Pacote | mx.rpc.livecycle |
Classe | public class DocumentReference |
Herança | DocumentReference Object |
Versão da linguagem: | ActionScript 3.0 |
Versão de produto: | Adobe Digital Enterprise Platform Data Services for Java EE 3 |
Versões de runtime: | Flash Player 9, AIR 1.1 |
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.
import flash.events.DataEvent; import flash.net.FileReference; private function startUpload():void { fileRef.addEventListener(Event.SELECT, selectHandler); fileRef.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, 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; }
You can also use FileReferenceList to upload multiple documents together. For example:
import flash.events.DataEvent; import flash.net.FileReference; import flash.net.FileReferenceList; private function startUpload():void { pendingFiles = new Array(); documents = new Array(); fileRefList.addEventListener(Event.SELECT, selectHandler); try { var success:Boolean = fileRefList.browse(); } catch (error:Error) { trace("Unable to browse for files."); } } private function selectHandler(event:Event):void { var file:FileReference; for (var i:uint = 0; i < fileRefList.fileList.length; i++) { file = FileReference(fileRefList.fileList[i]); try { addPendingFile(file); } catch (error:Error) { Alert.show("Unable to upload file."); } } } private function addPendingFile(file:FileReference):void { trace("addPendingFile: name=" + file.name); var request:URLRequest = new URLRequest("http://10.60.147.127:8080/remoting/lcfileupload"); pendingFiles.push(file); file.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, completeHandler); file.upload(request); } private function removePendingFile(file:FileReference):void { for (var i:uint; i < pendingFiles.length; i++) { if (pendingFiles[i].name == file.name) { pendingFiles.splice(i, 1); } } } 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; documents.push(docRef); var file:FileReference = FileReference(event.target); removePendingFile(file); if (pendingFiles.length == 0) { // invoke a serivce that takes a collection of documents as an argument here // using the "documents" array ...
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;
You can also create a Document from a piece of text on the client. On the server this string will be first converted into a Byte array and then into a server side Document. By default, the server's default character set will be used for the conversion into a Byte array. If it is desired that another character set be used, it may be specified via the charsetName property of this object. For example:
var docRef:DocumentReference = new DocumentReference(); docRef.referenceType = DocumentReference.REF_TYPE_INLINE; docRef.text = "Text for my document"; // to override server's default character set uncomment and set character set name // docRef.charsetName = "<name of your charset>";
Finally, you can create a Document from binary data available on the client. This binary data will be turned in to a server side Document. This can be used when you have small amounts of data instead of uploading the content to the server and using a URL. If you set the contentType on the reference it will be set on the document if the server side code does not figure it out on its own. For example:
var image:ByteArray = ... var docRef:DocumentReference = new DocumentReference(); docRef.referenceType = DocumentReference.REF_TYPE_INLINE; docRef.bytes = image; docRef.contentType = "image/jpg";
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.
Propriedade | Definido por | ||
---|---|---|---|
bytes : ByteArray
The client should set this field if the DocumentReference is created from binary content
available on the client. | DocumentReference | ||
charsetName : String
If the REF_TYPE_INLINE option is being used to create a DocumentReference and the text field
of this object has been set, this field may be set to determine the character set
used on the server to convert the passed-in text string into a byte array. | DocumentReference | ||
constructor : Object
Uma referência ao objeto de classe ou à função de construtor de uma determinada ocorrência de objeto. | Object | ||
contentType : String
String code for content type of document. | DocumentReference | ||
fileRef : String
Populated when the reference type is FILE. | DocumentReference | ||
referenceType : int
Reference Type - either REF_TYPE_URL,
REF_TYPE_FILE, or REF_TYPE_INLINE. | DocumentReference | ||
text : String
The client should set this field if the DocumentReference is created from a text
string available on the client. | DocumentReference | ||
url : String
Populated when the reference type is URL. | DocumentReference | ||
xml : String
Populated for an XML document whose contents are passed in-line. | DocumentReference |
Método | Definido por | ||
---|---|---|---|
[estático]
Constructs a request to be used when uploading a document
for the purposes of Remoting. | DocumentReference | ||
Return the value of the specified attribute. | DocumentReference | ||
Indica se um objeto tem uma propriedade especificada definida. | Object | ||
Indica se uma ocorrência da classe Object está na cadeia de protótipos do objeto especificado como o parâmetro. | Object | ||
Returns a list of attribute names for the DocumentReference. | DocumentReference | ||
Indica se a propriedade especificada existe e é enumerável. | Object | ||
Remove the attribute from the attribute list. | DocumentReference | ||
Add an attribute to the list of attributes for the Document. | DocumentReference | ||
Define a disponibilidade de uma propriedade dinâmica para operações de repetição. | Object | ||
Retorna a representação da string deste objeto, formatado segundo as convenções específicas para a localidade. | Object | ||
Retorna a representação de string do objeto especificado. | Object | ||
Retorna o valor primitivo do objeto especificado. | Object |
Constante | Definido por | ||
---|---|---|---|
REF_TYPE_FILE : uint = 2 [estático]
Reference to a Document on the LC server via its directory location. | DocumentReference | ||
REF_TYPE_INLINE : uint = 3 [estático]
Document contents are not referred to, but are included with this object. | DocumentReference | ||
REF_TYPE_URL : uint = 1 [estático]
Reference to a Document via a URL to LC server provided by
LC DocumentManager. | DocumentReference |
bytes | propriedade |
public var bytes:ByteArray
Versão da linguagem: | ActionScript 3.0 |
Versão de produto: | Adobe Digital Enterprise Platform Data Services for Java EE 3 |
Versões de runtime: | Flash Player 9, AIR 1.1 |
The client should set this field if the DocumentReference is created from binary content available on the client. The referenceType should be set to REF_TYPE_INLINE in this case.
charsetName | propriedade |
public var charsetName:String
Versão da linguagem: | ActionScript 3.0 |
Versão de produto: | Adobe Digital Enterprise Platform Data Services for Java EE 3 |
Versões de runtime: | Flash Player 9, AIR 1.1 |
If the REF_TYPE_INLINE option is being used to create a DocumentReference and the text field of this object has been set, this field may be set to determine the character set used on the server to convert the passed-in text string into a byte array. If this field is left unset, the server's default character set is used.
contentType | propriedade |
public var contentType:String
Versão da linguagem: | ActionScript 3.0 |
Versão de produto: | Adobe Digital Enterprise Platform Data Services for Java EE 3 |
Versões de runtime: | Flash Player 9, AIR 1.1 |
String code for content type of document. For example, "text/xml".
fileRef | propriedade |
public var fileRef:String
Versão da linguagem: | ActionScript 3.0 |
Versão de produto: | Adobe Digital Enterprise Platform Data Services for Java EE 3 |
Versões de runtime: | Flash Player 9, AIR 1.1 |
Populated when the reference type is FILE.
referenceType | propriedade |
public var referenceType:int
Versão da linguagem: | ActionScript 3.0 |
Versão de produto: | Adobe Digital Enterprise Platform Data Services for Java EE 3 |
Versões de runtime: | Flash Player 9, AIR 1.1 |
Reference Type - either REF_TYPE_URL
,
REF_TYPE_FILE
, or REF_TYPE_INLINE
.
text | propriedade |
public var text:String
Versão da linguagem: | ActionScript 3.0 |
Versão de produto: | Adobe Digital Enterprise Platform Data Services for Java EE 3 |
Versões de runtime: | Flash Player 9, AIR 1.1 |
The client should set this field if the DocumentReference is created from a text string available on the client. The referenceType should be set to REF_TYPE_INLINE in this case.
url | propriedade |
public var url:String
Versão da linguagem: | ActionScript 3.0 |
Versão de produto: | Adobe Digital Enterprise Platform Data Services for Java EE 3 |
Versões de runtime: | Flash Player 9, AIR 1.1 |
Populated when the reference type is URL.
xml | propriedade |
public var xml:String
Versão da linguagem: | ActionScript 3.0 |
Versão de produto: | Adobe Digital Enterprise Platform Data Services for Java EE 3 |
Versões de runtime: | Flash Player 9, AIR 1.1 |
Populated for an XML document whose contents are passed in-line.
constructRequestForUpload | () | método |
public static function constructRequestForUpload(serverURL:String, authToken:String):URLRequest
Versão da linguagem: | ActionScript 3.0 |
Versão de produto: | Adobe Digital Enterprise Platform Data Services for Java EE 3 |
Versões de runtime: | Flash Player 9, AIR 1.1 |
Constructs a request to be used when uploading a document
for the purposes of Remoting. The returned request is to be
used in conjunction with flash.net.FileReference
.
It should be passed in as the argument to the upload
function.
Parâmetros
serverURL:String — the URL of the server to which you are uploading a
document. For example, "http://localhost:8080" or "https://localhost:8443".
| |
authToken:String — the file upload authentication token as returned by a
call to getFileUploadToken of the LC.FileUploadAuthenticator RemoteObject
destination. An authenticated request must have been made to the server,
or single sign-on used, before a file upload is attempted.
|
URLRequest — a request to be used when uploading a document
for the purposes of Remoting.
|
getAttribute | () | método |
public function getAttribute(name:String):Object
Versão da linguagem: | ActionScript 3.0 |
Versão de produto: | Adobe Digital Enterprise Platform Data Services for Java EE 3 |
Versões de runtime: | Flash Player 9, AIR 1.1 |
Return the value of the specified attribute.
Parâmetros
name:String — The name of the attribute.
|
Object |
listAttributes | () | método |
public function listAttributes():Array
Versão da linguagem: | ActionScript 3.0 |
Versão de produto: | Adobe Digital Enterprise Platform Data Services for Java EE 3 |
Versões de runtime: | Flash Player 9, AIR 1.1 |
Returns a list of attribute names for the DocumentReference.
RetornaArray — A list of attribute names for the DocumentReference.
|
removeAttribute | () | método |
public function removeAttribute(name:String):void
Versão da linguagem: | ActionScript 3.0 |
Versão de produto: | Adobe Digital Enterprise Platform Data Services for Java EE 3 |
Versões de runtime: | Flash Player 9, AIR 1.1 |
Remove the attribute from the attribute list.
Parâmetros
name:String — The attribute name.
|
setAttribute | () | método |
public function setAttribute(name:String, value:Object):void
Versão da linguagem: | ActionScript 3.0 |
Versão de produto: | Adobe Digital Enterprise Platform Data Services for Java EE 3 |
Versões de runtime: | Flash Player 9, AIR 1.1 |
Add an attribute to the list of attributes for the Document.
Parâmetros
name:String — The name of the attribute.
| |
value:Object — The value of the attribute.
|
REF_TYPE_FILE | Constante |
public static const REF_TYPE_FILE:uint = 2
Versão da linguagem: | ActionScript 3.0 |
Versão de produto: | Adobe Digital Enterprise Platform Data Services for Java EE 3 |
Versões de runtime: | Flash Player 9, AIR 1.1 |
Reference to a Document on the LC server via its directory location.
REF_TYPE_INLINE | Constante |
public static const REF_TYPE_INLINE:uint = 3
Versão da linguagem: | ActionScript 3.0 |
Versão de produto: | Adobe Digital Enterprise Platform Data Services for Java EE 3 |
Versões de runtime: | Flash Player 9, AIR 1.1 |
Document contents are not referred to, but are included with this object.
REF_TYPE_URL | Constante |
public static const REF_TYPE_URL:uint = 1
Versão da linguagem: | ActionScript 3.0 |
Versão de produto: | Adobe Digital Enterprise Platform Data Services for Java EE 3 |
Versões de runtime: | Flash Player 9, AIR 1.1 |
Reference to a Document via a URL to LC server provided by LC DocumentManager.
Wed Jun 13 2018, 11:10 AM Z