Re: [ANNOUNCEMENT] Tapestry 5.8.4 release

2024-02-13 Thread Carlos Montero Canabal
Good job Tapestry Team, congratulations!

I have a question. This release supports Java 21 but checking Tomcat
versions (https://tomcat.apache.org/whichversion.html), If I want to use
Java 21 I have to use Tomcat 11.0.X and this version requires servlet spec
6.1. From the 6.0 version, servlet is provided by jakarta and all package
names switch from javax.servlet to jakarta.servlet.
Any updates about migrating tapestry code from javax to jakarta?

Thank you and keep the great work

Best Regards

Carlos Montero

El lun, 12 feb 2024 a las 17:28, Massimo Lusetti ()
escribió:

> Happy to see a new release!
>
> On Wed, Feb 7, 2024 at 3:02 AM Thiago H. de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > Hello, Tapestry community!
> >
> > Tapestry 5.8.4 has just been released, including some enhancements and
> > bug fixes. It's a
> > a drop-in replacement and recommended upgrade for Tapestry 5.7.0+
> projects.
> >
> > The highlights are the support for Java 21 bytecode, an improvement
> > and a fix in multiple classloader support and the upgrade to the
> > latest Underscore.js version.
> >
> > Full release notes at https://tapestry.apache.org/release-notes-584.html
> .
> >
> > Cheers!
> >
> > --
> > Thiago H. de Paula Figueiredo
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>
> --
> Massimo Lusetti
>


Re: [ANNOUNCEMENT] Tapestry 5.7.1 and 5.6.3 released

2021-03-22 Thread Carlos Montero Canabal
Hi Thiago,

>From my part I only has 1 "public" project:

https://elcocinerocasero.com is a recipe page with more than 10K users per
day (record with 35K users at Christmas). I have an integrated page with
google analytics to show the sessions by month
https://elcocinerocasero.com/estadisticas .Last year, due to COVID, we
received 690K sessions in one month with the same hardware configuration
(tomcat with 2GB of heap, the server has 4GB).

But I have more than 15 projects in production using tapestry 5.4+. The
last 2 projects, I combine Spring boot + Tapestry and it works perfectly.

Best regards

Carlos Montero



El lun, 22 mar 2021 a las 13:11, Thiago H. de Paula Figueiredo (<
thiag...@gmail.com>) escribió:

> Thank *you*, everyone! We have a great team in the PMC, in the committers
> list and in the community!
>
> Also thanks for sharing information about Tapestry usage. This is
> interesting and rewarding! If anyone is interested, we could refresh the
> Powered By section of Tapestry with new companies and projects powered by
> Tapestry. Of course, this is entirely opt-in and I know some information
> cannot be shared due to business and/or confidentiality reasons. You can
> post that here and we, the Tapestry team, we'll add this to the page in the
> project's site. Thanks in advance!
>
> On Sat, Mar 20, 2021 at 2:19 PM Adriaan Joubert 
> wrote:
>
> > Yes, thanks a lot! Tapestry is still one of the best and most productive
> > frameworks out there - we have thousands of lines of tapestry code and
> > multiple websites with complex applications, and keep on adding.
> >
> > Cheers,
> >
> > Adriaan
> >
> > On Sat, 20 Mar 2021 at 03:41, Liu Yong  wrote:
> >
> > > Thiago,
> > >
> > > Thanks for this good news , my previes company use t5 for very huge
> > > company in china in production ...
> > >
> > >
> > > Best regards
> > > hongdengdao
> > >
> > > 2021-03-20 7:01 GMT+08:00, Carlos Montero Canabal
> > > :
> > > > Thank you Thiago,
> > > >
> > > > I'm agree with Svein, in my case:
> > > >
> > > > 3.731.131 users
> > > > 5.922.653 pages
> > > > in one year with a server with 4GB of memory... and It runs very very
> > > > fast... without any restart.
> > > > Keep working that way
> > > >
> > > > Best regards
> > > >
> > > > Carlos Montero
> > > >
> > > >
> > > >
> > > >
> > > > El vie, 19 mar 2021 a las 21:32, Svein Erik Løken (<
> > > > svein.erik.lo...@brav.com>) escribió:
> > > >
> > > >> Thank you! I using Tapestry in production with 1,5 million unique
> > users
> > > >> every year. It handles very high load 
> > > >>
> > > >> S-E
> > > >>
> > > >> -Original Message-
> > > >> From: Thiago H. de Paula Figueiredo 
> > > >> Sent: tirsdag 16. mars 2021 22:30
> > > >> To: Tapestry users 
> > > >> Subject: [ANNOUNCEMENT] Tapestry 5.7.1 and 5.6.3 released
> > > >>
> > > >> Hello!
> > > >>
> > > >> Both are recommended upgrades: 5.6.3 for 5.4 to 5.6.2, 5.7.1 for
> > 5.7.0.
> > > >>
> > > >> Please check the release notes for both:
> > > >> 5.6.3: https://tapestry.apache.org/release-notes-563.html
> > > >> 5.7.1: https://tapestry.apache.org/release-notes-561.html
> > > >>
> > > >> Happy coding!
> > > >>
> > > >> --
> > > >> Thiago
> > > >>
> > > >>
> -
> > > >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > >> For additional commands, e-mail: users-h...@tapestry.apache.org
> > > >>
> > > >>
> > > >
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > >
> > >
> >
>
>
> --
> Thiago
>


Re: [ANNOUNCEMENT] Tapestry 5.7.1 and 5.6.3 released

2021-03-19 Thread Carlos Montero Canabal
Thank you Thiago,

I'm agree with Svein, in my case:

3.731.131 users
5.922.653 pages
in one year with a server with 4GB of memory... and It runs very very
fast... without any restart.
Keep working that way

Best regards

Carlos Montero




El vie, 19 mar 2021 a las 21:32, Svein Erik Løken (<
svein.erik.lo...@brav.com>) escribió:

> Thank you! I using Tapestry in production with 1,5 million unique users
> every year. It handles very high load 
>
> S-E
>
> -Original Message-
> From: Thiago H. de Paula Figueiredo 
> Sent: tirsdag 16. mars 2021 22:30
> To: Tapestry users 
> Subject: [ANNOUNCEMENT] Tapestry 5.7.1 and 5.6.3 released
>
> Hello!
>
> Both are recommended upgrades: 5.6.3 for 5.4 to 5.6.2, 5.7.1 for 5.7.0.
>
> Please check the release notes for both:
> 5.6.3: https://tapestry.apache.org/release-notes-563.html
> 5.7.1: https://tapestry.apache.org/release-notes-561.html
>
> Happy coding!
>
> --
> Thiago
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: CSS files are not combined into one single file

2020-06-19 Thread Carlos Montero Canabal
Hi Dongmei,

I wrote some years ago a mini post about it:
http://tapestry5.dev-util.com/optimization/cssstack

In the example you can see how to create the css stack by maven plugin or,
(my preferred option) by less file. You only have to create a new less file
and import into them all css or less files. For developing (not
production), I always put an If to import the individual files or the stack
to identify the line better when I play with the devtools.

Regards

Carlos Montero

El vie., 19 jun. 2020 a las 3:24, Dongmei Cao ()
escribió:

> Hi Everyone,
>
>
>
> I’m trying to improve the initial loading time of my application. I
> noticed that the CSS files are loaded by one by one. Currently I see 5 CSS
> files from tapestry5, plus a few more from my own application.
>
>
>
> I have upgraded to Tapestry 5.5.0. Per
> https://tapestry.apache.org/assets.html, I have added the following
> dependency
>
>
>
> 
>
> org.apache.tapestry
>
> tapestry-webresources
>
> 5.5.0
>
> 
>
>
>
> And have also configured SymbolConstants.MINIFICATION_ENABLED, "true". I
> can see the CSS files have been minimized. But they are not combined into
> one. Does anyone know what to configure so that the CSS files will be
> combined into one single file?
>
>
>
> Thanks in advance!!
>
> Dongmei
>


Re: Modules into Tapestry 5.5.0

2020-04-14 Thread Carlos Montero Canabal
Thank you so much for your response. I will try tonight and give us some
feedback. I checked that the mixin for autocomplete is failing in
production mode for the same reason. It could be a problem if we import
libraries with no "use strict" restrictions.

Best regards

Carlos Montero

El mar., 14 abr. 2020 a las 18:08, Cezary Biernacki ()
escribió:

> Hi Carlos,
> Tapestry in the production mode minifies all JavaScript. It seems that
> minification in T5.5 adds "'use strict';" pragma to minified files. "'use
> strict';" instructs the browser to fail if anything is wrong with your
> code, instead of trying quietly to fix problems. In your code "init =
> *function*(){"  refers to undeclared variable "init". Non-strict JavaScript
> automatically defines such variable, but in the strict mode it fails with
> the error: "init is not defined". All you need is to declare "init",
> e.g.: "var init = function(){".
>
> "use strict" is generally a good idea, because it ensures that all browser
> will execute your code in the same way, and any typos will not be silently
> ignored. I recommend adding line
> 'use strict';
> at the beginning of your .js file, so the code will work the same way in
> the development and and the production mode.
>
> Best regards,
> Cezary
>
>
>
>
> On Mon, Apr 13, 2020 at 8:45 PM Carlos Montero Canabal <
> carlosmonterocana...@gmail.com> wrote:
>
> > Hi Tapestry users!
> >
> > I'm deploying my first 5.5.0 app into production... and I checked that my
> > modules js doesnt work with production mode = true.
> >
> > Example:
> >
> > article.js:
> >
> > define(["jquery", "prism"], *function*($, Prism) {
> >
> > init = *function*(){
> >
> > Prism && Prism.hasOwnProperty('default') ? Prism['default'] : Prism;
> >
> > }
> >
> > *return*{
> >
> > init : init
> >
> > }
> >
> > });
> >
> >
> > ArticlePage.java
> >
> >
> > javaScriptSupport.require("article").invoke("init");
> >
> >
> > NOTE: It works fine with production mode = false.
> >
> >
> > The error is "RequireJS error: define: init is not defined, modules
> > article".
> >
> >
> > However, if I rewrite my module as below:
> >
> >
> > define(["jquery", "prism"], *function*($, Prism) {
> >
> > *return* *function*(){
> >
> > Prism && Prism.hasOwnProperty('default') ? Prism['default'] : Prism;
> >
> > }
> >
> > });
> >
> >
> > And my javacode to:
> >
> >
> > javaScriptSupport.require("article");
> >
> >
> > It works fine. But I want to define multiple functions inside the same
> > module.
> >
> >
> > In my apps in Tapestry 5.4.X I always use the modules as I wrote before.
> >
> >
> > Any suggestion?
> >
> >
> > For other hand, I think there is a missaligment on tapestry-webresources:
> >
> >
> > [image: image.png]
> >
> > In my project, with maven 3.6.3 protobuf-java is 2.5.0 from less4j but
> > webapp breaks when it inits the closure compiler. I had to fix writing
> the
> > version in my pom to 3.0.2.
> >
> > Best regards
> >
> > Carlos Montero
> >
>


Modules into Tapestry 5.5.0

2020-04-13 Thread Carlos Montero Canabal
Hi Tapestry users!

I'm deploying my first 5.5.0 app into production... and I checked that my
modules js doesnt work with production mode = true.

Example:

article.js:

define(["jquery", "prism"], *function*($, Prism) {

init = *function*(){

Prism && Prism.hasOwnProperty('default') ? Prism['default'] : Prism;

}

*return*{

init : init

}

});


ArticlePage.java


javaScriptSupport.require("article").invoke("init");


NOTE: It works fine with production mode = false.


The error is "RequireJS error: define: init is not defined, modules
article".


However, if I rewrite my module as below:


define(["jquery", "prism"], *function*($, Prism) {

*return* *function*(){

Prism && Prism.hasOwnProperty('default') ? Prism['default'] : Prism;

}

});


And my javacode to:


javaScriptSupport.require("article");


It works fine. But I want to define multiple functions inside the same
module.


In my apps in Tapestry 5.4.X I always use the modules as I wrote before.


Any suggestion?


For other hand, I think there is a missaligment on tapestry-webresources:


[image: image.png]

In my project, with maven 3.6.3 protobuf-java is 2.5.0 from less4j but
webapp breaks when it inits the closure compiler. I had to fix writing the
version in my pom to 3.0.2.

Best regards

Carlos Montero


Re: Apache Tapestry 5.5.0 released

2020-03-23 Thread Carlos Montero Canabal
Thank you so much Tapestry team! I will use it in my next project.

El lun., 23 mar. 2020 a las 22:02, Thiago H. de Paula Figueiredo (<
thiag...@gmail.com>) escribió:

> Hello, everyone!
>
> 5.5.0 has finally arrived! Here are the release notes with the details:
> https://tapestry.apache.org/release-notes-550.html
>
> Here are the highlights:
>
> Support for Java 12 bytecode. TAP5-2588
> Support for on-the-fly TypeScript compilation in the tapestry-webresources
> module.  TAP5-2591
> Ability to use Twitter Bootstrap 3 out-of-the-box (default and same version
> provided by Tapestry 5.4), Twitter Bootstrap 4 out-of-the-box (introduced
> in Tapestry 5.5.0) or provide your own CSS (in this case, Tapestry doesn't
> provide any CSS at all).  TAP5-2612
> The If component now has a then parameter.  TAP5-2615
>
> Happy coding!
>
> --
> Thiago
>


Re: Bootique-tapestry

2020-01-10 Thread Carlos Montero Canabal
Hi Cezary,

For app.properties (app_XX.properties)
@Contribute(ComponentMessagesSource.class) ... works perfectly. Thank you
for you message!

For static files... I was thinking that I will map directly into my
apache/nginx before to redirect to jetty. I asked because until now, with
war package, I had this problem solved very quickly and simple.

Best regards

Carlos Montero


El vie., 10 ene. 2020 a las 14:20, Cezary Biernacki ()
escribió:

> Hi,
> regarding serving static resources if they can be served from URL path
> /assets/ (or other configured via tapestry.asset-path-prefix), then put
> them in META-INF/assets folder (inside src/main/resources for Maven project
> structure). They will handled by Tapestry's AssetsDispatcher and can be
> potentially pre-processed by Tapestry (e.g. compressed). For other files,
> like robots.txt, you can  have special handling in your HomePage that
> either returns them as SteamResponse or redirects to assets. Alternatively
> you might also create your own Dispatcher (like AssetDispatcher). Finally,
> you can use static handling from the stack you are using. I don't know
> Bootique, so I cannot help you with that. I use Tapestry with Dropwizard,
> and e.g. Dropwizard's way for static assets is to use AssetsBundle.
>
> Just for explanation, "src/main/webapp" thing you mentioned is from
> standard Java mechanism for web applications packaged as WAR ("Web
> ARchive"). When the WAR is deployed on an app server, it unpacks the
> archive and configures an implicit servlet to serve static files from
> "webapp" folder.
>
> Regarding app.properties, I put them somewhere on classpath, and register
> them in Tapestry as contribution to ComponentMessagesSource. E.g.:
>
>@Contribute(ComponentMessagesSource.class)
> public static void setupMessages(OrderedConfiguration
> configuration, AssetSource assetSource) {
> configuration.add("my-properties",
> assetSource.resourceForPath("com/example/my-app.properties"));
> }
>
> and put my-app.properties in "com/example" inside "src/main/resources"
>
> Cezary
>
>
>
>
>
>
> On Thu, Jan 9, 2020 at 8:46 PM Carlos Montero Canabal <
> carlosmonterocana...@gmail.com> wrote:
>
> > Hi tapestry users,
> >
> > I'm developing my first bootique-tapestry project and I have some doubts.
> >
> > In "traditional" tapestry projects (using maven), we have the folder
> > src/main/webapp. In this folder I usually put files like robots.txt or
> > another files for google and google bot. This files always showed in the
> > http(s)://mydomain.com/robots.txt. I would like where I can put this
> > static
> > files with bootique.
> >
> > For other hand, the app.properties to use in all webapp have to be placed
> > into src/main/webapp/WEB-INF/app.properties. The same question, where do
> I
> > put this files?
> >
> > As a tapestry user from 2010, I have to say that I love to see
> integrations
> > like bootique (or spring boot) to deploy my webapps easily in new
> > environments (AWS).
> >
> > Best regards
> >
> > Carlos Montero
> >
>


Bootique-tapestry

2020-01-09 Thread Carlos Montero Canabal
Hi tapestry users,

I'm developing my first bootique-tapestry project and I have some doubts.

In "traditional" tapestry projects (using maven), we have the folder
src/main/webapp. In this folder I usually put files like robots.txt or
another files for google and google bot. This files always showed in the
http(s)://mydomain.com/robots.txt. I would like where I can put this static
files with bootique.

For other hand, the app.properties to use in all webapp have to be placed
into src/main/webapp/WEB-INF/app.properties. The same question, where do I
put this files?

As a tapestry user from 2010, I have to say that I love to see integrations
like bootique (or spring boot) to deploy my webapps easily in new
environments (AWS).

Best regards

Carlos Montero


Re: Browser History API

2019-02-20 Thread Carlos Montero Canabal
Hi Geoof,

Yes, I have to use to create a spa. I have an simple example here
http://tapestry5.dev-util.com/specialpages/spa/block1 . You can click on
link Page2 and Page1 an check the ajax requests and the url on browser. You
can click then on Back button and and see how the url and zone content
updates with the specific content. The main tasks are:
- Create the restore url for Back button
- Create a method to init the zone when a user Reload the page (in my
example I do this on IndexPage)

I hope the example helps you.

Regards

Carlos Montero

El jue., 21 feb. 2019 a las 5:39, JumpStart (<
geoff.callender.jumpst...@gmail.com>) escribió:

> Has anyone made use of the browser History API with Tapestry AJAX calls?
>
> I have an essentially single page app, all done with Zones and async event
> links. Tabs down one side flips between major functions (eg. Clients,
> Calendar, Billing), replacing the main pane contents, and clicking on
> buttons and links in the pane will often drill into a sub-function (eg.
> View Client, Pay Invoice). All requests are async=“true” and render Zones.
>
> The problem is that the URL in the browser never changes, so if you choose
> Refresh then you’ll go back to the initially displayed page.
>
> But, the app does support query params in the URLs that can navigate to
> the right place (eg. ?fun=CLIENT=UPDATE). I guess what I’d like is a
> way to tell AjaxResponseRenderer what URL I’d like handed to the browser
> History API, and for it to be done automatically.
>
> Cheers,
>
> Geoff
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: [ANNOUNCEMENT] Tapestry 5.4.4

2018-12-19 Thread Carlos Montero Canabal
I'm serving AMP pages with Tapestry (
https://elcocinerocasero.com/amp/receta/tortilla-de-patata ). I hope to
upload an example to http://tapestry5.dev-util.com/ this weekend with the
workaround to do it... But yes, AMP and XHTML aren´t good friends...

El mié., 19 dic. 2018 a las 17:03, Rafael Bugajewski (<
raf...@juicycocktail.com>) escribió:

> > On 2018-19-12, at 01:23 PM, Thiago H. de Paula Figueiredo <
> thiag...@gmail.com> wrote:
> >
> > Well, some stuff is indeed not simple, and I'd say the form support is
> the
> > part which could use some new components to make at least the simpler
> > scenarios simpler to implement (for example, when there are no loops).
> > Which other areas do you think could or should be simplified?
>
> The one thing that comes straight up from my head is the current
> complexity / pipeline necessary for generating output. A couple of months
> ago I wanted to generate valid AMP pages within Tapestry. After one day of
> research and a non-working proof of concept, I decided to use the Play
> framework for this small customer and it worked right away. Tapestry does
> some processing (necessary for other parts of the framework, AFAIK) that
> makes it hard to generate valid AMP pages. I would really love to use
> Tapestry here, and I don’t think it’s out of scope for the framework.
>
> Best,
> Rafael
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: [ANNOUNCEMENT] Tapestry 5.4.4

2018-12-19 Thread Carlos Montero Canabal
Great news and great work Tapestry Team!

El mié., 19 dic. 2018 a las 0:15, Thiago H. de Paula Figueiredo (<
thiag...@gmail.com>) escribió:

> You're welcome!
>
> Tapestry 5.5, supporting Java 11, will be released in the next couple
> months at most.
>
> On Tue, Dec 18, 2018 at 5:54 PM Cezary Biernacki 
> wrote:
>
> > Thanks. It is good to see a new release.
> >
> > Best regards,
> > Cezary
> >
> >
> > On Tue, Dec 18, 2018 at 7:13 PM Thiago H. de Paula Figueiredo <
> > thiag...@gmail.com> wrote:
> >
> > > Hello, everyone!
> > >
> > > Today the team released Tapestry 5.4.4, a drop-in replacement for
> 5.4.x.
> > >
> > > This is a recommended upgrade due to including one security
> improvement.
> > >
> > > Bugs fixed
> > > [TAP5-2582] - Service creation for Hibernate Session results in
> > > ClassFormatError: Duplicate method name
> > > Improvements
> > > [TAP5-2601] - Add configurable service to block access to classpath
> > assets
> > > [TAP5-2603] - Create HTML5-based date form field component
> > >
> > > --
> > > Thiago
> > >
> >
>
>
> --
> Thiago
>


Re: How to disable the tapestry default loading on refresh page

2018-12-12 Thread Carlos Montero Canabal
Hi,

If you want you can disable it throw SymbolsContants on AppModule

https://tapestry.apache.org/5.4/apidocs/org/apache/tapestry5/SymbolConstants.html#ENABLE_PAGELOADING_MASK

public void contributeApplicationDefaults(MappedConfiguration configuration)
{
  configuration.add(SymbolConstants.ENABLE_PAGELOADING_MASK, "false");
}

El mié., 12 dic. 2018 a las 12:00, Rbsn Lbk ()
escribió:

> Hi,
>
> I am having some issues with the default Tapestry loading on refresh the
> page. I will give more context:
>
> I have an application with tabs, and each tab refresh the page when I click
> it. The issue is, that sometimes  move back and forth between pages and
> other pages freezes my application.
>


Re: favicon.ico

2018-07-29 Thread Carlos Montero Canabal
Hi Geoff,

I think the basic solution is put your favicon.ico into src/main/webapp folder. 
I usually put here the robots.txt and it works fine.

Regards

Carlos Montero

> El 29/7/2018, a las 15:43, JumpStart  
> escribió:
> 
> Is there a way to have Tapestry serve up favicon.ico? That is, an image from 
> a fixed URL? No gzipping, no asset fingerprinting, and no far-future expires 
> header?
> 
> I need this for offline.js . To date I’ve had it call a simple page in the 
> app but sometimes the client gets confused and fails due to CORS. If I use an 
> image instead then CORS will not be an issue. But for simplicity of 
> configuration I would like to point it to its default, favicon.ico .
> 
> Alternatively, what’s a simple way of handling CORS from Tapestry?
> 
> Geoff
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: ServerSocket from within Tapestry

2018-06-07 Thread Carlos Montero Canabal
Hi!

I have to develop a chat on a Tapestry5 app and I have to include WebSockets. 
To do it i put the config below:

I create a ChatServlet class outside Tapestry5 packages

my.package.
chat -> ChatServlet
web.
   pages
   components
   services
   mixins

ChatServlet.java :

package mypackage.chat;

@ServerEndpoint(value = "/chat")
public class ChatServlet extends HttpServlet {

@OnOpen
public void onOpen(Session session) throws Exception {
…

@OnMessage
public void onMessage(Session session, String message) throws Exception 
{
…

AppModule.java:

public static void contributeIgnoredPathsFilter(final Configuration 
configuration) {
configuration.add("/chat.*");
}

web.xml


chat-servlet
mypackage.chat.ChatServlet
1


chat-servlet
/chat


And after to add this config, you can connect directly. With javascript is:

new WebSocket("ws://"+ baseUrl +"/chat”);

I hope the configuration for webapp helps you.

Regards

Carlos Montero Canabal


> El 7/6/2018, a las 8:10, Christopher Dodunski 
>  escribió:
> 
> Thanks Eugen, and where did you place the server-side class decorated with
> @ServerEndpoint("/ws")?  Perhaps it doesn't matter whether it is placed in
> 'pages' or 'services', as Tomcat finds it regardless.
> 
> Is it necessary to invoke new threads (multi-threading) within each of the
> methods decorated with @OnOpen, @OnClose, @OnMessage and @OnError, or does
> Tomcat automatically handle cases of multiple, simultaneous client
> connections?
> 
> I found the below 'howto' on using Tomcat WebSockets, but the client side
> code is implemented in HTML and JavaScript, not Java.  It would be useful
> to find some sample, client-side Java code for connecting and
> communicating via a Tomcat WebSocket.
> 
> https://examples.javacodegeeks.com/enterprise-java/tomcat/apache-tomcat-websocket-tutorial/
> 
> Regards,
> 
> Chris.
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 



Re: Single Page Application

2018-06-05 Thread Carlos Montero Canabal
Hi Tapestry users,

I have just upload a very simple example (but it works perfectly) of a SPA:
http://tapestry5.dev-util.com/specialpages/spa where we have a Route Page
(Index) and separate pages, each one with his internal code/tml.

I'm thinking on upload the source code of my personal website but I think
it worse... I only upload the code necessary to start and understand the
way to do it.

I hope my example helps you

Regards

Carlos Montero Canabal

2018-06-05 1:12 GMT+02:00 Bob Harner :

> Carlos, it'll be great to see that SPA example on your dev-util site.
> Looking forward to it!
>
> On Mon, Jun 4, 2018, 5:05 AM Carlos Montero Canabal <
> carlosmonterocana...@gmail.com> wrote:
>
> > Some years ago I develop mi personal website (
> http://dev.carlosmontero.es
> > <http://dev.carlosmontero.es/>) as a SPA with tapestry using the zones
> > system (you can try navigate and check on Network dev tools the requests
> > and responses). I have to say that for a small project, It´s not so
> > difficult to implement, but for medium-big projects, I think that
> tapestry
> > isn´t the best approach for it. If I have some free time this week I hope
> > to upload a simple example to http://tapestry5.dev-util.com/ <
> > http://tapestry5.dev-util.com/>
> >
> > Regards
> >
> > Carlos Montero
> >
> >
> > > El 3/6/2018, a las 9:07, peter.sk...@ooom.at escribió:
> > >
> > > Hi Juan,
> > >
> > > unfortunatelly I do not have a self-contained example of this approach
> > that I could
> > > provide you now. Here:
> > >
> > >
> > http://apache-tapestry-mailing-list-archives.1045711.
> n5.nabble.com/In-which-direction-is-Tapestry-heading-
> td5733862.html#a5733882
> > >
> > > I posted some JS code which demonstrates, how you can use
> > tapestry-generated html zone
> > > content directly, without the dependency on html forms.
> > > At the same time, values, put in the JSON response object on the server
> > side, are
> > > available in the client response object, which you can use further to
> > customize the
> > > behavior. As Thiago remarked, you can use as many zones, as you need.
> Yo
> > can use them
> > > as a kind of templating, most of them leaving invisible in the
> beginning
> > and switching
> > > them on, depending on the site context.
> > >
> > > The advantage is the power of the component composition of tapestry an
> > its transparence.
> > > Otherwise you would need much more complex ecosystem to reach such a
> > expressiveness.
> > >
> > > If you decide to try to use the approach and remain stuck with some
> > problem, just let
> > > me know, I shall support you, as far as possible.
> > >
> > > With regards, Peter
> > >
> > >> Hi Peter,
> > >>
> > >> do you have any open source example? or maybe if you cannot show any
> > code,
> > >> a link to an explanation, or guidelines, or descrption of how you do
> it?
> > >>
> > >> Thank you.
> > >>
> > >> El mié., 30 may. 2018 18:58,  escribió:
> > >>
> > >>> Hi,
> > >>>
> > >>> I have been experimenting with the combination tapestry + angular
> (1.x)
> > >>> few years ago,
> > >>> then used angular in two commercial projects.
> > >>> After this experience I believe, that it is, at least from my point
> of
> > >>> view, more
> > >>> efficient to use AMD (requireJS) and tapestry components in a way
> that
> > I
> > >>> have shortly
> > >>> described in February this year in an reaction to a question in this
> > >>> mailink list.
> > >>> Nicely structured apps can be built in this way, which are very
> dynamic
> > >>> and responsive
> > >>> as well.
> > >>>
> > >>> regards, Peter
> > >>>
> > >>>> Hi Jay,
> > >>>>
> > >>>> Which easier ways are you envisioning?
> > >>>>
> > >>>> Thanks,
> > >>>>
> > >>>> mrg
> > >>>>
> > >>>>
> > >>>> On Tue, May 29, 2018 at 8:56 PM Jay Ginete <
> killer.tila...@gmail.com>
> > >>> wrote:
> > >>>>
> > >>>>> I blogged about tapestry SPA back in 2013 to see how it works. I
> wa

Re: Single Page Application

2018-06-04 Thread Carlos Montero Canabal
Some years ago I develop mi personal website (http://dev.carlosmontero.es 
) as a SPA with tapestry using the zones system 
(you can try navigate and check on Network dev tools the requests and 
responses). I have to say that for a small project, It´s not so difficult to 
implement, but for medium-big projects, I think that tapestry isn´t the best 
approach for it. If I have some free time this week I hope to upload a simple 
example to http://tapestry5.dev-util.com/ 

Regards

Carlos Montero


> El 3/6/2018, a las 9:07, peter.sk...@ooom.at escribió:
> 
> Hi Juan,
> 
> unfortunatelly I do not have a self-contained example of this approach that I 
> could
> provide you now. Here:
> 
> http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/In-which-direction-is-Tapestry-heading-td5733862.html#a5733882
> 
> I posted some JS code which demonstrates, how you can use tapestry-generated 
> html zone
> content directly, without the dependency on html forms.
> At the same time, values, put in the JSON response object on the server side, 
> are
> available in the client response object, which you can use further to 
> customize the
> behavior. As Thiago remarked, you can use as many zones, as you need. Yo can 
> use them
> as a kind of templating, most of them leaving invisible in the beginning and 
> switching
> them on, depending on the site context.
> 
> The advantage is the power of the component composition of tapestry an its 
> transparence.
> Otherwise you would need much more complex ecosystem to reach such a 
> expressiveness.
> 
> If you decide to try to use the approach and remain stuck with some problem, 
> just let
> me know, I shall support you, as far as possible.
> 
> With regards, Peter
> 
>> Hi Peter,
>> 
>> do you have any open source example? or maybe if you cannot show any code,
>> a link to an explanation, or guidelines, or descrption of how you do it?
>> 
>> Thank you.
>> 
>> El mié., 30 may. 2018 18:58,  escribió:
>> 
>>> Hi,
>>> 
>>> I have been experimenting with the combination tapestry + angular (1.x)
>>> few years ago,
>>> then used angular in two commercial projects.
>>> After this experience I believe, that it is, at least from my point of
>>> view, more
>>> efficient to use AMD (requireJS) and tapestry components in a way that I
>>> have shortly
>>> described in February this year in an reaction to a question in this
>>> mailink list.
>>> Nicely structured apps can be built in this way, which are very dynamic
>>> and responsive
>>> as well.
>>> 
>>> regards, Peter
>>> 
 Hi Jay,
 
 Which easier ways are you envisioning?
 
 Thanks,
 
 mrg
 
 
 On Tue, May 29, 2018 at 8:56 PM Jay Ginete 
>>> wrote:
 
> I blogged about tapestry SPA back in 2013 to see how it works. I was
>>> using
> AngularJS (aka Angular1). I haven't updated it since I came to the
> conclusion there are easier ways to do SPAs.
> 
> 
> 
>>> https://killertilapia.blogspot.com/2013/06/resteasy-tapestry-with-angularjs.html
> 
> On Wed, May 30, 2018 at 1:31 AM, Michael Gentry 
> wrote:
> 
>> Tapestry RESTEasy is also quite nice:
>> 
>> http://www.tynamo.org/tapestry-resteasy+guide/
>> 
>> 
>> 
>> On Fri, May 18, 2018 at 5:40 PM Thiago H. de Paula Figueiredo <
>> thiag...@gmail.com> wrote:
>> 
>>> On Fri, May 18, 2018 at 6:36 PM, Juan 
>> wrote:
>>> 
 Hello, are there any good example of doing a single page
>>> application
>>> using
 Tapestry ?
 
>>> 
>>> Hello!
>>> 
>>> Although Tapestry isn't really built for single page applications,
>>> it
> can
>>> be used to build the server side of them. This section of the
>> documentation
>>> will tell you the easiest way of calling Java code (i.e. event
>>> handler
>>> methods) from JavaScript:
>>> 
>>> https://tapestry.apache.org/ajax-and-zones.html#
>> AjaxandZones-Invokingserver-sideeventhandlermethodsfromJavaScript
>>> .
>>> 
>>> Any further questions, ask away! :)
>>> 
>>> --
>>> Thiago
>>> 
>> 
> 
 
>>> 
>>> 
>>> 
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>> 
>>> 
>> 
> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 



Re: Odd breaking exception in 5.4

2018-05-25 Thread Carlos Montero Canabal
I have this problem in some situations too.

I have a tomcat instance with multiple Tapestry5 apps, some with 5.3 versions 
and anothers with 5.4 versions. To work fine, when I restart the tomcat, I have 
to start / load first the 5.3 apps, and then the 5.4, it’s the only way to run 
everyone in the same tomcat. I didn´t find any solution, I think I would have 
to install 5.3 apps on a dedicated tomcat and 5.4 into another one.

I hope my experience helps you.

Regards

Carlos Montero

> El 24/5/2018, a las 1:07, Richard Frovarp  escribió:
> 
> I'm having some very odd problems with Tapestry 5.4.3. Most of my stuff is on 
> 5.3, so I haven't been able to dig very deep on this, and I'm not quite sure 
> what I'm missing. I'm running Tomcat 8.5.x. Now, it appears that might be 
> from classpath:org/apache/tapestry5/corelib/pages/ExceptionReport.tml. But 
> something else must be generating the error. I've been able to make it go 
> away with a restart of Tomcat, but not of just the app itself. I'm fairly 
> confused. I think that the exception being reported isn't the actual root 
> cause, but rather the exception that is reported due to an error with 
> reporting the actual exception.
> 
> 2018-05-23 17:57:10,697 [ERROR] ioc.Registry java.lang.NullPointerException
> 2018-05-23 17:57:10,698 [ERROR] ioc.Registry Operations trace:
> 2018-05-23 17:57:10,698 [ERROR] ioc.Registry [ 1] Handling page render 
> request for page Index
> 2018-05-23 17:57:10,698 [ERROR] ioc.Registry [ 2] Constructing instance of 
> page class edu.ndsu.eci.international_capstone_exchange.pages.Index
> 2018-05-23 17:57:10,698 [ERROR] ioc.Registry [ 3] Creating ComponentAssembler 
> for edu.ndsu.eci.international_capstone_exchange.pages.Index
> 2018-05-23 17:57:10,698 [ERROR] ioc.Registry [ 4] Parsing component template 
> classpath:edu/ndsu/eci/international_capstone_exchange/pages/Index.tml
> 2018-05-23 17:57:10,712 [ERROR] TapestryModule.RequestExceptionHandler 
> Processing of request failed with uncaught exception: 
> org.apache.tapestry5.ioc.internal.OperationException
> org.apache.tapestry5.ioc.internal.OperationException
> at 
> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(OperationTrackerImpl.java:186)
> at 
> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:90)
> at 
> org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:72)
> at 
> org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1260)
> at 
> org.apache.tapestry5.internal.services.TemplateParserImpl.parseTemplate(TemplateParserImpl.java:57)
> at $TemplateParser_95423bef7.parseTemplate(Unknown Source)
> at 
> org.apache.tapestry5.internal.services.ComponentTemplateSourceImpl.parseTemplate(ComponentTemplateSourceImpl.java:190)
> at 
> org.apache.tapestry5.internal.services.ComponentTemplateSourceImpl.getTemplate(ComponentTemplateSourceImpl.java:162)
> at $ComponentTemplateSource_95423bef6.getTemplate(Unknown Source)
> at 
> org.apache.tapestry5.internal.pageload.PageLoaderImpl$4.invoke(PageLoaderImpl.java:258)
> at 
> org.apache.tapestry5.internal.pageload.PageLoaderImpl$4.invoke(PageLoaderImpl.java:251)
> at 
> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:82)
> at 
> org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:72)
> at 
> org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1260)
> 
> snip
> 
> Caused by: java.lang.NullPointerException
> at 
> org.apache.tapestry5.internal.services.XMLTokenStream.getLocation(XMLTokenStream.java:487)
> at 
> org.apache.tapestry5.internal.services.SaxTemplateParser.parse(SaxTemplateParser.java:181)
> at 
> org.apache.tapestry5.internal.services.TemplateParserImpl$1.invoke(TemplateParserImpl.java:61)
> at 
> org.apache.tapestry5.internal.services.TemplateParserImpl$1.invoke(TemplateParserImpl.java:58)
> at 
> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:82)
> ... 102 more
> 2018-05-23 17:57:10,804 [ERROR] ioc.Registry java.lang.NullPointerException
> 2018-05-23 17:57:10,804 [ERROR] ioc.Registry Operations trace:
> 2018-05-23 17:57:10,804 [ERROR] ioc.Registry [ 1] Constructing instance of 
> page class org.apache.tapestry5.corelib.pages.ExceptionReport
> 2018-05-23 17:57:10,804 [ERROR] ioc.Registry [ 2] Creating ComponentAssembler 
> for org.apache.tapestry5.corelib.pages.ExceptionReport
> 2018-05-23 17:57:10,804 [ERROR] ioc.Registry [ 3] Parsing component template 
> classpath:org/apache/tapestry5/corelib/pages/ExceptionReport.tml
> 
> 
> To add to the confusion, I've never had the error trigger when running on my 
> workstation using Tomcat, just as installed on our server. Almost 

Re: Create components dynamically and add to page

2018-04-12 Thread Carlos Montero Canabal
Hi Thiago, 

Thank you for your reply.

Yes, I know that the correct subject would be “adding components dynamically to 
a page” and not the “create” term. I develop the solution bellow that works 
fine for me:



















And my .java:

public Object getDynamicWidget(){
WidgetFacade widgetFacade = (WidgetFacade) 
componentSource.getComponent("Index:" + widget.getWidget().getComponentId());
Map<String, String> configuration = new HashMap<String, 
String>();
for(WidgetConfiguration conf : widget.getConfigurations()){
configuration.put(conf.getConfigurationKey(), 
conf.getConfigurationValue());
}
widgetFacade.init(configuration);
return widgetFacade;
}

I wanted to skip the block “widgetsDefinition” but it’s not possible. 

Thank you

Best regards

Carlos Montero

> El 12/4/2018, a las 21:55, Thiago H. de Paula Figueiredo <thiag...@gmail.com> 
> escribió:
> 
> On Thu, Apr 12, 2018 at 1:52 PM, Carlos Montero Canabal <
> carlosmonterocana...@gmail.com> wrote:
> 
>> Hi tapestry users,
>> 
> 
> Hello!
> 
> Being pedantic and accurate, the subject line of your e-mail is incorrect:
> Tapestry 5 doesn't support adding components dynamically to a page or
> component. The structure of pages and components are strictly static. You
> need to declare a component in a template in order to use it. There are no
> exceptions.
> 
> On the other hand, you have all the freedom to run your templates in any
> way you choose, with logic dictating what gets actually rendered.
> 
> 
>> I’m developing a configurable dashboard page where a user can select
>> different widgets to his own dashboard. I’m thinking on save on database
>> the widgets with his configuration per user. I would like to do something
>> like this:
>> 
>> 
>>
>> 
>> 
>> And in my page class something like:
>> 
>> public Block getCreateWidget(){
>> 
>>return componentSource.getComponent(widget.getComponentClassName());
>> > logical page names —>
>> }
>> 
>> Where widget.getComponentClassName() returns, for example,
>> "components/Widget1” or “my.package.components.Widget1".
>> 
>> Do you know if it’s possible this approach on Tapestry5?? With pages it
>> works fine (I do it multiple times for email rendering), but with
>> components I don’t found a method o service…
>> 
> 
> Using the Delegate component to dynamically choose which Block or component
> instance to render is correct. On the other hand, the getCreateWidget()
> method as described above won't work at all.
> 
> What actually works is declaring s in a page, using
> ComponentSource.getPage() to get an instance of that page, which is
> returned as a Component instance, then calling
> getComponentResources().getBlock(String id) to get the Block instance to
> pass to the Delegate component. That's exactly how the BeanModel-based
> components, such as Grid, BeanEditor, BeanDisplay and BeanEditForm work.
> 
> 
>> Thank you everyone
>> 
>> Best regards
>> 
>> Carlos Montero
>> 
>> http://tapestry5.dev-util.com/ <http://tapestry5.dev-util.com/>
>> 
>> 
>> 
> 
> 
> -- 
> Thiago



Create components dynamically and add to page

2018-04-12 Thread Carlos Montero Canabal
Hi tapestry users,

I’m developing a configurable dashboard page where a user can select different 
widgets to his own dashboard. I’m thinking on save on database the widgets with 
his configuration per user. I would like to do something like this:


 
  

And in my page class something like:

public Block getCreateWidget(){

return componentSource.getComponent(widget.getComponentClassName()); 

}

Where widget.getComponentClassName() returns, for example, "components/Widget1” 
or “my.package.components.Widget1".

Do you know if it’s possible this approach on Tapestry5?? With pages it works 
fine (I do it multiple times for email rendering), but with components I don’t 
found a method o service…

For other hand, I found a core component “Dynamic”. Is there any example of use?

Thank you everyone

Best regards

Carlos Montero

http://tapestry5.dev-util.com/ 




Re: [ANN] JumpStart 7 Released!

2018-01-11 Thread Carlos Montero Canabal
Great Job Geoff! Congrats!! I use it every time to resolve doubts ;)

Best regards

Carlos Montero

> El 11/1/2018, a las 14:14, JumpStart  
> escribió:
> 
> Hi all,
> 
> At long last, JumpStart 7 has officially been released, with a downloadable 
> zip file, installation notes, and tips!
> 
> I am still as excited as ever about Tapestry, particularly since 5.4 which 
> has been a stunning upgrade. Its adoption of jQuery, RequireJS, Bootstrap, 
> and Less, has lifted productivity even further than before. In fact my team 
> and I use JumpStart daily for product development. The delay has simply been 
> due to the demands of working in a startup.
> 
> JumpStart can be used here:
> 
>   http://jumpstart.doublenegative.com.au/jumpstart/ 
> 
> 
> And downloaded here:
> 
>   http://jumpstart.doublenegative.com.au/download.html
> 
> And as always, your comments and corrections are encouraged.
> 
> Cheers,
> 
> Geoff


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: How to render a block parameter in component

2017-08-31 Thread Carlos Montero Canabal
Hi!

To render a block you have to write



So, in your layout.ml file:





> El 31/8/2017, a las 8:46, Joshua Richardson  
> escribió:
> 
> I want to pass a block of rendered html as a component parameter.  After 2hrs 
> searching I have been unable to find the right doc or example.  I have a 
> suspicion that it may involve creating a render() handler, but I'm hoping 
> there's a simpler way.
> 
> 
> public class Layout {
> 
>  @Property
> 
>  @Parameter(required = false)
> 
>  private Block headerContent;
> 
> }
> 
> 
> layout.tml >> EOF
> 
> 
> 
> http://www.w3.org/1999/xhtml;
> 
>  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd;
> 
>> 
> 
>  ${prop:headerContent}
> 
> 
> 
> EOF
> 
> 
> page.tml >> EOF2
> 
>  
>  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd;
> 
>  xmlns:p="tapestry:parameter"
> 
>> 
> 
> 
> 
>
> 
>content rendered at page level
> 
>
> 
> 
> 
> EOF2
> 
> 
> expected output >> EOF3
> 
> 
> 
>   content rendered at page level
> 
> 
> 
> EOF3
> 
> 
> actual output >> EOF4
> 
> 
> 
>   Block[Parameter headerContent of Index:layout, at 
> classpath:com/example/pages/Index.tml, line 6]
> 
> 
> 
> EOF4


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: 5.4.2: How to completely disable Tapestry core stack?

2017-08-29 Thread Carlos Montero Canabal
Hi,

For remove tapestry default css you can see here 
http://tapestry5.dev-util.com/optimization/remove-tapestry-default-css 


For javascript, I think it’s not posible remove core.js (includes requirejs and 
other files that are necessary for success behavior), but I’m not 100% sure.

Regards

> El 29/8/2017, a las 12:07, Rural Hunter  escribió:
> 
> Hi,
> 
> I tried both overriding SymbolConstants.INCLUDE_CORE_STACK and contributing 
> MarkupRenderer to set "ImportCoreStack" to null. But I still see some 
> tapestry core staffs are loaded such as core.js, tapestry.css etc. Why?
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 



Re: Generic advice for upgrading from 5.3.8 to 5.4

2017-06-13 Thread Carlos Montero Canabal
For my experience (I had to upgrade 4 webapps), the mayor change is adapt your 
javascript to AMD Modules with RequireJS. If you use jquery.ready(function(){}) 
in your actual scripts, you have to move these logic to AMD Modules. The final 
result (webapp with Tapestry 5.4.X) is fantastic.


> El 13/6/2017, a las 16:33, Davide Vecchi  escribió:
> 
> Hi everybody,
> 
> We want to upgrade from 5.3.8 to 5.4 and we would like to do some preparation 
> and figure out as much as possible what changes might be needed - if any - so 
> any bit of advice, generic or specific,  and any pointer to related posts or 
> articles would be very welcome.
> 
> F.ex., I have seen some posts triggered by the removal of Scriptaculous and 
> they will be useful if we will be in similar situations, but we would also 
> like to know if there is any advice on how to handle this Scriptaculous 
> change in general (if there is anything to handle at all) or any description 
> of what this change entails from the user's perspective.
> 
> We also found through this mailing list an article which sounds spot-on: 
> https://github.com/bobharner/blog/wiki/Jumping-Into-Tapestry-5.4 .
> 
> We are also using the 5.4 Jumpstart, 
> http://jumpstart.doublenegative.com.au/jumpstart7/ , and the 5.4 release 
> notes (https://github.com/apache/tapestry-5/blob/master/54_RELEASE_NOTES.md).
> 
> Anything related to the upgrade to 5.4 would be of interest.
> 
> Thanks in advance.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Sign in with Facebook component

2017-01-02 Thread Carlos Montero Canabal
http://tapestry5.dev-util.com/javascript/facebooklogin 


A Facebook example with server login

Regards

Carlos Montero

> El 2/1/2017, a las 17:14, Qbyte Consulting  
> escribió:
> 
> I'd like to add a sign in/register with Facebook type component to my apps 
> login page.
> 
> Has anyone created such a component and/or able to shed light?
> 
> John
> 
> Sent from my iPhone
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 



Re: AMP pages with Tapestry

2016-11-30 Thread Carlos Montero Canabal
Thank you for the response.

AMP validation is very restrictive, so I need write  only, not  or .

So, I go for other fast solution which I use in other project to generate 
emails.

I will show the extended solution in my  tapestry5.dev-util.com 
<http://tapestry5.dev-util.com/> webapp, but as a short summary:

AmpPage.java

@Inject
private Block head, body;

...

AmpPage.tml

!doctype html>
http://tapestry.apache.org/schema/tapestry_5_3.xsd;
xmlns:p="tapestry:parameter">



 ...





 ...
 








So AmpPage is the “real" page but it has invalid AMP attributes. So I created a 
AmpExporterPage:

public class AmpExporterPage {

@Inject
private PartialTemplateRenderer partialTemplateRenderer;

@Inject
private ComponentSource componentSource;

@Inject
private Request request;

@Inject
private Environment environment;

public Object onActivate(final EventContext ec) {

return new StreamResponse() {

@Override
public void prepareResponse(final Response response) {

}

@Override
public InputStream getStream() throws IOException {

final AmpPage ampPage = (AmpPage) 
componentSource.getPage(AmpPage.class);
ampPage.onActivate(ec);
ampPage.setupRender();
final Block head = ampPage.getHead();
final Block body = ampPage.getBody();

environment.push(Heartbeat.class, new 
HeartbeatImpl());

String markupHead = 
partialTemplateRenderer.render(head);
String markupBody = 
partialTemplateRenderer.render(body);

markupHead = markupHead.replace(" 
xmlns=\"http://www.w3.org/1999/xhtml\";, "");
markupHead = 
markupHead.replaceAll("amp-boilerplate=\"amp-boilerplate\"", "amp-boilerplate");

markupBody = markupBody.replace(" 
xmlns=\"http://www.w3.org/1999/xhtml\";, "");

final StringBuilder sb = new StringBuilder();
sb.append("").append(markupHead).append(markupBody).append("");
final InputStream is = new 
ByteArrayInputStream(sb.toString().getBytes("UTF-8"));

return is;
}

@Override
public String getContentType() {
return "text/html";
}
};
}

}

I do a speed test and it takes around 40 milliseconds in generate de response, 
so it’s ok for me.

Regards

Carlos Montero


> El 30/11/2016, a las 14:06, Thiago H. de Paula Figueiredo 
> <thiag...@gmail.com> escribió:
> 
> On Tue, Nov 29, 2016 at 6:36 PM, Carlos Montero Canabal <
> carlosmonterocana...@gmail.com> wrote:
> 
>> Hello Tapestry users,
>> 
> 
> Hi!
> 
> 
>> 
>> I would like to create an amp version of my pages into a tapestry5.4
>> webapp. According to https://www.ampproject.org/
>> docs/reference/spec#required-markup <https://www.ampproject.org/
>> docs/reference/spec#required-markup> the root html only would be:
>> 
>> 
>> 
>> Tapestry5 make a xhtml compilation for the .tml, so I ask you if there is
>> any method to:
>> 
> 
> That's not correct. Tapestry 5 uses an XML parser for template files, and
> attributes without values aren't valid XML. You can try .
> 
> 
>> 1. Exclude de xhtml compilation for this pages
>> 2. Intercept the result and modify it to eliminate additional tags added
>> by Tapestry.
>> 3. Create a MarkupModel for AMPHtml?
>> 
> 
> Number 3 above is probably the best idea. You'll need to override the
> MarkupWriterFactory so you can use your AmpMarkupModel.
> 
> --
> Thiago



AMP pages with Tapestry

2016-11-29 Thread Carlos Montero Canabal
Hello Tapestry users,

I would like to create an amp version of my pages into a tapestry5.4 webapp. 
According to https://www.ampproject.org/docs/reference/spec#required-markup 
 the root html 
only would be:



Tapestry5 make a xhtml compilation for the .tml, so I ask you if there is any 
method to:

1. Exclude de xhtml compilation for this pages
2. Intercept the result and modify it to eliminate additional tags added by 
Tapestry.
3. Create a MarkupModel for AMPHtml?

What would be the best solution?

Best regards

Carlos Montero

Tapestry examples page

2016-11-08 Thread Carlos Montero Canabal
Hi tapestry users,

I want to share with us my first version of http://tapestry5.dev-util.com 
 webapp. I love jumpstart project 
(http://jumpstart.doublenegative.com.au/jumpstart7/ 
), so I decided some weeks 
ago to develop something similar with my own use cases.

At the moment there aren´t a lot of examples, but I will hope to develop 2-3 
more per month.

All feedback are welcome.

Regards

Carlos Montero

Re: Ajax self refresh

2016-09-14 Thread Carlos Montero Canabal
Hi,

You can see on http://jumpstart.doublenegative.com.au/jumpstart7/ the examples 
relatives to ajax periodic update

Regards

Carlos Montero 

Enviado desde mi iPhone

> El 14 sept 2016, a las 9:23, Adam X  escribió:
> 
> Hello Tapestry,
> 
> I am implementing a page which displays various transaction counts.
> These counts must be auto refreshed via ajax every few seconds.
> 
> How do I get Tapestry zone to auto refrsh itself? Essentially what I
> want to achieve is something like this:
> 
> http://cdn.crunchify.com/wp-content/uploads/code/Crunchify.Refresh.Div.Without.Reloading.Page.html
> 
> Are there any good examples to achieve this? I'm on Tapestry 5.4.1
> 
> Adam
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


Re: HTTPS on not @Secure page

2016-09-06 Thread Carlos Montero Canabal
Hi Thiago,

I could create a simple project with the problem, but I only know to reproduce 
it on production mode with my valid https certificate, in localhost I don’t 
know how to configure jetty to try it.

However I have fixed the problem. I only use event links to AJAX interactions, 
so in my AppModule I decorate ComponentEventLinkEncoder as below:

public ComponentEventLinkEncoder decorateComponentEventLinkEncoder(
final Request request,
final ComponentEventLinkEncoder oldHandler) {

return new ComponentEventLinkEncoder() {

@Override
public Link createPageRenderLink(final 
PageRenderRequestParameters parameters) {
return 
oldHandler.createPageRenderLink(parameters);
}

@Override
public Link createComponentEventLink(final 
ComponentEventRequestParameters parameters, final boolean forForm) {

final Link link = 
oldHandler.createComponentEventLink(parameters, forForm);
if (request.isSecure()) {

link.setSecurity(LinkSecurity.FORCE_SECURE);
}

return link;
}

@Override
public ComponentEventRequestParameters 
decodeComponentEventRequest(final Request request) {
return 
oldHandler.decodeComponentEventRequest(request);
}

@Override
public PageRenderRequestParameters 
decodePageRenderRequest(final Request request) {
return 
oldHandler.decodePageRenderRequest(request);
}

};
}

And everything works fine for me. This solution is valid but it isn´t the best 
(I think that if a Evenlink is not AJAX and the page is not @Secure, you will 
generate an https request that it isn´t necessary).

I think the solution is modify the Components because they know when they are 
async or with Zone param. For example, for EventLink would be fixed as below:

"EventLink extends AbstractComponentEventLink so we have to modify 
AbstractComponentEventLink”

public abstract class AbstractComponentEventLink extends AbstractLink{

...

void beginRender(MarkupWriter writer)
{
if (isDisabled()) return;

Link link = createLink(context);
if (request.isSecure() && (async || zone != null)){
 link.setSecurity(LinkSecurity.FORCE_SECURE);
}

writeLink(writer, link);

writer.attributes("data-update-zone", zone);

if (async)
{
javaScriptSupport.require("t5/core/zone");
writer.attributes("data-async-trigger", true);
}
}

I’m busy with a deadline now, but in some weeks I can create the sample project 
if you want Thiago. 

Regards

Carlos Montero

http://dev.carlosmontero.es <http://dev.carlosmontero.es/>


> El 2/9/2016, a las 14:13, Thiago H de Paula Figueiredo <thiag...@gmail.com> 
> escribió:
> 
> On Tue, 30 Aug 2016 20:04:58 -0300, Carlos Montero Canabal 
> <carlosmonterocana...@gmail.com <mailto:carlosmonterocana...@gmail.com>> 
> wrote:
> 
> I have configured my webapp with @Secure on pages who need it. But I have a 
> problem when I write manually the URL on browser. If I write https on not 
> @Secure page, the links  (actionLinks with t:zone or t:async for ajax 
> support)  created by tapestry starts with http and browsers blocked the 
> content when I click on them. Any solution? (Yes, I would host all my webapp 
> on https). I think that it is a bug, and Tapestry would see that the request 
> is secure and generate the ajax links secured too.
> 
> Olá, Carlos!
> 
> Yeah, this is indeed a bug. Could you please create a small project which 
> demonstrates this bug and attach it to a new Jira ticket? Thanks in advance. 
> :)
> 
> 
> Regards
> 
> Carlos Montero
> 
> 
> 
> -- 
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br <http://machina.com.br/>


Re: file upload doesn't set file value

2016-08-31 Thread Carlos Montero Canabal
For my experience, FileUpload doesn´t support ajax form (t:async="true" or 
t:zone=“^”).

Regards

Carlos Montero

> El 31/8/2016, a las 22:03, Qbyte Consulting  
> escribió:
> 
> Hi,
> 
> I'm always finding that file is null for file upload? If I submit the form
> without async=true then file value is set and it works.
> 
>
> 
>
>
> validate="required"/>
>
>
> 
>public void onValidateFromUploadForm() {
>if (file != null) {
>File copied = new File("./uploads/" + file.getFileName());
>file.write(copied);
> } else {
> System.out.println("upload failed");
>}
>}



smime.p7s
Description: S/MIME cryptographic signature


HTTPS on not @Secure page

2016-08-30 Thread Carlos Montero Canabal
I have configured my webapp with @Secure on pages who need it. But I have a 
problem when I write manually the URL on browser. If I write https on not 
@Secure page, the links  (actionLinks with t:zone or t:async for ajax support)  
created by tapestry starts with http and browsers blocked the content when I 
click on them. Any solution? (Yes, I would host all my webapp on https). I 
think that it is a bug, and Tapestry would see that the request is secure and 
generate the ajax links secured too.

Regards

Carlos Montero

smime.p7s
Description: S/MIME cryptographic signature


Re: using media attributes with @Import stylesheet

2016-08-11 Thread Carlos Montero Canabal
I think this code would work:

@Environmental
private JavaScriptSupport javaScriptSupport;

@Inject
@Path("css/material/bootstrap-material-design.css")
private Asset materialDesignCss;

void setupRender(){

javaScriptSupport.importStylesheet(new 
StylesheetLink(materialDesignCss, new StylesheetOptions("media and (min-width: 
40.5em)")));

}

@Import is for easy use cases.

Regards

Carlos Montero

> El 11/8/2016, a las 21:46, Qbyte Consulting  
> escribió:
> 
> I'm moving my prototype pages to T5.4.
> 
> I've put this on my Layout class:
> @Import(stylesheet
>= {"context:/layout/style.css",
> "context:/layout/jquery.mobile-1.4.5.min.css"}, library
>= {"context:/js/init.js","jquery.mobile-1.4.5.min.js"})
> 
> How do I handle the media attributes (see below)?
> 
> John
> 
> 
>   media="screen, handheld" />
> media="screen  and (min-width: 40.5em)" />



smime.p7s
Description: S/MIME cryptographic signature


Re: Tapestry vs Spring MVC + REST + Angular

2016-08-02 Thread Carlos Montero Canabal
Hi Geoff,

Can you tell us how you use Tapestry with PhoneGap? My questions are about how 
you embed T5 app into PhoneGap system that requires simple html/js. Do you do 
“Save as” the main IndexPage of Tapestry5 on browser  and put it on PhoneGap 
project? And deploy the t5 app to manage all the zone updates?

Regards

Carlos Montero

> El 2/8/2016, a las 5:54, JumpStart  
> escribió:
> 
> Totally agree. 
> 
> Most recently I’ve built an extensive tablet app using T5.4 + PhoneGap. 
> 
> It’s massively AJAX, but I didn’t have to think about it very much - thanks 
> to Zones.
> 
> It employs only 5 pages instead of a few hundred - thanks to components and 
> Zones. SPA without pain!
> 
> The small amount of custom JavaScript is done as components and is beautiful 
> (I'd never before thought that possible) - thanks to T5.4 using RequireJS.
> 
> It runs so fast - fast enough to fool most into believing it is a native app 
> - thanks to Zones, RequireJS, and T5.4’s asset handling (and AWS)!
> 
> But most of all, it has been a joy to build, and it has let me focus on the 
> domain most of the time, which I can’t say is true of any other framework 
> I’ve used (not even GWT).
> 
> Tapestry, and especially Tapestry 5.4, I take my hat off to you.
> 
> Geoff
> 
>> On 29 Jul 2016, at 8:38 PM, Qbyte Consulting  
>> wrote:
>> 
>> After years of Tapestry focus I finally got around to checking out how
>> others are building web apps these days. Spring MVC + REST and Angular seem
>> to be flavours of the day and can create some quite slick solutions. These
>> approaches are still full of boilerplate code, but things are looking a lot
>> better than the early days of Struts.
>> 
>> So far as I can see Tapestry and maybe GWT are still the only one stop shop
>> for cutting out the boiler plate code and having a focus on domain driven
>> design with components instead of these pattern centric low level
>> approaches.
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 



smime.p7s
Description: S/MIME cryptographic signature


Re: confused about countrycode in data-locale attribute

2016-06-27 Thread Carlos Montero Canabal
I write a jira issue about this problem 
https://issues.apache.org/jira/browse/TAP5-2551 
 some weeks ago.

For my experience, the locale de_DE is the locale of your JVM. As I wrote, "so 
the main bug is in the default locale who returns ThreadLocaleImpl meanwhile 
LocalizationSetter is not called.” 

I have to set ThreadLocale manually (threadLocale.setLocale(new Locale("es"));) 
as a fast fix because my webapps were down in some pages (for the 
loading-mask). I have to put this code on my PageRenderLinkTransformer (I use 
it for SEO):

public PageRenderRequestParameters decodePageRenderRequest(final 
Request request){

...
threadLocale.setLocale(new Locale("es"));
...
}

I hope the Tapestry Team fix the problem in a near future :)

> El 27/6/2016, a las 16:35, D.R.  escribió:
> 
> Hi,
> 
> i want my app in german, so in my appmodule i put
> configuration.add(SymbolConstants.SUPPORTED_LOCALES, "de");
> 
> 1.
> On my index page the html tag is rendered as:
>  xmlns="http://www.w3.org/1999/xhtml;>
> or with productionmode==true:
> http://www.w3.org/1999/xhtml;>
> everything is fine here, just want to mention, that a
> src="/modules.gz/t5/core/messages/de.js" is referenced...
> 
> 2.
> But on some pages the locale includes also the country code, even if my 
> browser locale is english:
>  xmlns="http://www.w3.org/1999/xhtml;>
> or with productionmode==true:
> http://www.w3.org/1999/xhtml;>
> here i see an error in the browser console, that this file can not be 
> retrieved:
> require.js:1910 GET http://localhost:8080/modules.gz/t5/core/messages/de_DE.js
> or with productionmode==true:
> core.js:1912 GET http://localhost:8080/modules.gz/t5/core/messages/de_DE.js
> If the ENABLE_PAGELOADING_MASK is set to true, i will never see the page 
> completely loaded, only the pageloader overlay :-(
> 
> I feel like the data-locale attribute is involved and causes the request for 
> the .js file.
> goolge around i found only that:
> http://tapestry.apache.org/current/coffeescript/messages.html
> 
> I tried to reproduce in a blank t5.4.1 skeleton project, but i am not able to 
> produce a page with data-locale="de_DE"
> 
> Is my assumption right, that this data-locale causes the request for the .js 
> file?
> 
> The data-locale is set here:
> org.apache.tapestry5.internal.services.javascript.ConfigureHTMLElementFilter.renderMarkup(MarkupWriter,
>  MarkupRenderer)
> by threadLocale.getLocale()
> 
> What causes the threadlocale to be sometimes only "de" and sometimes "de_DE" 
> with a resulting de_DE.js request error?
> 
> How can i deal with that problem? Any hints are very welcome.
> 
> 
> Kind regards
> David
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 



Re: bootstrap affix onload not executed

2016-06-21 Thread Carlos Montero Canabal
Hi,

In Tapestry 5.4.X versions "$(window).on('load', function ()" is never call it 
for requireJs. So you can create a module as:

my-affix-module.js (into META-INF/modules folder) with the code

define([“jquery”, “bootstrap/affix"], function($) {

return function(){

$('#myAffix').affix({
  options...
 });

}

});

And require it on .java

void afterRender() {
_javaScriptSupport.require(“my-affix-module”);
}

I think it works

Regards

Carlos Montero

> El 21/6/2016, a las 13:29, D.R.  escribió:
> 
> Hi,
> 
> i try this example:
> http://www.w3schools.com/bootstrap/bootstrap_affix.asp
> 
> with
>void afterRender() {
>_javaScriptSupport.require("bootstrap/affix");
>}
> 
> in a T5.4.1 environment, and the affix.js is loaded, require.js and jquery.js 
> do some initialization, but the
> $(window).on('load', function ()
> is never executed. The js debugger never stops inside that function.
> 
> Any hint what to do in order to get that working?
> 
> 
> Kind regards
> David
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 



Re: IgnoredPathsFilter no longer working with Wildfly10

2016-06-09 Thread Carlos Montero Canabal
I’m using Tapestry 5.4.0 and Tapestry 5.4.1 and I have WS with httpinvoker and 
my app module have the code:

public static void contributeIgnoredPathsFilter(final Configuration 
configuration) {
configuration.add("/adminservices.*");
}

my web.xml


httpinvoker-services
/adminservices/*


And everything works fine!!


> El 9/6/2016, a las 19:49, Cezary Biernacki  escribió:
> 
> I don't use Wildfly, so I can only speculate, but maybe values returned for
> servletPath and pathInfo from HttpServletRequest are subtly different. Try
> debugging service() method in
> org.apache.tapestry5.internal.services.IgnoredPathsFilter class.
> 
> Best regards,
> Cezary
> 
> On Thu, Jun 9, 2016 at 5:59 PM, Hendrik Grewe 
> wrote:
> 
>> Hi!
>> 
>> We recently upgraded our wildfly from 9.0.1.Final to 10.0.0.Final
>> 
>> Since then the IgnoredPathFilter within AppModule.java
>> 
>> public static void contributeIgnoredPathsFilter(Configuration
>> configuration){
>>configuration.add("/rest/.*");
>>}
>> 
>> no longer has any effect. Tapestry also handles URLs  under /rest/ so
>> our REST service is broken.
>> 
>> Any one has had similar issues?
>> 
>> 
>> Tapestry Version 5.3.8
>> 
>> Thanks in advance
>> 
>> Hendrik
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>> 
>> 



Re: Hyphens in URL possible?

2016-05-02 Thread Carlos Montero Canabal
Yes. I do it in many webapps.

AppModule:

@Contribute(PageRenderLinkTransformer.class)
@Primary
public static void provideURLRewriting(final 
OrderedConfiguration configuration) {

configuration.addInstance(
“MyLinkTransformer", MyLinkTransformer.class);
}

For simple pages (without context), I have a utility class with logicalPage 
name and the names into various languages (Spanish and English in the example) 
for better SEO on each language:

private class PageLinkTransFormer {

private final String logical;

private final String linkEs;

private final String linkEn;

public PageLinkTransFormer(final String logical, final String 
linkEs, final String linkEn) {
super();
this.logical = logical;
this.linkEs = linkEs;
this.linkEn = linkEn;
}

public String getLogical() {
return logical;
}

public String getLinkEs() {
return linkEs;
}

public String getLinkEn() {
return linkEn;
}

}


And the MyLinkTransformer Service (in the example, I have the pages 
DevolucionesPage, AvisoLegalPage and SizeGuidePage):

public class MyLinkTransformer implements PageRenderLinkTransformer {

private static final String DEVOLUCIONES_LOGICAL_PAGE_NAME = 
"Devoluciones";

private static final String DEVOLUCIONES_PAGE_URL_ES = 
"/envios-devoluciones-cuidados";

private static final String DEVOLUCIONES_PAGE_URL_EN = 
"/delivery-return-cares";

private static final String AVISO_LEGAL_LOGICAL_PAGE_NAME = 
"AvisoLegal";

private static final String AVISO_LEGAL_PAGE_URL_ES = "/aviso-legal";

private static final String AVISO_LEGAL_PAGE_URL_EN = "/disclaimer";

private static final String SIZE_GUIDE_LOGICAL_PAGE_NAME = "SizeGuide";

private static final String SIZE_GUIDE_PAGE_URL_ES = "/guia-tallas";

private static final String SIZE_GUIDE_PAGE_URL_EN = "/size-guide";

private final List links;

@Inject
private PageRenderLinkSource pageRenderLinkSource;

@Inject
private ContextValueEncoder contextValueEncoder;

@Inject
private ThreadLocale threadLocale;

@Inject
private PersistentLocale persistentLocale;

public MyLinkTransformer() {

links = new ArrayList();

links.add(new PageLinkTransFormer(
DEVOLUCIONES_LOGICAL_PAGE_NAME,
DEVOLUCIONES_PAGE_URL_ES,
DEVOLUCIONES_PAGE_URL_EN));

links.add(new PageLinkTransFormer(
AVISO_LEGAL_LOGICAL_PAGE_NAME,
AVISO_LEGAL_PAGE_URL_ES,
AVISO_LEGAL_PAGE_URL_EN));

links.add(new PageLinkTransFormer(
SIZE_GUIDE_LOGICAL_PAGE_NAME,
SIZE_GUIDE_PAGE_URL_ES,
SIZE_GUIDE_PAGE_URL_EN));

}

@Override
public Link transformPageRenderLink(final Link defaultLink, final 
PageRenderRequestParameters parameters) {

LOGGER.trace("transformPageRenderLink {} ({})", 
parameters.getLogicalPageName(), defaultLink.toAbsoluteURI());

final String locale = threadLocale.getLocale().toString();
for (final PageLinkTransFormer link : links) {
if 
(link.getLogical().equals(parameters.getLogicalPageName())) {
if ("es".equals(locale)) {
return 
defaultLink.copyWithBasePath(link.getLinkEs());
}
else {
return 
defaultLink.copyWithBasePath(link.getLinkEn());
}
}
}

return null;
}

@Override
public PageRenderRequestParameters decodePageRenderRequest(final 
Request request) {

String requestPath = request.getPath();
if (persistentLocale.isSet()) {
requestPath = requestPath.substring(3);
}

for (final PageLinkTransFormer link : links) {
if (requestPath.equals(link.getLinkEn()) || 
requestPath.equals(link.getLinkEs())) {
return new 
PageRenderRequestParameters(link.getLogical(), new EmptyEventContext(), false);
}

}

return null;
}

With context is simple to do it. I hope help you.

Regards

Carlos 

Re: integrating Facebook JS SDK

2016-04-09 Thread Carlos Montero Canabal
In your controller class (.java) you can write this:


javaScriptSupport.addModuleConfigurationCallback(new 
ModuleConfigurationCallback() {

@Override
public JSONObject configure(final JSONObject 
configuration) {
final JSONObject facebookExports = new 
JSONObject();
facebookExports.put("exports", "FB");

configuration.getJSONObject("shim").put("facebook", facebookExports);

final JSONObject paths = new JSONObject();
paths.put("facebook", 
"//connect.facebook.net/es_ES/sdk");
configuration.put("paths", paths);

return configuration;
}
});

And in your module file:

define(['facebook'], function(FB){

init = function(appId){

  FB.init({
appId  : appId,
version: 'v2.5',
xfbml  : true
  });
  
}

return {
init: init
}

});

For example.

I hope help you.

Regards

Carlos Montero


> El 9/4/2016, a las 14:11, Pavel Chernyak  escribió:
> 
> Greetings, Ilya.
> Here is my example for Yandex maps module. As you can see I define
> require.js config in module file.
> 
> requirejs.config({ paths: { 'ymaps': '//api-maps.yandex.ru/2.1/?lang=ru-RU',
> 'geolib': 'map/geolib.min' }, "shim": { 'ymaps': { exports: 'ymaps' },
> 'geolib' : { exports: 'geolib' } } }); define(["jquery", "ymaps",
> "geolib","./lodash.min","./graham_scan.min"], function ($, ymaps,geolib) {
> code... });
> 
> Pavel Chernyak.
> 9 апр. 2016 г. 15:05 пользователь "Ilya Obshadko"  написал:
> 
>> Facebook recommends the following method to integrate FB SDK using AMD
>> approach:
>> https://developers.facebook.com/docs/javascript/howto/requirejs/v2.5
>> 
>> However I can't find any obvious way to configure RequireJS paths in
>> Tapestry.
>> 
>> Is there any way to do it?
>> 
>> --
>> Ilya Obshadko
>> 



Re: [ANNOUNCE] Apache Tapestry 5.4

2016-02-12 Thread Carlos Montero Canabal
I have many apps into production with more than 50.000 users and 200.000
page-views at month and Tapestry works very good. I use Tapestry from
5.1.0.5 and it always run fast and I develop projects very easy and
productive.

I haven´t any problem with 5.4.0 version and I think my webapps (flight
search-engine, e-commerce, booking webapp...) have some complex, not only
"hello world".

2016-02-12 10:53 GMT+01:00 Emmanuel Sowah :

> Basile,
>
> You must be foolish to call me a troll. You folks here at Tapestry fail to
> look beyond your small and narrow-minded community. You behave like a sect.
> Even your sect leader, Howard Lewis Ship, has recently been enlightened and
> have left Tapestry. You guys are now struggling with the pieces he left
> behind. You are just fools. It is really insane people are putting Tapestry
> into production. Just can't believe that. Because Tapestry is a dead
> framework walking.
> Guys, how do you justify that the founder of Tapestry, Howard Lewis Ship,
> is no more using it but using mainly Wicket in all his recent projects? You
> don't need an IQ of Einstein to understand why you also should stop using
> Tapestry. Be wise for once and do the right thing. Simply quit Tapestry!
>
> On Thu, Feb 11, 2016 at 9:39 PM, Basile Chandesris  wrote:
>
> > https://wiki.apache.org/tapestry/Tapestry5Trolls
> >
> >
> > Le 11/02/2016 21:25, JT a écrit :
> >
> >> No wonder itv sucks.
> >> On Dec 25, 2015 5:40 PM, "Kalle Korhonen" 
> >> wrote:
> >>
> >> No, T5.4 was still firmly headed by Howard. He created the first T5.4
> >>> branch over three years (see for example
> >>>
> http://tapestryjava.blogspot.com/2012/10/zeroing-in-on-tapestry-54.html)
> >>> and you can see the results of his mastermind everywhere in the T5.4
> >>> code.
> >>> I guess you could say it was the first release not finished by Howard.
> >>>
> >>> Kalle
> >>>
> >>>
> >>> On Thu, Dec 24, 2015 at 10:23 AM, Alex Kotchnev 
> >>> wrote:
> >>>
> >>> Pretty epic, congrats to all who contributed and participated ! Most
>  notably, this seems like the first Tapestry release that was not
> headed
> 
> >>> by
> >>>
>  Howard (of course, I don't have any stats to back that up).
> 
>  Cheers - Alex K
> 
>  On Tue, Dec 22, 2015 at 8:48 PM, Bob Harner 
>  wrote:
> 
>  The Apache Tapestry developers are proud to announce that Tapestry
> 5.4,
> > a long-awaited major release, is now available for immediate
> download:
> >
> >  http://tapestry.apache.org/download
> >
> > Tapestry 5.4 represents a tremendous effort by a large number of
> > people, and includes almost 200 enhancements and over 300 bug fixes.
> > Full details are in the release notes, but here are a few highlights:
> >
> > * A JavaScript abstraction layer that removes Tapestry's dependence
> > on Prototype and lets you swap in jQuery (or potentially other
> > JavaScript framewords) instead.
> >
> > * JavaScript modules based on RequireJS
> >
> > * A new module, tapestry-webresources, which provides support for
> > automatically compiling CoffeeScript into JavaScript and Less into
> > CSS, and for minimizing CSS and JavaScript. And, best of all, this
> > processing takes place at runtime.
> >
> > * Greatly improved asset caching based on the checksums of file
> > contents, to intelligently cache assets like images and CSS only
> > until their content changes.
> >
> > * The adoption of Bootstrap 3 CSS styling by default, with built-in
> > glyphicon support.
> >
> > ... and many dozens of other significant changes.
> >
> > Despite all the changes, Tapestry 5.4 is still mostly a drop-in
> >
>  replacement
> 
> > for
> > 5.3 users, with the caveat that the adoption of Bootstrap 3 CSS may
> >
>  require
> 
> > some
> > CSS tweaks if you're not already using Bootstrap 3.
> >
> > Please see https://tapestry.apache.org/release-notes-54.html for a
> >
>  full
> >>>
>  list of
> > changes and upgrade instructions.
> >
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>


Re: jss.require(...) code is not executed when using ajaxResponseRenderer.addCallback(new JavaScriptCallback())

2016-02-05 Thread Carlos Montero Canabal
Hi,

Your js file you required is a js module??? I use many times require in a 
callback in tapestry 5.4.0 and it works perfect.

Regards

Carlos Montero 

Enviado desde mi iPhone

> El 5 feb 2016, a las 2:15, g  escribió:
> 
> hello geoff,
> 
> thanks for your feedback, and indeed: I believe it looks very much
> like a tapestry 5.4 bug ;-)
> 
> thanks & kind regards, g.
> 
> On 5 February 2016 at 02:00, JumpStart
>  wrote:
>> Sorry, just looked at your stack overflow example and I’m baffled as to why 
>> it wouldn’t work.
>> 
>> Geoff
>> 
>>> On 5 Feb 2016, at 8:55 AM, JumpStart  
>>> wrote:
>>> 
>>> Here are some working examples that may help.
>>> 
>>> In a callback:
>>> 
>>>  
>>> http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/modal/1
>>> 
>>> In afterRender:
>>> 
>>>  
>>> http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/robust
>>> 
>>> Geoff
>>> 
 On 5 Feb 2016, at 6:52 AM, g  wrote:
 
 hello,
 
 I noticed some inconsistent behavior when calling
 "jss.require(javascript).invoke(functionname).with(arguments)".
 
 if the call is made inside a construct
 "ajaxResponseRenderer.addCallback(new JavaScriptCallback() {public
 void run(JavaScriptSupport jss);}", the javascript code is NOT
 executed, where calling the same code inside void afterRender(){}, it
 DOES get executed correctly.
 
 so, I think there is a problem/bug in the code of the current 5.4.0
 tapestry when processing the jss.require inside a
 JavaScriptCallback...
 my code works fine in 5.3.8 when using the jss.addScript() rather than
 the jss.require...
 
 I posted sample source code on stackoverflow, but have not gotten any
 feedback so far:
 http://stackoverflow.com/questions/35127426/ajaxresponserenderer-addcallback-calling-requirejavascript-is-never-executed-f
 
 thanks for your feedback, g.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: [ANNOUNCE] Apache Tapestry 5.4

2015-12-25 Thread Carlos Montero Canabal
Hi Tapestry team.

I have to give us the congratulations for the release. I’m working with 
tapestry from the Tapestry 5.1.0.5 version. This 5.4 release is a big change 
(javascript) and I have to learn a lot of interesting new concepts.  Thank you 
so much and keep up the good work.

Carlos Montero

> El 24/12/2015, a las 22:02, JT  escribió:
> 
> No concerns. Just my two cents opinion. But does this release support all
> platform that 5.3.x support?



Handling a bad context and component events

2015-09-14 Thread Carlos Montero Canabal
Hi,

I would like to know if I develop the best option to handle a bad context in my 
webapp.

I have a website (http://www.ryalive.com ) with a form 
where you have to put various values. When you search, webapp redirect to 
http://page/arg0/arg1/arg2/arg3  . I have an 
onActivate method with (pseudocode):

Object onActivate(arg0, arg1, arg2, arg3){

if (arg0 == null)
record error;

if (arg1 == null || arg1 is not valid)
record error

…

if (!errors.isEmpty())
return IndexPage.class;

else
return Boolean.TRUE; // And then setupRender method is executed.

}

Problem: if a user remove some parameter from url, onActivate didn´t call it 
because does´t match the number of parameters. So I program another method:

Object onActivate(EventContext ec){

Object[] params = new Object[4];
for(int i=0; i I don’t have to 
validate the params
return Boolean.TRUE;
}

Object[] params = new Object[4];
for(int i=0; i