[daisy] change documenttype via api
Karel Vervaeke
karel at outerthought.org
Mon Nov 12 08:56:17 CST 2007
Quickly browsing through the (daisy 2.2-dev) code, I do not immediately
see a problem with what you are trying to do. Perhaps you can provide
the error message and/or the stacktrace?
Regards,
Karel
On Mon, 2007-11-12 at 12:33 +0100, Bart Van den Abeele wrote:
> Hi,
>
> I have a problem with switching the documenttype. Execute next code:
>
> document.setName(digidocument.getDocumentName());
> String oldDocumentType =
> schemaDAO.getDocumentType(document.getDocumentTypeId());
> String newDocumentType = digidocument.getDocumentType();
> if (!oldDocumentType.equals(newDocumentType))
> {
> Fields fields = document.getFields();
> for (Field field : fields.getArray())
> {
> document.deleteField(field.getTypeId());
> }
> document.changeDocumentType(newDocumentType);
> }
> modifyCommonSimpleProperties(digidocument, document);
> modifyUnknownFields(digidocument, document);
> modifyPictures(digidocument, document);
>
> First i delete al fields, then i change the documenttype and then i set
> the value of the new fields on the document. When i only adjust fields
> that were also on the previous documenttype i don't get a problem. But
> when i try to set the value of a field of the new documenttype, i get an
> error. This occurs in daisy 2.0.1 . Should i do something extra before
> setting the field that wasn't part of the old documenttype, or is this a
> bug?
>
> Grtz,
> Bart
>
> **** DISCLAIMER ****
> http://www.schaubroeck.be/maildisclaimer.htm
> _______________________________________________
> 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
More information about the daisy
mailing list