Re: Re[2]: Google Closure Whiteboard

2013-07-04 Thread Maxim Solodovnik
sure, please create git repo!

instead of using Wicket.ajax.get you can use normal *AjaxBehavior you can
also create functions of it using getCallbackFunction.
Old OM code had examples of that (was replaced with
wicketjquieryui-calendar)


On Thu, Jul 4, 2013 at 3:45 AM, Andun Sameera andun...@gmail.com wrote:

 Hi All,

 I have successfully did a first step integration of Andrey's whiteboard
 with Wicket. Now I can send the JSON string successfully to the JAVA code.
 Now I know the way and will work on formalizing the thing!


 @Andrey

 Can you give me a example to add a onChnage method to main collection. I
 tried to do it. But is fails.

 @ Maxim

 Can I create a Git Repo for the task? Is it going to be a wicket-jquery-UI
 plug-in ? or else ?

 Thanks!


 On Wed, Jul 3, 2013 at 11:18 PM, Andun Sameera andun...@gmail.com wrote:

 Hi Andrey,

 OK will do it like that!

 Thanks!


 On Wed, Jul 3, 2013 at 11:15 PM, Bogdanov Andrey ba...@mail.ru wrote:

  Hi Andun,

 Unfortunately I can't help you with wicket-ajax (I'm nit familiar with
 wicket).
 Only one remark about onChange - defining onChange for prototype is not
 a good idea, because whiteboard use two auxilary collections which need not
 to be synchronized. onChange function should be defined only for one main
 collection.

 Regards,
 Andrey


 Среда,  3 июля 2013, 22:50 +05:30 от Andun Sameera andun...@gmail.com:
 Hi,
 
 Considering the example which Andrey gave me early, I am planning to do
 this,
 
- Using the method given below, we can get a JSON string for any
 update
happen in Closure WhiteBoard
 
 // to be defined on using of collection
 bay.whiteboard.Collection.prototype.onChange = function(element){
 alert(this.getJson(element));
 }
 
- I will do a Wicket.Ajax call in this JavaScript method to send this
JSON string to the Server Side
- There I process the string and map it to Java Objects
- Then Synchronization happens
 
 As the initial step to do that, I am trying to implement a simple,
 application which can sent JavaScript Ajax calls to Wicket server. I use
 this article
 
 https://cwiki.apache.org/confluence/display/WICKET/Calling+Wicket+from+Javascript.
 I have created the application given below.
 
 public class HomePage extends WebPage {
 private static final long serialVersionUID = 1L;
 
 public HomePage(final PageParameters parameters) {
 super(parameters);
 
 
 final AbstractDefaultAjaxBehavior behave = new
 AbstractDefaultAjaxBehavior() {
 protected void respond(final AjaxRequestTarget target) {
 target.add(new Label(foo, Yeah I was just called from
 Javascript!));
 }
 
 public void renderHead(Component component,IHeaderResponse
 response){
 
 String componentMarkupId = component.getMarkupId();
 String callbackUrl = getCallbackUrl().toString();
 
 response.render(
 JavaScriptHeaderItem.forScript(var
 componentMarkupId='+componentMarkupId+'; var
 callbackUrl='+callbackUrl+';,values));
 }
 };
 
 add(behave);
 
 }
 
 }
 
 and my HomePage.html,
 
 !DOCTYPE HTML
 html
 body
 script src=
 http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js
 /script
 script type=text/javascript
 $(function() {
 var wcall = Wicket.Ajax.get({ u: '${callbackUrl}' + '' });
 alert(wcall);
 });
 /script
 /body
 /html
 
 Still I cant get this to a working position. When I start this
 application,
 wicket-ajax.js file is not loading. Thus console gives following error,
 
 ReferenceError: Wicket is not defined
 [Break On This Error]
 
 var wcall = Wicket.Ajax.get({ u: '${callbackUrl}' + '' });
 
 Still cant find why wicket-ajax is not loaded to my application. Will
 let
 you know further updates!
 
 Thanks!
 
 
 On Tue, Jul 2, 2013 at 2:08 PM, Andun Sameera  andun...@gmail.com 
 wrote:
 
  OK Maxim. Will do it like that!
 
 
  On Tue, Jul 2, 2013 at 2:05 PM, Maxim Solodovnik 
 solomax...@gmail.com wrote:
 
  I would totally disagree with
  At the Wicket Java code we save these elements as Java Objecst which
  contains the JSON strings.
 
  Java objects should contain normal fields like Point center; int
  radius; and be (de)serialized (from)into JSON if necessary.
 
 
   On Tue, Jul 2, 2013 at 2:27 PM, Andun Sameera  
  andun...@gmail.comwrote:
 
  Hi Andrey,
 
  Great! If you can give me a example for,
 
  collection.onChange(element)
 
  it will be highly appreciated.
 
  @Maxim,
 
  After some thinking I cam across of this idea. Please correct me If
 I am
  wrong.
 
 - All the whiteboard elements can be represented as JSON strings
 (Have to find a way to add PDF,DOCs, Pictures to whiteboard in
 this way)
 - At the Wicket Java code we save these elements as Java Objecst
 which contains the JSON strings.
 - To synchronize white board we can send these object to all the
 viewers.
 - To save/load we can use this 

Re: Re[2]: Google Closure Whiteboard

2013-07-04 Thread Andun Sameera
Hi All,

I have create the https://github.com/andunslg/Whiteboard-Wicket repo. I
have committed my POC code there and doing the development on that.

Thanks!

On Thu, Jul 4, 2013 at 12:10 PM, Maxim Solodovnik solomax...@gmail.comwrote:

 sure, please create git repo!

 instead of using Wicket.ajax.get you can use normal *AjaxBehavior you can
 also create functions of it using getCallbackFunction.
 Old OM code had examples of that (was replaced with
 wicketjquieryui-calendar)


 On Thu, Jul 4, 2013 at 3:45 AM, Andun Sameera andun...@gmail.com wrote:

 Hi All,

 I have successfully did a first step integration of Andrey's whiteboard
 with Wicket. Now I can send the JSON string successfully to the JAVA code.
 Now I know the way and will work on formalizing the thing!


 @Andrey

 Can you give me a example to add a onChnage method to main collection. I
 tried to do it. But is fails.

 @ Maxim

 Can I create a Git Repo for the task? Is it going to be a
 wicket-jquery-UI plug-in ? or else ?

 Thanks!


 On Wed, Jul 3, 2013 at 11:18 PM, Andun Sameera andun...@gmail.comwrote:

 Hi Andrey,

 OK will do it like that!

 Thanks!


 On Wed, Jul 3, 2013 at 11:15 PM, Bogdanov Andrey ba...@mail.ru wrote:

  Hi Andun,

 Unfortunately I can't help you with wicket-ajax (I'm nit familiar with
 wicket).
 Only one remark about onChange - defining onChange for prototype is not
 a good idea, because whiteboard use two auxilary collections which need not
 to be synchronized. onChange function should be defined only for one main
 collection.

 Regards,
 Andrey


 Среда,  3 июля 2013, 22:50 +05:30 от Andun Sameera andun...@gmail.com
 :
 Hi,
 
 Considering the example which Andrey gave me early, I am planning to do
 this,
 
- Using the method given below, we can get a JSON string for any
 update
happen in Closure WhiteBoard
 
 // to be defined on using of collection
 bay.whiteboard.Collection.prototype.onChange = function(element){
 alert(this.getJson(element));
 }
 
- I will do a Wicket.Ajax call in this JavaScript method to send
 this
JSON string to the Server Side
- There I process the string and map it to Java Objects
- Then Synchronization happens
 
 As the initial step to do that, I am trying to implement a simple,
 application which can sent JavaScript Ajax calls to Wicket server. I
 use
 this article
 
 https://cwiki.apache.org/confluence/display/WICKET/Calling+Wicket+from+Javascript.
 I have created the application given below.
 
 public class HomePage extends WebPage {
 private static final long serialVersionUID = 1L;
 
 public HomePage(final PageParameters parameters) {
 super(parameters);
 
 
 final AbstractDefaultAjaxBehavior behave = new
 AbstractDefaultAjaxBehavior() {
 protected void respond(final AjaxRequestTarget target) {
 target.add(new Label(foo, Yeah I was just called
 from
 Javascript!));
 }
 
 public void renderHead(Component component,IHeaderResponse
 response){
 
 String componentMarkupId = component.getMarkupId();
 String callbackUrl = getCallbackUrl().toString();
 
 response.render(
 JavaScriptHeaderItem.forScript(var
 componentMarkupId='+componentMarkupId+'; var
 callbackUrl='+callbackUrl+';,values));
 }
 };
 
 add(behave);
 
 }
 
 }
 
 and my HomePage.html,
 
 !DOCTYPE HTML
 html
 body
 script src=
 http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js
 /script
 script type=text/javascript
 $(function() {
 var wcall = Wicket.Ajax.get({ u: '${callbackUrl}' + '' });
 alert(wcall);
 });
 /script
 /body
 /html
 
 Still I cant get this to a working position. When I start this
 application,
 wicket-ajax.js file is not loading. Thus console gives following error,
 
 ReferenceError: Wicket is not defined
 [Break On This Error]
 
 var wcall = Wicket.Ajax.get({ u: '${callbackUrl}' + '' });
 
 Still cant find why wicket-ajax is not loaded to my application. Will
 let
 you know further updates!
 
 Thanks!
 
 
 On Tue, Jul 2, 2013 at 2:08 PM, Andun Sameera  andun...@gmail.com 
 wrote:
 
  OK Maxim. Will do it like that!
 
 
  On Tue, Jul 2, 2013 at 2:05 PM, Maxim Solodovnik 
 solomax...@gmail.com wrote:
 
  I would totally disagree with
  At the Wicket Java code we save these elements as Java Objecst
 which
  contains the JSON strings.
 
  Java objects should contain normal fields like Point center; int
  radius; and be (de)serialized (from)into JSON if necessary.
 
 
   On Tue, Jul 2, 2013 at 2:27 PM, Andun Sameera  
  andun...@gmail.comwrote:
 
  Hi Andrey,
 
  Great! If you can give me a example for,
 
  collection.onChange(element)
 
  it will be highly appreciated.
 
  @Maxim,
 
  After some thinking I cam across of this idea. Please correct me
 If I am
  wrong.
 
 - All the whiteboard elements can be represented as JSON strings
 (Have to find a way to add PDF,DOCs, Pictures to whiteboard 

Re: Re[2]: Google Closure Whiteboard

2013-07-04 Thread Andun Sameera
Hi Andrey,

Currently I am in the process of Mapping Whiteboard Elements to  Java
Objects. There I noticed that Text fields are bit buggy. I have attached a
screen shot. When we draw a text box, we are shown a label. But I can find
a place to edit it. Also I tried with info tool. When I enter a text using
that, it overlaps as shown in screen shot. Is there a fault in my code ?
You can look at it in the git repo.

Thanks!

On Fri, Jul 5, 2013 at 2:10 AM, Andun Sameera andun...@gmail.com wrote:

 Hi All,

 I have create the https://github.com/andunslg/Whiteboard-Wicket repo. I
 have committed my POC code there and doing the development on that.

 Thanks!


 On Thu, Jul 4, 2013 at 12:10 PM, Maxim Solodovnik solomax...@gmail.comwrote:

 sure, please create git repo!

 instead of using Wicket.ajax.get you can use normal *AjaxBehavior you can
 also create functions of it using getCallbackFunction.
 Old OM code had examples of that (was replaced with
 wicketjquieryui-calendar)


 On Thu, Jul 4, 2013 at 3:45 AM, Andun Sameera andun...@gmail.com wrote:

 Hi All,

 I have successfully did a first step integration of Andrey's whiteboard
 with Wicket. Now I can send the JSON string successfully to the JAVA code.
 Now I know the way and will work on formalizing the thing!


 @Andrey

 Can you give me a example to add a onChnage method to main collection. I
 tried to do it. But is fails.

 @ Maxim

 Can I create a Git Repo for the task? Is it going to be a
 wicket-jquery-UI plug-in ? or else ?

 Thanks!


 On Wed, Jul 3, 2013 at 11:18 PM, Andun Sameera andun...@gmail.comwrote:

 Hi Andrey,

 OK will do it like that!

 Thanks!


 On Wed, Jul 3, 2013 at 11:15 PM, Bogdanov Andrey ba...@mail.ru wrote:

  Hi Andun,

 Unfortunately I can't help you with wicket-ajax (I'm nit familiar with
 wicket).
 Only one remark about onChange - defining onChange for prototype is
 not a good idea, because whiteboard use two auxilary collections which 
 need
 not to be synchronized. onChange function should be defined only for one
 main collection.

 Regards,
 Andrey


 Среда,  3 июля 2013, 22:50 +05:30 от Andun Sameera andun...@gmail.com
 :
 Hi,
 
 Considering the example which Andrey gave me early, I am planning to
 do
 this,
 
- Using the method given below, we can get a JSON string for any
 update
happen in Closure WhiteBoard
 
 // to be defined on using of collection
 bay.whiteboard.Collection.prototype.onChange = function(element){
 alert(this.getJson(element));
 }
 
- I will do a Wicket.Ajax call in this JavaScript method to send
 this
JSON string to the Server Side
- There I process the string and map it to Java Objects
- Then Synchronization happens
 
 As the initial step to do that, I am trying to implement a simple,
 application which can sent JavaScript Ajax calls to Wicket server. I
 use
 this article
 
 https://cwiki.apache.org/confluence/display/WICKET/Calling+Wicket+from+Javascript.
 I have created the application given below.
 
 public class HomePage extends WebPage {
 private static final long serialVersionUID = 1L;
 
 public HomePage(final PageParameters parameters) {
 super(parameters);
 
 
 final AbstractDefaultAjaxBehavior behave = new
 AbstractDefaultAjaxBehavior() {
 protected void respond(final AjaxRequestTarget target) {
 target.add(new Label(foo, Yeah I was just called
 from
 Javascript!));
 }
 
 public void renderHead(Component component,IHeaderResponse
 response){
 
 String componentMarkupId = component.getMarkupId();
 String callbackUrl = getCallbackUrl().toString();
 
 response.render(
 JavaScriptHeaderItem.forScript(var
 componentMarkupId='+componentMarkupId+'; var
 callbackUrl='+callbackUrl+';,values));
 }
 };
 
 add(behave);
 
 }
 
 }
 
 and my HomePage.html,
 
 !DOCTYPE HTML
 html
 body
 script src=
 http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js
 /script
 script type=text/javascript
 $(function() {
 var wcall = Wicket.Ajax.get({ u: '${callbackUrl}' + '' });
 alert(wcall);
 });
 /script
 /body
 /html
 
 Still I cant get this to a working position. When I start this
 application,
 wicket-ajax.js file is not loading. Thus console gives following
 error,
 
 ReferenceError: Wicket is not defined
 [Break On This Error]
 
 var wcall = Wicket.Ajax.get({ u: '${callbackUrl}' + '' });
 
 Still cant find why wicket-ajax is not loaded to my application. Will
 let
 you know further updates!
 
 Thanks!
 
 
 On Tue, Jul 2, 2013 at 2:08 PM, Andun Sameera  andun...@gmail.com 
 wrote:
 
  OK Maxim. Will do it like that!
 
 
  On Tue, Jul 2, 2013 at 2:05 PM, Maxim Solodovnik 
 solomax...@gmail.com wrote:
 
  I would totally disagree with
  At the Wicket Java code we save these elements as Java Objecst
 which
  contains the JSON strings.
 
  Java objects should contain normal fields like Point center; int

Re: Re[2]: Google Closure Whiteboard

2013-07-03 Thread Andun Sameera
Hi All,

I have successfully did a first step integration of Andrey's whiteboard
with Wicket. Now I can send the JSON string successfully to the JAVA code.
Now I know the way and will work on formalizing the thing!


@Andrey

Can you give me a example to add a onChnage method to main collection. I
tried to do it. But is fails.

@ Maxim

Can I create a Git Repo for the task? Is it going to be a wicket-jquery-UI
plug-in ? or else ?

Thanks!

On Wed, Jul 3, 2013 at 11:18 PM, Andun Sameera andun...@gmail.com wrote:

 Hi Andrey,

 OK will do it like that!

 Thanks!


 On Wed, Jul 3, 2013 at 11:15 PM, Bogdanov Andrey ba...@mail.ru wrote:

  Hi Andun,

 Unfortunately I can't help you with wicket-ajax (I'm nit familiar with
 wicket).
 Only one remark about onChange - defining onChange for prototype is not a
 good idea, because whiteboard use two auxilary collections which need not
 to be synchronized. onChange function should be defined only for one main
 collection.

 Regards,
 Andrey


 Среда,  3 июля 2013, 22:50 +05:30 от Andun Sameera andun...@gmail.com:
 Hi,
 
 Considering the example which Andrey gave me early, I am planning to do
 this,
 
- Using the method given below, we can get a JSON string for any
 update
happen in Closure WhiteBoard
 
 // to be defined on using of collection
 bay.whiteboard.Collection.prototype.onChange = function(element){
 alert(this.getJson(element));
 }
 
- I will do a Wicket.Ajax call in this JavaScript method to send this
JSON string to the Server Side
- There I process the string and map it to Java Objects
- Then Synchronization happens
 
 As the initial step to do that, I am trying to implement a simple,
 application which can sent JavaScript Ajax calls to Wicket server. I use
 this article
 
 https://cwiki.apache.org/confluence/display/WICKET/Calling+Wicket+from+Javascript.
 I have created the application given below.
 
 public class HomePage extends WebPage {
 private static final long serialVersionUID = 1L;
 
 public HomePage(final PageParameters parameters) {
 super(parameters);
 
 
 final AbstractDefaultAjaxBehavior behave = new
 AbstractDefaultAjaxBehavior() {
 protected void respond(final AjaxRequestTarget target) {
 target.add(new Label(foo, Yeah I was just called from
 Javascript!));
 }
 
 public void renderHead(Component component,IHeaderResponse
 response){
 
 String componentMarkupId = component.getMarkupId();
 String callbackUrl = getCallbackUrl().toString();
 
 response.render(
 JavaScriptHeaderItem.forScript(var
 componentMarkupId='+componentMarkupId+'; var
 callbackUrl='+callbackUrl+';,values));
 }
 };
 
 add(behave);
 
 }
 
 }
 
 and my HomePage.html,
 
 !DOCTYPE HTML
 html
 body
 script src=
 http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js
 /script
 script type=text/javascript
 $(function() {
 var wcall = Wicket.Ajax.get({ u: '${callbackUrl}' + '' });
 alert(wcall);
 });
 /script
 /body
 /html
 
 Still I cant get this to a working position. When I start this
 application,
 wicket-ajax.js file is not loading. Thus console gives following error,
 
 ReferenceError: Wicket is not defined
 [Break On This Error]
 
 var wcall = Wicket.Ajax.get({ u: '${callbackUrl}' + '' });
 
 Still cant find why wicket-ajax is not loaded to my application. Will let
 you know further updates!
 
 Thanks!
 
 
 On Tue, Jul 2, 2013 at 2:08 PM, Andun Sameera  andun...@gmail.com 
 wrote:
 
  OK Maxim. Will do it like that!
 
 
  On Tue, Jul 2, 2013 at 2:05 PM, Maxim Solodovnik 
 solomax...@gmail.com wrote:
 
  I would totally disagree with
  At the Wicket Java code we save these elements as Java Objecst which
  contains the JSON strings.
 
  Java objects should contain normal fields like Point center; int
  radius; and be (de)serialized (from)into JSON if necessary.
 
 
   On Tue, Jul 2, 2013 at 2:27 PM, Andun Sameera  
  andun...@gmail.comwrote:
 
  Hi Andrey,
 
  Great! If you can give me a example for,
 
  collection.onChange(element)
 
  it will be highly appreciated.
 
  @Maxim,
 
  After some thinking I cam across of this idea. Please correct me If
 I am
  wrong.
 
 - All the whiteboard elements can be represented as JSON strings
 (Have to find a way to add PDF,DOCs, Pictures to whiteboard in
 this way)
 - At the Wicket Java code we save these elements as Java Objecst
 which contains the JSON strings.
 - To synchronize white board we can send these object to all the
 viewers.
 - To save/load we can use this already implemented JSON based
 serialization and de-serialization.
 
  But have to find ways to get all these data from closure
 implementation
  to wicket!
 
  Thanks!
  On Tue, Jul 2, 2013 at 11:28 AM, Bogdanov Andrey  ba...@mail.ru 
 wrote:
 
  Hi Andun,
 
  Whiteboard consists of two main objects: ui-component