Using Alfresco 4.2 or 5.0, how do you disable full text indexing on a content-model basis?
Here is an example content model, what do you change specifically (i.e. do not reference the index control aspect without how to actually use it with a content model).
<model name="my:textdoc" xmlns="http://www.alfresco.org/model/dictionary/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<imports>
<import prefix="d" uri="http://www.alfresco.org/model/dictionary/1.0" />
<import prefix="cm" uri="http://www.alfresco.org/model/content/1.0" />
</imports>
<namespaces>
<namespace prefix="my"
uri="http://www.notarealurl.xyz/model/my/1.0" />
</namespaces>
<types>
<type name="my:securetextdoc">
<title>text docs with keyword searching, but not content searching</title>
<parent>cm:content</parent>
<properties>
<property name="my:securekeywords">
<title>custom key word text field</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
</properties>
<mandatory-aspects>
<!-- <aspect>cm:dublincore</aspect> -->
<aspect>cm:versionable</aspect>
</mandatory-aspects>
</type>
</types>
FINAL ANSWER
<model name="my:textdoc" xmlns="http://www.alfresco.org/model/dictionary/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<imports>
<import prefix="d" uri="http://www.alfresco.org/model/dictionary/1.0" />
<import prefix="cm" uri="http://www.alfresco.org/model/content/1.0" />
</imports>
<namespaces>
<namespace prefix="my"
uri="http://www.notarealurl.xyz/model/my/1.0" />
</namespaces>
<types>
<type name="my:securetextdoc">
<title>text docs with keyword searching, but not content searching</title>
<parent>cm:content</parent>
<properties>
<property name="my:securekeywords">
<title>custom key word text field</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
</properties>
<mandatory-aspects>
<!-- <aspect>cm:dublincore</aspect> -->
<aspect>my:doNotIndexContentControl</aspect>
<aspect>cm:versionable</aspect>
</mandatory-aspects>
</type>
</types>
<aspects>
<aspect name="my:doNotIndexContentControl">
<title>Do Not Index Control</title>
<parent>cm:indexControl</parent>
<overrides>
<property name="cm:isIndexed">
<default>true</default>
</property>
<property name="cm:isContentIndexed">
<default>false</default>
</property>
</overrides>
</aspect>
</aspects>
</model>
Important Note: If you get "Source node class has no callback" errors, this is related to changing the content model and then trying to update (likely versionable) existing content. No known workaround, but this is unrelated to index control options.
You can achieve this by defining a new aspect that extends cm:indexControl like so:
<aspect name="my:doNotIndexContentControl">
<title>Do Not Index Control</title>
<parent>cm:indexControl</parent>
<overrides>
<property name="cm:isIndexed">
<default>true</default>
</property>
<property name="cm:isContentIndexed">
<default>false</default>
</property>
</overrides>
</aspect>
Note the overrides. The overridden property, cm:isContentIndexed, with default value set to false is key.
You then add this aspect as mandatory for the types which you do not wish to full text index the content. The full configuration options for cm:indexControl can be found in the documentation http://docs.alfresco.com/4.2/concepts/admin-indexes.html
Also, if you have existing content items that have already been indexed and you want those documents to no longer be indexed, you will need to do a full re-index.
This is covered in the Data Dictionary guide on the Alfresco wiki
All you need to do is all this to your model:
<index enabled="false" />
If you look at something like the Alfresco system model, you'll see several examples of that
Related
so we have a kind of normal dynamic sulu 1.6 content structure:
<template>
<properties>
<section name="highlight">
<properties>
<property name="title" type="text_line" mandatory="true">
<meta>
<title lang="en">Title</title>
<title lang="de">Titel</title>
</meta>
<params>
<param name="headline" value="true"/>
</params>
<tag name="sulu.rlp.part"/>
</property>
<property name="headline" type="text_line" mandatory="false">
<meta>
<title lang="en">Alternative Content Headline</title>
<title lang="de">Alternative Inhalts Überschrift</title>
</meta>
</property>
</section>
<block name="mainContent" default-type="article" colspan="8">
<types>
<!-- some types -->
<type name="article">
<meta>
<title lang="de">Artikel</title>
<title lang="en">Article</title>
</meta>
<properties>
<property name="headline" type="text_line"/>
<property name="teaser" type="text_editor"/>
<property name="content" type="text_editor"/>
<property name="mode" type="single_select">
<params>
<param name="values" type="collection">
<param name="simple">
<meta>
<title lang="de">Einfach</title>
<title lang="en">Simple</title>
</meta>
</param>
<param name="collapsible">
<meta>
<title lang="de">Ausklappbar</title>
<title lang="en">Collapsible</title>
</meta>
</param>
</param>
</params>
</property>
<property name="image" type="media_selection"/>
</properties>
</type>
</types>
</block>
</properties>
</template>
If I search now, sulu finds perfectly matches of the tile, but non hidden in the dynamic block content.
I checked out http://docs.sulu.io/en/latest/bundles/search.html and https://massivesearchbundle.readthedocs.io/en/latest/introduction.html but it is not clear to me, how to make this happen. Is there a way for the massive search bundle to also build an index over free text fields?
I would be interested in taking content from properties > block[name=mainContent] > types > type[name=article] > property[name=content] into account (and also property[name=teaser] of course). It can be 0 - n occurences in a page thou.
Thx a lot for any hint on this :)
Andreas
Inside blocks you should be able to add a field to the search with example:
<property name="article" type="text_editor">
<meta>
<title lang="en">Article</title>
</meta>
<tag name="sulu.search.field" />
</property>
See also http://docs.sulu.io/en/latest/book/templates.html#search
I have Multiple Custom content types, and based on individual type i am able to query documents. But my requirement is i want to get all types of document.
I wrote query select * from hr:hrdoctype, Because my hr:hrdoctype is my parent type for all other types. But its not working.
But if i will write select * from hr:hrReimbursment, This is working fine.
So how can i get all All Custom types of documents with single parent type or with single condition.
Please see the Below configuration.
in this case if i will use specific content type then its working fine. but i want to get all type of document using single query.
Please help me how can i write CMIS Query for this requirement.
Share-config-custom.xml:-
<type name="cm:content">
<subtype name="hr:hrdoctype" />
</type>
<type name="hr:hrdoctype">
<subtype name="hr:hrReimbursment" />
<subtype name="hr:hrMISCELLANEOUS" />
<subtype name="hr:hrWELFARE_POLICIES" />
<subtype name="hr:hrGENERAL_POLICIES" />
<subtype name="hr:hrPOLICIES_SIGNOFF_NOTES_FILE_NOTES" />
<subtype name="hr:hrPHOTOGRAPH" />
<subtype name="hr:hrPIF_PROFILE_OVERVIEW" />
<subtype name="hr:hrMPR_FORM" />
<subtype name="hr:hrPSYOMETRIC_REPORT" />
<subtype name="hr:hrTECHNICAL_TEST_ASSESSEMENT" />
<subtype name="hr:hrINTERVIEW_ASSESSEMENT_SHEET" />
</type>
Custom-content-model.xml:-
<types>
<type name="hr:hrdoctype">
<title>HR Document</title>
<parent>cm:content</parent>
<properties>
<property name="hr:employeeNumber">
<title>Employee Number</title>
<type>d:text</type>
</property>
<property name="hr:employeeName">
<title>Employee Name</title>
<type>d:text</type>
</property>
</properties>
</type>
<type name="hr:hrReimbursment">
<title>REIMBURSEMENT</title>
<parent>hr:hrdoctype</parent>
<properties>
<property name="hr:DocumentDescription">
<title>Document Description</title>
<type>d:text</type>
</property>
<property name="hr:ReimbursmentDate">
<title>Reimbursment Date</title>
<type>d:text</type>
</property>
</properties>
</type>
<type name="hr:hrMISCELLANEOUS">
<title>MISCELLANEOUS</title>
<parent>hr:hrdoctype</parent>
<properties>
<property name="hr:DocumentDescription1">
<title>Document Description</title>
<type>d:text</type>
</property>
</properties>
</type>
</types>
I just tested simillar case on my repository.
There are four base CMIS types: cmis:document, cmis:folder, cmis:relationship, cmis:policy. Types cmis:document and cmis:folder must be supported by any repository.
I my case the myc:xyz type inherits from the cmis:folder type.
CMIS query selecting all folders:
select * from cmis:folder where cmis:name='ABCD'
returns folder:
{
"cmis:objectId": "5b97929c-553b-4494-91cc-2c18e50b2f1c",
"cmis:objectTypeId": "F:myc:xyz",
"cmis:baseTypeId": "cmis:folder",
"cmis:name": "ABCD"
}
CMIS query selecting all myc:xyz folders:
select * from myc:xyz where cmis:name='ABCD'
return the same folder with some myc:xyz type's additional properties:
{
"cmis:objectId": "5b97929c-553b-4494-91cc-2c18e50b2f1c",
"cmis:objectTypeId": "F:myc:xyz",
"cmis:baseTypeId": "cmis:folder",
"cmis:name": "ABCD",
"myc:AdditionalProperty1": "1111",
"myc:AdditionalProperty2": "2222"
}
Hope this helps.
OpenCMIS Client API Developer's Guide
PS. You can test queries with Alfresco CMIS 1.1 "The Browser binding".
For example, this is URL for the query select * from cmis:folder where cmis:name='ABCD' (Firefox automatically decoding encoded parameters in URL, it is very comfortable):
http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser/?cmisselector=query&succinct=true&q=select * from cmis:folder where cmis:name='ABCD'
I have the next content model.:
<?xml version="1.0" encoding="UTF-8"?>
<model name="sm:modelContent" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<description>Content Model</description>
<author>Arak</author>
<version>1.0</version>
<imports>
<import uri="http://www.alfresco.org/model/dictionary/1.0"
prefix="d" />
<import uri="http://www.alfresco.org/model/bpm/1.0"
prefix="bpm" />
</imports>
<namespaces>
<namespace uri="http://www.some.com/model/content/1.0" prefix="sm" />
</namespaces>
<!-- Types -->
<types>
<type name="sm:contentParent">
<parent>cm:content</parent>
</type>
<type name="sm:contentChildren1">
<parent>sm:contentParent</parent>
</type>
<type name="sm:contentChildren2">
<parent>sm:contentParent</parent>
</type>
<type name="sm:contentChildren3">
<parent>sm:contentParent</parent>
</type>
</types>
<!-- Aspects -->
<aspects>
<!-- An Aspect -->
<aspect name="sm:otherOtherAspect">
<properties>
....
</properties>
</aspect>
<!-- Other Aspect -->
<aspect name="sm:otherAspect">
<properties>
....
</properties>
</aspect>
<!-- An Other Aspect -->
<aspect name="sm:anOtherAspect1">
<properties>
....
</properties>
</aspect>
<aspect name="sm:anOtherAspect2">
<properties>
....
</properties>
</aspect>
<aspect name="sm:anOtherAspect3">
<properties>
....
</properties>
</aspect>
... can exist N ...
<!-- Other Other Aspect -->
<aspect name="sm:anAspect1">
<properties>
....
</properties>
</aspect>
<aspect name="sm:anAspect2">
<properties>
....
</properties>
</aspect>
<aspect name="sm:anAspect3">
<properties>
....
</properties>
</aspect>
... can exist N ...
</aspects>
Depending of the type of content:
sm:contentChildren1 can have a 1 "anOtherAspect" and 0 "anAspect".
sm:contentChildren2 can have a N "anOtherAspect" and 0 "anAspect".
sm:contentChildren3 can have a N "anOtherAspect" and N "anAspect".
These relationships exist between types and aspects? (one-to-one or one-to-many) How can use it?, if not exist, I can simulate this relationship in any way?
I would like to work aspects based on a relationship and not creating them one by one (exaggerating the value of N, and creating a lot of aspects).
Greetings,
Pablo.
Alfresco aspects are on-to-one in that an Alfresco node can only have one instance of a particular aspect and a particular instance of an aspect is only associated with one node.
You have two options for getting multiple values on your node.
Designate your properties as <multiple>true</multiple> which means that it can hold multiple values. More details on this here:
http://docs.alfresco.com/5.0/concepts/metadata-model-props.html
Use peer associations. These allow you to have any kind of multiplicity relationship between nodes. Also bear in mind that the content of Alfresco nodes can be empty and you can use one only to hold metadata in a sense using it as an aspect. These are detailed in the data dictionary guide:
http://wiki.alfresco.com/wiki/Data_Dictionary_Guide#Peer_.28Non-Child.29_Associations
I’m having problem while adding the aspect to the required folders in Alfresco Share (Alfresco 4.2). When I click Manage Aspects, select the desired aspect then Save, a message pops up saying “Could not update aspects”.
Any help would be much appreciated.
Thank you..
share-config-custom.xml
<aspects>
<!-- Aspects that a user can see -->
<visible>
<aspect name="cm:generalclassifiable" />
<aspect name="cm:complianceable" />
<aspect name="cm:dublincore" />
<aspect name="cm:effectivity" />
<aspect name="cm:summarizable" />
<aspect name="cm:versionable" />
<aspect name="cm:templatable" />
<aspect name="cm:emailed" />
<aspect name="emailserver:aliasable" />
<aspect name="cm:taggable" />
<aspect name="app:inlineeditable" />
<aspect name="gd:googleEditable" />
<aspect name="cm:geographic" />
<aspect name="exif:exif" />
<aspect name="audio:audio" />
<aspect name="cm:indexControl" />
<aspect name="dp:restrictable" />
<aspect name="kb:referencable" />
</visible>
<!-- Aspects that a user can add. Same as "visible" if left empty -->
<addable>
</addable>
<!-- Aspects that a user can remove. Same as "visible" if left empty -->
<removeable>
</removeable>
</aspects>
custom-slingshot-application-context.xml.sample
<bean id="webscripts.kb.resources" class="org.springframework.extensions.surf.util.ResourceBundleBootstrapComponent">
<property name="resourceBundles">
<list>
<value>alfresco.messages.knowledgebase</value>
</list>
</property>
</bean>
web-client-config-custom.xml.sample
<config evaluator="aspect-name" condition="kb:referencable">
<property-sheet>
<show-property name="kb:documentRef"/>
</property-sheet>
</config>
<config evaluator="string-compare" condition="Action Wizards">
<aspects>
<aspect name="my:docProps" />
</aspects>
</config>
kb-model.xml
<aspects>
<!-- Definition of new Content Aspect: Knowledge Base Document -->
<aspect name="kb:referencable">
<title>Knowledge Base Referencable</title>
<properties>
<property name="kb:documentRef">
<type>d:text</type>
</property>
</properties>
</aspect>
</aspects>
kb-model-context.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<!-- Registration of new models -->
<bean id="extension.kb.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
<property name="models">
<list>
<value>alfresco/extension/kb-model.xml</value>
</list>
</property>
</bean>
<bean id="extension.kb.resourceBundle" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
<property name="resourceBundles">
<list>
<value>alfresco.messages.knowledgebase</value>
</list>
</property>
</bean>
</beans>
For creating aspect in Alfresco There are three main files which deals with aspects.
1.Model File In which you are defining aspect.
2.Context File(From which you are injecting model file)
3.Adding aspect for visibility in share-config-custom(Or web-client config if alfresco version is <5.0b)
Example of all above are as below.
Model File
<?xml version="1.0" encoding="UTF-8"?>
<model name="model1:ExtensionModel" xmlns="http://www.alfresco.org/model/dictionary/1.0" >
<description>Extension model</description>
<author>Krutik Jayswal</author>
<version>1.0</version>
<imports>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
</imports>
<namespaces>
<namespace uri="http://www.model.com/model/model/1.0" prefix="m1"/>
</namespaces>
<data-types/>
<constraints/>
<aspects>
<aspect name="m1:metadata1">
<title>Meta data 1</title>
<properties>
<property name="m1:Solution">
<title>Solution</title>
<type>d:text</type>
<mandatory>false</mandatory>
<index enabled="true">
<atomic>true</atomic>
<stored>true</stored>
<tokenised>TRUE</tokenised>
</index>
</property>
</properties>
</aspect>
</aspects>
</model>
Context File
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<!-- Registration of new models -->
<bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
<property name="models">
<list>
<value>alfresco/extension/extCustomModel.xml</value><!--This is path till model file.alfresco directory will be inside tomcat/shared classes/**alfresco**-->
</list>
</property>
</bean>
</beans>
Share-Config-Custom
<config evaluator="string-compare" condition="DocumentLibrary">
<aspects>
<visible>
<aspect name="m1:metadata1" />
</visible>
</aspects>
</config>
I create custom model with some textboxes and drop down controls. But I want to create file upload control. How can I do this in alfresco 4.2.f?
Can any one help me please? How can I create file upload in my custom content model??
I created custom model: following is my customModel.xml file
<?xml version="1.0" encoding="UTF-8"?>
<!-- Optional meta-data about the model -->
<description>Custom Model</description>
<author>Admin</author>
<version>1.0</version>
<imports>
<!-- Import Alfresco Dictionary Definitions -->
<import uri="http://www.alfresco.org/model/dictionary/1.0"
prefix="d" />
<!-- Import Alfresco Content Domain Model Definitions -->
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
<import uri="http://www.alfresco.org/model/system/1.0" prefix="sys" />
</imports>
<namespaces>
<namespace uri="http://www.healthindia.org/model/content/1.0" prefix="my" />
</namespaces>
<constraints>
<constraint name="my:departmentcategory" type="LIST">
<parameter name="allowedValues">
<list>
<value>Dep 1</value>
<value>Dep 2</value>
</list>
</parameter>
</constraint>
<constraint name="my:billcategory" type="LIST">
<parameter name="allowedValues">
<list>
<value>BillType1</value>
<value>BillType2</value>
</list>
</parameter>
</constraint>
</constraints>
<types>
<!-- Definition of new Content Type: Press Release -->
<type name="my:content">
<title>My Post</title>
<parent>cm:content</parent>
<properties>
<property name="my:department">
<title>Department</title>
<type>d:mltext</type>
<multiple>false</multiple>
<index enabled="false">
<atomic>false</atomic>
<stored>false</stored>
<tokenised>false</tokenised>
</index>
<constraints>
<constraint ref="my:departmentcategory" />
</constraints>
</property>
<property name="my:subject">
<title>Subject</title>
<type>d:mltext</type>
</property>
<property name="my:billtype">
<title>Bill Type</title>
<type>d:mltext</type>
<multiple>false</multiple>
<index enabled="false">
<atomic>false</atomic>
<stored>false</stored>
<tokenised>false</tokenised>
</index>
<constraints>
<constraint ref="my:billcategory" />
</constraints>
</property>
<property name="my:billtitle">
<title>Bill Title</title>
<type>d:mltext</type>
</property>
<property name="my:billno">
<title>Bill No</title>
<type>d:mltext</type>
</property>
<!-- <property name="my:category"> <title>Category</title> <type>d:mltext</type>
</property> -->
</properties>
<associations>
<association name="my:files">
<title>Files</title>
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>cm:content</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
</associations>
</type>
<!-- Definition of new Content Type: Press Release -->
<type name="my:housecontent">
<title>House Master</title>
<parent>cm:content</parent>
<properties>
<property name="my:houseid">
<title>House Id</title>
<type>d:mltext</type>
</property>
<property name="my:housename">
<title>House Name</title>
<type>d:mltext</type>
</property>
<!-- <property name="my:category"> <title>Category</title> <type>d:mltext</type>
</property> -->
</properties>
</type>
</types>
In this file I created textboxes and drop down controls, and I want file upload also (like Add Content in alfresco explorer). I don't have any idea about how this can be done.