JaroslavTulach: /* Old Archetype with Query API */ - 2017-01-17 06:25:47

Old Archetype with Query API

←Older revision Revision as of 06:25, 17 January 2017
Line 59: Line 59:
and the application starts with a [[JavaFX]] WebView and displays your page in it. More info at [[DukeScript]] [https://dukescript.com/update/2015/02/05/New-Version-of-Dukescript.html getting started] page.
and the application starts with a [[JavaFX]] WebView and displays your page in it. More info at [[DukeScript]] [https://dukescript.com/update/2015/02/05/New-Version-of-Dukescript.html getting started] page.
-
 
-
=== Old Archetype with Query API ===
 
-
 
-
This is the original style using experimental ''javaquery'' [[API]]. Just type:
 
-
 
-
<source lang="bash">
 
-
$ mvn archetype:generate -DarchetypeGroupId=org.apidesign.bck2brwsr \
 
-
-DarchetypeArtifactId=bck2brwsr-archetype-html-sample -DarchetypeVersion=0.7
 
-
</source>
 
-
 
-
[[Maven]] will download its libraries. Then it asks few questions (for example name of the project you want to create) and generates the skeleton project for you. When the project is successfully created, switch to the created subfolder:
 
-
 
-
<source lang="bash">
 
-
$ cd nameofyourproject
 
-
</source>
 
-
 
-
and you are ready to compile and launch your first [[Bck2Brwsr]] project:
 
-
 
-
<source lang="bash">
 
-
$ mvn process-classes bck2brwsr:brwsr
 
-
</source>
 
-
 
-
A browser window opens and you can check how easy it is to synchronize content of various elements on the [[HTML]] page, to compute derived properties and how to draw a text on an [[HTML]] canvas.
 
-
 
-
Of course, you don't have to work only from command line. [[Good]] IDEs, including [[NetBeans]] will recognize the generated project without any struggle and provide you all the comfort you are used to when coding in [[Java]].
 
-
 
-
Your [[Java|favourite language]] has just returned [[bck2brwsr]]!
 

JaroslavTulach: /* Knockout4Java + Bck2Brwsr Archetype */ - 2017-01-17 06:25:28

Knockout4Java + Bck2Brwsr Archetype

←Older revision Revision as of 06:25, 17 January 2017
Line 6: Line 6:
<source lang="java">
<source lang="java">
-
$ mvn archetype:generate -DarchetypeGroupId=org.apidesign.html \
+
$ mvn archetype:generate \
-
-DarchetypeArtifactId=knockout4j-archetype \
+
-DarchetypeGroupId=com.dukescript.archetype \
-
-DarchetypeVersion=1.1.2 \
+
-DarchetypeArtifactId=knockout4j-archetype \
-
-Dbck2brwsr=true
+
-DarchetypeVersion=0.16
 +
-Dwebpath=client-web
</source>
</source>
-
Possibly replace the ''1.1.2'' version with newer version if/when available.
+
Possibly replace the ''0.16'' version with newer version if/when available.
[[Maven]] will download its libraries. Then it asks few questions (for example name of the project you want to create) and generates the skeleton project for you. When the project is successfully created, switch to the created subfolder and execute following command in it
[[Maven]] will download its libraries. Then it asks few questions (for example name of the project you want to create) and generates the skeleton project for you. When the project is successfully created, switch to the created subfolder and execute following command in it
<source lang="bash">
<source lang="bash">
-
$ mvn -Pfxbrwsr clean package exec:java
+
$ mvn package
 +
$ mvn -f client process-classes exec:exec
</source>
</source>
Line 22: Line 24:
<source lang="bash">
<source lang="bash">
-
$ mvn -Pbck2brwsr clean package bck2brwsr:show
+
$ mvn -f client-web clean package -DskipTests bck2brwsr:show
</source>
</source>
Line 32: Line 34:
<source lang="bash">
<source lang="bash">
-
$ mvn clean install -Pbck2brwsr
+
$ mvn clean install
-
$ unzip target/*.zip
+
$ unzip client-web/target/*-bck2brwsr.zip
# to test it try firefox
# to test it try firefox
$ firefox public_html/index.html
$ firefox public_html/index.html
Line 41: Line 43:
When unzipped on the server, it is also wise idea to configure it to serve the ''bck2brwsr.js'' as a [[GZip]]ed file. That will get its size to ~200KB.
When unzipped on the server, it is also wise idea to configure it to serve the ''bck2brwsr.js'' as a [[GZip]]ed file. That will get its size to ~200KB.
-
 
-
Btw. If anyone knows how to configure [[Apache]] or other server to do the compression, please leave a note here. Thanks.
 
==== [[Eclipse]] Support ====
==== [[Eclipse]] Support ====
Line 53: Line 53:
<source lang="bash">
<source lang="bash">
-
$ mvn clean install -Pfxbrwsr
+
$ mvn -Pdesktop -f client clean install
-
$ unzip target/*zip
+
$ unzip client/target/*-javafx.zip
-
$ java -jar *-fxbrwsr/*jar
+
$ java -jar *-app/*jar
</source>
</source>
-
and the application starts with a [[JavaFX]] WebView and displays your page in it.
+
and the application starts with a [[JavaFX]] WebView and displays your page in it. More info at [[DukeScript]] [https://dukescript.com/update/2015/02/05/New-Version-of-Dukescript.html getting started] page.
=== Old Archetype with Query API ===
=== Old Archetype with Query API ===

JaroslavTulach: /* Knockout4Java + Bck2Brwsr Archetype */ - 2015-01-27 09:03:00

Knockout4Java + Bck2Brwsr Archetype

←Older revision Revision as of 09:03, 27 January 2015
Line 5: Line 5:
The latest archetype now focuses on integration with [[Knockout4Java]] and its execution in [[Bck2Brwsr]] (for deployment) and [[FXBrwsr]] (for debugging) modes:
The latest archetype now focuses on integration with [[Knockout4Java]] and its execution in [[Bck2Brwsr]] (for deployment) and [[FXBrwsr]] (for debugging) modes:
-
<source lang="java">\
+
<source lang="java">
$ mvn archetype:generate -DarchetypeGroupId=org.apidesign.html \
$ mvn archetype:generate -DarchetypeGroupId=org.apidesign.html \
-DarchetypeArtifactId=knockout4j-archetype \
-DarchetypeArtifactId=knockout4j-archetype \

JaroslavTulach: /* Knockout4Java + Bck2Brwsr Archetype */ - 2015-01-27 09:00:06

Knockout4Java + Bck2Brwsr Archetype

←Older revision Revision as of 09:00, 27 January 2015
Line 5: Line 5:
The latest archetype now focuses on integration with [[Knockout4Java]] and its execution in [[Bck2Brwsr]] (for deployment) and [[FXBrwsr]] (for debugging) modes:
The latest archetype now focuses on integration with [[Knockout4Java]] and its execution in [[Bck2Brwsr]] (for deployment) and [[FXBrwsr]] (for debugging) modes:
-
<source lang="java">
+
<source lang="java">\
-
$ mvn archetype:generate -DarchetypeGroupId=org.apidesign.bck2brwsr \
+
$ mvn archetype:generate -DarchetypeGroupId=org.apidesign.html \
-
-DarchetypeArtifactId=knockout4j-archetype -DarchetypeVersion=0.8.1
+
-DarchetypeArtifactId=knockout4j-archetype \
 +
-DarchetypeVersion=1.1.2 \
 +
-Dbck2brwsr=true
</source>
</source>
-
Possibly replace the ''0.8.1'' version with ''0.9-SNAPSHOT'' or newer versions when available.
+
Possibly replace the ''1.1.2'' version with newer version if/when available.
[[Maven]] will download its libraries. Then it asks few questions (for example name of the project you want to create) and generates the skeleton project for you. When the project is successfully created, switch to the created subfolder and execute following command in it
[[Maven]] will download its libraries. Then it asks few questions (for example name of the project you want to create) and generates the skeleton project for you. When the project is successfully created, switch to the created subfolder and execute following command in it
<source lang="bash">
<source lang="bash">
-
$ mvn process-classes bck2brwsr:brwsr -Pfxbrwsr
+
$ mvn -Pfxbrwsr clean package exec:java
</source>
</source>
Line 20: Line 22:
<source lang="bash">
<source lang="bash">
-
$ mvn process-classes bck2brwsr:brwsr -Pbck2brwsr
+
$ mvn -Pbck2brwsr clean package bck2brwsr:show
</source>
</source>

JaroslavTulach: /* Eclipse Support */ - 2014-09-25 08:10:00

Eclipse Support

←Older revision Revision as of 08:10, 25 September 2014
Line 44: Line 44:
==== [[Eclipse]] Support ====
==== [[Eclipse]] Support ====
-
Yesterday we (Jonathan Fuerth watched be me) managed to open the generated (and compiled) project in [[Eclipse]]. Showed up without errors after adding ''target/generated-sources/annotations/'' as additional source path root. The support for [[AnnotationProcessor]]s was limited, when we added new ''@Property(...)'', we needed to recompile for the IDE to realize what is going on. However the behavior seems acceptable and certainly better than I expected given the fact nobody tested it and designed for it yet.
+
Yesterday we (Jonathan Fuerth watched by me) managed to open the generated (and compiled) project in [[Eclipse]]. Showed up without errors after adding ''target/generated-sources/annotations/'' as additional source path root. The support for [[AnnotationProcessor]]s was limited, when we added new ''@Property(...)'', we needed to recompile for the IDE to realize what is going on. However the behavior seems acceptable and certainly better than I expected given the fact nobody tested it and designed for it yet.
==== Deploy as a Desktop Application ====
==== Deploy as a Desktop Application ====

JaroslavTulach: /* Knockout4Java + Bck2Brwsr Archetype */ - 2014-02-22 10:38:53

Knockout4Java + Bck2Brwsr Archetype

←Older revision Revision as of 10:38, 22 February 2014
Line 7: Line 7:
<source lang="java">
<source lang="java">
$ mvn archetype:generate -DarchetypeGroupId=org.apidesign.bck2brwsr \
$ mvn archetype:generate -DarchetypeGroupId=org.apidesign.bck2brwsr \
-
-DarchetypeArtifactId=knockout4j-archetype -DarchetypeVersion=0.8
+
-DarchetypeArtifactId=knockout4j-archetype -DarchetypeVersion=0.8.1
</source>
</source>
-
Possibly replace the ''0.8'' version with ''0.9-SNAPSHOT'' or newer versions when available.
+
Possibly replace the ''0.8.1'' version with ''0.9-SNAPSHOT'' or newer versions when available.
[[Maven]] will download its libraries. Then it asks few questions (for example name of the project you want to create) and generates the skeleton project for you. When the project is successfully created, switch to the created subfolder and execute following command in it
[[Maven]] will download its libraries. Then it asks few questions (for example name of the project you want to create) and generates the skeleton project for you. When the project is successfully created, switch to the created subfolder and execute following command in it

JaroslavTulach: /* Deploy as a Desktop Application */ - 2013-09-30 06:37:39

Deploy as a Desktop Application

←Older revision Revision as of 06:37, 30 September 2013
Line 56: Line 56:
</source>
</source>
-
and the application start with a [[JavaFX]] WebView and displays your page in it.
+
and the application starts with a [[JavaFX]] WebView and displays your page in it.
=== Old Archetype with Query API ===
=== Old Archetype with Query API ===

JaroslavTulach: /* Eclipse Support */ - 2013-09-26 17:52:30

Eclipse Support

←Older revision Revision as of 17:52, 26 September 2013
Line 44: Line 44:
==== [[Eclipse]] Support ====
==== [[Eclipse]] Support ====
-
Yesterday we (me and Jonathan Fuerth) managed to open the generated (and compiled) project in [[Eclipse]]. Showed up without errors after adding ''target/generated-sources/annotations/'' as additional source path root. The support for [[AnnotationProcessor]]s was limited, when we added new ''@Property(...)'', we needed to recompile for the IDE to realize what is going on. However the behavior seems acceptable and certainly better than I expected given the fact nobody tested it and designed for it yet.
+
Yesterday we (Jonathan Fuerth watched be me) managed to open the generated (and compiled) project in [[Eclipse]]. Showed up without errors after adding ''target/generated-sources/annotations/'' as additional source path root. The support for [[AnnotationProcessor]]s was limited, when we added new ''@Property(...)'', we needed to recompile for the IDE to realize what is going on. However the behavior seems acceptable and certainly better than I expected given the fact nobody tested it and designed for it yet.
==== Deploy as a Desktop Application ====
==== Deploy as a Desktop Application ====

JaroslavTulach: /* Deploy as a Desktop Application */ - 2013-09-26 17:50:19

Deploy as a Desktop Application

←Older revision Revision as of 17:50, 26 September 2013
Line 50: Line 50:
One can also build classical [[Java]] desktop application and deploy it to users as a [[ZIP]] file:
One can also build classical [[Java]] desktop application and deploy it to users as a [[ZIP]] file:
-
<source lang="java">
+
<source lang="bash">
$ mvn clean install -Pfxbrwsr
$ mvn clean install -Pfxbrwsr
$ unzip target/*zip
$ unzip target/*zip

JaroslavTulach: /* Eclipse Support */ - 2013-09-26 17:49:51

Eclipse Support

←Older revision Revision as of 17:49, 26 September 2013
Line 45: Line 45:
Yesterday we (me and Jonathan Fuerth) managed to open the generated (and compiled) project in [[Eclipse]]. Showed up without errors after adding ''target/generated-sources/annotations/'' as additional source path root. The support for [[AnnotationProcessor]]s was limited, when we added new ''@Property(...)'', we needed to recompile for the IDE to realize what is going on. However the behavior seems acceptable and certainly better than I expected given the fact nobody tested it and designed for it yet.
Yesterday we (me and Jonathan Fuerth) managed to open the generated (and compiled) project in [[Eclipse]]. Showed up without errors after adding ''target/generated-sources/annotations/'' as additional source path root. The support for [[AnnotationProcessor]]s was limited, when we added new ''@Property(...)'', we needed to recompile for the IDE to realize what is going on. However the behavior seems acceptable and certainly better than I expected given the fact nobody tested it and designed for it yet.
 +
 +
==== Deploy as a Desktop Application ====
 +
 +
One can also build classical [[Java]] desktop application and deploy it to users as a [[ZIP]] file:
 +
 +
<source lang="java">
 +
$ mvn clean install -Pfxbrwsr
 +
$ unzip target/*zip
 +
$ java -jar *-fxbrwsr/*jar
 +
</source>
 +
 +
and the application start with a [[JavaFX]] WebView and displays your page in it.
=== Old Archetype with Query API ===
=== Old Archetype with Query API ===