Package org.ametys.odf
Class OdfXSLTHelper
- java.lang.Object
-
- org.ametys.odf.OdfXSLTHelper
-
- All Implemented Interfaces:
Serviceable
- Direct Known Subclasses:
OdfXSLTHelper
public class OdfXSLTHelper extends Object implements Serviceable
Helper component to be used from XSL stylesheets.
-
-
Field Summary
Fields Modifier and Type Field Description protected static AmetysObjectResolver
_ametysObjectResolver
The Ametys resolverprotected static ODFHelper
_odfHelper
The ODF helperprotected static OdfReferenceTableHelper
_odfRefTableHelper
The ODF reference helperprotected static RootOrgUnitProvider
_rootOrgUnitProvider
The orgunit root provider
-
Constructor Summary
Constructors Constructor Description OdfXSLTHelper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
degreeLabel(String cdmValue)
Get the label associated with the degree keystatic String
degreeLabel(String cdmValue, String lang)
Get the label associated with the degree keystatic String
getCertificationLabel(String abstractProgramId)
Get the certification label of aAbstractProgram
.static String
getCode(String tableRefEntryId)
Get the code associated with the given reference table's entrystatic Double
getCumulatedHours(String contentId)
Count the hours accumulation in theProgramItem
static AmetysNodeList
getEducationalBooklet(String subProgramId)
Get the more recent educational booklet for one subprogramstatic String
getEntryId(String tableRefId, String code)
Get the id of reference table's entrystatic String
getOrgUnitIdByUAICode(String uaiCode)
Get the id of the first orgunit matching the given UAI codestatic NodeList
getParentProgram(String subprogramId)
Get the parent program informationstatic NodeList
getParentProgramStructure(String subprogramId, int depth)
Get the structure of a parent programs, including the structure of child subprograms until the given depth.static Node
getProgram(String programId)
Get the program informationstatic Node
getProgramStructure(String programId, int depth)
Get the structure of a program until the given depth.static String
getRootOrgUnitId()
Get the id of root orgunitstatic Node
getSubProgramStructure(String subprogramId)
Get the whole structure of a subprogram, including the structure of child subprogramsstatic Node
getSubProgramStructure(String subprogramId, int depth)
Get the structure of a subprogram, including the structure of child subprograms until the given depthstatic Node
getTableRefItems(String tableRefId, String lang)
Get the items of a reference tablestatic Node
getTableRefItems(String tableRefId, String lang, boolean ordered)
Get the items of a reference tablevoid
service(ServiceManager smanager)
-
-
-
Field Detail
-
_odfHelper
protected static ODFHelper _odfHelper
The ODF helper
-
_odfRefTableHelper
protected static OdfReferenceTableHelper _odfRefTableHelper
The ODF reference helper
-
_ametysObjectResolver
protected static AmetysObjectResolver _ametysObjectResolver
The Ametys resolver
-
_rootOrgUnitProvider
protected static RootOrgUnitProvider _rootOrgUnitProvider
The orgunit root provider
-
-
Constructor Detail
-
OdfXSLTHelper
public OdfXSLTHelper()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
degreeLabel
public static String degreeLabel(String cdmValue)
Get the label associated with the degree key- Parameters:
cdmValue
- The code of degree- Returns:
- The label of degree or code if not found
-
getCode
public static String getCode(String tableRefEntryId)
Get the code associated with the given reference table's entry- Parameters:
tableRefEntryId
- The id of entry- Returns:
- the code or
null
if not found
-
getEntryId
public static String getEntryId(String tableRefId, String code)
Get the id of reference table's entry- Parameters:
tableRefId
- The id of content typecode
- The code- Returns:
- the id or
null
if not found
-
degreeLabel
public static String degreeLabel(String cdmValue, String lang)
Get the label associated with the degree key- Parameters:
cdmValue
- The cdm value of degreelang
- The language- Returns:
- The label of degree or empty string if not found
-
getSubProgramStructure
public static Node getSubProgramStructure(String subprogramId)
Get the whole structure of a subprogram, including the structure of child subprograms- Parameters:
subprogramId
- The id of subprogram- Returns:
- Node with the subprogram structure
-
getSubProgramStructure
public static Node getSubProgramStructure(String subprogramId, int depth)
Get the structure of a subprogram, including the structure of child subprograms until the given depth- Parameters:
subprogramId
- The id of subprogramdepth
- Set a positive number to get structure of child subprograms until given depth. Set a negative number to get the whole structure recursively, including the structure of child subprograms. This parameter concerns only subprograms.- Returns:
- Node with the subprogram structure
-
getParentProgram
public static NodeList getParentProgram(String subprogramId)
Get the parent program information- Parameters:
subprogramId
- The id of subprogram- Returns:
- a node for each program's information
-
getCertificationLabel
public static String getCertificationLabel(String abstractProgramId)
Get the certification label of aAbstractProgram
. Returns null if the program is not certified.- Parameters:
abstractProgramId
- the id of program or subprogram- Returns:
- the certification label
-
getProgram
public static Node getProgram(String programId)
Get the program information- Parameters:
programId
- The id of program- Returns:
- Node with the program's information
-
getParentProgramStructure
public static NodeList getParentProgramStructure(String subprogramId, int depth)
Get the structure of a parent programs, including the structure of child subprograms until the given depth.- Parameters:
subprogramId
- The id of subprogramdepth
- Set a positive number to get structure of child subprograms until given depth. Set a negative number to get the whole structure recursively, including the structure of child subprograms. This parameter concerns only subprograms.- Returns:
- a node for each program's structure
-
getProgramStructure
public static Node getProgramStructure(String programId, int depth)
Get the structure of a program until the given depth.- Parameters:
programId
- The id of programdepth
- Set a positive number to get structure of child subprograms until given depth. Set a negative number to get the whole structure recursively, including the structure of child subprograms. This parameter concerns only subprograms.- Returns:
- Node with the program structure
-
getTableRefItems
public static Node getTableRefItems(String tableRefId, String lang)
Get the items of a reference table- Parameters:
tableRefId
- the id of reference tablelang
- the language to use for labels- Returns:
- the items
-
getTableRefItems
public static Node getTableRefItems(String tableRefId, String lang, boolean ordered)
Get the items of a reference table- Parameters:
tableRefId
- the id of reference tablelang
- the language to use for labelsordered
- true to sort items by 'order' attribute- Returns:
- the items
-
getRootOrgUnitId
public static String getRootOrgUnitId()
Get the id of root orgunit- Returns:
- The id of root
-
getOrgUnitIdByUAICode
public static String getOrgUnitIdByUAICode(String uaiCode)
Get the id of the first orgunit matching the given UAI code- Parameters:
uaiCode
- the UAI code- Returns:
- the id of orgunit or null if not found
-
getEducationalBooklet
public static AmetysNodeList getEducationalBooklet(String subProgramId)
Get the more recent educational booklet for one subprogram- Parameters:
subProgramId
- the subprogram id- Returns:
- the pdf as an ametys node list
-
getCumulatedHours
public static Double getCumulatedHours(String contentId)
Count the hours accumulation in theProgramItem
- Parameters:
contentId
- The id of theProgramItem
- Returns:
- The hours accumulation
-
-