Basic question about limiting editing in author mode

Are you missing a feature? Request its implementation here.
MarkL
Posts: 7
Joined: Thu Mar 26, 2009 11:56 pm

Basic question about limiting editing in author mode

Post by MarkL »

Hi,

I had a look around, but I'm not sure if this is possible and, if so, where to look to acheive this.

I'm about to embark on a project where I will be editing parts of an XML document and I'd like to configure Oxygen to allow only editing nodes within a specific tag.

I will be editing an XML document that describes a Web services API. The XML schema includes a tag called description. What I'd like is to open the XML document in Oxygen and have it prevent any changes to any node other than those within <description></description> tags. So, I can see the whole document, but only edit part of it.

Is this possible with Oxygen? And if so, how?

Thanks,
Mark
MarkL
Posts: 7
Joined: Thu Mar 26, 2009 11:56 pm

Re: Basic question about limiting editing in author mode

Post by MarkL »

Hi,

Actually, to clarify, it doesn't have to be in Author mode. Really, I'd like to be able to do it in any mode.

For example,

Suppose you have the following XML

<operation name=getItems>
<description></description>
<parameter>
<name>itemId</name>
<type>Integer</type>
<description></description>
</paremeter>
</operation>

And then configure Oxygen with something like "Allow editing to only nodes within tag == <description>

Then Oxygen displays something like:

<operation name=getItems>
<description></description>
<parameter>
<name>itemId</name>
<type>Integer</type>

<description></description>
</paremeter>
</operation>


And the items in red are not editable.

Sort of lock Locking Tags, but applying to everything except for one specific tag.

I hope that's clarifies what I meant, sorry if it only made it more confusing.

Thanks,
Mark
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Basic question about limiting editing in author mode

Post by Radu »

Hi Mark,

I understand your use case. It is possible to obtain what you want when editing in the Author page. We do not have the API to allow for something like this in the Text page.

The easiest way to almost achieve what you want in the Author page is by having a CSS file attached to the XML which specifies that some nodes are not editable (property which is an Oxygen CSS extensions).

For example if you associate this CSS with the XML:

Code: Select all


*{
display:block;
}
root:before, name:before, type:before, parameter:before, operation:before {
content: "<" name() " " attributes() ">";
}
root:after, name:after, type:after, parameter:after, operation:after {
content: "<" name() ">";
}
type, parameter, name, operation, root{
color:red;
}
description{
color:black;
}
name, type {
editable:false;
}
the content of the nodes name and type will no longer be editable in the Author.

Unfortunately using this extension you cannot specify that a node is not editable but one of its children is editable again so setting parameter as not editable would result in not being able to edit the description.

If you know Java and want more control over editing in the Author you can take a look at the Author SDK:
http://www.oxygenxml.com/developer.html ... horing_SDK
You can use the Author SDK to get control over every edit event performed in the Author.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
MarkL
Posts: 7
Joined: Thu Mar 26, 2009 11:56 pm

Re: Basic question about limiting editing in author mode

Post by MarkL »

Hi Radu,

Thanks very much for your help. That's exactly what I was looking for. I'd seen the Author SDK, but I wasn't sure if that was the right route to go down.

I'll have a look at the CSS solution as well. Perhaps that's a Good Enough solution for now.

Cheers,
Mark
Post Reply