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
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Types a package to contain content.static final int
Types a package to contain template.static final byte
Marks the workflow state of actualizing.static final byte
Marks the workflow state Conflict.static final byte
Marks the workflow state Error.static final byte
Marks the workflow state OK.static final byte
Marks the workflow state Release. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAuthorisedUser
(User user) Adds the given user to the list of authorisedUser
's of this package.void
addPublishUser
(User user) Adds the given user to the list ofUser
's which have the permission 'publish' for this package.void
addResponsibleUser
(User user) Adds the given user to the list of responsibleUser
's of this package.void
addStartNode
(IDProvider storeElement) Deprecated.boolean
containsStartNode
(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.void
delete()
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 String
getCustomEventScriptName
(String eventName) Deprecated.since 5.0.39 - no replacementDeprecated.since 5.0.39 - no replacementlong
getId()
Gets the id of this package.getName()
Returns the name of this package.Returns the type of this package.@Nullable Project
Gets theProject
that 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.int
getType()
Returns the type of this package.int
Gets the version of this package.Returns a readonly list ofPackageVersion
's existing for this package.getWorkflowName
(byte type) Gets the name of theWorkflow
which is mapped to the given event type.boolean
This flag indicates if the package is available.boolean
Indicates whether content in subscribing project of this package is read only or not.boolean
isValidNodeType
(StoreElement node) Validates the given node's type.boolean
boolean
overwriteDuringImport
(Class<? extends PackagePoolItem> clazz) void
Publish this package.
Starts the import of allSubscription
's of this package on the server.void
publishPackage
(PublishGroup publishGroup) Publish this package for the specified group.
Starts the import of allSubscription
's of this package which uses the givenPublishGroup
.void
removeAuthorisedUser
(User user) Removes the given user from the list of authorisedUser
's of this package.void
removeCustomEvent
(String eventName) Deprecated.since 5.0.39 - no replacementvoid
removePublishUser
(User user) Removes the given user from the list ofUser
's which have the permission 'publish' for this package.void
removeResponsibleUser
(User user) Removes the given user from the list of responsibleUser
's of this package.void
removeStartNode
(IDProvider storeElement) Deprecated.since 5.2.305 - usePackagePoolItem.removeFromPackage(Package)
void
removeVersion
(PackageVersion version) Removes the given PackageVersion from this package.void
setAvailable
(boolean available) Set this package available / not available.void
setComment
(String comment) Sets the comment for this package.void
setCustomScriptName
(String eventName, String scriptName) Deprecated.since 5.0.39 - no replacementvoid
Sets the name for this package.void
setOverwriteDuringImport
(boolean overwrite) Defines how to handle elements which causes anuid
conflict duringimport
of this package.
Iftrue
(default) existing elements intarget project
with the same uid will be overwritten with the package pool item of this package.
Iffalse
existing elements will be retained and the package pool item of this package will inserted with an unifieduid
void
setOverwriteDuringImport
(boolean overwrite, Class<? extends PackagePoolItem>... clazz) Set overwrite handling for specified types.void
setReadOnly
(boolean value) Read only packages: Content in subscribing may not be changed.void
setUseNameSpaceEnhancement
(boolean enhanceNameSpace) Set use name space enhancement.void
setUseNameSpaceEnhancement
(boolean useEnhancement, Class<? extends PackagePoolItem>... clazz) Set use name space enhancement for specified types.void
setWorkflow
(byte type, Workflow workflow) Map the given workflow to the given event type.subscribePackage
(Project subscriber) Creates a newSubscription
to this package from the givenProject
.
TheSubscription
is created with the defaultPublishGroup
.subscribePackage
(Project subscriber, PublishGroup publishGroup) boolean
Indicates whether the uid of elements which areadded
to this package will be enhanced with '@PACKAGE_NAME' or not.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 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_PACKAGE
orTEMPLATE_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 implementPackagePoolItem
can 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:
true
if the given node is existing,false
otherwise- 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 givenStoreElement
from the list of start nodes.- Parameters:
storeElement
- theStoreElement
to 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 == true
the 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 newSubscription
to this package from the givenProject
.
TheSubscription
is created with the defaultPublishGroup
. To create a subscription with a different publishgroup usesubscribePackage(Project, PublishGroup)
- Parameters:
subscriber
- theProject
which subscribes the package- Returns:
Subscription
the new subscription- Since:
- 3.1.158
-
subscribePackage
- Parameters:
subscriber
- theProject
which subscribes the packagepublishGroup
- thePublishGroup
to create the subscription for- Returns:
Subscription
the 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 theProject
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 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:
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
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 theWorkflow
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
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.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 alock
to this package.- Since:
- 3.1.158
-
useNameSpaceEnhancement
boolean useNameSpaceEnhancement()Indicates whether the uid of elements which areadded
to this package will be enhanced with '@PACKAGE_NAME' or not. This flag is used as fallback if there is no specialtype 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. Usetrue
to enable name space enhancement with '@PACKAGE_NAME' for the uid of elements which areadded
to 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 tofalse
forTemplate.class
a call touseNameSpaceEnhancement(TableTemplate.class)
deliversfalse
cause TableTemplate inherites interface Template- Returns:
true
if elements should be enhanced with '@PACKAGE_NAME',false
otherwise- 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 anuid
conflict duringimport
of this package.
Returnstrue
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 anuid
conflict duringimport
of this package.
Iftrue
(default) existing elements intarget project
with the same uid will be overwritten with the package pool item of this package.
Iffalse
existing 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 anuid
conflict duringimport
of this package.
Returnstrue
if package pool items should be overwritten,false
otherwise. 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 import
is set tofalse
forTemplate.class
a call tooverwriteDuringImport(TableTemplate.class)
deliversfalse
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
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)