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
ConstructorsConstructorDescriptionAddEntityDocChange(NodeFactory nodeFactory, InternalEntityDocumentsService entityDocumentsService, QueryBuilderFactory queryBuilderFactory, Context context, SecurityManager securityManager, BinaryFactory binaryFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(liquibase.database.Database database) getOrCreateEntityDocFolder(Entity entity, String entityModel) booleanhasEntityDocFolder(String modelName, Entity entity) voidlinkBinaryToEntity(Entity entity, InputStream inputStream, FolderNode entityDocFolder) voidsetBinaryFieldName(String binaryFieldName) voidsetBusinessUnitId(String businessUnitId) voidsetBusinessUnitPath(String businessUnitPath) voidsetEntityModel(String entityModel) voidsetFileName(String fileName) voidsetFileOpener(liquibase.resource.ResourceAccessor resourceAccessor) voidsetPublishStatus(String publishStatus) voidsetResourceName(String resourceName) voidsetUniqueId(String uniqueId) voidsetUp()liquibase.exception.ValidationErrorsvalidate(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:
executein interfaceliquibase.change.custom.CustomTaskChange- Throws:
liquibase.exception.CustomChangeException
-
getConfirmationMessage
- Specified by:
getConfirmationMessagein interfaceliquibase.change.custom.CustomChange
-
setUp
public void setUp() throws liquibase.exception.SetupException- Specified by:
setUpin interfaceliquibase.change.custom.CustomChange- Throws:
liquibase.exception.SetupException
-
setFileOpener
public void setFileOpener(liquibase.resource.ResourceAccessor resourceAccessor) - Specified by:
setFileOpenerin interfaceliquibase.change.custom.CustomChange
-
validate
public liquibase.exception.ValidationErrors validate(liquibase.database.Database database) - Specified by:
validatein interfaceliquibase.change.custom.CustomChange
-
getEntities
- Throws:
PersistExceptionliquibase.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
-