[daisy] Namespaces, ID's and daisy

Shane Starcher dragoonvengance at gmail.com
Fri Sep 28 11:33:53 CDT 2007


Thank you for your help I attempted to do as you said using the daisy java
API.  Essentially

"Document document = repository.createDocument(rootDocumentName,
                    documentType.getId());
            document.setRequestedId("182784-myns");
            document.save(false);"

Where rootDocumentName is "root"
and where documentType.getId() is the schema I am using

When this code is executed daisy throws this exception

"org.outerj.daisy.repository.InvalidDocumentIdException: Invalid document ID
"182784-myns"."

Any input would be appreciated.

Thank you,
Shane

On 9/11/07, Marc Portier <mpo at outerthought.org> wrote:
>
>
>
> Shane Starcher wrote:
> > My question is, is there anyway to use the daisy java API to do this.  I
> > have not been able to find a way to create a document and specify it's
> > namespace.
>
>
> What you are looking for is the method
>    Document#setRequestedId("182784-myns")
>
>
> http://cocoondev.org/javadoc/daisy/2.1/org/outerj/daisy/repository/Document.html#setRequestedId(java.lang.String)
>
>
> the sequence in javascript-speek is then:
>
>    var document = repository.createDocument(name, type, branch, lang);
>    var id = "182784-myns";
>    document.setRequestedId(id);
>    document.save(false);
>
>
> 'setRequestedId' means as much as you asking the repo to please assign
> that id (inclusive namespace) to the document.
>
> It will do so only if the requested namespace is not the one that is
> assigned to be managed by the repository itself (see <namespace> element
> in {DSY_DATA}/conf/myconfig.xml) - and throww an exception otherwise
>
> The repository will automatically assign a namespace-fingerprint if this
> namespace is used for the first time. I however you want to control that
> fingerprint yourself, then you will need to properly register the
> namespace in the repository.
>
> See the namespace-manager for that:
>
>
> http://cocoondev.org/javadoc/daisy/2.1/org/outerj/daisy/repository/namespace/NamespaceManager.html
>
> regards,
> -marc=
> _______________________________________________
> daisy community mailing list
> Professional Daisy support:
> http://outerthought.org/site/services/daisy/daisysupport.html
> mail to: daisy at lists.cocoondev.org
> list information: http://lists.cocoondev.org/mailman/listinfo/daisy
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cocoondev.org/pipermail/daisy/attachments/20070928/304b4173/attachment.htm


More information about the daisy mailing list