Packagecom.adobe.rtc.collaboration
Classpublic class BinaryPublisher
InheritanceBinaryPublisher Inheritance FilePublisher Inheritance mx.core.UIComponent

BinaryPublisher is a specialized FilePublisher used in submitting ByteArray data via HTTP for file-sharing. It employs a very simple API: developers can specify a group to which to publish, then use publish() to submit a ByteArray of file data, and notify other users of the presence of the new file. Users on the receiving end can use the FileManager APIs to detect the presence of new files on the service, and use either the FileSubscriber or BinarySubscriber to download its contents either as a complete file or as file data.

See also

com.adobe.rtc.sharedManagers.FileManager
com.adobe.rtc.sharedManagers.descriptors.FileDescriptor
com.adobe.rtc.collaboration.BinarySubscriber
com.adobe.rtc.collaboration.FileSubscriber


Public Properties
 PropertyDefined by
 InheritedaccessModel : int
The role value required for accessing files, for the group this component is assigned to
FilePublisher
 InheritedconnectSession : IConnectSession
The IConnectSession with which this component is associated; it defaults to the first IConnectSession created in the application.
FilePublisher
 InheritedgroupName : 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
 InheritedisSynchronized : Boolean
Returns true if the model is synchronized
FilePublisher
 InheritedprogressInterval : Number
The FilePublisher can send updates to other clients during an upload so that they know how much a user has uploaded.
FilePublisher
 InheritedpublishModel : int
The role required for this component to publish to the group specified by groupName.
FilePublisher
 InheritedsharedID : 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
 Inherited
amIUploadingFile():Boolean
Specifies whether or not the current user is uploading a file.
FilePublisher
 Inherited
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.
BinaryPublisher
 Inherited
close():void
Disposes all listeners to the network and framework classes.
FilePublisher
 Inherited
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
 Inherited
Gets the NodeConfiguration on the file group.
FilePublisher
 Inherited
getUserRole(p_userID:String):int
Returns the role of a given user for files, within the group this component is assigned to.
FilePublisher
  
publish(p_fileName:String, p_fileData:ByteArray, p_itemID:String = null, p_contentType:String = "application/octet-stream"):void
publish() takes a file name, ByteArray-formatted file data, a uniqueID, and an optional content-type parameter, and publishes the given data via HTTP to the service.
BinaryPublisher
 Inherited
remove(p_fileDesc:FileDescriptor):void
Removes the file specified by the fileDescriptor.
FilePublisher
 Inherited
setNodeConfiguration(p_nodeConfiguration:NodeConfiguration):void
Sets the NodeConfiguration.
FilePublisher
 Inherited
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
 Inherited
subscribe():void
Tells the component to begin synchronizing with the service.
FilePublisher
 Inherited
updateFilename(p_fileDesc:FileDescriptor, p_newName:String):void
Updates the file name of the file specified by the fileDescriptor with a new name.
FilePublisher
 Inherited
uploadFileReference(p_fileReference:FileReference, p_uid:String):void
Uploads the FileReference passed in.
FilePublisher
Events
 EventSummaryDefined by
   Dispatched on an upload completion.BinaryPublisher
 Inherited Dispatched on upload completion.FilePublisher
   Dispatched on an HTTP status change.BinaryPublisher
 Inherited Dispatched on upload progress.FilePublisher
 Inherited Dispatched on file select for upload.FilePublisher
 Inherited 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
 InheritedINVALID_FILENAME_CHARS : String = "?/\<>*:",|%"
[static] The set of invalid characters in a file name.
FilePublisher
Method detail
cancelFileUpload()method
public override function cancelFileUpload():void

Cancels any current file upload if one is in progress.

publish()method 
public function publish(p_fileName:String, p_fileData:ByteArray, p_itemID:String = null, p_contentType:String = "application/octet-stream"):void

publish() takes a file name, ByteArray-formatted file data, a uniqueID, and an optional content-type parameter, and publishes the given data via HTTP to the service. Subscribed clients will receive a updatedFileDescriptor event from the FileManager to indicate progress of the upload.

Parameters
p_fileName:String — The name for the new file, including the extension.
 
p_fileData:ByteArray — A ByteArray of data to publish as a file to the service.
 
p_itemID:String (default = null) — A uniqueID to give the file.
 
p_contentType:String (default = "application/octet-stream") — Optionally, the MIME content-type of the data; it defaults to "application/octet-stream".
Event detail
completeevent 
Event object type: flash.events.Event

Dispatched on an upload completion.

httpStatusevent  
Event object type: flash.events.HTTPStatusEvent

Dispatched on an HTTP status change.





 

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/BinaryPublisher.html