New Alfresco tutorial on working with a custom content model

UPDATE (2012): I’ve recently published a second edition of this tutorial that updates the original with Alfresco Share and CMIS.

UPDATE (2014): I’ve moved the tutorial and the source code to GitHub. The HTML version of the tutorial is here. It has been updated for Maven and AMPs.

I’ve written a new article (with sample files) that talks about how to extend Alfresco with your own content model and how to work with content that leverages that model via the Web Services API. All of the examples are written in Java but I do include one in PHP just for grins.

Most of the code is based on the Alfresco SDK Web Services sample code, but I’ve tweaked it here and there and I break it down into smaller chunks with commentary. I also think it is good to have one example to follow that takes you from designing the content model to implementing it to writing code that might leverage it.

More about the Alfresco Developer Series.

114 comments

  1. Jani says:

    Hi,

    Thank you for your article. But I have a problem. I put files someco-model-context.xml, scModel.xml, web-client-config-custom.xml, webclient.properties and webserviceclient.properties in directory C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension. When I create new contenct I can se new type (Someco Document, Someco Whitepaper) but when I look at created document properties, there are no custom fields.
    I use the latest version of Alfresco (ver 3), instaled on WinXP virual machine.

    What is wrong in my case?

    Thanx,

    Jani

  2. mco says:

    hi
    I read Your guide – it is very helpfull to understand content model. But I have a problem to something like this:
    I’d like to create new content, based on some web form, but I need to use it like a folder in web client (especially navigate and add new subitems in many levels).
    I created a new demo type (extending wcm:avmcontent) and added child-association (targeted with my demo type), but I’m not sure is it correct and I’ve no idea how to configure web client.
    Is it possible to browse associations in WCM web client in file/folder manner ? Or web client modifications are neccessary?

    regards
    mco

  3. jpotts says:

    @mco,

    I’m a little confused regarding which type of content model you are wanting to work with. There is the Alfresco content model, which lets you define types and aspects. Then there’s the web form model, which is expressed as XML Schema and used to capture XML from non-technical authors using a web form.

    Unfortunately, on the WCM side, you cannot use custom types. Even if you select one of your custom types in the “create web content” dialog, the content will be created as “wcm:avmcontent” and you won’t see any of your custom properties. You can, however, use custom aspects. The problem is that the aspect has to be added by a behavior because rule actions aren’t supported in WCM. This disparity between DM and WCM is something Alfresco needs to clean up.

    You mentioned associations. You can create associations between WCM assets but, as you suspected, you would have to modify the web client to be able to navigate those associations.

    On the DM side, you could create a custom type as a child of cm:folder and then add custom properties to that if you are looking for container type objects. Or you can simply create associations between objects and configure the web-client-config-custom.xml file to expose the associations.

    Jeff

  4. jpotts says:

    @jani,

    When troubleshooting something like this, the first thing I recommend is creating an instance of your custom type with some JavaScript. In the same script you can set some of your custom properties as well.

    Then, go into the Node Browser and look for the object you just created. If you can find the object and it has the type you expected and the values you expected, you can reasonably assume that your custom model is okay.

    If your model is okay but your custom properties are not showing up in the object’s property sheet on the details page, then it is a problem with your web-client-config-custom.xml file.

    Here’s some sample JavaScript from the book you can use to create a test instance of sc:whitepaper.

    var contentType = “whitepaper”;
    var contentName = “sample-a”;

    // create a new whitepaper node as child of the current node and set its properties
    var timestamp = new Date().getTime();
    var whitepaperNode = space.createNode(contentName + timestamp, “sc:” + contentType);
    whitepaperNode.addAspect(“sc:webable”);
    whitepaperNode.properties[“cm:name”] = contentName + ” (” + timestamp + “)”;
    whitepaperNode.properties[“sc:isActive”] = true;
    whitepaperNode.properties[“sc:published”] = new Date(“04/01/2007”);
    whitepaperNode.content = “This is a sample ” + contentType + ” document called ” + contentName;
    whitepaperNode.save();

    Jeff

  5. mco says:

    hi Jeff,
    only one question yet ๐Ÿ™‚

    When I was tested 2.9b I could create own document types in DM. Now I’m using Alfresco 3.0 stable and I can’t find ECM forms. Is it a bug or there are not ECM forms in this version?

    regards
    mco

  6. jpotts says:

    mco,

    I noticed the same thing! I haven’t looked into it–I’m not sure why they’re gone.

    I do know there is an effort underway to refactor the form service completely so maybe that has something to do with it.

    Jeff

  7. mco says:

    Jeff,
    do You know, when we may expect ECM Forms enabling ? It’s quite important functionality ๐Ÿ™‚

    regards
    mco

  8. arun says:

    Hi Jpotts,

    I went through the article. This was the one i was searching for.
    I had one doubt for the custom content type , in the modifi content properties page we are providing a button for searching and listing of contents available. It will be very helpful if we can use the ajaxfilepicker

    Is there any way to use the file picker there. ?
    (ajax folder picker is already used in tomcat\webapps\alfresco\jsp\actions\simple-workflow.jsp )

    Thanks in advance

    arun

  9. jpotts says:

    Arun,

    As you mentioned, there is an ajax folder browser used in the simple workflow config page as well as the advanced search page. You should also be able to leverage that component.

    You might also look at the component that’s used when you have a type that includes an association. It gives you a little search box that you can type keywords into. It then runs the search and lists the results. Selected objects are then added to the list.

    Jeff

  10. jerry says:

    Hi Jeff,
    I’m learning alfresco through your article and I want performe some customisations.
    I want that content properties that will be appeare in the advanced search page, are only those which belong to the selected content type listed above.
    Can give some advice how to do this customisation

    Thanks in advance

  11. Phil says:

    Hi Jeff,

    Great article that decided me to purchase your book! Everything is working up to the point when I want to create content with your code. I get an exception when executing the CML block:

    {http://www.alfresco.org/ws/service/repository/1.0}RepositoryFault:0java.lang.IllegalStateException: Failed to resolve to a single NodeRef with parameters (store=workspace:SpacesStore uuid=null path=/app:company_home/cm:Sites), found 0 nodes.

    I have tried to google it, look on the forums, but no chance so far… could you please explain what this cryptic messages means so I can start digging in the right direction?

    Thanks and best regards,

    Phil

  12. Phil says:

    Never mind I figured it out… I was using “Sites” but it turns out it is somehow related to Alfresco Shares. Then I tried with cm:username, but it has to be sys:username.

    Great article!

    Phil

  13. jpotts says:

    Jerry,

    To make that customization, you’ll have to extend and customize the search page to (1) make the page refresh when a new type is selected and (2) make the custom properties hide or show themselves based on which type is selected.

    Unfortunately this kind of customization is going to require you to get into the details of how the web client is put together and will require you to write JSF code.

    Jeff

  14. jpotts says:

    Phil,

    Yeah, I was wondering why you had Sites there. That’s definitely reserved for Alfresco Share. Each Share site gets its own folder under the Sites folder. Then, each “page” or tool within each site gets a folder under that.

    Jeff

  15. jerry says:

    Hi Jeff,
    I’ve followed your advices for performing search page customization.
    I’ve added a valueChangeListener methode on the selectOneMenu tag like following

    I can get the value of the selected Items in my back bean binding but the problem is occured when I want to use this value in the render java code (UISearchCustomProperties.java).

    I instatiate this back bean in the render and invoque the getValueSelectedItem(). Result : NullPoiterExeception.

    This is my methode in the back bean class(AdvancedSearchDialog.java) to pick up the selected Items value :

    public String getValueSelectedItem(ValueChangeEvent event){
    String value = (String) event.getNewValue();
    FacesContext context = FacesContext.getCurrentInstance();
    context.renderResponse();
    return value;
    }

    and this is the way I’ve used this value in the UISearchCustomProperties.java class :
    //encoding methode
    public void encodeBegin(FacesContext context, String typeContenu) throws IOException
    {
    ……….
    if (getChildCount() == 0)
    {
    createComponentsFromConfig(context, valueContenTypeSelected);
    }
    ………
    }

    private void createComponentsFromConfig(FacesContext context, String typeContentValue)
    {
    ……
    if(typePropriete.equals(typeContentValue ))
    {
    // do stuff to generate differents controls
    ………..
    }
    …….
    }

    Please tell me if I’m on the right way!
    Else would you mind giving me more explaination or even sample code to do this customization.

    Thanks in advance.

    Jerry.

  16. Josh says:

    Excellent article! One question that I haven’t found answered: let’s say I have a whitepaper and I want to save both the whitepaper and the cover art image. Is there a way to upload the image as a property of the whitepaper? Or do I need to create another type and use the child association? If I need define the new type, how would I go about defining an image type?
    Thanks,
    Josh

  17. jpotts says:

    An object can have multiple content properties, but you have to extend the model to make that work, the UI won’t likely be able to handle it, and it would be a pain to make it handle an undetermined number of attachments.

    So, your instinct to create the image as a separate object and hook them to together with an association is definitely the right one.

    You could use the cm:content type for that image. If you want to create a special “image” content type for it, just follow the content modeling tutorial this blog post refers to and create your type with whatever properties you need. You can use an aspect to define the child association between your “main” object and the associated image.

    Jeff

  18. Tilen says:

    Hey Jeff,

    I tried to find something on the web, but unfortunately I didn’t manage to find anything.

    I have documents as modules in my repository. I want to make a hierarchical structure of “modules” and then link those modules documents into that structure. I think that’s something like virtual document or compound document.
    I’m not quite sure how to implement that. I was thinking of a simple solution, to simply extend the folder content type and then make a required folder structure of modules. Then I would copy or link somehow those documents into that folder structure.
    The problem is, how to implement versioning on those folders (afaik folders cannot be versioned).
    That could be simply solved by extending the content type instead of folder. In that case I would have to implement hierarchical linking of modules and documents.

    Not to mention implementing graphical representation of that tree structure of modules… Ufff. =) But that’s another story…

    I hope you can give me an advice on that problem. Thank you very much for your answers. I read your book Developers guide and I think it’s really fantastic. It clears many things out… Keep on the good work. =)

    Regards

  19. jpotts says:

    Tilen,

    That one is going to require some heavy thinking and some extensive POC work, I think. I’d start with the folder route and figure out how to handle versioning for the folders.

    Out of curiosity, how do the different folder versions relate to each other? Does a specific parent folder link to a specific version of a child? Or does the parent folder always contain the “current” version of the child? Or all versions?

    Jeff

  20. Josh says:

    Hi Jeff, thanks for the response. Let me take a step back and try to see if Alfresco is what I think it is. Years ago my company used Documentum and unfortunately I wasn’t paying too much attention as a backend Java developer. But my recollection is that you could easily define a new template and enter in “data” which would be the equivalent of “properties” in Alfresco. You could also attach external files to this data which would be the equivalent of the documents in cm:content. Now, I can add properties to the cm:content objects no problem. But if I want some data without a document, I was under the impression I would need to use the cm:cmobject type. The issue with that is that you can’t create instances of this from the “create content” link in the web client. Was Alfresco not built with this sort of documentless content in mind? I would like to be able to give the business people one UI to manage all their content/data. I was hoping Alfresco would create all the UI for me and I wouldn’t have to create custom JSF components or anything like that.

    As a simple example, which may be a simpler example of Linden’s question, if I want to store my FAQ data in Alfresco, I planned on creating a faqCategory and faqEntry both of type cmobject with a child-association. Is that something that Alfresco could handle with a minimum of fuss? Would it make more sense to have the faqCategory be a folder if I don’t have to version it? I would still want to be able to easily add the faqEntry from the web client.

    I do appreciate your time and if I do determine that Alfresco will work for my requirements I will definitely be buying the book! ๐Ÿ™‚

    Thanks, Josh

  21. jpotts says:

    Hi Josh,

    Yes, Alfresco can handle contentless objects. We do this when you’ve got some data you want to manage but it isn’t necessarily file based. As you mentioned, though, the Alfresco Explorer web client is built for the generic document management use case. It expects a file to be there. The out-of-the-box “Create Content” wizard has a file upload step. The easiest way to deal with a contentless object is to create an alternate wizard that skips that step. Of course, there could be side-effects in other parts of the UI caused by not having a file.

    In the case of a FAQ, you don’t really need contentless objects. You can use either a folder or a category as the faqCategory and then use the file content (authored in the browser) to be the content of the faqEntry. That lets your users take advantage of the rich text editor in the web client to edit the body of the FAQ and it makes use of out-of-the-box constructs for categorization.

    Jeff

  22. Tilen says:

    Hey again,

    actually I’m trying to find the best option for creating eCTD submissions for pharmaceutical products. I’m a supporter of opensource products, so Alfresco was the first choice…

    Anyways, those “compound documents” are treated as a kind of submission. You create a submission (version 0.0) of multiple modules (version 0.0) to agency . After some time you have to make a change in those documents (as a consequence of change in production for example). So you make a new submission (version 0.1). Into that “compound” you include new versions of documents from 0.0 version (they get version 0.1) that changed and any new documents required, which again get the version 0.0 (but they are in submission version 0.1).

    Actually I would need a content that acts like a folder. I thought of crosslinking the documents. There would probably be a huge amount of links, hard to follow…

    Also the documents have to be in specific order. But OK, that could be solved by defining a property for that (I guess).

    Thanks again for your answers.

    Tilen

  23. Josh says:

    Hi Jeff, the reason I was thinking about a contentless object for the faq entry is that I wanted to have “question” and “answer” properties. That is just one example though. When I think of the content I have worked with, on massive insurance web sites and hotel sites, I would say that 90+% of the content I see is a set of properties without uploadable content per se. For example, you may want to have your hotel name, number of rooms, etc. managed in your CMS and associated with a set of one or more images (or groupings of images for guest rooms, exterior shots, etc.). I think in addition to creating a custom wizard, I would have to change the logic that shows the content as it appears that the cmobjects don’t show up now (assuming no user error). So I am surprised that Alfresco (and many other CMS systems I have looked at) don’t support this out of the box as this is by far my most important requirement. In your experience working on projects, are you seeing a different need than I am? Do you end up doing a lot of customizations to the web client?

    As for categorization, I think folders will work best in this case as it is easier for business people to understand that all the entries in the same folder are in the same category than having to look at the category on each piece of content. Or perhaps each folder can define an action to also set the category on the entry so it is in both places.

    Thanks, Josh

  24. jpotts says:

    Josh,

    First off, this is a very good discussion. Thanks for having it with me.

    If 90% of my objects didn’t have file content, I don’t think I’d use Alfresco’s DM store. Or at least I’d think hard about it. There’s nothing wrong with using it for data like that, it just feels like a mismatch. If the content was for a web site, and it could be edited with simple web forms, I’d consider using Alfresco WCM. In Alfresco WCM, structured data is captured as XML and then optionally transformed into whatever format you need. It’s also queryable via the API, although searching for specific element values within the XML is a bit of a pain. But I digress.

    If web forms weren’t the right fit, and if Alfresco wasn’t adding any other value, I’d consider using something else entirely, like eXist, Jackrabbit, CouchDB, or, a relational database. If I needed presentation as well as persistance I might use Drupal or another coupled CMS. The point is that Alfresco wants to manage files. Can it manage objects that don’t have files, yes, and that’s common. Can you manage a data set that is almost entirely content-less? You can, but should you? If you need a file repository, Alfresco is a good one, but if all you need is a key-value store, one of the ones I mentioned might be a better pick.

    Back to Alfresco…

    We try to minimize web client customizations. Extensive customizations are hard for most customers to maintain over time. And it’s expensive. Usually a better route to go is to build a custom UI on top of Alfresco using a standard (widely-known, easy-to-use, flexible) framework. Often, with Alfresco web client customizations, by the time you add in what you need and tear out what you don’t, you could have built the entire app, customized to exactly what the customer needs. The result is much more usable, better adopted, and more easily maintained.

    Regarding folders and categories, they are certainly similar. In fact, in the Explorer client, you can navigate categories and their items as if it were a folder structure (click the arrow next to “Navigator” and change it to “Categories”). If you needed to keep a folder in sync with one or more categories actions would certainly be a way to do it.

    One drawback to categories is that, OOTB, only admins can manage them whereas folders are much more flexible in that respect.

    Another difference is that you can easily add documents to more than one category, but to add a document to more than one folder requires an API call–you can’t do it from the OOTB UI.

    Jeff

  25. Josh says:

    Hi Jeff, it’s interesting how different people define “content”. When I think of content, I think off all the data that defines “stuff” in our enterprise, especially data that is changed by humans (whether they be the business teams or the tech teams). Some of this data is completely generic, decoupled from any presentation (such as the hotel name or number of rooms), while some of the data that is specific to an application or even a device (for example a property description in HTML and a version in WML or an HTML version for a customer facing web site and a different HTML version for the call center application). Some of the data (such as the hotel latitude/longitude) may never even be displayed but it would be used by the search queries. The data with the markup could be exported directly to a web server and we could also either apply some sort of template (such as an XSLT or freemarker template) to convert the data to a markup snippet or use an API from the application to get the data and render it directly in a JSP in a more dynamic fashion.

    5 years ago, I would have created separate tables for all this data and built a custom CRUD app using my favorite frameworks. Now, in my old age, I want to be able to define my model and have my CMS take care of the UI and the workflows (approvals, email notifications, etc.). That’s why I was so excited about Alfresco. It looks like it already has all the basic building blocks: custom models, a nice UI, an ability to dynamically show the properties, the ability to create rules, custom actions, user roles, etc. Ideally you wouldn’t really have to customize the web client as it would build the view directly from the model automatically. The issue with using eXist, Jackrabbit, CouchDB and the relational DB is that I would have to reinvent the wheel and redo the UI and more important all the rules and actions. Now don’t get me wrong, I don’t envision that everything would be in the CMS. Staying with the hotel example, all the reservations and the inventory would be in a DB perhaps with the hotel id, the rate plan id, the room id while all the data about the hotel, the rate plans and the rooms would be in the CMS.

    One more thing: in the companies I have seen, the data has been divided among various different business and tech teams and different teams have already implemented different UIs to get to their data so people need to be trained on various systems. Having a single enterprise CMS may help standardize all of this. Maybe instead of a “Content Management System”, I am looking for a “Data Management System” (I can hear the marketing people already: “CMSs are so last century!”). I think Alfresco is pretty close to what I am looking for and if it broadened how it defines content (or building the UI around cm:content instead of cm:cmobject) it may be able to satisfy a lot more use cases.

    What do you think?
    Josh

  26. jpotts says:

    Josh,

    I use “content” loosely which gets especially messy when moving between “ECM” contexts and “WCM” contexts because that word is sometimes used differently between the two. In any case, I agree that all of that “stuff” you listed is definitely content that can be managed in a repository, with or without actual files stored along with the object.

    I think that, in general, Alfresco can be used to do what you’re trying to do, so don’t let me discourage you there.

    As you plan your solution, though, it is definitely important to realize the difference between the Alfresco “DM” repository implementation and the Alfresco “WCM” repository implementation (sometimes called “the AVM store” in technical descriptions).

    In a perfect world, content would be content and it wouldn’t matter what you’re going to use it for or how you wanted to work with it, you just stuck it in Alfresco. At the present, though, the capabilities of the two stores (and the Explorer web client that sits on both) are different. Some of the things you are looking to do may not be possible in both stores. I’m working on a blog post on this topic I will publish today or tomorrow.

    Jeff

  27. Josh says:

    Thanks Jeff, good discussion. I guess I just wish that Alfresco would treat contentless objects as a first class citizen with Web Client support out of the box. I understand that Alfresco is open source so I could contribute to it if I had time, but I am not sure that open source products that are run by a for profit company are really in the spirit of open source. But that’s a whole different rant. Alfresco isn’t going to work for what I am looking to do but I’ll check out your other blog entry to see if the WCM can come in handy in the future. Thanks again for your time.

  28. shikari shambu says:

    Hi Jeff,
    I created a custom content model and UI modifications as outlined in your article on ecmarchitect.com https://ecmarchitect.com/images/articles … rticle.pdf.

    It looks like the content model and its setup is good – do not see any stack traces in Tomcat during startup. However, when i go to the web client and view properties I do not see the custom properties. I cannot edit the properties or do a search as I keep getting the following error

    javax.faces.el.PropertyNotFoundException: Bean: org.alfresco.web.bean.content.EditContentPropertiesDialog, property: hasCustomView

    Hide Details

    javax.faces.el.PropertyNotFoundException: Bean: org.alfresco.web.bean.content.EditContentPropertiesDialog, property: hasCustomView
    at org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(PropertyResolverImpl.java:500)
    at org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(PropertyResolverImpl.java:472)
    at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:436)
    at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:85)
    at org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelper.java:535)
    at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
    at org.apache.commons.el.UnaryOperatorExpression.evaluate(UnaryOperatorExpression.java:156)
    at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:386)
    at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:1078)
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:601)
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:605)
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:605)
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:605)
    at javax.faces.component.UIForm.processDecodes(UIForm.java:56)
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:605)
    at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:138)
    at org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(ApplyRequestValuesExecutor.java:32)
    at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
    at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:110)
    at sun.reflect.GeneratedMethodAccessor510.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:122)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy194.doFilter(Unknown Source)
    at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:88)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.alfresco.repo.web.filter.beans.NullFilter.doFilter(NullFilter.java:74)
    at sun.reflect.GeneratedMethodAccessor510.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:122)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy194.doFilter(Unknown Source)
    at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:88)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:619)

    I am not sure how to resolve it. Any help is appreciated.

    Thanks
    shikarishambu

  29. jpotts says:

    Shikari,

    It looks like it might be choking on your web client config. Double-check that all of the properties you are defining in your property sheet match exactly your content model.

    Jeff

  30. shikari shambu says:

    Jeff,
    Thanks for the response. I looked at my Model.xml, web-config-custom.xml and web.properties and could not find the issue. I have included them inline. Hopefully, you can find the cause of the issue.

    1. stepModel.xml


    STEP Model
    Shikari Shambu
    1.0

    STEP Document
    cm:content

    d:text
    false

    d:text
    false

    d:text
    false

    d:text
    false

    d:text
    false

    Related Documents

    false
    true

    step:doc
    false
    true

    cm:generalclassifiable
    cm:versionable

    STEP Brochure
    step:doc

    STEP Notice
    step:doc

    STEP Webable

    d:date

    d:boolean
    false

    2.web-client-config-custom.xml


    3. webclient.properties
    #step:webable
    published=Published
    isActive=Active

    Thanks for your help

  31. Mak says:

    Hi jeff,

    I want to perform search on alfresco repo thru web service similar like what we do in alfresco web client search.

    Where you just put name of the file without extension and select filter [filenames only]. Alfresco searches all the files having same name of any extension irrespective of case.

    i would like to have query syntax of the specified search.

  32. jpotts says:

    Mak,

    Specific properties can be specified in a Lucene search and file name is no exception. The name of an object is stored in the “cm:name” property. To search for all content with a name containing “maqsood”, for example, the syntax would be:

    @cm\:name:maqsood

    Obviously you can combine that qualifier with others, like to restrict the search to specific types, or content with a specific aspect, etc. Appendix A of the Alfresco Developer Guide has more search examples or take a look at the Alfresco wiki: http://wiki.alfresco.com/wiki/Search_Documentation.

    Hope that helps,

    Jeff

  33. Kishore G says:

    Thanks for the article. I was stuck in enabling custom content model in Alfresco. The article provided by you is cool and I hope it should help me to fix my issues.

  34. Eddie says:

    Hi Jeff & Josh,
    With regards to ‘documentless’ content – we have done something similar with Alfresco 3.2r2.

    Our client wanted to create structured documents using templates, each template having a defined set of fields. These content of these documents – the actual fields – would need to be available for consumption on an ‘as needed’ basis (so, a field ‘myfield’ would need to be accessible to another programme to consume)

    So, we’ve created custom models to represent these templates/documents & these fields are exposed as ‘metadata’ properties.

    In Share the user creates a document of type ‘x’ & this loads the UI, with each field as a metadata control. Behind the scenes we take the property values and use them to populate the document content – so the metadata becomes the document’s content & the user sees the document content ‘fill up’ as they enter data & save.

    When a document is approved we copy & transform it into a pdf (or xml, etc) for others to consume. We can still access particular properties or content (say ‘myfield’) by document.properties[“myfield”] rather than having to do a content search.

    So, Alf allows us to use the metadata to create ‘documentless’ documents in the UI, and also to query particular content properties, while also presenting complete documents to end users, while using all the power of OTB rules etc.

    For us Alfresco has proven very flexible and powerful.
    Thanks for your articles, which have proven very useful,
    Eddie

  35. dhartford says:

    Excellet write-up on Custom Content Types, including all the information needed in configuring, adding, and searching on custom properties!

  36. Hastoviche says:

    anyone know how to create a new space in alfresco using c# ????
    seems like iยดm the only one in the entire earth trying it?

    thanks

  37. yogeshkumar says:

    Hi,

    Is it possible to create new datatype? like d:list which maps to java.util.ArrayList

    if possible please let me know what are all the steps i should proceed

    thanks

  38. jpotts says:

    Yogeshkumar,

    You can make a property multi-value by setting the property’s “multiple” element to true. Then, when you ask the NodeService for the property value, you’ll get an array back.

    If that doesn’t get you exactly what you need, take a look at the out-of-the-box dictionaryModel.xml to see how new data types are defined and mapped to Java classes.

    Jeff

  39. pierlugi says:

    Hi
    Great Post
    I was able to do something similar very easily on community edition 3.4d.

    My question is
    Suppose i have a share with 3 sites: a, b and c.
    I want to apply a customization like this only to a and b site while c site will have its own different customization.

    Is this possible?

    Is multitenancy the answer? I tried but as soon as i deploy my xmls to tomcat dir, customization affects all tenants..

    Thanks Pierluigi

  40. jpotts says:

    No, unfortunately there is not a way to do site-specific user interface customizations. I believe Alfresco is working on site-specific themes for Share but that probably isn’t the entire answer either.

    You could have three different web apps. Each of the web apps would run Share and only the customizations specific to a certain site. Of course, if you do this, all three sites are available on all three Share instances so it isn’t a perfect solution.

    Now, if you want to have a content model that is specific to a certain tenant, that is where multi-tenancy would work. I’m not sure how Share deals with multiple tenants. I assume you’d have one Share web app instance for each tenant.

    Jeff

  41. pierluigi says:

    Jeff
    for my multi-tenant environment I installed one Share app for tenant as you suggested and it works!
    so thank you!

    Can you please tell me if examples exist about how to show in a Share Form a multiple values property so that the user is able to see and edit the multiple value list? (I cannot find any)

    Thanks, Pierluigi

  42. Fahmi says:

    Hello jpotts,
    I wanted to try to add new metadata to files that i uploaded to sites (in alfresco share) using your propositions…
    I have added files in the extension folder to the extension folder of alfresco…
    The problem is that i didn’t find any modification in the properties of my files…
    Could you please give all steps in details to test how to add metedata in alfresco share.
    I use alfresco 3.4,
    Help please.

  43. Fahmi says:

    thanks for this link, but from the beginning i didn’t find the web-framework-config-commons.xml file.

  44. jpotts says:

    You don’t need it. All you need is share-config-custom.xml. That’s where you add config elements for your types and aspects as described on that wiki page.

    Jeff

Comments are closed.