public interface Package extends Lockable, Comparable<Package>
Package
object needs to be locked for
modifying operations. Use Lockable.isLocked()
and Lockable.lock()
to
manage the locking of the packge.Lockable.save()
to make the changes persistent on the server.Lockable.refresh()
instead of Lockable.save()
Modifier and Type | Interface and Description |
---|---|
static class |
Package.Type
Enum representing a package type.
|
Modifier and Type | Field and Description |
---|---|
static int |
CONTENT_PACKAGE |
static int |
TEMPLATE_PACKAGE |
static byte |
WF_ACTUALIZE |
static byte |
WF_CONFLICT |
static byte |
WF_ERROR |
static byte |
WF_OK |
static byte |
WF_RELEASE |
Modifier and Type | Method and Description |
---|---|
void |
addAuthorisedUser(User user)
Adds the given user to the list of
authorised
User 's of this package. |
void |
addPublishUser(User user)
Adds the given user to the list of
User 's
which have the permission 'publish' for this package. |
void |
addResponsibleUser(User user)
Adds the given user to the list of
responsible
User 's of this package. |
void |
addStartNode(IDProvider storeElement)
Add a start node.
|
boolean |
containsStartNode(IDProvider node)
Checks if the given start node is existing in the
underlying start node list of this package.
|
PackageVersion |
createVersion(String tag,
String comment)
Create a new version.
|
PackageVersion |
createVersion(String tag,
String comment,
boolean update)
Creates a new version.
|
void |
delete() |
Map<Class<? extends PackagePoolItem>,Boolean> |
getAllNameSpaceEnhancements()
Get all defined NameSpaceEnhancement Settings for this package.
|
Map<Class<? extends PackagePoolItem>,Boolean> |
getAllOverwriteDuringImportSettings()
Get all defined OverwriteDuringImport Settings for this package.
|
List<User> |
getAuthorisedUsers()
Gets an unmodifiable list of authorised
User 's
of this package. |
String |
getComment()
Returns the comment of this package.
|
Set<String> |
getCustomEventNames()
Deprecated.
since 5.0.39 - no replacement
|
String |
getCustomEventScriptName(String eventName)
Deprecated.
since 5.0.39 - no replacement
|
Map<String,String> |
getCustomEventScripts()
Deprecated.
since 5.0.39 - no replacement
|
long |
getId()
Gets the id of this package.
|
String |
getName()
Returns the name of
this package.
|
Package.Type |
getPackageType()
Returns the type of this package.
|
Project |
getPublisher()
Gets the publisher
Project of this package. |
List<User> |
getPublishUsers()
Gets an unmodifiable list of
User 's which have the
permission 'publish' for this package. |
List<User> |
getResponsibleUsers()
Gets an unmodifiable list of responsible
User 's
of this package. |
Collection<IDProvider> |
getStartNodes()
Returns a read-only List of
StoreElement 's of
start nodes existing in this package. |
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. |
int |
getType()
Returns the type of this package.
|
int |
getVersion()
Gets the version of this package.
|
List<PackageVersion> |
getVersions()
Returns a readonly list of
PackageVersion 's
existing for this package. |
String |
getWorkflowName(byte type)
Gets the name of the
Workflow which is mapped to
the given event type. |
boolean |
isAvailable()
This flag indicates if the package is available.
|
boolean |
isReadOnly()
Read only packages: Content in subscribing may not be changed.
|
boolean |
isValidNodeType(StoreElement node) |
boolean |
overwriteDuringImport()
|
boolean |
overwriteDuringImport(Class<? extends PackagePoolItem> clazz)
|
void |
publishPackage()
Publish this package.
|
void |
publishPackage(PublishGroup publishGroup)
Publish this package for the specified group.
|
void |
removeAuthorisedUser(User user)
Removes the given user from the list of
authorised
User 's of this package. |
void |
removeCustomEvent(String eventName)
Deprecated.
since 5.0.39 - no replacement
|
void |
removePublishUser(User user)
Removes the given user from the list of
User 's
which have the permission 'publish' for this package. |
void |
removeResponsibleUser(User user)
Removes the given user from the list of
responsible
User 's of this package. |
void |
removeStartNode(IDProvider storeElement)
Removes the given
StoreElement from the list of start nodes. |
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 replacement
|
void |
setName(String name)
Sets the name for this package.
|
void |
setOverwriteDuringImport(boolean overwrite)
|
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.
|
Subscription |
subscribePackage(Project subscriber)
Creates a new
Subscription to this package from
the given Project . |
Subscription |
subscribePackage(Project subscriber,
PublishGroup publishGroup)
|
boolean |
useNameSpaceEnhancement()
Indicates whether the uid of elements which are
added
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 during
PackagePoolItem.addToPackage(Package) . |
isChanged, isLocked, lock, refresh, save, unlock
compareTo
static final int CONTENT_PACKAGE
static final int TEMPLATE_PACKAGE
static final byte WF_OK
static final byte WF_ERROR
static final byte WF_CONFLICT
static final byte WF_RELEASE
static final byte WF_ACTUALIZE
long getId()
String getName()
void setName(String name)
name
- String the new nameString getComment()
void setComment(String comment)
comment
- String the new commentint getType()
CONTENT_PACKAGE
or TEMPLATE_PACKAGE
Package.Type getPackageType()
Package.Type
boolean isValidNodeType(StoreElement node)
true
if the type of the specified node is a valid content type for this package,
false
otherwise. Only nodes wich implement PackagePoolItem
may be a valid.Collection<IDProvider> getStartNodes()
StoreElement
's of
start nodes existing in this package.StoreElement
boolean containsStartNode(IDProvider node)
node
- to check againsttrue
if the given node is existing, false
otherwiseCollection<IDProvider> getStartNodes(Store.Type storeType)
StoreElement
's of
start nodes existing in this package from the given Store type.storeType
- StoreElement
) for the specified store (maybe empty)void addStartNode(IDProvider storeElement)
storeElement
- IllegalArgumentException
- if the provided store element does not belong to the
publisher project or e.g. a template node is added to a content packagevoid removeStartNode(IDProvider storeElement)
StoreElement
from the list of start nodes.storeElement
- the StoreElement
to removeint getVersion()
Lockable.save()
increases this
version if the package was changed.List<PackageVersion> getVersions()
PackageVersion
's
existing for this package.PackageVersion
'sPackageVersion createVersion(String tag, String comment)
Lockable.save()
for this package to create version zip on the server.tag
- the tag for the new versioncomment
- the comment for the new versionPackageVersion createVersion(String tag, String comment, boolean update)
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.tag
- the tag for the new versioncomment
- the comment for the new versionupdate
- indicates whether the created version should be an update versionvoid removeVersion(PackageVersion version)
version
- the PackageVersion to removeSubscription subscribePackage(Project subscriber)
Subscription
to this package from
the given Project
.Subscription
is created with the default PublishGroup
.
To create a subscription with a different publishgroup use
subscribePackage(Project, PublishGroup)
subscriber
- the Project
which subscribes the packageSubscription
the new subscriptionSubscription subscribePackage(Project subscriber, PublishGroup publishGroup)
subscriber
- the Project
which subscribes the packagepublishGroup
- the PublishGroup
to create the subscription forSubscription
the new subscriptionvoid publishPackage(PublishGroup publishGroup)
Subscription
's of this package which uses the given
PublishGroup
.void publishPackage()
Subscription
's of this package on the server.@Nullable Project getPublisher()
Project
of this package.null
.Project
master projectboolean isReadOnly()
setReadOnly(boolean)
void setReadOnly(boolean value)
isReadOnly()
boolean isAvailable()
true
if this package is available,
false
otherwise.void setAvailable(boolean available)
available
- true
to activate,
false
to deactivate the packageList<User> getPublishUsers()
User
's which have the
permission 'publish' for this package.User
'svoid addPublishUser(User user)
User
's
which have the permission 'publish' for this package.user
- the user to addvoid removePublishUser(User user)
User
's
which have the permission 'publish' for this package.user
- the user to removeList<User> getResponsibleUsers()
User
's
of this package.User
'svoid addResponsibleUser(User user)
User
's of this package.user
- the user to addvoid removeResponsibleUser(User user)
User
's of this package.user
- the user to removeList<User> getAuthorisedUsers()
User
's
of this package.User
'svoid addAuthorisedUser(User user)
User
's of this package.user
- the user to addvoid removeAuthorisedUser(User user)
User
's of this package.user
- the user to removeString getWorkflowName(byte type)
Workflow
which is mapped to
the given event type.type
- WF_OK
, WF_ERROR
, WF_CONFLICT
, WF_RELEASE
, WF_ACTUALIZE
null
if no workflow is defined for this type, else the node id of the workflow nodevoid setWorkflow(byte type, Workflow workflow)
type
- WF_OK
, WF_ERROR
, WF_CONFLICT
, WF_RELEASE
, WF_ACTUALIZE
workflow
- the workflow to map to the event type@Deprecated Set<String> getCustomEventNames()
@Deprecated Map<String,String> getCustomEventScripts()
@Deprecated void setCustomScriptName(String eventName, String scriptName)
@Deprecated void removeCustomEvent(String eventName)
@Nullable @Deprecated String getCustomEventScriptName(String eventName)
void delete()
lock
to this packageboolean useNameSpaceEnhancement()
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.true
if elements should be enhanced with '@PACKAGE_NAME' during add to package, false
(default) otherwisesetUseNameSpaceEnhancement(boolean)
,
setUseNameSpaceEnhancement(boolean, Class[])
void setUseNameSpaceEnhancement(boolean enhanceNameSpace)
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[])
useNameSpaceEnhancement()
,
setUseNameSpaceEnhancement(boolean, Class[])
boolean useNameSpaceEnhancement(Class<? extends PackagePoolItem> clazz)
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.false
for Template.class
a call to useNameSpaceEnhancement(TableTemplate.class)
delivers false
cause TableTemplate inherites interface Templatetrue
if elements should be enhanced with '@PACKAGE_NAME', false
otherwiseuseNameSpaceEnhancement()
,
setUseNameSpaceEnhancement(boolean, Class[])
void setUseNameSpaceEnhancement(boolean useEnhancement, Class<? extends PackagePoolItem>... clazz)
useNameSpaceEnhancement(Class)
Map<Class<? extends PackagePoolItem>,Boolean> getAllNameSpaceEnhancements()
useNameSpaceEnhancement()
boolean overwriteDuringImport()
uid
conflict
during import
of this package.true
if package pool items should be overwritten, false
otherwise.true
(default) if elements with uid conflict should be overwritten during import, false
otherwisevoid setOverwriteDuringImport(boolean overwrite)
uid
conflict
during import
of this package.true
(default) existing elements in target project
with the same uid will be overwritten with the package pool
item of this package.false
existing elements will be retained and the package pool item of this package will inserted with an unified
uid
overwriteDuringImport()
boolean overwriteDuringImport(Class<? extends PackagePoolItem> clazz)
uid
conflict
during import
of this package.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.overwrite during import
is set to false
for Template.class
a call to overwriteDuringImport(TableTemplate.class)
delivers false
cause TableTemplate inherites interface Templatetrue
if elements with uid conflict should be overwritten during import, false
otherwiseoverwriteDuringImport()
,
setOverwriteDuringImport(boolean, Class[])
void setOverwriteDuringImport(boolean overwrite, Class<? extends PackagePoolItem>... clazz)
Map<Class<? extends PackagePoolItem>,Boolean> getAllOverwriteDuringImportSettings()
overwriteDuringImport()
Copyright © 2014 e-Spirit AG. All Rights Reserved. Build 5.0_BETA.500