Package org.pentaho.metadata.model

Examples of org.pentaho.metadata.model.Category


    logicalColumn2.setId( "LC_SALESREP" );
    logicalColumn2.setPhysicalColumn( column2 );
    logicalColumn2.setLogicalTable( logicalTable );
    logicalTable.addLogicalColumn( logicalColumn2 );

    Category mainCategory = new Category();
    mainCategory.setId( "CATEGORY" );
    mainCategory.setName( new LocalizedString( "en_US", "Category" ) );
    mainCategory.addLogicalColumn( logicalColumn );
    mainCategory.addLogicalColumn( logicalColumn2 );

    logicalModel.getCategories().add( mainCategory );

    Domain domain = new Domain();
    domain.setId( "DOMAIN" );
View Full Code Here


      return doc;
    }

    // Temporary hack to get the BusinessCategory. When fixed properly, you should be able to interrogate the
    // business column thingie for it's containing BusinessCategory.
    Category view = null;
    for ( Category category : model.getCategories() ) {
      for ( LogicalColumn col : category.getLogicalColumns() ) {
        if ( col.getId().equals( column.getId() ) ) {
          view = category;
          break;
        }
      }
    }

    if ( view == null ) {
      root.addElement( "message" ).setText( Messages.getInstance().getString( "PMDUIComponent.USER_VIEW_NOT_FOUND" ) ); //$NON-NLS-1$ //$NON-NLS-2$
      return doc;
    }

    String mql =
        "<mql><domain_type>relational</domain_type><domain_id>" + domainName + "</domain_id><model_id>" + modelId + "</model_id>"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    if ( column.getProperty( "lookup" ) == null ) { //$NON-NLS-1$
      mql += "<selection><view>" + view.getId() + "</view><column>" + column.getId() + "</column></selection>"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
      mql +=
          "<orders><order><direction>asc</direction><view_id>" + view.getId() + "</view_id><column_id>" + column.getId() + "</column_id></order></orders>"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    } else {

      String lookup = (String) column.getProperty( "lookup" ); //$NON-NLS-1$
      // assume model and view are the same...
View Full Code Here

TOP

Related Classes of org.pentaho.metadata.model.Category

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.