Package com.uc4.communication.requests
Class ImportObject
- java.lang.Object
-
- com.uc4.communication.requests.XMLRequest
-
- com.uc4.communication.requests.ImportObject
-
public class ImportObject extends XMLRequest
Imports UC4 Objects.Keep in mind that the size of the XML file must not exceed 30000 KB. Values below this limit may also be defined in the UC4 Variable UC_SYSTEM_SETTINGS.
The importing and exporting functionality is not suitable for mass transports! Use the UC4 Transport Case instead for this purpose.
-
-
Constructor Summary
Constructors Modifier Constructor Description ImportObject(java.io.File exportFile, IFolder folder, boolean overwriteObject, boolean keepFolderLinks)
Creates a request to import UC4 Objects.ImportObject(java.nio.ByteBuffer byteBuffer, IFolder folder, boolean overwriteObject, boolean keepFolderLinks)
Creates a request to import UC4 Objects.protected
ImportObject(org.w3c.dom.Document doc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addImportedBinary(java.lang.String resname, java.nio.ByteBuffer buffer)
When importing via ByteBuffer, add additional files to this requestprotected void
createRequest(com.uc4.util.XMLDocument doc, org.w3c.dom.Element request, ConnectionAttributes sessionInfo)
Creates the XML Document for the request.org.w3c.dom.Document
exportDocument()
Returns an XML DOM which represents the exported object if this instance was created using theExportObject.getImportRequest()
method.java.lang.String
getImportMessages()
Returns import messages.java.util.Iterator<UploadBinary>
getResourceList()
protected java.lang.String
getSrc()
Returns the request source.protected void
handleContent(com.uc4.util.XMLDocument doc, ConnectionAttributes session)
Sub classes extract the values from the XML document and provide public getter methods.protected boolean
isAllowedInClientZero()
This method is used internally.-
Methods inherited from class com.uc4.communication.requests.XMLRequest
assertClientZero, assertServerVersion, checkClient, checkID, checkLnr, checkNull, checkSelStatisticsPrivilege, checkSystemOverviewPrivilege, checkUC4ObjectEmptyName, checkUC4ObjectName, createNATFor, createNATRequest, emptyAttributes, getAllMessageBoxes, getMessageBox, getRequestID, handleResponse, ignoreMessageBox, send, setMessageBox, showQuarantineNotification
-
-
-
-
Constructor Detail
-
ImportObject
public ImportObject(java.io.File exportFile, IFolder folder, boolean overwriteObject, boolean keepFolderLinks) throws org.xml.sax.SAXException, java.io.IOException
Creates a request to import UC4 Objects.- Parameters:
exportFile
- File (XML) containing the objectsfolder
- Folder in which the objects should be createdoverwriteObject
- If true an existing object with this name will be replacedkeepFolderLinks
- If true, existing folder links will be kept- Throws:
java.io.IOException
- In case of an I/O Errororg.xml.sax.SAXException
- In case of an invalid file content
-
ImportObject
public ImportObject(java.nio.ByteBuffer byteBuffer, IFolder folder, boolean overwriteObject, boolean keepFolderLinks) throws org.xml.sax.SAXException, java.io.IOException
Creates a request to import UC4 Objects.- Parameters:
byteBuffer
- ByteBuffer (XML) containing the objectsfolder
- Folder in which the objects should be createdoverwriteObject
- If true an existing object with this name will be replacedkeepFolderLinks
- If true, existing folder links will be kept- Throws:
java.io.IOException
- In case of an I/O Errororg.xml.sax.SAXException
- In case of an invalid file content
-
ImportObject
protected ImportObject(org.w3c.dom.Document doc)
-
-
Method Detail
-
createRequest
protected void createRequest(com.uc4.util.XMLDocument doc, org.w3c.dom.Element request, ConnectionAttributes sessionInfo)
Description copied from class:XMLRequest
Creates the XML Document for the request. This method is used internally.- Specified by:
createRequest
in classXMLRequest
- Parameters:
doc
- Document, used to create new Elementsrequest
- Request Element - classes append information to this request elementsessionInfo
- Information about the session
-
exportDocument
public org.w3c.dom.Document exportDocument()
Returns an XML DOM which represents the exported object if this instance was created using theExportObject.getImportRequest()
method.- Returns:
- document
-
handleContent
protected void handleContent(com.uc4.util.XMLDocument doc, ConnectionAttributes session)
Description copied from class:XMLRequest
Sub classes extract the values from the XML document and provide public getter methods.- Overrides:
handleContent
in classXMLRequest
- Parameters:
doc
- XML Documentsession
- Info about the user session
-
getImportMessages
public java.lang.String getImportMessages()
Returns import messages.- Returns:
- String containing import messages
-
isAllowedInClientZero
protected boolean isAllowedInClientZero()
Description copied from class:XMLRequest
This method is used internally. Tests if thisXMLRequest
is allowed in client 0. The default implementation returnsfalse
, subclasses may override.- Overrides:
isAllowedInClientZero
in classXMLRequest
- Returns:
true
if this request is allowed in client 0,false
otherwise
-
getSrc
protected java.lang.String getSrc()
Description copied from class:XMLRequest
Returns the request source. This method is used internally.- Specified by:
getSrc
in classXMLRequest
- Returns:
- Source
-
getResourceList
public java.util.Iterator<UploadBinary> getResourceList()
Returns anIterator
with items ofUploadBinary
objects after invoking theImportObject
instance. Use thisIterator
to additionally upload all related resource items of each STORE object containing within the import.- Returns:
- An
Iterator
containing all resource items of each imported STORE object.
-
addImportedBinary
public void addImportedBinary(java.lang.String resname, java.nio.ByteBuffer buffer)
When importing via ByteBuffer, add additional files to this request- Parameters:
resname
- Resource namebuffer
- Content
-
-