public class FirstLevelPageFactory extends AbstractOdfPageFactory implements VirtualAmetysObjectFactory<Page>
AmetysObjectFactory handling FirstLevelPage.
This factory is referenced by an ODF root page._ametysObjectFactoryEP, _manager, _odfPageHandler, _pageCache, _pageDataTypeExtensionPoint, _resolver, _serviceExtensionPoint| 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) |
private ProgramPage |
_toProgramPage(Program program,
Page root) |
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. |
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. |
getCoursePageFactory, getFirstLevelPageFactory, getODFPageCache, getODFPageHandler, getPageDataTypeEP, getProgramPageFactory, getResolver, getSecondLevelPageFactory, getServiceEP, getZoneDataTypeEP, getZoneItemDataTypeEP, servicegetLogger, setLoggerpublic FirstLevelPageFactory()
public 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)
private ProgramPage _toProgramPage(Program program, Page root)
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
AmetysRepositoryException