Package org.ametys.plugins.ugc.page
Class VirtualUGCPageFactory
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.ugc.page.VirtualUGCPageFactory
-
- All Implemented Interfaces:
AmetysObjectFactory<Page>
,VirtualAmetysObjectFactory<Page>
,LogEnabled
,Component
,Serviceable
public class VirtualUGCPageFactory extends AbstractLogEnabled implements VirtualAmetysObjectFactory<Page>, Serviceable
AmetysObjectFactory
for handling "virtual" ugc page
-
-
Field Summary
Fields Modifier and Type Field Description protected PageDataTypeExtensionPoint
_pageDataTypeExtensionPoint
The extension point with available data types for pagesprotected AmetysObjectResolver
_resolver
The ametys object resolverprotected ServiceExtensionPoint
_serviceExtensionPoint
The service extension pointprotected SkinsManager
_skinManager
The skin managerprotected UGCPageHandler
_ugcPageHandler
The UGC page handler
-
Constructor Summary
Constructors Constructor Description VirtualUGCPageFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Page
getAmetysObjectById(String id)
Page
getChild(JCRAmetysObject parent, String childName)
Returns a namedAmetysObject
.AmetysObjectIterable<Page>
getChildren(JCRAmetysObject parent)
Returns the "root" objects of this virtual factory, hosted in the Ametys hierarchy under aTraversableAmetysObject
, which is backed by a concrete JCR Node.String
getScheme()
Returns the protocol of this factory, used to construct unique ids.boolean
hasAmetysObjectForId(String id)
Return true if the specified id correspond to an existingAmetysObject
.boolean
hasChild(JCRAmetysObject parent, String childName)
Returns true if the namedAmetysObject
exists.void
service(ServiceManager manager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_resolver
protected AmetysObjectResolver _resolver
The ametys object resolver
-
_ugcPageHandler
protected UGCPageHandler _ugcPageHandler
The UGC page handler
-
_skinManager
protected SkinsManager _skinManager
The skin manager
-
_pageDataTypeExtensionPoint
protected PageDataTypeExtensionPoint _pageDataTypeExtensionPoint
The extension point with available data types for pages
-
_serviceExtensionPoint
protected ServiceExtensionPoint _serviceExtensionPoint
The service extension point
-
-
Constructor Detail
-
VirtualUGCPageFactory
public VirtualUGCPageFactory()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getAmetysObjectById
public Page getAmetysObjectById(String id) throws AmetysRepositoryException
Description copied from interface:AmetysObjectFactory
- Specified by:
getAmetysObjectById
in interfaceAmetysObjectFactory<Page>
- Parameters:
id
- the identifier.- Returns:
- the corresponding
AmetysObject
. - Throws:
AmetysRepositoryException
- if an error occurs.
-
hasAmetysObjectForId
public boolean hasAmetysObjectForId(String id) throws AmetysRepositoryException
Description copied from interface:AmetysObjectFactory
Return true if the specified id correspond to an existingAmetysObject
. Id are like<protocol>://<protocol-specific-part>
.- Specified by:
hasAmetysObjectForId
in interfaceAmetysObjectFactory<Page>
- Parameters:
id
- the identifier.- Returns:
- true if the specified id correspond to an existing
AmetysObject
. - Throws:
AmetysRepositoryException
- if an error occurs.
-
getScheme
public String getScheme()
Description copied from interface:AmetysObjectFactory
Returns the protocol of this factory, used to construct unique ids.- Specified by:
getScheme
in interfaceAmetysObjectFactory<Page>
- Returns:
- the protocol of this factory.
-
getChildren
public AmetysObjectIterable<Page> getChildren(JCRAmetysObject parent)
Description copied from interface:VirtualAmetysObjectFactory
Returns the "root" objects of this virtual factory, hosted in the Ametys hierarchy under aTraversableAmetysObject
, which is backed by a concrete JCR Node.- Specified by:
getChildren
in interfaceVirtualAmetysObjectFactory<Page>
- Parameters:
parent
- theJCRAmetysObject
"hosting" this factory.- Returns:
- the root objects of this virtual factory.
-
getChild
public Page getChild(JCRAmetysObject parent, String childName)
Description copied from interface:VirtualAmetysObjectFactory
Returns a namedAmetysObject
.- Specified by:
getChild
in interfaceVirtualAmetysObjectFactory<Page>
- Parameters:
parent
- theJCRAmetysObject
"hosting" this factory.childName
- the name of the virtual child.- Returns:
- the corresponding
AmetysObject
.
-
hasChild
public boolean hasChild(JCRAmetysObject parent, String childName)
Description copied from interface:VirtualAmetysObjectFactory
Returns true if the namedAmetysObject
exists.- Specified by:
hasChild
in interfaceVirtualAmetysObjectFactory<Page>
- Parameters:
parent
- theJCRAmetysObject
"hosting" this factory.childName
- the name of the virtual child.- Returns:
- true if the named
AmetysObject
exists.
-
-