Package com.uc4.communication.requests
Class ImportObject
java.lang.Object
com.uc4.communication.requests.XMLRequest
com.uc4.communication.requests.ImportObject
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
ConstructorsModifierConstructorDescriptionImportObject(File exportFile, IFolder folder, boolean overwriteObject, boolean keepFolderLinks) Creates a request to import UC4 Objects.ImportObject(ByteBuffer byteBuffer, IFolder folder, boolean overwriteObject, boolean keepFolderLinks) Creates a request to import UC4 Objects.protectedImportObject(Document doc) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddImportedBinary(String resname, ByteBuffer buffer) When importing via ByteBuffer, add additional files to this requestprotected voidcreateRequest(com.uc4.util.XMLDocument doc, Element request, ConnectionAttributes sessionInfo) Creates the XML Document for the request.Returns an XML DOM which represents the exported object if this instance was created using theExportObject.getImportRequest()method.Returns import messages.protected StringgetSrc()Returns the request source.protected voidhandleContent(com.uc4.util.XMLDocument doc, ConnectionAttributes session) Sub classes extract the values from the XML document and provide public getter methods.protected booleanThis 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 Details
-
ImportObject
public ImportObject(File exportFile, IFolder folder, boolean overwriteObject, boolean keepFolderLinks) throws SAXException, 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:
IOException- In case of an I/O ErrorSAXException- In case of an invalid file content
-
ImportObject
public ImportObject(ByteBuffer byteBuffer, IFolder folder, boolean overwriteObject, boolean keepFolderLinks) throws SAXException, 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:
IOException- In case of an I/O ErrorSAXException- In case of an invalid file content
-
ImportObject
-
-
Method Details
-
createRequest
protected void createRequest(com.uc4.util.XMLDocument doc, Element request, ConnectionAttributes sessionInfo) Description copied from class:XMLRequestCreates the XML Document for the request. This method is used internally.- Specified by:
createRequestin classXMLRequest- Parameters:
doc- Document, used to create new Elementsrequest- Request Element - classes append information to this request elementsessionInfo- Information about the session
-
exportDocument
Returns an XML DOM which represents the exported object if this instance was created using theExportObject.getImportRequest()method.- Returns:
- document
-
handleContent
Description copied from class:XMLRequestSub classes extract the values from the XML document and provide public getter methods.- Overrides:
handleContentin classXMLRequest- Parameters:
doc- XML Documentsession- Info about the user session
-
getImportMessages
Returns import messages.- Returns:
- String containing import messages
-
isAllowedInClientZero
protected boolean isAllowedInClientZero()Description copied from class:XMLRequestThis method is used internally. Tests if thisXMLRequestis allowed in client 0. The default implementation returnsfalse, subclasses may override.- Overrides:
isAllowedInClientZeroin classXMLRequest- Returns:
trueif this request is allowed in client 0,falseotherwise
-
getSrc
Description copied from class:XMLRequestReturns the request source. This method is used internally.- Specified by:
getSrcin classXMLRequest- Returns:
- Source
-
getResourceList
Returns anIteratorwith items ofUploadBinaryobjects after invoking theImportObjectinstance. Use thisIteratorto additionally upload all related resource items of each STORE object containing within the import.- Returns:
- An
Iteratorcontaining all resource items of each imported STORE object.
-
addImportedBinary
When importing via ByteBuffer, add additional files to this request- Parameters:
resname- Resource namebuffer- Content
-