Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.contentview.jsf
Class ContentViewServiceImpl

java.lang.Object
  extended by org.nuxeo.runtime.model.DefaultComponent
      extended by org.nuxeo.ecm.platform.contentview.jsf.ContentViewServiceImpl
All Implemented Interfaces:
Serializable, ContentViewService, Adaptable, Component, Extensible

public class ContentViewServiceImpl
extends DefaultComponent
implements ContentViewService

Since:
5.4
Author:
Anahide Tchertchian
See Also:
Serialized Form

Field Summary
static String CONTENT_VIEW_EP
           
 
Constructor Summary
ContentViewServiceImpl()
           
 
Method Summary
<T> T
getAdapter(Class<T> adapter)
          Returns an object which is an instance of the given class associated with this object.
 ContentView getContentView(String name)
          Returns the content view with given name, or null if not found.
 ContentViewHeader getContentViewHeader(String name)
          Returns the content view header, or null if not found.
 Set<ContentViewHeader> getContentViewHeaders()
          Returns all the registered content view headers, or an empty set if no content view is registered.
 Set<ContentViewHeader> getContentViewHeaders(String flag)
          Returns all the registered content view headers with given flag declared on their definition
 Set<String> getContentViewNames()
          Returns all the registered content view names, or an empty set if no content view is registered.
 Set<String> getContentViewNames(String flag)
          Returns all the registered content view names with given flag declared on their definition
 PageProvider<?> getPageProvider(String name, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Object... parameters)
          Returns the page provider computed from the content view with given name.
 void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
           
 Map<String,Serializable> resolvePageProviderProperties(Map<String,String> stringProps)
           
 ContentView restoreContentView(ContentViewState contentViewState)
          Restores a content view given a state.
 ContentViewState saveContentView(ContentView contentView)
          Returns the state of this content view.
 void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
           
 
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, applicationStarted, deactivate, registerExtension, unregisterExtension
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT_VIEW_EP

public static final String CONTENT_VIEW_EP
See Also:
Constant Field Values
Constructor Detail

ContentViewServiceImpl

public ContentViewServiceImpl()
Method Detail

getContentView

public ContentView getContentView(String name)
                           throws ClientException
Description copied from interface: ContentViewService
Returns the content view with given name, or null if not found.

Specified by:
getContentView in interface ContentViewService
Throws:
ClientException

getContentViewHeader

public ContentViewHeader getContentViewHeader(String name)
Description copied from interface: ContentViewService
Returns the content view header, or null if not found.

Specified by:
getContentViewHeader in interface ContentViewService

getContentViewNames

public Set<String> getContentViewNames()
Description copied from interface: ContentViewService
Returns all the registered content view names, or an empty set if no content view is registered.

Specified by:
getContentViewNames in interface ContentViewService

getContentViewHeaders

public Set<ContentViewHeader> getContentViewHeaders()
Description copied from interface: ContentViewService
Returns all the registered content view headers, or an empty set if no content view is registered.

Specified by:
getContentViewHeaders in interface ContentViewService

getContentViewNames

public Set<String> getContentViewNames(String flag)
Description copied from interface: ContentViewService
Returns all the registered content view names with given flag declared on their definition

Specified by:
getContentViewNames in interface ContentViewService

getContentViewHeaders

public Set<ContentViewHeader> getContentViewHeaders(String flag)
Description copied from interface: ContentViewService
Returns all the registered content view headers with given flag declared on their definition

Specified by:
getContentViewHeaders in interface ContentViewService

getPageProvider

public PageProvider<?> getPageProvider(String name,
                                       List<SortInfo> sortInfos,
                                       Long pageSize,
                                       Long currentPage,
                                       Object... parameters)
                                throws ClientException
Description copied from interface: ContentViewService
Returns the page provider computed from the content view with given name. Its properties are resolved using current FacesContext instance if they are EL Expressions.

If not null, parameters sortInfos and pageSize will override information computed in the XML file. If not null, currentPage will override default current page (0).

Specified by:
getPageProvider in interface ContentViewService
Throws:
ClientException

resolvePageProviderProperties

public Map<String,Serializable> resolvePageProviderProperties(Map<String,String> stringProps)
                                                       throws ClientException
Throws:
ClientException

getAdapter

public <T> T getAdapter(Class<T> adapter)
Description copied from interface: Adaptable
Returns an object which is an instance of the given class associated with this object. Returns null if no such object can be found.

Specified by:
getAdapter in interface Adaptable
Overrides:
getAdapter in class DefaultComponent
Parameters:
adapter - the adapter class to look up
Returns:
a object castable to the given class, or null if this object does not have an adapter for the given class

registerContribution

public void registerContribution(Object contribution,
                                 String extensionPoint,
                                 ComponentInstance contributor)
                          throws Exception
Overrides:
registerContribution in class DefaultComponent
Throws:
Exception

unregisterContribution

public void unregisterContribution(Object contribution,
                                   String extensionPoint,
                                   ComponentInstance contributor)
                            throws Exception
Overrides:
unregisterContribution in class DefaultComponent
Throws:
Exception

restoreContentView

public ContentView restoreContentView(ContentViewState contentViewState)
                               throws ClientException
Description copied from interface: ContentViewService
Restores a content view given a state.

The core session is only useful when restoring a content view defining a page provider mapped to a document. It is used to initialize this document.

Specified by:
restoreContentView in interface ContentViewService
Throws:
ClientException
See Also:
ContentViewService.saveContentView(ContentView)

saveContentView

public ContentViewState saveContentView(ContentView contentView)
Description copied from interface: ContentViewService
Returns the state of this content view.

This state can be used to restore the content view in another context.

Specified by:
saveContentView in interface ContentViewService
See Also:
#restoreContentView(ContentViewState, CoreSession)

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.