cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Nodes without versioning

mitschi
Champ in-the-making
Champ in-the-making
Hello,

is it possible to create Nodes via the JavaScript API (from a WebScript) which is NOT versioned by default? I've set all autoVersion Fields I know to false, but every time i add a node, it's still versioned. (Code on the end of post)

Thanks for help in advance!
Yours,
Mitschi

contentModel.xml
 
    <aspect name="cm:versionable">
         <title>Versionable</title>
         <properties>
            <property name="cm:versionLabel">
               <title>Version Label</title>
               <type>d:text</type>
               <protected>true</protected>
            </property>
            <property name="cm:initialVersion">
               <title>Initial Version</title>
               <type>d:boolean</type>
               <default>false</default>
            </property>
            <property name="cm:autoVersion">
               <title>Auto Version</title>
               <type>d:boolean</type>
               <default>false</default>
            </property>
            <property name="cm:autoVersionOnUpdateProps">
               <title>Auto Version - on update properties only</title>
               <type>d:boolean</type>
               <default>false</default>
            </property>
          </properties>
      </aspect>
2 REPLIES 2

mitschi
Champ in-the-making
Champ in-the-making
so, finally after reviewing the alfresco webscripts i encountered that code which versions the file, in createNode() function:


if (versioningState != null)
{
        node = cmis.applyVersioningState(node, versioningState);
}

The problem is now that i cannot reference the file …\alfresco\templates\webscripts\org\alfresco\cmis\lib\modify.lib.js with the following code:
<import resource="classpath:alfresco/templates/webscripts/org/alfresco/cmis/lib/modify.lib.js">

Is there any solution or workaround for this?

Thanks in advance, and kindly regards
mitschi

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
you can create document and them remove cm:versionable aspect .

if(hasAspect("cm:versionable")){
  removeAspect("cm:versionable")
}