Package org.dom4j

Examples of org.dom4j.Document.selectNodes()


      IParameterProvider parameterProvider = null;
      HashMap parameters = new HashMap();
      if ( ( content != null ) && ( content.length() > 0 ) ) {
        Document doc = XmlDom4JHelper.getDocFromString( content, new PentahoEntityResolver() );
        List parameterNodes = doc.selectNodes( "//SOAP-ENV:Body/*/*" ); //$NON-NLS-1$
        for ( int i = 0; i < parameterNodes.size(); i++ ) {
          Node parameterNode = (Node) parameterNodes.get( i );
          String parameterName = parameterNode.getName();
          String parameterValue = parameterNode.getText();
          // String type = parameterNode.selectSingleNode( "@type" );
View Full Code Here


      doc = XmlDom4JHelper.getDocFromString( xml, new PentahoEntityResolver() );
    } catch ( XmlParseException e ) {
      error( Messages.getInstance().getErrorString( "HttpWebService.ERROR_0001_ERROR_DURING_WEB_SERVICE" ), e ); //$NON-NLS-1$
      return parameters;
    }
    List parameterNodes = doc.selectNodes( "//SOAP-ENV:Body/*/*" ); //$NON-NLS-1$
    for ( int i = 0; i < parameterNodes.size(); i++ ) {
      Node parameterNode = (Node) parameterNodes.get( i );
      String parameterName = parameterNode.getName();
      String parameterValue = parameterNode.getText();
      parameters.put( parameterName, parameterValue );
View Full Code Here

        XmlDom4JHelper.getDocFromString(
            new PentahoXmlaServlet().makeContentFinder( "fakeurl" ).getContent(),
            new PentahoEntityResolver() );

    assertEquals( 2,
        content.selectNodes( "/DataSources/DataSource/Catalogs/Catalog" ).size() );
    assertNotNull( content.selectNodes(
        "/DataSources/DataSource/Catalogs/Catalog[@name='EnabledCatalog']" ) );
    assertNotNull( content.selectNodes(
        "/DataSources/DataSource/Catalogs/Catalog[@name='FoodMart']" ) );
  }
View Full Code Here

            new PentahoXmlaServlet().makeContentFinder( "fakeurl" ).getContent(),
            new PentahoEntityResolver() );

    assertEquals( 2,
        content.selectNodes( "/DataSources/DataSource/Catalogs/Catalog" ).size() );
    assertNotNull( content.selectNodes(
        "/DataSources/DataSource/Catalogs/Catalog[@name='EnabledCatalog']" ) );
    assertNotNull( content.selectNodes(
        "/DataSources/DataSource/Catalogs/Catalog[@name='FoodMart']" ) );
  }
View Full Code Here

    assertEquals( 2,
        content.selectNodes( "/DataSources/DataSource/Catalogs/Catalog" ).size() );
    assertNotNull( content.selectNodes(
        "/DataSources/DataSource/Catalogs/Catalog[@name='EnabledCatalog']" ) );
    assertNotNull( content.selectNodes(
        "/DataSources/DataSource/Catalogs/Catalog[@name='FoodMart']" ) );
  }

  public void testInvalidDataSourceInfo() throws Exception {
    ISecurityHelper securityHelper = mock( ISecurityHelper.class );
View Full Code Here

    Assert.assertTrue( "Initialization of the platform failed", init() );
    String publishersXml = null;
    try {
      Document publishersDocument = PentahoSystem.getPublishersDocument();
      publishersXml = publishersDocument.asXML();
      List publisherNodes = publishersDocument.selectNodes( "publishers/publisher" ); //$NON-NLS-1$
      Iterator publisherIterator = publisherNodes.iterator();
      while ( publisherIterator.hasNext() ) {
        Node publisherNode = (Node) publisherIterator.next();
        Assert.assertNotNull( publisherNode.selectSingleNode( "name" ) ); //$NON-NLS-1$
        Assert.assertNotNull( publisherNode.selectSingleNode( "description" ) ); //$NON-NLS-1$
View Full Code Here

        nameConnection = request.getParameter("connectionName");
      query = document.selectSingleNode("//olap/MDXquery").getStringValue();
      Node cube = document.selectSingleNode("//olap/cube");
      reference = cube.valueOf("@reference");
      name = cube.valueOf("@name");
      parameters = document.selectNodes("//olap/MDXquery/parameter");
      analysis = new AnalysisBean();
      analysis.setConnectionName(nameConnection);
      analysis.setCatalogUri(reference);
      session.setAttribute("analysisBean",analysis);
    }
View Full Code Here

    try {
      doc = XmlDom4JHelper.getDocFromFile(dataSources, loader);
      String modified = doc.asXML();
      doc = XmlDom4JHelper.getDocFromString(modified, loader);

      List<Node> nodes = doc.selectNodes("/DataSources/DataSource/Catalogs/Catalog"); //$NON-NLS-1$
      int nr = 0;
      for (Node node : nodes) {
        nr++;
        String name = "PentahoDs" + nr;
        Element e = (Element) node;
View Full Code Here

    }
    Document doc = getSystemSettingsDocument( path );
    if ( doc == null ) {
      return null;
    }
    settings = doc.selectNodes( "//" + settingName ); //$NON-NLS-1$
    settingsDocumentMap.put( path + settingName, settings );
    return settings;
  }

  public List getSystemSettings( final String settingName ) {
View Full Code Here

    if ( ( results != null ) && ( results.size() > 0 ) ) {
      String result = results.get( 0 ).toString();
      try {
        Document doc = XmlDom4JHelper.getDocFromString( result, new PentahoEntityResolver() );
        if ( doc != null ) {
          List nodes = doc.selectNodes( "//update" ); //$NON-NLS-1$
          Iterator nodeIter = nodes.iterator();
          while ( nodeIter.hasNext() ) {
            Element updateElement = (Element) nodeIter.next();

            String title = updateElement.attributeValue( "title" ); //$NON-NLS-1$
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.