Alfresco Form-Model Management

11 Likes, 0 Dislikes, 11 Total

About this add-on

The Form Management Module allows you to design and manage forms that in turn deploy content models within Alfresco. Giving us the complete control over Usability, Design and Validation used in today's user focused forms. This is accomplished via the "hot deploy" method in the Data Dictio…

Visit code.google.com

License Type(s)

  • Mozilla Public License (MPL)
Description: 

The Form Management Module allows you to design and manage forms that in turn deploy content models within Alfresco. Giving us the complete control over Usability, Design and Validation used in today's user focused forms.

This is accomplished via the "hot deploy" method in the Data Dictionary/Models space. Therefore changes to the model are made available immediately.

Presentation Layer and Content Models.

Introducing a new presentation layer between the content model and the end user allows us to take control of the Usability, Design, Validation and verification used in today's modern forms. By splitting these layers up we can now take advantage of the following:

  • UI representation of form data can be completely custom (e.g. Using a slider, calendar, etc...)
  • Save time and effort creating forms and models (manage it in one place, manage the form = managing the model)
  • Move work over to the business area. Administrative staff can easily manage the forms themselves
  • Usability is in your complete control (Drag and drop order of fields, add help tips, create input masks so that data entry requires minimal skill and human error is minimized)
  • Use the same form on a different domain, outside Alfresco and manage it all in one place

NEW (2012-05-09): Added "Dummy Fields". A dummy field allows us to add fields to our form that we DO NOT want to put into the model. E.g. I may want cm:name in my form however, I cannot create cm:name again as its already in the Alfresco Model. If this is a "Dummy Field" it will be added to the JSON model and not the XML model BONUS! Dummy fields are colored yellow in the form builder.

--------------------------------------------------------------------------------

WEBINAR VIDEO TECH TALK LIVE: http://blogs.alfresco.com/wp/webcasts/2012/04/tech-talk-live-content-typ...

Updated Release on Google Code: Version 1.2.2
Last Updated: March 11th 2012
Comment: There are some interesting new features in this release check out the release notes for details
Release Notes
--------------------------------------------------------------------------------

EDIT: So far what have we accomplished?

  • Moved Constraints out of the model into a manageable service (Allows more than one aspect to use the same list, allows external lists to be used from other applications AND allows edit and removal of current constraints as this is no longer stored in the content model)
  • JSON Representation of a content model allows us to query it and grab information via webscripts without dealing with XML parsing
  • Allows for dependent information such as document type -> aspect collection (profiles)
  • Allows for much better usability and validation
  • Allows for completely new development on data respresentation e.g. (A slider can be used for integer or list values; check out the slider example in the form builder)
  • UI for managing forms and form validation
  • Both front end and back end node validation based upon given aspects or collections i.e. We can easily check if a node validates against a particular profile or aspect(s) even if it does not have it.
  • Allows for quick aspect management i.e. A node can have many aspects or profiles but in your application you may only want to deal with certain aspects at certain points. Using the FM Module you can show one, two or as many aspects are you like and deal with those aspects in an orderly fashion if you want! (Complete freedom over metadata and collections of data
  • Share site silos. The dropdown by share site feature allows you to show lists based upon share site. This allows each share site to have its own document types and profiles.

Documentation and Downloads.

Everything is available on google code via the download section or through the Wiki pages.

Development Requirements

  • jQuery
  • Alfresco REST services
  • Freemarker

To get your form up and running on existing applications you only need as little as 3 lines of init code:


$('.some-div-container').form({
'aspects': aspectObject
});

Please NOTE: This module is new, and will be ironing out bugs that pop up (Not a lot of testing as I have no user groups to test with :P )


Comments

  • Can you explain installation process in more detail?
    Thanks...

    dabada83 Fri, 02/10/2012 - 21:07
  • The installation only requires you to apply the AMP and manually create two spaces under company home > data dictionary; These are called "Constraints" and "JsonModels" respectively.

    Once those folders are made available, you can access the model manager here: http://localhost:8080/alfresco/wcs/form-builder/model-manager (replace localhost:8080 with your instance)

    Have you installed the AMP? Are you getting and error? Please explain what you have done so far so I can understand the issue.

    Cheers,
    Mike

    mike.priest Mon, 02/13/2012 - 06:29
  • Good morning, I followed the instructions but when I restart alfresco page http://localhost:8080/alfresco/wcs/form-builder/model-manager responds with the following error:

    Web Script Status 500 - Internal Error

    The Web Script /alfresco/wcs/form-builder/model-manager has responded with a status of 500 - Internal Error.

    500 Description: An error inside the HTTP server which prevented it from fulfilling the request.

    Message: 01140002 Wrapped Exception (with status template): 01140008 Failed to execute script 'classpath*:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/model-manager/model-manager.get.js': 01140007 TypeError: Cannot read property "children" from null (file:/opt/alfresco-4.0.c/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/ca/ab/fm/formsmanagement/model-manager/model-manager.get.js#1)

    Exception: org.mozilla.javascript.EcmaError - TypeError: Cannot read property "children" from null (file:/opt/alfresco-4.0.c/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/ca/ab/fm/formsmanagement/model-manager/model-manager.get.js#1)

    ....

    .....

    thanks for the help

    fmarigo Tue, 02/14/2012 - 10:03
  • Hello,

    Please download the latest AMP (I have updated google downloads to 1.1.9).

    http://alfresco-form-model-management.googlecode.com/files/alf_forms_man...

    The error you are receiving is because it cannot find Data Dictionary>Models. If you are using an Alfresco language pack and these folders are named differently in your alfresco instance please follow the following steps to get things up and running.

    Locate:
    \webapps\alfresco\WEB-INF\classes\alfresco\templates\webscripts\ca\ab\fm\formsmanagement\utils\locale\alfresco-locale.js

    The file will look something like this:
    var fmPath = {}
    fmPath.models = "Data Dictionary/Models/";
    fmPath.constraints = "Data Dictionary/Models/Constraints/";
    fmPath.jsonModels = "Data Dictionary/Models/JsonModels/";

    Change the paths to match your local space names. Refresh webscripts and you should be good to go.
    The error is coming from this line:
    var modelArr = companyhome.childByNamePath(fmPath.models).children;

    Hope that helps, Mike

    mike.priest Wed, 02/15/2012 - 08:46
  • Hi Mike, here I am confused, I am using default alfresco installtion (english), I have installed alfreso in /opt and installation folder is "/opt/alfresco-4.0.1/ , in this case, what parameter should I give in "alfresco-locale.js"
    Thanks
    Joseph John

    jjk_saji Wed, 05/16/2012 - 09:39
  • Ok, i composed model with aspect with fields. How to assign this model to particular file in share? How pop up this elegance form outside of FM?

    Vladimir Belov Mon, 02/13/2012 - 14:07
  • Hi Vladimir,

    In order to use the form outside of the FM manager you must use the jQuery plugin. There is documentation on google code on how to get this running. I will add a few example documents to the google Wiki today however the idea is to use the FM API to create and manage your own forms in Alfresco or Share. If you want to replace the Alfresco share forms you will have to do a bit of customization on the Alfresco side (Drop the plugin into Share and initiate the plugin on Alfresco's form div wrapper, but remember you will have to change this code when you update share).

    The forms you are creating can only be used via the FM plugin as Alfresco doesn't know what to do with it. I will create a couple of Share dashlets to show both aspect and metadata profile examples. I will update google and post the link on here soon.

    Mike

    mike.priest Wed, 02/15/2012 - 03:43
  • Hello Everyone, as per this post i have added a Share Demo Amp to google code. Here is a link to the AMP
    http://alfresco-form-model-management.googlecode.com/files/fmdemo-share.amp

    Please see the Wiki for details under the ShareDemonstration page:
    http://code.google.com/p/alfresco-form-model-management/w/list

    This will show you how to show the form, load node properties to it and save data back to the node.

    mike.priest Wed, 02/15/2012 - 08:44
  • I created a form in FM manager... ( http://localhost:8080/alfresco/wcs/form-builder/builder )
    I saved the form...
    When I add the dashlet to => http://localhost:8080/share/page/user/admin/dashboard => it carries the two fields "Aspects" and "Document UUID" ( the second one is marked as optional )
    >>>>> it really doesn't matter what I actually put in that field, behavior is always the same <<<<<

    when I enter the aspect name, which is "resumeaspect" and hit submit.... nothing shows up... I mean, I can see the "Save Metadata" button... but the tag where the form is supposed to be, is empty.

    url: http://localhost:8080/share/page/user/admin/dashboard?aspect=resumeaspec...

    I would really appreciate an explanation in detail, as I am not that familiar with Alfresco.

    Thanks...best wishes

    P.s.:
    I am using v4.0.d
    I read all that (http://code.google.com/p/alfresco-form-model-management/)
    I just don't get it, how to integrate that on a site.
    ================
    To get your form up and running on existing applications you only need as little as 3 lines of init code:

    $('').form({
    'aspects': aspectObject
    });

    mabs Fri, 03/23/2012 - 22:31
  • Hi there, from looking at your URL you are not giving the full aspect name. You need to include your namespace prefix, for example in the demos the prefix used was "dmo" therefore in the dashlet I would pass in something like dmo_aspectname
    (Use the underscore instead of colon); There is a doc that shows you how to use the API, three lines of front end code is all you need. You would have a get.js script or some other script hitting the API to collect the JSON object for that aspect or profile. Then all you need to do is put that object in the plugin on init. There is a webinar coming up next week, if you have any specific questions it would be a good place to ask (link is at the top of the page)

    $('.class-name-of-your-div').form({
    'aspects': ASPECT OBJECT HERE
    });

    mike.priest Wed, 03/28/2012 - 15:59
  • I actually debugged the server-side script and found out myself. "_" --> so in my case it is "mymodel_resumeaspect"

    ...

    mabs Thu, 03/29/2012 - 20:42
  • If you find this research/ development interesting and/or find these responses helpful please like this plugin via the like link next to the plugin title. I feel this is a really helpful plugin both from a business and development standpoint and would like everyone to understand where im going with it. NOTE: There is a nice new feature for building profiles and/or dropdown lists based upon Share site. This means each share site can have its own list of document types and in turn there own metadata profiles - see the wiki for details

    mike.priest Wed, 02/15/2012 - 08:41
  • I like this project but I have some problems implementing this functionality. First there is an error when I create a new form: DictionaryException: "Model '{x.model}y does not exist". see issuelist. What is the cause of this problem?

    a.vd.wiel Sun, 02/26/2012 - 03:28
  • Hello. I'll gladly look into this, though im having trouble trying to re-produce this bug. Could you please send me the following:

    • the error stack trace
    • Screenshot of your model properties from the model manager

    I think it may have something to do with the namespace prefixes but until I see whats going on exactly i wont know for sure.
    Cheers,
    Mike

    mike.priest Mon, 02/27/2012 - 15:55
  • Hi, I realized that the form-model-mgmt model-builder only picks up dynamic models, what about prefined models that we have already done within shared/classes/alfresco/extension? Do we need to add those as well as dynamic models?

    peterzmlim Thu, 03/29/2012 - 03:16
  • You have to add the models into the repo in Data Dictionary/Models. The FM Module will not pickup models deployed in the extension folder.

    mike.priest Sat, 04/07/2012 - 21:31
  • Nice add-on. Works great.

    mike oshields Wed, 05/16/2012 - 12:16