Class DefaultTraversableAmetysObjectFactory
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.plugins.repository.jcr.SimpleAmetysObjectFactory
org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObjectFactory
- All Implemented Interfaces:
- AmetysObjectFactory<SimpleAmetysObject>,- JCRAmetysObjectFactory<SimpleAmetysObject>,- Component,- Configurable,- LogEnabled,- Serviceable
- Direct Known Subclasses:
- AbstractSitemapElementFactory,- CartContainerFactory,- CategoryFactory,- DefaultActivityHolderFactory,- DefaultLinkFactory,- DefaultZoneFactory,- FormDirectoryFactory,- FormFactory,- FormPageFactory,- FormQuestionFactory,- JCRCalendarEventFactory,- JCRCalendarFactory,- JCRResourcesCollectionFactory,- JCRTasksListFactory,- JCRThreadFactory,- QueryContainerFactory,- RootAmetysObjectFactory,- SurveyElementFactory,- TagFactory,- ThesaurusFactory,- VersionComponentFactory,- VersionsFactory
- 
Field SummaryFields inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObjectFactory_ametysFactoryExtensionPoint, _manager, _nodetype, _repository, _resolver, _scheme
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescription<A extends AmetysObject>
 AcreateChild(DefaultTraversableAmetysObject object, String name, String type) Creates a child to the given object.getAmetysObject(javax.jcr.Node node, String parentPath) Creates aAmetysObjectfrom a persistent JCR node.<A extends AmetysObject>
 AgetChild(DefaultTraversableAmetysObject object, String path) Returns theAmetysObjectat the given subPath, relative to the givenDefaultTraversableAmetysObject.<A extends AmetysObject>
 AmetysObjectIterable<A>Returns all children of the givenDefaultTraversableAmetysObject.booleanhasChild(DefaultTraversableAmetysObject object, String name) Tests if a given object has a child with a given name.Methods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObjectFactoryconfigure, getAmetysObjectById, getAmetysObjectById, getNode, getNodetypes, getParent, getScheme, getWorkspaceNode, hasAmetysObjectForId, serviceMethods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabledenableLogging, getLogger, setupLogger, setupLogger, setupLogger
- 
Constructor Details- 
DefaultTraversableAmetysObjectFactory
 
- 
- 
Method Details- 
getAmetysObjectpublic DefaultTraversableAmetysObject getAmetysObject(javax.jcr.Node node, String parentPath) throws AmetysRepositoryException Description copied from interface:JCRAmetysObjectFactoryCreates aAmetysObjectfrom a persistent JCR node.- Specified by:
- getAmetysObjectin interface- JCRAmetysObjectFactory<SimpleAmetysObject>
- Overrides:
- getAmetysObjectin class- SimpleAmetysObjectFactory
- Parameters:
- node- the JCR node to use.
- parentPath- the parent Path in the Ametys hierarchy, may be- nullif not known yet.
- Returns:
- the object.
- Throws:
- AmetysRepositoryException- if an error occurs.
 
- 
getChildpublic <A extends AmetysObject> A getChild(DefaultTraversableAmetysObject object, String path) throws AmetysRepositoryException, UnknownAmetysObjectException Returns theAmetysObjectat the given subPath, relative to the givenDefaultTraversableAmetysObject.- Type Parameters:
- A- the actual type of- AmetysObject.
- Parameters:
- object- the context- DefaultTraversableAmetysObject.
- path- the sub path. Cannot be- null, empty or absolute.
- Returns:
- the AmetysObjectat the given subPath, relative to the givenDefaultTraversableAmetysObject.
- Throws:
- AmetysRepositoryException- if an error occurs.
- UnknownAmetysObjectException- if no such object exists.
 
- 
getChildrenpublic <A extends AmetysObject> AmetysObjectIterable<A> getChildren(DefaultTraversableAmetysObject object) throws AmetysRepositoryException Returns all children of the givenDefaultTraversableAmetysObject.- Type Parameters:
- A- the actual type of- AmetysObjects
- Parameters:
- object- a- DefaultTraversableAmetysObject.
- Returns:
- a List containing all children object in the Ametys hierarchy.
- Throws:
- AmetysRepositoryException- if an error occurs.
 
- 
hasChildpublic boolean hasChild(DefaultTraversableAmetysObject object, String name) throws AmetysRepositoryException Tests if a given object has a child with a given name.- Parameters:
- object- the context object.
- name- the name to test.
- Returns:
- trueis the given object has a child with the given name,- falseotherwise.
- Throws:
- AmetysRepositoryException- if an error occurs.
 
- 
createChildpublic <A extends AmetysObject> A createChild(DefaultTraversableAmetysObject object, String name, String type) throws AmetysRepositoryException Creates a child to the given object.- Type Parameters:
- A- the actual type of- AmetysObject.
- Parameters:
- object- the parent- AmetysObject.
- name- the new object's name.
- type- the new object's type.
- Returns:
- the newly created AmetysObject.
- Throws:
- AmetysRepositoryException- if an error occurs.
 
 
-