Project

General

Profile

Feature #2316

improve directory XML encoding

Added by Greg Shah almost 10 years ago. Updated about 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD

Related issues

Related to Runtime Infrastructure - Feature #1842: implement the multi-source directory approach New

History

#1 Updated by Greg Shah almost 10 years ago

-------- Original Message --------
Subject: directory.xml - an idea to the backlog
Date: Tue, 03 Jun 2014 22:16:09 +0200
From: Hynek Cihlar <>
To: Greg Shah <>
CC: Eric Faulhaber <>

Hi Greg,

here is an idea to make directory.xml more readable.

Instead of this:

<remapper-storage>
<node class="container" name="">
<node class="container" name="security">
<node class="container" name="audit">
<node class="boolean" name="enabled">
<node-attribute name="value" value="FALSE"/>
</node>
<node class="string" name="logfile">
<node-attribute name="value" value="./audit%g-%u.log"/>
</node>
<node class="integer" name="logsize">
<node-attribute name="value" value="8096"/>
</node>
<node class="integer" name="logcount">
<node-attribute name="value" value="3"/>
</node>
<node class="boolean" name="filtermode">
<node-attribute name="value" value="FALSE"/>
</node>
<node class="container" name="resources">
<node class="auditResource" name="10">
<node-attribute name="type" value="system"/>
<node-attribute name="instances" value="context"/>
</node>
</node>
</node>

do this:

<remapper-storage>
<container name="">
<container name="security">
<container name="audit">
<boolean name="enabled" value="FALSE"/>
<string name="logfile" value="./audit%g-%u.log"/>
<integer name="logsize" value="8096"/>
<integer name="logcount" value="3"/>
<boolean name="filtermode" value="FALSE"/>
<container name="resources">
<node class="auditResource" name="10">
<attribute name="type" value="system"/>
<attribute name="instances" value="context"/>
</node>
</container>
</container>

Hynek

#2 Updated by Greg Shah over 4 years ago

Please see #4340-4 for additional ideas on syntax improvements.

#4 Updated by Greg Shah over 4 years ago

  • Related to Feature #1842: implement the multi-source directory approach added

#5 Updated by Greg Shah about 3 years ago

Ideas from Igor:

I think that the current syntax of the directory.xml file is very verbose. For example the node:

          <node class="container" name="default">
            <node class="integer" name="windowingYear">
              <node-attribute name="value" value="1950"/>
            </node>
            <node class="string" name="userSecurityOpsClass">
              <node-attribute name="value" value="com.goldencode.p2j.util.MetadataSecurityOps"/>
            </node>
            ...
        </node>

Can be just:
    <default>
      <windowingYear value=1950/>
<userSecurityOpsClass="com.goldencode.p2j.util.MetadataSecurityOps"/>
    ...
    </default>

which looks more compact and more close to the syntax of theclient.xml file.

In addition the second version can be automatically validated by the XML parser using schema which can also contain default values and validation rules.

The conversion of the current syntax to another one can be done with a simple utility.

It seems also that it is better not to re-write the directory.xml file on every server start but keep this changing data in a separate file which allows adding user comments that will survive the restart.

Also available in: Atom PDF