I have created my own custom workflow (for now this is just adhoc workflow customization) and i have managed to customize start workflow form, however a can not customize second form, this is edit task form (when user start process and assign to "someone", "someone" get task in inbox and he see edit task form). This second form is the same as my first plus some extra fields. This is because i need that "someone" can view and edit data entered on start workflow form. So i basically copied first form configuration to second form but this doesn't work, only sets and textareas are rendered. Anybody now how can i customize this?
workflow definition
<process id="appppV1" name="Proces otvaranja projekta">
<startEvent id="start" name="Start" activiti:formKey="mcwm:submitStart"></startEvent>
<userTask id="preparationOfProjectCharter" name="Priprema projektne povelje" activiti:assignee="${bpm_assignee.properties.userName}" activiti:formKey="mcwm:preparationOfProjectCharter">
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
model for workflow:
<types>
<type name="mcwm:submitStart">
<parent>bpm:startTask</parent>
<properties>
<property name="mcwm:projectName">
<title>Naziv projekta</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="mcwm:shortProjectName">
<title>Skraćeni naziv projekta</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="mcwm:projectOrderer">
<title>Naručitelj projekta</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="mcwm:shortProjectOrderer">
<title>Skraćeni naziv naručitelja projekta</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="mcwm:isoProcess">
<title>ISO 9000 proces</title>
<type>d:text</type>
<mandatory>true</mandatory>
<default> </default>
<constraints>
<constraint name="mcwm:isoProcessChoices" type="LIST">
<parameter name="allowedValues">
<list>
<value> </value>
<value>održavanje - aplikativno</value>
<value>održavanje - sistemsko</value>
<value>konsalting</value>
<value>razvoj - sa odobrenjem arhitekture</value>
<value>razvoj - bez odobrenjem arhitekture</value>
<value>mali razvoj</value>
<value>implementacija</value>
</list>
</parameter>
</constraint>
</constraints>
</property>
<property name="mcwm:reporting">
<title>Učestalost izveštavanja</title>
<type>d:text</type>
<mandatory>true</mandatory>
<default>mesečno</default>
<constraints>
<constraint name="mcwm:reportingChoices" type="LIST">
<parameter name="allowedValues">
<list>
<value>mesečno</value>
<value>kvartalno</value>
<value>po okončanju</value>
</list>
</parameter>
</constraint>
</constraints>
</property>
<property name="mcwm:projectGoals">
<title>Ciljevi projekta</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="mcwm:beginDate">
<title>Datum početka projekta</title>
<type>d:date</type>
<mandatory>true</mandatory>
</property>
<property name="mcwm:endDate">
<title>Datum okončanja projekta</title>
<type>d:date</type>
<mandatory>false</mandatory>
</property>
<property name="mcwm:team">
<title>Projektni tim (*promena tipa kontorle)</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="mcwm:teamResource">
<title>Predviđeni utrošak ljudskih resursa (*promena tipa kontorle)</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="mcwm:teamComent">
<title>Komentar na predviđeni utrošak ljudskih resursa</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="mcwm:changeComent">
<title>Komentar izmene</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
</properties>
<!-- To select a user -->
<mandatory-aspects>
<aspect>bpm:assignee</aspect>
</mandatory-aspects>
</type>
<type name="mcwm:preparationOfProjectCharter">
<parent>bpm:workflowTask</parent>
<properties>
<property name="mcwm:editTask">
<title>Edit task</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
</properties>
</type>
share-config-custom.xml
<config evaluator="string-compare" condition="activiti$appppV1">
<forms>
<form>
<field-visibility>
<hide id="bpm:workflowDescription" />
<hide id="bpm:workflowDueDate" />
<hide id="bpm:workflowPriority" />
<show id="bpm:assignee" />
<show id="mcwm:projectName" />
<show id="mcwm:shortProjectName" />
<show id="mcwm:projectOrderer" />
<show id="mcwm:shortProjectOrderer" />
<show id="mcwm:isoProcess" />
<show id="mcwm:reporting"/>
<show id="mcwm:projectGoals"/>
<show id="mcwm:beginDate"/>
<show id="mcwm:endDate"/>
<show id="mcwm:team"/>
<show id="mcwm:teamResource"/>
<show id="mcwm:teamComent"/>
<show id="mcwm:changeComent"/>
<hide id="packageItems" />
<hide id="bpm:sendEMailNotifications" />
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="apppv1.set.projekat" />
<set id="general" appearance="fieldset" label-id="appppV1.set.general" />
<set id="date" template="/org/alfresco/components/form/2-column-set.ftl" appearance="fieldset" label-id="appppV1.set.date" />
<set id="team" appearance="fieldset" label-id="appppV1.set.team" />
<set id="change" appearance="fieldset" label-id="appppV1.set.change" />
<field id="mcwm:projectName" set="general" />
<field id="mcwm:shortProjectName" set="general" />
<field id="mcwm:projectOrderer" set="general" />
<field id="mcwm:shortProjectOrderer" set="general" />
<field id="mcwm:isoProcess" set="general" />
<field id="mcwm:reporting" set="general" />
<field id="mcwm:projectGoals" set="general">
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="style">width: 65%</control-param>
<control-param name="rows">5</control-param>
</control>
</field>
<field id="mcwm:beginDate" set="date"/>
<field id="mcwm:endDate" set="date"/>
<field id="bpm:assignee" set="team" label="Voditelj projekta"/>
<field id="mcwm:team" set="team">
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="style">width: 65%</control-param>
<control-param name="rows">5</control-param>
</control>
</field>
<field id="mcwm:teamResource" set="team"/>
<field id="mcwm:teamComent" set="team">
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="style">width: 65%</control-param>
<control-param name="rows">5</control-param>
</control>
</field>
<field id="mcwm:changeComent" set="change">
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="style">width: 65%</control-param>
<control-param name="rows">5</control-param>
</control>
</field>
</appearance>
</form>
</forms>
share-config-custom.xml - second form
<config evaluator="task-type" condition="mcwm:preparationOfProjectCharter">
<forms>
<form>
<field-visibility>
<show id="mcwm:projectName"/>
<show id="mcwm:editTask"/>
<hide id="bpm:workflowDescription" />
<hide id="bpm:workflowDueDate" />
<hide id="bpm:workflowPriority" />
<show id="bpm:assignee" />
<show id="mcwm:projectName" />
<show id="mcwm:shortProjectName" />
<show id="mcwm:projectOrderer" />
<show id="mcwm:shortProjectOrderer" />
<show id="mcwm:isoProcess" />
<show id="mcwm:reporting"/>
<show id="mcwm:projectGoals"/>
<show id="mcwm:beginDate"/>
<show id="mcwm:endDate"/>
<show id="mcwm:team"/>
<show id="mcwm:teamResource"/>
<show id="mcwm:teamComent"/>
<show id="mcwm:changeComent"/>
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="apppv1.set.projekat" />
<set id="general" appearance="fieldset" label-id="appppV1.set.general" />
<set id="date" template="/org/alfresco/components/form/2-column-set.ftl" appearance="fieldset" label-id="appppV1.set.date" />
<set id="team" appearance="fieldset" label-id="appppV1.set.team" />
<set id="change" appearance="fieldset" label-id="appppV1.set.change" />
<field id="mcwm:projectName" set="general" />
<field id="mcwm:shortProjectName" set="general" />
<field id="mcwm:projectOrderer" set="general" />
<field id="mcwm:shortProjectOrderer" set="general" />
<field id="mcwm:isoProcess" set="general" />
<field id="mcwm:reporting" set="general" />
<field id="mcwm:projectGoals" set="general">
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="style">width: 65%</control-param>
<control-param name="rows">5</control-param>
</control>
</field>
<field id="mcwm:beginDate" set="date"/>
<field id="mcwm:endDate" set="date"/>
<field id="bpm:assignee" set="team" label="Voditelj projekta"/>
<field id="mcwm:team" set="team">
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="style">width: 65%</control-param>
<control-param name="rows">5</control-param>
</control>
</field>
<field id="mcwm:teamResource" set="team"/>
<field id="mcwm:teamComent" set="team">
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="style">width: 65%</control-param>
<control-param name="rows">5</control-param>
</control>
</field>
<field id="mcwm:changeComent" set="change">
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="style">width: 65%</control-param>
<control-param name="rows">5</control-param>
</control>
</field>
<field id="mcwm:editTask" set="general" read-only="true"/>
</appearance>
</form>
</forms>
I try to use in show tag with force="true" attribute and this show my filed but data aren't transfered from my start from?!
Thanks in advance for help.
Regards,
Aleksandar
I think that you are not seeing any fields because mcwm:preparationOfProjectCharter task has no properties that you are trying to display.
If you want the same properties on second task that you have on first task you will have to define them in your task model.
If the properties are exactly the same and repeating a lot, you can specify them as an aspect and add them as mandatory aspect in task model.
Thanks for your help. :) I done something quite similar. I just set on my second task that parent is first task
<type name="mcwm:preparationOfProjectCharter">
<parent>mcwm:submitStart</parent>
and now i have all property from first task on my second task.
Regards,
Aleksandar
Related
I'm having issues and questions regarding the workflow details form. From what I've understood so far, modifications can mainly be done by modifying share-config-custom.xml, by adding a form-tag looking something like this (tried a number of variations):
<form id="workflow-details">
<field-visibility>
<show id="cmpny:processId" />
<hide id="cmpny:title" />
<hide id="cmpny:description" />
<hide id="packageItems" />
<hide id="cmpny:reason"/>
<hide id="cmpny:review"/>
<hide id="cmpny:deadline" />
<hide id="cmpny:customReviewOutcome"/>
</field-visibility>
<appearance>
<set id="" appearance="title" label="Overview" />
<set id="main" appearance="title" label="Description" />
<field id="cmpny:processId" set="main" label="Process-ID"/>
</appearance>
</form>
I have mainly tried copying the working form from one of the tasks and modifying it, giving it its own config-tag or added it to one existing one under the task's forms-tag, but nothing seems to work - at all. Whatever I do, no changes appear.
My main expectation is to having at least something appear, but no visible changes can be detected. I found this post:
Alfresco: Hide "General Info" section in workflow-details form
where the person in question at least managed to achieve some differences this way. I also want to modify the general-info, but that is another matter for another day. For the moment, I want to be able to modify the form displayed.
Apart from this, I wonder - most instructions on how to achieve this is very sparse. Most just seem to say "add a form with id=workflow-details to a task config-tag", and the form should appear once that specific task has been completed.
My questions are the following:
Apart from using a form with id="workflow-details" and adding it to a task's config-tag, is there anything more to it, in order to make it work?
Is there a way to make the form in question appear no matter the latest task?
** EDIT **
This is the latest code, unfiltered and cut straight from share-config-custom.xml.
<config evaluator="task-type" condition="cmpny:workflowModel_acceptreject">
<forms>
<form id="workflow-details">
<field-visibility>
<show id="cmpny:processId0" />
<show id="cmpny:title0" />
<show id="cmpny:description0" />
<show id="packageItems" />
<show id="cmpny:reason0"/>
<show id="cmpny:granskningsretur0"/>
<show id="cmpny:deadline0" />
<show id="cmpny:customReviewOutcome0"/>
</field-visibility>
<appearance>
<set id="" appearance="title" label="Översikt" />
<set id="main" appearance="title" label="Beskrivning" />
<set id="items" appearance="title" label="Information" />
<set id="other" appearance="title" label="Beslut" />
<field id="cmpny:processId0" set="main" label="Process-ID"><control template="/org/alfresco/components/form/controls/info.ftl"/></field>
<field id="cmpny:title0" set="main" label="Uppgiftsrubrik"><control template="/org/alfresco/components/form/controls/info.ftl"/></field>
<field id="cmpny:description0" set="main" label="Meddelande"><control template="/org/alfresco/components/form/controls/info.ftl"/></field>
<field id="packageItems" set="main" label="Bifogade Filer"/>
<field id="cmpny:reason0" set="main" label="Kommentar">
<control
template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="rows">4</control-param>
<control-param name="columns">8</control-param>
<control-param name="maxLength">5000</control-param>
</control>
</field>
<field id="cmpny:deadline0" set="items" label="Förfallodatum"><control template="/org/alfresco/components/form/controls/info.ftl"/></field>
<field id="cmpny:granskningsretur0" set="items" label="Granskning begärd"><control template="/org/alfresco/components/form/controls/info.ftl"/></field>
<field id="cmpny:customReviewOutcome0" label="Utfall" set="other">
<control template="/org/alfresco/components/form/controls/workflow/activiti-transitions.ftl" />
</field>
</appearance>
</form>
<form>
<field-visibility>
<show id="cmpny:processId0" />
<show id="cmpny:title0" />
<show id="cmpny:description0" />
<show id="packageItems" />
<show id="cmpny:reason0"/>
<show id="cmpny:granskningsretur0"/>
<show id="cmpny:deadline0" />
<show id="cmpny:customReviewOutcome0"/>
</field-visibility>
<appearance>
<set id="" appearance="title" label="Översikt" />
<set id="main" appearance="title" label="Beskrivning" />
<set id="items" appearance="title" label="Information" />
<set id="other" appearance="title" label="Beslut" />
<field id="cmpny:processId0" set="main" label="Process-ID"><control template="/org/alfresco/components/form/controls/info.ftl"/></field>
<field id="cmpny:title0" set="main" label="Uppgiftsrubrik"><control template="/org/alfresco/components/form/controls/info.ftl"/></field>
<field id="cmpny:description0" set="main" label="Meddelande"><control template="/org/alfresco/components/form/controls/info.ftl"/></field>
<field id="packageItems" set="main" label="Bifogade Filer"/>
<field id="cmpny:reason0" set="main" label="Kommentar">
<control
template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="rows">4</control-param>
<control-param name="columns">8</control-param>
<control-param name="maxLength">5000</control-param>
</control>
</field>
<field id="cmpny:deadline0" set="items" label="Förfallodatum"><control template="/org/alfresco/components/form/controls/info.ftl"/></field>
<field id="cmpny:granskningsretur0" set="items" label="Granskning begärd"><control template="/org/alfresco/components/form/controls/info.ftl"/></field>
<field id="cmpny:customReviewOutcome0" label="Utfall" set="other">
<control template="/org/alfresco/components/form/controls/workflow/activiti-transitions.ftl" />
</field>
</appearance>
</form>
</forms>
</config>
Screenshot (Only one, but the workflow-details-tag literally makes ZERO difference - screenshots are identical down to the pixel).
Perhaps at least worth mentioning is that I've also meddled some with the webscript, but I've checked that it isn't the cause.
Screenshot link here, can't add it directly apparently
I've tried multiple combinations, putting it in different tasks, shaving the parameters down to a bare minimum - nothing works. To just make it clear - ANY difference is what I'm aiming for at the moment - just getting anything to stick.
** EDIT 2 **
Clarified screenshot here.
Second, enhanced screenshot
This is the way you can add items in workflow details page
<field-visibility>
<show id="someWorkflow:VersionNumber" />
</field-visibility>
<appearance>
<set id="docSubDetails" label="Document Details"
template="/org/alfresco/components/form/2-column-set.ftl"/>
</appearance>
or Hide
<field-visibility>
<hide id="someWorkflow:VersionNumber" />
</field-visibility>
Full code
<config evaluator="task-type" condition="someWorkflow:peerReviewerTask">
<forms>
<form>
<field-visibility>
<show id="someWorkflow:VersionNumber" />
<show id="someWorkflow:documentLocation" />
<show id="someWorkflow:documentName" />
<show id="someWorkflow:author" />
<show id="bpm:assignees" />
<show id="bpm:comment" />
<show id="someWorkflow:peerReviewTaskOutcome" />
</field-visibility>
<appearance>
<set id="docSubDetails" label="Document Details" template="/org/alfresco/components/form/2-column-set.ftl"/>
<set id="docAuthor" appearance="title" label="" template="/org/alfresco/components/form/2-column-set.ftl"/>
<field id="someWorkflow:VersionNumber" set="docSubDetails" read-only="true"/>
<field id="someWorkflow:documentLocation" set="docSubDetails" read-only="true"/>
<field id="someWorkflow:documentName" set="docSubDetails" read-only="true"/>
<field id="someWorkflow:author" set="docAuthor" label="Author" read-only="true"/>
<field id="bpm:assignees" set="docAuthor" label="QC Reviewer(s)" read-only="true"/>
</field>
</appearance>
</form>
<form id="workflow-details">
<field-visibility>
<show id="someWorkflow:VersionNumber" />
<show id="someWorkflow:documentLocation" />
<show id="someWorkflow:documentName" />
<show id="someWorkflow:author" />
<show id="bpm:assignees" />
<show id="bpm:comment" />
<show id="someWorkflow:peerReviewTaskOutcome" />
</field-visibility>
<appearance>
<set id="docSubDetails" label="Document Details" template="/org/alfresco/components/form/2-column-set.ftl"/>
<set id="docAuthor" appearance="title" label="" template="/org/alfresco/components/form/2-column-set.ftl"/>
<field id="someWorkflow:VersionNumber" set="docSubDetails" read-only="true"/>
<field id="someWorkflow:documentLocation" set="docSubDetails" read-only="true"/>
<field id="someWorkflow:documentName" set="docSubDetails" read-only="true"/>
<field id="someWorkflow:author" set="docAuthor" label="Author" read-only="true"/>
<field id="bpm:assignees" set="docAuthor" label="QC Reviewer(s)" read-only="true"/>
</appearance>
</form>
</forms>
</config>
Workflow summary displays workflow / task details from start-task details only. So I have shared workflow model and share configuration also.
Workflow Model
<?xml version='1.0' encoding='UTF-8'?>
<model xmlns='http://www.alfresco.org/model/dictionary/1.0' name='workflowns:model'>
<version>1.0</version>
<imports>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
<import uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/>
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
<import uri="http://www.alfresco.org/model/site/1.0" prefix="st"/>
<import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm" />
</imports>
<namespaces>
<namespace uri="workflowns.model" prefix="workflowns"/>
</namespaces>
<types>
<type name="workflowns:Form0">
<title>Initiator Task</title>
<parent>bpm:startTask</parent>
<mandatory-aspects>
<aspect>bpm:assignee</aspect>
<aspect>workflowns:reviewerAspect</aspect>
<aspect>workflowns:approverAspect</aspect>
<aspect>workflowns:finalapproverAspect</aspect>
<aspect>workflowns:notesLabel</aspect>
<aspect>workflowns:Aspect1</aspect>
<aspect>workflowns:Aspect3</aspect>
</mandatory-aspects>
</type>
....
</model>
Share Custom Configuration
<!-- Workflow details page-->
<config evaluator="task-type" condition="workflowns:startTask">
<forms>
<form>
<field-visibility>
<show id="workflowns:documentname" />
<show id="workflowns:documentversion" />
<show id="workflowns:pathorlinktothedocument" />
<show id="workflowns:customerno" />
<show id="workflowns:projectno" />
<show id="workflowns:author" />
<show id="workflowns:reviewer" />
<show id="workflowns:approver" />
<show id="workflowns:finalapprover" />
<show id="workflowns:initiatorcomment" />
<show id="bpm:taskId" />
<show id="bpm:status" />
</field-visibility>
<appearance>
<set id="docDetails" appearance="title" label="Document Details"/>
<set id="docSubDetails" label="" template="/org/alfresco/components/form/2-column-set.ftl"/>
<set id="docAuthor" appearance="title" label="Author" template="/org/alfresco/components/form/2-column-set.ftl"/>
<set id="docReviewer" appearance="title" label="Reviewers" template="/org/alfresco/components/form/2-column-set.ftl"/>
<set id="docApprover" appearance="title" label="Approvers" template="/org/alfresco/components/form/2-column-set.ftl"/>
<set id="docFinalapprover" appearance="title" label="Final Approvers" template="/org/alfresco/components/form/2-column-set.ftl"/>
<field id="workflowns:documentname" set="docDetails" label="Document Name">
</field>
<field id="workflowns:documentversion" set="docDetails" label="Document Version">
</field>
<field id="workflowns:pathorlinktothedocument" set="docDetails" label="Path or Link to the document">
</field>
<field id="workflowns:customerno" set="docSubDetails" label="Customer Number">
</field>
<field id="workflowns:projectno" set="docSubDetails" label="Project Number">
</field>
<field id="workflowns:author" set="docAuthor" label="Author">
</field>
<field id="workflowns:reviewer" set="docReviewer" label="Reviewer">
</field>
<field id="workflowns:approver" set="docApprover" label="Approver">
</field>
<field id="workflowns:finalapprover" set="docFinalapprover" label="Final Approver">
</field>
</appearance>
</form>
</forms>
</config>
Hope this helps you.
I am able to successfully integrate between MONGODB & SOLR, using MONGO-CONNECTOR. And whenever, I update or add any thing, in the sample collection i have created, it copies only two or three fields in a documents, and rest of the fields data are not copied into solr. This is some thing I am not able to do it.
This is my collection and its document details. Name of collection: testdb
document inserted as follows:
db.testdb.insert( {
... _id: "101",
... name: "test",
... description: "descr",
... mydesc: "mydescr",
... nmdsc: "nmdsc1",
... coords: "coords1"
... })
And the data sync between solr and mongo logs says successful:
2014-01-17 19:35:38,462 - INFO - Finished 'http://<hostname>:<port>/solr/update/?co
mmit=true' (post) with body '<add><doc>' in 0.210 seconds.
But when I execute a query to see the document data it says only these fields data:
{
"responseHeader": {
"status": 0,
"QTime": 0,
"params": {
"q": "*:*",
"wt": "json"
}
},
"response": {
"numFound": 1,
"start": 0,
"docs": [
{
"id": "101",
"description": "descr",
"name": "test",
"_version_": 1457486601392226300
}
]
}
}
Clearly i can see that following fields & respective data are not copied into solr:
... mydesc: "mydescr",
... nmdsc: "nmdsc1",
... coords: "coords1"
Following is my schema.xml:
<schema name="narayana" version="1.5">
<types>
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true" />
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" positionIncrementGap="0" />
<fieldType name="text_wslc" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory" />
<filter class="solr.LowerCaseFilterFactory" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory" />
<filter class="solr.LowerCaseFilterFactory" />
</analyzer>
</fieldType>
<fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0" />
<fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate" />
<fieldType name="tdate" class="solr.TrieDateField" omitNorms="true" precisionStep="6" positionIncrementGap="0" />
</types>
<fields>
<field name="id" type="string" indexed="true" stored="true" required="true" />
<field name="name" type="text_wslc" indexed="true" stored="true" />
<field name="description" type="text_wslc" indexed="true" stored="true" />
<field name="mydesc" type="text_wslc" indexed="true" stored="true" />
<field name="nmdsc" type="text_wslc" indexed="true" stored="true" multiValued="true" />
<field name="coords" type="string" indexed="true" stored="true" multiValued="true" />
<field name="_version_" type="long" indexed="true" stored="true" />
<dynamicField name="*" type="string" indexed="true" stored="true" />
</fields>
<uniqueKey>id</uniqueKey>
<defaultSearchField>nmdsc</defaultSearchField>
<!-- we don't want too many results in this usecase -->
<solrQueryParser defaultOperator="AND" />
<copyField source="name" dest="nmdsc" />
<copyField source="description" dest="nmdsc" />
</schema>
You are defining your configuration to copy only two specific fields, if you want to index additional fields, you should be adding them to your configuration file and the same import cycle again:
<!-- we don't want too many results in this usecase -->
<solrQueryParser defaultOperator="AND" />
<copyField source="name" dest="nmdsc" />
<copyField source="description" dest="nmdsc" />
sI use activiti for my workflow on alfresco 4.2.c. I want to assign to a group from my form selection. But when I press submit task it throws an exception: org.activiti.engine.ActivitiException: Unknown property used in expression
My activiti is:
<userTask id="kiemtranoidungthethuc" name="Kiểm tra nội dung, thể thức VB- Chuyển cho phòng TCHC" activiti:assignee="${bpm_assignee.properties.userName}" activiti:formKey="wfdi:kiemtranoidungthethucTask_tc">
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate;
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
</activiti:string>
</activiti:field>
</activiti:taskListener>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
execution.setVariable('wfdi_userVanthu', person);
execution.setVariable('wfdi_chapthuan_tc', task.getVariable('wfdi_chapthuan_tc'));
<!-- execution.setVariable('bpm_assignee', person);-->
execution.setVariable('bpm_dueDate', task.getVariable('dueDate'));
execution.setVariable('bpm_priority', task.priority);
execution.setVariable('bpm_groupAssignee',task.bpm_groupAssignee);
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
<userTask id="kiemtrathethucchuky" name="Phòng TCHC - Kiểm tra thể thức, chữ ký - Chuyển cho BGH"
activiti:candidateGroups="${bpm_groupAssignee.properties.authorityName}" activiti:formKey="wfdi:kiemtrathethucchukyTask_tc">
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate;
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_priority;
<!-- if (typeof bpm_comment != 'undefined') task.setVariable('bpm_comment', bpm_comment);-->
</activiti:string>
</activiti:field>
</activiti:taskListener>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
execution.setVariable('wfdi_kiemtra_tc', task.getVariable('wfdi_kiemtra_tc'));
execution.setVariable('bpm_dueDate', task.getVariable('dueDate'));
execution.setVariable('bpm_priority', task.priority);
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
My form is:
<config evaluator="task-type" condition="wfdi:kiemtranoidungthethucTask_tc">
<forms>
<form>
<field-visibility>
<show id="message" />
<show id="taskOwner" />
<show id="bpm:priority" />
<show id="bpm:dueDate" />
<show id="bpm:taskId" />
<show id="packageItems" />
<show id="bpm:groupAssignee" />
<show id="bpm:comment" />
<show id="wfdi:chapthuan_tc" />
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="workflow.set.task.info" />
<set id="info" appearance="" template="/org/alfresco/components/form/3-column-set.ftl" />
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="assignee" appearance="title" label-id="workflow.set.assignee" />
<set id="response" appearance="title" label-id="workflow.set.response" />
<field id="message">
<control template="/org/alfresco/components/form/controls/info.ftl" />
</field>
<field id="taskOwner" set="info" />
<field id="bpm:taskId" set="info">
<control template="/org/alfresco/components/form/controls/info.ftl" />
</field>
<field id="bpm:priority" set="info" read-only="true">
<control template="/org/alfresco/components/form/controls/workflow/priority.ftl" />
</field>
<field id="bpm:dueDate" set="info" label-id="workflow.field.due">
<control template="/org/alfresco/components/form/controls/info.ftl" />
</field>
<field id="packageItems" set="items" />
<field id="bpm:groupAssignee" label-id="workflow.field.review_group" set="assignee" />
<field id="bpm:comment" label-id="workflow.field.comment" set="response">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="wfdi:chapthuan_tc" label-id="workflow.field.outcome" set="response">
<control template="/org/alfresco/components/form/controls/workflow/activiti-transitions.ftl" />
</field>
</appearance>
</form>
</forms>
My model is:
<type name="wfdi:kiemtranoidungthethucTask_tc">
<parent>bpm:workflowTask</parent>
<properties>
<property name="wfdi:chapthuan_tc">
<type>d:text</type>
<default>Tu_Choi</default>
<constraints>
<constraint name="wfdi:chapthuanOption_tc" type="LIST">
<parameter name="allowedValues">
<list>
<value>Chuyen_Phong_TCHC</value>
<value>Tu_Choi</value>
</list>
</parameter>
</constraint>
</constraints>
</property>
</properties>
<overrides>
<property name="bpm:packageItemActionGroup">
<default>edit_package_item_actions</default>
</property>
<property name="bpm:outcomePropertyName">
<default>{http://www.alfresco.org/model/workflow/1.0}chapthuan</default>
</property>
</overrides>
<mandatory-aspects>
<aspect>bpm:groupAssignee</aspect>
</mandatory-aspects>
I know the problem is: activiti:candidateGroups="${bpm_groupAssignee.properties.authorityName}"
but I don't know how to fix it.
Can anybody help me?
Thank in advance.
I am trying to build a custom workflow in alfresco community edition. Basically I am trying to modify the existing workflow called lifecycleprocess. I have been able to deploy the process using workflow console without error. But I am not able to do any change at all on the workflow form. My workflow is called leaveprocess and I have the following code :
Path : alfresco/tomcat/shared/classes/alfresco/extension/
leave-process-bpmn20.xml
<?xml version="1.0" encoding="UTF-8" ?>
<definitions id="leave-definitions"
typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath"
targetNamespace="http://activiti.org/bpmn20"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:activiti="http://activiti.org/bpmn">
<process id="activitileaveApproval" name="Leave Process">
<extensionElements>
<!-- When process is deleted/cancelled, status should be set to draft -->
<activiti:executionListener event="end" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
<activiti:field name="script">
<activiti:string>
if(cancelled || deleted) {
for (var i = 0; i < bpm_package.children.length; i++)
{
if (!bpm_package.children[i].hasAspect("wfl:status"))
{
bpm_package.children[i].properties["wfl:status"] = "Draft";
bpm_package.children[i].save();
}
}
}
</activiti:string>
</activiti:field>
</activiti:executionListener>
</extensionElements>
<startEvent id="start"
activiti:formKey="wf:submitReviewTask" />
<sequenceFlow id='flow1'
sourceRef='start'
targetRef='reviewTask'>
<extensionElements>
<activiti:executionListener event="take" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
<activiti:field name="script">
<activiti:string>
for (var i = 0; i < bpm_package.children.length; i++)
{
if (!bpm_package.children[i].hasAspect("wfl:status"))
{
bpm_package.children[i].addAspect("wfl:status");
}
}
</activiti:string>
</activiti:field>
</activiti:executionListener>
</extensionElements>
</sequenceFlow>
<userTask id="reviewTask" name="Review Task"
activiti:formKey="wf:activitiReviewTask">
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
for (var i = 0; i < bpm_package.children.length; i++)
{
if (bpm_package.children[0].hasAspect("wfl:status")) {
bpm_package.children[i].properties["wfl:status"] = "In Review";
bpm_package.children[i].save();
}
}
</activiti:string>
</activiti:field>
</activiti:taskListener>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
execution.setVariable('wf_reviewOutcome', task.getVariable('wf_reviewOutcome'));
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
<humanPerformer>
<resourceAssignmentExpression>
<formalExpression>${bpm_assignee.properties.userName}</formalExpression>
</resourceAssignmentExpression>
</humanPerformer>
</userTask>
<sequenceFlow id='flow2'
sourceRef='reviewTask'
targetRef='reviewDecision' />
<exclusiveGateway id="reviewDecision" name="Review Decision" />
<sequenceFlow id='flow3' sourceRef='reviewDecision' targetRef='approved' >
<conditionExpression xsi:type="tFormalExpression">${wf_reviewOutcome == 'Approve'}</conditionExpression>
</sequenceFlow>
<sequenceFlow id='flow4'
sourceRef='reviewDecision'
targetRef='rejected' />
<userTask id="approved" name="Document Approved"
activiti:formKey="wf:approvedTask" >
<documentation>
The document was reviewed and approved.
</documentation>
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
for (var i = 0; i < bpm_package.children.length; i++)
{
if (bpm_package.children[0].hasAspect("wfl:status")) {
bpm_package.children[i].properties["wfl:status"] = "Approved";
bpm_package.children[i].save();
}
}
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
<humanPerformer>
<resourceAssignmentExpression>
<formalExpression>${initiator.properties.userName}</formalExpression>
</resourceAssignmentExpression>
</humanPerformer>
</userTask>
<userTask id="rejected" name="Document Rejected"
activiti:formKey="wf:rejectedTask" >
<documentation>
The document was reviewed and rejected.
</documentation>
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
for (var i = 0; i < bpm_package.children.length; i++)
{
if (bpm_package.children[0].hasAspect("wfl:status"))
{
bpm_package.children[i].properties["wfl:status"] = "Draft";
bpm_package.children[i].save();
}
}
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
<humanPerformer>
<resourceAssignmentExpression>
<formalExpression>${initiator.properties.userName}</formalExpression>
</resourceAssignmentExpression>
</humanPerformer>
</userTask>
<sequenceFlow id='flow5' sourceRef='approved'
targetRef='end' />
<sequenceFlow id='flow6' sourceRef='rejected'
targetRef='end' />
<endEvent id="end" />
</process>
</definitions>
leave-messages.properties
# For JBPM leave Workflow Example
wfl_leaveapproval.workflow.title=Leave Application
wfl_leaveapproval.workflow.description=Leave Application (Auto updates document status)
wfl_leaveapproval.node.review.transition.reject.title=Reject
wfl_leaveapproval.node.review.transition.reject.description=Reject
wfl_leaveapproval.node.review.transition.approve.title=Approve
wfl_leaveapproval.node.review.transition.approve.description=Approve
# For Activiti leave Workflow Example
activitileaveApproval=Leave Application
activitileaveApproval=Leave Application workflow Activiti (Auto updates document status)
leave-workflow-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>
<bean id="leave.workflowBootstrap" parent="workflowDeployer">
<property name="workflowDefinitions">
<list>
<!-- JBPM version of leave process -->
<props>
<prop key="engineId">jbpm</prop>
<prop key="location">alfresco/extension/leave_processdefinition.xml</prop>
<prop key="mimetype">text/xml</prop>
<prop key="redeploy">false</prop>
</props>
<!-- Activiti version of leave process -->
<props>
<prop key="engineId">activiti</prop>
<prop key="location">alfresco/extension/leave-process.bpmn20.xml</prop>
<prop key="mimetype">text/xml</prop>
<prop key="redeploy">false</prop>
</props>
</list>
</property>
<property name="models">
<list>
<value>alfresco/extension/leaveModel.xml</value>
</list>
</property>
<property name="labels">
<list>
<value>alfresco/extension/leave-messages</value>
</list>
</property>
</bean>
</beans>
leave_processdefinition.xml
<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wfl:leaveapproval">
<swimlane name="initiator" />
<start-state name="start">
<task name="wf:submitReviewTask" swimlane="initiator" />
<event type="node-leave">
<!-- Call script once the workflow package exists i.e. on node-leave -->
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<!-- Apply the Workflow leave Aspect (wfl:status) if not set already. Note: The default wfl:status property is draft -->
<script>
for (var i = 0; i < bpm_package.children.length; i++)
{
if (!bpm_package.children[i].hasAspect("wfl:status"))
{
bpm_package.children[i].addAspect("wfl:status");
}
}
</script>
</action>
</event>
<transition name="" to="review" />
</start-state>
<swimlane name="reviewer">
<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
<actor>#{bpm_assignee}</actor>
</assignment>
</swimlane>
<task-node name="review">
<event type="node-enter">
<!-- Update the status to In Review when we enter this task -->
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
for (var i = 0; i < bpm_package.children.length; i++)
{
bpm_package.children[i].properties["wfl:status"] = "In Review";
bpm_package.children[i].save();
}
</script>
</action>
</event>
<task name="wf:reviewTask" swimlane="reviewer">
<event type="task-create">
<script>
if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
</script>
</event>
</task>
<transition name="approve" to="approved" />
<transition name="reject" to="rejected" />
</task-node>
<task-node name="rejected">
<event type="node-enter">
<!-- Update the status to Draft when we enter this task -->
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
for (var i = 0; i < bpm_package.children.length; i++)
{
bpm_package.children[i].properties["wfl:status"] = "Draft";
bpm_package.children[i].save();
}
</script>
</action>
</event>
<task name="wf:rejectedTask" swimlane="initiator" />
<transition name="" to="end" />
</task-node>
<task-node name="approved">
<event type="node-enter">
<!-- Update the status to Approved when we enter this task -->
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
for (var i = 0; i < bpm_package.children.length; i++)
{
bpm_package.children[i].properties["wfl:status"] = "Approved";
bpm_package.children[i].save();
}
</script>
</action>
</event>
<task name="wf:approvedTask" swimlane="initiator" />
<transition name="" to="end" />
</task-node>
<end-state name="end" />
<event type="process-end">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
if (cancelled)
{
for (var i = 0; i < bpm_package.children.length; i++)
{
if (bpm_package.children[0].hasAspect("wfl:status"))
{
bpm_package.children[i].properties["wfl:status"] = "Draft";
bpm_package.children[i].save();
}
}
if (logger.isLoggingEnabled()) logger.log("Workflow cancelled, status reset to Draft");
}
else
{
if (logger.isLoggingEnabled()) logger.log("Workflow completed");
}
</script>
</action>
</event>
</process-definition>
leaveModel.xml
<?xml version="1.0" encoding="UTF-8"?>
<model name="wfl:workflowleavemodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<!-- Optional meta-data about the model -->
<description>Workflow leave Model</description>
<author></author>
<version>1.0</version>
<!-- Imports are required to allow references to definitions in other models -->
<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" />
</imports>
<namespaces>
<namespace uri="wfl.model" prefix="wfl" />
</namespaces>
<constraints>
<constraint name="wfl:status" type="LIST">
<parameter name="allowedValues">
<list>
<value>Draft</value>
<value>In Review</value>
<value>Approved</value>
</list>
</parameter>
</constraint>
</constraints>
<aspects>
<!-- Status property is used to manage workflow approval -->
<aspect name="wfl:status">
<title>Status</title>
<properties>
<property name="wfl:status">
<title>Status</title>
<type>d:text</type>
<default>Draft</default>
<constraints>
<constraint ref="wfl:status" />
</constraints>
</property>
</properties>
</aspect>
</aspects>
</model>
Path : alfresco/tomcat/webapps/share/WEB-INF/classes/alfresco/
share-workflow-form-config.xml
<!-- Leave Workflow Definition -->
<config evaluator="string-compare" condition="jbpm$wfl:leaveApproval">
<forms>
<form>
<field-visibility>
<show id="bpm:workflowDescription" />
<show id="bpm:workflowDueDate" />
<show id="bpm:workflowPriority" />
<show id="bpm:assignee" />
<show id="packageItems" />
<show id="bpm:sendEMailNotifications" />
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="workflow.set.general" />
<set id="info" appearance="" template="/org/alfresco/components/form/2-column-set.ftl" />
<set id="assignee" appearance="title" label-id="workflow.set.assignee" />
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="other" appearance="title" label-id="workflow.set.other" />
<field id="bpm:workflowDescription" label-id="workflow.field.message">
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="style">width: 95%</control-param>
</control>
</field>
<field id="bpm:workflowDueDate" label-id="workflow.field.due" set="info" />
<field id="bpm:workflowPriority" label-id="workflow.field.priority" set="info">
<control template="/org/alfresco/components/form/controls/workflow/priority.ftl" />
</field>
<field id="bpm:assignee" label-id="workflow.field.reviewer" set="assignee" />
<field id="packageItems" set="items" />
<field id="bpm:sendEMailNotifications" set="other">
<control template="/org/alfresco/components/form/controls/workflow/email-notification.ftl" />
</field>
</appearance>
</form>
</forms>
</config>
<config evaluator="string-compare" condition="activiti$activitileaveApproval">
<forms>
<form>
<field-visibility>
<show id="bpm:workflowDescription" />
<show id="bpm:workflowDueDate" />
<show id="bpm:workflowPriority" />
<show id="bpm:assignee" />
<show id="packageItems" />
<show id="bpm:sendEMailNotifications" />
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="workflow.set.general" />
<set id="info" appearance="" template="/org/alfresco/components/form/2-column-set.ftl" />
<set id="assignee" appearance="title" label-id="workflow.set.assignee" />
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="other" appearance="title" label-id="workflow.set.other" />
<field id="bpm:workflowDescription" label-id="workflow.field.message">
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="style">width: 95%</control-param>
</control>
</field>
<field id="bpm:workflowDueDate" label-id="workflow.field.due" set="info">
<control template="/org/alfresco/components/form/controls/date.ftl">
<control-param name="showTime">false</control-param>
<control-param name="submitTime">false</control-param>
</control>
</field>
<field id="bpm:workflowPriority" label-id="workflow.field.priority" set="info">
<control template="/org/alfresco/components/form/controls/workflow/priority.ftl" />
</field>
<field id="bpm:assignee" label-id="workflow.field.reviewer" set="assignee" />
<field id="packageItems" set="items" />
<field id="bpm:sendEMailNotifications" set="other">
<control template="/org/alfresco/components/form/controls/workflow/email-notification.ftl" />
</field>
</appearance>
</form>
</forms>
</config>
I am unable to understand, no matter what changes I do in this code for share-workflow-form-config.xml, It does not reflect when go to Share->Workflows I've started->select Leave Process. It always show the default form there. Somebody please guide me what I am doing wrong here.
You need to replace this
<form>
with following line
<form id="workflow-details">
means add attribute "id" in your form tag
After making changes in share-config you have to restart alfresco :)
Deploy of workflow (via workflow console) makes just re-deploy of the workflow definitions (also like deploy of models,.. )
But
<config evaluator="string-compare" condition="jbpm$wfl:leaveApproval">
Should works :D, no other idea why not working..
In the share-config-custom.xml i've defined the following:
<config evaluator="node-type" condition="zk:document">
<forms>
<form>
<field-visibility>
<show id="cm:name" />
<show id="cm:description" force="true" />
<show id="zk:nummer" />
<show id="zk:registratieDatum" />
<show id="zk:zaakType" />
<show id="zk:documentType" />
<show id="zk:vertrouwelijkheid" />
<show id="zk:richting" />
<show id="zk:subject" />
<show id="zk:object" />
<show id="zk:perceel" />
<show id="cm:taggable" for-mode="edit" force="true" />
</field-visibility>
<appearance>
</appearance>
</form>
</forms>
</config>
The form shows fine in View and Edit(full metadata edit), but in simple edit mode (on docLibrary --> edit metadata) I'm getting too many fields.
I want only to show a couple of fields in simple mode and the full stack in full mode.
How can I achieve this? e.g. like the cm:content in simple mode only name, title & description and in Full mode the full stack.
Very simple to reproduce this:
- Start Alfresco
- Add a content
- click on edit-metadata (in docLib), you will see a simple edit form
- click on the upper-right corner, you will see a full edit form
My question:
- How can I configure the simple edit form?
Thanks!
Have a look at the original share form config: tomcat/webapps/share/WEB-INF/classes/alfresco/share-form-config.xml
There you can see that the simple metadata dialog has a separate form definition. It can be set by using the form id="doclib-simple-metadata" in addition to the normal form that you already have defined.
<config evaluator="node-type" condition="zk:document">
<forms>
<form>.... your full form here....</form>
<form id="doclib-simple-metadata">
<field-visibility>
<show id="cm:name" />
<show id="cm:title" force="true" />
<show id="cm:description" force="true" />
<!-- tags and categories -->
<show id="cm:taggable" for-mode="edit" force="true" />
<show id="cm:categories" />
</field-visibility>
</form>
</forms>
</config>
you need to add another formid (doclib-simple-metadata):
<form id="doclib-simple-metadata">
<field-visibility>
<show id="cm:name" />
<show id="cm:title" force="true" />
<show id="cm:description" force="true" />
<!-- tags and categories -->
<show id="cm:taggable" for-mode="edit" force="true" />
<show id="cm:categories" />
</field-visibility>
<edit-form template="../documentlibrary/forms/doclib-simple-metadata.ftl" />
<appearance>
<field id="cm:title">
<control template="/org/alfresco/components/form/controls/textfield.ftl" />
</field>
<field id="cm:description">
<control>
<control-param name="activateLinks">true</control-param>
</control>
</field>
<field id="cm:taggable">
<control>
<control-param name="compactMode">true</control-param>
<control-param name="params">aspect=cm:taggable</control-param>
<control-param name="createNewItemUri">/api/tag/workspace/SpacesStore</control-param>
<control-param name="createNewItemIcon">tag</control-param>
</control>
</field>
<field id="cm:categories">
<control>
<control-param name="compactMode">true</control-param>
</control>
</field>
</appearance>
</form>
Cheers, jan (#alfrescian)