This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 231131 - API to provide non-standard description of applyBindings( parameter )
Summary: API to provide non-standard description of applyBindings( parameter )
Status: VERIFIED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: Knockout (show other bugs)
Version: 7.4
Hardware: PC Linux
: P2 normal (vote)
Assignee: Roman Svitanic
URL:
Keywords:
Depends on:
Blocks: 251075 251076
  Show dependency tree
 
Reported: 2013-06-12 11:33 UTC by Jaroslav Tulach
Modified: 2015-03-10 18:32 UTC (History)
5 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Knockout CC in HTML using BindigsProvider (34.68 KB, patch)
2014-12-12 16:45 UTC, Roman Svitanic
Details | Diff
Addressing Y01-Y03 (73.36 KB, patch)
2014-12-19 10:55 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2013-06-12 11:33:06 UTC
Please provide API to allow Knockout4Java to specify description of JSON object which is passed as parameter into ko.applyBindings method. 

http://wiki.netbeans.org/KnockJSOut
Comment 1 Jaroslav Tulach 2013-06-12 11:40:43 UTC
Please review my initial API attempt associated by a unit test: http://hg.netbeans.org/ergonomics/rev/14c01973e813
Comment 2 Petr Jiricka 2013-06-13 08:46:49 UTC
Hi Jardo, just a couple clarifying questions:

PJ01: Who would be the clients of this API? Do you have a diff that illustrates the usages, in existing or new code?

PJ02: Where will api.knockout module be placed? Is it intended to be a part of the distribution, and if so, which cluster?

Thx.
Comment 3 Jaroslav Tulach 2013-06-13 10:25:46 UTC
Re. PJ01: Right now I only have the unit test. It shows the API related part well. The rest is parsing Java file and finding all @net.java.html.Model annotations and depending on their content calling the API as shown in the unit test.

Re. PJ02: The thing I'd like to get for 7.4 is the inclusion among list of friend modules - to be able to use html.editor API. I'd like to have the module in Hg repository and upload it to autoupdate (at least development one).
Comment 4 Petr Jiricka 2013-06-13 11:18:40 UTC
Re. PJ01: I was asking because I thought that there is a general guideline that when there are more than 3 clients, it is appropriate to consider public API, with fewer than 3, friend is more appropriate. But this of course is not a strict rule, just a guideline.

Re P102: Sounds good, friend of html.editor is of course not a problem.
Comment 5 Jaroslav Tulach 2014-12-10 10:49:41 UTC
Maybe web/knockout is more approppriate category.
Comment 6 Roman Svitanic 2014-12-12 16:45:23 UTC
Created attachment 151083 [details]
Knockout CC in HTML using BindigsProvider

Attached is diff of Jarda's API prototype with small modifications + sample module with sample bindings provider implementation.

In HTML where "|" marks position where CC is invoked, items from SampleBindingsProvider are offered:
<div data-bind="value: |">
Comment 7 Jaroslav Tulach 2014-12-12 18:03:33 UTC
I have problems applying the new patch. It says something like:

$ patch -p0 <~/X.diff 
patching file api.knockout/build.xml
patching file api.knockout/manifest.mf
patching file api.knockout/nbproject/project.properties
patching file api.knockout/nbproject/project.xml
patching file api.knockout/src/org/netbeans/api/knockout/Bundle.properties
patch: **** missing line number at line 112: @@ -0,0 +1, @@ 

Maybe the patch is corrupted?
Comment 8 Roman Svitanic 2014-12-15 08:48:24 UTC
I have just tried to apply the patch using NetBeans and it has been applied without any problems.
Comment 9 Jaroslav Tulach 2014-12-19 10:54:45 UTC
I've managed to apply the change. Here are my comments:

Y01 Why the api.knockout has dependency on html.editor? It seems redundant and no longer necessary.

Y02 The javadoc is slightly insufficient

Y03 SPIAccessor is not needed anymore in current source layout. Replace by static method.
Comment 10 Jaroslav Tulach 2014-12-19 10:55:43 UTC
Created attachment 151206 [details]
Addressing Y01-Y03

If the improved patch seems OK to you Roman, I have nothing against integrating it. Thanks.
Comment 11 Roman Svitanic 2015-02-03 09:47:39 UTC
Patch seems OK to, if there are no objections I will proceed with the integration.
Comment 12 Tomas Zezula 2015-02-03 10:36:11 UTC
Minor comment:

public void findBindings(FileObject htmlFile, Response r);

can be:

public Response findBindings(FileObject htmlFile);


class Response {
    static create(Binding... bindings);
    static create(String id, Binding... bindings);
}
Comment 13 Jaroslav Tulach 2015-02-03 12:36:06 UTC
Thanks. Any of the alternatives seems OK for my purposes.
Comment 14 Jaroslav Tulach 2015-02-18 18:27:57 UTC
What's happening? Another two weeks hiccup? I had a feeling the proposal is non-controversial and can be integrated. Why it has not been integrated yet?
Comment 15 Roman Svitanic 2015-02-20 16:47:02 UTC
Changeset: d35464431ab6
Author:    Roman Svitanic <rsvitanic@netbeans.org>
Date:      2015-02-20 17:46
Message:   #231131: API to provide non-standard description of applyBindings( parameter )
Comment 16 Quality Engineering 2015-02-24 23:47:01 UTC
Integrated into 'main-silver', will be available in build *201502242039* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/d35464431ab6
User: Roman Svitanic <rsvitanic@netbeans.org>
Log: #231131: API to provide non-standard description of applyBindings( parameter )
Task #231131 - API to provide non-standard description of applyBindings( parameter )
Comment 17 Jaroslav Tulach 2015-03-10 08:19:07 UTC
I just tried to use the new API and it seems to work great. Thanks.