Class BaseArchiveService
java.lang.Object
com.avoka.fc.core.service.BaseService
com.avoka.fc.core.service.CayenneService
com.avoka.fc.core.service.archive.BaseArchiveService
- Direct Known Subclasses:
ApplicationPackageArchiveService
,ClientArchiveService
,ConfigurationServiceArchiveService
,FormVersionArchiveService
,GroupArchiveService
,LibraryArchiveService
,MetadataTagArchiveService
,PortalArchiveService
,RoleArchiveService
,SecurityManagerArchiveService
,ServiceArchiveService
,ServiceConnectionArchiveService
,TPacArchiveService
Provides the base class for the set of archive services. Each service is responsible for exporting and importing a set of SFM entities (e.g. client or form and template versions).
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
static final String
The encoding that will be used when storing the XML files contained in the archiveprotected static final String
protected static final String
protected static final String
protected boolean
static final String
The name of the metadata value storing the TM environment namestatic final String
The name of the metadata value storing the TM environment type (relevant if the value is "maestro")static final String
The Maestro environment type (used to drive some defaults)static final String
The name of the metadata value storing the date the export archive was createdstatic final String
The name of the metadata value storing the SFM database versionstatic final String
The name of the metadata value storing the SFM build numberstatic final String
The name of the metadata value storing the SFM versionstatic final String
The name of the metadata value storing a string constant describing what will happen on import of this archivestatic final String
Indicates that the entity cannot be imported due to a conflict with existing entitiesstatic final String
Indicates that the entity being imported does not exist and will be createdstatic final String
Indicates that the entity cannot be imported due to an errorstatic final String
The name of the metadata value storing a message describing the action that will happen on import of this archivestatic final String
Indicates that the entity being imported already exists and will be updatedstatic final String
Indicates a warning about scripts containing java EE codestatic final int
The 5.1 db version where the authentication scope was moved to the portals.protected static final String
The old service type for credit card payment services (obsolete)static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addDeploymentSchedule
(Form form, Element parentElement) protected void
addForm
(ZipOutputStream zos, Form form, TemplateVersion version, Element parentElement) protected void
addFormFunctions
(TemplateVersion version, ZipOutputStream zos, Element parentElement) protected void
addFormGroups
(Form form, Element parentElement) protected void
addFormPortals
(Form form, Element parentElement) protected void
addParameterPrefillMaps
(SchemaSeed schemaSeed, ZipOutputStream zos, Element parentElement) protected void
addPropertyPrefillMaps
(Form form, SchemaSeed schemaSeed, ZipOutputStream zos, Element parentElement) protected void
addSchemaExtractMaps
(SchemaSeed schemaSeed, ZipOutputStream zos, Element parentElement) protected void
addSchemaSeed
(Form form, TemplateVersion version, ZipOutputStream zos, Element parentElement) protected void
addService
(ServiceDefinition serviceDefinition, ZipOutputStream zos, Element parentElement) protected void
addServiceConnection
(ZipOutputStream zos, ServiceConnection connection, Element parentElement) protected void
addTemplateVersion
(Form form, TemplateVersion version, ZipOutputStream zos, Element parentElement) protected void
addTemplateVersionData
(TemplateVersion version, ZipOutputStream zos, Element parentElement) protected void
addVersionAttachments
(Form form, TemplateVersion version, ZipOutputStream zos, Element parentElement) protected void
addVersionCategories
(TemplateVersion version, ZipOutputStream zos, Element parentElement) protected void
addVersionMetadataValues
(Form form, TemplateVersion version, ZipOutputStream zos, Element parentElement) protected void
addVersionPropertyValues
(Form form, TemplateVersion version, ZipOutputStream zos, Element parentElement) protected void
addXmlPrefillMaps
(TemplateVersion version, SchemaSeed schemaSeed, ZipOutputStream zos, Element parentElement) protected void
copyFromElementToEntity
(Element element, BaseEntity entity, List<String> warnings) protected void
copyFromElementToEntity
(Element element, BaseEntity entity, List<String> exclusions, List<String> warnings) Copies from an XML element to the given entity, usingEntityArchiveUtils
.protected void
createChildProperty
(Element parent, String nodeName, Object source) protected void
createChildValue
(Element parent, String nodeName, String value) protected abstract void
exportAuditLogger
(Object object) Create an entry in the audit log when an export is performed This is called before the postExport methodvoid
exportData
(Object object, OutputStream outputStream) Export the specified entity to an output stream.void
exportData
(Object object, OutputStream outputStream, Map<String, String> additionalHeaders) Export the specified entity to an output stream.byte[]
findFileInArchive
(byte[] zipFileData, String name) Find the given file in the archive and return its contentsprotected byte[]
getByteArrayForElement
(Element element) protected byte[]
getByteArrayForZipEntry
(ZipEntry entry, ZipInputStream zis) Set<? extends IJMImportOption>
getDefaultImportOptions
(String metadataImportAction) Return the immutable set of import options that make sense as a default for the given import action.protected Element
getElementForByteArray
(byte[] byteData) protected abstract String
Return the name identifying the individual entity being exported (e.g.protected BaseArchiveService.FormData
getFormData
(Element formElement, Form form, TemplateVersion version) protected String
getFormVersionKey
(Form form, TemplateVersion version) Deprecated.use {@link this#getFormVersionKey(String, TemplateVersion) instead and explicitly pass the appropriate form code (generally either the archive form code during import or form.getClientFormCode() during export).protected String
getFormVersionKey
(String formCode, TemplateVersion version) Make sure to pass in the appropriate form code.getImportMetadata
(byte[] importData) Retrieve the set of metadata values describing an archive that is being imported.Return a value from the import option enum, if this service has import options.protected ServiceDefinition
Search and retrieve ServiceDefinition for transformer serviceprotected void
importApplicationPackages
(Form form, Element parentElement, List<String> warnings) protected void
importApplicationPackages
(ServiceDefinition serviceDefinition, Element parentElement, List<String> warnings) void
importArchive
(ImportAction importAction, Set<? extends Enum> importOptions) Import the archive from a input streamvoid
importArchive
(ImportAction importAction, Set<? extends Enum> importOptions, Map<String, Object> parameters) Import the archive from a input streamprotected abstract void
importAuditLogger
(ImportAction object) Create an entry in the audit log when an import is performed This is called before the postImport methodprotected void
importDeploymentPlan
(Form form, Element parentElement, List<String> warnings) protected void
importFormFunctions
(TemplateVersion version, Element parentElement, List<String> warnings) protected void
importFormGroups
(Form form, Element formElement, List<String> warnings) protected void
importFormPortals
(Form form, Element formElement, List<String> warnings) protected void
importOldSchemaConfigMaps
(SchemaSeed schemaSeed, Element parentElement, List<String> warnings) protected void
importParameterPrefillMaps
(SchemaSeed schemaSeed, Element parentElement, List<String> warnings) protected void
importPropertyPrefillMaps
(SchemaSeed schemaSeed, Element parentElement, List<String> warnings) protected void
importSchemaExtractMaps
(SchemaSeed schemaSeed, Element parentElement, List<String> warnings) protected void
importSchemaSeed
(Form form, TemplateVersion version, Element formElement, Element parentElement, List<String> warnings) protected ServiceConnection
importServiceConnection
(Client client, ServiceDefinition serviceDefinition, boolean preserveServiceConnections, Element connectionElement, List<String> warnings) protected void
importServiceDefinition
(Client client, ApplicationPackage application, boolean preserveExistingServices, boolean preserveDefaultServices, boolean preserveServiceConnections, Element serviceElement, List<String> warnings) protected void
importServiceParameters
(ServiceDefinition serviceDefinition, Element parentElement, List<String> warnings) protected void
importTemplateVersionData
(Element formElement, TemplateVersion templateVersion) protected int
importTemplateVersions
(Form form, boolean importAttachments, boolean importMetadata, boolean importProperties, boolean importServices, boolean importFormDataConfiguration, boolean importCurrentVersionFlag, boolean importCategories, boolean importFormFunctions, Element formElement, List<String> warnings) protected int
importTemplateVersions
(Form form, Element formElement, List<String> warnings) protected void
importVersionAttachments
(Form form, TemplateVersion version, Element parentElement, List<String> warnings) protected void
importVersionCategories
(Form form, TemplateVersion version, Element parentElement, List<String> warnings) protected void
importVersionMetadata
(Form form, TemplateVersion version, Element parentElement, List<String> warnings) protected void
importVersionProperties
(Form form, TemplateVersion version, Element parentElement, List<String> warnings) protected void
importXmlPrefillMaps
(SchemaSeed schemaSeed, Element parentElement, List<String> warnings) boolean
Return true if GroovySecure API is enforced.protected abstract void
performImport
(ImportAction importAction, Set<? extends Enum> importOptions, Map<String, Object> parameters) Performs the act of importing the data contained in the archive to the SFM database.protected void
postExport
(Object exportObject) Called after the export has been done, and the file created.protected void
postImport
(ImportAction importAction) Can be used to do post-import tasks such as form publishing.protected abstract void
processImportFile
(String fileName, byte[] fileData) For a given file in the imported archive, the service stores its contents as it sees fit, preserving what it will need to recreate entities later.protected ApplicationPackage
readApplicationPackageReference
(Element parentElement, Client targetClient) protected String
readClientCodeReference
(Element element) protected void
readMetadataAttributes
(Element rootElement, Map<String, String> metadataMap) Add the metadata shared by all export files to the metadata mapprotected String
readServiceName
(Element serviceElement) Return the service name of the service stored in the specified elementprotected ServiceDefinition
readServiceReference
(Element serviceElement, Client client) Read a service definition defined in a special service elementvoid
setGroovySecureAPI
(boolean value) Set whether the GroovySecureAPI is enforcedTransform a groovy script with JAVA EE code into equivalent Jakarta EEprotected void
updateUnifiedAppFlagAndDoc
(TemplateVersion formTemplateVersion) abstract void
validateImportData
(byte[] importData) Validate an archive before it is imported.protected void
writeApplicationPackageReference
(Element parentElement, ApplicationPackage applicationPackage) Creates a child element for a reference to an application packageprotected void
writeClientCodeReference
(Element parentElement, String clientCode) protected abstract void
writeExportData
(Object object, ZipOutputStream zos, Map<String, String> additionalHeaders) Does the actual export of the data without having to worry about handling errors or preparing and closing the streamprotected void
writeHeaderAttributes
(Element element, Map<String, String> additionalHeaders) protected void
writeServiceReference
(Element parentElement, String childElementName, ServiceDefinition serviceDefinition) Creates a child element for a reference to a service definitionMethods inherited from class com.avoka.fc.core.service.CayenneService
commitChanges, deleteObject, deleteObjects, findObject, getDataContext, getDataDomain, getObjectForPK, getObjectStore, newObject, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, refetchEntity, refetchObject, registerNewObject, rollbackChanges, toMap, toMap
Methods inherited from class com.avoka.fc.core.service.BaseService
getLogger
-
Field Details
-
ENCODING
The encoding that will be used when storing the XML files contained in the archive- See Also:
-
METADATA_ENVIRONMENT_NAME
The name of the metadata value storing the TM environment name- See Also:
-
METADATA_ENVIRONMENT_TYPE
The name of the metadata value storing the TM environment type (relevant if the value is "maestro")- See Also:
-
METADATA_EXPORT_DATE
The name of the metadata value storing the date the export archive was created- See Also:
-
METADATA_EXPORT_VERSION
The name of the metadata value storing the SFM version- See Also:
-
METADATA_EXPORT_REVISION
The name of the metadata value storing the SFM build number- See Also:
-
METADATA_EXPORT_DB_VERSION
The name of the metadata value storing the SFM database version- See Also:
-
METADATA_IMPORT_ACTION
The name of the metadata value storing a string constant describing what will happen on import of this archive- See Also:
-
METADATA_IMPORT_ACTION_MESSAGE
The name of the metadata value storing a message describing the action that will happen on import of this archive- See Also:
-
METADATA_IMPORT_ACTION_CREATE
Indicates that the entity being imported does not exist and will be created- See Also:
-
METADATA_IMPORT_ACTION_UPDATE
Indicates that the entity being imported already exists and will be updated- See Also:
-
METADATA_IMPORT_ACTION_CONFLICT
Indicates that the entity cannot be imported due to a conflict with existing entities- See Also:
-
METADATA_IMPORT_ACTION_ERROR
Indicates that the entity cannot be imported due to an error- See Also:
-
METADATA_JAVA_EE_WARNING
Indicates a warning about scripts containing java EE code- See Also:
-
METADATA_ENVIRONMENT_TYPE_MAESTRO
The Maestro environment type (used to drive some defaults)- See Also:
-
PORTAL_AUTHENTICATION_DB_VERSION
public static final int PORTAL_AUTHENTICATION_DB_VERSIONThe 5.1 db version where the authentication scope was moved to the portals.- See Also:
-
TRANSFORMER_SERVICE_NAME
- See Also:
-
ELEMENT_CLIENT
- See Also:
-
ELEMENT_FORM_DELIVERY_TEST
- See Also:
-
ELEMENT_FORM_DELIVERY_PROD
- See Also:
-
ELEMENT_FORM_ABANDON_DELIVERY
- See Also:
-
ELEMENT_FORM_VALIDATION_DELIVERY
- See Also:
-
ELEMENT_AUTHENTICATION_MODE
- See Also:
-
ELEMENT_FORM_PORTALS
- See Also:
-
ELEMENT_FORM_PORTAL
- See Also:
-
ELEMENT_FORM_PORTAL_PORTAL_NAME
- See Also:
-
ATTRIBUTE_FORM_PORTAL_ANONYMOUS
- See Also:
-
ATTRIBUTE_FORM_PORTAL_AUTHENTICATED
- See Also:
-
ELEMENT_FORM_GROUPS
- See Also:
-
ELEMENT_FORM_GROUP
- See Also:
-
ELEMENT_FORM_STATUS
- See Also:
-
ELEMENT_TEMPLATE_VERSIONS
- See Also:
-
ELEMENT_TEMPLATE_VERSION
- See Also:
-
ELEMENT_FORM_FUNCTIONS
- See Also:
-
ELEMENT_FORM_FUNCTION
- See Also:
-
ELEMENT_VERSION_ATTACHMENTS
- See Also:
-
ELEMENT_VERSION_ATTACHMENT
- See Also:
-
ELEMENT_VERSION_METADATA_VALUES
- See Also:
-
ELEMENT_VERSION_METADATA_VALUE
- See Also:
-
ELEMENT_VERSION_PROPERTY_VALUES
- See Also:
-
ELEMENT_VERSION_PROPERTY_VALUE
- See Also:
-
ELEMENT_VERSION_CATEGORIES
- See Also:
-
ELEMENT_VERSION_CATEGORY
- See Also:
-
ELEMENT_TEMPLATE_VERSION_DEPLOYMENTS
- See Also:
-
ELEMENT_TEMPLATE_VERSION_DEPLOYMENT
- See Also:
-
ELEMENT_SCHEMA_SEED
- See Also:
-
ELEMENT_DOCUMENT_TYPE_NAME
- See Also:
-
ELEMENT_DOCUMENT_TYPE_CLIENT
- See Also:
-
ELEMENT_METADATA_TAG_NAME
- See Also:
-
ELEMENT_METADATA_TAG_CLIENT
- See Also:
-
ELEMENT_PROPERTY_TYPE_NAME
- See Also:
-
ELEMENT_PROPERTY_TYPE_SCOPE
- See Also:
-
ELEMENT_PROPERTY_TYPE_CLIENT
- See Also:
-
ELEMENT_CATEGORY_NAME
- See Also:
-
ELEMENT_SCHEMA_CONFIG_MAPPINGS
- See Also:
-
ELEMENT_SCHEMA_CONFIG_MAPPING
- See Also:
-
ELEMENT_PROPERTY_PREFILL_MAPPINGS
- See Also:
-
ELEMENT_PROPERTY_PREFILL_MAPPING
- See Also:
-
ELEMENT_XML_PREFILL_VERSION
- See Also:
-
ELEMENT_XML_PREFILL_MAPPINGS
- See Also:
-
ELEMENT_XML_PREFILL_MAPPING
- See Also:
-
ELEMENT_PARAMETER_PREFILL_MAPPINGS
- See Also:
-
ELEMENT_PARAMETER_PREFILL_MAPPING
- See Also:
-
ELEMENT_SCHEMA_EXTRACT_MAPPINGS
- See Also:
-
ELEMENT_SCHEMA_EXTRACT_MAPPING
- See Also:
-
ELEMENT_SERVICES
- See Also:
-
ELEMENT_SERVICE
- See Also:
-
ELEMENT_SERVICE_CONNECTIONS
- See Also:
-
ELEMENT_SERVICE_CONNECTION
- See Also:
-
ELEMENT_SERVICE_PARAMETERS
- See Also:
-
ELEMENT_SERVICE_PARAMETER
- See Also:
-
ELEMENT_SERVICE_PARAMETER_GROOVY_DEBUG_LOGGING
- See Also:
-
ELEMENT_APPLICATION_PACKAGES
- See Also:
-
ELEMENT_APPLICATION_PACKAGE
- See Also:
-
ELEMENT_CLIENT_CODE
- See Also:
-
ELEMENT_SERVICE_NAME
- See Also:
-
ELEMENT_SERVICE_CLIENT_CODE
- See Also:
-
ELEMENT_SERVICE_VERSION
- See Also:
-
ELEMENT_SERVICE_TYPE
- See Also:
-
ATTRIBUTE_EXPORT_DATE
- See Also:
-
ATTRIBUTE_ENVIRONMENT_NAME
- See Also:
-
ATTRIBUTE_SFM_VERSION
- See Also:
-
ATTRIBUTE_BUILD_NUMBER
- See Also:
-
ATTRIBUTE_DB_VERSION
- See Also:
-
DIR_FORM
- See Also:
-
DIR_FAR
- See Also:
-
DIR_RECEIPT
- See Also:
-
DIR_SCHEMA_SEED
- See Also:
-
DIR_XML_PREFILL
- See Also:
-
FILE_FAR_DEFAULT
- See Also:
-
FILE_SCHEMA_SEED_DEFAULT
- See Also:
-
FILE_XML_PREFILL_DEFAULT
- See Also:
-
SERVICE_TYPE_CARD_PAYMENT_OBSOLETE
The old service type for credit card payment services (obsolete)- See Also:
-
updatedTemplateVersionIds
-
oldCurrentServiceVersions
-
groovySecureAPI
protected boolean groovySecureAPI
-
-
Constructor Details
-
BaseArchiveService
public BaseArchiveService()
-
-
Method Details
-
exportData
Export the specified entity to an output stream.- Parameters:
object
- the object to be exported (required)outputStream
- an output stream (required)
-
exportData
public void exportData(Object object, OutputStream outputStream, Map<String, String> additionalHeaders) Export the specified entity to an output stream.- Parameters:
object
- the object to be exported (required)outputStream
- an output stream (required)additionalHeaders
- a map of parameters to add to the header metadata (optional)
-
getDefaultImportOptions
Return the immutable set of import options that make sense as a default for the given import action.- Parameters:
metadataImportAction
- the import action that will be performed (one ofMETADATA_IMPORT_ACTION_CREATE
,METADATA_IMPORT_ACTION_UPDATE
)- Returns:
- the set of default import options
- Since:
- 20.05.0
-
exportAuditLogger
Create an entry in the audit log when an export is performed This is called before the postExport method- Parameters:
object
- Object exported (Optional)- Since:
- 17.10.2
-
importAuditLogger
Create an entry in the audit log when an import is performed This is called before the postImport method- Parameters:
object
- ImportAction containing action performed (required)- Since:
- 17.10.2
-
validateImportData
Validate an archive before it is imported.- Parameters:
importData
- the import archive as a byte array- Throws:
Exception
- if an error occurs during validation
-
getImportMetadata
Retrieve the set of metadata values describing an archive that is being imported.- Parameters:
importData
- the import archive as a byte array- Returns:
- a map of metadata names and their values
- Throws:
Exception
- if an error occurs while the metadata is being loaded
-
importArchive
public void importArchive(ImportAction importAction, Set<? extends Enum> importOptions) throws Exception Import the archive from a input stream- Parameters:
importAction
- the input action object related to this importimportOptions
- a set of import options- Throws:
Exception
- if an error occurs during import
-
importArchive
public void importArchive(ImportAction importAction, Set<? extends Enum> importOptions, Map<String, Object> parameters) throws ExceptionImport the archive from a input stream- Parameters:
importAction
- the input action object related to this importimportOptions
- a set of import optionsparameters
- a set of optional parameters to be used during import- Throws:
Exception
- if an error occurs during import
-
findFileInArchive
Find the given file in the archive and return its contents- Parameters:
zipFileData
- the ZIP file dataname
- the name of the ZIP file entry (required)- Returns:
- the data for the entry with the given name, or null if not found
- Throws:
IOException
- if an error occurs while reading the ZIP file- Since:
- 20.05.0
-
getImportOptionEnum
Return a value from the import option enum, if this service has import options. Can be used to callIJMImportOption.defaultForImportAction(String)
- Returns:
- one of the import options
-
isGroovySecureAPI
public boolean isGroovySecureAPI()Return true if GroovySecure API is enforced.- Returns:
- true if GroovySecure API is enforced
- Since:
- 5.1.7
-
setGroovySecureAPI
public void setGroovySecureAPI(boolean value) Set whether the GroovySecureAPI is enforced- Parameters:
value
- set whether the GroovySecureAPI is enforced- Since:
- 5.1.7
-
writeExportData
protected abstract void writeExportData(Object object, ZipOutputStream zos, Map<String, String> additionalHeaders) throws ExceptionDoes the actual export of the data without having to worry about handling errors or preparing and closing the stream- Parameters:
object
- the non-null object to be exportedzos
- the stream to be written toadditionalHeaders
- the map of additional headers to be included in metadata- Throws:
Exception
- if an error occurs
-
processImportFile
For a given file in the imported archive, the service stores its contents as it sees fit, preserving what it will need to recreate entities later. This operation happens before the database transaction wrapping the actual import to the SFM database.- Parameters:
fileName
- the full file name of the ZIP file entry (e.g. form/TestForm.pdf)fileData
- the file data of the ZIP file entry- Throws:
Exception
- if an error occurs
-
performImport
protected abstract void performImport(ImportAction importAction, Set<? extends Enum> importOptions, Map<String, Object> parameters) throws ExceptionPerforms the act of importing the data contained in the archive to the SFM database. When this method will be called, the caller is expected to have established a transaction, and will also handle errors thrown by this method.- Parameters:
importAction
- the import action related to this importimportOptions
- the set of import options that should be appliedparameters
- optional parameters to be used during import- Throws:
Exception
- If an error occurs. The caller is responsible for rolling back the transaction to avoid contaminating the database.
-
postImport
Can be used to do post-import tasks such as form publishing. -
getEntityName
Return the name identifying the individual entity being exported (e.g. for a client, the client's name)- Returns:
- the entity name
-
postExport
Called after the export has been done, and the file created. Can be used to do service-specific activities such as logging.- Parameters:
exportObject
- the object that was passed to exportData
-
writeHeaderAttributes
-
readMetadataAttributes
Add the metadata shared by all export files to the metadata map- Parameters:
rootElement
- the root element in the export config file (required)metadataMap
- the map to add the metadata entries to
-
createChildProperty
-
createChildValue
-
writeServiceReference
protected void writeServiceReference(Element parentElement, String childElementName, ServiceDefinition serviceDefinition) Creates a child element for a reference to a service definition- Parameters:
parentElement
- the parent element (required)childElementName
- the name of the child element wrapping the service data (required)serviceDefinition
- the service definition (required)
-
readServiceName
Return the service name of the service stored in the specified element- Parameters:
serviceElement
- the element containing the service name and type- Returns:
- the service name
-
readServiceReference
Read a service definition defined in a special service element- Parameters:
serviceElement
- the element holding the service type and name (generally created bywriteServiceReference(Element, String, ServiceDefinition)
client
- the target client of the import, if any- Returns:
- the service element if found, or null otherwise
- Throws:
ApplicationException
- if a service was found, but the service type was different
-
getByteArrayForZipEntry
- Throws:
IOException
-
getByteArrayForElement
- Throws:
UnsupportedEncodingException
-
getElementForByteArray
- Throws:
UnsupportedEncodingException
-
copyFromElementToEntity
-
copyFromElementToEntity
protected void copyFromElementToEntity(Element element, BaseEntity entity, List<String> exclusions, List<String> warnings) Copies from an XML element to the given entity, usingEntityArchiveUtils
. If an error occurs, an import warning is added, and the error is swallowed. This allows us to ignore minor schema differences without having to code exclusions for every single potential difference.- Parameters:
element
- the XML element containing the dataentity
- the entity to copy toexclusions
- the list of excluded propertieswarnings
- the list of import warnings
-
addService
protected void addService(ServiceDefinition serviceDefinition, ZipOutputStream zos, Element parentElement) -
addServiceConnection
protected void addServiceConnection(ZipOutputStream zos, ServiceConnection connection, Element parentElement) -
addForm
protected void addForm(ZipOutputStream zos, Form form, TemplateVersion version, Element parentElement) throws IOException - Throws:
IOException
-
addFormPortals
-
addFormGroups
-
addDeploymentSchedule
-
addTemplateVersion
protected void addTemplateVersion(Form form, TemplateVersion version, ZipOutputStream zos, Element parentElement) throws IOException - Throws:
IOException
-
addTemplateVersionData
protected void addTemplateVersionData(TemplateVersion version, ZipOutputStream zos, Element parentElement) throws IOException - Throws:
IOException
-
addFormFunctions
protected void addFormFunctions(TemplateVersion version, ZipOutputStream zos, Element parentElement) -
addVersionAttachments
protected void addVersionAttachments(Form form, TemplateVersion version, ZipOutputStream zos, Element parentElement) -
addVersionMetadataValues
protected void addVersionMetadataValues(Form form, TemplateVersion version, ZipOutputStream zos, Element parentElement) -
addVersionPropertyValues
protected void addVersionPropertyValues(Form form, TemplateVersion version, ZipOutputStream zos, Element parentElement) -
addVersionCategories
protected void addVersionCategories(TemplateVersion version, ZipOutputStream zos, Element parentElement) -
addSchemaSeed
protected void addSchemaSeed(Form form, TemplateVersion version, ZipOutputStream zos, Element parentElement) throws IOException - Throws:
IOException
-
addPropertyPrefillMaps
protected void addPropertyPrefillMaps(Form form, SchemaSeed schemaSeed, ZipOutputStream zos, Element parentElement) -
addXmlPrefillMaps
protected void addXmlPrefillMaps(TemplateVersion version, SchemaSeed schemaSeed, ZipOutputStream zos, Element parentElement) -
addParameterPrefillMaps
protected void addParameterPrefillMaps(SchemaSeed schemaSeed, ZipOutputStream zos, Element parentElement) -
addSchemaExtractMaps
protected void addSchemaExtractMaps(SchemaSeed schemaSeed, ZipOutputStream zos, Element parentElement) -
importFormGroups
protected void importFormGroups(Form form, Element formElement, List<String> warnings) throws ParseException - Throws:
ParseException
-
importFormPortals
-
importTemplateVersions
-
importTemplateVersions
protected int importTemplateVersions(Form form, boolean importAttachments, boolean importMetadata, boolean importProperties, boolean importServices, boolean importFormDataConfiguration, boolean importCurrentVersionFlag, boolean importCategories, boolean importFormFunctions, Element formElement, List<String> warnings) -
importTemplateVersionData
-
importFormFunctions
protected void importFormFunctions(TemplateVersion version, Element parentElement, List<String> warnings) -
importVersionAttachments
protected void importVersionAttachments(Form form, TemplateVersion version, Element parentElement, List<String> warnings) -
importVersionMetadata
protected void importVersionMetadata(Form form, TemplateVersion version, Element parentElement, List<String> warnings) -
importVersionProperties
protected void importVersionProperties(Form form, TemplateVersion version, Element parentElement, List<String> warnings) -
importVersionCategories
protected void importVersionCategories(Form form, TemplateVersion version, Element parentElement, List<String> warnings) -
importSchemaSeed
-
importOldSchemaConfigMaps
protected void importOldSchemaConfigMaps(SchemaSeed schemaSeed, Element parentElement, List<String> warnings) -
importPropertyPrefillMaps
protected void importPropertyPrefillMaps(SchemaSeed schemaSeed, Element parentElement, List<String> warnings) -
importXmlPrefillMaps
protected void importXmlPrefillMaps(SchemaSeed schemaSeed, Element parentElement, List<String> warnings) -
importParameterPrefillMaps
protected void importParameterPrefillMaps(SchemaSeed schemaSeed, Element parentElement, List<String> warnings) -
importSchemaExtractMaps
protected void importSchemaExtractMaps(SchemaSeed schemaSeed, Element parentElement, List<String> warnings) -
importDeploymentPlan
-
importServiceDefinition
protected void importServiceDefinition(Client client, ApplicationPackage application, boolean preserveExistingServices, boolean preserveDefaultServices, boolean preserveServiceConnections, Element serviceElement, List<String> warnings) -
importServiceConnection
protected ServiceConnection importServiceConnection(Client client, ServiceDefinition serviceDefinition, boolean preserveServiceConnections, Element connectionElement, List<String> warnings) -
importServiceParameters
protected void importServiceParameters(ServiceDefinition serviceDefinition, Element parentElement, List<String> warnings) -
importApplicationPackages
protected void importApplicationPackages(ServiceDefinition serviceDefinition, Element parentElement, List<String> warnings) -
importApplicationPackages
-
readApplicationPackageReference
protected ApplicationPackage readApplicationPackageReference(Element parentElement, Client targetClient) -
writeApplicationPackageReference
protected void writeApplicationPackageReference(Element parentElement, ApplicationPackage applicationPackage) Creates a child element for a reference to an application package- Parameters:
parentElement
- the parent element (required)applicationPackage
- the application package (required)
-
readClientCodeReference
-
writeClientCodeReference
-
getFormData
protected BaseArchiveService.FormData getFormData(Element formElement, Form form, TemplateVersion version) -
getFormVersionKey
Deprecated.use {@link this#getFormVersionKey(String, TemplateVersion) instead and explicitly pass the appropriate form code (generally either the archive form code during import or form.getClientFormCode() during export). -
getFormVersionKey
Make sure to pass in the appropriate form code. For example, during application package import, form codes may automatically be changed to unique ones. However, in the archive the old form codes are used as directory names, so this method must be used. Note that the form version archive service uses a different key. -
updateUnifiedAppFlagAndDoc
-
transform
Transform a groovy script with JAVA EE code into equivalent Jakarta EE- Parameters:
script
- string containing groovy script- Returns:
- Jakarta equivalent script or null if no conversion is needed.
- Since:
- 23.4.0
-
getTransformerServiceInstalled
Search and retrieve ServiceDefinition for transformer service- Returns:
- Service definition or null if not found.
- Since:
- 23.4.0
-