Class DefaultWebContentFactory
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.plugins.repository.jcr.SimpleAmetysObjectFactory
org.ametys.plugins.repository.jcr.DefaultAmetysObjectFactory
org.ametys.cms.repository.ContentFactory
org.ametys.web.repository.content.jcr.DefaultWebContentFactory
- All Implemented Interfaces:
AmetysObjectFactory<SimpleAmetysObject>,JCRAmetysObjectFactory<SimpleAmetysObject>,DeferredServiceable,Component,Configurable,LogEnabled,Serviceable
- Direct Known Subclasses:
DefaultSharedContentFactory,ModifiableDefaultWebContentFactory
AmetysObjectFactory for creating DefaultWebContent.-
Field Summary
Fields inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObjectFactory
_ametysFactoryExtensionPoint, _manager, _nodetype, _repository, _resolver, _scheme -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<A extends AmetysObject>
AcreateChild(DefaultWebContent 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(DefaultWebContent object, String path) Returns theAmetysObjectat the given subPath, relative to the givenDefaultTraversableAmetysObject.<A extends AmetysObject>
AmetysObjectIterable<A> getChildren(DefaultWebContent object) Returns all children of the givenDefaultTraversableAmetysObject.booleanhasChild(DefaultWebContent object, String name) Tests if a given object has a child with a given name.<A extends AmetysObject>
AresolveAmetysObject(javax.jcr.Node node) Resolves anAmetysObjectfrom a node.voidservice(ServiceManager smanager) Methods inherited from class org.ametys.cms.repository.ContentFactory
createChild, deferredService, getChild, getChildren, getContentDataHelper, getContentHelper, getContentSaxer, getInternalDataTypesExtensionPoint, getSystemPropertyExtensionPoint, hasChildMethods inherited from class org.ametys.plugins.repository.jcr.DefaultAmetysObjectFactory
getCurrentUser, getUnversionedDataTypeExtensionPoint, getWorkspaceNodeMethods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObjectFactory
configure, getAmetysObjectById, getAmetysObjectById, getNode, getNodetypes, getParent, getScheme, hasAmetysObjectForIdMethods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Constructor Details
-
DefaultWebContentFactory
public DefaultWebContentFactory()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classContentFactory- Throws:
ServiceException
-
getAmetysObject
public DefaultWebContent getAmetysObject(javax.jcr.Node node, String parentPath) throws AmetysRepositoryException Description copied from interface:JCRAmetysObjectFactoryCreates aAmetysObjectfrom a persistent JCR node.- Specified by:
getAmetysObjectin interfaceJCRAmetysObjectFactory<SimpleAmetysObject>- Overrides:
getAmetysObjectin classContentFactory- Parameters:
node- the JCR node to use.parentPath- the parent Path in the Ametys hierarchy, may benullif not known yet.- Returns:
- the object.
- Throws:
AmetysRepositoryException- if an error occurs.
-
resolveAmetysObject
public <A extends AmetysObject> A resolveAmetysObject(javax.jcr.Node node) throws AmetysRepositoryException, javax.jcr.RepositoryException Resolves anAmetysObjectfrom a node.- Type Parameters:
A- the actual type ofAmetysObject.- Parameters:
node- the node.- Returns:
- the
AmetysObjectresolved. - Throws:
AmetysRepositoryException- if an error occurs.javax.jcr.RepositoryException- if a JCR error occurs.
-
getChild
public <A extends AmetysObject> A getChild(DefaultWebContent object, String path) throws AmetysRepositoryException, UnknownAmetysObjectException Returns theAmetysObjectat the given subPath, relative to the givenDefaultTraversableAmetysObject.- Type Parameters:
A- the actual type ofAmetysObject.- Parameters:
object- the contextDefaultTraversableAmetysObject.path- the sub path. Cannot benull, 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.
-
getChildren
public <A extends AmetysObject> AmetysObjectIterable<A> getChildren(DefaultWebContent object) throws AmetysRepositoryException Returns all children of the givenDefaultTraversableAmetysObject.- Type Parameters:
A- the actual type ofAmetysObjects- Parameters:
object- aDefaultTraversableAmetysObject.- Returns:
- a List containing all children object in the Ametys hierarchy.
- Throws:
AmetysRepositoryException- if an error occurs.
-
hasChild
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.
-
createChild
public <A extends AmetysObject> A createChild(DefaultWebContent object, String name, String type) throws AmetysRepositoryException Creates a child to the given object.- Type Parameters:
A- the actual type ofAmetysObject.- Parameters:
object- the parentAmetysObject.name- the new object's name.type- the new object's type.- Returns:
- the newly created
AmetysObject. - Throws:
AmetysRepositoryException- if an error occurs.
-