[GeoNetwork-devel] Scripting metadata insertion

What is the easiest way to create/insert metadata to GN automatically via
javascript?

I am using a XmlHTTPRequest to invoke the mef.import service, but i can only
seem to get it to work if i use an xml file located at
"/usr/local/geonetwork/data/tmp/."

Is there a better service that i can use that i can pass the xml stream to
directly?

-----
-------------------------------------------
Cuffy Camz
-------------------------------------------
--
View this message in context: http://n2.nabble.com/Scripting-metadata-insertion-tp3732674p3732674.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

As this forum sux & no-one even views most of the posts let alone solves them
i solved my own problem.

I used the metadata.insert.paste service.

function sendRequest()
{
  var inpParams = "";
  inpParams += "data=" + "<gmd:MD_Metadata ...>\r ... </gmd:MD_Metadata>";
  inpParams += "&category=_none_";
  inpParams += "&file_type=single";
  inpParams += "&group=3";
  inpParams += "&insert_mode=0";
  inpParams += "&mefFile";
  inpParams += "&styleSheet=_none_";
  inpParams += "&template=n";
  inpParams += "&title=";
  inpParams += "&uuidAction=nothing";

  xmlhttp.open("POST", "/geonetwork/srv/en/metadata.insert.paste", true);
  xmlhttp.withCredentials = "true";
  xmlhttp.setRequestHeader('Content-Type',
'application/x-www-form-urlencoded');
  xmlhttp.send( inpParams );
}

CuffyCamz wrote:

What is the easiest way to create/insert metadata to GN automatically via
javascript?

I am using a XmlHTTPRequest to invoke the mef.import service, but i can
only seem to get it to work if i use an xml file located at
"/usr/local/geonetwork/data/tmp/."

Is there a better service that i can use that i can pass the xml stream to
directly?

-----
-------------------------------------------
Cuffy Camz
-------------------------------------------
--
View this message in context: http://n2.nabble.com/Scripting-metadata-insertion-tp3732674p3733205.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

CSW Transaction operation is another option.
That was discussed on the french mailing list
http://n2.nabble.com/CSW-Transaction-initiee-en-PHP-td3471308.html#a3471562

Francois

2009/9/29 CuffyCamz <cameron.haddad@anonymised.com>:

As this forum sux & no-one even views most of the posts let alone solves them
i solved my own problem.

I used the metadata.insert.paste service.

function sendRequest()
{
var inpParams = "";
inpParams += "data=" + "<gmd:MD_Metadata ...>\r ... </gmd:MD_Metadata>";
inpParams += "&category=_none_";
inpParams += "&file_type=single";
inpParams += "&group=3";
inpParams += "&insert_mode=0";
inpParams += "&mefFile";
inpParams += "&styleSheet=_none_";
inpParams += "&template=n";
inpParams += "&title=";
inpParams += "&uuidAction=nothing";

xmlhttp.open("POST", "/geonetwork/srv/en/metadata.insert.paste", true);
xmlhttp.withCredentials = "true";
xmlhttp.setRequestHeader('Content-Type',
'application/x-www-form-urlencoded');
xmlhttp.send( inpParams );
}

CuffyCamz wrote:

What is the easiest way to create/insert metadata to GN automatically via
javascript?

I am using a XmlHTTPRequest to invoke the mef.import service, but i can
only seem to get it to work if i use an xml file located at
"/usr/local/geonetwork/data/tmp/."

Is there a better service that i can use that i can pass the xml stream to
directly?

-----
-------------------------------------------
Cuffy Camz
-------------------------------------------
--
View this message in context: http://n2.nabble.com/Scripting-metadata-insertion-tp3732674p3733205.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork