Hi,

I want to update an existing document, with its existing permissions
and collections, in XCC, but I'm stuck.

In XQuery, I do this with

xdmp:document-insert(
  $uri,
  <updated_doc_here/>,
  xdmp:document-get-permissions($uri),
  xdmp:document-get-collections($uri))

... Or alternatively, I guess I could use xdmp:node-replace, which
doesn't seem to have an XCC equivalent.

In XCC, ContentFactory.newContent can have a ContentCreateOptions
object. If I use a "default" ContentCreateOptions object, I get
errors[1]. I can create that object with the relevant values by first
doing a query that retrieves permissions and collections. However, the
ContentPermission object in the options object needs a role name,
whereas xdmp:document-get-permissions returns role id's.

The particular user that performs these operations, does not have
administrative privileges, so she can't access functions like
sec:get-role-names (on the security database).

As far as I can tell, there is no way to get at the role names.

... Alternatively, I would have to trust the magic qualities of ML and
pass an entire document as string to a module that does all the saving
work for me. Which seems a brittle solution, especially since I have
no knowledge of the particular content my XML documents will have
(document size, processing instructions, special characters,
etcetera). It's not going to be fast either, since it won't stream the
document content and need megabytes of heap size on the Java
application server per request.

And how about if I want to use the DLS Library services, e.g.
dls:document-update; Would I be able to mix that with XCC?

And so, I am wondering, how can I save a document over XCC?

regards,
Jeroen

[1] "Document must have at least one update permission"; This
particular user doesn't have default permissions/collection, and I
certainly don't want to reset the permissionss and collections on
save.

-- 
Jeroen Pulles
Xopus B.V., The Netherlands

Xopus: The web based WYSIWYG XML Editor
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to