Packagecom.adobe.rtc.sharedManagers
Classpublic class FileManager
InheritanceFileManager Inheritance flash.events.EventDispatcher
ImplementsISessionSubscriber

One of the "4 pillars" of a room, the FileManager represents the shared model for files available for download for the client. It expresses a variety of methods for other components to access, modify, or publish specific files. FileManager uses FileDescriptors as control metadata to represent the available files; files themselves may be added, modified, and downloaded through FileSubscriber and FilePublisher.

The FileManager keeps files in "groups," with permissions settable on a per-group basis. Users with the owner role are able to add, modify, and delete these groups. By default, only users with a publisher role and higher may publish a file to a group, while those with role of viewer or higher are able to download.

Note: If you're listening to the NEW_FILE_DESCRIPTOR and UPDATE_FILE_DESCRIPTOR events, just because the Manager dispatches a NEW_FILE_DESCRIPTOR does not mean that the file is ready for download. On the contrary, the NEW_FILE_DESCRIPTOR is emitted when the file is ready to begin uploading, not after it's uploaded. Instead, listen to UPDATE_FILE_DESCRIPTOR, and check to see when the uploadProgress property of FileDescriptor equals 100.

Each IConnectSession handles creation/setup of its own FileManager instance. Use an IConnectSession's fileManager property to access it.

See also

com.adobe.rtc.sharedManagers.descriptors.FileDescriptor
com.adobe.rtc.collaboration.FilePublisher
com.adobe.rtc.collaboration.FileSubscriber
com.adobe.rtc.collaboration.BinaryPublisher
com.adobe.rtc.collaboration.BinarySubscriber
com.adobe.rtc.events.FileManagerEvent
com.adobe.rtc.session.IConnectSession


Public Properties
 PropertyDefined by
  amIUploadingFile : Boolean
Specifies whether the current user is currently uploading a file.
FileManager
  connectSession : IConnectSession
(Read Only) Specifies the IConnectSession to which this manager is assigned.
FileManager
  fileDescriptors : ArrayCollection
The set of all fileDescriptors in the room.
FileManager
  isSynchronized : Boolean
[read-only] Returns true if the model is synchronized.
FileManager
  maxFileSize : Number
[read-only] Specifies the maximum filesize allowed.
FileManager
Public Methods
 MethodDefined by
  
Constructor.
FileManager
  
canIUpload(p_groupName:String):Boolean
Indicates whether or not the local client has upload privileges on the chosen group.
FileManager
  
clearFileDescriptor(p_id:String):void
Clears a file descriptor by retracting the file in question and thereby making it unavailable for download.
FileManager
  
createGroup(p_groupName:String, p_nodeConfiguration:NodeConfiguration = null):void
Creates a new group for files with the specified name and nodeConfiguration.
FileManager
  
findGroupFor(p_id:String):String
Returns the group name of which the indicated descriptor is a member.
FileManager
  
Returns a specific file descriptor.
FileManager
  
getFileDescriptors(p_groupName:String):ArrayCollection
Returns the set of fileDescriptors in a specified group.
FileManager
  
getGroupNames():Array
Returns all the group names.
FileManager
  
Gets the NodeConfiguration of a node within a group.
FileManager
  
getUserRole(p_userID:String, p_groupName:String = null):int
Gets the role of the specified user for a particular group.
FileManager
  
isGroupDefined(p_groupName:String):Boolean
Returns whether or not a specified group exists.
FileManager
  
publishFileDescriptor(p_descriptor:FileDescriptor, p_associatedUserID:String = null):void
Announces to the service that a file will be uploaded for the first time by the local client or by somebody else.
FileManager
  
removeGroup(p_groupName:String):void
Removes a group if it does exist as well as the nodes associated with it.
FileManager
  
setNodeConfiguration(p_nodeConf:NodeConfiguration, p_groupName:String):void
Sets the NodeConfiguration of a node within a group.
FileManager
  
setUserRole(p_userID:String, p_role:int, p_groupName:String):void
Sets the specified user's role to the indicated role for the node.
FileManager
  
updateFileDescriptor(p_id:String, p_name:String = null, p_filename:String = null, p_url:String = null, p_type:String = null, p_size:int = -1, p_uploadProgress:Number = -1, p_state:String = null):void
Updates any field of a file descriptor except for its ID, submitterID, and lastModified.
FileManager
  
updateFilename(p_id:String, p_name:String, p_filename:String):void
Updates the name field in an existing file descriptor.
FileManager
  
updateSubmitterID(p_id:String, p_submitterID:String):void
Updates the submitter field in an existing file descriptor.
FileManager
  
updateUploadProgress(p_id:String, p_uploadProgress:Number):void
Updates the uploadProgress field in an existing file descriptor.
FileManager
Events
 EventSummaryDefined by
   Dispatched when a fileDescriptor is retracted from the service, and its corresponding file has been deleted.FileManager
   Dispatched when the my role with respect to a stream changes.FileManager
   Dispatched when a new fileDescriptor is sent to the service.FileManager
   Dispatched when a user's request to upload has been validated.FileManager
   Dispatched when the manager goes in and out of sync either on connect or disconnect.FileManager
   Dispatched when a fileDescriptor has been updated.FileManager
   Dispatched when the user's role with respect to a stream changes.FileManager
Public Constants
 ConstantDefined by
  COLLECTION_NAME : String = "FileManager"
[static] The name of the CollectionNode used to represent the FileManager's shared model.
FileManager
Property detail
amIUploadingFileproperty
amIUploadingFile:Boolean  [read-write]

Specifies whether the current user is currently uploading a file. Note that only one file may be uploaded at a time.

Implementation
    public function get amIUploadingFile():Boolean
    public function set amIUploadingFile(value:Boolean):void
connectSessionproperty 
connectSession:IConnectSession  [read-write]

(Read Only) Specifies the IConnectSession to which this manager is assigned.

Implementation
    public function get connectSession():IConnectSession
    public function set connectSession(value:IConnectSession):void
fileDescriptorsproperty 
public var fileDescriptors:ArrayCollection

The set of all fileDescriptors in the room.

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
maxFileSizeproperty 
maxFileSize:Number  [read-only]

Specifies the maximum filesize allowed.

Implementation
    public function get maxFileSize():Number
Constructor detail
FileManager()constructor
public function FileManager()

Constructor.

Method detail
canIUpload()method
public function canIUpload(p_groupName:String):Boolean

Indicates whether or not the local client has upload privileges on the chosen group.

Parameters
p_groupName:String

Returns
Boolean — True if we can, false if not.
clearFileDescriptor()method 
public function clearFileDescriptor(p_id:String):void

Clears a file descriptor by retracting the file in question and thereby making it unavailable for download.

Parameters
p_id:String — The ID of the file descriptor.
createGroup()method 
public function createGroup(p_groupName:String, p_nodeConfiguration:NodeConfiguration = null):void

Creates a new group for files with the specified name and nodeConfiguration.

Parameters
p_groupName:String — The name for the new group.
 
p_nodeConfiguration:NodeConfiguration (default = null) — The settings for the new group; most notably, accessModel and publishModel for rights.
findGroupFor()method 
public function findGroupFor(p_id:String):String

Returns the group name of which the indicated descriptor is a member.

Parameters
p_id:String — The ID of the descriptor to look up.

Returns
String — The name of the group of which the indicated descriptor is a member.
getFileDescriptor()method 
public function getFileDescriptor(p_id:String):FileDescriptor

Returns a specific file descriptor.

Parameters
p_id:String — The ID of the file descriptor.

Returns
FileDescriptor — The filedescriptor.
getFileDescriptors()method 
public function getFileDescriptors(p_groupName:String):ArrayCollection

Returns the set of fileDescriptors in a specified group.

Parameters
p_groupName:String — The name of the group to query.

Returns
ArrayCollection — An ArrayCollection of FileDescriptors.
getGroupNames()method 
public function getGroupNames():Array

Returns all the group names.

Returns
Array — An array of group names
getNodeConfiguration()method 
public function getNodeConfiguration(p_groupName:String):NodeConfiguration

Gets the NodeConfiguration of a node within a group.

Parameters
p_groupName:String — The group name for the node on which to get the node configuration. The default is null.

Returns
NodeConfiguration
getUserRole()method 
public function getUserRole(p_userID:String, p_groupName:String = null):int

Gets the role of the specified user for a particular group.

Parameters
p_userID:String — The specified user's userID.
 
p_groupName:String (default = null) — The group name for which to get the user role. The default is null.

Returns
int — int which is the user role value
isGroupDefined()method 
public function isGroupDefined(p_groupName:String):Boolean

Returns whether or not a specified group exists.

Parameters
p_groupName:String — The name of the group to query.

Returns
Boolean — True if the group exists; false if not.
publishFileDescriptor()method 
public function publishFileDescriptor(p_descriptor:FileDescriptor, p_associatedUserID:String = null):void

Announces to the service that a file will be uploaded for the first time by the local client or by somebody else. Only a host can request that someone else upload a file. To specify this, set p_associatedUserID to another user's userID.

Parameters
p_descriptor:FileDescriptor — The file descriptor to publish.
 
p_associatedUserID:String (default = null) — The ID of the intended uploader of the file.
removeGroup()method 
public function removeGroup(p_groupName:String):void

Removes a group if it does exist as well as the nodes associated with it.

Parameters
p_groupName:String — The group Name.
setNodeConfiguration()method 
public function setNodeConfiguration(p_nodeConf:NodeConfiguration, p_groupName:String):void

Sets the NodeConfiguration of a node within a group.

Parameters
p_nodeConf:NodeConfiguration — The group name for the node on which to set the node configuration. The default is null.
 
p_groupName:String
setUserRole()method 
public function setUserRole(p_userID:String, p_role:int, p_groupName:String):void

Sets the specified user's role to the indicated role for the node. Only users with an owner role may call this method.

Parameters
p_userID:String — The specified user's userID.
 
p_role:int — The role desired.
 
p_groupName:String — The group name for which the user role is being set. The default is null.
updateFileDescriptor()method 
public function updateFileDescriptor(p_id:String, p_name:String = null, p_filename:String = null, p_url:String = null, p_type:String = null, p_size:int = -1, p_uploadProgress:Number = -1, p_state:String = null):void

Updates any field of a file descriptor except for its ID, submitterID, and lastModified.

Parameters
p_id:String — The ID of the descriptor to change.
 
p_name:String (default = null) — The new name (if null, no change).
 
p_filename:String (default = null) — The new filename (if null, no change).
 
p_url:String (default = null) — The new URL (if null, no change)
 
p_type:String (default = null) — The new type (if null, no change)
 
p_size:int (default = -1) — The new size (-1, no change)
 
p_uploadProgress:Number (default = -1) — The new uploadProgress (if -1, no change)
 
p_state:String (default = null) — The new state (one of the constants defined on FileDescriptor. If null, no change)

See also

updateFilename()method 
public function updateFilename(p_id:String, p_name:String, p_filename:String):void

Updates the name field in an existing file descriptor.

Parameters
p_id:String — The ID of the file descriptor to change.
 
p_name:String — The new name.
 
p_filename:String — The new filename.
updateSubmitterID()method 
public function updateSubmitterID(p_id:String, p_submitterID:String):void

Updates the submitter field in an existing file descriptor. Only hosts can use this.

Parameters
p_id:String — The ID of the file descriptor to change.
 
p_submitterID:String — The new submitter's ID.
updateUploadProgress()method 
public function updateUploadProgress(p_id:String, p_uploadProgress:Number):void

Updates the uploadProgress field in an existing file descriptor.

Parameters
p_id:String — The ID of the file descriptor to change.
 
p_uploadProgress:Number — The new upload progress percentage.
Event detail
clearedFileDescriptorevent 
Event object type: com.adobe.rtc.events.FileManagerEvent

Dispatched when a fileDescriptor is retracted from the service, and its corresponding file has been deleted.

myRoleChangeevent  
Event object type: com.adobe.rtc.events.CollectionNodeEvent

Dispatched when the my role with respect to a stream changes.

newFileDescriptorevent  
Event object type: com.adobe.rtc.events.FileManagerEvent

Dispatched when a new fileDescriptor is sent to the service. Note that this doesn't indicate that a file has been uploaded but rather that a user has begun uploading a file.

readyForUploadevent  
Event object type: com.adobe.rtc.events.FileManagerEvent

Dispatched when a user's request to upload has been validated.

synchronizationChangeevent  
Event object type: com.adobe.rtc.events.CollectionNodeEvent

Dispatched when the manager goes in and out of sync either on connect or disconnect.

updatedFileDescriptorevent  
Event object type: com.adobe.rtc.events.FileManagerEvent

Dispatched when a fileDescriptor has been updated. This may mean any of the properties on the FileDescriptor has changed. If the uploadProgress is 100, the file is ready for download.

userRoleChangeevent  
Event object type: com.adobe.rtc.events.CollectionNodeEvent

Dispatched when the user's role with respect to a stream changes.

Constant detail
COLLECTION_NAMEconstant
public static const COLLECTION_NAME:String = "FileManager"

The name of the CollectionNode used to represent the FileManager's shared model.





 

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/sharedManagers/FileManager.html