Class CommonUtil


  • public class CommonUtil
    extends Object
    used to include common utility functions
    • Constructor Detail

      • CommonUtil

        public CommonUtil()
    • Method Detail

      • deleteReportTemplate

        public static void deleteReportTemplate​(String templateName,
                                                org.wso2.carbon.registry.core.Registry registry)
                                         throws org.wso2.carbon.reporting.api.ReportingException
        Parameters:
        templateName - name of the report
        registry - Registry
        Throws:
        org.wso2.carbon.reporting.api.ReportingException - if failed to delete report template
      • getAllReports

        public static List<String> getAllReports​(org.wso2.carbon.registry.core.Registry registry)
                                          throws org.wso2.carbon.reporting.api.ReportingException
        Parameters:
        registry - Registry
        Returns:
        report name list
        Throws:
        org.wso2.carbon.reporting.api.ReportingException - if failed to get report name list
      • getReportResources

        public static String getReportResources​(String componentName,
                                                String reportTemplate,
                                                org.wso2.carbon.registry.core.Registry registry)
                                         throws org.wso2.carbon.reporting.api.ReportingException,
                                                XMLStreamException
        Parameters:
        componentName - name of the report requesting component
        reportTemplate - name of the template
        registry - Registry
        Returns:
        report template as string
        Throws:
        org.wso2.carbon.reporting.api.ReportingException - if failed to get report template
        XMLStreamException
      • getJRXMLFileContent

        public static String getJRXMLFileContent​(String componentName,
                                                 String reportTemplate,
                                                 org.wso2.carbon.registry.core.Registry registry)
                                          throws org.wso2.carbon.reporting.api.ReportingException
        Throws:
        org.wso2.carbon.reporting.api.ReportingException
      • updateReport

        public static boolean updateReport​(String fileName,
                                           String fileContent,
                                           org.wso2.carbon.registry.core.Registry registry)
                                    throws org.wso2.carbon.reporting.api.ReportingException,
                                           net.sf.jasperreports.engine.JRException
        Parameters:
        fileName - name of the modifying report name
        fileContent - modified content
        registry - Registry
        Returns:
        status of the update process
        Throws:
        org.wso2.carbon.reporting.api.ReportingException
        net.sf.jasperreports.engine.JRException
      • addJrxmlConfigs

        public static void addJrxmlConfigs​(org.wso2.carbon.registry.core.Registry systemRegistry)
                                    throws org.wso2.carbon.registry.core.exceptions.RegistryException
        Throws:
        org.wso2.carbon.registry.core.exceptions.RegistryException