Class PathSegmentComponent
- java.lang.Object
-
- org.nuxeo.runtime.model.DefaultComponent
-
- org.nuxeo.ecm.core.api.pathsegment.PathSegmentComponent
-
- All Implemented Interfaces:
PathSegmentService,Adaptable,Component,Extensible,TimestampedService
public class PathSegmentComponent extends DefaultComponent implements PathSegmentService
Central service for the generation of a path segment for a document.
-
-
Field Summary
Fields Modifier and Type Field Description protected LinkedList<Class<? extends PathSegmentService>>contribsprotected booleanrecomputeprotected PathSegmentServiceservicestatic StringXP-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
Fields inherited from interface org.nuxeo.ecm.core.api.pathsegment.PathSegmentService
NUXEO_MAX_SEGMENT_SIZE_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description PathSegmentComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(ComponentContext context)Activates the component.voiddeactivate(ComponentContext context)Deactivates the component.StringgeneratePathSegment(String s)Generate the path segment to use from a string.StringgeneratePathSegment(DocumentModel doc)Generate the path segment to use for aDocumentModelthat's about to be created.intgetMaxSize()Return the path segment max sizeprotected voidrecompute()voidregisterContribution(Object contrib, String xp, ComponentInstance contributor)voidunregisterContribution(Object contrib, String xp, ComponentInstance contributor)-
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
addRuntimeMessage, addRuntimeMessage, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.Component
applicationStarted, getApplicationStartedOrder
-
-
-
-
Field Detail
-
XP
public static final String XP
- See Also:
- Constant Field Values
-
contribs
protected LinkedList<Class<? extends PathSegmentService>> contribs
-
service
protected PathSegmentService service
-
recompute
protected boolean recompute
-
-
Method Detail
-
activate
public void activate(ComponentContext context)
Description copied from interface:ComponentActivates the component.This method is called by the runtime when a component is activated.
- Specified by:
activatein interfaceComponent- Overrides:
activatein classDefaultComponent- Parameters:
context- the runtime context
-
deactivate
public void deactivate(ComponentContext context)
Description copied from interface:ComponentDeactivates the component.This method is called by the runtime when a component is deactivated.
- Specified by:
deactivatein interfaceComponent- Overrides:
deactivatein classDefaultComponent- Parameters:
context- the runtime context
-
registerContribution
public void registerContribution(Object contrib, String xp, ComponentInstance contributor)
- Overrides:
registerContributionin classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contrib, String xp, ComponentInstance contributor)
- Overrides:
unregisterContributionin classDefaultComponent
-
generatePathSegment
public String generatePathSegment(DocumentModel doc)
Description copied from interface:PathSegmentServiceGenerate the path segment to use for aDocumentModelthat's about to be created.- Specified by:
generatePathSegmentin interfacePathSegmentService- Parameters:
doc- the document- Returns:
- the path segment, which must not contain any
/character
-
recompute
protected void recompute()
-
generatePathSegment
public String generatePathSegment(String s)
Description copied from interface:PathSegmentServiceGenerate the path segment to use from a string.- Specified by:
generatePathSegmentin interfacePathSegmentService- Parameters:
s- the string- Returns:
- the path segment, which must not contain any
/character
-
getMaxSize
public int getMaxSize()
Description copied from interface:PathSegmentServiceReturn the path segment max size- Specified by:
getMaxSizein interfacePathSegmentService
-
-