org.osivia.nuxeo.component
Class FragmentServiceImpl

java.lang.Object
  extended by org.nuxeo.runtime.model.DefaultComponent
      extended by org.osivia.nuxeo.component.FragmentServiceImpl
All Implemented Interfaces:
org.nuxeo.runtime.model.Adaptable, org.nuxeo.runtime.model.Component, org.nuxeo.runtime.model.Extensible, org.nuxeo.runtime.service.TimestampedService, FragmentService

public class FragmentServiceImpl
extends org.nuxeo.runtime.model.DefaultComponent
implements FragmentService

Generic fragment class


Field Summary
static java.lang.String SCHEMA
          Main nuxeo schema shared by all fragments
 
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified
 
Constructor Summary
FragmentServiceImpl()
           
 
Method Summary
 void addFragmentType(FragmentDescriptor contribution)
           
 java.util.Map.Entry<FragmentDescriptor,Fragment> findByCode(java.lang.String code)
           
 java.util.Map.Entry<FragmentDescriptor,Fragment> getFragmentCategory(org.nuxeo.ecm.core.api.DocumentModel doc, java.lang.String uri)
           
 java.lang.String prepareCreation(org.nuxeo.ecm.core.api.DocumentModel doc, Fragment specific, java.lang.String fragmentCategory, java.lang.String region, java.lang.String belowUri)
          Initialize a default entry in the main fragments schema
 void registerContribution(java.lang.Object contribution, java.lang.String extensionPoint, org.nuxeo.runtime.model.ComponentInstance contributor)
           
 void removeFragmentType(FragmentDescriptor contribution)
           
 void unregisterContribution(java.lang.Object contribution, java.lang.String extensionPoint, org.nuxeo.runtime.model.ComponentInstance contributor)
           
 
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, applicationStarted, deactivate, getAdapter, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, setModifiedNow, unregisterExtension
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCHEMA

public static java.lang.String SCHEMA
Main nuxeo schema shared by all fragments

Constructor Detail

FragmentServiceImpl

public FragmentServiceImpl()
Method Detail

registerContribution

public void registerContribution(java.lang.Object contribution,
                                 java.lang.String extensionPoint,
                                 org.nuxeo.runtime.model.ComponentInstance contributor)
                          throws java.lang.Exception
Overrides:
registerContribution in class org.nuxeo.runtime.model.DefaultComponent
Throws:
java.lang.Exception

unregisterContribution

public void unregisterContribution(java.lang.Object contribution,
                                   java.lang.String extensionPoint,
                                   org.nuxeo.runtime.model.ComponentInstance contributor)
                            throws java.lang.Exception
Overrides:
unregisterContribution in class org.nuxeo.runtime.model.DefaultComponent
Throws:
java.lang.Exception

addFragmentType

public void addFragmentType(FragmentDescriptor contribution)

removeFragmentType

public void removeFragmentType(FragmentDescriptor contribution)

findByCode

public java.util.Map.Entry<FragmentDescriptor,Fragment> findByCode(java.lang.String code)
                                                            throws FragmentServiceException
Specified by:
findByCode in interface FragmentService
Throws:
FragmentServiceException

getFragmentCategory

public java.util.Map.Entry<FragmentDescriptor,Fragment> getFragmentCategory(org.nuxeo.ecm.core.api.DocumentModel doc,
                                                                            java.lang.String uri)
                                                                     throws FragmentServiceException
Specified by:
getFragmentCategory in interface FragmentService
Parameters:
doc - nuxeo document
uri - id of the fragment
Returns:
the fragmentCategory
Throws:
FragmentServiceException

prepareCreation

public java.lang.String prepareCreation(org.nuxeo.ecm.core.api.DocumentModel doc,
                                        Fragment specific,
                                        java.lang.String fragmentCategory,
                                        java.lang.String region,
                                        java.lang.String belowUri)
                                 throws FragmentServiceException
Initialize a default entry in the main fragments schema

Specified by:
prepareCreation in interface FragmentService
Parameters:
doc - the current simplepage
region - the cms region
belowUri - the position where the fragment goes
Returns:
the new id (timestamp)
Throws:
FragmentServiceException


Copyright © 2013. All Rights Reserved.