AnsweredAssumed Answered

CMIS Select AS (alias) and text-qualifying spaces

Question asked by dhartford on Jan 3, 2013
Latest reply on Jan 7, 2013 by jpotts
Hey all,
I'm working through some scenarios with CMIS, and I ran into this scenario – not sure if this is CMIS spec oriented, or Alfresco impl, but hopefully at least raising it up unless someone else found a workaround:

Intent: Return the 'Display Name' as the alias for each return column.

String query1 = "SELECT " + propertyDefinition.getId(); //works

String query2 = "SELECT " + propertyDefinition.getId() + " AS '" + propertyDefinition.getDisplayName()+"' "; //surrounding with single quotes for displayname with spaces failing with errors.

String query3 = "SELECT " + propertyDefinition.getId() + " AS \"" + propertyDefinition.getDisplayName()+"\" "; //surrounding with double quotes for displaynames with spaces failing with errors.

String query4 = "SELECT " + queryFragment.append(propertyDefinition.getId() + " AS z_" + propertyDefinition.getLocalName(); //localName seems to always be a single word (no space).  Error with cmis:name's localname of 'name', so prefix with z_ worked around for demonstration purposes.

Summary: I do not seem to be able to provide column alias on the SELECT portion that contains spaces.

-Darren

Outcomes