Packagecom.adobe.rtc.collaboration
Classpublic class FilePublisher
InheritanceFilePublisher Inheritance mx.core.UIComponent
ImplementsISessionSubscriber
SubclassesBinaryPublisher

FilePublisher is a foundation component for supporting file uploads as well as notification to other users that a file has been uploaded. It only supports one upload at a time. Additionally, it optionally plays an animation while an upload is in progress. It is normally invisible, but it becomes visible when an upload begins; on completion, it disappears again.

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

com.adobe.rtc.sharedManagers.FileManager
com.adobe.rtc.sharedManagers.descriptors.FileDescriptor
com.adobe.rtc.collaboration.FileSubscriber
com.adobe.rtc.pods.FileShare


Public Properties
 PropertyDefined 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
Public Methods
 MethodDefined 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
  
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
Events
 EventSummaryDefined 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
Public Constants
 ConstantDefined by
  INVALID_FILENAME_CHARS : String = "?/\<>*:",|%"
[static] The set of invalid characters in a file name.
FilePublisher
Property detail
accessModelproperty
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
connectSessionproperty 
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.

Implementation
    public function get connectSession():IConnectSession
    public function set connectSession(value:IConnectSession):void
groupNameproperty 
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.

Implementation
    public function get groupName():String
    public function set groupName(value:String):void
isSynchronizedproperty 
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
progressIntervalproperty 
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
publishModelproperty 
publishModel:int  [read-write]

The role required for this component to publish to the group specified by groupName.

Implementation
    public function get publishModel():int
    public function set publishModel(value:int):void
sharedIDproperty 
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.

Implementation
    public function get sharedID():String
    public function set sharedID(value:String):void
Constructor detail
FilePublisher()constructor
public function FilePublisher()

Constructor.

Method detail
amIUploadingFile()method
public function amIUploadingFile():Boolean

Specifies whether or not the current user is uploading a file.

Returns
Boolean
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.

Parameters
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

FileReference.browse()
cancelFileUpload()method 
public function cancelFileUpload():void

Cancels any current file upload if one is in progress.

close()method 
public function close():void

Disposes 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.

Parameters
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():NodeConfiguration

Gets the NodeConfiguration on the file group.

Returns
NodeConfiguration
getUserRole()method 
public function getUserRole(p_userID:String):int

Returns the role of a given user for files, within the group this component is assigned to.

Parameters
p_userID:String — The user ID of the user whose role we should get.

Returns
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.

Parameters
p_fileDesc:FileDescriptor — The FileDescriptor representing the file to be deleted.
setNodeConfiguration()method 
public function setNodeConfiguration(p_nodeConfiguration:NodeConfiguration):void

Sets the NodeConfiguration.

Parameters
p_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.

Parameters
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.

Parameters
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):void

Uploads 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.

Parameters
p_fileReference:FileReference — The file reference to upload.
 
p_uid:String
Event detail
completeevent 
Event object type: flash.events.Event

Dispatched on upload completion.

progressevent  
Event object type: flash.events.ProgressEvent

Dispatched on upload progress.

selectevent  
Event object type: flash.events.Event

Dispatched on file select for upload.

synchronizationChangeevent  
Event object type: 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.

Constant detail
INVALID_FILENAME_CHARSconstant
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