public class SecondLevelPageFactory extends Object implements AmetysObjectFactory<SecondLevelPage>, Serviceable
AmetysObjectFactory
handling SecondLevelPage
.Modifier and Type | Field and Description |
---|---|
private OdfPageHandler |
_odfPageHandler |
private ODFPageCache |
_pageCache |
private AmetysObjectResolver |
_resolver |
Constructor and Description |
---|
SecondLevelPageFactory() |
Modifier and Type | Method and Description |
---|---|
private String[] |
_extractLevels(String id) |
private Page |
_extractRoot(String id) |
private Optional<Map.Entry<String,String>> |
_findSecondLevelValueEntry(Map<String,String> secondLevelValues,
String levelCode) |
private Optional<Map.Entry<String,String>> |
_findSecondLevelValueEntry(Page rootPage,
String levelCode) |
private boolean |
_hasSecondLevelValue(Page rootPage,
String level2Code) |
private SecondLevelPage |
_toSecondLevelPage(Page rootPage,
String level1Code,
Map.Entry<String,String> secondLevelValueEntry) |
SecondLevelPage |
getAmetysObjectById(String id)
|
(package private) ODFPageCache |
getODFPageCache() |
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 . |
void |
service(ServiceManager manager) |
private AmetysObjectResolver _resolver
private OdfPageHandler _odfPageHandler
private ODFPageCache _pageCache
public SecondLevelPageFactory()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public SecondLevelPage getAmetysObjectById(String id) throws AmetysRepositoryException
AmetysObjectFactory
getAmetysObjectById
in interface AmetysObjectFactory<SecondLevelPage>
id
- the identifier.AmetysObject
.AmetysRepositoryException
- if an error occurs.private Page _extractRoot(String id)
private String[] _extractLevels(String id)
private Optional<Map.Entry<String,String>> _findSecondLevelValueEntry(Page rootPage, String levelCode)
private Optional<Map.Entry<String,String>> _findSecondLevelValueEntry(Map<String,String> secondLevelValues, String levelCode)
private SecondLevelPage _toSecondLevelPage(Page rootPage, String level1Code, Map.Entry<String,String> secondLevelValueEntry)
public String getScheme()
AmetysObjectFactory
getScheme
in interface AmetysObjectFactory<SecondLevelPage>
public boolean hasAmetysObjectForId(String id) throws AmetysRepositoryException
AmetysObjectFactory
AmetysObject
.
Id are like <protocol>://<protocol-specific-part>
.hasAmetysObjectForId
in interface AmetysObjectFactory<SecondLevelPage>
id
- the identifier.AmetysObject
.AmetysRepositoryException
- if an error occurs.private boolean _hasSecondLevelValue(Page rootPage, String level2Code) throws AmetysRepositoryException
AmetysRepositoryException
ODFPageCache getODFPageCache()