Class OdfXSLTHelper

java.lang.Object
org.ametys.odf.OdfXSLTHelper
org.ametys.plugins.odfweb.xslt.OdfXSLTHelper
All Implemented Interfaces:
Contextualizable, Serviceable

public class OdfXSLTHelper extends OdfXSLTHelper implements Contextualizable
Helper component to be used from XSL stylesheets.
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager smanager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Overrides:
      service in class OdfXSLTHelper
      Throws:
      ServiceException
    • contextualize

      public void contextualize(Context context) throws ContextException
      Specified by:
      contextualize in interface Contextualizable
      Throws:
      ContextException
    • odfRootPage

      public static String odfRootPage(String siteName, String language)
      Get the ODF root page, for a specific site, language. If there is many ODF root pages, the first page of the list is returned.
      Parameters:
      siteName - the desired site name.
      language - the sitemap language to search in.
      Returns:
      the first ODF root page, or null if not found
    • odfRootPage

      public static String odfRootPage(String siteName, String language, String catalog)
      Get the ODF root page, for a specific site, language and catalog.
      Parameters:
      siteName - the desired site name.
      language - the sitemap language to search in.
      catalog - The ODF catalog
      Returns:
      the ODF root page, or null if not found
    • odfPDFUrl

      public static String odfPDFUrl(String contentId, String siteName)
      Get the PDF url of a program or a subprogram
      Parameters:
      contentId - The content id
      siteName - The site name
      Returns:
      the PDF url or empty string if the content is not a Program or SubProgram
    • parentProgramId

      public static String parentProgramId()
      Get the id of parent program from the current page
      Returns:
      the id of parent program or null if not found
    • getCurrentEcts

      public static double getCurrentEcts()
      Get the ECTS of the current course for the current context if present
      Returns:
      the ECTS or 0 if not found
    • getCurrentSkills

      public static NodeList getCurrentSkills()
      Get the Skills of the current course for the current context if present
      Returns:
      the MicroSkills by MacroSkills or null if not found
    • isPartOfCurrentEducationalPaths

      public static String isPartOfCurrentEducationalPaths(String educationPath)
      Determines if a given EducationalPath is part of the current EducationalPaths
      - TRUE_EXACTLY if the education path belongs to the current educational path and the current educational path is unique - TRUE if the education path belongs to the current educational paths - FALSE if the education path does not belong to the current educational paths
      Parameters:
      educationPath - the education path as string
      Returns:
      the status of the entry path belonging to the current context or not
    • getMainStructureEducationalPathAsString

      public static String getMainStructureEducationalPathAsString(String educationalPath)
      Extract educational path of main structure that the given education path belongs to. The path stops to the last parent container of type year or the last subprogram if the year does not exist.
      Parameters:
      educationalPath - the educational path as string
      Returns:
      the readable education path of main structure
    • getCurrentEcts

      public static double getCurrentEcts(String defaultValue)
      Get the ECTS of the current course for the current context if present
      Parameters:
      defaultValue - The default value
      Returns:
      the ECTS or 0 if not found
    • areECTSEqual

      public static boolean areECTSEqual(String courseId)
      Determines if the values of ECTS is equals for the course's educational paths in the current context
      Parameters:
      courseId - The course id
      Returns:
      true if the values of ECTS is equals in the current context
    • areECTSEqual

      public static boolean areECTSEqual()
      Determines if the values of ECTS is equals for the current course's educational paths in the current context
      Returns:
      true if the values of ECTS is equals in the current context
    • areSkillsUnavailable

      public static boolean areSkillsUnavailable(String programItemId, String programPageItemId)
      true if the program item is part of an program item (program, subprogram or container) that is excluded from skills
      Parameters:
      programItemId - the program item id
      programPageItemId - the program item page id. If null or empty, program item is display with no context, consider that skills are available
      Returns:
      true if the program item has an excluded parent in it path from the page context