cancel
Showing results for 
Search instead for 
Did you mean: 

Add Contentless metadata in alfresco

ojio_bis
Champ in-the-making
Champ in-the-making
I have a use case where I have a articletype as meta data for an content article.
This meta-data is not a fixed one and I need to some screens to manage this(create/read/update/delete)
I see there are three ways here.
1, Design lookup values for a piece of metadata in the content model as a typed list(Constraint).
2, One way to design is to store the articletype in relational world.
3, Model this meta data as content-less content model

The first solution will be less flexible as this meta-data needs to be managed. The second is simple and straight forward.
But I was planning to see if I can model this as content-less content model.

My Question is what will be option in alfreso web client / share to create screens to manage this model (with/without customising).

Can ECM forms can be used in this case?
15 REPLIES 15

amenel
Champ in-the-making
Champ in-the-making
Meanwhile,  is there any simple example of how to add a contentless data using a webscript.
Say for ex: I want to create a department which has name, location and description.  I will create a custom content model for this.  How to insert/update/delete/read this data using webscript ??

Any pointers can really help.

Hi,
the simplest way would be to manage every aspect of the adding/deleting/updating by yourself, which means designing your interface (which is typically made of forms) AND the webscript. The advantage is to have complete control over the formats, encodings, assumptions and conventions; that advantage minimizes dependencies to work by others and notably, unspoken assumptions. The drawback is having to do some work before succeeding in adding/deleting/etc. However, that work is relatively (heavy stress on "relatively") easy and short.

If you head for the 'complete control' option, go for the Alfresco webscript reference: http://wiki.alfresco.com/wiki/Web_Scripts
Otherwise, you will have to reuse what some other people have already done.

Since we here at BlueXML already did that work, I can offer some insight (whenever work load allows) or an example of how the read/delete/etc. works currently. Let us know which way you choose to go.

amenel
Champ in-the-making
Champ in-the-making
Meanwhile,  is there any simple example of how to add a contentless data using a webscript.

Say for ex: I want to create a department which has name, location and description.  I will create a custom content model for this.  How to insert/update/delete/read this data using webscript ??

Any pointers can really help.
There is no "simple example" because many steps/services/components are involved and a simple example is not enough. So I'll explain a few things and react to your questions.

Currently, we have a webscript that is deployed with XForms generation projects. A documentation should be available in the upcoming weeks. For now, the webscript exposes the API below for the operations you asked about. Note that "localhost:8080" is an example address for the host where the webscript is installed.

  • read: "http://localhost:8080/alfresco/service/xforms/read". Parameter: "objectId" (a complete Alfresco Id for the object to read with protocol and store, e.g. "workspace://SpacesStore/56146ba9-dfef-11de-9a2c-1955ff37e2bd"). Returns: an XML document that conforms to an xsd we defined. This service will read anything that is available in the Alfresco repository; we pose no restrictions in the webscript although Alfresco may prevent reading special stores or protocols (the "system" protocol comes to my mind).

  • delete: "http://localhost:8080/alfresco/service/xforms/delete". Parameter: "nodeRef" (also a complete Id). Returns the parameter that was provided. This service deletes the node ('NodeToDelete') whose Id is given, removing all its associations and deleting all nodes associated to NodeToDelete through ChildAssociations.

  • create/update/delete: "http://localhost:8080/alfresco/service/xforms/batch". This service is rather complex and I'll need more time to collect and present the information in a comprehensible form. I will post another message later specifically for batch. The batch service, also ruled by an xsd, supports Alfresco transactions and allows multiple operations (i.e. a mix of creations, updates and deletions) in one service call.

  • ASSUMPTIONS:
    - the HTTP method for calling those URLs MUST be POST
    - parameter names are case-sensitive
    - all parameters, including numeric ones, are provided as strings

    You may also be interested in:
  • list: "http://localhost:8080/alfresco/service/xforms/list". Parameters: 1- "type" (the name of a content type generated with SIDE), 2- "format" (a formatting specification for computing the label of each listed item. I'll come back to it in another post), 3- "query" (a string for restricting the items listed over searchable properties. For instance, if Department objects have searchable properties, providing "account" as query string will limit the listed items to the objects that have the string "account" in one of their searchable properties), 4- "maxResults" (the maximal number of items allowed in the result, no limit is applied if 0), 5- maxLength (if above 0, the length at which labels - indicated by the <value> tags in the example below - are truncated). Returns an XML document. This service lists all contents of the given type. If that type has subtypes, contents of those subtypes are also listed. We don't have an xsd for this service so here is an example of the result XML document:

  • <?xml version="1.0" encoding="UTF-8"?>
    <results>
       <query>
          <count>4</count>
          <maxResults>0</maxResults>
          <returned>4</returned>
          <query/>
       </query>
       <item>
          <id>workspace://SpacesStore/1e07f303-db69-11de-9fde-adb9e3c8d923</id>
          <value>Langue fr_FR</value>
       </item>
       <item>
          <id>workspace://SpacesStore/33ee074a-db69-11de-9fde-adb9e3c8d923</id>
          <value>Langue en_US</value>
       </item>
       <item>
          <id>workspace://SpacesStore/4745cf91-db69-11de-9fde-adb9e3c8d923</id>
          <value>Langue en_GB</value>
       </item>
       <item>
          <id>workspace://SpacesStore/8e654b5a-ddd1-11de-914b-219683673b8d</id>
          <value>Langue it_IT</value>
       </item>
    </results>

    jck
    Champ in-the-making
    Champ in-the-making
    In very short,
    SIDE-Labs takes care of all these things for you. You just have to design and generate and everything is ok.

    You will find some documentation at:
    * http://www.side-labs.org/wiki/index.php/DocumentationSmiley Surprisedverview
    * http://www.side-labs.org/wiki/index.php/Documentation:User:GettingStarted

    HTH

    JC

    PS: SIDE-Labs Forums have been fixed. You need to recreate an account on http://www.side-labs.org/forums/

    amisha
    Champ in-the-making
    Champ in-the-making
    Very informative post.This is another strategic component in the content management.

    amenel
    Champ in-the-making
    Champ in-the-making
    As jck said, if you use SIDE-Labs, you won't have to worry about CRUD operations: we took care of that. What you'll have to do is this:
    - model your content using a Data model
    - model your forms using a Forms Model
    - generate your models and deploy them to your Alfresco installation

    From there you'll be able to create, read, update and delete the contentless metadata from the XForms webapp you generated and deployed. That data is stored in the repository under Data Dictionary > SIDEDATA in a folder whose name is the name you chose in the Data model. In case you have several content types defined in your model, there will be one folder per content type.

    If you have another interface (like a Java or PHP application) or don't want to use the XForms forms, you may still use our webscript but you'll need some developer information, particularly the xsd files and format specification I mentioned in my previous post. If so, let us know.

    ojio_bis
    Champ in-the-making
    Champ in-the-making
    Thanks a lot for your replies JC and Amnel.
    I am particularly interested to understand about the XSD file as I am not using XForms and I am planning for a custom Java application.
    Once again Thanks a lot guys.