Packagemx.rpc.livecycle
Classpublic class DocumentReference
InheritanceDocumentReference Inheritance Object

DocumentReference provides the means of refering to documents on the server, from a Flex client. A DocumentReference should be used as an input parameter to any LiveCycle operation that expects a Document input parameter. A DocumentReference will also be returned as an output parameter for any LiveCycle operation that returns a parameter of type Document.

If the document is not yet on the server, use the LiveCycle Remoting upload servlet to get the document to the server and create a DocumentReference using the URL returned by the servlet.

View the examples



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  contentType : String
String code for content type of document.
DocumentReference
  fileRef : String
Populated when the reference type is FILE.
DocumentReference
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  referenceType : int
Reference Type - one of three supported types described above.
DocumentReference
  REF_TYPE_FILE : uint = 2
[static] Reference to a Document on the LiveCycle ES server via its directory location.
DocumentReference
  REF_TYPE_INLINE : uint = 3
[static] Document contents are not referred to, but are included with this object.
DocumentReference
  REF_TYPE_URL : uint = 1
[static] Reference to a Document via a URL to LC server provided by the LiveCycle ES DocumentManager.
DocumentReference
  url : String
Populated when the reference type is URL.
DocumentReference
  xml : String
Populated for an XML document when its contents are passed in-line.
DocumentReference
Public Methods
 MethodDefined By
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Property Detail
contentTypeproperty
public var contentType:String

String code for content type of document. For example, "text/xml".

fileRefproperty 
public var fileRef:String

Populated when the reference type is FILE.

REF_TYPE_FILEproperty 
public static var REF_TYPE_FILE:uint = 2

Reference to a Document on the LiveCycle ES server via its directory location.

REF_TYPE_INLINEproperty 
public static var REF_TYPE_INLINE:uint = 3

Document contents are not referred to, but are included with this object.

REF_TYPE_URLproperty 
public static var REF_TYPE_URL:uint = 1

Reference to a Document via a URL to LC server provided by the LiveCycle ES DocumentManager.

referenceTypeproperty 
public var referenceType:int

Reference Type - one of three supported types described above.

urlproperty 
public var url:String

Populated when the reference type is URL.

xmlproperty 
public var xml:String

Populated for an XML document when its contents are passed in-line.

Examples How to use examples
   private function startUpload():void
  {     
    fileRef.addEventListener(Event.SELECT, selectHandler);
    fileRef.addEventListener("uploadCompleteData", completeHandler);
    try 
    {
  var success:Boolean = fileRef.browse();
    } 
    catch (error:Error) 
    {
  trace("Unable to browse for files.");
    }
        }
         private function selectHandler(event:Event):void {
    var request:URLRequest = new URLRequest("http://SERVER:PORT/remoting/lcfileupload")
    try 
    {
        fileRef.upload(request);
    } 
    catch (error:Error) 
    {
  trace("Unable to upload file.");
    }
  }
       private function completeHandler(event:DataEvent):void 
  {
   
    var params:Object = new Object();
    var docRef:DocumentReference = new DocumentReference();
    docRef.url = event.data as String;
    docRef.referenceType = DocumentReference.REF_TYPE_URL;
  }
  

If the document is already on the server and its file location is known, set the referenceType field to REF_TYPE_FILE and the fileRef field to the location of the file on the server. For example:

  var docRef:DocumentReference = new DocumentReference();
     docRef.fileRef = "C:/temp/file1";
     docRef.referenceType=DocumentReference.REF_TYPE_FILE;
     

If the document is already on the server and its URL is known, set the referenceType field to URL and the url field to the REF_TYPE_URL. For example:

     var docRef:DocumentReference = new DocumentReference();
     docRef.url = "http://localhost:8080/DocumentManager/1168728809000/7855483216115920647";
     docRef.referenceType=DocumentReference.REF_TYPE_URL;
     

Flex clients will receive objects of type DocumentReference.as for LC operations that return Documents as output parameters. The DocumentReference object's referenceType will let the client know whether the content is in the DocumentReference object itself, DocumentReference.xml (the case for XML documents) or needs to be retrieved via a URL, DocumentReference.url. The DocumentReference.contentType field will let the client know the type of document.





 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/common/langref/mx/rpc/livecycle/DocumentReference.html