From: <fxp...@us...> - 2010-04-07 08:45:51
|
Revision: 5940 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=5940&view=rev Author: fxprunayre Date: 2010-04-07 08:45:43 +0000 (Wed, 07 Apr 2010) Log Message: ----------- Fix CRLF issue on windows. Modified Paths: -------------- sandbox/GeoSource/trunk/src/main/patches/01-xlink.patch sandbox/GeoSource/trunk/src/main/patches/05-children-dm.patch sandbox/GeoSource/trunk/src/main/patches/05-children.patch Modified: sandbox/GeoSource/trunk/src/main/patches/01-xlink.patch =================================================================== --- sandbox/GeoSource/trunk/src/main/patches/01-xlink.patch 2010-04-06 15:06:41 UTC (rev 5939) +++ sandbox/GeoSource/trunk/src/main/patches/01-xlink.patch 2010-04-07 08:45:43 UTC (rev 5940) @@ -1,63 +1,63 @@ -Index: web/geonetwork/loc/en/xml/contact.xml -=================================================================== ---- web/geonetwork/loc/en/xml/contact.xml (revision 0) -+++ web/geonetwork/loc/en/xml/contact.xml (revision 0) -@@ -0,0 +1,16 @@ -+<?xml version="1.0" encoding="UTF-8"?> -+<strings> -+ <contactRole>Contact role</contactRole> -+ <contactName>Contact name</contactName> -+ <contactEdition>Contact editor</contactEdition> -+ <contactdirectory>Current contact directory:</contactdirectory> -+ <contactdirectory.admin>Contacts catalogue</contactdirectory.admin> -+ <contactdirectory.admin.desc>Add/modify/delete or visualize contacts</contactdirectory.admin.desc> -+ <contactDirectoryManagement>Manage contact directory</contactDirectoryManagement> -+ <importFromV1>Import from GeoSource v1</importFromV1> -+ <importContact>Import as: </importContact> -+ <importAsLocal>Local catalogue</importAsLocal> -+ <importAsExternal>External catalogue (read-only)</importAsExternal> -+ <new>New</new> -+ <duplicate>Duplicate</duplicate> -+</strings> -\ No newline at end of file -Index: web/geonetwork/loc/fr/xml/contact.xml -=================================================================== ---- web/geonetwork/loc/fr/xml/contact.xml (revision 0) -+++ web/geonetwork/loc/fr/xml/contact.xml (revision 0) -@@ -0,0 +1,19 @@ -+<?xml version="1.0" encoding="UTF-8"?> -+<strings> -+ <organisationName>Nom de l\'organisation</organisationName> -+ <contactRole>Rôle du contact</contactRole> -+ <contactName>Nom du contact</contactName> -+ <contactEdition>Editeur du contact</contactEdition> -+ <contactdirectory>Catalogue des contacts : </contactdirectory> -+ <contactDirectoryManagement> -+ Gestion des contacts -+ </contactDirectoryManagement> -+ <contactdirectory.admin>Gestion des contacts</contactdirectory.admin> -+ <contactdirectory.admin.desc>Ajouter/Modifier/Supprimer ou visualiser un contact</contactdirectory.admin.desc> -+ <importFromV1>Importer depuis un fichier au format GeoSource v1</importFromV1> -+ <importContact>Importer : </importContact> -+ <importAsLocal>Catalogue locale</importAsLocal> -+ <importAsExternal>Catalogue externe (lecture seule)</importAsExternal> -+ <new>Nouveau</new> -+ <duplicate>Dupliquer</duplicate> -+</strings> -\ No newline at end of file -Index: web/geonetwork/scripts/editor/metadata-editor.js -=================================================================== ---- web/geonetwork/scripts/editor/metadata-editor.js (revision 5862) -+++ web/geonetwork/scripts/editor/metadata-editor.js (working copy) -@@ -1,3 +1,6 @@ +Index: web/geonetwork/loc/en/xml/contact.xml +=================================================================== +--- web/geonetwork/loc/en/xml/contact.xml (revision 0) ++++ web/geonetwork/loc/en/xml/contact.xml (revision 0) +@@ -0,0 +1,16 @@ ++<?xml version="1.0" encoding="UTF-8"?> ++<strings> ++ <contactRole>Contact role</contactRole> ++ <contactName>Contact name</contactName> ++ <contactEdition>Contact editor</contactEdition> ++ <contactdirectory>Current contact directory:</contactdirectory> ++ <contactdirectory.admin>Contacts catalogue</contactdirectory.admin> ++ <contactdirectory.admin.desc>Add/modify/delete or visualize contacts</contactdirectory.admin.desc> ++ <contactDirectoryManagement>Manage contact directory</contactDirectoryManagement> ++ <importFromV1>Import from GeoSource v1</importFromV1> ++ <importContact>Import as: </importContact> ++ <importAsLocal>Local catalogue</importAsLocal> ++ <importAsExternal>External catalogue (read-only)</importAsExternal> ++ <new>New</new> ++ <duplicate>Duplicate</duplicate> ++</strings> +\ No newline at end of file +Index: web/geonetwork/loc/fr/xml/contact.xml +=================================================================== +--- web/geonetwork/loc/fr/xml/contact.xml (revision 0) ++++ web/geonetwork/loc/fr/xml/contact.xml (revision 0) +@@ -0,0 +1,19 @@ ++<?xml version="1.0" encoding="UTF-8"?> ++<strings> ++ <organisationName>Nom de l\'organisation</organisationName> ++ <contactRole>Rôle du contact</contactRole> ++ <contactName>Nom du contact</contactName> ++ <contactEdition>Editeur du contact</contactEdition> ++ <contactdirectory>Catalogue des contacts : </contactdirectory> ++ <contactDirectoryManagement> ++ Gestion des contacts ++ </contactDirectoryManagement> ++ <contactdirectory.admin>Gestion des contacts</contactdirectory.admin> ++ <contactdirectory.admin.desc>Ajouter/Modifier/Supprimer ou visualiser un contact</contactdirectory.admin.desc> ++ <importFromV1>Importer depuis un fichier au format GeoSource v1</importFromV1> ++ <importContact>Importer : </importContact> ++ <importAsLocal>Catalogue locale</importAsLocal> ++ <importAsExternal>Catalogue externe (lecture seule)</importAsExternal> ++ <new>Nouveau</new> ++ <duplicate>Dupliquer</duplicate> ++</strings> +\ No newline at end of file +Index: web/geonetwork/scripts/editor/metadata-editor.js +=================================================================== +--- web/geonetwork/scripts/editor/metadata-editor.js (revision 5862) ++++ web/geonetwork/scripts/editor/metadata-editor.js (working copy) +@@ -1,3 +1,6 @@ +var addKeywordAsXLink = true; +var addContactAsXLink = true; + var getGNServiceURL = function(service) { return Env.locService+"/"+service; }; -@@ -816,7 +819,93 @@ - +@@ -816,7 +819,93 @@ + } + @@ -99,8 +99,8 @@ + "") + .replace(/\&/g, + "&amp;") -+ .replace(/\"/g, -+ """) ++ .replace(/\"/g, ++ """) + .replace(/\r\n/g, ""); + if (first) { + xml = contacts[index]; @@ -140,7 +140,7 @@ + contactSelectionWindow.items.get(0).setRef(ref); + contactSelectionWindow.items.get(0).setName(name); + contactSelectionWindow.show(); -+ contactSelectionWindow.items.get(0).setAddAsXLink(addContactAsXLink); ++ contactSelectionWindow.items.get(0).setAddAsXLink(addContactAsXLink); +} + + @@ -150,7 +150,7 @@ * Property: keywordSelectionWindow * The window in which we can select keywords */ -@@ -840,7 +929,7 @@ +@@ -840,7 +929,7 @@ Ext.each(keywords, function(item, index) { // Format XML keywords[index] = item.replace("<?xml version=\"1.0\" encoding=\"UTF-8\"?>","") @@ -159,463 +159,463 @@ if (first) { xml = keywords[index]; first = false; -@@ -872,6 +961,7 @@ +@@ -872,6 +961,7 @@ }; keywordSelectionWindow.items.get(0).setRef(ref); keywordSelectionWindow.show(); -+ keywordSelectionWindow.items.get(0).setAddAsXLink(addKeywordAsXLink); ++ keywordSelectionWindow.items.get(0).setAddAsXLink(addKeywordAsXLink); } -Index: web/geonetwork/scripts/editor/app.KeywordSelectionPanel.js -=================================================================== ---- web/geonetwork/scripts/editor/app.KeywordSelectionPanel.js (revision 5862) -+++ web/geonetwork/scripts/editor/app.KeywordSelectionPanel.js (working copy) -@@ -40,6 +40,11 @@ - * Property: itemSelector - */ - itemSelector: null, -+ -+ /** -+ * Property: addAsXLink -+ */ -+ addAsXLink: false, - - /** - * Property: loadingMask -@@ -102,6 +107,17 @@ - this.addEvents('keywordselected'); - - this.bbar = ['->', { -+ id: 'addAsXLinkCheckBox', -+ xtype: 'checkbox', -+ checked: false, -+ boxLabel: translate('addAsXLink'), -+ listeners: { -+ check: function(c, checked) { -+ this.addAsXLink = checked; -+ }, -+ scope: this -+ } -+ }, { - id: 'keywordSearchValidateButton', - iconCls: 'addIcon', - disabled: true, -@@ -134,8 +150,15 @@ - setRef: function(ref) { - this.ref = ref; - }, -- - /** -+ * APIMethod: setAddAsXLink -+ * Set the add as XLink option -+ */ -+ setAddAsXLink: function(xlink) { -+ this.addAsXLink = xlink; -+ Ext.getCmp('addAsXLinkCheckBox').setValue(this.addAsXLink); -+ }, -+ /** - * Method: getLimitInput - * - * -@@ -269,10 +292,10 @@ - this.keywordsSelected = []; - var self = this; - this.ThesaurusCount = 0; -- - var thesaurusCollection = []; - var store = this.itemSelector.toMultiselect.store; - thesaurusCollection = store.collect('thesaurus'); -+ - Ext.each(thesaurusCollection, function(thesaurus, index, thesauri) { - store.filter('thesaurus', thesaurus); - var values = store.collect('uri'); -@@ -290,9 +313,21 @@ - '&multiple=' + multiple; - - ++self.ThesaurusCount; -- self.retrieveKeywordData(inputValue); -+ if (self.addAsXLink) { -+ -+ var tpl = "<gmd:descriptiveKeywords xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:gmd='http://www.isotc211.org/2005/gmd' xmlns:gco='http://www.isotc211.org/2005/gco'" + -+ " xlink:href='" + Env.host + Env.locService + "/" + inputValue + "'/>"; -+ self.keywordsSelected.push(tpl); -+ } else { -+ self.retrieveKeywordData(inputValue); -+ } - }); - -+ if (this.addAsXLink) { -+ this.fireEvent('keywordselected', this, this.keywordsSelected); -+ this.ownerCt.hide(); -+ } -+ - store.clearFilter(); - }, - -Index: web/geonetwork/scripts/editor/app.ContactSelectionPanel.js -=================================================================== ---- web/geonetwork/scripts/editor/app.ContactSelectionPanel.js (revision 0) -+++ web/geonetwork/scripts/editor/app.ContactSelectionPanel.js (revision 0) -@@ -0,0 +1,353 @@ -+Ext.namespace("app"); -+ -+/** -+ * Class: app.ContactSelectionPanel -+ */ -+ -+app.Contact = {}; -+ -+var Contact = Ext.data.Record.create([ -+ {name: 'xlink'}, -+ {name: 'name'} -+]); -+ -+app.Contact.ContactStore = new Ext.data.Store({ -+ proxy: new Ext.data.HttpProxy({ -+ url: "contacts.search", -+ method: 'GET' -+ }), -+ baseParams: { -+ ref: 'all', -+ type: 'contains', -+ mode: 'xml' -+ }, -+ reader: new Ext.data.XmlReader({ -+ record: 'contact', -+ id: 'xlink' -+ }, Contact), -+ fields: ["xlink", "name"], -+ sortInfo: { -+ field: "name" -+ } -+}); -+ -+app.ContactSelectionPanel = Ext.extend(Ext.FormPanel, { -+ border: false, -+ -+ -+ /** -+ * Property: itemSelector -+ */ -+ addAsXLink: false, -+ -+ /** -+ * Property: itemSelector -+ */ -+ itemSelector: null, -+ -+ /** -+ * Property: loadingMask -+ */ -+ loadingMask: null, -+ -+ /** -+ * Property: roleCount -+ */ -+ contactCount: null, -+ -+ /** -+ * Property: ref -+ */ -+ ref: null, -+ -+ /** -+ * Property: name The node name with prefix -+ */ -+ name: null, -+ -+ /** -+ * Property: role -+ */ -+ role: '', -+ -+ /** -+ * Property: role -+ * Default role to be used for all selected contacts. -+ */ -+ defaultRole: 'pointOfContact', -+ -+ /** -+ * APIProperty: ContactsSelected -+ * {Object} Hash table of selected contacts with their XML raw data -+ */ -+ ContactsSelected: [], -+ -+ initComponent: function() { -+ this.items = [{ -+ xtype: 'panel', -+ layout: 'fit', -+ bodyStyle: 'padding: 5px;', -+ border: false, -+ tbar: [ -+ this.getContact() -+ ], -+ items: [this.getContactsItemSelector()] -+ }]; -+ -+ app.Contact.ContactStore.on({ -+ 'loadexception': function() {}, -+ 'beforeload': function(store, options) { -+ if (!this.loadingMask) { -+ this.loadingMask = new Ext.LoadMask(this.itemSelector.fromMultiselect.getEl(), -+ {msg: translate('searching')}); -+ } -+ this.loadingMask.show(); -+ }, -+ 'load': function() { -+ this.loadingMask.hide(); -+ }, -+ scope: this -+ }); -+ -+ /** -+ * triggered when the user has selected a Contact -+ */ -+ this.addEvents('contactSelected'); -+ -+ this.bbar = ['->', { -+ id: 'addAsXLinkCheckBox', -+ xtype: 'checkbox', -+ checked: false, -+ boxLabel: translate('addAsXLink'), -+ listeners: { -+ check: function(c, checked) { -+ this.addAsXLink = checked; -+ }, -+ scope: this -+ } -+ }, -+ this.getroleCombo(), ' ', -+ { -+ id: 'ContactSearchValidateButton', -+ iconCls: 'addIcon', -+ disabled: true, -+ text: translate('add'), -+ handler: function() { -+ this.buildContactXmlList(); -+ // The event will be fired on requests response completed for -+ // every role -+ }, -+ scope: this -+ }]; -+ -+ app.ContactSelectionPanel.superclass.initComponent.call(this); -+ }, -+ -+ getContact: function() { -+ -+ return new Ext.app.SearchField({ -+ id: 'ContactSearchField', -+ width:240, -+ store: app.Contact.ContactStore, -+ paramName: 'name', -+ value: '' -+ }); -+ }, -+ -+ /** -+ * APIMethod: setRef -+ * Set the element reference -+ */ -+ setRef: function(ref) { -+ this.ref = ref; -+ }, -+ /** -+ * APIMethod: setClass -+ * Set the element reference -+ */ -+ setName: function(name) { -+ this.name = name; -+ }, -+ /** -+ * APIMethod: setAddAsXLink -+ * Set the add as XLink option -+ */ -+ setAddAsXLink: function(xlink) { -+ this.addAsXLink = xlink; -+ Ext.getCmp('addAsXLinkCheckBox').setValue(this.addAsXLink); -+ }, -+ -+ getroleCombo: function() { -+ var role = Ext.data.Record.create([ -+ {name: 'code'}, -+ {name: 'label'}, -+ {name: 'description'} -+ ]); -+ -+ /** -+ * Property: roleStore -+ */ -+ app.Contact.roleStore = new Ext.data.Store({ -+ url: 'contacts.getRole', -+ reader: new Ext.data.XmlReader({ -+ record: 'entry' -+ }, role), -+ fields: ['code', 'label', 'description'] -+ }); -+ -+ var combo = { -+ xtype: 'combo', -+ width: 150, -+ id: 'contact-role', -+ value: 0, -+ store: app.Contact.roleStore, -+ triggerAction: 'all', -+ mode: 'local', -+ emptyText: translate('contactRole'), -+ displayField: 'label', -+ valueField: 'code', -+ listWidth: 250, -+ }; -+ -+ // add the "" record -+ var record = new role({label: ''}); -+ record.set('code', ''); -+ -+ app.Contact.roleStore.add(record); -+ -+ app.Contact.roleStore.load({add: true}); -+ -+ app.Contact.roleStore.on({ -+ 'load': function() { -+ Ext.getCmp('contact-role').setValue(this.defaultRole); -+ }, -+ scope: this -+ }); -+ -+ -+ return combo; -+ }, -+ -+ -+ getContactsItemSelector: function() { -+ -+ var tpl = '<tpl for="."><div class="ux-mselect-item'; -+ if(Ext.isIE || Ext.isIE7) { -+ tpl+='" unselectable=on'; -+ } else { -+ tpl+=' x-unselectable"'; -+ } -+ tpl+='>{name}</div></tpl>'; -+ -+ this.itemSelector = new Ext.ux.ItemSelector({ -+ name:"itemselector", -+ fieldLabel:"ItemSelector", -+ dataFields:["xlink", "name"], -+ toData:[], -+ msWidth:320, -+ msHeight:230, -+ valueField:"xlink", -+ fromTpl: tpl, -+ toTpl: tpl, -+ toLegend: translate('selectedContacts'), -+ fromLegend:translate('foundContacts'), -+ fromStore: app.Contact.ContactStore, -+ fromAllowTrash: false, -+ fromAllowDup: true, -+ toAllowDup: false, -+ drawUpIcon: false, -+ drawDownIcon: false, -+ drawTopIcon: false, -+ drawBotIcon: false, -+ imagePath: javascriptsLocation + 'ext-ux/MultiselectItemSelector-3.0/icons', -+ toTBar:[{ -+ text:translate('clear'), -+ handler:function(){ -+ var i = this.getForm().findField("itemselector"); -+ i.reset.call(i); -+ }, -+ scope: this -+ }] -+ }); -+ -+ // enable the validate button only if there are selected Contacts -+ this.itemSelector.on({ -+ 'change': function(component) { -+ Ext.getCmp('ContactSearchValidateButton').setDisabled(component.toStore.getCount() < 1); -+ } -+ }); -+ -+ return this.itemSelector; -+ }, -+ -+ /** -+ * Method: buildContactXmlList -+ * -+ * populate ContactsSelected array with xml strings -+ */ -+ buildContactXmlList: function() { -+ -+ this.ContactsSelected = []; -+ var self = this; -+ this.role = Ext.getCmp('contact-role').getValue(); -+ this.contactCount = 0; -+ var store = this.itemSelector.toMultiselect.store; -+ xlinkCollection = store.collect('xlink'); -+ Ext.each(xlinkCollection, function(xlink, index, xlinks) { -+ var values = store.collect('uri'); -+ -+ var inputValue = xlink + self.role; -+ -+ ++self.contactCount; -+ if (self.addAsXLink) { -+ // Could be gmd:contact, gmd:pointOfContact, ... -+ var tpl = "<" + self.name + " xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:gmd='http://www.isotc211.org/2005/gmd' xmlns:gco='http://www.isotc211.org/2005/gco'" + -+ " xlink:href='" + inputValue + "'/>"; -+ self.ContactsSelected.push(tpl); -+ } else { -+ self.retrieveContactData(inputValue); -+ } -+ -+ }); -+ -+ if (this.addAsXLink) { -+ this.fireEvent('contactSelected', this, this.ContactsSelected); -+ this.ownerCt.hide(); -+ } -+ -+ store.clearFilter(); -+ }, -+ -+ /** -+ * Method: retrieveContactData -+ * -+ * Load Contact data, transform it to a json object, & put it in selectedContactsJson -+ */ -+ retrieveContactData: function(url) { -+ -+ Ext.getCmp('ContactSearchValidateButton').disable(); -+ -+ Ext.Ajax.request({ -+ -+ url: url, -+ method: 'GET', -+ scope: this, -+ success: function(response) { -+ var Contact = response.responseText; -+ if (Contact.indexOf('<gmd:CI_ResponsibleParty') != -1) -+ this.ContactsSelected.push(response.responseText); -+ Ext.getCmp('ContactSearchValidateButton').enable(); -+ this.contactCount -= 1; -+ -+ if (this.contactCount == 0) { -+ // Wait until the request for *each* role has ended before -+ // firing the event & closing the window -+ this.fireEvent('contactSelected', this, this.ContactsSelected); -+ this.ownerCt.hide(); -+ } -+ } -+ -+ }); -+ -+ } -+}); -Index: web/geonetwork/scripts/contactsearching.js -=================================================================== ---- web/geonetwork/scripts/contactsearching.js (revision 0) -+++ web/geonetwork/scripts/contactsearching.js (revision 0) -@@ -0,0 +1,313 @@ +Index: web/geonetwork/scripts/editor/app.KeywordSelectionPanel.js +=================================================================== +--- web/geonetwork/scripts/editor/app.KeywordSelectionPanel.js (revision 5862) ++++ web/geonetwork/scripts/editor/app.KeywordSelectionPanel.js (working copy) +@@ -40,6 +40,11 @@ + * Property: itemSelector + */ + itemSelector: null, ++ ++ /** ++ * Property: addAsXLink ++ */ ++ addAsXLink: false, + + /** + * Property: loadingMask +@@ -102,6 +107,17 @@ + this.addEvents('keywordselected'); + + this.bbar = ['->', { ++ id: 'addAsXLinkCheckBox', ++ xtype: 'checkbox', ++ checked: false, ++ boxLabel: translate('addAsXLink'), ++ listeners: { ++ check: function(c, checked) { ++ this.addAsXLink = checked; ++ }, ++ scope: this ++ } ++ }, { + id: 'keywordSearchValidateButton', + iconCls: 'addIcon', + disabled: true, +@@ -134,8 +150,15 @@ + setRef: function(ref) { + this.ref = ref; + }, +- + /** ++ * APIMethod: setAddAsXLink ++ * Set the add as XLink option ++ */ ++ setAddAsXLink: function(xlink) { ++ this.addAsXLink = xlink; ++ Ext.getCmp('addAsXLinkCheckBox').setValue(this.addAsXLink); ++ }, ++ /** + * Method: getLimitInput + * + * +@@ -269,10 +292,10 @@ + this.keywordsSelected = []; + var self = this; + this.ThesaurusCount = 0; +- + var thesaurusCollection = []; + var store = this.itemSelector.toMultiselect.store; + thesaurusCollection = store.collect('thesaurus'); ++ + Ext.each(thesaurusCollection, function(thesaurus, index, thesauri) { + store.filter('thesaurus', thesaurus); + var values = store.collect('uri'); +@@ -290,9 +313,21 @@ + '&multiple=' + multiple; + + ++self.ThesaurusCount; +- self.retrieveKeywordData(inputValue); ++ if (self.addAsXLink) { ++ ++ var tpl = "<gmd:descriptiveKeywords xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:gmd='http://www.isotc211.org/2005/gmd' xmlns:gco='http://www.isotc211.org/2005/gco'" + ++ " xlink:href='" + Env.host + Env.locService + "/" + inputValue + "'/>"; ++ self.keywordsSelected.push(tpl); ++ } else { ++ self.retrieveKeywordData(inputValue); ++ } + }); + ++ if (this.addAsXLink) { ++ this.fireEvent('keywordselected', this, this.keywordsSelected); ++ this.ownerCt.hide(); ++ } ++ + store.clearFilter(); + }, + +Index: web/geonetwork/scripts/editor/app.ContactSelectionPanel.js +=================================================================== +--- web/geonetwork/scripts/editor/app.ContactSelectionPanel.js (revision 0) ++++ web/geonetwork/scripts/editor/app.ContactSelectionPanel.js (revision 0) +@@ -0,0 +1,353 @@ ++Ext.namespace("app"); ++ ++/** ++ * Class: app.ContactSelectionPanel ++ */ ++ ++app.Contact = {}; ++ ++var Contact = Ext.data.Record.create([ ++ {name: 'xlink'}, ++ {name: 'name'} ++]); ++ ++app.Contact.ContactStore = new Ext.data.Store({ ++ proxy: new Ext.data.HttpProxy({ ++ url: "contacts.search", ++ method: 'GET' ++ }), ++ baseParams: { ++ ref: 'all', ++ type: 'contains', ++ mode: 'xml' ++ }, ++ reader: new Ext.data.XmlReader({ ++ record: 'contact', ++ id: 'xlink' ++ }, Contact), ++ fields: ["xlink", "name"], ++ sortInfo: { ++ field: "name" ++ } ++}); ++ ++app.ContactSelectionPanel = Ext.extend(Ext.FormPanel, { ++ border: false, ++ ++ ++ /** ++ * Property: itemSelector ++ */ ++ addAsXLink: false, ++ ++ /** ++ * Property: itemSelector ++ */ ++ itemSelector: null, ++ ++ /** ++ * Property: loadingMask ++ */ ++ loadingMask: null, ++ ++ /** ++ * Property: roleCount ++ */ ++ contactCount: null, ++ ++ /** ++ * Property: ref ++ */ ++ ref: null, ++ ++ /** ++ * Property: name The node name with prefix ++ */ ++ name: null, ++ ++ /** ++ * Property: role ++ */ ++ role: '', ++ ++ /** ++ * Property: role ++ * Default role to be used for all selected contacts. ++ */ ++ defaultRole: 'pointOfContact', ++ ++ /** ++ * APIProperty: ContactsSelected ++ * {Object} Hash table of selected contacts with their XML raw data ++ */ ++ ContactsSelected: [], ++ ++ initComponent: function() { ++ this.items = [{ ++ xtype: 'panel', ++ layout: 'fit', ++ bodyStyle: 'padding: 5px;', ++ border: false, ++ tbar: [ ++ this.getContact() ++ ], ++ items: [this.getContactsItemSelector()] ++ }]; ++ ++ app.Contact.ContactStore.on({ ++ 'loadexception': function() {}, ++ 'beforeload': function(store, options) { ++ if (!this.loadingMask) { ++ this.loadingMask = new Ext.LoadMask(this.itemSelector.fromMultiselect.getEl(), ++ {msg: translate('searching')}); ++ } ++ this.loadingMask.show(); ++ }, ++ 'load': function() { ++ this.loadingMask.hide(); ++ }, ++ scope: this ++ }); ++ ++ /** ++ * triggered when the user has selected a Contact ++ */ ++ this.addEvents('contactSelected'); ++ ++ this.bbar = ['->', { ++ id: 'addAsXLinkCheckBox', ++ xtype: 'checkbox', ++ checked: false, ++ boxLabel: translate('addAsXLink'), ++ listeners: { ++ check: function(c, checked) { ++ this.addAsXLink = checked; ++ }, ++ scope: this ++ } ++ }, ++ this.getroleCombo(), ' ', ++ { ++ id: 'ContactSearchValidateButton', ++ iconCls: 'addIcon', ++ disabled: true, ++ text: translate('add'), ++ handler: function() { ++ this.buildContactXmlList(); ++ // The event will be fired on requests response completed for ++ // every role ++ }, ++ scope: this ++ }]; ++ ++ app.ContactSelectionPanel.superclass.initComponent.call(this); ++ }, ++ ++ getContact: function() { ++ ++ return new Ext.app.SearchField({ ++ id: 'ContactSearchField', ++ width:240, ++ store: app.Contact.ContactStore, ++ paramName: 'name', ++ value: '' ++ }); ++ }, ++ ++ /** ++ * APIMethod: setRef ++ * Set the element reference ++ */ ++ setRef: function(ref) { ++ this.ref = ref; ++ }, ++ /** ++ * APIMethod: setClass ++ * Set the element reference ++ */ ++ setName: function(name) { ++ this.name = name; ++ }, ++ /** ++ * APIMethod: setAddAsXLink ++ * Set the add as XLink option ++ */ ++ setAddAsXLink: function(xlink) { ++ this.addAsXLink = xlink; ++ Ext.getCmp('addAsXLinkCheckBox').setValue(this.addAsXLink); ++ }, ++ ++ getroleCombo: function() { ++ var role = Ext.data.Record.create([ ++ {name: 'code'}, ++ {name: 'label'}, ++ {name: 'description'} ++ ]); ++ ++ /** ++ * Property: roleStore ++ */ ++ app.Contact.roleStore = new Ext.data.Store({ ++ url: 'contacts.getRole', ++ reader: new Ext.data.XmlReader({ ++ record: 'entry' ++ }, role), ++ fields: ['code', 'label', 'description'] ++ }); ++ ++ var combo = { ++ xtype: 'combo', ++ width: 150, ++ id: 'contact-role', ++ value: 0, ++ store: app.Contact.roleStore, ++ triggerAction: 'all', ++ mode: 'local', ++ emptyText: translate('contactRole'), ++ displayField: 'label', ++ valueField: 'code', ++ listWidth: 250, ++ }; ++ ++ // add the "" record ++ var record = new role({label: ''}); ++ record.set('code', ''); ++ ++ app.Contact.roleStore.add(record); ++ ++ app.Contact.roleStore.load({add: true}); ++ ++ app.Contact.roleStore.on({ ++ 'load': function() { ++ Ext.getCmp('contact-role').setValue(this.defaultRole); ++ }, ++ scope: this ++ }); ++ ++ ++ return combo; ++ }, ++ ++ ++ getContactsItemSelector: function() { ++ ++ var tpl = '<tpl for="."><div class="ux-mselect-item'; ++ if(Ext.isIE || Ext.isIE7) { ++ tpl+='" unselectable=on'; ++ } else { ++ tpl+=' x-unselectable"'; ++ } ++ tpl+='>{name}</div></tpl>'; ++ ++ this.itemSelector = new Ext.ux.ItemSelector({ ++ name:"itemselector", ++ fieldLabel:"ItemSelector", ++ dataFields:["xlink", "name"], ++ toData:[], ++ msWidth:320, ++ msHeight:230, ++ valueField:"xlink", ++ fromTpl: tpl, ++ toTpl: tpl, ++ toLegend: translate('selectedContacts'), ++ fromLegend:translate('foundContacts'), ++ fromStore: app.Contact.ContactStore, ++ fromAllowTrash: false, ++ fromAllowDup: true, ++ toAllowDup: false, ++ drawUpIcon: false, ++ drawDownIcon: false, ++ drawTopIcon: false, ++ drawBotIcon: false, ++ imagePath: javascriptsLocation + 'ext-ux/MultiselectItemSelector-3.0/icons', ++ toTBar:[{ ++ text:translate('clear'), ++ handler:function(){ ++ var i = this.getForm().findField("itemselector"); ++ i.reset.call(i); ++ }, ++ scope: this ++ }] ++ }); ++ ++ // enable the validate button only if there are selected Contacts ++ this.itemSelector.on({ ++ 'change': function(component) { ++ Ext.getCmp('ContactSearchValidateButton').setDisabled(component.toStore.getCount() < 1); ++ } ++ }); ++ ++ return this.itemSelector; ++ }, ++ ++ /** ++ * Method: buildContactXmlList ++ * ++ * populate ContactsSelected array with xml strings ++ */ ++ buildContactXmlList: function() { ++ ++ this.ContactsSelected = []; ++ var self = this; ++ this.role = Ext.getCmp('contact-role').getValue(); ++ this.contactCount = 0; ++ var store = this.itemSelector.toMultiselect.store; ++ xlinkCollection = store.collect('xlink'); ++ Ext.each(xlinkCollection, function(xlink, index, xlinks) { ++ var values = store.collect('uri'); ++ ++ var inputValue = xlink + self.role; ++ ++ ++self.contactCount; ++ if (self.addAsXLink) { ++ // Could be gmd:contact, gmd:pointOfContact, ... ++ var tpl = "<" + self.name + " xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:gmd='http://www.isotc211.org/2005/gmd' xmlns:gco='http://www.isotc211.org/2005/gco'" + ++ " xlink:href='" + inputValue + "'/>"; ++ self.ContactsSelected.push(tpl); ++ } else { ++ self.retrieveContactData(inputValue); ++ } ++ ++ }); ++ ++ if (this.addAsXLink) { ++ this.fireEvent('contactSelected', this, this.ContactsSelected); ++ this.ownerCt.hide(); ++ } ++ ++ store.clearFilter(); ++ }, ++ ++ /** ++ * Method: retrieveContactData ++ * ++ * Load Contact data, transform it to a json object, & put it in selectedContactsJson ++ */ ++ retrieveContactData: function(url) { ++ ++ Ext.getCmp('ContactSearchValidateButton').disable(); ++ ++ Ext.Ajax.request({ ++ ++ url: url, ++ method: 'GET', ++ scope: this, ++ success: function(response) { ++ var Contact = response.responseText; ++ if (Contact.indexOf('<gmd:CI_ResponsibleParty') != -1) ++ this.ContactsSelected.push(response.responseText); ++ Ext.getCmp('ContactSearchValidateButton').enable(); ++ this.contactCount -= 1; ++ ++ if (this.contactCount == 0) { ++ // Wait until the request for *each* role has ended before ++ // firing the event & closing the window ++ this.fireEvent('contactSelected', this, this.ContactsSelected); ++ this.ownerCt.hide(); ++ } ++ } ++ ++ }); ++ ++ } ++}); +Index: web/geonetwork/scripts/contactsearching.js +=================================================================== +--- web/geonetwork/scripts/contactsearching.js (revision 0) ++++ web/geonetwork/scripts/contactsearching.js (revision 0) +@@ -0,0 +1,313 @@ +//===================================================================================== +//=== +//=== API methods @@ -929,618 +929,618 @@ +{ +}; + -Index: web/geonetwork/scripts/config/view.js -=================================================================== ---- web/geonetwork/scripts/config/view.js (revision 5862) -+++ web/geonetwork/scripts/config/view.js (working copy) -@@ -139,6 +139,8 @@ - - $('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(); -@@ -222,8 +224,9 @@ - SHIB_ATTRIB_FIRSTNAME : $('shib.attrib.firstname').value, - SHIB_ATTRIB_PROFILE : $('shib.attrib.profile').value, - -- USERSELFREGISTRATION_ENABLE : $('userSelfRegistration.enable').checked && $('geonetworkdb.use').checked -+ USERSELFREGISTRATION_ENABLE : $('userSelfRegistration.enable').checked && $('geonetworkdb.use').checked, - -+ XLINKRESOLVER_ENABLE : $('xlinkResolver.enable').checked - } - - return data; -Index: web/geonetwork/scripts/config/model.js -=================================================================== ---- web/geonetwork/scripts/config/model.js (revision 5862) -+++ web/geonetwork/scripts/config/model.js (working copy) -@@ -83,7 +83,9 @@ - SHIB_ATTRIB_FIRSTNAME : xml.evalXPath(node, 'shib/attrib/firstname'), - SHIB_ATTRIB_PROFILE : xml.evalXPath(node, 'shib/attrib/profile'), - -- USERSELFREGISTRATION_ENABLE : xml.evalXPath(node, 'userSelfRegistration/enable') -+ USERSELFREGISTRATION_ENABLE : xml.evalXPath(node, 'userSelfRegistration/enable'), -+ -+ XLINKRESOLVER_ENABLE : xml.evalXPath(node, 'xlinkResolver/enable') - } - - this.getConfigCB(data); -@@ -213,6 +215,9 @@ - ' <userSelfRegistration>'+ - ' <enable>{USERSELFREGISTRATION_ENABLE}</enable>'+ - ' </userSelfRegistration>'+ -+' <xlinkResolver>'+ -+' <enable>{XLINKRESOLVER_ENABLE}</enable>'+ -+' </xlinkResolver>'+ - '</config>'; - - //===================================================================================== -Index: web/geonetwork/WEB-INF/user-profiles.xml -=================================================================== ---- web/geonetwork/WEB-INF/user-profiles.xml (revision 5862) -+++ web/geonetwork/WEB-INF/user-profiles.xml (working copy) -@@ -78,6 +78,15 @@ - <allow service="test.i18n"/> - <allow service="test.i18n.xml"/> - -+ -+ <!-- Contact directory services --> -+ <allow service="contactdirectory.admin"/> -+ <allow service="contactdirectory.edit"/> -+ <allow service="contactdirectory.upload"/> -+ <allow service="contactdirectory.download"/> -+ <allow service="contactdirectory.delete"/> -+ <allow service="contacts.deleteelement"/> -+ - </profile> - - <!-- ====================================================================== --> -@@ -188,6 +197,15 @@ - <allow service="xml.relation.insert"/> - <allow service="xml.relation.delete"/> - -+ <!-- Contact services --> -+ <allow service="contactdirectory.view"/> -+ <allow service="contactdirectory.list"/> -+ <allow service="contacts.newelement"/> -+ <allow service="contacts.duplicateelement"/> -+ <allow service="contacts.updateelement"/> -+ <allow service="contacts.saveelement"/> -+ <allow service="contacts.viewelement"/> -+ - </profile> - - <!-- ====================================================================== --> -@@ -352,6 +370,15 @@ - <!-- User self registration --> - <allow service="user.register.get"/> - <allow service="user.register.submit"/> -+ -+ <!-- Contact search services --> -+ <allow service="contacts.search"/> -+ <allow service="contacts.sort"/> -+ <allow service="contacts.select"/> -+ <allow service="contacts.editsearch"/> -+ <allow service="contacts.getselected"/> -+ <allow service="contacts.getRole"/> -+ - </profile> - - <!-- ====================================================================== --> -Index: web/geonetwork/WEB-INF/config-contact.xml -=================================================================== ---- web/geonetwork/WEB-INF/config-contact.xml (revision 0) -+++ web/geonetwork/WEB-INF/config-contact.xml (revision 0) -@@ -0,0 +1,134 @@ -+<?xml version="1.0" encoding="ISO-8859-1"?> -+<geonet> -+ <services package="org.fao.geonet"> -+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> -+ <!-- contactdirectory services --> -+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> -+ <service name="contactdirectory.admin"> -+ <class name=".services.contact.List"> -+ <param name="type" value="file"/> -+ </class> -+ <output sheet="contact/contact-admin.xsl"> -+ <xml name="contact" file="xml/contact.xml"/> -+ <call name="importStyleSheets" class=".guiservices.util.GetImportXSLs"/> -+ </output> -+ </service> -+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> -+ <service name="contactdirectory.upload"> -+ <class name=".services.contact.Upload"/> -+ <output forward="contactdirectory.admin"/> -+ </service> -+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> -+ <service name="contactdirectory.download"> -+ <class name=".services.contact.Download"/> -+ <error id="file-not-found" sheet="error.xsl"> -+ <xml name="error" file="xml/file-not-found-error.xml"/> -+ </error> -+ <output file="true"/> -+ </service> -+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> -+ <service name="contactdirectory.delete"> -+ <class name=".services.contact.Delete"/> -+ <output forward="contactdirectory.admin"/> -+ </service> -+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> -+ <service name="contactdirectory.view"> -+ <class name=".services.contact.List"> -+ <param name="mode" value="view"/> -+ <param name="currTab" value=".guiservices.util.GetCurrentMDTab"/> -+ </class> -+ <output sheet="contact/contact-edit-search.xsl"> -+ <xml name="contact" file="xml/contact.xml"/> -+ </output> -+ </service> -+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> -+ <service name="contactdirectory.edit"> -+ <class name=".services.contact.List"> -+ <param name="mode" value="edit"/> -+ </class> -+ <output sheet="contact/contact-edit-search.xsl"> -+ <xml name="contact" file="xml/contact.xml"/> -+ </output> -+ </service> -+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> -+ -+ <!-- Manage contact element --> -+ <service name="contacts.newelement"> -+ <class name=".services.contact.NewElement"> -+ <param name="mode" value="new"/> -+ </class> -+ <output forward="contacts.updateelement"/> -+ </service> -+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> -+ <service name="contacts.duplicateelement"> -+ <class name=".services.contact.DuplicateElement"> -+ <param name="mode" value="new"/> -+ </class> -+ <output forward="contacts.updateelement"/> -+ </service> -+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> -+ <service name="contacts.updateelement"> -+ <class name=".services.contact.UpdateElement"> -+ <param name="mode" value="update"/> -+ </class> -+ <output sheet="contact/metadata-edit-contact.xsl"> -+ <xml name="contact" file="xml/contact.xml"/> -+ <call name="currTab" class=".guiservices.util.GetCurrentMDTab"/> -+ <call name="groups" class=".guiservices.groups.GetMine"/> -+ </output> -+ </service> -+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> -+ <service name="contacts.viewelement"> -+ <class name=".services.contact.UpdateElement"> -+ <param name="mode" value="view"/> -+ </class> -+ <output sheet="contact/metadata-edit-contact.xsl"> -+ <xml name="contact" file="xml/contact.xml"/> -+ <call name="currTab" class=".guiservices.util.GetCurrentMDTab"/> -+ <call name="groups" class=".guiservices.groups.GetMine"/> -+ </output> -+ </service> -+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> -+ <service name="contacts.saveelement"> -+ <class name=".services.contact.SaveElement"> -+ <param name="finished" value="yes" /> -+ </class> -+ </service> -+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> -+ <service name="contacts.deleteelement"> -+ <class name=".services.contact.DeleteElement"/> -+ </service> -+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> -+ <service name="contacts.sort" type="xml"> -+ <class name=".services.thesaurus.SortKeywords"/> -+ <output sheet="contact/contact-search-results.xsl"> -+ <xml name="contact" file="xml/contact.xml"/> -+ </output> -+ </service> -+ <service name="contacts.select" type="xml"> -+ <class name=".services.main.Select"> -+ <param name="type" value="contact"/> -+ </class> -+ </service> -+ <service name="contacts.search" type="xml"> -+ <class name=".services.contact.List"/> -+ <output sheet="contact/contact-search-results.xsl" contentType="text/xml; charset=UTF-8"> -+ <xml name="contact" file="xml/contact.xml"/> -+ <call name="siteURL" class=".guiservices.util.GetSiteURL"/> -+ </output> -+ </service> -+ <service name="contacts.editsearch"> -+ <class name=".services.contact.List"> -+ <param name="type" value="file"/> -+ </class> -+ <output sheet="contact/contact-edit-search.xsl"> -+ <xml name="contact" file="xml/contact.xml"/> -+ </output> -+ </service> -+ <service name="contacts.getRole" type="xml"> -+ <output sheet="contact/get-role.xsl" contentType="text/xml; charset=UTF-8"> -+ <xml name="codelist" base="xml/schemas/iso19139/loc" file="codelists.xml" /> -+ </output> -+ </service> -+ </services> -+</geonet> -Index: web/geonetwork/WEB-INF/cache.ccf -=================================================================== ---- web/geonetwork/WEB-INF/cache.ccf (revision 0) -+++ web/geonetwork/WEB-INF/cache.ccf (revision 0) -@@ -0,0 +1,69 @@ -+# DEFAULT CACHE REGION -+ -+jcs.default= -+jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes -+jcs.default.cacheattributes.MaxObjects=1000 -+jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache -+ -+jcs.default.cacheattributes.UseMemoryShrinker=true -+jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600 -+jcs.default.cacheattributes.ShrinkerIntervalSeconds=60 -+jcs.default.cacheattributes.MaxSpoolPerRun=500 -+jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes -+jcs.default.elementattributes.IsEternal=false -+jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory -+jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes -+jcs.auxiliary.DC.attributes.DiskPath=jcs_caching -+ -+ -+# XLink cache -+jcs.region.xlink=DC -+jcs.region.xlink.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes -+jcs.region.xlink.cacheattributes.MaxObjects=10000 -+jcs.region.xlink.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache -+jcs.region.xlink.elementattributes.IsEternal=false -+jcs.region.xlink.elementattributes.MaxLifeSeconds=60000 -+jcs.region.xlink.elementattributes.IdleTime=1800 -+jcs.region.xlink.elementattributes.IsSpool=true -+jcs.region.xlink.elementattributes.IsRemote=true -+jcs.region.xlink.elementattributes.IsLateral=true -+ -+# SPATIAL Filter FEATURE CACHING -+jcs.region.SpatialFilterCache=DC -+jcs.region.SpatialFilterCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes -+jcs.region.SpatialFilterCache.cacheattributes.MaxObjects=5000 -+jcs.region.SpatialFilterCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache -+jcs.region.SpatialFilterCache.elementattributes.IsEternal=false -+jcs.region.SpatialFilterCache.elementattributes.MaxLifeSeconds=7200 -+jcs.region.SpatialFilterCache.elementattributes.IdleTime=1800 -+jcs.region.SpatialFilterCache.elementattributes.IsSpool=true -+jcs.region.SpatialFilterCache.elementattributes.IsRemote=true -+jcs.region.SpatialFilterCache.elementattributes.IsLateral=true -+ -+ -+# LUCENE SPATIAL FILTER CACHING -+#jcs.region.luceneSpatialFilter.cacheattributes= -+# org.apache.jcs.engine.CompositeCacheAttributes -+#jcs.region.luceneSpatialFilter.cacheattributes.MaxObjects=1000 -+#jcs.region.luceneSpatialFilter.cacheattributes.MemoryCacheName= -+# org.apache.jcs.engine.memory.lru.LRUMemoryCache -+#jcs.region.luceneSpatialFilter.elementattributes.IsEternal=false -+#jcs.region.luceneSpatialFilter.elementattributes.MaxLifeSeconds=7200 -+#jcs.region.luceneSpatialFilter.elementattributes.IdleTime=1800 -+#jcs.region.luceneSpatialFilter.elementattributes.IsSpool=true -+#jcs.region.luceneSpatialFilter.elementattributes.IsRemote=true -+#jcs.region.luceneSpatialFilter.elementattributes.IsLateral=true -+# -+# CSW SPATIAL FILTER CACHING -+#jcs.region.cswSpatialFilter.cacheattributes= -+# org.apache.jcs.engine.CompositeCacheAttributes -+#jcs.region.cswSpatialFilter.cacheattributes.MaxObjects=1000 -+#jcs.region.cswSpatialFilter.cacheattributes.MemoryCacheName= -+# org.apache.jcs.engine.memory.lru.LRUMemoryCache -+#jcs.region.cswSpatialFilter.elementattributes.IsEternal=false -+#jcs.region.cswSpatialFilter.elementattributes.MaxLifeSeconds=7200 -+#jcs.region.cswSpatialFilter.elementattributes.IdleTime=1800 -+#jcs.region.cswSpatialFilter.elementattributes.IsSpool=true -+#jcs.region.cswSpatialFilter.elementattributes.IsRemote=true -+#jcs.region.cswSpatialFilter.elementattributes.IsLateral=true -+# -\ No newline at end of file -Index: web/geonetwork/xsl/metadata-iso19139.xsl -=================================================================== ---- web/geonetwork/xsl/metadata-iso19139.xsl (revision 5862) -+++ web/geonetwork/xsl/metadata-iso19139.xsl (working copy) -@@ -534,6 +534,7 @@ - <xsl:variable name="name" select="local-name(..)"/> - <xsl:variable name="qname" select="name(..)"/> - <xsl:variable name="value" select="../@codeListValue"/> -+ <xsl:variable name="isXLinked" select="count(ancestor-or-self::node()[@xlink:href]) > 0" /> - - <xsl:choose> - <xsl:when test="$qname='gmd:LanguageCode'"> -@@ -579,6 +580,9 @@ - <xsl:if test="../../geonet:element/@min='1' and $edit"> - <xsl:attribute name="onchange">validateNonEmpty(this);</xsl:attribute> - </xsl:if> -+ <xsl:if test="$isXLinked"> -+ <xsl:attribute name="disabled">disabled</xsl:attribute> -+ </xsl:if> - <option name=""/> - <xsl:for-each select="$codelist/entry"> - <xsl:sort select="label"/> -@@ -2569,6 +2573,7 @@ - <xsl:template mode="iso19139" match="gmd:protocol" priority="2"> - <xsl:param name="schema"/> - <xsl:param name="edit"/> -+ <xsl:variable name="isXLinked" select="count(ancestor-or-self::node()[@xlink:href]) > 0" /> - - <xsl:choose> - <xsl:when test="$edit=true()"> -@@ -2587,6 +2592,9 @@ - <xsl:variable name="fref" select="../gmd:name/gco:CharacterString/geonet:element/@ref"/> - <input type="hidden" id="_{$ref}" name="_{$ref}" value="{$value}"/> - <select id="s_{$ref}" name="s_{$ref}" size="1" onchange="checkForFileUpload('{$fref}', '{$ref}');" class="md"> -+ <xsl:if test="$isXLinked"> -+ <xsl:attribute name="disabled">disabled</xsl:attribute> -+ </xsl:if> - <xsl:if test="$value=''"> - <option value=""/> - </xsl:if> -@@ -2627,6 +2635,7 @@ - <xsl:variable name="ref" select="gco:CharacterString/geonet:element/@ref"/> - <xsl:variable name="value" select="gco:CharacterString"/> - <xsl:variable name="button" select="starts-with($protocol,'WWW:DOWNLOAD') and contains($protocol,'http') and normalize-space($value)=''"/> -+ <xsl:variable name="isXLinked" select="count(ancestor-or-self::node()[@xlink:href]) > 0" /> - - <xsl:call-template name="simpleElementGui"> - <xsl:with-param name="schema" select="$schema"/> -@@ -2651,7 +2660,11 @@ - </xsl:call-template> - </xsl:with-param> - <xsl:with-param name="text"> -- <input id="_{gco:CharacterString/geonet:element/@ref}" class="md" type="text" name="_{gco:CharacterString/geonet:element/@ref}" value="{gco:CharacterString/text()}" size="40" /> -+ <input id="_{gco:CharacterString/geonet:element/@ref}" class="md" type="text" name="_{gco:CharacterString/geonet:element/@ref}" value="{gco:CharacterString/text()}" size="40"> -+ <xsl:if test="$isXLinked"> -+ <xsl:attribute name="disabled">disabled</xsl:attribute> -+ </xsl:if> -+ </input> - </xsl:with-param> - <xsl:with-param name="id" select="concat('di_',$ref)"/> - <xsl:with-param name="visible" select="not($button)"/> -@@ -3111,7 +3124,8 @@ - - <xsl:variable name="qname" select="name(.)"/> - <xsl:variable name="value" select="gco:CharacterString"/> -- -+ <xsl:variable name="isXLinked" select="count(ancestor-or-self::node()[@xlink:href]) > 0" /> -+ - <xsl:apply-templates mode="simpleElement" select="."> - <xsl:with-param name="schema" select="$schema" /> - <xsl:with-param name="edit" select="$edit" /> -@@ -3121,11 +3135,19 @@ - - <xsl:variable name="lang" select="/root/gui/language"/> - <input class="md" name="_{gco:CharacterString/geonet:element/@ref}" -- id="_{gco:CharacterString/geonet:element/@ref}" value="{gco:CharacterString}"/> -+ id="_{gco:CharacterString/geonet:element/@ref}" value="{gco:CharacterString}"> -+ <xsl:if test="$isXLinked"> -+ <xsl:attribute name="disabled">disabled</xsl:attribute> -+ </xsl:if> -+ </input> - <xsl:text> </xsl:text> - <select class="md" - onchange="$('_{gco:CharacterString/geonet:element/@ref}').value = this.options[this.selectedIndex].value;" - size="1"> -+ <xsl:if test="$isXLinked"> -+ <xsl:attribute name="disabled">disabled</xsl:attribute> -+ </xsl:if> -+ - <option name="" /> - <xsl:for-each select="/root/gui/regions/record"> - <xsl:sort select="label/child::*[name() = $lang]" order="ascending"/> -@@ -3717,6 +3739,18 @@ - geonet:child[@name='referenceSystemInfo' and @prefix='gmd']"> - <xsl:text>showCRSSelectionPanel</xsl:text> - </xsl:template> -+ -+ <xsl:template mode="addXMLFragment" match="gmd:contact| -+ geonet:child[@name='contact' and @prefix='gmd']| -+ gmd:citedResponsibleParty| -+ geonet:child[@name='citedResponsibleParty' and @prefix='gmd']| -+ gmd:pointOfContact| -+ geonet:child[@name='pointOfContact' and @prefix='gmd']| -+ gmd:distributorContact| -+ geonet:child[@name='distributorContact' and @prefix='gmd'] -+ "> -+ <xsl:text>showContactSelectionPanel</xsl:text> -+ </xsl:template> - <xsl:template mode="addXMLFragment" match="*|@*"></xsl:template> - - </xsl:stylesheet> -Index: web/geonetwork/xsl/metadata.xsl -=================================================================== ---- web/geonetwork/xsl/metadata.xsl (revision 5862) -+++ web/geonetwork/xsl/metadata.xsl (working copy) -@@ -127,7 +127,12 @@ - or $subtemplates"> - <xsl:variable name="text"> - <xsl:if test="geonet:choose"> -+ <xsl:variable name="isXLinked" select="count(ancestor-or-self::node()[@xlink:href]) > 0" /> -+ - <select class="md" name="_{$parentName}_{$qname}" size="1"> -+ <xsl:if test="$isXLinked"> -+ <xsl:attribute name="disabled">disabled</xsl:attribute> -+ </xsl:if> - <xsl:for-each select="geonet:choose"> - <!-- FIXME : here we should sort by title ? --> - <xsl:sort select="@name"/> -@@ -382,9 +387,9 @@ - <!-- - prevent drawing of geonet:* elements - --> -- <xsl:template mode="element" match="geonet:null|geonet:element|geonet:info|geonet:attribute|geonet:schematronerrors|@geonet:xsderror|@xlink:type|@gco:isoType|@gco:nilReason"/> -- <xsl:template mode="simpleElement" match="geonet:null|geonet:element|geonet:info|geonet:attribute|geonet:schematronerrors|@geonet:xsderror|@xlink:type|@gco:isoType|@gco:nilReason"/> -- <xsl:template mode="complexElement" match="geonet:null|geonet:element|geonet:info|geonet:attribute|geonet:schematronerrors|@geonet:xsderror|@xlink:type|@gco:isoType|@gco:nilReason"/> -+ <xsl:template mode="element" match="geonet:null|geonet:element|geonet:info|geonet:attribute|geonet:schematronerrors|@geonet:xsderror|@xlink:type|@xlink:href|@gco:isoType|@gco:nilReason"/> -+ <xsl:template mode="simpleElement" match="geonet:null|geonet:element|geonet:info|geonet:attribute|geonet:schematronerrors|@geonet:xsderror|@xlink:type|@xlink:href|@gco:isoType|@gco:nilReason"/> -+ <xsl:template mode="complexElement" match="geonet:null|geonet:element|geonet:info|geonet:attribute|geonet:schematronerrors|@geonet:xsderror|@xlink:type|@xlink:href|@gco:isoType|@gco:nilReason"/> - - <!-- - prevent drawing of attributes starting with "_", used in old GeoNetwork versions -@@ -737,6 +742,9 @@ - <xsl:param name="id" select="generate-id(.)"/> - <xsl:param name="visible" select="true()"/> - -+ <xsl:variable name="isXLinked" select="count(ancestor-or-self::node()[@xlink:href]) > 0" /> -+ -+ - <tr id="{$id}" type="metadata"> - <xsl:if test="not($visible)"> - <xsl:attribute name="style"> -@@ -761,7 +769,7 @@ - </xsl:otherwise> - </xsl:choose> - <xsl:text> </xsl:text> -- <xsl:if test="$edit"> -+ <xsl:if test="$edit and not($isXLinked)"> - <xsl:call-template name="getButtons"> - <xsl:with-param name="addLink" select="$addLink"/> - <xsl:with-param name="addXMLFragment" select="$addXMLFragment"/> -@@ -774,7 +782,6 @@ - </xsl:if> - </th> - <td class="padded" valign="top"> -- - <xsl:variable name="textnode" select="exslt:node-set($text)"/> - <xsl:choose> - <xsl:when test="$edit"> -@@ -838,6 +845,8 @@ - <xsl:param name="edit" select="false()"/> - <xsl:param name="id" select="generate-id(.)"/> - -+ <xsl:variable name="isXLinked" select="count(ancestor::node()[@xlink:href]) > 0" /> -+ - <tr id="{$id}" type="metadata"> - <td class="padded-content" width="100%" colspan="2"> - <fieldset class="metadata-block"> -@@ -861,7 +870,7 @@ - </xsl:call-template> - </xsl:otherwise> - </xsl:choose> -- <xsl:if test="$edit"> -+ <xsl:if test="$edit and not($isXLinked)"> - <xsl:call-template name="getButtons"> - <xsl:with-param name="addLink" select="$addLink"/> - <xsl:with-param name="addXMLFragment" select="$addXMLFragment"/> -@@ -978,11 +987,11 @@ - <!-- Set to true no_name parameter in order to create an element - which will not be submitted to the form. --> - <xsl:param name="no_name" select="false()" /> -- -- -+ - <xsl:variable name="name" select="name(.)"/> - <xsl:variable name="value" select="string(.)"/> -- -+ <xsl:variable name="isXLinked" select="count(ancestor-or-self::node()[@xlink:href]) > 0" /> -+ - <xsl:choose> - <!-- list of values --> - <xsl:when test="geonet:element/geonet:text"> -@@ -1018,6 +1027,9 @@ - <xsl:if test="$visible = 'false'"> - <xsl:attribute name="style">display:none;</xsl:attribute> - </xsl:if> -+ <xsl:if test="$isXLinked"> -+ <xsl:attribute name="disabled">disabled</xsl:attribute> -+ </xsl:if> - <option name=""/> - <xsl:for-each select="exslt:node-set($list)//item"> - <xsl:sort select="label"/> -@@ -1042,6 +1054,9 @@ - <xsl:if test="$visible = 'false'"> - <xsl:attribute name="style">display:none;</xsl:attribute> - </xsl:if> -+ <xsl:if test="$isXLinked"> -+ <xsl:attribute name="disabled">disabled</xsl:attribute> -+ </xsl:if> - <xsl:if test="( - (name(.)='gmd:LocalisedCharacterString' and ../../geonet:element/@min='1') - or ../geonet:element/@min='1' -@@ -1086,16 +1101,27 @@ - - <xsl:choose> - <xsl:when test="text()='true' or text()='1'"> -- <input class="md" type="checkbox" id="_{geonet:element/@ref}_checkbox" onclick="handleCheckboxAsBoolean(this, '_{geonet:element/@ref}');" checked="checked"/> -+ <input class="md" type="checkbox" id="_{geonet:element/@ref}_checkbox" onclick="handleCheckboxAsBoolean(this, '_{geonet:element/@ref}');" checked="checked"> -+ <xsl:if test="$isXLinked"> -+ <xsl:attribute name="disabled">disabled</xsl:attribute> -+ </xsl:if> -+ </input> - </xsl:when> - <xsl:otherwise> -- <input class="md" type="checkbox" id="_{geonet:element/@ref}_checkbox" onclick="handleCheckboxAsBoolean(this, '_{geonet:element/@ref}');"/> -+ <input class="md" type="checkbox" id="_{geonet:element/@ref}_checkbox" onclick="handleCheckboxAsBoolean(this, '_{geonet:element/@ref}');"> -+ <xsl:if test="$isXLinked"> -+ <xsl:attribute name="disabled">disabled</xsl:attribute> -+ </xsl:if> -+ </input> - </xsl:otherwise> - </xsl:choose> - </xsl:when> - - <xsl:otherwise> - <input class="md" type="{$input_type}" value="{text()}" size="{$cols}"> -+ <xsl:if test="$isXLinked"> -+ <xsl:attribute name="disabled">disabled</xsl:attribute> -+ </xsl:if> - <xsl:choose> - <xsl:when test="$no_name=false()"> - <xsl:attribute name="name">_<xsl:value-of select="geonet:element/@ref"/></xsl:attribute> -@@ -1130,6 +1156,9 @@ - <xsl:if test="$visible = 'false'"> - <xsl:attribute name="style">display:none;</xsl:attribute> - </xsl:if> -+ <xsl:if test="$isXLinked"> -+ <xsl:attribute name="disabled">disabled</xsl:attribute> -+ </xsl:if> - <xsl:if test="( - (name(.)='gmd:LocalisedCharacterString' and ../../geonet:ele... [truncated message content] |