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_ametysObjectResolverThe Ametys resolverprotected static OdfReferenceTableHelper_odfRefTableHelperThe ODF reference helperprotected static RootOrgUnitProvider_rootOrgUnitProviderThe 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 StringdegreeLabel(String cdmValue)Get the label associated with the degree keystatic StringdegreeLabel(String cdmValue, String lang)Get the label associated with the degree keystatic StringgetCertificationLabel(String abstractProgramId)Get the certification label of aAbstractProgram.static StringgetCode(String tableRefEntryId)Get the code associated with the given reference table's entrystatic StringgetEntryId(String tableRefId, String code)Get the id of reference table's entrystatic NodeListgetParentProgram(String subprogramId)Get the parent program informationstatic NodeListgetParentProgramStructure(String subprogramId, int depth)Get the structure of a parent programs, including the structure of child subprograms until the given depth.static NodegetProgram(String programId)Get the program informationstatic NodegetProgramStructure(String programId, int depth)Get the structure of a program until the given depth.static StringgetRootOrgUnitId()Get the id of root orgunitstatic NodegetSubProgramStructure(String subprogramId)Get the whole structure of a subprogram, including the structure of child subprogramsstatic NodegetSubProgramStructure(String subprogramId, int depth)Get the structure of a subprogram, including the structure of child subprograms until the given depthstatic NodegetTableRefItems(String tableRefId, String lang)Get the items of a reference tablestatic NodegetTableRefItems(String tableRefId, String lang, boolean ordered)Get the items of a reference tablevoidservice(ServiceManager smanager)
-
-
-
Field Detail
-
_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:
servicein 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
nullif 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
nullif 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
-
-