[protege-owl] My new plugin isn't showed

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

[protege-owl] My new plugin isn't showed

Massimo Coletti
Hi,

I am sorry to repeat a recurring question, but I wasn't able to find a
resolutive answer in previous posts.

I have developed a tool to integrate Velocity in Protege, in order to
create reports from an ontology.
Now I would like to transform it in a plugin, in order to make it more
usable.

Following the documentation I have:
- created a jar velociowl.jar, and placed in a directory
plugins/net.mcoletti.protege.velocity
- the jar contains a manifest witht he content:

Manifest-Version: 1.0

Name: net/mcoletti/protege/velocity/VelocityTabWidget.class
Tab-Widget: True

(one white line before and after the plugin entry)

The directory contains also the velocity.jar library, and a
plugin.properties file with the content:
plugin.component.count=1
plugin.component.name.0=Velocity Tab
plugin.dependency.count=1
plugin.dependency.0=edu.stanford.smi.protegex.owl

The jar contains one class:

package net.mcoletti.protege.velocity;

public class VelocityTabWidget extends AbstractTabWidget {
...
...
    public void initialize() {
           // initialize the tab label
        setLabel("Velocity");
        setIcon(Icons.getQueryIcon());
        System.out.println(INIT_MESSAGE);
        field = new JTextField(10);
        field.setText("testo di prova");
        field.setEnabled(true);
        field.setHorizontalAlignment(SwingConstants.RIGHT);

        // add the components to the tab widget
        setLayout(new FlowLayout());
        add(field);
 
    }
       public static boolean isSuitable(Project project, Collection
errors) {
            return true;

So, I believe that the requirements are satisfied:
- the plugin class extends the proper Abstract plugin class
- initialize() and isSuitable() methods are implemented
- the jar is installed in a subdir of plugins directory
- the manifest entry matches the class name

When Protege starts, the console shows that my plugins is being loaded:

...
...
CONFIG: Loaded plugin JessTab - JessTab Plugin
CONFIG: Loaded plugin lu.tudor.citi.demoisel.docgen - docgen, docgen
export project, lu.tudor.citi.demoisel.docgen
CONFIG: Loaded plugin net.mcoletti.protege.velocity - Velocity
Tab        <=== MY PLUGIN
CONFIG: Loaded plugin org.algernon - Algernon
...
...

But the plugin isn't showed either in the Project->Configuration or in
the OWL preference -> Tabs


So, what's wrong???

Many thanks

Massimo

P.S. obviously, my plugin will be published!



This e-mail and any attachments may contain confidential and
privileged information. If you are not the intended recipient,
please notify the sender immediately by return e-mail, delete this
e-mail and destroy any copies. Any dissemination or use of this
information by a person other than the intended recipient is
unauthorized and may be illegal.
_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl
Reply | Threaded
Open this post in threaded view
|

Re: [protege-owl] My new plugin isn't showed

Papapanagiwtou Petros
The number 1 reason why the plugin wouldn't show in the list (even
though it appears to have been loaded the way you descibe) for me was
some error in the Manifest file.
The manifest file should exist within a "meta-inf" folder inside the jar
file and named "MANIFEST.MF". You can compare the structure with one of
the other default plugins (just open the respective jar file with a zip
program).
Its contents seem fine but its correct location is of equal importance!

The "CONFIG: Loaded plugin net.mcoletti.protege.velocity - Velocity Tab"
line only indicates that the plugin folder and plugin.properties file
(which is outside the jar file) have been located/parsed, NOT that the
plugin code has been loaded correctly. (You can verify that by actually
removing everything else except the folder itself and the
plugin.properties file! :P )

Note that if the plugin is loaded correctly but has errors in the code
it will appear at the bottom of the "Project->Configure" list in italics
(along with the tabs whose isSuitable method returned false) so you
might also want to double check it doesn't appear there - at the bottom.

I hope I've helped, cause really nothing else seems to be wrong!

Be well,
Papapanagiotou Petros

Massimo Coletti wrote:

> Hi,
>
> I am sorry to repeat a recurring question, but I wasn't able to find a
> resolutive answer in previous posts.
>
> I have developed a tool to integrate Velocity in Protege, in order to
> create reports from an ontology.
> Now I would like to transform it in a plugin, in order to make it more
> usable.
>
> Following the documentation I have:
> - created a jar velociowl.jar, and placed in a directory
> plugins/net.mcoletti.protege.velocity
> - the jar contains a manifest witht he content:
>
> Manifest-Version: 1.0
>
> Name: net/mcoletti/protege/velocity/VelocityTabWidget.class
> Tab-Widget: True
>
> (one white line before and after the plugin entry)
>
> The directory contains also the velocity.jar library, and a
> plugin.properties file with the content:
> plugin.component.count=1
> plugin.component.name.0=Velocity Tab
> plugin.dependency.count=1
> plugin.dependency.0=edu.stanford.smi.protegex.owl
>
> The jar contains one class:
>
> package net.mcoletti.protege.velocity;
>
> public class VelocityTabWidget extends AbstractTabWidget {
> ...
> ...
>     public void initialize() {
>            // initialize the tab label
>         setLabel("Velocity");
>         setIcon(Icons.getQueryIcon());
>         System.out.println(INIT_MESSAGE);
>         field = new JTextField(10);
>         field.setText("testo di prova");
>         field.setEnabled(true);
>         field.setHorizontalAlignment(SwingConstants.RIGHT);
>
>         // add the components to the tab widget
>         setLayout(new FlowLayout());
>         add(field);
>  
>     }
>        public static boolean isSuitable(Project project, Collection
> errors) {
>             return true;
>
> So, I believe that the requirements are satisfied:
> - the plugin class extends the proper Abstract plugin class
> - initialize() and isSuitable() methods are implemented
> - the jar is installed in a subdir of plugins directory
> - the manifest entry matches the class name
>
> When Protege starts, the console shows that my plugins is being loaded:
>
> ...
> ...
> CONFIG: Loaded plugin JessTab - JessTab Plugin
> CONFIG: Loaded plugin lu.tudor.citi.demoisel.docgen - docgen, docgen
> export project, lu.tudor.citi.demoisel.docgen
> CONFIG: Loaded plugin net.mcoletti.protege.velocity - Velocity
> Tab        <=== MY PLUGIN
> CONFIG: Loaded plugin org.algernon - Algernon
> ...
> ...
>
> But the plugin isn't showed either in the Project->Configuration or in
> the OWL preference -> Tabs
>
>
> So, what's wrong???
>
> Many thanks
>
> Massimo
>
> P.S. obviously, my plugin will be published!
>
>
>
> This e-mail and any attachments may contain confidential and
> privileged information. If you are not the intended recipient,
> please notify the sender immediately by return e-mail, delete this
> e-mail and destroy any copies. Any dissemination or use of this
> information by a person other than the intended recipient is
> unauthorized and may be illegal.
> _______________________________________________
> protege-owl mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
>  
_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl
Reply | Threaded
Open this post in threaded view
|

Re: [protege-owl] My new plugin isn't showed

Massimo Coletti
Petros,

many thanks for your reply. I have already spent some hours checking all
the documentation, and the config. of the other plugins, trying to
figure out what is wrong.
I really believe that is a situation where a "macroscopic" error is
invisible to me, and may appear evident to someone else. I have already
checked what you are suggesting.

Cheers,

Massimo

Papapanagiotou Petros ha scritto:
> The number 1 reason why the plugin wouldn't show in the list (even
> though it appears to have been loaded the way you descibe) for me was
> some error in the Manifest file.
>  
The full plugin directory path is the following:
C:\programmi\Protege_3.2_beta\plugins\net.mcoletti.protege.velocity

This dir contains two jars: one is velocity.jar, the standard
deliverable by Apache Foundation, and velociowl.jar, created with the
jar packager of Eclipse. The second jar contains a META-INF directory
(along with the .class directory tree.
The META-INF dir contains just the MANIFEST.MF file: I have copied the
manifest content in my original message.
The path:
C:\programmi\Protege_3.2_beta\plugins\net.mcoletti.protege.velocity\velociowl.jar\net\mcoletti\protege\velocity\
contains the VelocityTabWidget.class file.
> The manifest file should exist within a "meta-inf" folder inside the jar
> file and named "MANIFEST.MF". You can compare the structure with one of
> the other default plugins (just open the respective jar file with a zip
> program).
> Its contents seem fine but its correct location is of equal importance!
>  
I have also noticed that the developer documentation instruct to code
the class name separating the package path with forward slashes, and
reporting the class name including the .class suffix, while most plugins
report the dot-separated name of the class, without the .class suffix.
I have tried both configuration, without any noticeable difference.

> The "CONFIG: Loaded plugin net.mcoletti.protege.velocity - Velocity Tab"
> line only indicates that the plugin folder and plugin.properties file
> (which is outside the jar file) have been located/parsed, NOT that the
> plugin code has been loaded correctly. (You can verify that by actually
> removing everything else except the folder itself and the
> plugin.properties file! :P )
>
> Note that if the plugin is loaded correctly but has errors in the code
> it will appear at the bottom of the "Project->Configure" list in italics
> (along with the tabs whose isSuitable method returned false) so you
> might also want to double check it doesn't appear there - at the bottom.
>  
Unfortunately, the plugin isn't listed at all.

> I hope I've helped, cause really nothing else seems to be wrong!
>
> Be well,
> Papapanagiotou Petros
>
> Massimo Coletti wrote:
>  
>> Hi,
>>
>> I am sorry to repeat a recurring question, but I wasn't able to find a
>> resolutive answer in previous posts.
>>
>> I have developed a tool to integrate Velocity in Protege, in order to
>> create reports from an ontology.
>> Now I would like to transform it in a plugin, in order to make it more
>> usable.
>>
>> Following the documentation I have:
>> - created a jar velociowl.jar, and placed in a directory
>> plugins/net.mcoletti.protege.velocity
>> - the jar contains a manifest witht he content:
>>
>> Manifest-Version: 1.0
>>
>> Name: net/mcoletti/protege/velocity/VelocityTabWidget.class
>> Tab-Widget: True
>>
>> (one white line before and after the plugin entry)
>>
>> The directory contains also the velocity.jar library, and a
>> plugin.properties file with the content:
>> plugin.component.count=1
>> plugin.component.name.0=Velocity Tab
>> plugin.dependency.count=1
>> plugin.dependency.0=edu.stanford.smi.protegex.owl
>>
>> The jar contains one class:
>>
>> package net.mcoletti.protege.velocity;
>>
>> public class VelocityTabWidget extends AbstractTabWidget {
>> ...
>> ...
>>     public void initialize() {
>>            // initialize the tab label
>>         setLabel("Velocity");
>>         setIcon(Icons.getQueryIcon());
>>         System.out.println(INIT_MESSAGE);
>>         field = new JTextField(10);
>>         field.setText("testo di prova");
>>         field.setEnabled(true);
>>         field.setHorizontalAlignment(SwingConstants.RIGHT);
>>
>>         // add the components to the tab widget
>>         setLayout(new FlowLayout());
>>         add(field);
>>  
>>     }
>>        public static boolean isSuitable(Project project, Collection
>> errors) {
>>             return true;
>>
>> So, I believe that the requirements are satisfied:
>> - the plugin class extends the proper Abstract plugin class
>> - initialize() and isSuitable() methods are implemented
>> - the jar is installed in a subdir of plugins directory
>> - the manifest entry matches the class name
>>
>> When Protege starts, the console shows that my plugins is being loaded:
>>
>> ...
>> ...
>> CONFIG: Loaded plugin JessTab - JessTab Plugin
>> CONFIG: Loaded plugin lu.tudor.citi.demoisel.docgen - docgen, docgen
>> export project, lu.tudor.citi.demoisel.docgen
>> CONFIG: Loaded plugin net.mcoletti.protege.velocity - Velocity
>> Tab        <=== MY PLUGIN
>> CONFIG: Loaded plugin org.algernon - Algernon
>> ...
>> ...
>>
>> But the plugin isn't showed either in the Project->Configuration or in
>> the OWL preference -> Tabs
>>
>>
>> So, what's wrong???
>>
>> Many thanks
>>
>> Massimo
>>
>> P.S. obviously, my plugin will be published!
>>
>>
>>
>> This e-mail and any attachments may contain confidential and
>> privileged information. If you are not the intended recipient,
>> please notify the sender immediately by return e-mail, delete this
>> e-mail and destroy any copies. Any dissemination or use of this
>> information by a person other than the intended recipient is
>> unauthorized and may be illegal.
>> _______________________________________________
>> protege-owl mailing list
>> [hidden email]
>> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>
>>  
>>    
> _______________________________________________
> protege-owl mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>  



This e-mail and any attachments may contain confidential and
privileged information. If you are not the intended recipient,
please notify the sender immediately by return e-mail, delete this
e-mail and destroy any copies. Any dissemination or use of this
information by a person other than the intended recipient is
unauthorized and may be illegal.
_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl
Reply | Threaded
Open this post in threaded view
|

Re: [protege-owl] My new plugin isn't showed

Massimo Coletti
In reply to this post by Massimo Coletti
For anyone interested, I found the bug!

The problem was in the manifest file (as correctly suggested by Petros).
The line preceding the plugin name, was blank, but - for Protege - it
should be "empty", while it was filled with two blank characters.
Removing the blanks, and leaving only a CR, the problem was fixed.

Thanks again to Petros.

Massimo

Massimo Coletti ha scritto:

> Hi,
>
> I am sorry to repeat a recurring question, but I wasn't able to find a
> resolutive answer in previous posts.
>
> I have developed a tool to integrate Velocity in Protege, in order to
> create reports from an ontology.
> Now I would like to transform it in a plugin, in order to make it more
> usable.
>
> Following the documentation I have:
> - created a jar velociowl.jar, and placed in a directory
> plugins/net.mcoletti.protege.velocity
> - the jar contains a manifest witht he content:
>
> Manifest-Version: 1.0
>
> Name: net/mcoletti/protege/velocity/VelocityTabWidget.class
> Tab-Widget: True
>
> (one white line before and after the plugin entry)
>
> The directory contains also the velocity.jar library, and a
> plugin.properties file with the content:
> plugin.component.count=1
> plugin.component.name.0=Velocity Tab
> plugin.dependency.count=1
> plugin.dependency.0=edu.stanford.smi.protegex.owl
>
> The jar contains one class:
>
> package net.mcoletti.protege.velocity;
>
> public class VelocityTabWidget extends AbstractTabWidget {
> ...
> ...
>     public void initialize() {
>            // initialize the tab label
>         setLabel("Velocity");
>         setIcon(Icons.getQueryIcon());
>         System.out.println(INIT_MESSAGE);
>         field = new JTextField(10);
>         field.setText("testo di prova");
>         field.setEnabled(true);
>         field.setHorizontalAlignment(SwingConstants.RIGHT);
>
>         // add the components to the tab widget
>         setLayout(new FlowLayout());
>         add(field);
>  
>     }
>        public static boolean isSuitable(Project project, Collection
> errors) {
>             return true;
>
> So, I believe that the requirements are satisfied:
> - the plugin class extends the proper Abstract plugin class
> - initialize() and isSuitable() methods are implemented
> - the jar is installed in a subdir of plugins directory
> - the manifest entry matches the class name
>
> When Protege starts, the console shows that my plugins is being loaded:
>
> ...
> ...
> CONFIG: Loaded plugin JessTab - JessTab Plugin
> CONFIG: Loaded plugin lu.tudor.citi.demoisel.docgen - docgen, docgen
> export project, lu.tudor.citi.demoisel.docgen
> CONFIG: Loaded plugin net.mcoletti.protege.velocity - Velocity
> Tab        <=== MY PLUGIN
> CONFIG: Loaded plugin org.algernon - Algernon
> ...
> ...
>
> But the plugin isn't showed either in the Project->Configuration or in
> the OWL preference -> Tabs
>
>
> So, what's wrong???
>
> Many thanks
>
> Massimo
>
> P.S. obviously, my plugin will be published!
>
>
>
> This e-mail and any attachments may contain confidential and
> privileged information. If you are not the intended recipient,
> please notify the sender immediately by return e-mail, delete this
> e-mail and destroy any copies. Any dissemination or use of this
> information by a person other than the intended recipient is
> unauthorized and may be illegal.
> _______________________________________________
> protege-owl mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>  



This e-mail and any attachments may contain confidential and
privileged information. If you are not the intended recipient,
please notify the sender immediately by return e-mail, delete this
e-mail and destroy any copies. Any dissemination or use of this
information by a person other than the intended recipient is
unauthorized and may be illegal.
_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl
Reply | Threaded
Open this post in threaded view
|

Re: [protege-owl] My new plugin isn't showed

Papapanagiwtou Petros
Glad I could help even in such an indirect way.
Having to deal with such subtle errors is really frustrating!

Good luck with the rest!
Petros

Massimo Coletti wrote:

> For anyone interested, I found the bug!
>
> The problem was in the manifest file (as correctly suggested by Petros).
> The line preceding the plugin name, was blank, but - for Protege - it
> should be "empty", while it was filled with two blank characters.
> Removing the blanks, and leaving only a CR, the problem was fixed.
>
> Thanks again to Petros.
>
> Massimo
>
> Massimo Coletti ha scritto:
>  
>> Hi,
>>
>> I am sorry to repeat a recurring question, but I wasn't able to find a
>> resolutive answer in previous posts.
>>
>> I have developed a tool to integrate Velocity in Protege, in order to
>> create reports from an ontology.
>> Now I would like to transform it in a plugin, in order to make it more
>> usable.
>>
>> Following the documentation I have:
>> - created a jar velociowl.jar, and placed in a directory
>> plugins/net.mcoletti.protege.velocity
>> - the jar contains a manifest witht he content:
>>
>> Manifest-Version: 1.0
>>
>> Name: net/mcoletti/protege/velocity/VelocityTabWidget.class
>> Tab-Widget: True
>>
>> (one white line before and after the plugin entry)
>>
>> The directory contains also the velocity.jar library, and a
>> plugin.properties file with the content:
>> plugin.component.count=1
>> plugin.component.name.0=Velocity Tab
>> plugin.dependency.count=1
>> plugin.dependency.0=edu.stanford.smi.protegex.owl
>>
>> The jar contains one class:
>>
>> package net.mcoletti.protege.velocity;
>>
>> public class VelocityTabWidget extends AbstractTabWidget {
>> ...
>> ...
>>     public void initialize() {
>>            // initialize the tab label
>>         setLabel("Velocity");
>>         setIcon(Icons.getQueryIcon());
>>         System.out.println(INIT_MESSAGE);
>>         field = new JTextField(10);
>>         field.setText("testo di prova");
>>         field.setEnabled(true);
>>         field.setHorizontalAlignment(SwingConstants.RIGHT);
>>
>>         // add the components to the tab widget
>>         setLayout(new FlowLayout());
>>         add(field);
>>  
>>     }
>>        public static boolean isSuitable(Project project, Collection
>> errors) {
>>             return true;
>>
>> So, I believe that the requirements are satisfied:
>> - the plugin class extends the proper Abstract plugin class
>> - initialize() and isSuitable() methods are implemented
>> - the jar is installed in a subdir of plugins directory
>> - the manifest entry matches the class name
>>
>> When Protege starts, the console shows that my plugins is being loaded:
>>
>> ...
>> ...
>> CONFIG: Loaded plugin JessTab - JessTab Plugin
>> CONFIG: Loaded plugin lu.tudor.citi.demoisel.docgen - docgen, docgen
>> export project, lu.tudor.citi.demoisel.docgen
>> CONFIG: Loaded plugin net.mcoletti.protege.velocity - Velocity
>> Tab        <=== MY PLUGIN
>> CONFIG: Loaded plugin org.algernon - Algernon
>> ...
>> ...
>>
>> But the plugin isn't showed either in the Project->Configuration or in
>> the OWL preference -> Tabs
>>
>>
>> So, what's wrong???
>>
>> Many thanks
>>
>> Massimo
>>
>> P.S. obviously, my plugin will be published!
>>
>>
>>
>> This e-mail and any attachments may contain confidential and
>> privileged information. If you are not the intended recipient,
>> please notify the sender immediately by return e-mail, delete this
>> e-mail and destroy any copies. Any dissemination or use of this
>> information by a person other than the intended recipient is
>> unauthorized and may be illegal.
>> _______________________________________________
>> protege-owl mailing list
>> [hidden email]
>> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>    
_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl