public GeoRole matchColumnToGeoRole( IPhysicalColumn column ) { for ( GeoRole role : this ) { if ( role.evaluate( column.getId() ) ) { return role; } } return null; }
public GeoRole matchFieldToGeoRole( AvailableField field ) { for ( GeoRole role : this ) { if ( role.evaluate( field.getPhysicalColumn().getId() ) ) { return role; } else if ( field.getPhysicalColumn().getId().startsWith( "pc__" ) ) { // sql data sources prefix the column ids with pc__, if that is detected just match with out it if ( role.evaluate( field.getPhysicalColumn().getId().substring( 4 ) ) ) { return role; } } } return null; }
protected static LogicalColumn findCorrespondingOlapColumn( LogicalColumn relationalColumn, LogicalModel olapModel ) { LogicalTable olapTable = findCorrespondingOlapTable( relationalColumn.getLogicalTable(), olapModel ); if ( olapTable != null ) { for ( LogicalColumn col : olapTable.getLogicalColumns() ) { if ( col.getPhysicalColumn().getId().equals( relationalColumn.getPhysicalColumn().getId() ) ) { return col; } } } return null; }
public LogicalColumn findLogicalColumn( IPhysicalColumn column, ModelerPerspective perspective ) { LogicalColumn col = null; IPhysicalTable physicalTable = column.getPhysicalTable(); LogicalModel logicalModel = this.getLogicalModel( perspective ); if ( logicalModel == null ) { return col; } for ( LogicalTable table : logicalModel.getLogicalTables() ) { if ( table.getPhysicalTable().getId().equals( physicalTable.getId() ) ) { if ( ( perspective == ModelerPerspective.ANALYSIS && table.getId().endsWith( BaseModelerWorkspaceHelper.OLAP_SUFFIX ) ) || ( perspective == ModelerPerspective.REPORTING && !table.getId().endsWith( BaseModelerWorkspaceHelper.OLAP_SUFFIX ) ) ) { for ( LogicalColumn lCol : table.getLogicalColumns() ) { if ( lCol.getPhysicalColumn().getId().equals( column.getId() ) ) { return lCol; } } } } } return col; }
public void setLocationFields( ModelerWorkspace workspace, LevelMetaData locationLevel, String latitudeFieldName, String longitudeFieldName ) { boolean foundLatLongColumn = false; // -1 used to determine if something column index has not been found. > -1 if found. int latColIndex = -1; int lonColIndex = -1; // Look for specified lat and long columns List<AvailableTable> tableList = workspace.getAvailableTables().getAsAvailableTablesList(); for ( AvailableTable table : tableList ) { int count = 0; for ( IPhysicalColumn col : table.getPhysicalTable().getPhysicalColumns() ) { String fieldName = col.getId(); if ( fieldName.equalsIgnoreCase( latitudeFieldName ) ) { foundLatLongColumn = true; latColIndex = count; } else if ( fieldName.equalsIgnoreCase( longitudeFieldName ) ) { foundLatLongColumn = true; lonColIndex = count; } count++; } if ( foundLatLongColumn && locationLevel != null && latColIndex > -1 && lonColIndex > -1 ) { setLocationMemberAnnotations( locationLevel, getLocationRole() ); setLocationMemberProperties( workspace, table, locationLevel, latColIndex, lonColIndex ); } } }
"BUSINESS_COLUMN_BUSINESS_TABLE", column.getLogicalTable().getId(), idGen.getNextId() ) ); //$NON-NLS-1$ modelElement.appendChild( createTaggedValue( doc, "BUSINESS_COLUMN_PHYSICAL_COLUMN_NAME", column.getPhysicalColumn().getId(),
parent.addLogicalColumn( col ); for ( IPhysicalColumn phycol : parent.getPhysicalTable().getPhysicalColumns() ) { if ( phycol.getId().equals( pcol ) ) { col.setPhysicalColumn( phycol ); break;
for ( AvailableTable table : tablesList ) { for ( AvailableField f : table.getAvailableFields() ) { if ( f.getPhysicalColumn().getId().equals( measure.getLogicalColumn().getPhysicalColumn().getId() ) && f.getPhysicalColumn().getPhysicalTable().getId().equals( measure.getLogicalColumn().getPhysicalColumn().getPhysicalTable().getId() ) ) { for ( AvailableTable table : tablesList ) { for ( AvailableField f : table.getAvailableFields() ) { if ( f.getPhysicalColumn().getId().equals( lm.getLogicalColumn().getPhysicalColumn().getId() ) && f.getPhysicalColumn().getPhysicalTable().getId().equals( lm.getLogicalColumn().getPhysicalColumn().getPhysicalTable().getId() ) ) { for ( AvailableTable table : tablesList ) { for ( AvailableField f : table.getAvailableFields() ) { if ( f.getPhysicalColumn().getId().equals( field.getLogicalColumn().getPhysicalColumn().getId() ) && f.getPhysicalColumn().getPhysicalTable().getId().equals( field.getLogicalColumn().getPhysicalColumn().getPhysicalTable().getId() ) ) {
String fieldName = col.getId();
LogicalColumn logicalColumn = new LogicalColumn(); for ( IPhysicalColumn physicalColumn : physicalTable.getPhysicalColumns() ) { if ( physicalColumn.getId().equals( column.getPhysicalColumn().getId() ) ) { logicalColumn.setPhysicalColumn( physicalColumn );
+ ModelerWorkspace.toId( col.getPhysicalColumn().getId() ) + BaseModelerWorkspaceHelper.OLAP_SUFFIX;
"LC_" + toId( lTab.getPhysicalTable().getName( locale ) ) + "_" + toId( field.getPhysicalColumn().getId() );
PhysicalColumn physicalColumn = schemaMeta.findPhysicalColumn( column.getPhysicalColumn().getPhysicalTable().getId(), column .getPhysicalColumn().getId() );