Revision: 4701
http://geonetwork.svn.sourceforge.net/geonetwork/?rev=4701&view=rev
Author: sppigot
Date: 2009-07-29 03:54:36 +0000 (Wed, 29 Jul 2009)
Log Message:
-----------
Reorganise system config page to incorporate authentication layout changes
(from trunk), add userSelfRegistration enable, add experimental xlink enable
Add support for xlink enabler so that experimental xlink support can be switched off
Modify xlink resolver so that xlink attributes are removed on resolution except when editing
Modified Paths:
--------------
sandbox/BlueNetMEST/gast/setup/db/Settings.ddf
sandbox/BlueNetMEST/src/org/fao/geonet/kernel/DataManager.java
sandbox/BlueNetMEST/src/org/fao/geonet/kernel/XmlSerializer.java
sandbox/BlueNetMEST/src/org/fao/geonet/kernel/harvest/harvester/metadatafragments/Harvester.java
sandbox/BlueNetMEST/src/org/fao/geonet/services/config/Set.java
sandbox/BlueNetMEST/src/org/fao/geonet/services/metadata/Show.java
sandbox/BlueNetMEST/web/geonetwork/loc/en/xml/config.xml
sandbox/BlueNetMEST/web/geonetwork/scripts/config/model.js
sandbox/BlueNetMEST/web/geonetwork/scripts/config/view.js
sandbox/BlueNetMEST/web/geonetwork/scripts/core/gui/shower.js
sandbox/BlueNetMEST/web/geonetwork/xsl/banner.xsl
sandbox/BlueNetMEST/web/geonetwork/xsl/config/config.xsl
sandbox/BlueNetMEST/web/geonetwork/xsl/xml/config.xsl
sandbox/BlueNetMEST/web/geonetwork/xsl/xml/env.xsl
Modified: sandbox/BlueNetMEST/gast/setup/db/Settings.ddf
===================================================================
--- sandbox/BlueNetMEST/gast/setup/db/Settings.ddf 2009-07-28 11:46:11 UTC (rev 4700)
+++ sandbox/BlueNetMEST/gast/setup/db/Settings.ddf 2009-07-29 03:54:36 UTC (rev 4701)
@@ -66,11 +66,17 @@
110 87 name cn
112 87 profile profile
-120 1 shib
-121 120 use false
-122 120 path /geonetwork/srv/en/shib.user.login
-123 120 attrib
-124 123 username REMOTE_USER
-125 123 surname Shib-Person-surname
-126 123 firstname Shib-InetOrgPerson-givenName
-127 123 profile Shib-EP-Entitlement
+170 1 shib
+171 170 use false
+172 170 path /geonetwork/srv/en/shib.user.login
+173 170 attrib
+174 173 username REMOTE_USER
+175 173 surname Shib-Person-surname
+176 173 firstname Shib-InetOrgPerson-givenName
+177 173 profile Shib-EP-Entitlement
+
+190 1 userSelfRegistration
+191 190 enable false
+
+200 1 xlinkResolver
+201 200 enable false
Modified: sandbox/BlueNetMEST/src/org/fao/geonet/kernel/DataManager.java
===================================================================
--- sandbox/BlueNetMEST/src/org/fao/geonet/kernel/DataManager.java 2009-07-28 11:46:11 UTC (rev 4700)
+++ sandbox/BlueNetMEST/src/org/fao/geonet/kernel/DataManager.java 2009-07-29 03:54:36 UTC (rev 4701)
@@ -59,7 +59,6 @@
import jeeves.utils.SerialFactory;
import jeeves.utils.Xml;
import jeeves.xlink.Processor;
-import jeeves.xlink.XLink;
import org.fao.geonet.constants.Edit;
import org.fao.geonet.constants.Geonet;
@@ -71,6 +70,7 @@
import org.fao.geonet.kernel.search.MetaSearcher;
import org.fao.geonet.kernel.search.SearchManager;
import org.fao.geonet.kernel.setting.SettingManager;
+import org.fao.geonet.kernel.setting.SettingManager;
import org.fao.geonet.util.ISODate;
import org.fao.geonet.util.FileCopyMgr;
@@ -188,7 +188,7 @@
//--------------------------------------------------------------------------
- public static void indexMetadata(Dbms dbms, String id, SearchManager sm) throws Exception
+ private void indexMetadata(Dbms dbms, String id, SearchManager sm) throws Exception
{
try
{
@@ -202,12 +202,17 @@
//--------------------------------------------------------------------------
- private static void indexMetadataI(Dbms dbms, String id, SearchManager sm) throws Exception
+ private void indexMetadataI(Dbms dbms, String id, SearchManager sm) throws Exception
{
Vector moreFields = new Vector();
// get metadata table fields
- Element md = XmlSerializer.select(dbms, "Metadata", id);
+ Element md = null;
+ if (xlinkResolverEnabled()) {
+ md = XmlSerializer.selectWithXLinks(dbms, "Metadata", id);
+ } else {
+ md = XmlSerializer.select(dbms, "Metadata", id);
+ }
String root = md.getName();
String query ="SELECT schemaId, createDate, changeDate, source, isTemplate, title, uuid, "+
@@ -746,6 +751,7 @@
"id = ? AND isHarvested='n'";
dbms.execute(query, new Integer(id));
+ dbms.commit();
indexMetadata(dbms, id);
}
@@ -762,11 +768,13 @@
String query = "UPDATE MetadataRating SET rating=? WHERE metadataId=? AND ipAddress=?";
int res = dbms.execute(query, rating, id, ipAddress);
+ dbms.commit();
if (res == 0)
{
query = "INSERT INTO MetadataRating(metadataId, ipAddress, rating) VALUES(?,?,?)";
dbms.execute(query, id, ipAddress, rating);
+ dbms.commit();
}
//--- then, calculate new rating
@@ -789,6 +797,7 @@
query = "UPDATE Metadata SET rating=? WHERE id=?";
dbms.execute(query, rating, id);
+ dbms.commit();
indexMetadata(dbms, Integer.toString(id));
return rating;
@@ -826,7 +835,12 @@
//--- store metadata
- String id = XmlSerializer.insert(dbms, schema, xml, serial, source, uuid, owner, groupOwner);
+ String id = null;
+ if (xlinkResolverEnabled()) {
+ id = XmlSerializer.insertWithXLinks(dbms, schema, xml, serial, source, uuid, owner, groupOwner);
+ } else {
+ id = XmlSerializer.insert(dbms, schema, xml, serial, source, uuid, owner, groupOwner);
+ }
copyDefaultPrivForGroup(dbms, id, groupOwner);
@@ -905,8 +919,13 @@
//--- Note: we cannot index metadata here. Indexing is done in the harvesting part
- return XmlSerializer.insert(dbms, schema, md, id, source, uuid, createDate,
- changeDate, "n", null, owner, groupOwner);
+ String outId = null;
+ if (xlinkResolverEnabled()) {
+ outId = XmlSerializer.insertWithXLinks(dbms, schema, md, id, source, uuid, createDate, changeDate, "n", null, owner, groupOwner);
+ } else {
+ outId = XmlSerializer.insert(dbms, schema, md, id, source, uuid, createDate, changeDate, "n", null, owner, groupOwner);
+ }
+ return outId;
}
//--------------------------------------------------------------------------
@@ -935,7 +954,12 @@
//--- store metadata
- String id = XmlSerializer.insert(dbms, schema, xml, serial, source, uuid, isTemplate, title, owner, groupOwner);
+ String id = null;
+ if (xlinkResolverEnabled()) {
+ id = XmlSerializer.insertWithXLinks(dbms, schema, xml, serial, source, uuid, isTemplate, title, owner, groupOwner);
+ } else {
+ id = XmlSerializer.insert(dbms, schema, xml, serial, source, uuid, isTemplate, title, owner, groupOwner);
+ }
copyDefaultPrivForGroup(dbms, id, groupOwner);
if (category != null)
@@ -960,29 +984,42 @@
return getMetadata(srvContext, id, forEditing, false);
}
- /** Retrieves a metadata (in xml) given its id
+ //--------------------------------------------------------------------------
+ /** Retrieves a metadata (in xml) given its id; adds editing information
+ * if requested and validation errors if requested
*/
- public Element getMetadata(Dbms dbms, String id) throws Exception
+ public Element getMetadata(ServiceContext srvContext, String id, boolean forEditing, boolean withEditorValidationErrors) throws Exception
{
- return XmlSerializer.select(dbms, "Metadata", id);
+ boolean noInfo = false;
+ return getMetadata(srvContext, id, forEditing, withEditorValidationErrors, noInfo);
}
+ //--------------------------------------------------------------------------
+ /** Retrieves a metadata (in xml) given its id with no geonet:info
+ */
+ public Element getMetadataNoInfo(ServiceContext srvContext, String id) throws Exception
+ {
+ boolean noInfo = true;
+ return getMetadata(srvContext, id, false, false, noInfo);
+ }
+
+ //--------------------------------------------------------------------------
/** Retrieves a metadata (in xml) given its id; adds editing information
* if requested and validation errors if requested
*/
- public Element getMetadata(ServiceContext srvContext, String id, boolean forEditing, boolean withEditorValidationErrors) throws Exception
+ private Element getMetadata(ServiceContext srvContext, String id, boolean forEditing, boolean withEditorValidationErrors, boolean noInfo) throws Exception
{
Dbms dbms = (Dbms) srvContext.getResourceManager().open(Geonet.Res.MAIN_DB);
- Element md = getMetadata(dbms, id);
+ boolean resolveXLinks = xlinkResolverEnabled();
- if (md == null)
- return null;
+ Element md = XmlSerializer.select(dbms, "Metadata", id);
+ if (md == null) return null;
String version = null;
- if (forEditing)
- {
+ if (forEditing) {
+ if (resolveXLinks) Processor.processXLink(md);
String schema = getMetadataSchema(dbms, id);
boolean xsdErrors = false;
@@ -1003,14 +1040,17 @@
Element condChecks = getSchemaTronXmlReport(getSchemaDir(schema),md);
if (condChecks != null) md.addContent(condChecks);
}
+ } else {
+ if (resolveXLinks) Processor.detachXLink(md);
}
- md.addNamespaceDeclaration(Edit.NAMESPACE);
- Element info = buildInfoElem(srvContext, id, version);
- md.addContent(info);
+ if (!noInfo) {
+ md.addNamespaceDeclaration(Edit.NAMESPACE);
+ Element info = buildInfoElem(srvContext, id, version);
+ md.addContent(info);
+ }
- md.detach();
- return md;
+ return (Element)md.detach();
}
//--------------------------------------------------------------------------
@@ -1403,89 +1443,23 @@
}
//--------------------------------------------------------------------------
- /** For Editing : adds an attribute from a metadata ([add] link)
- * FIXME: Modify and use within Ajax controls
- */
+ /** For Editing : adds an attribute from a metadata ([add] link)
+ * FIXME: Modify and use within Ajax controls
+ */
- public synchronized boolean addAttribute(Dbms dbms, String id, String ref,
- String name, String currVersion) throws Exception
- {
- Element md = XmlSerializer.select(dbms, "Metadata", id);
+ public synchronized boolean addAttribute(Dbms dbms, String id, String ref, String name, String currVersion) throws Exception {
- //--- check if the metadata has been deleted
- if (md == null)
- return false;
-
- String schema = getMetadataSchema(dbms, id);
- editLib.expandElements(schema, md);
- editLib.enumerateTree(md);
-
- //--- check if the metadata has been modified from last time
- if (currVersion != null && !editLib.getVersion(id).equals(currVersion))
- return false;
-
- //--- get element to add
- Element el = editLib.findElement(md, ref);
-
- if (el == null)
- throw new IllegalStateException("Element not found at ref = " + ref);
-
- //--- remove editing info added by previous call
- editLib.removeEditingInfo(md);
-
- el.setAttribute(new Attribute(name, ""));
-
- editLib.contractElements(md);
- md = updateFixedInfo(schema, id, md, dbms);
- XmlSerializer.update(dbms, id, md);
-
- //--- update search criteria
- indexMetadata(dbms, id);
-
- return true;
+ return false;
}
//--------------------------------------------------------------------------
- /** For Editing : removes an attribute from a metadata ([del] link)
- * FIXME: Modify and use within Ajax controls
- */
+ /** For Editing : removes an attribute from a metadata ([del] link)
+ * FIXME: Modify and use within Ajax controls
+ */
- public synchronized boolean deleteAttribute(Dbms dbms, String id, String ref,
- String name, String currVersion) throws Exception
- {
- Element md = XmlSerializer.select(dbms, "Metadata", id);
+ public synchronized boolean deleteAttribute(Dbms dbms, String id, String ref, String name, String currVersion) throws Exception {
- //--- check if the metadata has been deleted
- if (md == null)
- return false;
-
- String schema = getMetadataSchema(dbms, id);
- editLib.expandElements(schema, md);
- editLib.enumerateTree(md);
-
- //--- check if the metadata has been modified from last time
- if (currVersion != null && !editLib.getVersion(id).equals(currVersion))
- return false;
-
- //--- get element to remove
- Element el = editLib.findElement(md, ref);
-
- if (el == null)
- throw new IllegalStateException("Element not found at ref = " + ref);
-
- //--- remove editing info added by previous call
- editLib.removeEditingInfo(md);
-
- el.removeAttribute(name);
-
- editLib.contractElements(md);
- md = updateFixedInfo(schema, id, md, dbms);
- XmlSerializer.update(dbms, id, md);
-
- //--- update search criteria
- indexMetadata(dbms, id);
-
- return true;
+ return false;
}
//--------------------------------------------------------------------------
@@ -1512,10 +1486,15 @@
/** For Editing : updates all leaves with new values
*/
- public synchronized boolean updateMetadata(UserSession session, Dbms dbms, String id, String currVersion, Hashtable changes, boolean validate) throws Exception
- {
- Element md = XmlSerializer.select(dbms, "Metadata", id);
+ public synchronized boolean updateMetadata(UserSession session, Dbms dbms, String id, String currVersion, Hashtable changes, boolean validate) throws Exception {
+ Element md = null;
+ if (xlinkResolverEnabled()) {
+ md = XmlSerializer.selectWithXLinks(dbms, "Metadata", id);
+ } else {
+ md = XmlSerializer.select(dbms, "Metadata", id);
+ }
+
//--- check if the metadata has been deleted
if (md == null)
return false;
@@ -1590,6 +1569,18 @@
//--------------------------------------------------------------------------
+ private boolean xlinkResolverEnabled() {
+ String xlR = settingMan.getValue("system/xlinkResolver/enable");
+ Log.error(Geonet.DATA_MANAGER, "xlink resolver was "+xlR);
+ if (xlR != null) {
+ return xlR.equals("true");
+ } else {
+ return false;
+ }
+ }
+
+ //--------------------------------------------------------------------------
+
public synchronized boolean updateMetadata(UserSession session, Dbms dbms, String id, Element md, boolean validate, String version) throws Exception
{
//--- check if the metadata has been modified from last time
@@ -1603,7 +1594,11 @@
md = updateFixedInfo(schema, id, md, dbms);
//--- write metadata to dbms
- XmlSerializer.update(dbms, id, md);
+ if (xlinkResolverEnabled()) {
+ XmlSerializer.updateWithXLinks(dbms, id, md);
+ } else {
+ XmlSerializer.update(dbms, id, md);
+ }
//--- update search criteria
indexMetadata(dbms, id);
@@ -1649,7 +1644,11 @@
public void updateMetadataExt(Dbms dbms, String id, Element md, String changeDate)
throws Exception
{
- XmlSerializer.update(dbms, id, md, changeDate);
+ if (xlinkResolverEnabled()) {
+ XmlSerializer.updateWithXLinks(dbms, id, md, changeDate);
+ } else {
+ XmlSerializer.update(dbms, id, md, changeDate);
+ }
}
//--------------------------------------------------------------------------
@@ -1711,7 +1710,12 @@
public Element getThumbnails(Dbms dbms, String id) throws Exception
{
- Element md = XmlSerializer.select(dbms, "Metadata", id);
+ Element md = null;
+ if (xlinkResolverEnabled()) {
+ md = XmlSerializer.selectWithXLinks(dbms, "Metadata", id);
+ } else {
+ md = XmlSerializer.select(dbms, "Metadata", id);
+ }
if (md == null)
return null;
@@ -1758,7 +1762,12 @@
private void manageThumbnail(Dbms dbms, String id, boolean small, Element env,
String styleSheet) throws Exception
{
- Element md = XmlSerializer.select(dbms, "Metadata", id);
+ Element md = null;
+ if (xlinkResolverEnabled()) {
+ md = XmlSerializer.selectWithXLinks(dbms, "Metadata", id);
+ } else {
+ md = XmlSerializer.select(dbms, "Metadata", id);
+ }
if (md == null)
return;
@@ -1794,7 +1803,11 @@
styleSheet = getSchemaDir(schema) + styleSheet;
md = Xml.transform(root, styleSheet);
- XmlSerializer.update(dbms, id, md);
+ if (xlinkResolverEnabled()) {
+ XmlSerializer.updateWithXLinks(dbms, id, md);
+ } else {
+ XmlSerializer.update(dbms, id, md);
+ }
//--- update search criteria
indexMetadata(dbms, id);
@@ -1833,7 +1846,12 @@
private void manageCommons(Dbms dbms, String id, Element env,
String styleSheet) throws Exception
{
- Element md = XmlSerializer.select(dbms, "Metadata", id);
+ Element md = null;
+ if (xlinkResolverEnabled()) {
+ md = XmlSerializer.selectWithXLinks(dbms, "Metadata", id);
+ } else {
+ md = XmlSerializer.select(dbms, "Metadata", id);
+ }
if (md == null)
return;
Modified: sandbox/BlueNetMEST/src/org/fao/geonet/kernel/XmlSerializer.java
===================================================================
--- sandbox/BlueNetMEST/src/org/fao/geonet/kernel/XmlSerializer.java 2009-07-28 11:46:11 UTC (rev 4700)
+++ sandbox/BlueNetMEST/src/org/fao/geonet/kernel/XmlSerializer.java 2009-07-29 03:54:36 UTC (rev 4701)
@@ -57,7 +57,7 @@
* @param id metadata identifier
*/
- private static Element select(Dbms dbms, String table, String id, boolean resolveXLink) throws Exception
+ public static Element select(Dbms dbms, String table, String id, boolean processXLinks, boolean detachXLink) throws Exception
{
String query = "SELECT * FROM " + table + " WHERE id = ?";
@@ -70,12 +70,20 @@
rec = Xml.loadString(xmlData, false);
- if (resolveXLink) Processor.processXLink(rec);
+ if (processXLinks) {
+ if (detachXLink) {
+ Processor.detachXLink(rec);
+ } else {
+ Processor.processXLink(rec);
+ }
+ }
return (Element) rec.detach();
}
- /** Retrieve the xml element which id matches the given one. The element is
+ //--------------------------------------------------------------------------
+
+ /** Retrieve the xml element whose id matches the given one. The element is
* read from 'table' and the string read is converted into xml and resolve
* all XLinks found in document.
*
@@ -83,30 +91,60 @@
*/
public static Element select(Dbms dbms, String table, String id) throws Exception
{
- return select(dbms, table, id, true);
+ return select(dbms, table, id, false, false);
}
+
+ //--------------------------------------------------------------------------
+
+ /** Retrieve the xml element whose id matches the given one. The element is
+ * read from 'table' and the string read is converted into xml. XLinks are
+ * not resolved.
+ *
+ * @param id metadata identifier
+ */
+ public static Element selectWithXLinks(Dbms dbms, String table, String id) throws Exception
+ {
+ return select(dbms, table, id, true, true);
+ }
//--------------------------------------------------------------------------
public static String insert(Dbms dbms, String schema, Element xml, int serial, String source, String uuid, int owner, String groupOwner) throws SQLException {
- return insert(dbms, schema, xml, serial, source, uuid, null, null, "n", null, owner, groupOwner, true);
+ return insert(dbms, schema, xml, serial, source, uuid, null, null, "n", null, owner, groupOwner, false, false);
}
//--------------------------------------------------------------------------
+ public static String insertWithXLinks(Dbms dbms, String schema, Element xml, int serial, String source, String uuid, int owner, String groupOwner) throws SQLException {
+ return insert(dbms, schema, xml, serial, source, uuid, null, null, "n", null, owner, groupOwner, true, true);
+ }
+
+ //--------------------------------------------------------------------------
+
public static String insert(Dbms dbms, String schema, Element xml, int serial, String source, String uuid, String isTemplate, String title, int owner, String groupOwner) throws SQLException {
- return insert(dbms, schema, xml, serial, source, uuid, null, null, isTemplate, title, owner, groupOwner, true);
+ return insert(dbms, schema, xml, serial, source, uuid, null, null, isTemplate, title, owner, groupOwner, false, false);
}
//--------------------------------------------------------------------------
+ public static String insertWithXLinks(Dbms dbms, String schema, Element xml, int serial, String source, String uuid, String isTemplate, String title, int owner, String groupOwner) throws SQLException {
+ return insert(dbms, schema, xml, serial, source, uuid, null, null, isTemplate, title, owner, groupOwner, true, true);
+ }
+
+ //--------------------------------------------------------------------------
+
public static String insert(Dbms dbms, String schema, Element xml, int serial, String source, String uuid, String createDate, String changeDate, String isTemplate, String title, int owner, String groupOwner) throws SQLException {
- return insert(dbms, schema, xml, serial, source, uuid, createDate, changeDate, isTemplate, title, owner, groupOwner, true);
+ return insert(dbms, schema, xml, serial, source, uuid, createDate, changeDate, isTemplate, title, owner, groupOwner, false, false);
}
//--------------------------------------------------------------------------
- private static String insert(Dbms dbms, String schema, Element xml, int serial, String source, String uuid, String createDate, String changeDate, String isTemplate, String title, int owner, String groupOwner, boolean removeAndUncacheXLinks) throws SQLException
+ public static String insertWithXLinks(Dbms dbms, String schema, Element xml, int serial, String source, String uuid, String createDate, String changeDate, String isTemplate, String title, int owner, String groupOwner) throws SQLException {
+ return insert(dbms, schema, xml, serial, source, uuid, createDate, changeDate, isTemplate, title, owner, groupOwner, true, true);
+ }
+
+ //--------------------------------------------------------------------------
+ private static String insert(Dbms dbms, String schema, Element xml, int serial, String source, String uuid, String createDate, String changeDate, String isTemplate, String title, int owner, String groupOwner, boolean processXLinks, boolean removeAndUncacheXLinks) throws SQLException
{
String date = new ISODate().toString();
@@ -147,9 +185,11 @@
args.add(title);
}
- if (removeAndUncacheXLinks) {
- Processor.removeXLink(xml);
- Processor.uncacheXLink(xml);
+ if (processXLinks) {
+ if (removeAndUncacheXLinks) {
+ Processor.removeXLink(xml);
+ Processor.uncacheXLink(xml);
+ }
}
String query = "INSERT INTO Metadata (" + fields + ") VALUES(" + values + ")";
@@ -164,15 +204,43 @@
public static void update(Dbms dbms, String id, Element xml) throws SQLException
{
- update(dbms, id, xml, null);
+ update(dbms, id, xml, null, false, false);
}
//--------------------------------------------------------------------------
+ public static void updateWithXLinks(Dbms dbms, String id, Element xml) throws SQLException
+ {
+ update(dbms, id, xml, null, true, true);
+ }
+
+ //--------------------------------------------------------------------------
+
public static void update(Dbms dbms, String id, Element xml, String changeDate) throws SQLException
{
+ update(dbms, id, xml, changeDate, false, false);
+ }
+
+ //--------------------------------------------------------------------------
+
+ public static void updateWithXLinks(Dbms dbms, String id, Element xml, String changeDate) throws SQLException
+ {
+ update(dbms, id, xml, changeDate, true, true);
+ }
+
+ //--------------------------------------------------------------------------
+
+ private static void update(Dbms dbms, String id, Element xml, String changeDate, boolean processXLinks, boolean removeAndUncacheXLinks) throws SQLException
+ {
String query = "UPDATE Metadata SET data=?, changeDate=?, root=? WHERE id=?";
+ if (processXLinks) {
+ if (removeAndUncacheXLinks) {
+ Processor.removeXLink(xml);
+ Processor.uncacheXLink(xml);
+ }
+ }
+
Vector args = new Vector();
fixCR(xml);
Modified: sandbox/BlueNetMEST/src/org/fao/geonet/kernel/harvest/harvester/metadatafragments/Harvester.java
===================================================================
--- sandbox/BlueNetMEST/src/org/fao/geonet/kernel/harvest/harvester/metadatafragments/Harvester.java 2009-07-28 11:46:11 UTC (rev 4700)
+++ sandbox/BlueNetMEST/src/org/fao/geonet/kernel/harvest/harvester/metadatafragments/Harvester.java 2009-07-29 03:54:36 UTC (rev 4701)
@@ -44,7 +44,6 @@
import org.fao.geonet.constants.Geonet;
import org.fao.geonet.constants.Params;
import org.fao.geonet.kernel.DataManager;
-import org.fao.geonet.kernel.XmlSerializer;
import org.fao.geonet.kernel.harvest.harvester.CategoryMapper;
import org.fao.geonet.kernel.harvest.harvester.GroupMapper;
import org.fao.geonet.kernel.harvest.harvester.Privileges;
@@ -302,7 +301,7 @@
//--- get the template to match the fragments into
if (!params.templateId.equals("0")) {
- templateForLinks = XmlSerializer.select(dbms, "Metadata", params.templateId);
+ templateForLinks = dataMan.getMetadataNoInfo(context, params.templateId);
// build a list of all Namespaces in the templateForLinks document
Namespace ns = templateForLinks.getNamespace();
if (ns != null) {
Modified: sandbox/BlueNetMEST/src/org/fao/geonet/services/config/Set.java
===================================================================
--- sandbox/BlueNetMEST/src/org/fao/geonet/services/config/Set.java 2009-07-28 11:46:11 UTC (rev 4700)
+++ sandbox/BlueNetMEST/src/org/fao/geonet/services/config/Set.java 2009-07-29 03:54:36 UTC (rev 4701)
@@ -125,7 +125,11 @@
new ConfigEntry(ConfigEntry.Type.STRING, false, "shib/attrib/username", "system/shib/attrib/username"),
new ConfigEntry(ConfigEntry.Type.STRING, false, "shib/attrib/surname", "system/shib/attrib/surname"),
new ConfigEntry(ConfigEntry.Type.STRING, false, "shib/attrib/firstname", "system/shib/attrib/firstname"),
- new ConfigEntry(ConfigEntry.Type.STRING, false, "shib/attrib/profile", "system/shib/attrib/profile")
+ new ConfigEntry(ConfigEntry.Type.STRING, false, "shib/attrib/profile", "system/shib/attrib/profile"),
+
+ new ConfigEntry(ConfigEntry.Type.BOOL, true, "userSelfRegistration/enable", "system/userSelfRegistration/enable"),
+
+ new ConfigEntry(ConfigEntry.Type.BOOL, true, "xlinkResolver/enable", "system/xlinkResolver/enable")
};
}
Modified: sandbox/BlueNetMEST/src/org/fao/geonet/services/metadata/Show.java
===================================================================
--- sandbox/BlueNetMEST/src/org/fao/geonet/services/metadata/Show.java 2009-07-28 11:46:11 UTC (rev 4700)
+++ sandbox/BlueNetMEST/src/org/fao/geonet/services/metadata/Show.java 2009-07-29 03:54:36 UTC (rev 4701)
@@ -121,7 +121,7 @@
Element elMd = null;
if (skipInfoElement) {
- elMd = dm.getMetadata(dbms, id);
+ elMd = dm.getMetadataNoInfo(context, id);
} else {
elMd = dm.getMetadata(context, id, addEdit);
}
Modified: sandbox/BlueNetMEST/web/geonetwork/loc/en/xml/config.xml
===================================================================
--- sandbox/BlueNetMEST/web/geonetwork/loc/en/xml/config.xml 2009-07-28 11:46:11 UTC (rev 4700)
+++ sandbox/BlueNetMEST/web/geonetwork/loc/en/xml/config.xml 2009-07-29 03:54:36 UTC (rev 4701)
@@ -28,8 +28,17 @@
<removedMetadata>Removed metadata</removedMetadata>
<dir>Directory</dir>
+
+ <userSelfRegistration>user self-registration</userSelfRegistration>
+
+ <authentication>Authentication</authentication>
+
+ <loginuses>Login uses</loginuses>
+ <otherlogins>Allow other users to login from</otherlogins>
+
+ <geonetworkdb>GeoNetwork Authentication</geonetworkdb>
- <ldap>LDAP Authentication</ldap>
+ <ldap>LDAP</ldap>
<defProfile>Default profile</defProfile>
<login>Login</login>
<userDN>User DN</userDN>
@@ -40,14 +49,14 @@
<name>Name</name>
<password>Password</password>
<profile>Profile</profile>
-
- <shib>Shibboleth Authentication</shib>
- <path>Path</path>
- <attributes>Shibboleth attribute mapping</attributes>
- <username>Username</username>
- <surname>Surname</surname>
- <firstname>Firstname</firstname>
- <profile>Profile</profile>
+
+ <shib>Shibboleth</shib>
+ <path>Path</path>
+ <attributes>Shibboleth attribute mapping</attributes>
+ <username>Username</username>
+ <surname>Surname</surname>
+ <firstname>Firstname</firstname>
+ <profile>Profile</profile>
<!-- Buttons -->
@@ -157,6 +166,22 @@
<tip id="removedMd.dir">
Directory used to store metadata (in MEF format) when they are deleted.
</tip>
+
+ <!-- userSelfRegistration -->
+
+ <tip id="userSelfRegistration.enable">
+ If set, users will be able to register themselves. Self-registered
+ users are assigned to the GUEST group. An email is sent to the
+ user with their username and password enclosed using the feedback
+ email information.
+ </tip>
+
+ <!-- xlinkResolver -->
+
+ <tip id="xlinkResolver.enable">
+ EXPERIMENTAL: If set, xlinks will be resolved. This is not tested fully
+ so be warned.
+ </tip>
</tips>
</strings>
Modified: sandbox/BlueNetMEST/web/geonetwork/scripts/config/model.js
===================================================================
--- sandbox/BlueNetMEST/web/geonetwork/scripts/config/model.js 2009-07-28 11:46:11 UTC (rev 4700)
+++ sandbox/BlueNetMEST/web/geonetwork/scripts/config/model.js 2009-07-29 03:54:36 UTC (rev 4701)
@@ -36,7 +36,6 @@
INTRANET_NETMASK : xml.evalXPath(node, 'intranet/netmask'),
Z3950_ENABLE : xml.evalXPath(node, 'z3950/enable'),
Z3950_PORT : xml.evalXPath(node, 'z3950/port'),
- Z3950_REPOSITORYNAME : xml.evalXPath(node, 'z3950/repositoryName'),
PROXY_USE : xml.evalXPath(node, 'proxy/use'),
PROXY_HOST : xml.evalXPath(node, 'proxy/host'),
PROXY_PORT : xml.evalXPath(node, 'proxy/port'),
@@ -61,7 +60,11 @@
SHIB_ATTRIB_USERNAME : xml.evalXPath(node, 'shib/attrib/username'),
SHIB_ATTRIB_SURNAME : xml.evalXPath(node, 'shib/attrib/surname'),
SHIB_ATTRIB_FIRSTNAME : xml.evalXPath(node, 'shib/attrib/firstname'),
- SHIB_ATTRIB_PROFILE : xml.evalXPath(node, 'shib/attrib/profile')
+ SHIB_ATTRIB_PROFILE : xml.evalXPath(node, 'shib/attrib/profile'),
+
+ USERSELFREGISTRATION_ENABLE : xml.evalXPath(node, 'userSelfRegistration/enable'),
+
+ XLINKRESOLVER_ENABLE : xml.evalXPath(node, 'xlinkResolver/enable')
}
this.getConfigCB(data);
@@ -113,7 +116,6 @@
' <z3950>'+
' <enable>{Z3950_ENABLE}</enable>'+
' <port>{Z3950_PORT}</port>'+
-' <repositoryName>{Z3950_REPOSITORYNAME}</repositoryName>'+
' </z3950>'+
' <proxy>'+
' <use>{PROXY_USE}</use>'+
@@ -156,6 +158,12 @@
' <profile>{SHIB_ATTRIB_PROFILE}</profile>'+
' </attrib>'+
' </shib>'+
+' <userSelfRegistration>'+
+' <enable>{USERSELFREGISTRATION_ENABLE}</enable>'+
+' </userSelfRegistration>'+
+' <xlinkResolver>'+
+' <enable>{XLINKRESOLVER_ENABLE}</enable>'+
+' </xlinkResolver>'+
'</config>';
//=====================================================================================
Modified: sandbox/BlueNetMEST/web/geonetwork/scripts/config/view.js
===================================================================
--- sandbox/BlueNetMEST/web/geonetwork/scripts/config/view.js 2009-07-28 11:46:11 UTC (rev 4700)
+++ sandbox/BlueNetMEST/web/geonetwork/scripts/config/view.js 2009-07-29 03:54:36 UTC (rev 4701)
@@ -23,7 +23,6 @@
{ id:'intranet.netmask', type:'ipaddress' },
{ id:'z3950.port', type:'integer', minValue:80, maxValue:65535, empty:true },
- { id:'z3950.repositoryName', type:'length', minSize :1, maxSize :200 },
{ id:'feedback.email', type:'length', minSize :0, maxSize :200 },
{ id:'feedback.mail.host', type:'length', minSize :0, maxSize :200 },
@@ -54,7 +53,11 @@
this.z3950Shower = new Shower('z3950.enable', 'z3950.subpanel');
this.proxyShower = new Shower('proxy.use', 'proxy.subpanel');
- this.ldapShower = new Shower('ldap.use', 'ldap.subpanel');
+
+ var targetIds = ['ldap.subpanel', 'geonetworkdb.subpanel'];
+ this.ldapShower = new RadioShower('ldap.use', 'ldap.subpanel', targetIds);
+ this.geonetworkdbShower = new RadioShower('geonetworkdb.use', 'geonetworkdb.subpanel', targetIds);
+
this.shibShower = new Shower('shib.use', 'shib.subpanel');
}
@@ -79,7 +82,6 @@
$('z3950.enable').checked = data['Z3950_ENABLE'] == 'true';
$('z3950.port') .value = data['Z3950_PORT'];
- $('z3950.repositoryName') .value = data['Z3950_REPOSITORYNAME'];
$('proxy.use') .checked = data['PROXY_USE'] == 'true';
$('proxy.host').value = data['PROXY_HOST'];
@@ -101,18 +103,25 @@
$('ldap.usersDN') .value = data['LDAP_DN_USERS'];
$('ldap.nameAttr') .value = data['LDAP_ATTR_NAME'];
$('ldap.profileAttr') .value = data['LDAP_ATTR_PROFILE'];
-
+
$('shib.use') .checked = data['SHIB_USE'] == 'true';
$('shib.path') .value = data['SHIB_PATH'];
$('shib.attrib.username') .value = data['SHIB_ATTRIB_USERNAME'];
$('shib.attrib.surname') .value = data['SHIB_ATTRIB_SURNAME'];
$('shib.attrib.firstname').value = data['SHIB_ATTRIB_FIRSTNAME'];
$('shib.attrib.profile') .value = data['SHIB_ATTRIB_PROFILE'];
-
+
+ $('geonetworkdb.use').checked = data['LDAP_USE'] != 'true';
+
+ $('userSelfRegistration.enable').checked = data['USERSELFREGISTRATION_ENABLE'] == 'true' && data['LDAP_USE'] != 'true';
+
+ $('xlinkResolver.enable').checked = data['XLINKRESOLVER_ENABLE'] == 'true';
+
this.z3950Shower.update();
this.proxyShower.update();
this.ldapShower.update();
this.shibShower.update();
+ this.geonetworkdbShower.update();
}
//=====================================================================================
@@ -138,8 +147,7 @@
Z3950_ENABLE : $('z3950.enable').checked,
Z3950_PORT : $('z3950.port') .value,
- Z3950_REPOSITORYNAME : $('z3950.repositoryName') .value,
-
+
PROXY_USE : $('proxy.use') .checked,
PROXY_HOST : $('proxy.host').value,
PROXY_PORT : $('proxy.port').value,
@@ -166,12 +174,15 @@
SHIB_ATTRIB_USERNAME : $('shib.attrib.username').value,
SHIB_ATTRIB_SURNAME : $('shib.attrib.surname').value,
SHIB_ATTRIB_FIRSTNAME : $('shib.attrib.firstname').value,
- SHIB_ATTRIB_PROFILE : $('shib.attrib.profile').value
-
+ SHIB_ATTRIB_PROFILE : $('shib.attrib.profile').value,
+
+ USERSELFREGISTRATION_ENABLE : $('userSelfRegistration.enable').checked && $('geonetworkdb.use').checked,
+
+ XLINKRESOLVER_ENABLE : $('xlinkResolver.enable').checked
+
}
return data;
}
//=====================================================================================
-
Modified: sandbox/BlueNetMEST/web/geonetwork/scripts/core/gui/shower.js
===================================================================
--- sandbox/BlueNetMEST/web/geonetwork/scripts/core/gui/shower.js 2009-07-28 11:46:11 UTC (rev 4700)
+++ sandbox/BlueNetMEST/web/geonetwork/scripts/core/gui/shower.js 2009-07-29 03:54:36 UTC (rev 4701)
@@ -23,4 +23,34 @@
}
//=====================================================================================
-}
\ No newline at end of file
+}
+
+function RadioShower(sourceId, targetId, targetIds)
+{
+ var source = $(sourceId);
+ var target = $(targetId);
+ var targets = [];
+ for (var index = 0, len = targetIds.length; index < len; ++index) {
+ var id = targetIds[index];
+ targets.push($(id));
+ }
+
+ Event.observe(source, 'click', update);
+
+ this.update = update;
+
+//=====================================================================================
+
+function update()
+{
+ if (source.checked) {
+ for (var index = 0, len = targets.length; index < len; ++index) {
+ var elem = targets[index];
+ if (elem.id == target.id) Element.show(elem);
+ else Element.hide(elem);
+ }
+ }
+}
+
+//=====================================================================================
+}
Modified: sandbox/BlueNetMEST/web/geonetwork/xsl/banner.xsl
===================================================================
--- sandbox/BlueNetMEST/web/geonetwork/xsl/banner.xsl 2009-07-28 11:46:11 UTC (rev 4700)
+++ sandbox/BlueNetMEST/web/geonetwork/xsl/banner.xsl 2009-07-29 03:54:36 UTC (rev 4701)
@@ -55,7 +55,9 @@
<a class="banner" onclick="doBannerButton('{/root/gui/locService}/links','{/root/gui/strings/links}',600)" href="javascript:void(0);"><xsl:value-of select="/root/gui/strings/links"/></a>
</xsl:otherwise>
</xsl:choose>
- <xsl:if test="string(/root/gui/session/userId)=''">
+ <xsl:if test="string(/root/gui/session/userId)='' and
+ string(/root/gui/env/userSelfRegistration/enable)='true'">
+
|
<a class="banner" onclick="doBannerButton('{/root/gui/locService}/user.register.get','{/root/gui/strings/registerTitle}',800)" href="javascript:void(0);">
<xsl:value-of select="/root/gui/strings/register"/>
Modified: sandbox/BlueNetMEST/web/geonetwork/xsl/config/config.xsl
===================================================================
--- sandbox/BlueNetMEST/web/geonetwork/xsl/config/config.xsl 2009-07-28 11:46:11 UTC (rev 4700)
+++ sandbox/BlueNetMEST/web/geonetwork/xsl/config/config.xsl 2009-07-29 03:54:36 UTC (rev 4701)
@@ -4,7 +4,7 @@
<!-- ============================================================================================= -->
- <xsl:include href="../edit.xsl"/>
+ <xsl:include href="../main.xsl"/>
<!-- ============================================================================================= -->
@@ -28,7 +28,6 @@
<xsl:with-param name="title" select="/root/gui/strings/systemConfig"/>
<xsl:with-param name="content">
- <xsl:call-template name="buttons"/>
<xsl:call-template name="panel"/>
</xsl:with-param>
@@ -50,12 +49,53 @@
<xsl:call-template name="proxy"/>
<xsl:call-template name="feedback"/>
<xsl:call-template name="removedMetadata"/>
- <xsl:call-template name="ldap"/>
- <xsl:call-template name="shib"/>
+ <xsl:call-template name="xlinkResolver"/>
+ <xsl:call-template name="authentication"/>
</xsl:template>
<!-- ============================================================================================= -->
+ <xsl:template name="xlinkResolver">
+ <h1 align="left"><xsl:value-of select="'XLink Resolver'"/></h1>
+ <div align="left" style="{$style}">
+ <table>
+ <tr>
+ <td class="padded" width="{$width}"><xsl:value-of select="/root/gui/config/enable"/></td>
+ <td class="padded"><input id="xlinkResolver.enable" class="content" type="checkbox"/></td>
+ </tr>
+ </table>
+ </div>
+ </xsl:template>
+
+ <!-- ============================================================================================= -->
+
+ <xsl:template name="authentication">
+ <h1 align="left"><xsl:value-of select="/root/gui/config/authentication"/></h1>
+ <div align="left" style="{$style}">
+ <b><xsl:value-of select="concat(/root/gui/config/loginuses,': ')"/></b>
+ <div align="left" style="{$style}">
+ <input align="left" type="radio" id="geonetworkdb.use" name="authentication" value="default"><xsl:value-of select="/root/gui/config/geonetworkdb"/></input>
+ <xsl:call-template name="geonetworkdb"/>
+ </div>
+ <div align="left" style="{$style}">
+ <input align="left" type="radio" id="ldap.use" name="authentication" value="ldap"><xsl:value-of select="/root/gui/config/ldap"/></input>
+ <xsl:call-template name="ldap"/>
+ </div>
+ </div>
+
+ <div align="left" style="{$style}">
+ <b><xsl:value-of select="concat(/root/gui/config/otherlogins,': ')"/></b>
+ <div align="left" style="{$style}">
+ <input align="left" type="checkbox" id="shib.use" name="authentication" value="shib">
+ <xsl:value-of select="/root/gui/config/shib"/>
+ </input>
+ <xsl:call-template name="shib"/>
+ </div>
+ </div>
+ </xsl:template>
+
+ <!-- ============================================================================================= -->
+
<xsl:template name="site">
<h1 align="left"><xsl:value-of select="/root/gui/config/site"/></h1>
@@ -133,10 +173,6 @@
<td class="padded"><xsl:value-of select="/root/gui/config/port"/></td>
<td class="padded"><input id="z3950.port" class="content" type="text" value="" size="20"/></td>
</tr>
- <tr>
- <td class="padded"><xsl:value-of select="/root/gui/config/repositoryName"/></td>
- <td class="padded"><input id="z3950.repositoryName" class="content" type="text" value="" size="40"/></td>
- </tr>
</table>
</td>
</tr>
@@ -224,63 +260,65 @@
</table>
</div>
</xsl:template>
+
+ <!-- ============================================================================================= -->
+ <!-- === Geonetwork DB panels === -->
+ <!-- ============================================================================================= -->
+ <xsl:template name="geonetworkdb">
+ <div align="left" style="{$style}">
+ <table id="geonetworkdb.subpanel">
+ <tr>
+ <td class="padded" width="40%"><xsl:value-of select="concat(/root/gui/config/enable,' ',/root/gui/config/userSelfRegistration)"/></td>
+ <td class="padded"><input id="userSelfRegistration.enable" class="content" type="checkbox"/></td>
+ </tr>
+ </table>
+ </div>
+ </xsl:template>
+
<!-- ============================================================================================= -->
<!-- === LDAP panels === -->
<!-- ============================================================================================= -->
<xsl:template name="ldap">
- <h1 align="left"><xsl:value-of select="/root/gui/config/ldap"/></h1>
-
<div align="left" style="{$style}">
- <table>
+ <table id="ldap.subpanel">
<tr>
- <td class="padded"><xsl:value-of select="/root/gui/config/use"/></td>
- <td class="padded"><input id="ldap.use" class="content" type="checkbox" value=""/></td>
+ <td class="padded"><xsl:value-of select="/root/gui/config/host"/></td>
+ <td class="padded"><input id="ldap.host" class="content" type="text" value="" size="20"/></td>
</tr>
+
<tr>
- <td/>
- <td>
- <table id="ldap.subpanel">
- <tr>
- <td class="padded"><xsl:value-of select="/root/gui/config/host"/></td>
- <td class="padded"><input id="ldap.host" class="content" type="text" value="" size="20"/></td>
- </tr>
-
- <tr>
- <td class="padded"><xsl:value-of select="/root/gui/config/port"/></td>
- <td class="padded"><input id="ldap.port" class="content" type="text" value="" size="20"/></td>
- </tr>
+ <td class="padded"><xsl:value-of select="/root/gui/config/port"/></td>
+ <td class="padded"><input id="ldap.port" class="content" type="text" value="" size="20"/></td>
+ </tr>
- <tr>
- <td class="padded"><xsl:value-of select="/root/gui/config/defProfile"/></td>
- <td class="padded"><xsl:call-template name="ldapDefProfile"/></td>
- </tr>
+ <tr>
+ <td class="padded"><xsl:value-of select="/root/gui/config/defProfile"/></td>
+ <td class="padded"><xsl:call-template name="ldapDefProfile"/></td>
+ </tr>
- <!-- distinguished names -->
+ <!-- distinguished names -->
- <tr>
- <td class="padded"><xsl:value-of select="/root/gui/config/distNames"/></td>
- <td/>
- </tr>
- <tr>
- <td/>
- <td class="padded"><xsl:call-template name="ldapDistNames"/></td>
- </tr>
+ <tr>
+ <td class="padded"><xsl:value-of select="/root/gui/config/distNames"/></td>
+ <td/>
+ </tr>
+ <tr>
+ <td/>
+ <td class="padded"><xsl:call-template name="ldapDistNames"/></td>
+ </tr>
- <!-- user's attributes -->
+ <!-- user's attributes -->
- <tr>
- <td class="padded"><xsl:value-of select="/root/gui/config/userAttribs"/></td>
- <td/>
- </tr>
- <tr>
- <td/>
- <td class="padded"><xsl:call-template name="ldapUserAttribs"/></td>
- </tr>
- </table>
- </td>
- </tr>
+ <tr>
+ <td class="padded"><xsl:value-of select="/root/gui/config/userAttribs"/></td>
+ <td/>
+ </tr>
+ <tr>
+ <td/>
+ <td class="padded"><xsl:call-template name="ldapUserAttribs"/></td>
+ </tr>
</table>
</div>
</xsl:template>
@@ -342,80 +380,65 @@
</tr>
</table>
</xsl:template>
-
-
- <!-- ============================================================================================= -->
- <!-- === Shibboleth panels === -->
- <!-- ============================================================================================= -->
-
- <xsl:template name="shib">
- <h1 align="left"><xsl:value-of select="/root/gui/config/shib"/></h1>
-
- <div align="left" style="{$style}">
- <table>
- <tr>
- <td class="padded"><xsl:value-of select="/root/gui/config/use"/></td>
- <td class="padded"><input id="shib.use" class="content" type="checkbox" value=""/></td>
- </tr>
- <tr>
- <td/>
- <td>
- <table id="shib.subpanel">
- <tr>
- <td class="padded"><xsl:value-of select="/root/gui/config/path"/></td>
- <td class="padded"><input id="shib.path" class="content" type="text" size="256"/></td>
- </tr>
-
- <!-- shibboleth attributes -->
-
- <tr>
- <td class="padded" colspan="2"><xsl:value-of select="/root/gui/config/attributes"/></td>
- </tr>
- <tr>
- <td/>
- <td class="padded"><xsl:call-template name="shibAttribs"/></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </div>
- </xsl:template>
-
- <!-- ============================================================================================= -->
-
- <xsl:template name="shibAttribs">
- <table>
- <tr>
- <td class="padded" width="60px"><xsl:value-of select="/root/gui/config/username"/></td>
- <td class="padded"><input id="shib.attrib.username" class="content" type="text" value="" size="150"/></td>
- </tr>
- <tr>
- <td class="padded"><xsl:value-of select="/root/gui/config/surname"/></td>
- <td class="padded"><input id="shib.attrib.surname" class="content" type="text" value="" size="150"/></td>
- </tr>
- <tr>
- <td class="padded"><xsl:value-of select="/root/gui/config/firstname"/></td>
- <td class="padded"><input id="shib.attrib.firstname" class="content" type="text" value="" size="150"/></td>
- </tr>
- <tr>
- <td class="padded"><xsl:value-of select="/root/gui/config/profile"/></td>
- <td class="padded"><input id="shib.attrib.profile" class="content" type="text" value="" size="150"/></td>
- </tr>
- </table>
- </xsl:template>
-
<!-- ============================================================================================= -->
+ <!-- === Shibboleth panels === -->
+ <!-- ============================================================================================= -->
+
+ <xsl:template name="shib">
+
+ <div align="left" style="{$style}">
+ <table id="shib.subpanel">
+ <tr>
+ <td class="padded"><xsl:value-of select="/root/gui/config/path"/></td>
+ <td class="padded"><input id="shib.path" class="content" type="text" size="256"/></td>
+ </tr>
+
+ <!-- shibboleth attributes -->
+
+ <tr>
+ <td class="padded" colspan="2"><xsl:value-of select="/root/gui/config/attributes"/></td>
+ </tr>
+ <tr>
+ <td/>
+ <td class="padded"><xsl:call-template name="shibAttribs"/></td>
+ </tr>
+ </table>
+ </div>
+ </xsl:template>
+
+ <!-- ============================================================================================= -->
+
+ <xsl:template name="shibAttribs">
+ <table>
+ <tr>
+ <td class="padded" width="60px"><xsl:value-of select="/root/gui/config/username"/></td>
+ <td class="padded"><input id="shib.attrib.username" class="content" type="text" value="" size="150"/></td>
+ </tr>
+ <tr>
+ <td class="padded"><xsl:value-of select="/root/gui/config/surname"/></td>
+ <td class="padded"><input id="shib.attrib.surname" class="content" type="text" value="" size="150"/></td>
+ </tr>
+ <tr>
+ <td class="padded"><xsl:value-of select="/root/gui/config/firstname"/></td>
+ <td class="padded"><input id="shib.attrib.firstname" class="content" type="text" value="" size="150"/></td>
+ </tr>
+ <tr>
+ <td class="padded"><xsl:value-of select="/root/gui/config/profile"/></td>
+ <td class="padded"><input id="shib.attrib.profile" class="content" type="text" value="" size="150"/></td>
+ </tr>
+ </table>
+ </xsl:template>
+
+ <!-- ============================================================================================= -->
<!-- === Buttons -->
<!-- ============================================================================================= -->
<xsl:template name="buttons">
- <!--
<button class="content" onclick="load('{/root/gui/locService}/admin')">
<xsl:value-of select="/root/gui/strings/back"/>
</button>
-   -->
+  
<button class="content" onclick="config.save()">
<xsl:value-of select="/root/gui/config/save"/>
</button>
Modified: sandbox/BlueNetMEST/web/geonetwork/xsl/xml/config.xsl
===================================================================
--- sandbox/BlueNetMEST/web/geonetwork/xsl/xml/config.xsl 2009-07-28 11:46:11 UTC (rev 4700)
+++ sandbox/BlueNetMEST/web/geonetwork/xsl/xml/config.xsl 2009-07-29 03:54:36 UTC (rev 4701)
@@ -18,8 +18,10 @@
<xsl:variable name="ldapLogin" select="$ldap/login/children"/>
<xsl:variable name="ldapDisNam" select="$ldap/distinguishedNames/children"/>
<xsl:variable name="ldapUsrAtt" select="$ldap/userAttribs/children"/>
- <xsl:variable name="shib" select="children/shib/children"/>
- <xsl:variable name="shibAttrib" select="$shib/attrib/children"/>
+ <xsl:variable name="shib" select="children/shib/children"/>
+ <xsl:variable name="shibAttrib" select="$shib/attrib/children"/>
+ <xsl:variable name="userSelfRegistration" select="children/userSelfRegistration/children"/>
+ <xsl:variable name="xlinkResolver" select="children/xlinkResolver/children"/>
<config>
<site>
@@ -76,17 +78,23 @@
<name><xsl:value-of select="$ldapUsrAtt/name/value"/></name>
<profile><xsl:value-of select="$ldapUsrAtt/profile/value"/></profile>
</userAttribs>
- </ldap>
- <shib>
- <use><xsl:value-of select="$shib/use"/></use>
- <path><xsl:value-of select="$shib/path"/></path>
- <attrib>
- <username><xsl:value-of select="$shibAttrib/username"/></username>
- <surname><xsl:value-of select="$shibAttrib/surname"/></surname>
- <firstname><xsl:value-of select="$shibAttrib/firstname"/></firstname>
- <profile><xsl:value-of select="$shibAttrib/profile"/></profile>
- </attrib>
+ </ldap>
+ <shib>
+ <use><xsl:value-of select="$shib/use"/></use>
+ <path><xsl:value-of select="$shib/path"/></path>
+ <attrib>
+ <username><xsl:value-of select="$shibAttrib/username"/></username>
+ <surname><xsl:value-of select="$shibAttrib/surname"/></surname>
+ <firstname><xsl:value-of select="$shibAttrib/firstname"/></firstname>
+ <profile><xsl:value-of select="$shibAttrib/profile"/></profile>
+ </attrib>
</shib>
+ <xlinkResolver>
+ <enable><xsl:value-of select="$xlinkResolver/enable"/></enable>
+ </xlinkResolver>
+ <userSelfRegistration>
+ <enable><xsl:value-of select="$userSelfRegistration/enable"/></enable>
+ </userSelfRegistration>
</config>
</xsl:template>
Modified: sandbox/BlueNetMEST/web/geonetwork/xsl/xml/env.xsl
===================================================================
--- sandbox/BlueNetMEST/web/geonetwork/xsl/xml/env.xsl 2009-07-28 11:46:11 UTC (rev 4700)
+++ sandbox/BlueNetMEST/web/geonetwork/xsl/xml/env.xsl 2009-07-29 03:54:36 UTC (rev 4701)
@@ -14,8 +14,10 @@
<xsl:variable name="proxy" select="children/proxy/children"/>
<xsl:variable name="feedback" select="children/feedback/children"/>
<xsl:variable name="platform" select="children/platform/children"/>
- <xsl:variable name="shib" select="children/shib/children"/>
- <xsl:variable name="shibAttrib" select="$shib/attrib/children"/>
+ <xsl:variable name="shib" select="children/shib/children"/>
+ <xsl:variable name="shibAttrib" select="$shib/attrib/children"/>
+ <xsl:variable name="userSelfRegistration" select="children/userSelfRegistration/children"/>
+ <xsl:variable name="xlinkResolver" select="children/xlinkResolver/children"/>
<env>
<site>
@@ -56,19 +58,26 @@
<host><xsl:value-of select="$feedback/mailServer/children/host/value"/></host>
<port><xsl:value-of select="$feedback/mailServer/children/port/value"/></port>
</mailServer>
- </feedback>
-
- <shib>
- <use><xsl:value-of select="$shib/use"/></use>
- <path><xsl:value-of select="$shib/path"/></path>
- <attrib>
- <username><xsl:value-of select="$shibAttrib/username"/></username>
- <surname><xsl:value-of select="$shibAttrib/surname"/></surname>
- <firstname><xsl:value-of select="$shibAttrib/firstname"/></firstname>
- <profile><xsl:value-of select="$shibAttrib/profile"/></profile>
- </attrib>
- </shib>
-
+ </feedback>
+
+ <shib>
+ <use><xsl:value-of select="$shib/use"/></use>
+ <path><xsl:value-of select="$shib/path"/></path>
+ <attrib>
+ <username><xsl:value-of select="$shibAttrib/username"/></username>
+ <surname><xsl:value-of select="$shibAttrib/surname"/></surname>
+ <firstname><xsl:value-of select="$shibAttrib/firstname"/></firstname>
+ <profile><xsl:value-of select="$shibAttrib/profile"/></profile>
+ </attrib>
+ </shib>
+
+ <userSelfRegistration>
+ <enable><xsl:value-of select="$userSelfRegistration/enable/value"/></enable>
+ </userSelfRegistration>
+
+ <xlinkResolver>
+ <enable><xsl:value-of select="$xlinkResolver/enable/value"/></enable>
+ </xlinkResolver>
</env>
</xsl:template>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|