| Package | com.adobe.rtc.collaboration |
| Class | public class FilePublisher |
| Inheritance | FilePublisher mx.core.UIComponent |
| Implements | ISessionSubscriber |
| Subclasses | BinaryPublisher |
Files are organized logically in AFCS as groups in the FileManager, which allows the developer to assign permissions and roles on a group-by-group basis. FilePublisher acts as an easy to use proxy for the FileManager in creating and uploading files to groups. FilePublisher is intended as a low-level component; for a higher level component with a user interface which supports uploading, listing, and downloading files, see com.adobe.rtc.pods.FileShare.
By default, a user must have a role higher than UserRoles.PUBLISHER to
upload a file, and use UserRoles.VIEWER to receive one.
See also
| Property | Defined by | ||
|---|---|---|---|
| accessModel : int
The role value required for accessing files, for the group this component is assigned to
| FilePublisher | ||
| connectSession : IConnectSession
The IConnectSession with which this component is associated; it defaults to the first
IConnectSession created in the application.
| FilePublisher | ||
| groupName : String
Components (pods) are assigned to a group via
groupName; if not specified,
the component is assigned to the default, public group (the room at large). | FilePublisher | ||
| isSynchronized : Boolean [read-only]
Returns true if the model is synchronized
| FilePublisher | ||
| progressInterval : Number
The FilePublisher can send updates to other clients during an upload so that they know how much a user has
uploaded.
| FilePublisher | ||
| publishModel : int
The role required for this component to publish to the group specified by
groupName. | FilePublisher | ||
| sharedID : String
Defines the logical location of the component on the service; typically this assigns the
sharedID of the collectionNode
used by the component. | FilePublisher | ||
| Method | Defined by | ||
|---|---|---|---|
|
Constructor.
| FilePublisher | ||
|
amIUploadingFile():Boolean
Specifies whether or not the current user is uploading a file.
| FilePublisher | ||
|
browse(p_itemID:String, p_typeFilter:Array = null):void
browse() begins the process of preparing for upload by prompting the user to
select a file. | FilePublisher | ||
|
cancelFileUpload():void
Cancels any current file upload if one is in progress.
| FilePublisher | ||
|
close():void
Disposes all listeners to the network and framework classes.
| FilePublisher | ||
|
createAndUseGroup(p_groupName:String, p_nodeConfiguration:NodeConfiguration = null):void
Creates a new group of files within the FileManager with the specified name and optionally configures
its permissions.
| FilePublisher | ||
|
Gets the NodeConfiguration on the file group.
| FilePublisher | ||
|
getUserRole(p_userID:String):int
Returns the role of a given user for files, within the group this component is assigned to.
| FilePublisher | ||
|
remove(p_fileDesc:FileDescriptor):void
Removes the file specified by the
fileDescriptor. | FilePublisher | ||
|
setNodeConfiguration(p_nodeConfiguration:NodeConfiguration):void
Sets the NodeConfiguration.
| FilePublisher | ||
|
setUserRole(p_userID:String, p_userRole:int):void
Sets the role of a given user for publishing and subscribing to this component's group
specified by
groupName. | FilePublisher | ||
|
subscribe():void
Tells the component to begin synchronizing with the service.
| FilePublisher | ||
|
updateFilename(p_fileDesc:FileDescriptor, p_newName:String):void
Updates the file name of the file specified by the
fileDescriptor with a new name. | FilePublisher | ||
|
uploadFileReference(p_fileReference:FileReference, p_uid:String):void
Uploads the FileReference passed in.
| FilePublisher | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Dispatched on upload completion. | FilePublisher | |||
| Dispatched on upload progress. | FilePublisher | |||
| Dispatched on file select for upload. | FilePublisher | |||
| Dispatched when the component either loses its connection to the session or regains it and has finished re-synchronizing itself to the rest of the room. | FilePublisher | |||
| Constant | Defined by | ||
|---|---|---|---|
| INVALID_FILENAME_CHARS : String = "?/\<>*:",|%" [static]
The set of invalid characters in a file name.
| FilePublisher | ||
| accessModel | property |
accessModel:int [read-write]The role value required for accessing files, for the group this component is assigned to
Implementation public function get accessModel():int
public function set accessModel(value:int):void
| connectSession | property |
connectSession:IConnectSession [read-write]
The IConnectSession with which this component is associated; it defaults to the first
IConnectSession created in the application. Note that this may only be set once before
subscribe() is called, and re-sessioning of components is not supported.
public function get connectSession():IConnectSession
public function set connectSession(value:IConnectSession):void
| groupName | property |
groupName:String [read-write]
Components (pods) are assigned to a group via groupName; if not specified,
the component is assigned to the default, public group (the room at large). Groups are like separate
conversations within the room, but each conversation could employ one or more pods; for example, one
"conversation" may use a web camera, chat, and whiteboard pod, with each pod using different access
and publish models. Users are members of and can only see components within the group they are assigned.
Room hosts can see all the groups and all the members in those groups.
public function get groupName():String
public function set groupName(value:String):void
| isSynchronized | property |
isSynchronized:Boolean [read-only]Returns true if the model is synchronized
This property can be used as the source for data binding.
Implementation public function get isSynchronized():Boolean
| progressInterval | property |
progressInterval:Number [read-write]The FilePublisher can send updates to other clients during an upload so that they know how much a user has uploaded. By default, these messages are sent every 3000 milliseconds. Set it to 0 if you don't want to send any updates at all. In that case, the only two announcements will be "The user is going to upload a file" and "The file is done uploading."
Implementation public function get progressInterval():Number
public function set progressInterval(value:Number):void
| publishModel | property |
publishModel:int [read-write]
The role required for this component to publish to the group specified by groupName.
public function get publishModel():int
public function set publishModel(value:int):void
| sharedID | property |
sharedID:String [read-write]
Defines the logical location of the component on the service; typically this assigns the sharedID of the collectionNode
used by the component. sharedIDs should be unique within a room if they're expressing two
unique locations. Note that this can only be assigned once before subscribe() is called. For components
with an id property, sharedID defaults to that value.
public function get sharedID():String
public function set sharedID(value:String):void
| FilePublisher | () | constructor |
public function FilePublisher()Constructor.
| amIUploadingFile | () | method |
public function amIUploadingFile():BooleanSpecifies whether or not the current user is uploading a file.
ReturnsBoolean |
| browse | () | method |
public function browse(p_itemID:String, p_typeFilter:Array = null):void
browse() begins the process of preparing for upload by prompting the user to
select a file. If accepted by the FileManager, it will fire a
FileManagerEvent.READY_FOR_UPLOAD. The type filter works the
same way as in FileReference.browse(). For more information, see
browse() in the ActionScript 3.0 documentation: flash.net.filereference.
p_itemID:String — A unique identifier based on ActionScript's pseudo-random
number generator and the current time. This ID is used to identify the file that
will be uploaded to the room.
|
|
p_typeFilter:Array (default = null) — An array of FileFilter instances used to filter the files that
are displayed in the dialog box. The default is null and all files are displayed.
|
See also
| cancelFileUpload | () | method |
public function cancelFileUpload():voidCancels any current file upload if one is in progress.
| close | () | method |
public function close():voidDisposes all listeners to the network and framework classes. Recommended for proper garbage collection of the component.
| createAndUseGroup | () | method |
public function createAndUseGroup(p_groupName:String, p_nodeConfiguration:NodeConfiguration = null):void
Creates a new group of files within the FileManager with the specified name and optionally configures
its permissions. It also specifies the groupName to use for any subsequent uploads from
the publisher. Note that the user must have role of UserRoles.OWNER in order to add a new
group of files.
p_groupName:String — The name of the new group.
|
|
p_nodeConfiguration:NodeConfiguration (default = null) — The configuration for the new group (including
accessModel and publishModel).
|
| getNodeConfiguration | () | method |
public function getNodeConfiguration():NodeConfigurationGets the NodeConfiguration on the file group.
ReturnsNodeConfiguration |
| getUserRole | () | method |
public function getUserRole(p_userID:String):intReturns the role of a given user for files, within the group this component is assigned to.
Parametersp_userID:String — The user ID of the user whose role we should get.
|
int |
| remove | () | method |
public function remove(p_fileDesc:FileDescriptor):void
Removes the file specified by the fileDescriptor. This will notify room
participants of the file's removal and delete the file from the service.
p_fileDesc:FileDescriptor — The FileDescriptor representing the file to be deleted.
|
| setNodeConfiguration | () | method |
public function setNodeConfiguration(p_nodeConfiguration:NodeConfiguration):voidSets the NodeConfiguration.
Parametersp_nodeConfiguration:NodeConfiguration — The node Configuration of the file group
|
| setUserRole | () | method |
public function setUserRole(p_userID:String, p_userRole:int):void
Sets the role of a given user for publishing and subscribing to this component's group
specified by groupName.
p_userID:String — The user ID of the user whose role should be set.
|
|
p_userRole:int — The role value to assign to the user with this user ID.
|
| subscribe | () | method |
public function subscribe():void
Tells the component to begin synchronizing with the service. For UIComponent-based components such as this one,
this is called automatically upon being added to the displayList.
For "headless" components, this method must be called explicitly.
| updateFilename | () | method |
public function updateFilename(p_fileDesc:FileDescriptor, p_newName:String):void
Updates the file name of the file specified by the fileDescriptor with a new name.
p_fileDesc:FileDescriptor — The FileDescriptor representing the file to be deleted.
|
|
p_newName:String — The new name to use for the file.
|
| uploadFileReference | () | method |
public function uploadFileReference(p_fileReference:FileReference, p_uid:String):voidUploads the FileReference passed in. This also submits a notification to the FileManager that the user intends to initiate and upload. If the notification is validated, the upload begins and others in the room are notified.
Parametersp_fileReference:FileReference — The file reference to upload.
|
|
p_uid:String |
| complete | event |
| progress | event |
| select | event |
| synchronizationChange | event |
com.adobe.rtc.events.CollectionNodeEvent
Dispatched when the component either loses its connection to the session or regains it and has finished re-synchronizing itself to the rest of the room.
| INVALID_FILENAME_CHARS | constant |
public static const INVALID_FILENAME_CHARS:String = "?/\<>*:",|%"The set of invalid characters in a file name.
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/labs/acrobatcom/com/adobe/rtc/collaboration/FilePublisher.html