AnsweredAssumed Answered

Custom Folder Type

Question asked by sanjaybandhniya on Aug 4, 2018
Latest reply on Aug 6, 2018 by ratik.singhal

I have created custom folder with custom type with the help of onNewFolder action.Just changing itemId.

Custom folder have field like field1,field2 etc.... There is no cm:name property in that custom type.

Node is created but name is something like 'c3ee5007-296e-4dfa-a642-e5a26ca364fa' but i want to assign name like field1_field2.

 

How can i do that?

 

Custom Type : 

 

 

<types>
<type name="abc:project">
      <title>Project</title>
      <parent>cm:folder</parent>

<mandatory-aspects>
      <aspect>abc:projectId</aspect>
      <aspect>abc:projectName</aspect>
      <aspect>abc:projectConsultantName</aspect>
      <aspect>abc:region</aspect>
</mandatory-aspects>
</type>
</types>

 

toolbar.js 

 

 

this.widgets.newMOTCFolder = Alfresco.util.createYUIButton(this, "newMOTCFolder-button", this.onNewMOTCFolder,
{
   disabled: true,
   value: "CreateChildren"
});

 

var templateUrl = YAHOO.lang.substitute(Alfresco.constants.URL_SERVICECONTEXT + "components/form?itemKind={itemKind}&itemId={itemId}&destination={destination}&mode={mode}&submitType={submitType}&formId={formId}&showCancelButton=true",
{
      itemKind: "type",
      itemId: "abc:project",
      destination: destination,
      mode: "create",
      submitType: "json",
      formId: "doclib-common"
});

 

etc........

 

 

share-config-custom.xml

 

<config evaluator="model-type" condition="abc:project">
<forms>
<!-- Default Create Content form -->
   <form id="doclib-common">
      <field-visibility>
      <show id="abc:projectId" />
      <show id="abc:projectName" />
      <show id="abc:projectConsultantName" />
      <show id="abc:oman" />
</field-visibility>
<create-form template="../documentlibrary/forms/doclib-common.ftl" />
<appearance>
      <field id="abc:projectId" />
      <field id="abc:projectName" />
      <field id="abc:projectConsultantName"/>
      <field id="abc:oman" />
</appearance>
</form>
</forms>
</config>

Outcomes