Package org.pentaho.platform.engine.core.solution

Examples of org.pentaho.platform.engine.core.solution.FileInfo


  public IFileInfo getFileInfo( ISolutionFile solutionFile, InputStream in ) {
    try {
      Document doc = XmlDom4JHelper.getDocFromStream( in );

      IFileInfo info = new FileInfo();
      Node node = doc.selectSingleNode( "state-file/documentation/author" ); //$NON-NLS-1$
      if ( node != null ) {
        info.setAuthor( node.getText() );
      } else {
        info.setAuthor( "" ); //$NON-NLS-1$
      }
      info.setDisplayType( "HTML" ); //$NON-NLS-1$
      node = doc.selectSingleNode( "state-file/documentation/title" ); //$NON-NLS-1$
      if ( node != null ) {
        info.setTitle( node.getText() );
      } else {
        info.setTitle( "" ); //$NON-NLS-1$
      }
      node = doc.selectSingleNode( "state-file/documentation/description" ); //$NON-NLS-1$
      if ( node != null ) {
        info.setDescription( node.getText() );
      } else {
        info.setDescription( "" ); //$NON-NLS-1$
      }
      node = doc.selectSingleNode( "state-file/documentation/icon" ); //$NON-NLS-1$
      if ( node != null ) {
        info.setIcon( node.getText() );
      } else {
        info.setIcon( "" ); //$NON-NLS-1$
      }
      return info;
    } catch ( Exception e ) {
      if ( logger != null ) {
        logger.error( getClass().toString(), e );
View Full Code Here


  }

  public void testFileInfo() {

    FileInfo cgi = new FileInfo();

    cgi.setDescription( "test description" );
    cgi.setTitle( "test title" );
    cgi.setAuthor( "test author" );
    cgi.setIcon( "test icon" );
    cgi.setDisplayType( "test displaytype" );

    assertEquals( "wrong field", "test description", cgi.getDescription() );
    assertEquals( "wrong field", "test title", cgi.getTitle() );
    assertEquals( "wrong field", "test author", cgi.getAuthor() );
    assertEquals( "wrong field", "test icon", cgi.getIcon() );
    assertEquals( "wrong field", "test displaytype", cgi.getDisplayType() );

  }
View Full Code Here

            "SolutionRepository.ERROR_0016_FAILED_TO_CREATE_ACTION_SEQUENCE", //$NON-NLS-1$
            path ) );
        return null;
      }

      IFileInfo info = new FileInfo();
      info.setAuthor( actionSequence.getAuthor() );
      info.setDescription( actionSequence.getDescription() );
      info.setDisplayType( actionSequence.getResultType() );
      info.setIcon( actionSequence.getIcon() );
      info.setTitle( actionSequence.getTitle() );
      return info;
    } catch ( Exception e ) {
      if ( logger != null ) {
        logger.error( getClass().toString(), e );
      }
View Full Code Here

            String title = solutionFile.getFileName();
            if (title != null && title.endsWith(".saiku")) {
              title = title.substring(0,title.indexOf(".saiku"));
            }

            IFileInfo info = new FileInfo();
            info.setAuthor("");
            info.setDescription("");
            info.setIcon(PluginConfig.ICON);
            info.setTitle(title);
            return info;

        } catch (Exception e) {
            LOG.error(getClass().toString(), e);
        }
View Full Code Here

    }
  }

  public static class Tst10bMetaProvider extends SolutionFileMetaAdapter {
    public IFileInfo getFileInfo( ISolutionFile solutionFile, InputStream in ) {
      FileInfo fileInfo = new FileInfo();
      fileInfo.setTitle( "test10b-title" );
      fileInfo.setAuthor( "test10b-author" );
      fileInfo.setDescription( "test10b-description" );
      return fileInfo;
    }
View Full Code Here

      String author = (String) xpath.evaluate("/cdf/author", doc, XPathConstants.STRING); //$NON-NLS-1$
      String description = (String) xpath.evaluate("/cdf/description", doc, XPathConstants.STRING); //$NON-NLS-1$
      String icon = (String) xpath.evaluate("/cdf/icon", doc, XPathConstants.STRING); //$NON-NLS-1$
      String title = (String) xpath.evaluate("/cdf/title", doc, XPathConstants.STRING); //$NON-NLS-1$

      IFileInfo info = new FileInfo();
      info.setAuthor(author);
      info.setDescription(description);
      info.setDisplayType(result);
      info.setIcon(icon);
      info.setTitle(title);
      return info;

    } catch (Exception e) {
      logger.error(Messages.getErrorString("CdfFileInfoGenerator.ERROR_0001_PARSING_XCDF"), e); //$NON-NLS-1$
      return null;
View Full Code Here

    String author = XmlDom4JHelper.getNodeText("/cdf/author", doc, "")//$NON-NLS-1$ //$NON-NLS-2$
    String description = XmlDom4JHelper.getNodeText("/cdf/description", doc, "")//$NON-NLS-1$ //$NON-NLS-2$
    String icon = XmlDom4JHelper.getNodeText("/cdf/icon", doc, "")//$NON-NLS-1$ //$NON-NLS-2$
    String title = XmlDom4JHelper.getNodeText("/cdf/title", doc, "")//$NON-NLS-1$ //$NON-NLS-2$

    IFileInfo info = new FileInfo();
    info.setAuthor(author);
    info.setDescription(description);
    info.setDisplayType(result);
    info.setIcon(icon);
    info.setTitle(title);
    return info;
  }
View Full Code Here

    String author = XmlDom4JHelper.getNodeText("/cdf/author", doc, "")//$NON-NLS-1$ //$NON-NLS-2$
    String description = XmlDom4JHelper.getNodeText("/cdf/description", doc, "")//$NON-NLS-1$ //$NON-NLS-2$
    String icon = XmlDom4JHelper.getNodeText("/cdf/icon", doc, "")//$NON-NLS-1$ //$NON-NLS-2$
    String title = XmlDom4JHelper.getNodeText("/cdf/title", doc, "")//$NON-NLS-1$ //$NON-NLS-2$

    IFileInfo info = new FileInfo();
    info.setAuthor(author);
    info.setDescription(description);
    info.setDisplayType(result);
    info.setIcon(icon);
    info.setTitle(title);
    return info;
  }
View Full Code Here

      String author = (String) xpath.evaluate("/cdf/author", doc, XPathConstants.STRING); //$NON-NLS-1$
      String description = (String) xpath.evaluate("/cdf/description", doc, XPathConstants.STRING); //$NON-NLS-1$
      String icon = (String) xpath.evaluate("/cdf/icon", doc, XPathConstants.STRING); //$NON-NLS-1$
      String title = (String) xpath.evaluate("/cdf/title", doc, XPathConstants.STRING); //$NON-NLS-1$

      IFileInfo info = new FileInfo();
      info.setAuthor(author);
      info.setDescription(description);
      info.setDisplayType(result);
      info.setIcon(icon);
      info.setTitle(title);
      return info;

    } catch (Exception e) {
      logger.error(Messages.getErrorString("CdfFileInfoGenerator.ERROR_0001_PARSING_XCDF"), e); //$NON-NLS-1$
      return null;
View Full Code Here

TOP

Related Classes of org.pentaho.platform.engine.core.solution.FileInfo

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.