CMIS: How to look for all properties of a document type? - cmis

I'm trying to find out how to create a cmis query that returns the properties of a specific document. Not the values, just the property name and its type. For example: property "dateCreated" type "String".

You have to get the type definition of the document. It contains the property definitions, which provide the information you are looking for.
If you are using OpenCMIS, DotCMIS, or PortCMIS, you access the property definitions like this: doc.getType().getPropertyDefinitions()
See also https://chemistry.apache.org/docs/cmis-samples/samples/types/index.html and https://chemistry.apache.org/java/javadoc/org/apache/chemistry/opencmis/commons/definitions/PropertyDefinition.html

Related

Filtering GetEntries by another Entry ID's existence within array of links attribute

I have a content type post where the entries have a categories attribute, which is an Array of Links (to a category content type).
I want to fetch all posts that have been tagged with a certain category. That is, Post entries where fields.categories[any link sys.id] = MyCategoryId.
I can only find an example only where the reference field is a singleton, not an array.
Would love any help, thanks!
You could specify your query like this:
/spaces/YOURSPACEID/entries?content_type=CONTENTTYPEID&fields.categories.sys.id=SOMEID
Notice that a content type restriction is necessary as we are filtering on a field property.
Also note that this only works because we're filtering on a system property directly accessible from the actual entry returned. If you wanted to filter on another property of the Category content type, for example title or description that is not currently supported.
Here's also a link to the official documentation including examples and explanations for the search api: https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters/query-entries

Alfresco Lucene search syntax

I am writing a webscript, wherein I have a custom content model.
I want to list all the documents, that have a particular property as one of it's attributes.
Firstly I did
search.luceneSearch("PATH:\"/app:company_home//*\" AND #cm:name:myDocument")
This returned me value 1. But this query actually returns me the documents, whose cm:name property is myDocument.
what if I want to search for documents, who has cm:name property as an attribute.
So that later, I can change cm:name with mycontentmodel:myproperty, and find the elements that belong to my content type.
If I understand correctly, you'd like to find all the documents that have property mycontentmodel:myproperty, but you're not interested in the actual value of the property.
If so, find out what type or aspect mycontentmodel:myproperty belongs to.
If it belongs to type mycontentmodel:mytype the query can be:
PATH:"/app:company_home//*" AND TYPE:"mycontentmodel:mytype"
and if it belongs to aspect mycontentmodel:myaspect
PATH:"/app:company_home//*" AND ASPECT:"mycontentmodel:myaspect"

CMIS query language; Queryname cmis:document

I have some problems with CMIS query language. I want to get all documents (table no important), which have some property. So I wrote Select my_property from cmis:document.
Unfortunately I get answer: 0 documents. But when I alter query to Select my_property from my_table. I get different answer.
Could you tell me why?
The reason is that the spec does not provide for it. Here is what the spec says about the "relational view projection" (source):
In each Virtual Table, a Virtual Column is implicitly defined for each
property defined in the Object-Type Definition AND for all properties
defined on ANY ancestor-type of the Object-Type but NOT defined in the
Object-Type definition.
So a given object-type can be queried for properties of ancestor types, but the spec makes no provision for querying an object-type for properties of descendent types, which is what you are trying to do.
Jeff

How to display "ContentType" name in search results?

I have a MOSS site where I have created custom content types and activated those on a document library. Now I want to use a custom XSL stylesheet with search results to pull back those documents and display the name of the custom content type assigned for each one.
I know how to create managed properties and map those, etc... but can not seem to find the built-in type that would have the name I assigned to the custom content types? You would think this would be simple - but simply using a built-in one like "ContentType" returns something generic and not the name of the custom type.
Any ideas?
The default content type managed property is mapped to multiple crawled properties, with the first one usually being the mime type. I think there is a way to get all values of a property rather than just the first one in the search results xsl, but if that doesn't work out you can always add a custom managed property that only maps to the one crawled property.

What are the Valid values of the searchboxex AppQueryTerms enum?

I'm building a custom search page and attempting to use an existing custom search scope. I'm having success using the SearchBoxEx with the AppQueryTerms = "ContentType:'my custom content type name'" but when i try using AppQueryTerms = "Scope:'My Custom Search Scope'" I get no errors, but also no proper results. I know my scope is populated using the advanced search so I must be using AppQuwryTerms wrong.
I've searched the net over and can't find the list of allowed AppQueryTerms filters. Is this Enum know to the stackerverse?
The problem is your scope name has spaces.
This worked for me:
AppQueryTerms="Scope:"My Scope""
The values for SearchBoxEx.AppQueryTerms are not an enum. They're actually a query written in a specific language for SharePoint Searching. The syntax for SharePoint 2010 is defined by microsoft on this page. It follows the format <Property Name><Property Operator><Property Value>
Scope is your property name.
: is your property operator for
matching using the property store database.
My Scope is your
property value.
The page above states:
The property restriction must not include white space between the property name, property operator, and the property value, or the property restriction will be treated as a free-text query. The length of a property restriction is limited to 2,048 characters.
Therefore, as in HelloSharePoint's example, you have to wrap the property value in quotes if it includes spaces.
Does your custom scope appear in the web sites list of Scopes?
http://intranet/[sitecollection]/_layouts/viewscopes.aspx?mode=site
Does the scope appear in a Display Group?

Resources