[GeoNetwork-devel] Add a new Stylesheet transformation

Hi!

I've created a new stylesheet to register SOS services, i tested it and it's
working.
I can import a SOS GetCapabilities document in "Metadata insert", because i
added a new option on the StyleSheet options.

I've already added SOS as a new type of services in
loc/en/xml/harvesting.xml wxstype element, but when i try to harvest a SOS,
it doesn't work. I think it's because Geonetwork is calling the
OGCWxSGetCapabilities-to-19119.xsl instead of the new one i created,
OGCSOSGetCapabilities-to-19119.xsl.
How do i change that, so when the "Type of OGC webservice" is SOS, the
harvester knows that he has to use the OGCSOSGetCapabilities-to-19119.xsl?

Kind regards,
Vitor Gonçalves
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Add-a-new-Stylesheet-transformation-tp5483549p5483549.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

Hello Vitor,

2010/8/31 vmag <1050569@anonymised.com>:

Hi!

I've created a new stylesheet to register SOS services, i tested it and it's
working.

Great !

I can import a SOS GetCapabilities document in "Metadata insert", because i
added a new option on the StyleSheet options.

I've already added SOS as a new type of services in
loc/en/xml/harvesting.xml wxstype element, but when i try to harvest a SOS,
it doesn't work. I think it's because Geonetwork is calling the
OGCWxSGetCapabilities-to-19119.xsl instead of the new one i created,
OGCSOSGetCapabilities-to-19119.xsl.
How do i change that, so when the "Type of OGC webservice" is SOS, the
harvester knows that he has to use the OGCSOSGetCapabilities-to-19119.xsl?

You've 2 options :
* modify the Harvester (line 263) in order to use your stylesheet if
type is SOS instead of the default one.
* or merge your stylesheet with the default one.

The first option is probably easier and better.

I made a ticket [1] for enhancement in order to split the XSL for each
type of OGC services.
You could also add you SOS XSL to the patch and I could integrate that later.

Cheers.
Francois

[1] http://trac.osgeo.org/geonetwork/ticket/305

Kind regards,
Vitor Gonçalves
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Add-a-new-Stylesheet-transformation-tp5483549p5483549.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
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

Hi!

Thanks for your help.

The second option doesn't work. I tried to make the modifications on the
OGCWxSGetCapabilities-to-19119.xsl, but it can't process the SOS
GetCapabilities well, that's why i made a new one.

The first option looks good to me. But i have installed Geonetwork 2.4.3.
How do i make modifications on my version? Compile the source code that is
on the installation folder? How do i make a new project on eclipse, using
that source code?

Kind regards,
Vitor Gonçalves
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Add-a-new-Stylesheet-transformation-tp5483549p5495905.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

Hi,

2010/9/3 vmag <1050569@anonymised.com>:

Hi!

Thanks for your help.

The second option doesn't work. I tried to make the modifications on the
OGCWxSGetCapabilities-to-19119.xsl, but it can't process the SOS
GetCapabilities well, that's why i made a new one.

The first option looks good to me. But i have installed Geonetwork 2.4.3.
How do i make modifications on my version? Compile the source code that is
on the installation folder? How do i make a new project on eclipse, using
that source code?

Check the developper doc you have on the installation. Make sure you
have the src folder installed. Basically you need to run ant on the
GeoNetwork folder to compile the application. The online developper
manual [1] is for 2.6.x series.

HTH.

Francois

[1] http://geonetwork-opensource.org/developers/development/index.html

Kind regards,
Vitor Gonçalves
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Add-a-new-Stylesheet-transformation-tp5483549p5495905.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
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

Hi!

Many thanks for your help Francois, it's working now!

I modified the file Harvester.java with this:

    //--- Loading stylesheet
    
    String ogctype = capa.getNamespacePrefix();
    String styleSheet;
    
    if(ogctype == "sos"){
      
      styleSheet = context.getAppPath() +
                  Geonet.Path.IMPORT_STYLESHEETS +
                  "/OGCSOSGetCapabilities-to-ISO19119_ISO19139.xsl";
      
      log.debug (" - XSLT transformation using
OGCSOSGetCapabilities-to-ISO19119_ISO19139.xsl");
      
    }
    else{
      
      styleSheet = context.getAppPath() +
                  Geonet.Path.IMPORT_STYLESHEETS +
                  "/OGCWxSGetCapabilities-to-ISO19119_ISO19139.xsl";
      
      log.debug (" - XSLT transformation using
OGCWxSGetCapabilities-to-ISO19119_ISO19139.xsl");
      
    }

Kind regards,
Vitor Gonçalves
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Add-a-new-Stylesheet-transformation-tp5483549p5503693.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

Hi!

I tried to compile the installer, but it fails.

I run the command "ant" on the folder "installer" but i get this error:

BUILD FAILED
C:\Users\vmag.USIC_INESCPORTO\Documents\geonetwork\installer\build.xml:146:
The
following error occurred while executing this line:
C:\Users\vmag.USIC_INESCPORTO\Documents\geonetwork\docs\build.xml:70:
Compile fa
iled; see the compiler error output for details.

Before i got this error, i had others saying that were missing some folders
on the "docs" folder, so i copied the missing folders to the "docs" folder,
and solved the problem. But now i can't solve this one. Any clue?

Kind regards,
Vitor Gonçalves
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Add-a-new-Stylesheet-transformation-tp5483549p5506940.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

Hi Vitor,

If you want that SOS harvester added to future GeoNetwork releases,
open a ticket on trac or send me the transformation.

Thanks.

Francois

2010/9/6 vmag <1050569@anonymised.com>:

Hi!

Many thanks for your help Francois, it's working now!

I modified the file Harvester.java with this:

           //\-\-\- Loading stylesheet

           String ogctype = capa\.getNamespacePrefix\(\);
           String styleSheet;

           if\(ogctype == &quot;sos&quot;\)\{

                   styleSheet = context\.getAppPath\(\) \+
                                                                   Geonet\.Path\.IMPORT\_STYLESHEETS \+
                                                                   &quot;/OGCSOSGetCapabilities\-to\-ISO19119\_ISO19139\.xsl&quot;;

                   log\.debug \(&quot;  \- XSLT transformation using

OGCSOSGetCapabilities-to-ISO19119_ISO19139.xsl");

           \}
           else\{

                   styleSheet = context\.getAppPath\(\) \+
                                                                   Geonet\.Path\.IMPORT\_STYLESHEETS \+
                                                                   &quot;/OGCWxSGetCapabilities\-to\-ISO19119\_ISO19139\.xsl&quot;;

                   log\.debug \(&quot;  \- XSLT transformation using

OGCWxSGetCapabilities-to-ISO19119_ISO19139.xsl");

           \}

Kind regards,
Vitor Gonçalves
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Add-a-new-Stylesheet-transformation-tp5483549p5503693.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
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

Hi

2010/9/7 vmag <1050569@anonymised.com>:

Hi!

I tried to compile the installer, but it fails.

I run the command "ant" on the folder "installer" but i get this error:

BUILD FAILED
C:\Users\vmag.USIC_INESCPORTO\Documents\geonetwork\installer\build.xml:146:
The
following error occurred while executing this line:
C:\Users\vmag.USIC_INESCPORTO\Documents\geonetwork\docs\build.xml:70:
Compile fa
iled; see the compiler error output for details.

Before i got this error, i had others saying that were missing some folders
on the "docs" folder, so i copied the missing folders to the "docs" folder,
and solved the problem. But now i can't solve this one. Any clue?

Did you manage to run ant in docs folder ?

Francois

Kind regards,
Vitor Gonçalves
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Add-a-new-Stylesheet-transformation-tp5483549p5506940.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
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

Hi!

I can't run ant on the docs folder, because there isn't any build.xml on
that folder. The one that appears on my error, it's because i copied the
build.xml to the docs folder.

The first error that appears when i run ant on the installer folder is:

BUILD FAILED
C:\geonetwork\installer\build.xml:104: Warning: Could not find file
C:\geonetwor
k\docs\readme.html to copy.

So i copied the docs folder from C:\geonetwork\web\geonetwork\ to
C:\geonetwork\ and tried to run ant again, but got an error again:

BUILD FAILED
C:\geonetwork\installer\build.xml:146: The following error occurred while
execut
ing this line:
java.io.FileNotFoundException: C:\geonetwork\docs\build.xml (The system
cannot f
ind the file specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at
org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:
268)
        at
org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:
177)
        at
org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.jav
a:82)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:393)
        at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
        at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
        at org.apache.tools.ant.Main.runBuild(Main.java:801)
        at org.apache.tools.ant.Main.startAnt(Main.java:218)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

If i comment that line, i get this error:

BUILD FAILED
C:\geonetwork\installer\build.xml:148: Basedir C:\geonetwork\geoserver does
not
exist

What can i do to compile the installer?
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Add-a-new-Stylesheet-transformation-tp5483549p5526409.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

2010/9/13 vmag <1050569@anonymised.com>:

Hi!

I can't run ant on the docs folder, because there isn't any build.xml on
that folder. The one that appears on my error, it's because i copied the
build.xml to the docs folder.

The first error that appears when i run ant on the installer folder is:

BUILD FAILED
C:\geonetwork\installer\build.xml:104: Warning: Could not find file
C:\geonetwor
k\docs\readme.html to copy.

So i copied the docs folder from C:\geonetwork\web\geonetwork\ to
C:\geonetwork\ and tried to run ant again, but got an error again:

BUILD FAILED
C:\geonetwork\installer\build.xml:146: The following error occurred while
execut
ing this line:
java.io.FileNotFoundException: C:\geonetwork\docs\build.xml (The system
cannot f
ind the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at
org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:
268)
at
org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:
177)
at
org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.jav
a:82)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:393)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
at org.apache.tools.ant.Main.runBuild(Main.java:801)
at org.apache.tools.ant.Main.startAnt(Main.java:218)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

If i comment that line, i get this error:

BUILD FAILED
C:\geonetwork\installer\build.xml:148: Basedir C:\geonetwork\geoserver does
not
exist

What can i do to compile the installer?

Probably use 2.4.3 svn tag [1] if you're not.

HTH.

Francois

[1] https://geonetwork.svn.sourceforge.net/svnroot/geonetwork/tags/2.4.3/

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Add-a-new-Stylesheet-transformation-tp5483549p5526409.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
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