Class AddEntityDocChange
java.lang.Object
ch.tocco.nice2.dms.impl.dbrefactoring.AddEntityDocChange
- All Implemented Interfaces:
liquibase.change.custom.CustomChange
,liquibase.change.custom.CustomTaskChange
Used to upload binaries and attach them as entitydocs
Parameters:
* publishStatus PublishStatus to be used
* fileName Filename of the to-be-attached file. Relative to project root
* entityModel Name of the respective EntityModel
* uniqueId unique_id of the respective Entity
* binaryFieldName Optional. Field name to which the binary shall be bound
* resourceName. Name of the resource
* businessUnitId. uniqueId of the business unit
* businessUnitPath. path to the business unit (default = "relBusiness_unit")
-
Constructor Summary
ConstructorDescriptionAddEntityDocChange
(NodeFactory nodeFactory, InternalEntityDocumentsService entityDocumentsService, QueryBuilderFactory queryBuilderFactory, Context context, SecurityManager securityManager, BinaryFactory binaryFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoid
execute
(liquibase.database.Database database) getOrCreateEntityDocFolder
(Entity entity, String entityModel) boolean
hasEntityDocFolder
(String modelName, Entity entity) void
linkBinaryToEntity
(Entity entity, InputStream inputStream, FolderNode entityDocFolder) void
setBinaryFieldName
(String binaryFieldName) void
setBusinessUnitId
(String businessUnitId) void
setBusinessUnitPath
(String businessUnitPath) void
setEntityModel
(String entityModel) void
setFileName
(String fileName) void
setFileOpener
(liquibase.resource.ResourceAccessor resourceAccessor) void
setPublishStatus
(String publishStatus) void
setResourceName
(String resourceName) void
setUniqueId
(String uniqueId) void
setUp()
liquibase.exception.ValidationErrors
validate
(liquibase.database.Database database)
-
Constructor Details
-
AddEntityDocChange
public AddEntityDocChange() -
AddEntityDocChange
public AddEntityDocChange(NodeFactory nodeFactory, InternalEntityDocumentsService entityDocumentsService, QueryBuilderFactory queryBuilderFactory, Context context, SecurityManager securityManager, BinaryFactory binaryFactory)
-
-
Method Details
-
execute
public void execute(liquibase.database.Database database) throws liquibase.exception.CustomChangeException - Specified by:
execute
in interfaceliquibase.change.custom.CustomTaskChange
- Throws:
liquibase.exception.CustomChangeException
-
getConfirmationMessage
- Specified by:
getConfirmationMessage
in interfaceliquibase.change.custom.CustomChange
-
setUp
public void setUp() throws liquibase.exception.SetupException- Specified by:
setUp
in interfaceliquibase.change.custom.CustomChange
- Throws:
liquibase.exception.SetupException
-
setFileOpener
public void setFileOpener(liquibase.resource.ResourceAccessor resourceAccessor) - Specified by:
setFileOpener
in interfaceliquibase.change.custom.CustomChange
-
validate
public liquibase.exception.ValidationErrors validate(liquibase.database.Database database) - Specified by:
validate
in interfaceliquibase.change.custom.CustomChange
-
getEntities
- Throws:
PersistException
liquibase.exception.CustomChangeException
-
linkBinaryToEntity
public void linkBinaryToEntity(Entity entity, InputStream inputStream, FolderNode entityDocFolder) throws IOException, PersistException, InterruptedException -
getOrCreateEntityDocFolder
public FolderNode getOrCreateEntityDocFolder(Entity entity, String entityModel) throws PersistException - Throws:
PersistException
-
hasEntityDocFolder
- Throws:
PersistException
-
openFile
- Throws:
IOException
-
getResourceName
-
getBinaryFieldName
-
getEntityModel
-
getUniqueId
-
getFileName
-
getPublishStatus
-
setFileName
-
setEntityModel
-
setUniqueId
-
setBinaryFieldName
-
setResourceName
-
setPublishStatus
-
getBusinessUnitId
-
setBusinessUnitId
-
getBusinessUnitPath
-
setBusinessUnitPath
-