Grooper.CMIS.CmisQuery

Defines a CMISQL query which selects documents or folders from a CMIS Repository. CMISQL is a query language based on a subset of the SQL-92 grammar, with some extensions specific to CMIS. A CMISQL statement takes the following general form:

SELECT <Properties> FROM <Type> [WHERE <Conditions>] [ORDER BY <Sort>]

A CMISQL query specifies the type of item being searched for, the criteria for matching items, the order in which results should be returned, and what properties should be returned with each result. All properties and content types used in a CMIS Query must be referenced using their "query name".

SELECT Clause

The SELECT clause specifies which properties are to be returned with query results. It should contain a comma-separated list of property names, or * to indicate that all properties should be returned.

FROM Clause

The FROM clause indicates the type of object to search for, and should specify the name of a queryable content type defined in the CMIS Repository. If the content type is document-based, then each query result will be a CMIS Document. If the content type is folder-based, then each query result will be a CMIS Folder.

The content type specified in the FROM clause serves 2 primary purposes. Firstly, it defines what properties are available in the SELECT, WHERE, and ORDER BY clauses. Secondly, it limits the scope of the search to objects of the specified type. (This includes objects with a type inheriting from the specified type.)

WHERE Clause

The optional WHERE clause specifies one or more conditions items must match to be included in the result set. Multiple conditions are joined with the AND/OR operators, and may be nested with parenthesis () to indicate order of operations. Each condition may be one of the following predicates:
Predicate TypeDescriptionExample
Comparison PredicateSpecifies a condition for an individual property.invoice_date < '12/31/2007'
IN PredicateSpecifies a list of allowed values for a property.FileExtension IN ('.pdf', '.docx', '.xlsx')
CONTAINS PredicateSpecifies a full-text query.CONTAINS('mortgage AND payment AND NOT vehicle')
Scope PredicateRestricts the search scope to children or descendants of a folder.IN_FOLDER(/Inbox)
IN_TREE(/Inbox)
The NOT operator may be used to invert the logic of individual predicates or a group of predicates enclosed by (). Note that some CMIS Bindings have limited support for the NOT operator.

ORDER BY Clause

The optional ORDER BY clause specifies the order in which results should be returned. It should include a comma-separated list of one or more property names on which the result set should be sorted. Optionally, each property name may be followed by ASC or DESC to indicate ascending or descending sort direction. If a property is specified without a sort direction, the default is ascending. See ORDER BY Element for more details.

CMISQL Query Examples


SELECT * FROM INVOICES WHERE (invoice_amount>5000) AND (freight<100) ORDER BY invoice_amount DESC


SELECT po_number, invoice_no, invoice_date, freight, sales_tax, invoice_amount FROM INVOICES WHERE (invoice_no='123456789')


SELECT * FROM File WHERE FileExtension IN ('.pdf', '.docx') AND cmis:creationDate > '1/1/2018' AND CONTAINS('grooper AND cmis')


SELECT * FROM Message WHERE Subject LIKE '%grooper%' AND DateTimeSent > '1/1/2018' AND CONTAINS('training')


Inherits from: Grooper.GrooperObject

Constructors

Signature Description
New (QueryText As String, QueryableTypes As TypeDefinitionCollection, FilterMode As Boolean)
Parameters
QueryText
          Type: String
          
 
QueryableTypes
          Type: TypeDefinitionCollection
          
 
FilterMode
          Type: Boolean
          

Fields

Field Name Field Type Description
ContentType As System.String System.String
OrderBy As System.Collections.Generic.List`1[[Grooper.CMIS.OrderByElement, Grooper.CMIS, Version=2.80.35.0, Culture=neutral, PublicKeyToken=null]] System.Collections.Generic.List(Of T)
QueryableTypes As Grooper.CMIS.TypeDefinitionCollection Grooper.CMIS.TypeDefinitionCollection
SelectElements As System.Collections.Generic.List`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] System.Collections.Generic.List(Of T)
TypeDef As PortCMIS.Data.ITypeDefinition PortCMIS.Data.ITypeDefinition
WhereClause As Grooper.CMIS.WherePredicate Grooper.CMIS.WherePredicate

Properties

Property Name Property Type Description
IsEmpty System.Boolean Returns true if all properties with a ViewableAttribute are set to their default value.
IsWriteable System.Boolean Returns true if the object is writable, or false if it is not.

Methods

Method Name Description
AddRequiredSelectProperties()
CleanQuery(Value As String) As String
Parameters
Value
          Type: String
          
ElementsOfType() As IEnumerable(Of TheType)
GetProperties() As PropertyDescriptorCollection
IsPropertyEnabled(PropertyName As String) As Nullable(Of Boolean) Defines whether a property is currently enabled.
Parameters
PropertyName
          Type: String
          The name of the property to determine the enabled state for.
IsPropertyVisible(PropertyName As String) As Nullable(Of Boolean) Defines whether a property is currently visible.
Parameters
PropertyName
          Type: String
          The name of the property to determine the visible state for.
IsType(Type As Type) As Boolean Returns true if the object is of the type specified, or if it derives from the type specfied.
Parameters
Type
          Type: Type
          The type to check.
ToString() As String
ValidateProperties() As ValidationErrorList Validates the properties of the object, returning a list of validation errors.