Class AddEntityDocChange

java.lang.Object
ch.tocco.nice2.dms.impl.dbrefactoring.AddEntityDocChange
All Implemented Interfaces:
liquibase.change.custom.CustomChange, liquibase.change.custom.CustomTaskChange

public class AddEntityDocChange extends Object implements 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 Details

  • Method Details

    • execute

      public void execute(liquibase.database.Database database) throws liquibase.exception.CustomChangeException
      Specified by:
      execute in interface liquibase.change.custom.CustomTaskChange
      Throws:
      liquibase.exception.CustomChangeException
    • getConfirmationMessage

      public String getConfirmationMessage()
      Specified by:
      getConfirmationMessage in interface liquibase.change.custom.CustomChange
    • setUp

      public void setUp() throws liquibase.exception.SetupException
      Specified by:
      setUp in interface liquibase.change.custom.CustomChange
      Throws:
      liquibase.exception.SetupException
    • setFileOpener

      public void setFileOpener(liquibase.resource.ResourceAccessor resourceAccessor)
      Specified by:
      setFileOpener in interface liquibase.change.custom.CustomChange
    • validate

      public liquibase.exception.ValidationErrors validate(liquibase.database.Database database)
      Specified by:
      validate in interface liquibase.change.custom.CustomChange
    • getEntities

      public EntityList getEntities() throws PersistException, liquibase.exception.CustomChangeException
      Throws:
      PersistException
      liquibase.exception.CustomChangeException
    • linkBinaryToEntity

      public void linkBinaryToEntity(Entity entity, InputStream inputStream, FolderNode entityDocFolder) throws IOException, PersistException, InterruptedException
      Throws:
      IOException
      PersistException
      InterruptedException
    • getOrCreateEntityDocFolder

      public FolderNode getOrCreateEntityDocFolder(Entity entity, String entityModel) throws PersistException
      Throws:
      PersistException
    • hasEntityDocFolder

      public boolean hasEntityDocFolder(String modelName, Entity entity) throws PersistException
      Throws:
      PersistException
    • openFile

      public InputStream openFile(String uriString) throws IOException
      Throws:
      IOException
    • getResourceName

      public String getResourceName()
    • getBinaryFieldName

      public String getBinaryFieldName()
    • getEntityModel

      public String getEntityModel()
    • getUniqueId

      public String getUniqueId()
    • getFileName

      public String getFileName()
    • getPublishStatus

      public String getPublishStatus()
    • setFileName

      public void setFileName(String fileName)
    • setEntityModel

      public void setEntityModel(String entityModel)
    • setUniqueId

      public void setUniqueId(String uniqueId)
    • setBinaryFieldName

      public void setBinaryFieldName(String binaryFieldName)
    • setResourceName

      public void setResourceName(String resourceName)
    • setPublishStatus

      public void setPublishStatus(String publishStatus)
    • getBusinessUnitId

      public String getBusinessUnitId()
    • setBusinessUnitId

      public void setBusinessUnitId(String businessUnitId)
    • getBusinessUnitPath

      public String getBusinessUnitPath()
    • setBusinessUnitPath

      public void setBusinessUnitPath(String businessUnitPath)