Opened 14 years ago

Closed 13 years ago

#366 closed enhancement (fixed)

editor / add contextual label translation using allowing full xpath for elements

Reported by: josegar74 Owned by: josegar74
Priority: major Milestone: v2.6.1
Component: User interface (web) Version: v2.6.0
Keywords: Cc:

Description

Extend the context attribute in labels.xml files to support full xpath for elements. Some examples supported:

Full xpath in context:

<element name="gmd:role" id="380.0" context="gmd:MD_Metadata/gmd:contact/gmd:CI_ResponsibleParty/gmd:role">

<label>Role contact</label> <description>Function performed by the responsible party</description> <condition>mandatory</condition> <help_link>http://documentation.iso19139.example?id=contact_role</help_link>

</element>

Parent element context:

<element name="gmd:role" id="566.0" context="gmd:MD_Association">

<label>Role</label> <description>Reference to the ends (roles) of a concrete association</description>

</element>

No context:

<element name="gmd:role" id="379.0">

<label>Role</label> <description>Function performed by the responsible party</description> <condition>mandatory</condition>

</element>

Support also of help_link tag, so the labels can be linked with an external website for example to provide verbose documentation on the item

See related ticket #124

Change History (3)

comment:1 by josegar74, 14 years ago

Resolution: fixed
Status: newclosed

comment:2 by Fxp, 13 years ago

Resolution: fixed
Status: closedreopened

I can't make full xpath context works in trunk without the following patch:

Index: src/main/java/org/fao/geonet/services/schema/Info.java
===================================================================
--- src/main/java/org/fao/geonet/services/schema/Info.java      (revision 8291)
+++ src/main/java/org/fao/geonet/services/schema/Info.java      (working copy)
@@ -203,7 +203,10 @@
             }
 
             if (currContext != null && context != null && isoType != null) {
+                // XPath context are supposed to use same namespace prefix
+                if (!currContext.contains("/")) {
                 currContext = findNamespace(currContext, scm, schema);
+                }
 
                 if (name.equals(currName)
                         && (context.equals(currContext) || isoType.equals(currContext))) {

Context first prefix was changed by ns URL and compared to the XPath send by the client. Eg. http://www.isotc211.org/2005/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:resourceConstraints/gmd:MD_SecurityConstraints/gmd:useLimitation = gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:resourceConstraints/gmd:MD_SecurityConstraints/gmd:useLimitation

and never happens.

Any comments on the fix ?

comment:3 by Fxp, 13 years ago

Resolution: fixed
Status: reopenedclosed

Needs improvements based on #375.

Committed revision 8306.

Note: See TracTickets for help on using tickets.