Class FirstLevelPageFactory
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.odfweb.repository.AbstractOdfPageFactory
-
- org.ametys.plugins.odfweb.repository.FirstLevelPageFactory
-
- All Implemented Interfaces:
AmetysObjectFactory<Page>,VirtualAmetysObjectFactory<Page>,LogEnabled,Component,Serviceable
public class FirstLevelPageFactory extends AbstractOdfPageFactory implements VirtualAmetysObjectFactory<Page>
AmetysObjectFactoryhandlingFirstLevelPage. This factory is referenced by an ODF root page.
-
-
Field Summary
-
Fields inherited from class org.ametys.plugins.odfweb.repository.AbstractOdfPageFactory
_ametysObjectFactoryEP, _manager, _odfPageHandler, _pageCache, _pageDataTypeExtensionPoint, _resolver, _serviceExtensionPoint
-
-
Constructor Summary
Constructors Constructor Description FirstLevelPageFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private String_extractChildName(String id)private Page_extractRoot(String id)private Optional<Map.Entry<String,OdfClassificationHandler.LevelValue>>_findFirstLevelValueEntry(Map<String,OdfClassificationHandler.LevelValue> firstLevelValues, String levelCode)private Optional<Map.Entry<String,OdfClassificationHandler.LevelValue>>_findFirstLevelValueEntry(Page rootPage, String levelCode)private boolean_hasFirstLevelValue(Page rootPage, String level1Code)private FirstLevelPage_toFirstLevelPage(Page rootPage, Map.Entry<String,OdfClassificationHandler.LevelValue> firstLevelValueEntry)private ProgramPage_toProgramPage(Program program, Page root)PagegetAmetysObjectById(String id)PagegetChild(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.StringgetScheme()Returns the protocol of this factory, used to construct unique ids.booleanhasAmetysObjectForId(String id)Return true if the specified id correspond to an existingAmetysObject.booleanhasChild(JCRAmetysObject parent, String childName)Returns true if the namedAmetysObjectexists.-
Methods inherited from class org.ametys.plugins.odfweb.repository.AbstractOdfPageFactory
getCoursePageFactory, getFirstLevelPageFactory, getODFPageCache, getODFPageHandler, getPageDataTypeEP, getProgramPageFactory, getResolver, getSecondLevelPageFactory, getServiceEP, getZoneDataTypeEP, getZoneItemDataTypeEP, service
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Constructor Detail
-
FirstLevelPageFactory
public FirstLevelPageFactory()
-
-
Method Detail
-
getScheme
public String getScheme()
Description copied from interface:AmetysObjectFactoryReturns the protocol of this factory, used to construct unique ids.- Specified by:
getSchemein interfaceAmetysObjectFactory<Page>- Returns:
- the protocol of this factory.
-
getAmetysObjectById
public Page getAmetysObjectById(String id) throws AmetysRepositoryException
Description copied from interface:AmetysObjectFactory- Specified by:
getAmetysObjectByIdin interfaceAmetysObjectFactory<Page>- Parameters:
id- the identifier.- Returns:
- the corresponding
AmetysObject. - Throws:
AmetysRepositoryException- if an error occurs.
-
_extractRoot
private Page _extractRoot(String id)
-
_extractChildName
private String _extractChildName(String id)
-
_findFirstLevelValueEntry
private Optional<Map.Entry<String,OdfClassificationHandler.LevelValue>> _findFirstLevelValueEntry(Page rootPage, String levelCode)
-
_findFirstLevelValueEntry
private Optional<Map.Entry<String,OdfClassificationHandler.LevelValue>> _findFirstLevelValueEntry(Map<String,OdfClassificationHandler.LevelValue> firstLevelValues, String levelCode)
-
_toFirstLevelPage
private FirstLevelPage _toFirstLevelPage(Page rootPage, Map.Entry<String,OdfClassificationHandler.LevelValue> firstLevelValueEntry)
-
_toProgramPage
private ProgramPage _toProgramPage(Program program, Page root)
-
hasAmetysObjectForId
public boolean hasAmetysObjectForId(String id) throws AmetysRepositoryException
Description copied from interface:AmetysObjectFactoryReturn true if the specified id correspond to an existingAmetysObject. Id are like<protocol>://<protocol-specific-part>.- Specified by:
hasAmetysObjectForIdin interfaceAmetysObjectFactory<Page>- Parameters:
id- the identifier.- Returns:
- true if the specified id correspond to an existing
AmetysObject. - Throws:
AmetysRepositoryException- if an error occurs.
-
getChild
public Page getChild(JCRAmetysObject parent, String childName)
Description copied from interface:VirtualAmetysObjectFactoryReturns a namedAmetysObject.- Specified by:
getChildin interfaceVirtualAmetysObjectFactory<Page>- Parameters:
parent- theJCRAmetysObject"hosting" this factory.childName- the name of the virtual child.- Returns:
- the corresponding
AmetysObject.
-
getChildren
public AmetysObjectIterable<Page> getChildren(JCRAmetysObject parent)
Description copied from interface:VirtualAmetysObjectFactoryReturns the "root" objects of this virtual factory, hosted in the Ametys hierarchy under aTraversableAmetysObject, which is backed by a concrete JCR Node.- Specified by:
getChildrenin interfaceVirtualAmetysObjectFactory<Page>- Parameters:
parent- theJCRAmetysObject"hosting" this factory.- Returns:
- the root objects of this virtual factory.
-
hasChild
public boolean hasChild(JCRAmetysObject parent, String childName)
Description copied from interface:VirtualAmetysObjectFactoryReturns true if the namedAmetysObjectexists.- Specified by:
hasChildin interfaceVirtualAmetysObjectFactory<Page>- Parameters:
parent- theJCRAmetysObject"hosting" this factory.childName- the name of the virtual child.- Returns:
- true if the named
AmetysObjectexists.
-
_hasFirstLevelValue
private boolean _hasFirstLevelValue(Page rootPage, String level1Code) throws AmetysRepositoryException
- Throws:
AmetysRepositoryException
-
-