com.ibm.workplace.wcm.api.editions
Interface EditionService

All Superinterfaces:
Disposable

public interface EditionService
extends Disposable

EditionsService enables access to the WCM Editions API

This service is used to manage Edition within the WCM repository. With this service one can create, delete, and locate existing Editions. The service can be obtained via one of the home interfaces listed below.

Since:
8.5
See Also:
EditionServiceHome, EditionServiceProvider

Method Summary
 EditionDelta compare(Edition start, Edition end)
          Compare the two Editions and return a set of differences.
 long count(EditionQuery query)
          Count the query result without retrieving the actual editions.
 Edition create(java.lang.String name, java.util.Locale localeOfName)
          Create a new Edition.
 EditionQuery createQuery()
          Creates a empty query that will inherit the default options.
 void delete(Edition edition)
          Deletes the given Edition
 boolean existsInEdition(Identity<?> p_idRef)
          Returns true if the specified Identity exists in an Edition
 java.util.Iterator<Edition> find(EditionQuery query)
          Return Editions match search criteria
 PageIterator<Edition> find(EditionQuery query, int resultsPerPage, int firstPage)
          Return Editions match search criteria with paging parameter.
 Edition get(Identity<Edition> editionId)
          Retrieve the Edition that has the provided Id.
 Identity<Edition> getIdentity(java.lang.String editionId)
          Retrieves an Identity object for the given edition unique Id.
 boolean hasEditions()
          Returns true if any Editions have been created within the Repository
 Edition rename(Edition edition, java.lang.String newName, java.util.Locale localeOfName)
          Renames the Edition to the new name.
 
Methods inherited from interface com.ibm.portal.Disposable
dispose
 

Method Detail

create

Edition create(java.lang.String name,
               java.util.Locale localeOfName)
               throws com.ibm.workplace.wcm.api.exceptions.EditionException,
                      com.ibm.workplace.wcm.api.exceptions.AuthorizationException
Create a new Edition. Will contain the current Version of all items in the WCM workspace. Results in a new edition being created immediately.

Parameters:
name - - name of the newly created Edition
localeOfName - - locale of the supplied name
Returns:
Edition object representing the newly created Edition
Throws:
com.ibm.workplace.wcm.api.exceptions.EditionException - If there are any errors creating the Edition.
com.ibm.workplace.wcm.api.exceptions.AuthorizationException - if the user does not have Administrator access to the WCM repository
Since:
8.5

hasEditions

boolean hasEditions()
Returns true if any Editions have been created within the Repository

Returns:
true if any Editions exist in the Repository
Since:
8.5

existsInEdition

boolean existsInEdition(Identity<?> p_idRef)
                        throws com.ibm.workplace.wcm.api.exceptions.EditionException,
                               com.ibm.workplace.wcm.api.exceptions.AuthorizationException
Returns true if the specified Identity exists in an Edition

Parameters:
p_idRef -
Returns:
boolean true if exists in any editions
Throws:
com.ibm.workplace.wcm.api.exceptions.EditionException
com.ibm.workplace.wcm.api.exceptions.AuthorizationException
Since:
8.5

get

Edition get(Identity<Edition> editionId)
            throws com.ibm.workplace.wcm.api.exceptions.EditionException,
                   com.ibm.workplace.wcm.api.exceptions.AuthorizationException
Retrieve the Edition that has the provided Id.

Parameters:
editionId - unique id of the Edition to retrieve
Returns:
renamed edition
Throws:
com.ibm.workplace.wcm.api.exceptions.EditionException - If there are any errors retrieving the Edition.
com.ibm.workplace.wcm.api.exceptions.AuthorizationException - if the user does not have Editor access to the WCM repository
Since:
8.5

rename

Edition rename(Edition edition,
               java.lang.String newName,
               java.util.Locale localeOfName)
               throws com.ibm.workplace.wcm.api.exceptions.EditionException,
                      com.ibm.workplace.wcm.api.exceptions.AuthorizationException
Renames the Edition to the new name. Rename takes affect immediately.

Parameters:
edition - Edition to be renamed
newName - new name of the Edition
localeOfName - - locale of the supplied name
Returns:
Edition with Id editionId
Throws:
com.ibm.workplace.wcm.api.exceptions.EditionException - If there are any errors retrieving the Edition.
com.ibm.workplace.wcm.api.exceptions.AuthorizationException - if the user does not have Editor access to the WCM repository
Since:
8.5

createQuery

EditionQuery createQuery()
                         throws com.ibm.workplace.wcm.api.exceptions.EditionException
Creates a empty query that will inherit the default options.

Returns:
A empty EditionQuery
Throws:
com.ibm.workplace.wcm.api.exceptions.EditionException - if any error occurs generating the Query object
Since:
8.5

find

java.util.Iterator<Edition> find(EditionQuery query)
                                 throws com.ibm.workplace.wcm.api.exceptions.EditionException,
                                        com.ibm.workplace.wcm.api.exceptions.AuthorizationException
Return Editions match search criteria

Parameters:
query - search criteria to use to locate Editions
Returns:
Iterator of editions that match the query
Throws:
com.ibm.workplace.wcm.api.exceptions.EditionException - if any error occurs performing the search
com.ibm.workplace.wcm.api.exceptions.AuthorizationException - if the user does not have Editor access to the WCM repository
Since:
8.5

find

PageIterator<Edition> find(EditionQuery query,
                           int resultsPerPage,
                           int firstPage)
                           throws com.ibm.workplace.wcm.api.exceptions.EditionException,
                                  com.ibm.workplace.wcm.api.exceptions.AuthorizationException
Return Editions match search criteria with paging parameter. This query will ignore any MaximumResults value specified on the query param

Parameters:
query - search criteria to use to locate Editions
resultsPerPage - how many results per page
firstPage - the first page of the return result
Returns:
Iterator of editions that match the query
Throws:
com.ibm.workplace.wcm.api.exceptions.EditionException - if any error occurs performing the search
com.ibm.workplace.wcm.api.exceptions.AuthorizationException - if the user does not have Editor access to the WCM repository
Since:
8.5

count

long count(EditionQuery query)
           throws com.ibm.workplace.wcm.api.exceptions.EditionException,
                  com.ibm.workplace.wcm.api.exceptions.AuthorizationException
Count the query result without retrieving the actual editions.

Parameters:
query - search criteria to use to locate Editions
Returns:
number of editions that match the query
Throws:
com.ibm.workplace.wcm.api.exceptions.EditionException - if any error occurs performing the search
com.ibm.workplace.wcm.api.exceptions.AuthorizationException - if the user does not have Editor access to the WCM repository

delete

void delete(Edition edition)
            throws com.ibm.workplace.wcm.api.exceptions.EditionException,
                   com.ibm.workplace.wcm.api.exceptions.AuthorizationException
Deletes the given Edition

Parameters:
edition - to be deleted
Throws:
com.ibm.workplace.wcm.api.exceptions.EditionException - if any error occurs deleting the Edition
com.ibm.workplace.wcm.api.exceptions.AuthorizationException - if the user does not have Administrator access to the WCM repository
Since:
8.5

compare

EditionDelta compare(Edition start,
                     Edition end)
                     throws com.ibm.workplace.wcm.api.exceptions.EditionException,
                            com.ibm.workplace.wcm.api.exceptions.AuthorizationException
Compare the two Editions and return a set of differences. The differences will be broken down into three parts.
  • Additions made between the start and the end.
  • Deletions made between the start and the end.
  • Updates made between the start and the end.
The differences will be returned in such a fashion that if you were to call getEdition(start), then apply the changes returned in EditionDelta, the result should be the same as calling getEdition(end). All deltas are calculated based upon the DocumentId of the Nodes as they exist(ed) in workspace at the point in which the Editions were created.

The Edition specified as start must have bee created prior to end Edition.

Parameters:
start - the Edition that is to be used as the starting point of the comparison
end - the Edition that is to be used as the ending point of the comparison
Returns:
object that contains the changes between the starting Edition and the ending Edition
Throws:
com.ibm.workplace.wcm.api.exceptions.EditionException - is any error occurs comparing the Editions
com.ibm.workplace.wcm.api.exceptions.AuthorizationException - if the user does not have Editor access to the WCM repository
Since:
8.5

getIdentity

Identity<Edition> getIdentity(java.lang.String editionId)
                              throws com.ibm.workplace.wcm.api.exceptions.EditionException
Retrieves an Identity object for the given edition unique Id.

The editionId should be a string that was previously returned from the getID() method of an existing Edition's Identity

Parameters:
editionId - unique id of the Edition to retrieve an Identity for.
Returns:
the Identity for the given edition
Throws:
com.ibm.workplace.wcm.api.exceptions.EditionException - is any error occurs in creating the Identity