I am unable to verify my plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

I am unable to verify my plugin

Peter Cheung
The tutorial on web teach me to click "Install/Reload in Development plugin" to debug. This step work perfectly, but when I pack my plugin into NBM and submit to plugin central. It either said, I use hard dependency so don't let me verify OR the plugin crash, can't load the BookmarkList class (https://github.com/mcheung63/netbeans-minimap/issues/8) . I am sure this bug exist because I installed a clean netbeans in VM to test my plugin.

All I want to do is read out the bookmarks line numbers, so I have to use "org-netbeans-modules-editor-bookmarks", but just can't make it works.

Steps to produce:
1) git clone https://github.com/mcheung63/netbeans-minimap.git
2) right click project, click "clean and build", it should success
3) click "Install/Reload in Development plugin" OR "Run project", it said "NetBeans: Error redeploying NBM module in development IDE."

Below are the code I read out bookmark information

Code:
       
BookmarkList bookmarkList = (BookmarkList) document.getProperty(BookmarkList.class);
isBookmarkLine(bookmarkList, 1);

boolean isBookmarkLine(BookmarkList bookmarkList, int lineNo) {
                if (bookmarkList == null) {
                        return false;
                }
                for (Bookmark bookmark : bookmarkList.getBookmarks()) {
                        if (bookmark.getLineNumber() == lineNo) {
                                return true;
                        }
                }
                return false;
        }



Thanks
Peter




Reply | Threaded
Open this post in threaded view
|

Re: I am unable to verify my plugin

geertjan.wielenga@oracle.com


On 15-4-2017 18:10, mcheung63 wrote:
> The tutorial on web teach me to click "Install/Reload in Development plugin" to debug.

You don't need to do that at all to debug. You can deploy your plugin
from NetBeans to a fresh instance of NetBeans, i.e., right-click the
project and click Run.


>   This step work perfectly,

But in the previous e-mail, you said that you get the error message
"NetBeans: Error redeploying NBM module in development IDE." when you
click "Install/Reload in Development IDE".

So, how can it work perfectly?

And, you really don't need to install any plugin via "Install/Reload in
Development IDE". Just right-click, choose Run, and a new instance of
NetBeans will start with your plugin installed into it and there you can
try it out (is that what you mean by "debug")?

I don't understand. Too many questions.

Gj

>   but when I pack my plugin into NBM and submit to plugin central. It either said, I use hard dependency so don't let me verify OR the plugin crash, can't load the BookmarkList class (https://github.com/mcheung63/netbeans-minimap/issues/8) . I am sure this bug exist because I installed a clean netbeans in VM to test my plugin.
>
> All I want to do is read out the bookmarks line numbers, so I have to use "org-netbeans-modules-editor-bookmarks", but just can't make it works.
>
> Steps to produce:
> 1) git clone https://github.com/mcheung63/netbeans-minimap.git
> 2) right click project, click "clean and build", it should success
> 3) click "Install/Reload in Development plugin" OR "Run project", it said "NetBeans: Error redeploying NBM module in development IDE."
>
> Below are the code I read out bookmark information
>
> Code:
>
> BookmarkList bookmarkList = (BookmarkList) document.getProperty(BookmarkList.class);
> isBookmarkLine(bookmarkList, 1);
>
> boolean isBookmarkLine(BookmarkList bookmarkList, int lineNo) {
> if (bookmarkList == null) {
> return false;
> }
> for (Bookmark bookmark : bookmarkList.getBookmarks()) {
> if (bookmark.getLineNumber() == lineNo) {
> return true;
> }
> }
> return false;
> }
>
>
>
> Thanks
> Peter
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: I am unable to verify my plugin

Peter Cheung

If I have this in pom.xml, "Install/Reload in dev" works, but plugin central said "Plugin has hard dependency to other modules defined in info.xml module descriptor, therefore can't be subject of verification"


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

</dependency>

</moduleDependencies>


If I have changed to this, plugin central won't complaint but "Install/Reload in dev" doesn't works


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue>  

</dependency>

</moduleDependencies>

!!! Click "run" is just same case.

Thanks, I know I am too disturb, sorry


From: geertjan wielenga <[hidden email]>
Sent: Sunday, April 16, 2017 12:20 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


On 15-4-2017 18:10, mcheung63 wrote:
> The tutorial on web teach me to click "Install/Reload in Development plugin" to debug.

You don't need to do that at all to debug. You can deploy your plugin
from NetBeans to a fresh instance of NetBeans, i.e., right-click the
project and click Run.


>   This step work perfectly,

But in the previous e-mail, you said that you get the error message
"NetBeans: Error redeploying NBM module in development IDE." when you
click "Install/Reload in Development IDE".

So, how can it work perfectly?

And, you really don't need to install any plugin via "Install/Reload in
Development IDE". Just right-click, choose Run, and a new instance of
NetBeans will start with your plugin installed into it and there you can
try it out (is that what you mean by "debug")?

I don't understand. Too many questions.

Gj

>   but when I pack my plugin into NBM and submit to plugin central. It either said, I use hard dependency so don't let me verify OR the plugin crash, can't load the BookmarkList class (https://github.com/mcheung63/netbeans-minimap/issues/8) . I am sure this bug exist because I installed a clean netbeans in VM to test my plugin.
>
> All I want to do is read out the bookmarks line numbers, so I have to use "org-netbeans-modules-editor-bookmarks", but just can't make it works.
>
> Steps to produce:
> 1) git clone https://github.com/mcheung63/netbeans-minimap.git
> 2) right click project, click "clean and build", it should success
> 3) click "Install/Reload in Development plugin" OR "Run project", it said "NetBeans: Error redeploying NBM module in development IDE."
>
> Below are the code I read out bookmark information
>
> Code:
>       
> BookmarkList bookmarkList = (BookmarkList) document.getProperty(BookmarkList.class);
> isBookmarkLine(bookmarkList, 1);
>
> boolean isBookmarkLine(BookmarkList bookmarkList, int lineNo) {
>                if (bookmarkList == null) {
>                        return false;
>                }
>                for (Bookmark bookmark : bookmarkList.getBookmarks()) {
>                        if (bookmark.getLineNumber() == lineNo) {
>                                return true;
>                        }
>                }
>                return false;
>        }
>
>
>
> Thanks
> Peter
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: I am unable to verify my plugin

geertjan.wielenga@oracle.com


Yes, this indicated an implementation dependency:

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue> 


And therefore it will not be permitted in the Plugin Portal. That's a hard dependency on a specific version of the plugin, which will not necessarily be in the official release of NetBeans for which you've developed the plugin.


Gj


On 15-4-2017 18:29, Peter Cheung wrote:

If I have this in pom.xml, "Install/Reload in dev" works, but plugin central said "Plugin has hard dependency to other modules defined in info.xml module descriptor, therefore can't be subject of verification"


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

</dependency>

</moduleDependencies>


If I have changed to this, plugin central won't complaint but "Install/Reload in dev" doesn't works


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue>  

</dependency>

</moduleDependencies>

!!! Click "run" is just same case.

Thanks, I know I am too disturb, sorry


From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 12:20 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


On 15-4-2017 18:10, mcheung63 wrote:
> The tutorial on web teach me to click "Install/Reload in Development plugin" to debug.

You don't need to do that at all to debug. You can deploy your plugin
from NetBeans to a fresh instance of NetBeans, i.e., right-click the
project and click Run.


>   This step work perfectly,

But in the previous e-mail, you said that you get the error message
"NetBeans: Error redeploying NBM module in development IDE." when you
click "Install/Reload in Development IDE".

So, how can it work perfectly?

And, you really don't need to install any plugin via "Install/Reload in
Development IDE". Just right-click, choose Run, and a new instance of
NetBeans will start with your plugin installed into it and there you can
try it out (is that what you mean by "debug")?

I don't understand. Too many questions.

Gj

>   but when I pack my plugin into NBM and submit to plugin central. It either said, I use hard dependency so don't let me verify OR the plugin crash, can't load the BookmarkList class (https://github.com/mcheung63/netbeans-minimap/issues/8) . I am sure this bug exist because I installed a clean netbeans in VM to test my plugin.
>
> All I want to do is read out the bookmarks line numbers, so I have to use "org-netbeans-modules-editor-bookmarks", but just can't make it works.
>
> Steps to produce:
> 1) git clone https://github.com/mcheung63/netbeans-minimap.git
> 2) right click project, click "clean and build", it should success
> 3) click "Install/Reload in Development plugin" OR "Run project", it said "NetBeans: Error redeploying NBM module in development IDE."
>
> Below are the code I read out bookmark information
>
> Code:
>       
> BookmarkList bookmarkList = (BookmarkList) document.getProperty(BookmarkList.class);
> isBookmarkLine(bookmarkList, 1);
>
> boolean isBookmarkLine(BookmarkList bookmarkList, int lineNo) {
>                if (bookmarkList == null) {
>                        return false;
>                }
>                for (Bookmark bookmark : bookmarkList.getBookmarks()) {
>                        if (bookmark.getLineNumber() == lineNo) {
>                                return true;
>                        }
>                }
>                return false;
>        }
>
>
>
> Thanks
> Peter
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: I am unable to verify my plugin

Peter Cheung

So what can I do? embed the whole source code of that into my plugin?

thx


From: geertjan wielenga <[hidden email]>
Sent: Sunday, April 16, 2017 1:24 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


Yes, this indicated an implementation dependency:

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue> 


And therefore it will not be permitted in the Plugin Portal. That's a hard dependency on a specific version of the plugin, which will not necessarily be in the official release of NetBeans for which you've developed the plugin.


Gj


On 15-4-2017 18:29, Peter Cheung wrote:

If I have this in pom.xml, "Install/Reload in dev" works, but plugin central said "Plugin has hard dependency to other modules defined in info.xml module descriptor, therefore can't be subject of verification"


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

</dependency>

</moduleDependencies>


If I have changed to this, plugin central won't complaint but "Install/Reload in dev" doesn't works


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue>  

</dependency>

</moduleDependencies>

!!! Click "run" is just same case.

Thanks, I know I am too disturb, sorry


From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 12:20 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


On 15-4-2017 18:10, mcheung63 wrote:
> The tutorial on web teach me to click "Install/Reload in Development plugin" to debug.

You don't need to do that at all to debug. You can deploy your plugin
from NetBeans to a fresh instance of NetBeans, i.e., right-click the
project and click Run.


>   This step work perfectly,

But in the previous e-mail, you said that you get the error message
"NetBeans: Error redeploying NBM module in development IDE." when you
click "Install/Reload in Development IDE".

So, how can it work perfectly?

And, you really don't need to install any plugin via "Install/Reload in
Development IDE". Just right-click, choose Run, and a new instance of
NetBeans will start with your plugin installed into it and there you can
try it out (is that what you mean by "debug")?

I don't understand. Too many questions.

Gj

>   but when I pack my plugin into NBM and submit to plugin central. It either said, I use hard dependency so don't let me verify OR the plugin crash, can't load the BookmarkList class (https://github.com/mcheung63/netbeans-minimap/issues/8) . I am sure this bug exist because I installed a clean netbeans in VM to test my plugin.
>
> All I want to do is read out the bookmarks line numbers, so I have to use "org-netbeans-modules-editor-bookmarks", but just can't make it works.
>
> Steps to produce:
> 1) git clone https://github.com/mcheung63/netbeans-minimap.git
> 2) right click project, click "clean and build", it should success
> 3) click "Install/Reload in Development plugin" OR "Run project", it said "NetBeans: Error redeploying NBM module in development IDE."
>
> Below are the code I read out bookmark information
>
> Code:
>       
> BookmarkList bookmarkList = (BookmarkList) document.getProperty(BookmarkList.class);
> isBookmarkLine(bookmarkList, 1);
>
> boolean isBookmarkLine(BookmarkList bookmarkList, int lineNo) {
>                if (bookmarkList == null) {
>                        return false;
>                }
>                for (Bookmark bookmark : bookmarkList.getBookmarks()) {
>                        if (bookmark.getLineNumber() == lineNo) {
>                                return true;
>                        }
>                }
>                return false;
>        }
>
>
>
> Thanks
> Peter
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: I am unable to verify my plugin

geertjan.wielenga@oracle.com


What's the reason you need to use an implementation dependency?


Gj


On 16-4-2017 6:50, Peter Cheung wrote:

So what can I do? embed the whole source code of that into my plugin?

thx


From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 1:24 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


Yes, this indicated an implementation dependency:

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue> 


And therefore it will not be permitted in the Plugin Portal. That's a hard dependency on a specific version of the plugin, which will not necessarily be in the official release of NetBeans for which you've developed the plugin.


Gj


On 15-4-2017 18:29, Peter Cheung wrote:

If I have this in pom.xml, "Install/Reload in dev" works, but plugin central said "Plugin has hard dependency to other modules defined in info.xml module descriptor, therefore can't be subject of verification"


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

</dependency>

</moduleDependencies>


If I have changed to this, plugin central won't complaint but "Install/Reload in dev" doesn't works


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue>  

</dependency>

</moduleDependencies>

!!! Click "run" is just same case.

Thanks, I know I am too disturb, sorry


From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 12:20 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


On 15-4-2017 18:10, mcheung63 wrote:
> The tutorial on web teach me to click "Install/Reload in Development plugin" to debug.

You don't need to do that at all to debug. You can deploy your plugin
from NetBeans to a fresh instance of NetBeans, i.e., right-click the
project and click Run.


>   This step work perfectly,

But in the previous e-mail, you said that you get the error message
"NetBeans: Error redeploying NBM module in development IDE." when you
click "Install/Reload in Development IDE".

So, how can it work perfectly?

And, you really don't need to install any plugin via "Install/Reload in
Development IDE". Just right-click, choose Run, and a new instance of
NetBeans will start with your plugin installed into it and there you can
try it out (is that what you mean by "debug")?

I don't understand. Too many questions.

Gj

>   but when I pack my plugin into NBM and submit to plugin central. It either said, I use hard dependency so don't let me verify OR the plugin crash, can't load the BookmarkList class (https://github.com/mcheung63/netbeans-minimap/issues/8) . I am sure this bug exist because I installed a clean netbeans in VM to test my plugin.
>
> All I want to do is read out the bookmarks line numbers, so I have to use "org-netbeans-modules-editor-bookmarks", but just can't make it works.
>
> Steps to produce:
> 1) git clone https://github.com/mcheung63/netbeans-minimap.git
> 2) right click project, click "clean and build", it should success
> 3) click "Install/Reload in Development plugin" OR "Run project", it said "NetBeans: Error redeploying NBM module in development IDE."
>
> Below are the code I read out bookmark information
>
> Code:
>       
> BookmarkList bookmarkList = (BookmarkList) document.getProperty(BookmarkList.class);
> isBookmarkLine(bookmarkList, 1);
>
> boolean isBookmarkLine(BookmarkList bookmarkList, int lineNo) {
>                if (bookmarkList == null) {
>                        return false;
>                }
>                for (Bookmark bookmark : bookmarkList.getBookmarks()) {
>                        if (bookmark.getLineNumber() == lineNo) {
>                                return true;
>                        }
>                }
>                return false;
>        }
>
>
>
> Thanks
> Peter
>
>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: I am unable to verify my plugin

Peter Cheung

So far, that is the only one way I got to read out editor-bookmark information.

Peter.




From: geertjan wielenga <[hidden email]>
Sent: Sunday, April 16, 2017 12:52 PM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


What's the reason you need to use an implementation dependency?


Gj


On 16-4-2017 6:50, Peter Cheung wrote:

So what can I do? embed the whole source code of that into my plugin?

thx


From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 1:24 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


Yes, this indicated an implementation dependency:

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue> 


And therefore it will not be permitted in the Plugin Portal. That's a hard dependency on a specific version of the plugin, which will not necessarily be in the official release of NetBeans for which you've developed the plugin.


Gj


On 15-4-2017 18:29, Peter Cheung wrote:

If I have this in pom.xml, "Install/Reload in dev" works, but plugin central said "Plugin has hard dependency to other modules defined in info.xml module descriptor, therefore can't be subject of verification"


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

</dependency>

</moduleDependencies>


If I have changed to this, plugin central won't complaint but "Install/Reload in dev" doesn't works


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue>  

</dependency>

</moduleDependencies>

!!! Click "run" is just same case.

Thanks, I know I am too disturb, sorry


From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 12:20 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


On 15-4-2017 18:10, mcheung63 wrote:
> The tutorial on web teach me to click "Install/Reload in Development plugin" to debug.

You don't need to do that at all to debug. You can deploy your plugin
from NetBeans to a fresh instance of NetBeans, i.e., right-click the
project and click Run.


>   This step work perfectly,

But in the previous e-mail, you said that you get the error message
"NetBeans: Error redeploying NBM module in development IDE." when you
click "Install/Reload in Development IDE".

So, how can it work perfectly?

And, you really don't need to install any plugin via "Install/Reload in
Development IDE". Just right-click, choose Run, and a new instance of
NetBeans will start with your plugin installed into it and there you can
try it out (is that what you mean by "debug")?

I don't understand. Too many questions.

Gj

>   but when I pack my plugin into NBM and submit to plugin central. It either said, I use hard dependency so don't let me verify OR the plugin crash, can't load the BookmarkList class (https://github.com/mcheung63/netbeans-minimap/issues/8) . I am sure this bug exist because I installed a clean netbeans in VM to test my plugin.
>
> All I want to do is read out the bookmarks line numbers, so I have to use "org-netbeans-modules-editor-bookmarks", but just can't make it works.
>
> Steps to produce:
> 1) git clone https://github.com/mcheung63/netbeans-minimap.git
> 2) right click project, click "clean and build", it should success
> 3) click "Install/Reload in Development plugin" OR "Run project", it said "NetBeans: Error redeploying NBM module in development IDE."
>
> Below are the code I read out bookmark information
>
> Code:
>       
> BookmarkList bookmarkList = (BookmarkList) document.getProperty(BookmarkList.class);
> isBookmarkLine(bookmarkList, 1);
>
> boolean isBookmarkLine(BookmarkList bookmarkList, int lineNo) {
>                if (bookmarkList == null) {
>                        return false;
>                }
>                for (Bookmark bookmark : bookmarkList.getBookmarks()) {
>                        if (bookmark.getLineNumber() == lineNo) {
>                                return true;
>                        }
>                }
>                return false;
>        }
>
>
>
> Thanks
> Peter
>
>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: I am unable to verify my plugin

geertjan.wielenga@oracle.com


Which information and why do you need it.


Is the information you need in an implementation package, if so, what specifically and why is it in an implementation package. Probably it means that you're not supposed to be using that information for some reason.


Again, without details, no one can help.


Gj


On 16-4-2017 10:01, Peter Cheung wrote:

So far, that is the only one way I got to read out editor-bookmark information.

Peter.




From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 12:52 PM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


What's the reason you need to use an implementation dependency?


Gj


On 16-4-2017 6:50, Peter Cheung wrote:

So what can I do? embed the whole source code of that into my plugin?

thx


From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 1:24 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


Yes, this indicated an implementation dependency:

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue> 


And therefore it will not be permitted in the Plugin Portal. That's a hard dependency on a specific version of the plugin, which will not necessarily be in the official release of NetBeans for which you've developed the plugin.


Gj


On 15-4-2017 18:29, Peter Cheung wrote:

If I have this in pom.xml, "Install/Reload in dev" works, but plugin central said "Plugin has hard dependency to other modules defined in info.xml module descriptor, therefore can't be subject of verification"


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

</dependency>

</moduleDependencies>


If I have changed to this, plugin central won't complaint but "Install/Reload in dev" doesn't works


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue>  

</dependency>

</moduleDependencies>

!!! Click "run" is just same case.

Thanks, I know I am too disturb, sorry


From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 12:20 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


On 15-4-2017 18:10, mcheung63 wrote:
> The tutorial on web teach me to click "Install/Reload in Development plugin" to debug.

You don't need to do that at all to debug. You can deploy your plugin
from NetBeans to a fresh instance of NetBeans, i.e., right-click the
project and click Run.


>   This step work perfectly,

But in the previous e-mail, you said that you get the error message
"NetBeans: Error redeploying NBM module in development IDE." when you
click "Install/Reload in Development IDE".

So, how can it work perfectly?

And, you really don't need to install any plugin via "Install/Reload in
Development IDE". Just right-click, choose Run, and a new instance of
NetBeans will start with your plugin installed into it and there you can
try it out (is that what you mean by "debug")?

I don't understand. Too many questions.

Gj

>   but when I pack my plugin into NBM and submit to plugin central. It either said, I use hard dependency so don't let me verify OR the plugin crash, can't load the BookmarkList class (https://github.com/mcheung63/netbeans-minimap/issues/8) . I am sure this bug exist because I installed a clean netbeans in VM to test my plugin.
>
> All I want to do is read out the bookmarks line numbers, so I have to use "org-netbeans-modules-editor-bookmarks", but just can't make it works.
>
> Steps to produce:
> 1) git clone https://github.com/mcheung63/netbeans-minimap.git
> 2) right click project, click "clean and build", it should success
> 3) click "Install/Reload in Development plugin" OR "Run project", it said "NetBeans: Error redeploying NBM module in development IDE."
>
> Below are the code I read out bookmark information
>
> Code:
>       
> BookmarkList bookmarkList = (BookmarkList) document.getProperty(BookmarkList.class);
> isBookmarkLine(bookmarkList, 1);
>
> boolean isBookmarkLine(BookmarkList bookmarkList, int lineNo) {
>                if (bookmarkList == null) {
>                        return false;
>                }
>                for (Bookmark bookmark : bookmarkList.getBookmarks()) {
>                        if (bookmark.getLineNumber() == lineNo) {
>                                return true;
>                        }
>                }
>                return false;
>        }
>
>
>
> Thanks
> Peter
>
>
>
>




Reply | Threaded
Open this post in threaded view
|

Re: I am unable to verify my plugin

Peter Cheung

Hi, I need to know which line(s) are marked as bookmark for current document.

Peter.


Which information and why do you need it. 

Is the information you need in an implementation package, if so, what specifically and why is it in an implementation package. Probably it means that you're not supposed to be using that information for some reason.


Again, without details, no one can help.


Gj


On 16-4-2017 10:01, Peter Cheung wrote:

So far, that is the only one way I got to read out editor-bookmark information.

Peter.




From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 12:52 PM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


What's the reason you need to use an implementation dependency?


Gj


On 16-4-2017 6:50, Peter Cheung wrote:

So what can I do? embed the whole source code of that into my plugin?

thx


From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 1:24 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


Yes, this indicated an implementation dependency:

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue> 


And therefore it will not be permitted in the Plugin Portal. That's a hard dependency on a specific version of the plugin, which will not necessarily be in the official release of NetBeans for which you've developed the plugin.


Gj


On 15-4-2017 18:29, Peter Cheung wrote:

If I have this in pom.xml, "Install/Reload in dev" works, but plugin central said "Plugin has hard dependency to other modules defined in info.xml module descriptor, therefore can't be subject of verification"


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

</dependency>

</moduleDependencies>


If I have changed to this, plugin central won't complaint but "Install/Reload in dev" doesn't works


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue>  

</dependency>

</moduleDependencies>

!!! Click "run" is just same case.

Thanks, I know I am too disturb, sorry


From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 12:20 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


On 15-4-2017 18:10, mcheung63 wrote:
> The tutorial on web teach me to click "Install/Reload in Development plugin" to debug.

You don't need to do that at all to debug. You can deploy your plugin
from NetBeans to a fresh instance of NetBeans, i.e., right-click the
project and click Run.


>   This step work perfectly,

But in the previous e-mail, you said that you get the error message
"NetBeans: Error redeploying NBM module in development IDE." when you
click "Install/Reload in Development IDE".

So, how can it work perfectly?

And, you really don't need to install any plugin via "Install/Reload in
Development IDE". Just right-click, choose Run, and a new instance of
NetBeans will start with your plugin installed into it and there you can
try it out (is that what you mean by "debug")?

I don't understand. Too many questions.

Gj

>   but when I pack my plugin into NBM and submit to plugin central. It either said, I use hard dependency so don't let me verify OR the plugin crash, can't load the BookmarkList class (https://github.com/mcheung63/netbeans-minimap/issues/8) . I am sure this bug exist because I installed a clean netbeans in VM to test my plugin.
>
> All I want to do is read out the bookmarks line numbers, so I have to use "org-netbeans-modules-editor-bookmarks", but just can't make it works.
>
> Steps to produce:
> 1) git clone https://github.com/mcheung63/netbeans-minimap.git
> 2) right click project, click "clean and build", it should success
> 3) click "Install/Reload in Development plugin" OR "Run project", it said "NetBeans: Error redeploying NBM module in development IDE."
>
> Below are the code I read out bookmark information
>
> Code:
>       
> BookmarkList bookmarkList = (BookmarkList) document.getProperty(BookmarkList.class);
> isBookmarkLine(bookmarkList, 1);
>
> boolean isBookmarkLine(BookmarkList bookmarkList, int lineNo) {
>                if (bookmarkList == null) {
>                        return false;
>                }
>                for (Bookmark bookmark : bookmarkList.getBookmarks()) {
>                        if (bookmark.getLineNumber() == lineNo) {
>                                return true;
>                        }
>                }
>                return false;
>        }
>
>
>
> Thanks
> Peter
>
>
>
>




Reply | Threaded
Open this post in threaded view
|

Re: I am unable to verify my plugin

Boris Heithecker
As far as I know, bookmarks are stored in an "AuxiliaryConfiguration" file in nbproject/private/private.xml. Find this file in one of your projects (wherein bookmarks are used, of course) and study the xml structure.
You should be able to access the bookmarks DOM element as follows:

AuxiliaryConfiguration config = ProjectUtils. getAuxiliaryConfiguration(project);
org.w3c.dom.Element element = config.getConfigurationFragment("editor-bookmarks", "http://www.netbeans.org/ns/editor-bookmarks/2",  false); //try true as well if it doen't work
...

Studying the above xml structure you should be able to extract the information without any further dependency.

Hope it helps,
Boris


2017-04-16 16:44 GMT+02:00 Peter Cheung <[hidden email]>:

Hi, I need to know which line(s) are marked as bookmark for current document.

Peter.


Which information and why do you need it. 

Is the information you need in an implementation package, if so, what specifically and why is it in an implementation package. Probably it means that you're not supposed to be using that information for some reason.


Again, without details, no one can help.


Gj


On 16-4-2017 10:01, Peter Cheung wrote:

So far, that is the only one way I got to read out editor-bookmark information.

Peter.




From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 12:52 PM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


What's the reason you need to use an implementation dependency?


Gj


On 16-4-2017 6:50, Peter Cheung wrote:

So what can I do? embed the whole source code of that into my plugin?

thx


From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 1:24 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


Yes, this indicated an implementation dependency:

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue> 


And therefore it will not be permitted in the Plugin Portal. That's a hard dependency on a specific version of the plugin, which will not necessarily be in the official release of NetBeans for which you've developed the plugin.


Gj


On 15-4-2017 18:29, Peter Cheung wrote:

If I have this in pom.xml, "Install/Reload in dev" works, but plugin central said "Plugin has hard dependency to other modules defined in info.xml module descriptor, therefore can't be subject of verification"


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

</dependency>

</moduleDependencies>


If I have changed to this, plugin central won't complaint but "Install/Reload in dev" doesn't works


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue>  

</dependency>

</moduleDependencies>

!!! Click "run" is just same case.

Thanks, I know I am too disturb, sorry


From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 12:20 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


On 15-4-2017 18:10, mcheung63 wrote:
> The tutorial on web teach me to click "Install/Reload in Development plugin" to debug.

You don't need to do that at all to debug. You can deploy your plugin
from NetBeans to a fresh instance of NetBeans, i.e., right-click the
project and click Run.


>   This step work perfectly,

But in the previous e-mail, you said that you get the error message
"NetBeans: Error redeploying NBM module in development IDE." when you
click "Install/Reload in Development IDE".

So, how can it work perfectly?

And, you really don't need to install any plugin via "Install/Reload in
Development IDE". Just right-click, choose Run, and a new instance of
NetBeans will start with your plugin installed into it and there you can
try it out (is that what you mean by "debug")?

I don't understand. Too many questions.

Gj

>   but when I pack my plugin into NBM and submit to plugin central. It either said, I use hard dependency so don't let me verify OR the plugin crash, can't load the BookmarkList class (https://github.com/mcheung63/netbeans-minimap/issues/8) . I am sure this bug exist because I installed a clean netbeans in VM to test my plugin.
>
> All I want to do is read out the bookmarks line numbers, so I have to use "org-netbeans-modules-editor-bookmarks", but just can't make it works.
>
> Steps to produce:
> 1) git clone https://github.com/mcheung63/netbeans-minimap.git
> 2) right click project, click "clean and build", it should success
> 3) click "Install/Reload in Development plugin" OR "Run project", it said "NetBeans: Error redeploying NBM module in development IDE."
>
> Below are the code I read out bookmark information
>
> Code:
>       
> BookmarkList bookmarkList = (BookmarkList) document.getProperty(BookmarkList.class);
> isBookmarkLine(bookmarkList, 1);
>
> boolean isBookmarkLine(BookmarkList bookmarkList, int lineNo) {
>                if (bookmarkList == null) {
>                        return false;
>                }
>                for (Bookmark bookmark : bookmarkList.getBookmarks()) {
>                        if (bookmark.getLineNumber() == lineNo) {
>                                return true;
>                        }
>                }
>                return false;
>        }
>
>
>
> Thanks
> Peter
>
>
>
>







--
Boris Heithecker


Dr. Boris Heithecker
Lüneburger Str. 30
28870 Ottersberg
Tel.: 0 42 05/ 31 58 34
Reply | Threaded
Open this post in threaded view
|

Re: I am unable to verify my plugin

Peter Cheung

Thanks, but there are weak points. 

1) The file (nbproject/private/private.xml) will update only when i closed the netbeans

2) Maven project don't even have that file.

Thanks

from Peter




From: Boris Heithecker <[hidden email]>
Sent: Monday, April 17, 2017 12:41 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 
As far as I know, bookmarks are stored in an "AuxiliaryConfiguration" file in nbproject/private/private.xml. Find this file in one of your projects (wherein bookmarks are used, of course) and study the xml structure.
You should be able to access the bookmarks DOM element as follows:

AuxiliaryConfiguration config = ProjectUtils. getAuxiliaryConfiguration(project);
org.w3c.dom.Element element = config.getConfigurationFragment("editor-bookmarks", "http://www.netbeans.org/ns/editor-bookmarks/2",  false); //try true as well if it doen't work
...

Studying the above xml structure you should be able to extract the information without any further dependency.

Hope it helps,
Boris


2017-04-16 16:44 GMT+02:00 Peter Cheung <[hidden email]>:

Hi, I need to know which line(s) are marked as bookmark for current document.

Peter.


Which information and why do you need it. 

Is the information you need in an implementation package, if so, what specifically and why is it in an implementation package. Probably it means that you're not supposed to be using that information for some reason.


Again, without details, no one can help.


Gj


On 16-4-2017 10:01, Peter Cheung wrote:

So far, that is the only one way I got to read out editor-bookmark information.

Peter.




From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 12:52 PM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


What's the reason you need to use an implementation dependency?


Gj


On 16-4-2017 6:50, Peter Cheung wrote:

So what can I do? embed the whole source code of that into my plugin?

thx


From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 1:24 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


Yes, this indicated an implementation dependency:

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue> 


And therefore it will not be permitted in the Plugin Portal. That's a hard dependency on a specific version of the plugin, which will not necessarily be in the official release of NetBeans for which you've developed the plugin.


Gj


On 15-4-2017 18:29, Peter Cheung wrote:

If I have this in pom.xml, "Install/Reload in dev" works, but plugin central said "Plugin has hard dependency to other modules defined in info.xml module descriptor, therefore can't be subject of verification"


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

</dependency>

</moduleDependencies>


If I have changed to this, plugin central won't complaint but "Install/Reload in dev" doesn't works


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue>  

</dependency>

</moduleDependencies>

!!! Click "run" is just same case.

Thanks, I know I am too disturb, sorry


From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 12:20 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


On 15-4-2017 18:10, mcheung63 wrote:
> The tutorial on web teach me to click "Install/Reload in Development plugin" to debug.

You don't need to do that at all to debug. You can deploy your plugin
from NetBeans to a fresh instance of NetBeans, i.e., right-click the
project and click Run.


>   This step work perfectly,

But in the previous e-mail, you said that you get the error message
"NetBeans: Error redeploying NBM module in development IDE." when you
click "Install/Reload in Development IDE".

So, how can it work perfectly?

And, you really don't need to install any plugin via "Install/Reload in
Development IDE". Just right-click, choose Run, and a new instance of
NetBeans will start with your plugin installed into it and there you can
try it out (is that what you mean by "debug")?

I don't understand. Too many questions.

Gj

>   but when I pack my plugin into NBM and submit to plugin central. It either said, I use hard dependency so don't let me verify OR the plugin crash, can't load the BookmarkList class (https://github.com/mcheung63/netbeans-minimap/issues/8) . I am sure this bug exist because I installed a clean netbeans in VM to test my plugin.
>
> All I want to do is read out the bookmarks line numbers, so I have to use "org-netbeans-modules-editor-bookmarks", but just can't make it works.
>
> Steps to produce:
> 1) git clone https://github.com/mcheung63/netbeans-minimap.git
> 2) right click project, click "clean and build", it should success
> 3) click "Install/Reload in Development plugin" OR "Run project", it said "NetBeans: Error redeploying NBM module in development IDE."
>
> Below are the code I read out bookmark information
>
> Code:
>       
> BookmarkList bookmarkList = (BookmarkList) document.getProperty(BookmarkList.class);
> isBookmarkLine(bookmarkList, 1);
>
> boolean isBookmarkLine(BookmarkList bookmarkList, int lineNo) {
>                if (bookmarkList == null) {
>                        return false;
>                }
>                for (Bookmark bookmark : bookmarkList.getBookmarks()) {
>                        if (bookmark.getLineNumber() == lineNo) {
>                                return true;
>                        }
>                }
>                return false;
>        }
>
>
>
> Thanks
> Peter
>
>
>
>







--
Boris Heithecker


Dr. Boris Heithecker
Lüneburger Str. 30
28870 Ottersberg
Tel.: 0 42 05/ 31 58 34
Reply | Threaded
Open this post in threaded view
|

Re: I am unable to verify my plugin

Boris Heithecker
Don't access this file directly, you only need it to understand the xml structure (alternatively, see the related xml schema file at http://hg.netbeans.org/main/file/tip/editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/resources/editor-bookmarks-2.xsd).
As I suggested, use ProjetUtils to access the dom tree in AuxiliaryConfiguration, which should be kept updated while the platform is running (i'm not entirely sure, you have to try it out). 
Boris

2017-04-16 20:02 GMT+02:00 Peter Cheung <[hidden email]>:

Thanks, but there are weak points. 

1) The file (nbproject/private/private.xml) will update only when i closed the netbeans

2) Maven project don't even have that file.

Thanks

from Peter




From: Boris Heithecker <[hidden email]>
Sent: Monday, April 17, 2017 12:41 AM

To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 
As far as I know, bookmarks are stored in an "AuxiliaryConfiguration" file in nbproject/private/private.xml. Find this file in one of your projects (wherein bookmarks are used, of course) and study the xml structure.
You should be able to access the bookmarks DOM element as follows:

AuxiliaryConfiguration config = ProjectUtils. getAuxiliaryConfiguration(project);
org.w3c.dom.Element element = config.getConfigurationFragment("editor-bookmarks", "http://www.netbeans.org/ns/editor-bookmarks/2",  false); //try true as well if it doen't work
...

Studying the above xml structure you should be able to extract the information without any further dependency.

Hope it helps,
Boris


2017-04-16 16:44 GMT+02:00 Peter Cheung <[hidden email]>:

Hi, I need to know which line(s) are marked as bookmark for current document.

Peter.


Which information and why do you need it. 

Is the information you need in an implementation package, if so, what specifically and why is it in an implementation package. Probably it means that you're not supposed to be using that information for some reason.


Again, without details, no one can help.


Gj


On 16-4-2017 10:01, Peter Cheung wrote:

So far, that is the only one way I got to read out editor-bookmark information.

Peter.




From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 12:52 PM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


What's the reason you need to use an implementation dependency?


Gj


On 16-4-2017 6:50, Peter Cheung wrote:

So what can I do? embed the whole source code of that into my plugin?

thx


From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 1:24 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


Yes, this indicated an implementation dependency:

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue> 


And therefore it will not be permitted in the Plugin Portal. That's a hard dependency on a specific version of the plugin, which will not necessarily be in the official release of NetBeans for which you've developed the plugin.


Gj


On 15-4-2017 18:29, Peter Cheung wrote:

If I have this in pom.xml, "Install/Reload in dev" works, but plugin central said "Plugin has hard dependency to other modules defined in info.xml module descriptor, therefore can't be subject of verification"


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

</dependency>

</moduleDependencies>


If I have changed to this, plugin central won't complaint but "Install/Reload in dev" doesn't works


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue>  

</dependency>

</moduleDependencies>

!!! Click "run" is just same case.

Thanks, I know I am too disturb, sorry


From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 12:20 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


On 15-4-2017 18:10, mcheung63 wrote:
> The tutorial on web teach me to click "Install/Reload in Development plugin" to debug.

You don't need to do that at all to debug. You can deploy your plugin
from NetBeans to a fresh instance of NetBeans, i.e., right-click the
project and click Run.


>   This step work perfectly,

But in the previous e-mail, you said that you get the error message
"NetBeans: Error redeploying NBM module in development IDE." when you
click "Install/Reload in Development IDE".

So, how can it work perfectly?

And, you really don't need to install any plugin via "Install/Reload in
Development IDE". Just right-click, choose Run, and a new instance of
NetBeans will start with your plugin installed into it and there you can
try it out (is that what you mean by "debug")?

I don't understand. Too many questions.

Gj

>   but when I pack my plugin into NBM and submit to plugin central. It either said, I use hard dependency so don't let me verify OR the plugin crash, can't load the BookmarkList class (https://github.com/mcheung63/netbeans-minimap/issues/8) . I am sure this bug exist because I installed a clean netbeans in VM to test my plugin.
>
> All I want to do is read out the bookmarks line numbers, so I have to use "org-netbeans-modules-editor-bookmarks", but just can't make it works.
>
> Steps to produce:
> 1) git clone https://github.com/mcheung63/netbeans-minimap.git
> 2) right click project, click "clean and build", it should success
> 3) click "Install/Reload in Development plugin" OR "Run project", it said "NetBeans: Error redeploying NBM module in development IDE."
>
> Below are the code I read out bookmark information
>
> Code:
>       
> BookmarkList bookmarkList = (BookmarkList) document.getProperty(BookmarkList.class);
> isBookmarkLine(bookmarkList, 1);
>
> boolean isBookmarkLine(BookmarkList bookmarkList, int lineNo) {
>                if (bookmarkList == null) {
>                        return false;
>                }
>                for (Bookmark bookmark : bookmarkList.getBookmarks()) {
>                        if (bookmark.getLineNumber() == lineNo) {
>                                return true;
>                        }
>                }
>                return false;
>        }
>
>
>
> Thanks
> Peter
>
>
>
>







--
Boris Heithecker


Dr. Boris Heithecker
Lüneburger Str. 30
28870 Ottersberg
Tel.: 0 42 05/ 31 58 34



--
Boris Heithecker


Dr. Boris Heithecker
Lüneburger Str. 30
28870 Ottersberg
Tel.: 0 42 05/ 31 58 34
Reply | Threaded
Open this post in threaded view
|

Re: I am unable to verify my plugin

Peter Cheung

Thanks Boris

   Below code I've tested can read the bookmark line numbers, but this code won't read the latest line numbers unless I close the project/netbeans, because I think it is reading the private.xml and it won't be update unless I close the project/netbeans.


Project project = NetbeansUtil.getProject();

AuxiliaryConfiguration config = ProjectUtils.getAuxiliaryConfiguration(project);

org.w3c.dom.Element element = config.getConfigurationFragment("editor-bookmarks", "http://www.netbeans.org/ns/editor-bookmarks/2", false);

ModuleLib.log("element=" + element);

if (element != null) {

NodeList list = element.getElementsByTagNameNS("http://www.netbeans.org/ns/editor-bookmarks/2", "bookmark");

for (int x = 0; x < list.getLength(); x++) {

org.w3c.dom.Element enEl = (org.w3c.dom.Element) list.item(x);

String x = enEl.getTextContent().trim();

ModuleLib.log("line no=" + x);

}

}


Peter.


From: Boris Heithecker <[hidden email]>
Sent: Monday, April 17, 2017 3:17 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 
Don't access this file directly, you only need it to understand the xml structure (alternatively, see the related xml schema file at http://hg.netbeans.org/main/file/tip/editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/resources/editor-bookmarks-2.xsd).
As I suggested, use ProjetUtils to access the dom tree in AuxiliaryConfiguration, which should be kept updated while the platform is running (i'm not entirely sure, you have to try it out). 
Boris

2017-04-16 20:02 GMT+02:00 Peter Cheung <[hidden email]>:

Thanks, but there are weak points. 

1) The file (nbproject/private/private.xml) will update only when i closed the netbeans

2) Maven project don't even have that file.

Thanks

from Peter




From: Boris Heithecker <[hidden email]>
Sent: Monday, April 17, 2017 12:41 AM

To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 
As far as I know, bookmarks are stored in an "AuxiliaryConfiguration" file in nbproject/private/private.xml. Find this file in one of your projects (wherein bookmarks are used, of course) and study the xml structure.
You should be able to access the bookmarks DOM element as follows:

AuxiliaryConfiguration config = ProjectUtils. getAuxiliaryConfiguration(project);
org.w3c.dom.Element element = config.getConfigurationFragment("editor-bookmarks", "http://www.netbeans.org/ns/editor-bookmarks/2",  false); //try true as well if it doen't work
...

Studying the above xml structure you should be able to extract the information without any further dependency.

Hope it helps,
Boris


2017-04-16 16:44 GMT+02:00 Peter Cheung <[hidden email]>:

Hi, I need to know which line(s) are marked as bookmark for current document.

Peter.


Which information and why do you need it. 

Is the information you need in an implementation package, if so, what specifically and why is it in an implementation package. Probably it means that you're not supposed to be using that information for some reason.


Again, without details, no one can help.


Gj


On 16-4-2017 10:01, Peter Cheung wrote:

So far, that is the only one way I got to read out editor-bookmark information.

Peter.




From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 12:52 PM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


What's the reason you need to use an implementation dependency?


Gj


On 16-4-2017 6:50, Peter Cheung wrote:

So what can I do? embed the whole source code of that into my plugin?

thx


From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 1:24 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


Yes, this indicated an implementation dependency:

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue> 


And therefore it will not be permitted in the Plugin Portal. That's a hard dependency on a specific version of the plugin, which will not necessarily be in the official release of NetBeans for which you've developed the plugin.


Gj


On 15-4-2017 18:29, Peter Cheung wrote:

If I have this in pom.xml, "Install/Reload in dev" works, but plugin central said "Plugin has hard dependency to other modules defined in info.xml module descriptor, therefore can't be subject of verification"


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

</dependency>

</moduleDependencies>


If I have changed to this, plugin central won't complaint but "Install/Reload in dev" doesn't works


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue>  

</dependency>

</moduleDependencies>

!!! Click "run" is just same case.

Thanks, I know I am too disturb, sorry


From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 12:20 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


On 15-4-2017 18:10, mcheung63 wrote:
> The tutorial on web teach me to click "Install/Reload in Development plugin" to debug.

You don't need to do that at all to debug. You can deploy your plugin
from NetBeans to a fresh instance of NetBeans, i.e., right-click the
project and click Run.


>   This step work perfectly,

But in the previous e-mail, you said that you get the error message
"NetBeans: Error redeploying NBM module in development IDE." when you
click "Install/Reload in Development IDE".

So, how can it work perfectly?

And, you really don't need to install any plugin via "Install/Reload in
Development IDE". Just right-click, choose Run, and a new instance of
NetBeans will start with your plugin installed into it and there you can
try it out (is that what you mean by "debug")?

I don't understand. Too many questions.

Gj

>   but when I pack my plugin into NBM and submit to plugin central. It either said, I use hard dependency so don't let me verify OR the plugin crash, can't load the BookmarkList class (https://github.com/mcheung63/netbeans-minimap/issues/8) . I am sure this bug exist because I installed a clean netbeans in VM to test my plugin.
>
> All I want to do is read out the bookmarks line numbers, so I have to use "org-netbeans-modules-editor-bookmarks", but just can't make it works.
>
> Steps to produce:
> 1) git clone https://github.com/mcheung63/netbeans-minimap.git
> 2) right click project, click "clean and build", it should success
> 3) click "Install/Reload in Development plugin" OR "Run project", it said "NetBeans: Error redeploying NBM module in development IDE."
>
> Below are the code I read out bookmark information
>
> Code:
>       
> BookmarkList bookmarkList = (BookmarkList) document.getProperty(BookmarkList.class);
> isBookmarkLine(bookmarkList, 1);
>
> boolean isBookmarkLine(BookmarkList bookmarkList, int lineNo) {
>                if (bookmarkList == null) {
>                        return false;
>                }
>                for (Bookmark bookmark : bookmarkList.getBookmarks()) {
>                        if (bookmark.getLineNumber() == lineNo) {
>                                return true;
>                        }
>                }
>                return false;
>        }
>
>
>
> Thanks
> Peter
>
>
>
>







--
Boris Heithecker


Dr. Boris Heithecker
Lüneburger Str. 30
28870 Ottersberg
Tel.: 0 42 05/ 31 58 34



--
Boris Heithecker


Dr. Boris Heithecker
Lüneburger Str. 30
28870 Ottersberg
Tel.: 0 42 05/ 31 58 34
Reply | Threaded
Open this post in threaded view
|

Re: I am unable to verify my plugin

Peter Cheung

Thanks Boris, super clear answer. Appreciate for your help and Geertjan 😊



From: Boris Heithecker <[hidden email]>
Sent: Monday, April 17, 2017 9:44 PM
To: Peter Cheung
Subject: Re: [platform-dev] Re: I am unable to verify my plugin
 
Okay, I just did the following: open the "editor.bookmarks" module from the NetBeans sources, go to the sources directory and use the "find" action to see all occurrences of "AuxiliaryConfiguration" in these sources. 
There is only one class: BookmarksPersistence, and it becomes clear that bookmarks are indeed saved only when the related project is being closed, meaning that the xml node is, unfortunately, not kept updated. (Better design would have been to update it every time a bookmark is added or removed, in my opinion.)
So principally you really need an implementation dependency on the editor bookmark module, but this is a hardly a good idea if you want to publish your module as a plugin for the IDE, I think. 
Another option could be using java reflexion to successively get all BookmarkInfo items you need from BookmarkManager. Unfortunenately simply calling BookmarksPersistence.get().propertyChange(null) to trigger the saving won't help if the project is still in opened state. In any case, you'll have to read the sources.
(BTW: For future development of the platform it would be a good think to make at least a small part (like BookmarkManager, BookmarkManagerListener) of this and MANY OTHER (not only editor) modules public API... It will make it much easier to reuse and extend the very refined editor structure, which has no equivalent in the java world....)
Boris

2017-04-17 1:53 GMT+02:00 Peter Cheung <[hidden email]>:

Thanks Boris

   Below code I've tested can read the bookmark line numbers, but this code won't read the latest line numbers unless I close the project/netbeans, because I think it is reading the private.xml and it won't be update unless I close the project/netbeans.


Project project = NetbeansUtil.getProject();

AuxiliaryConfiguration config = ProjectUtils.getAuxiliaryConfiguration(project);

org.w3c.dom.Element element = config.getConfigurationFragment("editor-bookmarks", "http://www.netbeans.org/ns/editor-bookmarks/2", false);

ModuleLib.log("element=" + element);

if (element != null) {

NodeList list = element.getElementsByTagNameNS("http://www.netbeans.org/ns/editor-bookmarks/2", "bookmark");

for (int x = 0; x < list.getLength(); x++) {

org.w3c.dom.Element enEl = (org.w3c.dom.Element) list.item(x);

String x = enEl.getTextContent().trim();

ModuleLib.log("line no=" + x);

}

}


Peter.


From: Boris Heithecker <[hidden email]>
Sent: Monday, April 17, 2017 3:17 AM

To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 
Don't access this file directly, you only need it to understand the xml structure (alternatively, see the related xml schema file at http://hg.netbeans.org/main/file/tip/editor.bookmarks/src/org/netbeans/modules/editor/bookmarks/resources/editor-bookmarks-2.xsd).
As I suggested, use ProjetUtils to access the dom tree in AuxiliaryConfiguration, which should be kept updated while the platform is running (i'm not entirely sure, you have to try it out). 
Boris

2017-04-16 20:02 GMT+02:00 Peter Cheung <[hidden email]>:

Thanks, but there are weak points. 

1) The file (nbproject/private/private.xml) will update only when i closed the netbeans

2) Maven project don't even have that file.

Thanks

from Peter




From: Boris Heithecker <[hidden email]>
Sent: Monday, April 17, 2017 12:41 AM

To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 
As far as I know, bookmarks are stored in an "AuxiliaryConfiguration" file in nbproject/private/private.xml. Find this file in one of your projects (wherein bookmarks are used, of course) and study the xml structure.
You should be able to access the bookmarks DOM element as follows:

AuxiliaryConfiguration config = ProjectUtils. getAuxiliaryConfiguration(project);
org.w3c.dom.Element element = config.getConfigurationFragment("editor-bookmarks", "http://www.netbeans.org/ns/editor-bookmarks/2",  false); //try true as well if it doen't work
...

Studying the above xml structure you should be able to extract the information without any further dependency.

Hope it helps,
Boris


2017-04-16 16:44 GMT+02:00 Peter Cheung <[hidden email]>:

Hi, I need to know which line(s) are marked as bookmark for current document.

Peter.


Which information and why do you need it. 

Is the information you need in an implementation package, if so, what specifically and why is it in an implementation package. Probably it means that you're not supposed to be using that information for some reason.


Again, without details, no one can help.


Gj


On 16-4-2017 10:01, Peter Cheung wrote:

So far, that is the only one way I got to read out editor-bookmark information.

Peter.




From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 12:52 PM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


What's the reason you need to use an implementation dependency?


Gj


On 16-4-2017 6:50, Peter Cheung wrote:

So what can I do? embed the whole source code of that into my plugin?

thx


From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 1:24 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


Yes, this indicated an implementation dependency:

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue> 


And therefore it will not be permitted in the Plugin Portal. That's a hard dependency on a specific version of the plugin, which will not necessarily be in the official release of NetBeans for which you've developed the plugin.


Gj


On 15-4-2017 18:29, Peter Cheung wrote:

If I have this in pom.xml, "Install/Reload in dev" works, but plugin central said "Plugin has hard dependency to other modules defined in info.xml module descriptor, therefore can't be subject of verification"


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

</dependency>

</moduleDependencies>


If I have changed to this, plugin central won't complaint but "Install/Reload in dev" doesn't works


<moduleDependencies>

<dependency>

<id>org.netbeans.modules:org-netbeans-modules-editor-bookmarks</id>

<type>impl</type>

<explicitValue>org.netbeans.modules.editor.bookmarks/1 >= 1.37.l</explicitValue>  

</dependency>

</moduleDependencies>

!!! Click "run" is just same case.

Thanks, I know I am too disturb, sorry


From: geertjan wielenga [hidden email]
Sent: Sunday, April 16, 2017 12:20 AM
To: [hidden email]
Subject: [platform-dev] Re: I am unable to verify my plugin
 


On 15-4-2017 18:10, mcheung63 wrote:
> The tutorial on web teach me to click "Install/Reload in Development plugin" to debug.

You don't need to do that at all to debug. You can deploy your plugin
from NetBeans to a fresh instance of NetBeans, i.e., right-click the
project and click Run.


>   This step work perfectly,

But in the previous e-mail, you said that you get the error message
"NetBeans: Error redeploying NBM module in development IDE." when you
click "Install/Reload in Development IDE".

So, how can it work perfectly?

And, you really don't need to install any plugin via "Install/Reload in
Development IDE". Just right-click, choose Run, and a new instance of
NetBeans will start with your plugin installed into it and there you can
try it out (is that what you mean by "debug")?

I don't understand. Too many questions.

Gj

>   but when I pack my plugin into NBM and submit to plugin central. It either said, I use hard dependency so don't let me verify OR the plugin crash, can't load the BookmarkList class (https://github.com/mcheung63/netbeans-minimap/issues/8) . I am sure this bug exist because I installed a clean netbeans in VM to test my plugin.
>
> All I want to do is read out the bookmarks line numbers, so I have to use "org-netbeans-modules-editor-bookmarks", but just can't make it works.
>
> Steps to produce:
> 1) git clone https://github.com/mcheung63/netbeans-minimap.git
> 2) right click project, click "clean and build", it should success
> 3) click "Install/Reload in Development plugin" OR "Run project", it said "NetBeans: Error redeploying NBM module in development IDE."
>
> Below are the code I read out bookmark information
>
> Code:
>       
> BookmarkList bookmarkList = (BookmarkList) document.getProperty(BookmarkList.class);
> isBookmarkLine(bookmarkList, 1);
>
> boolean isBookmarkLine(BookmarkList bookmarkList, int lineNo) {
>                if (bookmarkList == null) {
>                        return false;
>                }
>                for (Bookmark bookmark : bookmarkList.getBookmarks()) {
>                        if (bookmark.getLineNumber() == lineNo) {
>                                return true;
>                        }
>                }
>                return false;
>        }
>
>
>
> Thanks
> Peter
>
>
>
>







--
Boris Heithecker


Dr. Boris Heithecker
Lüneburger Str. 30
28870 Ottersberg
Tel.: 0 42 05/ 31 58 34



--
Boris Heithecker


Dr. Boris Heithecker
Lüneburger Str. 30
28870 Ottersberg
Tel.: 0 42 05/ 31 58 34



--
Boris Heithecker


Dr. Boris Heithecker
Lüneburger Str. 30
28870 Ottersberg
Tel.: 0 42 05/ 31 58 34