public class OdfPageResolver extends AbstractLogEnabled implements Component, Serviceable
Modifier and Type | Field and Description |
---|---|
protected AmetysObjectResolver |
_ametysResolver
The ametys object resolver.
|
protected ODFHelper |
_odfHelper
ODF helper
|
protected OdfPageHandler |
_odfPageHandler
The odf page handler
|
static String |
ROLE
The avalon role.
|
Constructor and Description |
---|
OdfPageResolver() |
Modifier and Type | Method and Description |
---|---|
CoursePage |
getCoursePage(Course course,
AbstractProgram parentProgram,
String siteName)
Return the course page
|
CoursePage |
getCoursePage(Course course,
Course parentCourse,
String siteName)
Return the course page
|
CoursePage |
getCoursePage(Page odfRootPage,
Course course,
AbstractProgram parentAbstractProgram)
Return the course page
|
CoursePage |
getCoursePage(Page odfRootPage,
Course course,
Course parentCourse)
Return the course page
|
AbstractProgram |
getNearestAncestorAbstractProgram(ProgramItem programItem,
AbstractProgram parentProgram)
Returns the nearest
AbstractProgram ancestor. |
List<AbstractProgram> |
getNearestAncestorAbstractPrograms(ProgramPart programPart)
Returns the nearest
AbstractProgram ancestors. |
Page |
getOdfRootPage(String siteName,
String language,
String catalog)
Get the ODF root page, either in the given site if it exists, or in the default ODF site.
|
Program |
getParentProgram(ProgramItem programItem,
AbstractProgram parentProgram)
Returns the first
Program ancestor, ensuring that the given parent content 'parentProgram' is in the hierarchy, if not null.If 'parentProgram' is null, the first Program ancestor will be returned regardless of parent hierarchy.If 'parentProgram' is a SubProgram , the first Program ancestor from this SubProgram will be returned regardless of parent hierarchy |
String |
getPathInProgram(ProgramItem item,
AbstractProgram parentProgram)
Get the path in sitemap of a ODF content into a
Program or SubProgram Be careful, this is the path in sitemap, to get the path of a item into a Program, use ODFHelper.getPathInProgram(java.lang.String, java.lang.String) instead. |
String |
getProgramItemPagePath(String siteName,
String language,
ProgramItem programItem,
Program parentProgram)
Get the path of a
ProgramItem page into the given Program |
ProgramPage |
getProgramPage(Page odfRootPage,
Program program)
Return the program page
|
ProgramPage |
getProgramPage(Program program)
Return the program page
|
ProgramPage |
getProgramPage(Program program,
String siteName)
Return the program page
|
String |
getProgramPagePath(String siteName,
String language,
Program program)
Get the path of a Program page from the Program content.
|
Set<Page> |
getReferencingPages(ProgramItem programItem)
Get all referencing pages for this program item, in all sites and all sitemaps
|
Set<Page> |
getReferencingPages(ProgramItem programItem,
String siteName,
String lang)
Get all referencing pages for this program item
|
ProgramPage |
getSubProgramPage(Page odfRootPage,
SubProgram subProgram,
AbstractProgram parentAbstractProgram)
Return the subprogram page
|
ProgramPage |
getSubProgramPage(SubProgram subProgram,
AbstractProgram parentProgram,
String siteName)
Return the subprogram page
|
void |
service(ServiceManager serviceManager) |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected AmetysObjectResolver _ametysResolver
protected OdfPageHandler _odfPageHandler
protected ODFHelper _odfHelper
public OdfPageResolver()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
ServiceException
public Set<Page> getReferencingPages(ProgramItem programItem)
programItem
- The program itempublic Set<Page> getReferencingPages(ProgramItem programItem, String siteName, String lang)
programItem
- The program itemsiteName
- The site name. Can be null to search on all siteslang
- The sitemap language. Can be null to search on all sitemapspublic ProgramPage getProgramPage(Program program)
program
- the programpublic ProgramPage getProgramPage(Program program, String siteName)
program
- the programsiteName
- The current site name. If the no ODF root page is present in this site, the default ODF site will be used instead.public ProgramPage getProgramPage(Page odfRootPage, Program program)
odfRootPage
- the odf root pageprogram
- the programpublic ProgramPage getSubProgramPage(SubProgram subProgram, AbstractProgram parentProgram, String siteName)
subProgram
- the subprogramparentProgram
- The parent programsiteName
- The current site name. If the no ODF root page is present in this site, the default ODF site will be used instead.public ProgramPage getSubProgramPage(Page odfRootPage, SubProgram subProgram, AbstractProgram parentAbstractProgram)
odfRootPage
- the odf root pagesubProgram
- the subprogramparentAbstractProgram
- The parent program or subprogrampublic CoursePage getCoursePage(Course course, AbstractProgram parentProgram, String siteName)
course
- the courseparentProgram
- the parent program or subprogram. Can be null.siteName
- The current site name. If the no ODF root page is present in this site, the default ODF site will be used instead.public CoursePage getCoursePage(Page odfRootPage, Course course, AbstractProgram parentAbstractProgram)
odfRootPage
- the odf root pagecourse
- the courseparentAbstractProgram
- the parent program or subprogram. Can be null.public CoursePage getCoursePage(Course course, Course parentCourse, String siteName)
course
- the courseparentCourse
- the parent course. Can NOT be null.siteName
- The current site name. If the no ODF root page is present in this site, the default ODF site will be used instead.public CoursePage getCoursePage(Page odfRootPage, Course course, Course parentCourse)
odfRootPage
- the odf root pagecourse
- the courseparentCourse
- the parent course. Can NOT be null.public Page getOdfRootPage(String siteName, String language, String catalog)
siteName
- the desired site name.language
- the sitemap language to search in.catalog
- The ODF catalogpublic String getPathInProgram(ProgramItem item, AbstractProgram parentProgram)
Program
or SubProgram
ODFHelper.getPathInProgram(java.lang.String, java.lang.String)
instead.item
- The program itemparentProgram
- The parent root (sub)program. Can be null.public Program getParentProgram(ProgramItem programItem, AbstractProgram parentProgram)
Program
ancestor, ensuring that the given parent content 'parentProgram' is in the hierarchy, if not null.Program
ancestor will be returned regardless of parent hierarchy.SubProgram
, the first Program
ancestor from this SubProgram
will be returned regardless of parent hierarchyprogramItem
- a ProgramItem
parentProgram
- The parent program or subprogram. Can be null.Program
into this (sub)program or null if not foundpublic List<AbstractProgram> getNearestAncestorAbstractPrograms(ProgramPart programPart)
AbstractProgram
ancestors.programPart
- a ProgramPart
AbstractProgram
ancestors containing this program partpublic AbstractProgram getNearestAncestorAbstractProgram(ProgramItem programItem, AbstractProgram parentProgram)
AbstractProgram
ancestor.programItem
- a ProgramItem
parentProgram
- The parent program or subprogramAbstractProgram
ancestor into this (sub)program or null if not foundpublic String getProgramPagePath(String siteName, String language, Program program)
siteName
- the site name.language
- the language.program
- the program.public String getProgramItemPagePath(String siteName, String language, ProgramItem programItem, Program parentProgram)
ProgramItem
page into the given Program
siteName
- the site namelanguage
- the languageprogramItem
- the subprogram.parentProgram
- The parent program