public class FirstLevelPageFactory extends AbstractLogEnabled implements VirtualAmetysObjectFactory<Page>, Serviceable
AmetysObjectFactory handling FirstLevelPage.
This factory is referenced by an ODF root page.| Modifier and Type | Field and Description |
|---|---|
private OdfPageHandler |
_odfPageHandler |
private ODFPageCache |
_pageCache |
private AmetysObjectResolver |
_resolver |
| Constructor and Description |
|---|
FirstLevelPageFactory() |
| Modifier and Type | Method and Description |
|---|---|
private String |
_extractChildName(String id) |
private Page |
_extractRoot(String id) |
private Optional<Map.Entry<String,String>> |
_findFirstLevelValueEntry(Map<String,String> firstLevelValues,
String levelCode) |
private Optional<Map.Entry<String,String>> |
_findFirstLevelValueEntry(Page rootPage,
String levelCode) |
private boolean |
_hasFirstLevelValue(Page rootPage,
String level1Code) |
private FirstLevelPage |
_toFirstLevelPage(Page rootPage,
Map.Entry<String,String> firstLevelValueEntry) |
Page |
getAmetysObjectById(String id)
|
Page |
getChild(JCRAmetysObject parent,
String childName)
Returns a named
AmetysObject. |
AmetysObjectIterable<Page> |
getChildren(JCRAmetysObject parent)
Returns the "root" objects of this virtual factory, hosted in the Ametys
hierarchy under a
TraversableAmetysObject, which is backed by a
concrete JCR Node. |
(package private) ODFPageCache |
getODFPageCache() |
(package private) AmetysObjectResolver |
getResolver() |
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 existing
AmetysObject. |
boolean |
hasChild(JCRAmetysObject parent,
String childName)
Returns true if the named
AmetysObject exists. |
void |
service(ServiceManager manager) |
getLogger, setLoggerprivate AmetysObjectResolver _resolver
private OdfPageHandler _odfPageHandler
private ODFPageCache _pageCache
public FirstLevelPageFactory()
public void service(ServiceManager manager) throws ServiceException
service in interface ServiceableServiceExceptionpublic String getScheme()
AmetysObjectFactorygetScheme in interface AmetysObjectFactory<Page>public Page getAmetysObjectById(String id) throws AmetysRepositoryException
AmetysObjectFactorygetAmetysObjectById in interface AmetysObjectFactory<Page>id - the identifier.AmetysObject.AmetysRepositoryException - if an error occurs.private Page _extractRoot(String id)
private String _extractChildName(String id)
private Optional<Map.Entry<String,String>> _findFirstLevelValueEntry(Page rootPage, String levelCode)
private Optional<Map.Entry<String,String>> _findFirstLevelValueEntry(Map<String,String> firstLevelValues, String levelCode)
private FirstLevelPage _toFirstLevelPage(Page rootPage, Map.Entry<String,String> firstLevelValueEntry)
public boolean hasAmetysObjectForId(String id) throws AmetysRepositoryException
AmetysObjectFactoryAmetysObject.
Id are like <protocol>://<protocol-specific-part>.hasAmetysObjectForId in interface AmetysObjectFactory<Page>id - the identifier.AmetysObject.AmetysRepositoryException - if an error occurs.public Page getChild(JCRAmetysObject parent, String childName)
VirtualAmetysObjectFactoryAmetysObject.getChild in interface VirtualAmetysObjectFactory<Page>parent - the JCRAmetysObject "hosting" this factory.childName - the name of the virtual child.AmetysObject.public AmetysObjectIterable<Page> getChildren(JCRAmetysObject parent)
VirtualAmetysObjectFactoryTraversableAmetysObject, which is backed by a
concrete JCR Node.getChildren in interface VirtualAmetysObjectFactory<Page>parent - the JCRAmetysObject "hosting" this factory.public boolean hasChild(JCRAmetysObject parent, String childName)
VirtualAmetysObjectFactoryAmetysObject exists.hasChild in interface VirtualAmetysObjectFactory<Page>parent - the JCRAmetysObject "hosting" this factory.childName - the name of the virtual child.AmetysObject exists.private boolean _hasFirstLevelValue(Page rootPage, String level1Code) throws AmetysRepositoryException
AmetysRepositoryExceptionAmetysObjectResolver getResolver()
ODFPageCache getODFPageCache()