Interface Subscription
@NonExtendable
public interface Subscription
This interface provides methods to handle the subscription to a corporate-content
package
.- Since:
- 3.1.158
-
Field Summary
Modifier and TypeFieldDescriptionstatic final byte
Defines the mode automatic.static final byte
Defines the mode manual.static final byte
Defines the release mode automatic.static final byte
Defines the release mode workflow.static final byte
Strategy for update conflicts (the local copy and the original have been modified): .static final byte
Strategy for update conflicts (the local copy and the original have been modified): An error is reported and the update / import process is cancelled.static final byte
Strategy for update conflicts (the local copy and the original have been modified): Override local changes. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deprecated, for removal: This API element is subject to removal in a future version.since 5.0.101 - no replacementboolean
delete()
Deletes this subscription.void
excludeNode
(IDProvider storeElement) Excludes the given storeelement from the list of nodes which will be imported from the package.byte
The conflict mode defines a strategy to handle conflicts which occurs during the import of this subscription.
A conflict occurs, when the local copy and the source of a subscribed element both have been changed since the last update of the subscription.@NotNull IdTranslator
Provides a translator between element IDs from the publisher project to thesubscriber project
.Returns a read-only list ofStoreElement
's which are excluded from the list of startnodes in the belongingPackage
of this subscription.@Nullable Calendar
Returns the date of the last import.@Nullable PackageImportLogfile
Returns the import log file of the last import of this subscription ornull
if no import log file exists.Returns the package this subscription is belonging toint
Gets the version number of the last imported package version or-1
if nothing has been imported yetGets the publish group of this subscription.byte
Gets the release mode of this subscription.
RELEASE_MODE_AUTO
(default) : all nodes which were updated or created during the import of this subscription will be released automatically.
RELEASE_MODE_WORKFLOW
: after the import of this subscription the defined release workflow (setWorkflow(byte, Workflow)
) will be started.Deprecated, for removal: This API element is subject to removal in a future version.since 5.0.101 - no replacement@Nullable Project
Returns the subscriberProject
of this subscription.
The update of this subscription will be imported into the subscriber project.@NotNull IdTranslator
Provides a translator between template IDs from the publisher project to thesubscriber project
.byte
Gets the update mode of this subscription.
If the update mode isMODE_AUTOMATIC
(default) the import of this subscription will start automatically as soon as a new version of the belongingPackage
is available.
InMODE_MANUAL
mode the import has to be started manually.getWorkflow
(byte type) Gets the workflow defined for the given event type.getWorkflowName
(byte type) Gets the name of the workflow which is mapped to the given event type.boolean
Returnstrue
if an error occurred during the import of the lastPackageVersion
void
includeNode
(IDProvider storeElement) Includes the given storeelement to the list of nodes which will be imported from the package.boolean
isActive()
Returnstrue
if this subscription is active,false
otherwise
If the subscription is inactive the update will not be processed.boolean
boolean
Returnstrue
if thePackage
subscribed by thisSubscription
has 'no' newerPackageVersion
as the last importedPackageVersion
in the subscriber-project of thisSubscription
void
Executes the import of this subscription.
The lastPackageVersion
existing in the underlyingPackage
will be imported.void
refresh()
Refreshes this subscription with the subcription object from the server.
Call to rollback changesvoid
Deprecated, for removal: This API element is subject to removal in a future version.since 5.0.101 - no replacementvoid
save()
Call to this method makes all changes to this subscription persistent on the server.void
setActive
(boolean activate) Activates / Deactivates this subscription.void
setChangeable
(boolean changeable) Sets the changeable flag for this subscription.void
setConflictMode
(byte conflictMode) Sets the conflict mode for this subscription.void
setPublishGroup
(PublishGroup value) Sets the given publish group for this subscriptionvoid
setReleaseMode
(byte releaseMode) Sets the release mode for this subscription.void
setUpdateMode
(byte updateMode) Sets the update mode for this subscription.void
setWorkflow
(byte type, Workflow workflow) Sets the given workflow for the given event type.
-
Field Details
-
MODE_AUTOMATIC
static final byte MODE_AUTOMATICDefines the mode automatic.- Since:
- 3.1.158
- See Also:
-
MODE_MANUAL
static final byte MODE_MANUALDefines the mode manual.- Since:
- 3.1.158
- See Also:
-
RELEASE_MODE_AUTO
static final byte RELEASE_MODE_AUTODefines the release mode automatic.- Since:
- 3.1.158
- See Also:
-
RELEASE_MODE_WORKFLOW
static final byte RELEASE_MODE_WORKFLOWDefines the release mode workflow.- Since:
- 3.1.158
- See Also:
-
STRATEGY_OVERRIDE
static final byte STRATEGY_OVERRIDEStrategy for update conflicts (the local copy and the original have been modified): Override local changes.- Since:
- 3.1.158
- See Also:
-
STRATEGY_ERROR
static final byte STRATEGY_ERRORStrategy for update conflicts (the local copy and the original have been modified): An error is reported and the update / import process is cancelled.- Since:
- 3.1.158
- See Also:
-
STRATEGY_COPY
static final byte STRATEGY_COPYStrategy for update conflicts (the local copy and the original have been modified): .- Since:
- 3.1.158
- See Also:
-
-
Method Details
-
getPublishGroup
PublishGroup getPublishGroup()Gets the publish group of this subscription.During the update the latest
PackageVersion
existing in the subscribedPackage
, which is published for the returned publish group, is imported.- Returns:
- PublishGroup the publish group of this subscription
- Since:
- 3.1.158
-
setPublishGroup
Sets the given publish group for this subscription- Parameters:
value
-- Since:
- 3.1.158
-
getPackage
Package getPackage()Returns the package this subscription is belonging to- Returns:
- Package the package of this subscription
- Since:
- 3.1.158
-
getSubscriber
Returns the subscriberProject
of this subscription.
The update of this subscription will be imported into the subscriber project.- Returns:
- Project the subscriber project of this subscription
- Since:
- 3.1.158
-
getLastImport
Returns the date of the last import.- Returns:
- the date of the last import or
null
if nothing has been imported yet - Since:
- 3.1.158
-
getLastImportLogfile
Returns the import log file of the last import of this subscription ornull
if no import log file exists.- Since:
- 4.2.34
-
getPackageVersion
int getPackageVersion()Gets the version number of the last imported package version or-1
if nothing has been imported yet- Returns:
- the version of the last imported package version
- Since:
- 3.1.158
- See Also:
-
isUptoDate
boolean isUptoDate()Returnstrue
if thePackage
subscribed by thisSubscription
has 'no' newerPackageVersion
as the last importedPackageVersion
in the subscriber-project of thisSubscription
- Returns:
- boolean
true
if uptoDate,false
otherwise - Since:
- 3.1.158
-
hasImportErrors
boolean hasImportErrors()Returnstrue
if an error occurred during the import of the lastPackageVersion
- Returns:
- boolean
true
if an error occurred,false
otherwise - Since:
- 3.1.158
-
isActive
boolean isActive()Returnstrue
if this subscription is active,false
otherwise
If the subscription is inactive the update will not be processed.- Returns:
true
if this subscription is activefalse
otherwise- Since:
- 3.1.158
-
setActive
void setActive(boolean activate) Activates / Deactivates this subscription.- Parameters:
activate
-true
to activate,false
to deactivate the subscription- Since:
- 3.1.158
-
isChangeable
boolean isChangeable()The changeable flag indicates if the nodes containing in thePackage
which is subscribed by this subscription, are changeable (true
) in the subscriberProject
or not (false
).- Returns:
true
imported nodes are changeable,false
- read-only- Since:
- 3.1.158
-
setChangeable
void setChangeable(boolean changeable) Sets the changeable flag for this subscription.- Parameters:
changeable
-- Since:
- 3.1.158
- See Also:
-
getSiteStoreVariablesToOverride
Deprecated, for removal: This API element is subject to removal in a future version.since 5.0.101 - no replacementAlways provides an empty set.- Returns:
- An empty set.
-
addSitestoreVariableToOverride
Deprecated, for removal: This API element is subject to removal in a future version.since 5.0.101 - no replacementDoes nothing.- Parameters:
name
- A name.
-
removeSitestoreVariable
Deprecated, for removal: This API element is subject to removal in a future version.since 5.0.101 - no replacementDoes nothing.- Parameters:
name
- A name.
-
excludeNode
Excludes the given storeelement from the list of nodes which will be imported from the package. The given element must be from themaster project
and NOT from thesubscriber
.- Parameters:
storeElement
- the element from master project respectively the element from the package- Since:
- 3.1.158
-
includeNode
Includes the given storeelement to the list of nodes which will be imported from the package. The given element must be from themaster project
and NOT from thesubscriber
.- Parameters:
storeElement
- the element from master project respectively the element from the package- Since:
- 3.1.158
-
getExclusionNodeList
Collection<IDProvider> getExclusionNodeList()Returns a read-only list ofStoreElement
's which are excluded from the list of startnodes in the belongingPackage
of this subscription.- Returns:
- a read-only List of
StoreElement
's - Since:
- 3.1.158
-
getUpdateMode
byte getUpdateMode()Gets the update mode of this subscription.
If the update mode isMODE_AUTOMATIC
(default) the import of this subscription will start automatically as soon as a new version of the belongingPackage
is available.
InMODE_MANUAL
mode the import has to be started manually.- Returns:
MODE_AUTOMATIC
orMODE_MANUAL
- Since:
- 3.1.158
-
setUpdateMode
void setUpdateMode(byte updateMode) Sets the update mode for this subscription.- Parameters:
updateMode
-MODE_AUTOMATIC
orMODE_MANUAL
- Since:
- 3.1.158
- See Also:
-
getReleaseMode
byte getReleaseMode()Gets the release mode of this subscription.
RELEASE_MODE_AUTO
(default) : all nodes which were updated or created during the import of this subscription will be released automatically.
RELEASE_MODE_WORKFLOW
: after the import of this subscription the defined release workflow (setWorkflow(byte, Workflow)
) will be started.- Returns:
RELEASE_MODE_AUTO
(default) orRELEASE_MODE_WORKFLOW
- Since:
- 3.1.158
-
setReleaseMode
void setReleaseMode(byte releaseMode) Sets the release mode for this subscription.- Parameters:
releaseMode
-RELEASE_MODE_AUTO
(default) orRELEASE_MODE_WORKFLOW
- Since:
- 3.1.158
- See Also:
-
getConflictMode
byte getConflictMode()The conflict mode defines a strategy to handle conflicts which occurs during the import of this subscription.
A conflict occurs, when the local copy and the source of a subscribed element both have been changed since the last update of the subscription.- Returns:
STRATEGY_OVERRIDE
(default),STRATEGY_ERROR
, orSTRATEGY_COPY
- Since:
- 3.1.158
-
setConflictMode
void setConflictMode(byte conflictMode) Sets the conflict mode for this subscription.- Parameters:
conflictMode
-STRATEGY_OVERRIDE
,STRATEGY_ERROR
, orSTRATEGY_COPY
- Since:
- 3.1.158
- See Also:
-
getWorkflow
Gets the workflow defined for the given event type. The mapping event -> workflow is by default inherited from the subsribedPackage
. This mapping could be overridden by usingsetWorkflow(byte, Workflow)
- Parameters:
type
-Package.WF_OK
,Package.WF_ERROR
,Package.WF_CONFLICT
,Package.WF_RELEASE
,Package.WF_ACTUALIZE
- Returns:
- workflow the workflow which is mapped to the given type
- Since:
- 3.1.158
-
getWorkflowName
Gets the name of the workflow which is mapped to the given event type.- Parameters:
type
-Package.WF_OK
,Package.WF_ERROR
,Package.WF_CONFLICT
,Package.WF_RELEASE
,Package.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
Sets the given workflow for the given event type.- Parameters:
type
-Package.WF_OK
,Package.WF_ERROR
,Package.WF_CONFLICT
,Package.WF_RELEASE
,Package.WF_ACTUALIZE
workflow
-- Since:
- 3.1.158
-
pullImport
void pullImport()Executes the import of this subscription.
The lastPackageVersion
existing in the underlyingPackage
will be imported.- Throws:
de.espirit.firstspirit.access.packagepool.NoPackageVersionExistingException
- if noPackageVersion
existing in belonging thePackage
which is released for the underlyingPublishGroup
- Since:
- 3.1.158
- See Also:
-
save
void save()Call to this method makes all changes to this subscription persistent on the server.- Since:
- 3.1.158
-
delete
boolean delete()Deletes this subscription.- Returns:
true
if this subscription was successfully deleted,false
otherwise- Since:
- 3.1.158
-
refresh
void refresh()Refreshes this subscription with the subcription object from the server.
Call to rollback changes- Since:
- 3.1.158
-
getElementIdTranslator
Provides a translator between element IDs from the publisher project to thesubscriber project
. Reuse the provided IdTranslator for multiple id translation calls.- Returns:
- The element ID translator.
- Since:
- 5.1.504, 5.2.103
-
getTemplateIdTranslator
Provides a translator between template IDs from the publisher project to thesubscriber project
. Reuse the provided IdTranslator for multiple id translation calls.- Returns:
- The template ID translator.
- Since:
- 5.1.504, 5.2.103
-