Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.webapp.versioning
Class DocumentVersioningBean

java.lang.Object
  extended by org.nuxeo.ecm.webapp.versioning.DocumentVersioningBean
All Implemented Interfaces:
Serializable, DocumentVersioning

@Name(value="documentVersioning")
@Scope(value=CONVERSATION)
@Install(precedence=10)
public class DocumentVersioningBean
extends Object
implements DocumentVersioning, Serializable

Web action bean for document versioning. Used also by other seam components through injection.

Author:
Dragos Mihalache
See Also:
Serialized Form

Constructor Summary
DocumentVersioningBean()
           
 
Method Summary
 String factoryForIncrementationRules()
           
 boolean factoryForRenderVersioningOption()
           
 Map<String,String> getAvailableVersioningOptionsMap()
           
 boolean getCreateSnapshot()
          Deprecated. 
 VersionInfo getCurrentDocumentVersionInfo()
           
 Collection<VersionModel> getCurrentItemVersioningHistory()
          Returns the available versioning history for the current document and state.
 Collection<VersioningActions> getCurrentItemVersioningOptions()
          Deprecated. 
 boolean getDefaultCreateSnapshot()
          Deprecated. 
 boolean getDisplayCreateSnapshotOption()
          Deprecated. 
 String getIncRulesResult()
          Deprecated. 
 Collection<VersionModel> getItemVersioningHistory(DocumentModel document)
          Returns the available versioning options for the document parameter and state.
 boolean getRendered()
           
 String getVersioningOptionInstanceId()
           
 Map<String,String> getVersioningOptionsMap(DocumentModel doc)
          Creates a Map with versioning options (as keys) and labels (as map entry values).
 String getVersionLabel(DocumentModel doc)
           
 void resetRenderingStatus()
          For documents about to be created there should be no versioning options.
 void resetVersioningOption()
           
 void setCreateSnapshot(boolean createSnapshot)
          Deprecated. 
 void setRendered(Boolean rendered)
           
 void setVersioningOptionInstanceId(DocumentModel docModel, String optionId)
           
 void setVersioningOptionInstanceId(DocumentModel docModel, VersioningActions option)
           
 void setVersioningOptionInstanceId(String optionId)
          Web action method to set version increment option to the current documentModel.
 void validateOptionSelection(FacesContext context, UIComponent component, Object value)
          Versioning increment options - select radio component validator method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentVersioningBean

public DocumentVersioningBean()
Method Detail

getCurrentItemVersioningOptions

@Deprecated
public Collection<VersioningActions> getCurrentItemVersioningOptions()
Deprecated. 

Description copied from interface: DocumentVersioning
Returns the available versioning options for the currentItem and state.

Specified by:
getCurrentItemVersioningOptions in interface DocumentVersioning
Returns:
a collection of option names.

getItemVersioningHistory

public Collection<VersionModel> getItemVersioningHistory(DocumentModel document)
Description copied from interface: DocumentVersioning
Returns the available versioning options for the document parameter and state.

Specified by:
getItemVersioningHistory in interface DocumentVersioning
Parameters:
document - the document for which the versioning options will be returned
Returns:
a collection of option names.

getCurrentItemVersioningHistory

public Collection<VersionModel> getCurrentItemVersioningHistory()
Description copied from interface: DocumentVersioning
Returns the available versioning history for the current document and state.

Specified by:
getCurrentItemVersioningHistory in interface DocumentVersioning
Returns:
a collection of option names.

factoryForIncrementationRules

@Factory(value="currentDocumentIncrementationRules",
         scope=EVENT)
public String factoryForIncrementationRules()
Specified by:
factoryForIncrementationRules in interface DocumentVersioning

getCurrentDocumentVersionInfo

@Factory(autoCreate=true,
         value="currentDocumentVersionInfo",
         scope=EVENT)
public VersionInfo getCurrentDocumentVersionInfo()
                                          throws ClientException
Throws:
ClientException

getIncRulesResult

@Deprecated
public String getIncRulesResult()
Deprecated. 

Description copied from interface: DocumentVersioning
Provides an explaining message of the inc options availability.

Specified by:
getIncRulesResult in interface DocumentVersioning
Returns:
key for the message (to be read from messages bundles)

resetVersioningOption

@Observer(value={"documentSelectionChanged","documentChanged"},
          create=false)
@BypassInterceptors
public void resetVersioningOption()

getAvailableVersioningOptionsMap

public Map<String,String> getAvailableVersioningOptionsMap()
Specified by:
getAvailableVersioningOptionsMap in interface DocumentVersioning

resetRenderingStatus

@Observer(value="changeableDocumentCreated",
          create=false)
@BypassInterceptors
public void resetRenderingStatus()
For documents about to be created there should be no versioning options.


getVersioningOptionsMap

public Map<String,String> getVersioningOptionsMap(DocumentModel doc)
Description copied from interface: DocumentVersioning
Creates a Map with versioning options (as keys) and labels (as map entry values).

Specified by:
getVersioningOptionsMap in interface DocumentVersioning

getVersionLabel

public String getVersionLabel(DocumentModel doc)
                       throws ClientException
Specified by:
getVersionLabel in interface DocumentVersioning
Throws:
ClientException

getVersioningOptionInstanceId

public String getVersioningOptionInstanceId()
Specified by:
getVersioningOptionInstanceId in interface DocumentVersioning

setVersioningOptionInstanceId

public void setVersioningOptionInstanceId(String optionId)
                                   throws ClientException
Description copied from interface: DocumentVersioning
Web action method to set version increment option to the current documentModel.

Specified by:
setVersioningOptionInstanceId in interface DocumentVersioning
Throws:
ClientException

setVersioningOptionInstanceId

public void setVersioningOptionInstanceId(DocumentModel docModel,
                                          String optionId)
                                   throws ClientException
Specified by:
setVersioningOptionInstanceId in interface DocumentVersioning
Throws:
ClientException

setVersioningOptionInstanceId

public void setVersioningOptionInstanceId(DocumentModel docModel,
                                          VersioningActions option)
                                   throws ClientException
Specified by:
setVersioningOptionInstanceId in interface DocumentVersioning
Throws:
ClientException

validateOptionSelection

public void validateOptionSelection(FacesContext context,
                                    UIComponent component,
                                    Object value)
Description copied from interface: DocumentVersioning
Versioning increment options - select radio component validator method. Check if an option has been selected. This is mandatory since the component is being displayed.

Specified by:
validateOptionSelection in interface DocumentVersioning

setCreateSnapshot

@Deprecated
public void setCreateSnapshot(boolean createSnapshot)
Deprecated. 

Specified by:
setCreateSnapshot in interface DocumentVersioning

getCreateSnapshot

@Deprecated
public boolean getCreateSnapshot()
                          throws ClientException
Deprecated. 

Specified by:
getCreateSnapshot in interface DocumentVersioning
Throws:
ClientException

getDefaultCreateSnapshot

@Deprecated
public boolean getDefaultCreateSnapshot()
                                 throws ClientException
Deprecated. 

Specified by:
getDefaultCreateSnapshot in interface DocumentVersioning
Throws:
ClientException

getDisplayCreateSnapshotOption

@Deprecated
public boolean getDisplayCreateSnapshotOption()
                                       throws ClientException
Deprecated. 

Specified by:
getDisplayCreateSnapshotOption in interface DocumentVersioning
Throws:
ClientException

factoryForRenderVersioningOption

@Factory(value="renderVersioningOptionsForCurrentDocument",
         scope=EVENT)
public boolean factoryForRenderVersioningOption()
Specified by:
factoryForRenderVersioningOption in interface DocumentVersioning

getRendered

public boolean getRendered()

setRendered

public void setRendered(Boolean rendered)

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.