cancel
Showing results for 
Search instead for 
Did you mean: 

Rest Api : Link a File to a Site

hilal_aslan
Confirmed Champ
Confirmed Champ

Hi,

 

I m using Alfresco Community 5.2. I want to create link a file(this file is in another site) to site by using REST API. But I can not find any document about this issue.

 

How can I create link to site for folder or any document?

Thanks in advance..

10 REPLIES 10

janv
Employee
Employee

You need to "create [the symbolic] link" in a new parent folder, hence use POST .../nodes/{parentFolderNodeId}/children:

Alfresco Content Services REST API Explorer 

The "cm:destination" property points to the source file. It should be noted that this is a pre-existing model as currently used by Share. Here the snippets from ...

applicationModel.xml

<type name="app:filelink">
   <title>File Link Object</title>
   <parent>cm:link</parent>
</type>

contentModel.xml

<type name="cm:link">
   <title>Link Object</title>
   <parent>cm:cmobject</parent>
   <properties>
      <property name="cm:destination">
         <title>Link Destination</title>
         <type>d:noderef</type>
         <mandatory>true</mandatory>
      </property>
   </properties>
</type>

Regards,

Jan