John Austin wrote:
> 
> I would like to use XXE in an application and I am very
> interested in some of the features I have seen in 2.3.
> 
> One basic feature I need is the ability to constrain the
> user in editing certain documents. The best way to describe
> this is in terms of the Bug Report example.
> 
> I would like to prevent the user from changing the content
> of certain elements while accepting changes to other
> content. For example, in some applications the user should
> not be able to change the value of the <submittedBy> element.
> Problem description would be another element I would not
> allow a user top change. New entries would be permitted
> to follow existing entries but old content could not be
> modified.
> 
> From my limited understanding (so far) I would expect to
> write a command in Java. The Upper Case example shows how
> to bind such a command to keystrokes but I need to learn
> how to bind the command to a CSS style rule. I can see how
> to place dialog controls in the editor but I am not certain
> how to add the functionality I am after.
> 
> Any suggestions ?

Commands are declared in an XXE configuration file bound to a document
type, not the in CSS style sheet (see
http://www.xmlmind.com/xmleditor/_distrib/docs/poweruser/ar01s01.html ).

This is described in
http://www.xmlmind.com/xmleditor/_distrib/docs/poweruser/ar01s04s02.html
(<cfg:command>) and in
http://www.xmlmind.com/xmleditor/_distrib/docs/poweruser/ar01s04s01.html
(<cfg:binding>).

But I don't see how writing a command would solve your problem...

You'll have to wait until XXE V2.4 is released. As a ``side effect'' of
implementing multi-file documents, XXE V2.4 will allow to very easily
toggle the editability of an element (of a document subtree, in fact).

When you'll be able to code "element.setReadOnly(true)", writing a very
simple documentHook defining a documentOpened(Document) method will
solve your problem (see
http://www.xmlmind.com/xmleditor/_distrib/docs/dev/ar01s06.html ).

In this method, you have access to the document just after it has been
opened. You can traverse its elements and, according to your business
rules, turn off the editability of certain elements.

Reply via email to