Interface Package
- All Superinterfaces:
Comparable<Package>,Lockable
- All Known Subinterfaces:
ContentPackage,TemplatePackage
The
All changes to the package need to be committed by calling
To rollback changes to a package, call
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
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intTypes a package to contain content.static final intTypes a package to contain template.static final byteMarks the workflow state of actualizing.static final byteMarks the workflow state Conflict.static final byteMarks the workflow state Error.static final byteMarks the workflow state OK.static final byteMarks the workflow state Release. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAuthorisedUser(User user) Adds the given user to the list of authorisedUser's of this package.voidaddPublishUser(User user) Adds the given user to the list ofUser's which have the permission 'publish' for this package.voidaddResponsibleUser(User user) Adds the given user to the list of responsibleUser's of this package.voidaddStartNode(IDProvider storeElement) Deprecated.booleancontainsStartNode(IDProvider node) Checks if the given start node is existing in the underlying start node list of this package.createVersion(String tag, String comment) Create a new version.createVersion(String tag, String comment, boolean update) Creates a new version.voiddelete()Deletes this package.Map<Class<? extends PackagePoolItem>,Boolean> Get all defined NameSpaceEnhancement Settings for this package.Map<Class<? extends PackagePoolItem>,Boolean> Get all defined OverwriteDuringImport Settings for this package.Gets an unmodifiable list of authorisedUser's of this package.Returns the comment of this package.Deprecated.since 5.0.39 - no replacement@Nullable StringgetCustomEventScriptName(String eventName) Deprecated.since 5.0.39 - no replacementDeprecated.since 5.0.39 - no replacementlonggetId()Gets the id of this package.getName()Returns the name of this package.Returns the type of this package.@Nullable ProjectGets theProjectthat is the package's owner.Gets an unmodifiable list ofUser's which have the permission 'publish' for this package.Gets an unmodifiable list of responsibleUser's of this package.Returns a read-only List ofStoreElement's of start nodes existing in this package.getStartNodes(Store.Type storeType) Returns a read-only List ofStoreElement's of start nodes existing in this package from the given Store type.intgetType()Returns the type of this package.intGets the version of this package.Returns a readonly list ofPackageVersion's existing for this package.getWorkflowName(byte type) Gets the name of theWorkflowwhich is mapped to the given event type.booleanThis flag indicates if the package is available.booleanIndicates whether content in subscribing project of this package is read only or not.booleanisValidNodeType(StoreElement node) Validates the given node's type.booleanbooleanoverwriteDuringImport(Class<? extends PackagePoolItem> clazz) voidPublish this package.
Starts the import of allSubscription's of this package on the server.voidpublishPackage(PublishGroup publishGroup) Publish this package for the specified group.
Starts the import of allSubscription's of this package which uses the givenPublishGroup.voidremoveAuthorisedUser(User user) Removes the given user from the list of authorisedUser's of this package.voidremoveCustomEvent(String eventName) Deprecated.since 5.0.39 - no replacementvoidremovePublishUser(User user) Removes the given user from the list ofUser's which have the permission 'publish' for this package.voidremoveResponsibleUser(User user) Removes the given user from the list of responsibleUser's of this package.voidremoveStartNode(IDProvider storeElement) Deprecated.since 5.2.305 - usePackagePoolItem.removeFromPackage(Package)voidremoveVersion(PackageVersion version) Removes the given PackageVersion from this package.voidsetAvailable(boolean available) Set this package available / not available.voidsetComment(String comment) Sets the comment for this package.voidsetCustomScriptName(String eventName, String scriptName) Deprecated.since 5.0.39 - no replacementvoidSets the name for this package.voidsetOverwriteDuringImport(boolean overwrite) Defines how to handle elements which causes anuidconflict duringimportof this package.
Iftrue(default) existing elements intarget projectwith the same uid will be overwritten with the package pool item of this package.
Iffalseexisting elements will be retained and the package pool item of this package will inserted with an unifieduidvoidsetOverwriteDuringImport(boolean overwrite, Class<? extends PackagePoolItem>... clazz) Set overwrite handling for specified types.voidsetReadOnly(boolean value) Read only packages: Content in subscribing may not be changed.voidsetUseNameSpaceEnhancement(boolean enhanceNameSpace) Set use name space enhancement.voidsetUseNameSpaceEnhancement(boolean useEnhancement, Class<? extends PackagePoolItem>... clazz) Set use name space enhancement for specified types.voidsetWorkflow(byte type, Workflow workflow) Map the given workflow to the given event type.subscribePackage(Project subscriber) Creates a newSubscriptionto this package from the givenProject.
TheSubscriptionis created with the defaultPublishGroup.subscribePackage(Project subscriber, PublishGroup publishGroup) booleanIndicates whether the uid of elements which areaddedto this package will be enhanced with '@PACKAGE_NAME' or not.booleanuseNameSpaceEnhancement(Class<? extends PackagePoolItem> clazz) Indicates whether the uid of an element of the given clazz should be enhanced with '@PACKAGE_NAME' or not duringPackagePoolItem.addToPackage(Package).Methods inherited from interface java.lang.Comparable
compareTo
-
Field Details
-
CONTENT_PACKAGE
static final int CONTENT_PACKAGETypes a package to contain content.- Since:
- 3.1.158
- See Also:
-
TEMPLATE_PACKAGE
static final int TEMPLATE_PACKAGETypes a package to contain template.- Since:
- 3.1.158
- See Also:
-
WF_OK
static final byte WF_OKMarks the workflow state OK.- Since:
- 3.1.158
- See Also:
-
WF_ERROR
static final byte WF_ERRORMarks the workflow state Error.- Since:
- 3.1.158
- See Also:
-
WF_CONFLICT
static final byte WF_CONFLICTMarks the workflow state Conflict.- Since:
- 3.1.158
- See Also:
-
WF_RELEASE
static final byte WF_RELEASEMarks the workflow state Release.- Since:
- 3.1.158
- See Also:
-
WF_ACTUALIZE
static final byte WF_ACTUALIZEMarks 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
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
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_PACKAGEorTEMPLATE_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
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 implementPackagePoolItemcan be a valid.- Returns:
true, if valid.- Since:
- 3.1.158
-
getStartNodes
Collection<IDProvider> getStartNodes()Returns a read-only List ofStoreElement's of start nodes existing in this package.- Returns:
- a list of start nodes (
StoreElement - Since:
- 3.1.158
-
containsStartNode
Checks if the given start node is existing in the underlying start node list of this package.- Parameters:
node- to check against- Returns:
trueif the given node is existing,falseotherwise- Since:
- 4.0.17
-
getStartNodes
Returns a read-only List ofStoreElement'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.since 5.2.305 - usePackagePoolItem.addToPackage(Package)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.since 5.2.305 - usePackagePoolItem.removeFromPackage(Package)Removes the givenStoreElementfrom the list of start nodes.- Parameters:
storeElement- theStoreElementto remove- Since:
- 4.0.17
-
getVersion
int getVersion()Gets the version of this package. Every call ofLockable.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 ofPackageVersion's existing for this package.- Returns:
- List of
PackageVersion's - Since:
- 3.1.158
-
createVersion
Create a new version. Ensure to callLockable.save()for this package to create version zip on the server.- Parameters:
tag- the tag for the new versioncomment- the comment for the new version- Returns:
- the new version
- Since:
- 3.1.158
-
createVersion
Creates a new version. Ensure to callLockable.save()for this package to create version zip on the server. Ifupdate == truethe version zip creation duringLockable.save()will ignore not released elements.- Parameters:
tag- the tag for the new versioncomment- the comment for the new versionupdate- indicates whether the created version should be an update version- Returns:
- the new version
- Since:
- 4.2.455
-
removeVersion
Removes the given PackageVersion from this package.- Parameters:
version- the PackageVersion to remove- Since:
- 3.1.158
-
subscribePackage
Creates a newSubscriptionto this package from the givenProject.
TheSubscriptionis created with the defaultPublishGroup. To create a subscription with a different publishgroup usesubscribePackage(Project, PublishGroup)- Parameters:
subscriber- theProjectwhich subscribes the package- Returns:
Subscriptionthe new subscription- Since:
- 3.1.158
-
subscribePackage
- Parameters:
subscriber- theProjectwhich subscribes the packagepublishGroup- thePublishGroupto create the subscription for- Returns:
Subscriptionthe new subscription- Since:
- 3.1.158
-
publishPackage
Publish this package for the specified group.
Starts the import of allSubscription's of this package which uses the givenPublishGroup.- Since:
- 3.1.158
-
publishPackage
void publishPackage()Publish this package.
Starts the import of allSubscription's of this package on the server.- Since:
- 3.1.158
-
getPublisher
Gets theProjectthat 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 deliversfalse. 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:
trueif this package is available,falseotherwise.- Since:
- 3.1.158
-
setAvailable
void setAvailable(boolean available) Set this package available / not available.- Parameters:
available-trueto activate,falseto deactivate the package- Since:
- 3.1.158
-
getPublishUsers
Gets an unmodifiable list ofUser's which have the permission 'publish' for this package.- Returns:
- List of publish
User's - Since:
- 3.1.158
-
addPublishUser
Adds the given user to the list ofUser's which have the permission 'publish' for this package.- Parameters:
user- the user to add- Since:
- 3.1.158
-
removePublishUser
Removes the given user from the list ofUser's which have the permission 'publish' for this package.- Parameters:
user- the user to remove- Since:
- 3.1.158
-
getResponsibleUsers
Gets an unmodifiable list of responsibleUser's of this package.- Returns:
- List of responsible
User's - Since:
- 3.1.158
-
addResponsibleUser
Adds the given user to the list of responsibleUser's of this package.- Parameters:
user- the user to add- Since:
- 3.1.158
-
removeResponsibleUser
Removes the given user from the list of responsibleUser's of this package.- Parameters:
user- the user to remove- Since:
- 3.1.158
-
getAuthorisedUsers
Gets an unmodifiable list of authorisedUser's of this package.- Returns:
- List of authorised
User's - Since:
- 3.1.158
-
addAuthorisedUser
Adds the given user to the list of authorisedUser's of this package.- Parameters:
user- the user to add- Since:
- 3.1.158
-
removeAuthorisedUser
Removes the given user from the list of authorisedUser's of this package.- Parameters:
user- the user to remove- Since:
- 3.1.158
-
getWorkflowName
Gets the name of theWorkflowwhich is mapped to the given event type.- Parameters:
type-WF_OK,WF_ERROR,WF_CONFLICT,WF_RELEASE,WF_ACTUALIZE- Returns:
nullif no workflow is defined for this type, else the node id of the workflow node- Since:
- 3.1.158
-
setWorkflow
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_ACTUALIZEworkflow- the workflow to map to the event type- Since:
- 3.1.158
-
getCustomEventNames
Deprecated.since 5.0.39 - no replacement -
getCustomEventScripts
Deprecated.since 5.0.39 - no replacement -
setCustomScriptName
Deprecated.since 5.0.39 - no replacement -
removeCustomEvent
Deprecated.since 5.0.39 - no replacement -
getCustomEventScriptName
Deprecated.since 5.0.39 - no replacement -
delete
void delete()Deletes this package. Requires alockto this package.- Since:
- 3.1.158
-
useNameSpaceEnhancement
boolean useNameSpaceEnhancement()Indicates whether the uid of elements which areaddedto this package will be enhanced with '@PACKAGE_NAME' or not. This flag is used as fallback if there is no specialtype settingfor the element which is added.- Returns:
trueif 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. Usetrueto enable name space enhancement with '@PACKAGE_NAME' for the uid of elements which areaddedto this package. For type specific settings usesetUseNameSpaceEnhancement(boolean, Class[])- Since:
- 4.1.10
- See Also:
-
useNameSpaceEnhancement
Indicates whether the uid of an element of the given clazz should be enhanced with '@PACKAGE_NAME' or not duringPackagePoolItem.addToPackage(Package). This method also regards inheritance of the given class and the fallback settinguseNameSpaceEnhancement()if there is no special setting for the given clazz.
Inheritance example:
If namespace enhancement is set tofalseforTemplate.classa call touseNameSpaceEnhancement(TableTemplate.class)deliversfalsecause TableTemplate inherites interface Template- Returns:
trueif elements should be enhanced with '@PACKAGE_NAME',falseotherwise- Since:
- 4.1.10
- See Also:
-
setUseNameSpaceEnhancement
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 anuidconflict duringimportof this package.
Returnstrueif package pool items should be overwritten,falseotherwise.- Returns:
true(default) if elements with uid conflict should be overwritten during import,falseotherwise- Since:
- 4.1.10
-
setOverwriteDuringImport
void setOverwriteDuringImport(boolean overwrite) Defines how to handle elements which causes anuidconflict duringimportof this package.
Iftrue(default) existing elements intarget projectwith the same uid will be overwritten with the package pool item of this package.
Iffalseexisting elements will be retained and the package pool item of this package will inserted with an unifieduid- Since:
- 4.1.10
- See Also:
-
overwriteDuringImport
Indicates how to handle package pool items of the given clazz which causes anuidconflict duringimportof this package.
Returnstrueif package pool items should be overwritten,falseotherwise. This method also regards inheritance of the given class and the fallback settingoverwriteDuringImport()if there is no special setting for the given clazz.
Inheritance example:
Ifoverwrite during importis set tofalseforTemplate.classa call tooverwriteDuringImport(TableTemplate.class)deliversfalsecause TableTemplate inherites interface Template- Returns:
trueif elements with uid conflict should be overwritten during import,falseotherwise- Since:
- 4.1.10
- See Also:
-
setOverwriteDuringImport
Set overwrite handling for specified types. -
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:
-
PackagePoolItem.addToPackage(Package)