git-svn-id: http://svn.research-infrastructures.eu/d4science/gcube/trunk/spatial-data/geonetwork@100758 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b49a3d56ef
commit
b9482dff08
|
@ -0,0 +1,24 @@
|
||||||
|
0 [main] INFO org.gcube.common.scope.impl.ScopeProviderScanner - using scope provider org.gcube.common.scope.impl.DefaultScopeProvider@771199f0
|
||||||
|
2 [main] DEBUG org.gcube.common.scope.impl.DefaultScopeProvider - setting scope /gcube/devsec in thread 1
|
||||||
|
945 [main] INFO org.gcube.common.scan.DefaultScanner - matched 13 resources from 40 urls in 101 ms
|
||||||
|
971 [main] INFO org.gcube.common.scope.impl.ServiceMapScanner - loading jar:file:/home/fabio/.m2/repository/org/gcube/core/common-scope-maps/1.0.2-SNAPSHOT/common-scope-maps-1.0.2-SNAPSHOT.jar!/d4science.servicemap
|
||||||
|
1129 [main] INFO org.gcube.common.scope.impl.ServiceMapScanner - loading jar:file:/home/fabio/.m2/repository/org/gcube/core/common-scope-maps/1.0.2-SNAPSHOT/common-scope-maps-1.0.2-SNAPSHOT.jar!/vo1.servicemap
|
||||||
|
1130 [main] INFO org.gcube.common.scope.impl.ServiceMapScanner - loading jar:file:/home/fabio/.m2/repository/org/gcube/core/common-scope-maps/1.0.2-SNAPSHOT/common-scope-maps-1.0.2-SNAPSHOT.jar!/openbio.servicemap
|
||||||
|
1131 [main] INFO org.gcube.common.scope.impl.ServiceMapScanner - loading jar:file:/home/fabio/.m2/repository/org/gcube/core/common-scope-maps/1.0.2-SNAPSHOT/common-scope-maps-1.0.2-SNAPSHOT.jar!/cnr.servicemap
|
||||||
|
1132 [main] INFO org.gcube.common.scope.impl.ServiceMapScanner - loading jar:file:/home/fabio/.m2/repository/org/gcube/core/common-scope-maps/1.0.2-SNAPSHOT/common-scope-maps-1.0.2-SNAPSHOT.jar!/testing.servicemap
|
||||||
|
1132 [main] INFO org.gcube.common.scope.impl.ServiceMapScanner - loading jar:file:/home/fabio/.m2/repository/org/gcube/core/common-scope-maps/1.0.2-SNAPSHOT/common-scope-maps-1.0.2-SNAPSHOT.jar!/gcube.servicemap
|
||||||
|
1133 [main] INFO org.gcube.common.scope.impl.ServiceMapScanner - loading jar:file:/home/fabio/.m2/repository/org/gcube/core/common-scope-maps/1.0.2-SNAPSHOT/common-scope-maps-1.0.2-SNAPSHOT.jar!/farm.servicemap
|
||||||
|
1134 [main] INFO org.gcube.common.scope.impl.ServiceMapScanner - loading jar:file:/home/fabio/.m2/repository/org/gcube/core/common-scope-maps/1.0.2-SNAPSHOT/common-scope-maps-1.0.2-SNAPSHOT.jar!/isti.servicemap
|
||||||
|
1135 [main] INFO org.gcube.common.scope.impl.ServiceMapScanner - loading jar:file:/home/fabio/.m2/repository/org/gcube/core/common-scope-maps/1.0.2-SNAPSHOT/common-scope-maps-1.0.2-SNAPSHOT.jar!/gcubeapps.servicemap
|
||||||
|
1136 [main] INFO org.gcube.common.scope.impl.ServiceMapScanner - loading jar:file:/home/fabio/.m2/repository/org/gcube/core/common-scope-maps/1.0.2-SNAPSHOT/common-scope-maps-1.0.2-SNAPSHOT.jar!/ecosystem.servicemap
|
||||||
|
1137 [main] INFO org.gcube.common.scope.impl.ServiceMapScanner - loading jar:file:/home/fabio/.m2/repository/org/gcube/core/common-scope-maps/1.0.2-SNAPSHOT/common-scope-maps-1.0.2-SNAPSHOT.jar!/securevo.servicemap
|
||||||
|
1137 [main] INFO org.gcube.common.scope.impl.ServiceMapScanner - loading jar:file:/home/fabio/.m2/repository/org/gcube/core/common-scope-maps/1.0.2-SNAPSHOT/common-scope-maps-1.0.2-SNAPSHOT.jar!/devsec.servicemap
|
||||||
|
1138 [main] INFO org.gcube.common.scope.impl.ServiceMapScanner - loading jar:file:/home/fabio/.m2/repository/org/gcube/core/common-scope-maps/1.0.2-SNAPSHOT/common-scope-maps-1.0.2-SNAPSHOT.jar!/devnext.servicemap
|
||||||
|
1399 [main] INFO org.gcube.common.clients.stubs.jaxws.StubFactory - fetching wsdl for XQueryAccessService at http://dlib01.isti.cnr.it:8080/wsrf/services/gcube/informationsystem/collector/XQueryAccess?wsdl
|
||||||
|
1799 [main] INFO org.gcube.common.clients.stubs.jaxws.StubCache - caching stub for interface org.gcube.resources.discovery.icclient.stubs.CollectorStub
|
||||||
|
2061 [main] INFO org.gcube.resources.discovery.icclient.ICClient - executing query declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry'; for $resource in collection('/db/Profiles/GenericResource')//Document/Data/ic:Profile/Resource where ($resource/Profile/SecondaryType/text() eq 'ISO') and ($resource/Profile/Name/text() eq 'MetadataConstants') return $resource
|
||||||
|
2123 [main] INFO org.gcube.common.clients.stubs.jaxws.handlers.HandlerRegistry - loaded call handler org.gcube.common.clients.stubs.jaxws.handlers.ScopeHandler@7dd84118
|
||||||
|
2123 [main] INFO org.gcube.common.clients.stubs.jaxws.handlers.HandlerRegistry - loaded call handler org.gcube.common.clients.stubs.jaxws.handlers.TargetServiceHandler@c10420b
|
||||||
|
2124 [main] INFO org.gcube.common.clients.stubs.jaxws.handlers.HandlerRegistry - loaded call handler org.gcube.common.clients.stubs.jaxws.handlers.ClientInfoHandler@593e9bf1
|
||||||
|
2124 [main] INFO org.gcube.common.clients.stubs.jaxws.handlers.HandlerRegistry - loaded call handler org.gcube.common.clients.stubs.jaxws.handlers.LegacyWSAddressingHandler@3d3b10b1
|
||||||
|
2317 [main] INFO org.gcube.resources.discovery.icclient.ICClient - executed query declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry'; for $resource in collection('/db/Profiles/GenericResource')//Document/Data/ic:Profile/Resource where ($resource/Profile/SecondaryType/text() eq 'ISO') and ($resource/Profile/Name/text() eq 'MetadataConstants') return $resource in 256 ms
|
2
pom.xml
2
pom.xml
|
@ -8,7 +8,7 @@
|
||||||
</parent>
|
</parent>
|
||||||
<groupId>org.gcube.spatial.data</groupId>
|
<groupId>org.gcube.spatial.data</groupId>
|
||||||
<artifactId>geonetwork</artifactId>
|
<artifactId>geonetwork</artifactId>
|
||||||
<version>2.0.2-SNAPSHOT</version>
|
<version>2.0.3-SNAPSHOT</version>
|
||||||
<name>geonetwork</name>
|
<name>geonetwork</name>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|
|
@ -11,12 +11,15 @@ import it.geosolutions.geonetwork.util.GNSearchResponse;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.xml.bind.JAXBException;
|
import javax.xml.bind.JAXBException;
|
||||||
|
|
||||||
import org.gcube.spatial.data.geonetwork.configuration.AuthorizationException;
|
import org.gcube.spatial.data.geonetwork.configuration.AuthorizationException;
|
||||||
import org.gcube.spatial.data.geonetwork.configuration.Configuration;
|
import org.gcube.spatial.data.geonetwork.configuration.Configuration;
|
||||||
import org.gcube.spatial.data.geonetwork.configuration.ConfigurationManager;
|
import org.gcube.spatial.data.geonetwork.configuration.ConfigurationManager;
|
||||||
|
import org.gcube.spatial.data.geonetwork.configuration.XMLAdapter;
|
||||||
import org.geotoolkit.xml.XML;
|
import org.geotoolkit.xml.XML;
|
||||||
import org.jdom.output.Format;
|
import org.jdom.output.Format;
|
||||||
import org.jdom.output.XMLOutputter;
|
import org.jdom.output.XMLOutputter;
|
||||||
|
@ -120,7 +123,7 @@ public class GeoNetwork implements GeoNetworkPublisher {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public long insertMetadata(GNInsertConfiguration configuration,Metadata meta) throws GNLibException, GNServerException, IOException, JAXBException{
|
public long insertMetadata(GNInsertConfiguration configuration,Metadata meta) throws GNLibException, GNServerException, IOException, JAXBException{
|
||||||
return insertMetadata(configuration, meta2File(meta));
|
return insertMetadata(configuration, meta2File(meta,registeredXMLAdapters));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -136,7 +139,7 @@ public class GeoNetwork implements GeoNetworkPublisher {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public long insertMetadata(Metadata meta) throws GNLibException, GNServerException, IOException, JAXBException{
|
public long insertMetadata(Metadata meta) throws GNLibException, GNServerException, IOException, JAXBException{
|
||||||
return insertMetadata(meta2File(meta));
|
return insertMetadata(meta2File(meta,registeredXMLAdapters));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -153,10 +156,12 @@ public class GeoNetwork implements GeoNetworkPublisher {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void updateMetadata(long id,Metadata meta) throws GNLibException, GNServerException, IOException, JAXBException{
|
public void updateMetadata(long id,Metadata meta) throws GNLibException, GNServerException, IOException, JAXBException{
|
||||||
updateMetadata(id, meta2File(meta));
|
updateMetadata(id, meta2File(meta,registeredXMLAdapters));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.gcube.spatial.data.geonetwork.GeoNetworkReader#deleteMetadata(long)
|
* @see org.gcube.spatial.data.geonetwork.GeoNetworkReader#deleteMetadata(long)
|
||||||
*/
|
*/
|
||||||
|
@ -167,6 +172,15 @@ public class GeoNetwork implements GeoNetworkPublisher {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerXMLAdapter(XMLAdapter adapter) {
|
||||||
|
registeredXMLAdapters.add(adapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//************* PRIVATE
|
//************* PRIVATE
|
||||||
|
|
||||||
private GNClient theClient=null;
|
private GNClient theClient=null;
|
||||||
|
@ -178,10 +192,16 @@ public class GeoNetwork implements GeoNetworkPublisher {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static File meta2File(Metadata meta) throws IOException, JAXBException{
|
private List<XMLAdapter> registeredXMLAdapters=new ArrayList<XMLAdapter>();
|
||||||
|
|
||||||
|
|
||||||
|
private static File meta2File(Metadata meta,List<XMLAdapter> adapters) throws IOException, JAXBException{
|
||||||
File temp=File.createTempFile("meta", ".xml");
|
File temp=File.createTempFile("meta", ".xml");
|
||||||
FileWriter writer=new FileWriter(temp);
|
FileWriter writer=new FileWriter(temp);
|
||||||
writer.write(XML.marshal(meta));
|
String marshalled=XML.marshal(meta);
|
||||||
|
for(XMLAdapter adapter:adapters)
|
||||||
|
marshalled=adapter.adaptXML(marshalled);
|
||||||
|
writer.write(marshalled);
|
||||||
writer.close();
|
writer.close();
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import java.io.IOException;
|
||||||
|
|
||||||
import javax.xml.bind.JAXBException;
|
import javax.xml.bind.JAXBException;
|
||||||
|
|
||||||
import org.gcube.spatial.data.geonetwork.configuration.AuthorizationException;
|
import org.gcube.spatial.data.geonetwork.configuration.XMLAdapter;
|
||||||
import org.opengis.metadata.Metadata;
|
import org.opengis.metadata.Metadata;
|
||||||
|
|
||||||
public interface GeoNetworkPublisher extends GeoNetworkReader {
|
public interface GeoNetworkPublisher extends GeoNetworkReader {
|
||||||
|
@ -32,6 +32,7 @@ public interface GeoNetworkPublisher extends GeoNetworkReader {
|
||||||
GNServerException, IOException,
|
GNServerException, IOException,
|
||||||
JAXBException;
|
JAXBException;
|
||||||
|
|
||||||
|
|
||||||
public void updateMetadata(long id, File metadataFile)
|
public void updateMetadata(long id, File metadataFile)
|
||||||
throws GNLibException, GNServerException;
|
throws GNLibException, GNServerException;
|
||||||
|
|
||||||
|
@ -41,4 +42,7 @@ public interface GeoNetworkPublisher extends GeoNetworkReader {
|
||||||
|
|
||||||
public void deleteMetadata(long id) throws GNLibException,
|
public void deleteMetadata(long id) throws GNLibException,
|
||||||
GNServerException;
|
GNServerException;
|
||||||
|
|
||||||
|
public void registerXMLAdapter(XMLAdapter adapter);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
package org.gcube.spatial.data.geonetwork.configuration;
|
||||||
|
|
||||||
|
public interface XMLAdapter {
|
||||||
|
|
||||||
|
public String adaptXML(String xml);
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue