Re: I am unable to verify my plugin

Boris Heithecker <[email protected]> Sun, 16 Apr 2017 21:17:56 +0200
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <CAL465RHn7pJzRii24SUQephWFfbrzvsw0w5i0oe8dVSsf3xa+A@mail.gmail.com>
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 <[email protected]>:

> 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 <[email protected]>
> *Sent:* Monday, April 17, 2017 12:41 AM
>
> *To:* [email protected]
> *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 <[email protected]>:
>
>> 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 <[email protected]>
>> <[email protected]>
>> *Sent:* Sunday, April 16, 2017 12:52 PM
>> *To:* [email protected]
>> *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 <[email protected]>
>> <[email protected]>
>> *Sent:* Sunday, April 16, 2017 1:24 AM
>> *To:* [email protected]
>> *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 <[email protected]>
>> <[email protected]>
>> *Sent:* Sunday, April 16, 2017 12:20 AM
>> *To:* [email protected]
>> *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