public class DefaultWebContentFactory extends ContentFactory
AmetysObjectFactory
for creating DefaultWebContent
.Modifier and Type | Field and Description |
---|---|
private SiteManager |
_siteManager |
_ametysFactoryExtensionPoint, _manager, _nodetype, _repository, _resolver, _scheme
Constructor and Description |
---|
DefaultWebContentFactory() |
Modifier and Type | Method and Description |
---|---|
<A extends AmetysObject> |
createChild(DefaultWebContent object,
String name,
String type)
Creates a child to the given object.
|
DefaultWebContent |
getAmetysObject(Node node,
String parentPath)
Creates a
AmetysObject from a persistent JCR node. |
<A extends AmetysObject> |
getChild(DefaultWebContent object,
String path)
Returns the
AmetysObject at the given subPath,
relative to the given DefaultTraversableAmetysObject . |
<A extends AmetysObject> |
getChildren(DefaultWebContent object)
Returns all children of the given
DefaultTraversableAmetysObject . |
(package private) Site |
getSite(String siteName) |
boolean |
hasChild(DefaultWebContent object,
String name)
Tests if a given object has a child with a given name.
|
<A extends AmetysObject> |
resolveAmetysObject(Node node)
Resolves an
AmetysObject from a node. |
void |
service(ServiceManager smanager) |
_getContentTypeExtensionPoint, createChild, getChild, getChildren, hasChild
getCurrentUser, getWorkspaceNode
configure, getAmetysObjectById, getAmetysObjectById, getNode, getNodetypes, getParent, getScheme, hasAmetysObjectForId
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
private SiteManager _siteManager
public DefaultWebContentFactory()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
service
in class ContentFactory
ServiceException
public DefaultWebContent getAmetysObject(Node node, String parentPath) throws AmetysRepositoryException
JCRAmetysObjectFactory
AmetysObject
from a persistent JCR node.getAmetysObject
in interface JCRAmetysObjectFactory<SimpleAmetysObject>
getAmetysObject
in class ContentFactory
node
- the JCR node to use.parentPath
- the parent Path in the Ametys hierarchy,
may be null
if not known yet.AmetysRepositoryException
- if an error occurs.public <A extends AmetysObject> A resolveAmetysObject(Node node) throws AmetysRepositoryException, RepositoryException
AmetysObject
from a node.A
- the actual type of AmetysObject
.node
- the node.AmetysObject
resolved.AmetysRepositoryException
- if an error occurs.RepositoryException
- if a JCR error occurs.public <A extends AmetysObject> A getChild(DefaultWebContent object, String path) throws AmetysRepositoryException, UnknownAmetysObjectException
AmetysObject
at the given subPath,
relative to the given DefaultTraversableAmetysObject
.A
- the actual type of AmetysObject
.object
- the context DefaultTraversableAmetysObject
.path
- the sub path. Cannot be null
, empty or absolute.AmetysObject
at the given subPath,
relative to the given DefaultTraversableAmetysObject
.AmetysRepositoryException
- if an error occurs.UnknownAmetysObjectException
- if no such object exists.public <A extends AmetysObject> AmetysObjectIterable<A> getChildren(DefaultWebContent object) throws AmetysRepositoryException
DefaultTraversableAmetysObject
.A
- the actual type of AmetysObject
sobject
- a DefaultTraversableAmetysObject
.AmetysRepositoryException
- if an error occurs.public boolean hasChild(DefaultWebContent object, String name) throws AmetysRepositoryException
object
- the context object.name
- the name to test.true
is the given object has a child with the given name,
false
otherwise.AmetysRepositoryException
- if an error occurs.public <A extends AmetysObject> A createChild(DefaultWebContent object, String name, String type) throws AmetysRepositoryException
A
- the actual type of AmetysObject
.object
- the parent AmetysObject
.name
- the new object's name.type
- the new object's type.AmetysObject
.AmetysRepositoryException
- if an error occurs.