if ( model == null ) {
root.addElement( "message" ).setText( Messages.getInstance().getString( "PMDUIComponent.USER_MODEL_LOADING_ERROR", modelId ) ); //$NON-NLS-1$ //$NON-NLS-2$
return doc;
}
LogicalColumn column = model.findLogicalColumn( columnId );
if ( column == null ) {
root.addElement( "message" ).setText( Messages.getInstance().getString( "PMDUIComponent.USER_COLUMN_NOT_FOUND" ) ); //$NON-NLS-1$ //$NON-NLS-2$
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...
StringTokenizer tokenizer1 = new StringTokenizer( lookup, ";" ); //$NON-NLS-1$
while ( tokenizer1.hasMoreTokens() ) {
StringTokenizer tokenizer2 = new StringTokenizer( tokenizer1.nextToken(), "." ); //$NON-NLS-1$
if ( tokenizer2.countTokens() == 2 ) {