[WebApp] Define sub-topics of a topic read-only

Post here questions and problems related to oXygen frameworks/document types.
Denis
Posts: 47

[WebApp] Define sub-topics of a topic read-only

Tue Jan 26, 2016 11:05 am

Hi,

I have the following use case, which I want to accomplish with the oxygen webapp:

The user opens a topic to edit some parts of it. In the middle of the topic is a subtopic, which he does not have to edit.
We are using processing instructions to define, which subtopic is read only.

Here is an example:

Code: Select all

...
<task id="task_fz4_b2h_55">       <--- this task should be editable
    <title>Lorem ipsum</title>
    <shortdesc>Lorem ipsum dolor sit amet</shortdesc>
    <taskbody>
      ...
    </taskbody>
    <task id="task_gwp_r3h_55">    <--- this task should be read only
    <? read-only ?>               <--- read only pi      
        <title>sub title 1</title>
        <taskbody>
            <context>about</context>
            <steps id="steps_p15_s3h_55">
                <step>
                    <cmd>cmd</cmd>
                </step>
            </steps>
        </taskbody>
    </task>
    <task id="task_s3q_t3h_55">       <--- this task should be editable
        <title>sub title 2</title>
        <taskbody>
            <context>about</context>
            <example>example</example>
        </taskbody>
    </task>
</task>


In the oxygen eclipse application we are accomplish this behaviour with the StylesFilter. The WebApp doesn't support the StylesFilter. We have also tried the https://www.oxygenxml.com/doc/versions/17.1/ug-author/index.html#topics/dg-subject-selector.html, but unfortunately these won't work for processing instructions, yet.

Do you have any further ideas how we could accomplish this requirement for the webapp?

Thanks
Denis
Denis Zygann
KGU Consulting GmbH
http://www.kgu-consulting.com
alex_jitianu
Posts: 645

Re: [WebApp] Define sub-topics of a topic read-only

Tue Jan 26, 2016 5:36 pm

Hi Denis,

I've added an issue for supporting the Styles Filter extension in the WebApp too. My question is: would the subject selector working with processing instructions be enough for you? Because if it is, I could send you a build in which we've fixed this issue and the subject selector works with PIs. Please let me know if you would like me to send you such a build.

Best regards,
Alex
flo
Posts: 1

Re: [WebApp] Define sub-topics of a topic read-only

Thu Jan 28, 2016 5:15 pm

Hi Alex,

I am a colleague of Denis.

thanks for adding the issue for supporting the Styles Filter extension in the WebApp.
We have further analyzed our requirments:
Given the following XML-structure:

Code: Select all

    <topic id="abc">
        <?read-only yes ?>
        <title>Title</title>
        <topic id="subtopic-abc">
            <?read-only no ?>
            <title>Subtitle</title>
        </topic>
    </topic>
    <topic id="abb">
        <?read-only yes ?>
        <title>new title</title>
    </topic>

In combination with the following CSS:

Code: Select all

*! > oxy|processing-instruction[read-only][yes] {
    background-color: gray !important;
   -oxy-editable: false;
}
*! > oxy|processing-instruction[read-only][no] {
    background-color: white !important;
   -oxy-editable: true;
}


There are three issues we could not solve:
  • The PI-selector in combination with the subject selector (as mentioned in the prior post)
  • Re-enabling -oxy-editable within a topic that is not editable. We haven't found this working with CSS at all.
  • The PI-selector to match a parameter which is not in key="value" format. (We need <?read-only yes ?> instead of <?read-only parameter="yes" ?>). This is definitely least prioritized.

Thank you
Florian
alex_jitianu
Posts: 645

Re: [WebApp] Define sub-topics of a topic read-only

Mon Feb 01, 2016 5:24 pm

Hi Florian,

The PI-selector in combination with the subject selector (as mentioned in the prior post)

We can provide a build in which the PI-selector works in combination with the subject selector. In this build you will also be able to use the StylesFilter to set the oxy_editable property.
Re-enabling -oxy-editable within a topic that is not editable. We haven't found their working with CSS at all.

Yes, once you set an element as read-only, all of its descendants are read-only and you can't change this state through CSS rules. But we do have an issue already recorded to allow this behavior. The good news is that through a StylesFilter this behavior is already possible. A StylesFilter can mark a parent as oxy_editable:false and some of its descendants as oxy_editable:true.

I think one of my colleagues already gave Denis a build in which the StylesFilter can be used to set the oxy_editable property so you should be able to test both issue mentioned above. If not, please let me know and I can provide such a build.


The good news is that from an StylesFilter you can

Best regards,
Alex

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 0 guests