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>>
contribs
protected boolean
recompute
protected PathSegmentService
service
static String
XP
-
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 void
activate(ComponentContext context)
Activates the component.void
deactivate(ComponentContext context)
Deactivates the component.String
generatePathSegment(String s)
Generate the path segment to use from a string.String
generatePathSegment(DocumentModel doc)
Generate the path segment to use for aDocumentModel
that's about to be created.int
getMaxSize()
Return the path segment max sizeprotected void
recompute()
void
registerContribution(Object contrib, String xp, ComponentInstance contributor)
void
unregisterContribution(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:Component
Activates the component.This method is called by the runtime when a component is activated.
- Specified by:
activate
in interfaceComponent
- Overrides:
activate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
deactivate
public void deactivate(ComponentContext context)
Description copied from interface:Component
Deactivates the component.This method is called by the runtime when a component is deactivated.
- Specified by:
deactivate
in interfaceComponent
- Overrides:
deactivate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
registerContribution
public void registerContribution(Object contrib, String xp, ComponentInstance contributor)
- Overrides:
registerContribution
in classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contrib, String xp, ComponentInstance contributor)
- Overrides:
unregisterContribution
in classDefaultComponent
-
generatePathSegment
public String generatePathSegment(DocumentModel doc)
Description copied from interface:PathSegmentService
Generate the path segment to use for aDocumentModel
that's about to be created.- Specified by:
generatePathSegment
in 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:PathSegmentService
Generate the path segment to use from a string.- Specified by:
generatePathSegment
in interfacePathSegmentService
- Parameters:
s
- the string- Returns:
- the path segment, which must not contain any
/
character
-
getMaxSize
public int getMaxSize()
Description copied from interface:PathSegmentService
Return the path segment max size- Specified by:
getMaxSize
in interfacePathSegmentService
-
-