Package org.pentaho.platform.api.engine

Examples of org.pentaho.platform.api.engine.IPluginResourceLoader


  private void initialize() throws PluginHibernateException
  {


    // Get hbm file
    IPluginResourceLoader resLoader = PentahoSystem.get(IPluginResourceLoader.class, null);
    InputStream in = resLoader.getResourceAsStream(StorageEngine.class, "resources/hibernate/Storage.hbm.xml");

    // Close session and rebuild
    PluginHibernateUtil.closeSession();
    PluginHibernateUtil.getConfiguration().addInputStream(in);
    PluginHibernateUtil.rebuildSessionFactory();
View Full Code Here


  private void initialize() throws PluginHibernateException
  {


    // Get hbm file
    IPluginResourceLoader resLoader = PentahoSystem.get(IPluginResourceLoader.class, null);
    InputStream in = resLoader.getResourceAsStream(CommentsEngine.class, "resources/hibernate/Comments.hbm.xml");

    // Close session and rebuild
    PluginHibernateUtil.closeSession();
    PluginHibernateUtil.getConfiguration().addInputStream(in);
    PluginHibernateUtil.rebuildSessionFactory();
View Full Code Here

    private void returnResource(final String urlPath, final IContentItem contentItem, final OutputStream out) throws Exception {
        final IParameterProvider pathParams = parameterProviders.get("path"); //$NON-NLS-1$
        contentItem.setMimeType(MimeHelper.getMimeTypeFromFileName(urlPath));

        final IPluginResourceLoader resLoader = PentahoSystem.get(IPluginResourceLoader.class, null);
        final String maxAge = resLoader.getPluginSetting(CdfContentGenerator.class, "settings/max-age");
        final HttpServletResponse response = (HttpServletResponse) pathParams.getParameter("httpresponse");
        if (maxAge != null && response != null) {
            response.setHeader("Cache-Control", "max-age=" + maxAge);
        }
View Full Code Here

          IOUtils.closeQuietly(in);
        }
    }

    public void getSolutionFile(final String resourcePath, final OutputStream out, final ILogger logger) throws Exception {
        final IPluginResourceLoader resLoader = PentahoSystem.get(IPluginResourceLoader.class, null);
        final String formats = resLoader.getPluginSetting(this.getClass(), "settings/resources/downloadable-formats");

        List<String> allowedFormats = Arrays.asList(StringUtils.split(formats, ','));
        String extension = resourcePath.replaceAll(".*\\.(.*)", "$1");
        if (allowedFormats.indexOf(extension) < 0) {
            // We can't provide this type of file
View Full Code Here

TOP

Related Classes of org.pentaho.platform.api.engine.IPluginResourceLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.