Good morning Giovanni.

I think this is a problem from the development framework (Eclipse?). If this is the case, you should check your classpath for the run configuration and put your "Configurazione.jar" before the saig-core classes. Look at the example at the attached image. I think that the -cp option won't be useful in this case.

Regards,

PD: Giovanni, please use a more accurate Subject in the mail in order to help the other users to identify the mail better.

Giovanni Virdis escribió:
Hi Sergio,

In order :


- I have created a new project (Configurazione --> name of project). This is the organization of the folder: -Configurazione ----bin
  ----Src
        ----com
            ----vividsolutions
              ---------------jump
                                ----workbench
                                            ---------JUMPConfiguration.java
(J:\Sorgenti_Kosmo\Lavoro\Configurazione\src\com\vividsolutions\jump\workbench).
This is the content of the file JUMPConfiguration.java

******************************************************************
package com.vividsolutions.jump.workbench;

import java.lang.reflect.Field;

import com.vividsolutions.jts.util.Assert;
import com.vividsolutions.jump.workbench.plugin.PlugIn;
import com.vividsolutions.jump.workbench.plugin.PlugInContext;

/**
 * @author giovanni
 *
 */
public class JUMPConfiguration {
        
        
        
        
    private void initializeExternalPlugIns( WorkbenchContext workbenchContext ) 
throws Exception {
        workbenchContext.getWorkbench().getPlugInManager().load();
    }

private void initializeInternalPlugIns( WorkbenchContext workbenchContext ) throws Exception {

        Field[] fields = getClass().getDeclaredFields();

        for( int i = 0; i < fields.length; i++ ) {
            Object field = null;

            try {
                field = fields[i].get(this);
            } catch (IllegalAccessException e) {
                Assert.shouldNeverReachHere();
            }

            if (!(field instanceof PlugIn)) {
                continue;
            }

            PlugIn plugIn = (PlugIn) field;
            plugIn.initialize(new PlugInContext(workbenchContext, null, null, 
null, null));
        }
    }

}       
****************************************************************************

I have create a jar file Configurazione.jar and I have set up the value of "VM 
arguments" of the project extension :
***********************

-cp "J:\Sorgenti_Kosmo\Lavoro\extensiones\Configurazione.jar"
-Xmx1024M -Djava.library.path="J:\Sorgenti_Kosmo\Lavoro\libs\dlls"

***********************

A you can see in my class JUMPConfiguration I have implemented only the method for initialize the internal and external plugin. I expected that kosmo visualized only my external plugin and did not load nothing other, instead when kosmo load all botton and menu it wants to say that it uses its JUMPConfiguration class.
Where I am mistaking?

Thanks for the help

Giovanni





-----Messaggio originale-----
Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Per conto di [EMAIL PROTECTED]
Inviato: mercoledì 7 maggio 2008 12.01
A: [email protected]
Oggetto: Resumen de Kosmo, Vol 25, Envío 7

Envie los mensajes para la lista Kosmo a
        [email protected]

Para subscribirse o anular su subscripción a través de WEB
        http://lists.saig.es/mailman/listinfo/kosmo

O por correo electrónico, enviando un mensaje con el texto "help" en
el asunto (subject) o en el cuerpo a:
        [EMAIL PROTECTED]

Puede contactar con el responsable de la lista escribiendo a:
        [EMAIL PROTECTED]

Si responde a algún contenido de este mensaje, por favor, edite la
linea del asunto (subject) para que el texto sea mas especifico que:
"Re: Contents of Kosmo digest...". Ademas, por favor, incluya en la
respuesta solo aquellas partes del mensaje a las que esta
respondiendo.


Asuntos del día:

   1. R: Resumen de Kosmo, Vol 25, Envío 6 (Giovanni Virdis)
   2. Re: R: Resumen de Kosmo, Vol 25, Envío 6 ( Extension)
      (Sergio Baños Calvo)


----------------------------------------------------------------------

Message: 1
Date: Tue, 6 May 2008 14:08:35 +0200
From: "Giovanni Virdis" <[EMAIL PROTECTED]>
Subject: [Kosmo] R: Resumen de Kosmo, Vol 25, Envío 6
To: <[email protected]>
Message-ID:
        <[EMAIL PROTECTED]>
Content-Type: text/plain;       charset="iso-8859-1"

Hi Sergio,

thanks for your fastest replay. I have another question:

You say that another possibility it's to add an additional .jar to the distribution that contains the modified classes. I must create a new jar that contains only the class that extends a JUMPConfiguration class? I would have to create a new project with one single class and after create a jar file?
How I can do?

Thanks Giovanni


-----Messaggio originale-----
Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Per conto di [EMAIL PROTECTED]
Inviato: martedì 6 maggio 2008 12.15
A: [email protected]
Oggetto: Resumen de Kosmo, Vol 25, Envío 6

Envie los mensajes para la lista Kosmo a
        [email protected]

Para subscribirse o anular su subscripción a través de WEB
        http://lists.saig.es/mailman/listinfo/kosmo

O por correo electrónico, enviando un mensaje con el texto "help" en
el asunto (subject) o en el cuerpo a:
        [EMAIL PROTECTED]

Puede contactar con el responsable de la lista escribiendo a:
        [EMAIL PROTECTED]

Si responde a algún contenido de este mensaje, por favor, edite la
linea del asunto (subject) para que el texto sea mas especifico que:
"Re: Contents of Kosmo digest...". Ademas, por favor, incluya en la
respuesta solo aquellas partes del mensaje a las que esta
respondiendo.


Asuntos del día:

   1. Re: Extension (Sergio Baños Calvo)
   2. Re: sobre cr (Giuseppe Aruta)


----------------------------------------------------------------------

Message: 1
Date: Tue, 06 May 2008 11:32:33 +0200
From: Sergio Baños Calvo <[EMAIL PROTECTED]>
Subject: Re: [Kosmo] Extension
To: Lista de Kosmo <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=windows-1252; format=flowed

Good morning, Giovanni.

The extension mechanism that is implemented in Kosmo allows to incorporate new functionalities to the core base, but it can't replace the funcionality that is already present at core without modifying it (in general). You can modify the JUMPConfiguration class and change the tools that are loaded into the program by modifying its contents.

Another possibility that we have used in some projects it's to add an additional .jar to the distribution that contains the modified classes (e.g.: the new JUMPConfiguration and your extending EditablePlugIn) and change the .bat/.sh launch file to take it into account. E.g.:

SET PATH=..\dlls;%PATH%
start.\jre\bin\javaw -Djava.library.path="..\dlls;" -cp .;./myclasses.jar;./saig.jar -Xmx800M com.vividsolutions.jump.workbench.JUMPWorkbench -plug-in-directory ./ext

Note that the myclasses.jar must be declared before the saig.jar to occult the common classes and use the defined at myclasses.jar.

Regards,

Giovanni Virdis escribió:
Good morning,

I have a question

I am working with kosmo and I have made some extension, but I have not understood if it is possible to manage kosmo without to modify the original project (saig-core) and only using the extensions. For example, I want to extends the class "EditablePlugIn" with my class, and I want that for some users it is not possible to execute the modification of the layer.

I must directly modify the class "EditablePlugIn "so as to inhibit its operations or I can make all by means of one my class?

If I succeed to manage all through the extensions also changing version of kosmo in future I must not have problems or mistake?

How I can add my class for the modification of the layer in the relative menu to the layer replacing the original class "EditablePlugIn" without to modify the code of the project (saig-core) ?

Thanks

Giovanni

------------------------------------------------------------------------

_______________________________________________
Kosmo mailing list
[email protected]
http://lists.saig.es/mailman/listinfo/kosmo


--

Sergio Baños Calvo

Jefe de desarrollos
Sistemas Abiertos de Información Geográfica, S.L. (SAIG S.L.)
Tlfno. móvil: 685005960
Tlfno. fijo: (+34) 954788876

E-mail: [EMAIL PROTECTED]

<<inline: 2008-05-08_084548.png>>

_______________________________________________
Kosmo mailing list
[email protected]
http://lists.saig.es/mailman/listinfo/kosmo

Responder a