cancel
Showing results for 
Search instead for 
Did you mean: 

Creating content of custom type in Share

horia
Champ in-the-making
Champ in-the-making
I am trying to have Share let the user create new documents based on a custom type I implemented (see the excellent documentation here <a>http://ecmarchitect.com/images/articles/alfresco-content/content-article-2ed.pdf</a>)

I had the type implemented and defined aspects, but I can't see a clear way to configure Share in order to propose in the interface my type for a new document.

I guess it should be added to the Create content menu option that lists available types.

Thanks
13 REPLIES 13

mitpatoliya
Star Collaborator
Star Collaborator
You just need to add one config in your share-config-custom.xml


  <config evaluator="string-compare" condition="DocumentLibrary">
<types>
         <type name="cm:content">        
          <subtype name="custom:contentType" />           
         </type>
      </types>

</config>


Have you added this entry?

horia
Champ in-the-making
Champ in-the-making
this won't change the list of content types to be created in the dropdown menu options

horia
Champ in-the-making
Champ in-the-making
I don't even know where the types of documents to be created come from, they are not listed in any .xml

rjohnson
Star Contributor
Star Contributor
Well according to this post

http://forums.alfresco.com/forum/developer-discussions/alfresco-share-development/add-own-content-ty...

(see item 10) all you need to do is add


<!– Document Library config section –>
<config evaluator="string-compare" condition="DocumentLibrary">
   <create-content>
      <content id="plain-text" mimetype="text/plain" label="criar-conteudo.text" itemid="axcl:cliente" icon="ax"/>
   </create-content>
</config>


in share-config-custom.xml in 4.0e (and presumably later)

Acknowledgement to Itardioli

It used to be much harder than that in earlier versions. Which version are you on.

Bob

mitpatoliya
Star Collaborator
Star Collaborator
Yeah, bob is right I just misread your question. Apologies.

horia
Champ in-the-making
Champ in-the-making
thanks, Bob, but this won't help.

I'm using a file called share-config-custom.xml placed under \tomcat\webapps\share\WEB-INF\classes\alfresco\web-extension. Alfresco 4.2c

Here is how the added section looks like:

        <config evaluator="string-compare" condition="DocumentLibrary">
           <create-content>
         <content id="plain-text" mimetype="text/plain" label="wavemachines.text" itemid="sc:doc"/>
      </create-content>
   </config>

horia
Champ in-the-making
Champ in-the-making
I discovered that once I include this section into
share-form-config.xml
, the new content type is shown.
This means that my
share-config-custom.xml
is ignored, how could that be?

rjohnson
Star Contributor
Star Contributor
Your share-config-custom.xml is in the wrong place. You need to put it in a directory

\tomcat\shared\classes\alfresco\web-extension

not

\tomcat\webapps\share\WEB-INF\classes\alfresco\web-extension

thats where mine is and it definately picks it up from there.

Bob

horia
Champ in-the-making
Champ in-the-making
no, the file was in the good place, otherwise it won't be used by Share, but by Explorer.

my problem was that the custom settings file contained some type declarations and aspects that influenced the content type settings. Obviously, the order of declarations is very important Smiley Happy

thanks for the help