cancel
Showing results for 
Search instead for 
Did you mean: 

Property not available for alfresco query

mundi
Champ in-the-making
Champ in-the-making
Hello,

I've created the aspect accident:Rappel which has the properties "accident:nbr", "accident:sortieLe" and "accident:destinataireRappel".
I can set/create the properties with the commands:
pjProperties.put(accident:nbr, nombre);
pjProperties.put(accident:sortieLe, cal);
pjProperties.put(accident:destinataireRappel, destinataireRappel);
alfrescoFacade.addAspectToDocument(alfrescoDocument, pjProperties, AlfrescoFacade.ASPECT_ACCIDENT_RAPPEL);

I can also read them out with:
BigInteger nombre = alfrescoDocument.getPropertyValue(accident:nbr);
String destinataire = alfrescoDocument.getPropertyValue(accident:destinataireRappel);
GregorianCalendar calendar = alfrescoDocument.getPropertyValue(accident:sortieLe);

without any problems at all.

But if I try to execute the following query:
select d.cmis:objectId from cmis:document as d join accident:rappel as a on d.cmis:objectId = a.cmis:objectId where IN_TREE(a, 'workspace://SpacesStore/b57d9fec-87c0-42e5-ab93-b34f39490bcf') and a.accident:sortieLe = '2012-12-31T23:00:00.000Z'

I get the following error:
SEVERE: org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: Unknown column/property accident:sortieLe


Does anyone knows why this is the case?
8 REPLIES 8

iblanco
Confirmed Champ
Confirmed Champ
Not sure but… shouldn't the aspect be prefixed with "P:" ? I think alfresco maps aspects as policies because the currently implemented CMIS version does not support secondary types.

Have you tried this:
select d.cmisSmiley SurprisedbjectId from cmis:document as d join P:accident:rappel as a on d.cmisSmiley SurprisedbjectId = a.cmisSmiley SurprisedbjectId where IN_TREE(a, 'workspace://SpacesStore/b57d9fec-87c0-42e5-ab93-b34f39490bcf') and a.accident:sortieLe = '2012-12-31T23:00:00.000Z'

mundi
Champ in-the-making
Champ in-the-making
Thanks, I've tried this but it didn't solved the issue.
Strange thing is that I'm doing queries on other properties of other apects and they work without any problem.

mundi
Champ in-the-making
Champ in-the-making
I've also tried this query:
select d.cmis:objectId from cmis:document as d join accident:rappel as a on d.cmis:objectId = a.cmis:objectId where IN_TREE(a, 'workspace://SpacesStore/b57d9fec-87c0-42e5-ab93-b34f39490bcf') and a.accident:nbr = 3

which also works without any issue so it seems that the problem is related to the "sortieLe" property.

mundi
Champ in-the-making
Champ in-the-making
I don't think that the date format is the problem because the error says "Unknown column/property" and other queries with dates work.
Nevertheless I tried my query with "TIMESTAMP", but: same result…

kaynezhang
World-Class Innovator
World-Class Innovator
It seems property sortieLe  didn't register into cmis dictionary correctly,not format problem. Could you paste your aspect definition here?
is your aspect  subtype of versionable,auditable or referenceable?

mundi
Champ in-the-making
Champ in-the-making
Here my aspect definition:
<?xml version='1.0' encoding='UTF-8'?>
<cmis:type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="cmis:cmisTypePolicyDefinitionType">
   <cmis:id>P:accident:rappel</cmis:id>
   <cmis:localName>rappel</cmis:localName>
   <cmis:localNamespace>accident.model</cmis:localNamespace>
   <cmis:displayName>Accident Rappel Document</cmis:displayName>
   <cmis:queryName>accident:rappel</cmis:queryName>
   <cmis:description>Accident Rappel Document</cmis:description>
   <cmis:baseId>cmis:policy</cmis:baseId>
   <cmis:parentId>P:cmisext:aspects</cmis:parentId>
   <cmis:creatable>false</cmis:creatable>
   <cmis:fileable>false</cmis:fileable>
   <cmis:queryable>true</cmis:queryable>
   <cmis:fulltextIndexed>true</cmis:fulltextIndexed>
   <cmis:includedInSupertypeQuery>true</cmis:includedInSupertypeQuery>
   <cmis:controllablePolicy>false</cmis:controllablePolicy>
   <cmis:controllableACL>false</cmis:controllableACL>
   <cmis:propertyStringDefinition>
      <cmis:id>accident:destinataireRappel</cmis:id>
      <cmis:localName>destinataireRappel</cmis:localName>
      <cmis:localNamespace>accident.model</cmis:localNamespace>
      <cmis:displayName>accident:destinataireRappel</cmis:displayName>
      <cmis:queryName>accident:destinataireRappel</cmis:queryName>
      <cmis:description>accident:destinataireRappel</cmis:description>
      <cmis:propertyType>string</cmis:propertyType>
      <cmis:cardinality>single</cmis:cardinality>
      <cmis:updatability>readwrite</cmis:updatability>
      <cmis:inherited>false</cmis:inherited>
      <cmis:required>false</cmis:required>
      <cmis:queryable>true</cmis:queryable>
      <cmis:orderable>false</cmis:orderable>
   </cmis:propertyStringDefinition>
   <cmis:propertyDateTimeDefinition>
      <cmis:id>accident:sortieLe</cmis:id>
      <cmis:localName>sortieLe</cmis:localName>
      <cmis:localNamespace>accident.model</cmis:localNamespace>
      <cmis:displayName>accident:sortieLe</cmis:displayName>
      <cmis:queryName>accident:sortieLe</cmis:queryName>
      <cmis:description>accident:sortieLe</cmis:description>
      <cmis:propertyType>datetime</cmis:propertyType>
      <cmis:cardinality>single</cmis:cardinality>
      <cmis:updatability>readwrite</cmis:updatability>
      <cmis:inherited>false</cmis:inherited>
      <cmis:required>false</cmis:required>
      <cmis:queryable>true</cmis:queryable>
      <cmis:orderable>true</cmis:orderable>
   </cmis:propertyDateTimeDefinition>
   <cmis:propertyIntegerDefinition>
      <cmis:id>accident:nbr</cmis:id>
      <cmis:localName>nbr</cmis:localName>
      <cmis:localNamespace>accident.model</cmis:localNamespace>
      <cmis:displayName>accident:nbr</cmis:displayName>
      <cmis:queryName>accident:nbr</cmis:queryName>
      <cmis:description>accident:nbr</cmis:description>
      <cmis:propertyType>integer</cmis:propertyType>
      <cmis:cardinality>single</cmis:cardinality>
      <cmis:updatability>readwrite</cmis:updatability>
      <cmis:inherited>false</cmis:inherited>
      <cmis:required>false</cmis:required>
      <cmis:queryable>true</cmis:queryable>
      <cmis:orderable>true</cmis:orderable>
   </cmis:propertyIntegerDefinition>
</cmis:type>

kaynezhang
World-Class Innovator
World-Class Innovator
It seems nothing was wrong with your aspect definition,You can set log4j.logger.org.alfresco.cmis.dictionary=debug in you log4j file,and restart your alfresco server to check whether your aspect and properties are registered correctly into cmis dictionary.