Integration of custom plugin

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Integration of custom plugin

Giovanni Virdis
Good morning Sergio,

In order:

I have create the jar for my exstension (RitecoITExtension.jar)and i put it into the directory \bin\ext of my Kosmo  installation.

In the /bin directory I have create the file workbench-properties.xml with this code:
<workbench>    
<plug-in>it.riteco.sassari.nuovoElemento.NuovoElementoPlugIn</plug-in>                                                                                                  
</workbench>

I change the Kosmo.bat with the -properties
SET PATH=..\dlls;%PATH%
start .\jre\bin\javaw -Djava.library.path="..\dlls" -cp .;./RitecoITExtension.jar;./saig.jar -Xmx512M com.vividsolutions.jump.workbench.JUMPWorkbench -plug-in-directory ./ext -properties "workbench-properties.xml"

but when I run the application I have the error when find to load the plugin.
I don't understand the last step

" On Kosmo loading the initialize() method for the myCustomPlugIn will be
called. Inside this method you should put all the stuff needed for your
plugin to be started (add it to a toolbar, create a new toolbar, add it
to a menu, create a new main menu, ...)"

If is possible I want create an exe that install kosmo on pc with my plug in and my project just loading on start. I must work with the folder relative of the installaztion the kosmo on my machine or I must work with the project on eclipse.

Thanks

Regards,

Giovanni



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

Message: 1
Date: Mon, 04 May 2009 10:40:01 +0200
From: Sergio Ba?os Calvo <[hidden email]>
Subject: Re: [Kosmo_int] customize kosmo
To: "International Kosmo mailing list (english languaje)"
        <[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Good morning Giovanni.

In order to incorporate your changes to Kosmo, you only have to create
the jar for your extension and put it into the directory \bin\ext for
your Kosmo installation. If you want the extension to be activated by
default you should start your Kosmo version, activate the extension,
mark the option "Mark as default" and exit the application. Kosmo will
load by default the new extensions in sucesive executions (the options
are saved into the workbench-state.xml file).

There is also another option that can be used to load a plugin without
the needing of activate it by default. The -properties options allow to
load a custom XML file that enumerates a group of plugins that must be
loaded on startup. You must change the Kosmo.bat file in order to use
it, adding the -properties option:

-- Example of Kosmo.bat

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


-- Example of worbench-properties.xml, that should be place into the
directory \bin

<workbench>
  <plug-in>org.saig.jump.plugin.custom.myCustomPlugIn</plug-in>
</workbench>

On Kosmo loading the initialize() method for the myCustomPlugIn will be
called. Inside this method you should put all the stuff needed for your
plugin to be started (add it to a toolbar, create a new toolbar, add it
to a menu, create a new main menu, ...).

Regards,

Giovanni Virdis escribió:

>
> Hi,
>
>  
>
> If is possibile i want create a my kosmo . I explain better . I want
> create a new jar that executes kosmo modified with my exstension , and
> with my project already open when start kosmo. The users  lunch kosmo
> and they can use it as a normal kosmo but they have a new function
> that I have implemented for a specific scope.
>
>  
>
> How I can do?
>
>  
>
>  
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Kosmo_int mailing list
> [hidden email]
> http://lists.saig.es/mailman/listinfo/kosmo_int
>  

--

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: [hidden email]



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

Message: 2
Date: Mon, 04 May 2009 10:41:10 +0200
From: Sergio Ba?os Calvo <[hidden email]>
Subject: Re: [Kosmo_int] Connector for Spatialite
To: "International Kosmo mailing list (english languaje)"
        <[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Good morning, V Ramachandran.

The SpatialLite connector is planned to be developed but it haven't been
started yet.

Regards,

V Ramachandran escribió:
> Hi,
>
> I would like to know is there any connector available (or under
> development) for kosmo accessing tables from SpatiaLite?
>

--

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: [hidden email]



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

Message: 3
Date: Mon, 04 May 2009 10:43:42 +0200
From: Sergio Ba?os Calvo <[hidden email]>
Subject: Re: [Kosmo_int] customize kosmo
To: "International Kosmo mailing list (english languaje)"
        <[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Good morning Dragan.

Have you added the META-INF/MANIFEST.MF correctly to the saig.jar file?
If I can remember correctly, when you use the Eclipse export wizard you
have some options about it, and one of them is "Use an existent
manifest.mf file". Open your saig.jar file and revise if the MANIFEST.MF
file has been correctly defined or not.

Regards,

Dragan Podvezanec escribió:

>
> Giovanni Virdis wrote:
>  
>> Hi,
>>
>>  
>>
>> If is possibile i want create a my kosmo .I explain better . I want
>> create a new jar that executes kosmo modified with my exstension , and
>> with my project already open when start kosmo. The users  lunch kosmo
>> and they can use it as a normal kosmo but they have a new function that
>> I have implemented for a specific scope.
>>
>>  
>>
>> How I can do?
>>
>>  
>>
>>
>>    
>
> We have similar problem:
>
> I don't know how to export properly saig.jar from Eclipse: I went to File >
> Export > Java > JAR File. There are some minor errors, but export gets done.
> After that I changed original saig.jar with my exported .jar, but I can't
> launch Kosmo, because it says it cannot find main class, although I used
> same .bat as Kosmo.
>
> So , can authors guide us how to properly export custom .jar?
>
> Regards,
> Dragan
>
>
>
>  

--

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: [hidden email]



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

_______________________________________________
Kosmo_int mailing list
[hidden email]
http://lists.saig.es/mailman/listinfo/kosmo_int


End of Kosmo_int Digest, Vol 24, Issue 2
****************************************


_______________________________________________
Kosmo_int mailing list
[hidden email]
http://lists.saig.es/mailman/listinfo/kosmo_int
Reply | Threaded
Open this post in threaded view
|

Re: Integration of custom plugin

Sergio Baños Calvo
Good morning Giovanni.

In respect of the your custom extension:

1) In order to incorporate new functionalities to Kosmo - Desktop Client
you have two options: create an Extension class that performs the
loading of your plugins, or instantiate your own plugin, by calling it
through the workbench-properties file or by changing the
JUMPConfiguration class file.

    a) For the first option, you have to include your jar into the /ext
directory and the user will have the possibity to activate it or not
    b) For the second one, you have to setup it as you have done, but,
the RitecoITExtension.jar must be placed at the \bin directory, as you
have defined in your Kosmo.bat (./RitecoITExtension.jar)

2) The last step could be explained better through an example. Look at
the geoprocessing wizard extension:

      /**
     * Loads the geoprocessing wizard plugin
     */
    public void install( PlugInContext context ) throws Exception {
        if(this.geoprocessingWizardPlugIn == null)
        {
            this.geoprocessingWizardPlugIn = new
GeoprocessingWizardPlugIn();
        }
        this.geoprocessingWizardPlugIn.initialize(context);
    }

    In this class the associated plugin is called in the extension
install method.

    If you take a look into the GeoprocessingWizardPlugIn you can see
the next:

    @Override
    public void initialize( PlugInContext context ) throws Exception
{      
        context.getFeatureInstaller().addMainMenuItem(this,
                menuPath, getName()/*+ "{pos:5}"*/, false, getIcon(),
//$NON-NLS-1$
               
GeoprocessingWizardPlugIn.createEnableCheck(context.getWorkbenchContext()));
    }

    It adds itself to the Tools main menu, at the 5th position. If you
use the 2nd approach, the initialize() method is called directly during
the workbench-properties.xml processing, while if you load it through an
extension, it will be called at the install method.


3) Yes, it's posible to do it. We use Izpack (http://izpack.org) to
create the java installer and make a launch4j exe wrapper
(http://launch4j.sourceforge.net) around it to launch the installation.
The Kosmo.bat file can be changed to load a project at startup by adding
the parameter -proj sprFileName.spr to it. If you need more information
about any of them just ask and we'll help you as far as we can

Regards,


Giovanni Virdis escribió:

> Good morning Sergio,
>
> In order:
>
> I have create the jar for my exstension (RitecoITExtension.jar)and i put it into the directory \bin\ext of my Kosmo  installation.
>
> In the /bin directory I have create the file workbench-properties.xml with this code:
> <workbench>    
> <plug-in>it.riteco.sassari.nuovoElemento.NuovoElementoPlugIn</plug-in>                                                                                                  
> </workbench>
>
> I change the Kosmo.bat with the -properties
> SET PATH=..\dlls;%PATH%
> start .\jre\bin\javaw -Djava.library.path="..\dlls" -cp .;./RitecoITExtension.jar;./saig.jar -Xmx512M com.vividsolutions.jump.workbench.JUMPWorkbench -plug-in-directory ./ext -properties "workbench-properties.xml"
>
> but when I run the application I have the error when find to load the plugin.
> I don't understand the last step
>
> " On Kosmo loading the initialize() method for the myCustomPlugIn will be
> called. Inside this method you should put all the stuff needed for your
> plugin to be started (add it to a toolbar, create a new toolbar, add it
> to a menu, create a new main menu, ...)"
>
> If is possible I want create an exe that install kosmo on pc with my plug in and my project just loading on start. I must work with the folder relative of the installaztion the kosmo on my machine or I must work with the project on eclipse.
>
> Thanks
>
> Regards,
>
> Giovanni
>
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 04 May 2009 10:40:01 +0200
> From: Sergio Ba?os Calvo <[hidden email]>
> Subject: Re: [Kosmo_int] customize kosmo
> To: "International Kosmo mailing list (english languaje)"
> <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Good morning Giovanni.
>
> In order to incorporate your changes to Kosmo, you only have to create
> the jar for your extension and put it into the directory \bin\ext for
> your Kosmo installation. If you want the extension to be activated by
> default you should start your Kosmo version, activate the extension,
> mark the option "Mark as default" and exit the application. Kosmo will
> load by default the new extensions in sucesive executions (the options
> are saved into the workbench-state.xml file).
>
> There is also another option that can be used to load a plugin without
> the needing of activate it by default. The -properties options allow to
> load a custom XML file that enumerates a group of plugins that must be
> loaded on startup. You must change the Kosmo.bat file in order to use
> it, adding the -properties option:
>
> -- Example of Kosmo.bat
>
> SET PATH=..\dlls;%PATH%
> start.\jre\bin\javaw -Djava.library.path="..\dlls;" -cp
> .;./customExtension.jar;./saig.jar -Xmx800M
> com.vividsolutions.jump.workbench.JUMPWorkbench -plug-in-directory ./ext
> -properties "workbench-properties.xml"
>
>
> -- Example of worbench-properties.xml, that should be place into the
> directory \bin
>
> <workbench>
>   <plug-in>org.saig.jump.plugin.custom.myCustomPlugIn</plug-in>
> </workbench>
>
> On Kosmo loading the initialize() method for the myCustomPlugIn will be
> called. Inside this method you should put all the stuff needed for your
> plugin to be started (add it to a toolbar, create a new toolbar, add it
> to a menu, create a new main menu, ...).
>
> Regards,
>
> Giovanni Virdis escribió:
>  
>> Hi,
>>
>>  
>>
>> If is possibile i want create a my kosmo . I explain better . I want
>> create a new jar that executes kosmo modified with my exstension , and
>> with my project already open when start kosmo. The users  lunch kosmo
>> and they can use it as a normal kosmo but they have a new function
>> that I have implemented for a specific scope.
>>
>>  
>>
>> How I can do?
>>
>>  
>>
>>  
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Kosmo_int mailing list
>> [hidden email]
>> http://lists.saig.es/mailman/listinfo/kosmo_int
>>  
>>    
>
>  

--

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: [hidden email]

_______________________________________________
Kosmo_int mailing list
[hidden email]
http://lists.saig.es/mailman/listinfo/kosmo_int