Show cm:creator e cm:modifier in dataList

cancel
Showing results for 
Search instead for 
Did you mean: 
mikele
Active Member

Show cm:creator e cm:modifier in dataList

Jump to solution

Hello,
I am a beginner of alfresco. I would need to display when creating a data list the user who creates it and the user who is editing.
I made the changes in the share-config-custom.xml file by adding these directives:

<config condition="btcSmiley TonguerojectListItem" evaluator="model-type">
<forms>
<!-- Create item form -->
<form>
<field-visibility>
<show id="btcSmiley TonguerojectName" />
<show id="btc:clientName" />
<show id="btc:contactPerson" />
<show id="cm:modifier" />

<show id="cm: creator" />
</field-visibility>

<config condition="btcSmiley TonguerojectListItem" evaluator="node-type">
<forms>
<!-- Create item form -->
<form>
<field-visibility>
<show id="btcSmiley TonguerojectName" />
<show id="btc:clientName" />
<show id="btc:contactPerson" />
<show for-mode="view" id="cm:creator" />
<show for-mode="view" id="cm:modifier" />
</field-visibility>

the creator and modifier fields are shown to me in read-only format and are empty

Someone could tell me if we can do this from the file share-config-custom?

has anyone ever used autocompler to populate the cm: creator field?

I've read the Rules autocomplete options | from the official guide Alfresco Documentation.

 

I would need to understand if I can use node.cm:creator within the xml file?

 

Someone could give me some indication?

Thank you very much

1 Solution

Accepted Solutions
sanjaybandhniya
Intermediate

Re: Show cm:creator e cm:modifier in dataList

Jump to solution

These fields are handled by system during creating/editing node so we cannot make it as user input field.You can use it for display purpose.

Thanks,

Contcentric

View solution in original post

6 Replies
sanjaybandhniya
Intermediate

Re: Show cm:creator e cm:modifier in dataList

Jump to solution

These fields are handled by system during creating/editing node so we cannot make it as user input field.You can use it for display purpose.

Thanks,

Contcentric

mikele
Active Member

Re: Show cm:creator e cm:modifier in dataList

Jump to solution

You can use it for display purpose.....??? What do you mean? How can I view them? Can you give me a suggestion?

Thank you very much

sanjaybandhniya
Intermediate

Re: Show cm:creator e cm:modifier in dataList

Jump to solution

Configure your datalist in share-config-custom.xml below way.

<config evaluator="model-type" condition="trtxdl:country">
<forms>
   <form>
      <field-visibility>
         <show id="trtxdl:countryName" />
         <show id="trtxdl:isActive" />
      </field-visibility>
<create-form template="../data-lists/forms/dataitem.ftl" />
<appearance></appearance>
</form>
<!-- Data Grid view -->
<form id="datagrid">
   <field-visibility>
      <show id="trtxdl:countryName" />
      <show id="trtxdl:isActive" />
      <show id="cm:modified" />
      <show id="cm:created" />
      <show id="cm:creator" />
      <show id="cm:modifier" />
</field-visibility>
</form>
</forms>
</config>

mikele
Active Member

Re: Show cm:creator e cm:modifier in dataList

Jump to solution
Thank you so much for answering me. Is it possible to change the style? 
I would like to remove the * sign and change the background,
bring up the background color of the field on gray.
Thank you so much for every possible answer

I've already tried to change the style nl file share-config-custom.xml but nothing to do

<field id="cm:modifier" label="Modificato da" mandatory="false" >
<control-param name="style">background-color: red</control-param>
</field>

with this instruction only the name of the label is changed, the * sign remains
and the color remains the same

Can you give me some ideas?

Thank you very much
mikele
Active Member

Re: Show cm:creator e cm:modifier in dataList

Jump to solution

Hello
I put the following piece of code in the share-config-custom.xml:
<field id = "cm: modifier" label = "Modified by">
<control template = "/ org / alfresco / components / form / controls / textfield.ftl">
<control-param name = "style"> background-color: #CCCCCC </ control-param>
</ Control>
</ Field>

Browsing the documentation and more I did not understand how to delete the symbol (*) next to the cm: creator and cm: modifier fields

There's a way?

Do you have any ideas to suggest?

thank you very much

sanjaybandhniya
Intermediate

Re: Show cm:creator e cm:modifier in dataList

Jump to solution

These field are by default true from content-model so specifying mandatory="false" it will not remove symbol(*).

Workaround you can remove by specifying custom-control(custom_textfield.ftl-) and remove mandatory condition