Interface Package

All Superinterfaces:
Comparable<Package>, Lockable
All Known Subinterfaces:
ContentPackage, TemplatePackage

@NonExtendable public interface Package extends Lockable, Comparable<Package>
The Package object needs to be locked for modifying operations. Use Lockable.isLocked() and Lockable.lock() to manage the locking of the package.
All changes to the package need to be committed by calling Lockable.save() to make the changes persistent on the server.
To rollback changes to a package, call Lockable.refresh() instead of Lockable.save()
Since:
3.1.185
  • Field Details

    • CONTENT_PACKAGE

      static final int CONTENT_PACKAGE
      Types a package to contain content.
      Since:
      3.1.158
      See Also:
    • TEMPLATE_PACKAGE

      static final int TEMPLATE_PACKAGE
      Types a package to contain template.
      Since:
      3.1.158
      See Also:
    • WF_OK

      static final byte WF_OK
      Marks the workflow state OK.
      Since:
      3.1.158
      See Also:
    • WF_ERROR

      static final byte WF_ERROR
      Marks the workflow state Error.
      Since:
      3.1.158
      See Also:
    • WF_CONFLICT

      static final byte WF_CONFLICT
      Marks the workflow state Conflict.
      Since:
      3.1.158
      See Also:
    • WF_RELEASE

      static final byte WF_RELEASE
      Marks the workflow state Release.
      Since:
      3.1.158
      See Also:
    • WF_ACTUALIZE

      static final byte WF_ACTUALIZE
      Marks the workflow state of actualizing.
      Since:
      3.1.158
      See Also:
  • Method Details

    • getId

      long getId()
      Gets the id of this package. The id is the unique identifier of the package.
      Returns:
      long the id of the package
      Since:
      3.1.158
    • getName

      String getName()
      Returns the name of this package.
      Returns:
      String name
      Since:
      3.1.158
    • setName

      void setName(String name)
      Sets the name for this package.
      Parameters:
      name - String the new name
      Since:
      3.1.158
    • getComment

      String getComment()
      Returns the comment of this package.
      Returns:
      String comment
      Since:
      3.1.158
    • setComment

      void setComment(String comment)
      Sets the comment for this package.
      Parameters:
      comment - String the new comment
      Since:
      3.1.158
    • getType

      int getType()
      Returns the type of this package.
      Returns:
      CONTENT_PACKAGE or TEMPLATE_PACKAGE
      Since:
      3.1.158
    • getPackageType

      Package.Type getPackageType()
      Returns the type of this package.
      Returns:
      on of Package.Type
      Since:
      5.0.37
    • isValidNodeType

      boolean isValidNodeType(StoreElement node)
      Validates the given node's type. This validates to true, if the type of the specified node is a valid content type for this package, false, otherwise. Only nodes wich implement PackagePoolItem can be a valid.
      Returns:
      true, if valid.
      Since:
      3.1.158
    • getStartNodes

      Collection<IDProvider> getStartNodes()
      Returns a read-only List of StoreElement's of start nodes existing in this package.
      Returns:
      a list of start nodes (StoreElement
      Since:
      3.1.158
    • containsStartNode

      boolean containsStartNode(IDProvider node)
      Checks if the given start node is existing in the underlying start node list of this package.
      Parameters:
      node - to check against
      Returns:
      true if the given node is existing, false otherwise
      Since:
      4.0.17
    • getStartNodes

      Collection<IDProvider> getStartNodes(Store.Type storeType)
      Returns a read-only List of StoreElement's of start nodes existing in this package from the given Store type.
      Parameters:
      storeType -
      Returns:
      a list of start nodes (StoreElement) for the specified store (maybe empty)
      Since:
      4.0.17
    • addStartNode

      @Deprecated void addStartNode(IDProvider storeElement)
      Deprecated.
      Add a start node.
      Parameters:
      storeElement -
      Throws:
      IllegalArgumentException - if the provided store element does not belong to the publisher project or e.g. a template node is added to a content package
      Since:
      4.0.17
    • removeStartNode

      @Deprecated void removeStartNode(IDProvider storeElement)
      Deprecated.
      Removes the given StoreElement from the list of start nodes.
      Parameters:
      storeElement - the StoreElement to remove
      Since:
      4.0.17
    • getVersion

      int getVersion()
      Gets the version of this package. Every call of Lockable.save() increases this version if the package was changed.
      Returns:
      the current version of this package
      Since:
      3.1.158
    • getVersions

      List<PackageVersion> getVersions()
      Returns a readonly list of PackageVersion's existing for this package.
      Returns:
      List of PackageVersion's
      Since:
      3.1.158
    • createVersion

      PackageVersion createVersion(String tag, String comment)
      Create a new version. Ensure to call Lockable.save() for this package to create version zip on the server.
      Parameters:
      tag - the tag for the new version
      comment - the comment for the new version
      Returns:
      the new version
      Since:
      3.1.158
    • createVersion

      PackageVersion createVersion(String tag, String comment, boolean update)
      Creates a new version. Ensure to call Lockable.save() for this package to create version zip on the server. If update == true the version zip creation during Lockable.save() will ignore not released elements.
      Parameters:
      tag - the tag for the new version
      comment - the comment for the new version
      update - indicates whether the created version should be an update version
      Returns:
      the new version
      Since:
      4.2.455
    • removeVersion

      void removeVersion(PackageVersion version)
      Removes the given PackageVersion from this package.
      Parameters:
      version - the PackageVersion to remove
      Since:
      3.1.158
    • subscribePackage

      Subscription subscribePackage(Project subscriber)
      Creates a new Subscription to this package from the given Project.
      The Subscription is created with the default PublishGroup. To create a subscription with a different publishgroup use subscribePackage(Project, PublishGroup)
      Parameters:
      subscriber - the Project which subscribes the package
      Returns:
      Subscription the new subscription
      Since:
      3.1.158
    • subscribePackage

      Subscription subscribePackage(Project subscriber, PublishGroup publishGroup)
      Creates a new Subscription to this package from the given Project and with the given PublishGroup.
      Parameters:
      subscriber - the Project which subscribes the package
      publishGroup - the PublishGroup to create the subscription for
      Returns:
      Subscription the new subscription
      Since:
      3.1.158
    • publishPackage

      void publishPackage(PublishGroup publishGroup)
      Publish this package for the specified group.
      Starts the import of all Subscription's of this package which uses the given PublishGroup.
      Since:
      3.1.158
    • publishPackage

      void publishPackage()
      Publish this package.
      Starts the import of all Subscription's of this package on the server.
      Since:
      3.1.158
    • getPublisher

      @Nullable @Nullable Project getPublisher()
      Gets the Project that is the package's owner.
      Returns:
      The master project of the package if it is visible to the user and has not been deleted.
      Since:
      3.1.158
    • isReadOnly

      boolean isReadOnly()
      Indicates whether content in subscribing project of this package is read only or not. By default this method delivers false. Read only packages: Content in subscribing may not be changed.
      Since:
      3.1.158
      See Also:
    • setReadOnly

      void setReadOnly(boolean value)
      Read only packages: Content in subscribing may not be changed.
      Since:
      3.1.158
      See Also:
    • isAvailable

      boolean isAvailable()
      This flag indicates if the package is available. Only available packages could be subscribed by other projects.
      Returns:
      true if this package is available, false otherwise.
      Since:
      3.1.158
    • setAvailable

      void setAvailable(boolean available)
      Set this package available / not available.
      Parameters:
      available - true to activate, false to deactivate the package
      Since:
      3.1.158
    • getPublishUsers

      List<User> getPublishUsers()
      Gets an unmodifiable list of User's which have the permission 'publish' for this package.
      Returns:
      List of publish User's
      Since:
      3.1.158
    • addPublishUser

      void addPublishUser(User user)
      Adds the given user to the list of User's which have the permission 'publish' for this package.
      Parameters:
      user - the user to add
      Since:
      3.1.158
    • removePublishUser

      void removePublishUser(User user)
      Removes the given user from the list of User's which have the permission 'publish' for this package.
      Parameters:
      user - the user to remove
      Since:
      3.1.158
    • getResponsibleUsers

      List<User> getResponsibleUsers()
      Gets an unmodifiable list of responsible User's of this package.
      Returns:
      List of responsible User's
      Since:
      3.1.158
    • addResponsibleUser

      void addResponsibleUser(User user)
      Adds the given user to the list of responsible User's of this package.
      Parameters:
      user - the user to add
      Since:
      3.1.158
    • removeResponsibleUser

      void removeResponsibleUser(User user)
      Removes the given user from the list of responsible User's of this package.
      Parameters:
      user - the user to remove
      Since:
      3.1.158
    • getAuthorisedUsers

      List<User> getAuthorisedUsers()
      Gets an unmodifiable list of authorised User's of this package.
      Returns:
      List of authorised User's
      Since:
      3.1.158
    • addAuthorisedUser

      void addAuthorisedUser(User user)
      Adds the given user to the list of authorised User's of this package.
      Parameters:
      user - the user to add
      Since:
      3.1.158
    • removeAuthorisedUser

      void removeAuthorisedUser(User user)
      Removes the given user from the list of authorised User's of this package.
      Parameters:
      user - the user to remove
      Since:
      3.1.158
    • getWorkflowName

      String getWorkflowName(byte type)
      Gets the name of the Workflow which is mapped to the given event type.
      Parameters:
      type - WF_OK, WF_ERROR, WF_CONFLICT, WF_RELEASE, WF_ACTUALIZE
      Returns:
      null if no workflow is defined for this type, else the node id of the workflow node
      Since:
      3.1.158
    • setWorkflow

      void setWorkflow(byte type, Workflow workflow)
      Map the given workflow to the given event type. The given workflow needs to exist in the target project.
      Parameters:
      type - WF_OK, WF_ERROR, WF_CONFLICT, WF_RELEASE, WF_ACTUALIZE
      workflow - the workflow to map to the event type
      Since:
      3.1.158
    • getCustomEventNames

      @Deprecated Set<String> getCustomEventNames()
      Deprecated.
      since 5.0.39 - no replacement
    • getCustomEventScripts

      @Deprecated Map<String,String> getCustomEventScripts()
      Deprecated.
      since 5.0.39 - no replacement
    • setCustomScriptName

      @Deprecated void setCustomScriptName(String eventName, String scriptName)
      Deprecated.
      since 5.0.39 - no replacement
    • removeCustomEvent

      @Deprecated void removeCustomEvent(String eventName)
      Deprecated.
      since 5.0.39 - no replacement
    • getCustomEventScriptName

      @Nullable @Deprecated @Nullable String getCustomEventScriptName(String eventName)
      Deprecated.
      since 5.0.39 - no replacement
    • delete

      void delete()
      Deletes this package. Requires a lock to this package.
      Since:
      3.1.158
    • useNameSpaceEnhancement

      boolean useNameSpaceEnhancement()
      Indicates whether the uid of elements which are added to this package will be enhanced with '@PACKAGE_NAME' or not. This flag is used as fallback if there is no special type setting for the element which is added.
      Returns:
      true if elements should be enhanced with '@PACKAGE_NAME' during add to package, false (default) otherwise
      Since:
      4.1.10
      See Also:
    • setUseNameSpaceEnhancement

      void setUseNameSpaceEnhancement(boolean enhanceNameSpace)
      Set use name space enhancement. Use true to enable name space enhancement with '@PACKAGE_NAME' for the uid of elements which are added to this package. For type specific settings use setUseNameSpaceEnhancement(boolean, Class[])
      Since:
      4.1.10
      See Also:
    • useNameSpaceEnhancement

      boolean useNameSpaceEnhancement(Class<? extends PackagePoolItem> clazz)
      Indicates whether the uid of an element of the given clazz should be enhanced with '@PACKAGE_NAME' or not during PackagePoolItem.addToPackage(Package). This method also regards inheritance of the given class and the fallback setting useNameSpaceEnhancement() if there is no special setting for the given clazz.

      Inheritance example:
      If namespace enhancement is set to false for Template.class a call to useNameSpaceEnhancement(TableTemplate.class) delivers false cause TableTemplate inherites interface Template
      Returns:
      true if elements should be enhanced with '@PACKAGE_NAME', false otherwise
      Since:
      4.1.10
      See Also:
    • setUseNameSpaceEnhancement

      void setUseNameSpaceEnhancement(boolean useEnhancement, Class<? extends PackagePoolItem>... clazz)
      Set use name space enhancement for specified types.
      Since:
      4.1.10
      See Also:
    • getAllNameSpaceEnhancements

      Map<Class<? extends PackagePoolItem>,Boolean> getAllNameSpaceEnhancements()
      Get all defined NameSpaceEnhancement Settings for this package.
      Returns:
      a Map containg all defined namespace enhancements settings for this package
      Since:
      4.1.10
      See Also:
    • overwriteDuringImport

      boolean overwriteDuringImport()
      Indicates how to handle package pool items which causes an uid conflict during import of this package.
      Returns true if package pool items should be overwritten, false otherwise.
      Returns:
      true (default) if elements with uid conflict should be overwritten during import, false otherwise
      Since:
      4.1.10
    • setOverwriteDuringImport

      void setOverwriteDuringImport(boolean overwrite)
      Defines how to handle elements which causes an uid conflict during import of this package.
      If true (default) existing elements in target project with the same uid will be overwritten with the package pool item of this package.
      If false existing elements will be retained and the package pool item of this package will inserted with an unified uid
      Since:
      4.1.10
      See Also:
    • overwriteDuringImport

      boolean overwriteDuringImport(Class<? extends PackagePoolItem> clazz)
      Indicates how to handle package pool items of the given clazz which causes an uid conflict during import of this package.
      Returns true if package pool items should be overwritten, false otherwise. This method also regards inheritance of the given class and the fallback setting overwriteDuringImport() if there is no special setting for the given clazz.

      Inheritance example:
      If overwrite during import is set to false for Template.class a call to overwriteDuringImport(TableTemplate.class) delivers false cause TableTemplate inherites interface Template
      Returns:
      true if elements with uid conflict should be overwritten during import, false otherwise
      Since:
      4.1.10
      See Also:
    • setOverwriteDuringImport

      void setOverwriteDuringImport(boolean overwrite, Class<? extends PackagePoolItem>... clazz)
      Set overwrite handling for specified types.
      Since:
      4.1.10
      See Also:
    • getAllOverwriteDuringImportSettings

      Map<Class<? extends PackagePoolItem>,Boolean> getAllOverwriteDuringImportSettings()
      Get all defined OverwriteDuringImport Settings for this package.
      Returns:
      a Map containg all defined overwrite during import settings for this package
      Since:
      4.1.10
      See Also: