"basedocument" is hardcoded in NamespaceWorkflowImple hint()

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

"basedocument" is hardcoded in NamespaceWorkflowImple hint()

jatlin
For CMS version 7.8, is there a reason why "basedocument" is hardcoded in org.hippoecm.editor.repository.impl.NamespaceWorkflowImple hints() method?

            if (subject.hasNode("basedocument")) {
                documentTypes.add("basedocument");
                boolean update = true;
                while (update) {
                    update = false;
                    for (String superType : new ArrayList<String>(documentTypes)) {
                        if (descendantTypes.containsKey(superType)) {
                            List<String> subTypes = descendantTypes.get(superType);
                            for (String subType : subTypes) {
                                if (!documentTypes.contains(subType)) {
                                    documentTypes.add(subType);
                                    update = true;
                                }
                            }
                        }
                    }
                }
            }

The result is all document types must inherit from basedocument to show up in choicelist of new document type dialog in the CMS application.
Reply | Threaded
Open this post in threaded view
|

Re: "basedocument" is hardcoded in NamespaceWorkflowImple hint()

Frank van Lankvelt
On Mon, Feb 11, 2013 at 11:19 PM, jatlin <[hidden email]> wrote:

> For CMS version 7.8, is there a reason why "basedocument" is hardcoded in
> org.hippoecm.editor.repository.impl.NamespaceWorkflowImple hints() method?
>
>             if (subject.hasNode("basedocument")) {
>                 documentTypes.add("basedocument");
>                 boolean update = true;
>                 while (update) {
>                     update = false;
>                     for (String superType : new
> ArrayList<String>(documentTypes)) {
>                         if (descendantTypes.containsKey(superType)) {
>                             List<String> subTypes =
> descendantTypes.get(superType);
>                             for (String subType : subTypes) {
>                                 if (!documentTypes.contains(subType)) {
>                                     documentTypes.add(subType);
>                                     update = true;
>                                 }
>                             }
>                         }
>                     }
>                 }
>             }
>
> The result is all document types must inherit from basedocument to show up
> in choicelist of new document type dialog in the CMS application.
>
indeed.  Having a predetermined document type as the base of all
document types in a namespace makes it straightforward to create
queries & have uniform workflow.  The 'basedocument' type will also be
present when you create a new namespace.  So you're immediately set to
create new document types, the basedocument does not introduce any
overhead.

Of course you are free to create a different, more complex, type
hierarchy; the model is a lot more powerful than the UI can expose.
You'll have to bypass the CMS UI though.

cheers, Frank

>
>
> --
> View this message in context: http://hippo.2275632.n2.nabble.com/basedocument-is-hardcoded-in-NamespaceWorkflowImple-hint-tp7580397.html
> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html



--
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html