Re: Experiences with upgrading our apps from 5.8.2 to 5.8.6

2024-05-03 Thread Thiago H. de Paula Figueiredo
On Fri, May 3, 2024 at 3:16 AM Chris Poulsen  wrote:

> > It would help a lot to have an example of class hierarchy not being
> handled
> well. I'll definitely use it.
>
> OK, I'll try to find some time to see if I can create a minimal example
>

Much appreciated!


> > Regarding service classes, field injection is indeed supported
>


> I think both cases that caused these issues was related to (field)
> injecting an Asset (an icon or similar) and the error was something about
> RequestGlobals being null, IIRC
>

This makes sense. RequestGlobals only has its request and response
properties set in web threads (i.e. requests), so, when the service is
instantiated in a non-web-thread, you get an NPE for trying to use a null
request or response object. Another reason for using constructor injection.
:)

-- 
Thiago H. de Paula Figueiredo


Re: Experiences with upgrading our apps from 5.8.2 to 5.8.6

2024-04-30 Thread Thiago H. de Paula Figueiredo
e to
> 'com/dezide/author/gui/base/conversation/ParentConversationPageBase'
>
> but the class is defined as:
>
> public class SelectFaqArticle extends ParentConversationPageBase
>
> The code that failed was calling the following in
> ParentConversationPageBase:
>
> protected void setupParentConversationalSubPage(
> ParentConversationPageBase page )
> {
> conversationPageManager.setupParentConversationalSubPage( page,
> componentResources );
> }
>
> I managed to work around this using an interface on the
> ParentConversationPageBase instead of the concrete class in the signature.
>
> Changing to:
>   interface ParentConversationPage {}
>   class ParentConversationPageBase implements ParentConversationPage
>
> and
>
> protected void setupParentConversationalSubPage( ParentConversationPage
> page )
>
> got things going again.
>
> It seems like there are some regressions around class hierarchies in the
> plastic stuff between 5.8.2 and 5.8.6.
>
> Our actual code is pretty complex (or a mess as some would say), but I can
> try to come up with a simple example, if anyone has a hunch on what is
> wrong / is willing to try and fix it.
>
> --
> Chris
>


-- 
Thiago H. de Paula Figueiredo


[ANNOUNCEMENT] Tapestry 5.8.6 released

2024-04-16 Thread Thiago H. de Paula Figueiredo
Hello, community!

Another month, another bugfix release which should fix exceptions when
running in production mode. Release notes at
https://tapestry.apache.org/release-notes-586.html.

Happy coding!

-- 
Thiago H. de Paula Figueiredo


[WARNING] Don't use Tapestry 5.8.5 in production

2024-04-09 Thread Thiago H. de Paula Figueiredo
Hello, everyone!

2 different Tapestry users warned me of 2 different issues. Thank you very much!

While one of them should be rare and I couldn't reproduce myself, the
other affecting webapps in production mode, breaking pages or
components using  and . That's my fault
and I apologize for that.

Both users, who I'll be happy to name here if they choose so, verified
the problems were solved in the latest 5.8.6 snapshot. One of the
fixes was provided by the user reporting it! The Tapestry community
and its members are awesome. :)

We'll try to get 5.8.6 released as soon as possible

Cheers!

On Mon, Apr 1, 2024 at 7:07 PM Thiago H. de Paula Figueiredo
 wrote:
>
> Hello, Tapestry community!
>
> Apache Tapestry 5.8.5 has just been. It's got 2 bugfixes and it's a
> drop-in replacement and recommended upgrade for Tapestry 5.7.0+ plus
> projects.
>
> Release notes at https://tapestry.apache.org/release-notes-581.html .
>
> Happy coding!
>
> Cheers!
>
> --
> Thiago H. de Paula Figueiredo



-- 
Thiago H. de Paula Figueiredo

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



[ANNOUNCEMENT] Tapestry 5.8.5 released

2024-04-01 Thread Thiago H. de Paula Figueiredo
Hello, Tapestry community!

Apache Tapestry 5.8.5 has just been. It's got 2 bugfixes and it's a
drop-in replacement and recommended upgrade for Tapestry 5.7.0+ plus
projects.

Release notes at https://tapestry.apache.org/release-notes-581.html .

Happy coding!

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



Re: [ANNOUNCEMENT] Tapestry 5.8.4 release

2024-02-14 Thread Thiago H. de Paula Figueiredo
On Tue, Feb 13, 2024 at 6:57 PM David Taylor
 wrote:

> First, thanks for the 5.8.4 release! The timing was perfect since
> underscore.js was one of the items flagged in a recent vulnerability scan.

Nice!

> Given there is no schedule for official Tapestry Jakarta EE support, we
> decided to create and host an internal build of Tapestry. I applied the
> changes provided by Christian Köberl in pull request TAP5-2741 to the
> 5.8.4 sources and everything is looking good so far. Thank you so much
> for providing the pull request!

We already expected Köberl's pull request to work, but it's nice to
see some additional testing being done by the community. :) Thanks you
for that and thanks Köberl for the PR!

> I would be very interested in everyone's thoughts on how the official
> Jakarta EE support should work. Perhaps it would be feasible to create
> an automated patch and build process that can be maintained in parallel
> to the official Tapestry build? While it may not be as elegant as a
> fully integrated approach, I believe it would address the immediate need
> for Jakarta EE artifacts without significantly increasing the
> maintenance costs. Thoughts?

Volker Lamp already tried that approach, but it reached a few dead
ends since it's not just a package name change, but some Servlet API
changes too.

The Tapestry team should announce the project's planned roadmap,
including the Jakarta EE issue, in the upcoming weeks. Stay tuned! :)

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



Re: [ANNOUNCEMENT] Tapestry 5.8.4 release

2024-02-13 Thread Thiago H. de Paula Figueiredo
On Tue, Feb 13, 2024 at 8:20 AM Carlos Montero Canabal
 wrote:

> Good job Tapestry Team, congratulations!

Thanks!

> 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?

We won't provide any schedule, but indeed our main priority now is to
provide a Tapestry version using the jakarta.* packages and Servlet
API 6.

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



[ANNOUNCEMENT] Tapestry 5.8.4 release

2024-02-06 Thread Thiago H. de Paula Figueiredo
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



Re: Reason for PlasticClassLoader Problems

2024-01-18 Thread Thiago H. de Paula Figueiredo
On Tue, Jan 16, 2024 at 5:12 PM Michael Helbig
 wrote:

> Hi

Hi!

Are you running with multiple classloader mode on?

Unless you have something tied specifically to Tomcat, I really prefer
and advise developing Tapestry webapps locally with Jetty.
tapestry-test's JettyRunner class can be used for that (and that's
what I usually use), even though at my day job all webapps run on
Tomcat.

>
> i have a problem with a tapestry app using tapestry 5.8.3 and using
> OpenJDK 11. The Application is working fine in a tomcat instance Version
> 9.x after starting with a "fresh cleared" temp / Work directory.
> Sometime after just restarting the Tomcat Instance without any further
> changes the app having problems on different pages. The problem occures
> on different pages.
>
> Render queue error in BeginRender[SearchResult]: class de. cannot be
> cast to class de. (de. is in unnamed module of loader
> org.apache.tapestry5.internal.plastic.PlasticClassLoader @544a0d3e;
> de. is in unnamed module of loader
> org.apache.tapestry5.internal.plastic.PlasticClassLoader @1e0785a0)
>
> No change on the Application or anything else. Any idea for that ??
> After clearing again the Temp / Work Directory the app starts without
> any problem again.
>
> Thanks in advance.
>
> Michael
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>


-- 
Thiago H. de Paula Figueiredo

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



Re: Help request with LCR and IntelliJ

2023-10-30 Thread Thiago H. de Paula Figueiredo
On Thu, Oct 26, 2023 at 1:50 PM Riccardo De Menna  wrote:

> Hi everyone,

Hi!

Welcome to the Tapestry community!

There's a fundamental difference in how Eclipse and IntelliJ idea work
regarding how they build Java code which affects the Tapestry live
class reloading experience.

Every time you save a Java file in Eclipse, it gets automatically and
instantaneously compiled by default (i.e. unless you disable the
"Build automatically" option).
In IntelliJ, as far as I know, Java files are only compiled when
requested (in most cases, when you ask it to build the project). The
shortcut for build is Control-F9, so I guess we have a typo in the
documentation.

Please let me know if you have further questions.

Cheers!

-- 
Thiago

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



Re: Anyone still using Java 8 in Tapestry webapps

2023-10-05 Thread Thiago H. de Paula Figueiredo
Thank you all for your feedback! It's very important to us. We have no
plans of dropping support for Java 8 in Tapestry.

On Tue, Oct 3, 2023 at 2:34 PM Thiago H. de Paula Figueiredo
 wrote:
>
> Hello, everyone!
>
> While planning the next Tapestry steps, one piece of information that
> would be useful is whether there's still Tapestry webapps out there
> running on Java 8. No need to tell what the webapps are, just raise
> your virtual hand if the answer is yes.
>
> Thanks in advance.
>
> Cheers!
>
> --
> Thiago



-- 
Thiago

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



Anyone still using Java 8 in Tapestry webapps

2023-10-03 Thread Thiago H. de Paula Figueiredo
Hello, everyone!

While planning the next Tapestry steps, one piece of information that
would be useful is whether there's still Tapestry webapps out there
running on Java 8. No need to tell what the webapps are, just raise
your virtual hand if the answer is yes.

Thanks in advance.

Cheers!

-- 
Thiago

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



[ANNOUNCEMENT] Tapestry 5.8.3 released

2023-07-16 Thread Thiago H. de Paula Figueiredo
Hello, Tapestry community!

Tapestry 5.8.3, after a long year, has finally been released, and it
has a long list of release notes! :)
It should very soon be accessible at
https://tapestry.apache.org/release-notes-582.html, but here's a text
version of its highlights (which don't include all enhancements and
bugs):

TAP5-2742 - Smarter page cache invalidation CLOSED Smarter page cache
validation (also known as multiple classloader mode). Besides
collecting dependencies between page, component, mixin and base
classes, this enhancement, when turned on, allows Tapestry to
invalidate just the cached page instances that need to be rebuilt when
a class, template, messages properties or asset is changed. It's
documented in the Multiple Classloader Mode/Smarter Page Class
Invalidation section of the class reloading page.

TAP5-1733 - Throw bespoke exceptions so they may be more easily
identified by Error Handlers CLOSED Tapestry no longer logs an
OperationException when a client submits a form using a method other
than POST. Previously, the log entry would explain that "Forms require
that the request method be POST and that the t:formdata query
parameter have values." Likewise, in production mode, instead of
displaying the error page, Tapestry silently redirects back to the
page containing the form.

TAP5-2708 - CssCompressor update/optimizations RESOLVED TAP5-1733 -
Throw bespoke exceptions so they may be more easily identified by
Error Handlers CLOSED TAP5-2600 - CSS minification breaks transition
statement RESOLVED The YUI CssCompressor got updated to the latest
available code, which fixes multiple issues (TAP5-2753, TAP5-2708,
TAP5-2600).

As Yahoo doesn't develop the Compressor further, a better testing
environment was added to tapestry-webresources to fix any upcoming CSS
compression issues faster.
TAP5-2745 - Tree component with empty list of root nodes causes
NullPointerException RESOLVED The Tree component now gracefully
handles an empty list of root nodes instead of throwing an NPE.

TAP5-2743 - PerThreadValue should provide more convenience methods
RESOLVED Convenience methods added to PerThreadValue for easier use:
T computeIfAbsent(Supplier fn)
T computeIfPresent(Function fn)
T compute(Function fn)
void ifSet(Consumer action)

TAP5-2730 - Misspelt ‘ComnpressedModules’ object id RESOLVED
CookieBuilder now accepts java.time.Duration for its maxAge-related
operation.
Also, a TypeCoercion for TimeInterval->Duration was added, so Duration
is usable for SymbolConstants.COOKIE_MAX_AGE.

TAP5-2735 - LocalizationSetter should add "void
setLocaleFromRequest(Request)" RESOLVED New method void
setNonPersistentLocaleFromRequest(Request request) added to
LocalizationSetter to expose all of the locale handling through the
service.

TAP5-2739 - Remove org.apache.tapestry5.ioc.internal.util.JDKUtils and
org.apache.tapestry5.ioc.internal.util.DummyLock RESOLVED Remnants
from Java 5->6 transitions removed:
org.apache.tapestry5.ioc.internal.util.JDKUtils and
org.apache.tapestry5.ioc.internal.util.DummyLock.

TAP5-2730 - Misspelt ‘ComnpressedModules’ object id RESOLVED Misspelt
internally used id in org.apache.tapestry5.modules fixed
(ComnpressedModules -> CompressedModules)

Happy coding!

-- 
Thiago

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



Re: Avoiding page loading

2023-07-12 Thread Thiago H. de Paula Figueiredo
Hello, Ben!

Your suggestion is great and I've implemented it in
https://github.com/apache/tapestry-5/commit/d6c4324215337b3bfb9ed8e62dd7174e0427410d
. It's some code that will be called a low number times during the
application runtime, so I decided to not try to optimize the
just-1-page-name case.
Cheers!

Th

On Sun, Jun 18, 2023 at 7:33 AM Ben Weidig  wrote:
>
> Hi Thiago,
>
> I like your implementation as a general solution better, as it solves the
> problem in a simple and straightforward way, whereas my approach would only
> provide the tools to build a solution by yourself.
>
> One thing I might have added is a helper method in the ReferenceType to
> create the most common contribution easier, maybe something like this
> pseudo/untested code:
>
> public enum ReferenceType {
> SOFT,
> STRONG;
>
> public PageCachingReferenceTypeService forPages(String...
> canonicalPageNames) {
> // Handle simplest case without allocating a HashSet
> if (canonicalPageNames.length == 1) {
> return pageName ->
> canonicalPageNames[0].equalsIgnoreCase(pageName) ? this : null;
> }
>
> // Prepare the page names for case-insensitive lookup
> Set pageNames = new HashSet<>(canonicalPageNames.length);
> for (String pageName : canonicalPageNames) {
> pageNames.add(pageName.toLowerCase());
> }
>
> return pageName -> pageNames.contains(pageName.toLowerCase()) ?
> this : null;
> }
> }
>
> configuration.add("StrongPages", ReferenceType.STRONG.forPages("VeryLarge",
> "AndTheOtherLargePage"));
>
> Cheers
> Ben
>
> On Sun, Jun 18, 2023 at 12:11 AM Thiago H. de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > Hello!
> >
> > So I've just implemented what I suggested in Tapestry 5.8.3:
> > https://issues.apache.org/jira/browse/TAP5-2756. Example:
> >
> > public static void contributePageCachingReferenceTypeService(
> >   OrderedConfiguration
> > configuration) {
> > configuration.add("VeryLarge", p -> p.equals("VeryLarge") ?
> > ReferenceType.STRONG : null);
> > }
> >
> > This would cause the page named VeryLarge to be cached using a
> > regular, strong, non-garbage-collectable reference while leaving all
> > other pages cached with a soft, garbage-collectable reference.
> >
> > Ben, I find your idea interesting, but I believe it's a bit orthogonal
> > to what I did, both being able to coexist.
> >
> > On Thu, Jan 5, 2023 at 10:23 AM Thiago H. de Paula Figueiredo
> >  wrote:
> > >
> > > Hello, everyone!
> > >
> > > I prefer Ben's idea of a thread or cron job to keep it fresh other
> > > than overriding a service, especially now that I'm working on
> > > something (smarter page invalidation, which is actually smarter
> > > invalidation of some key Tapestry caches) which changes that
> > > PageSourceImpl a bit and this override would likely break live class
> > > reloading. I'd have the cron/thread call ComponentSource.getPage()
> > > instead, since PageSource is an internal service and ComponentSource
> > > isn't.
> > >
> > > Another possibility is to introduce a configuration to tell whether
> > > PageSource should use regular references or soft ones, defaulting to
> > > current behavior. Or a new service to tell whether a specific page
> > > class should use a regular reference instead of a soft one. This would
> > > be more flexible.
> > >
> > > On Wed, Dec 28, 2022 at 6:55 AM Ben Weidig  wrote:
> > > >
> > > > Hi Geoff,
> > > >
> > > > I've read through the SoftReference documentation and as far as I
> > > > understand it the references do only get garbage-collected in case of
> > > > memory-pressure.
> > > > However, the behavior to keep recently used objects is only
> > encouraged, not
> > > > explicitly required.
> > > >
> > > > Looking over the source code, you mabye can replace PageSource with a
> > > > custom implementation that uses another caching implementation.
> > > > Something like this (untested) code maybe?
> > > >
> > > > package tapestry;
> > > >
> > > > import java.lang.ref.SoftReference;
> > > > import java.util.Map;
> > > >
> > > > import org.apache.tapestry5.commons.util.CollectionFactory;
> > > > import org.apache.tapestry5.inte

Re: Problem running Tapestry 5.8.2 with Hibernate 5.4.32.Final

2023-06-27 Thread Thiago H. de Paula Figueiredo
Hello, everyone!

While I believe we should fix this problem in the Tapestry's proxy
creator code, since it may have been happening in non-Hibernate stuff
as well, maybe we could have an interim fix of not using
PropertyShadowBuider to build the Session service? Code is in
HibernateCoreModule.buildSession().

On Sat, Jun 24, 2023 at 11:17 AM Ben Weidig  wrote:
>
> I think I found the issue.
> Not 100% sure yet, but my first tests look good.
>
> The PropertyShadowBuilder got changed in TAP5-2582, so it can handle
> duplicate methods if interfaces extend each other.
>
>
> In the case of Session, however, the return types of the methods differ, as
> it's totally valid to elevate a return type if you extend an interface, as
> long as the new return type extends/implements the previous one.
> The
> org.apache.tapestry5.ioc.internal.services.PropertyShadowBuilderImpl.MethodSignatureUniqueComparator
> is used for sorting the methods, so only the first of each method is used.
>
>
> For example,without checking the return type, the method
>
> public abstract org.hibernate.query.Query
> org.hibernate.SharedSessionContract.getNamedQuery(java.lang.String)
>
> gets removed.
>
>
>
> With comparing return types, the method
>
> public default org.hibernate.Query
> org.hibernate.SharedSessionContract.getNamedQuery(java.lang.String)
>
> gets removed.
>
>
> What confused me was the "default" modifier on the method, as the method
> declarations in the interface don't have a "default" implementations.
> Let's recreate the scenario:
>
> interface Original {
> Number test();
> }
> interface Extended extends Original {
> Double test();
> }
>
> Time for some bytecode:
>
> Classfile /Users/ben/code/tapestry/tapestry-5/Extended.class
>   Last modified 24 Jun 2023; size 254 bytes
>   SHA-256 checksum
> 708c3793a9074f5afdd523542cf287559d5cbeee871a0ca9757444dc28edafe3
>   Compiled from "Extended.java"
> interface Extended extends Original
>   minor version: 0
>   major version: 61
>   flags: (0x0600) ACC_INTERFACE, ACC_ABSTRACT
>   this_class: #2  // Extended
>   super_class: #7 // java/lang/Object
>   interfaces: 1, fields: 0, methods: 2, attributes: 1
> Constant pool:
>#1 = InterfaceMethodref #2.#3  //
> Extended.test:()Ljava/lang/Double;
>#2 = Class  #4 // Extended
>#3 = NameAndType#5:#6  // test:()Ljava/lang/Double;
>#4 = Utf8   Extended
>#5 = Utf8   test
>#6 = Utf8   ()Ljava/lang/Double;
>#7 = Class  #8 // java/lang/Object
>#8 = Utf8   java/lang/Object
>#9 = Class  #10// Original
>   #10 = Utf8   Original
>   #11 = Utf8   ()Ljava/lang/Number;
>   #12 = Utf8   Code
>   #13 = Utf8   LineNumberTable
>   #14 = Utf8   SourceFile
>   #15 = Utf8   Extended.java
> {
>   public abstract java.lang.Double test();
> descriptor: ()Ljava/lang/Double;
> flags: (0x0401) ACC_PUBLIC, ACC_ABSTRACT
>
>   public default java.lang.Number test();
> descriptor: ()Ljava/lang/Number;
> flags: (0x1041) ACC_PUBLIC, ACC_BRIDGE, ACC_SYNTHETIC
> Code:
>   stack=1, locals=1, args_size=1
>  0: aload_0
>  1: invokeinterface #1,  1// InterfaceMethod
> test:()Ljava/lang/Double;
>  6: areturn
>   LineNumberTable:
> line 1: 0
> }
> SourceFile: "Extended.java"
>
> Ok, the "default" method now makes more sense, as the two methods exist on
> the interface but with different return types.
> This might feel like invalid Java, as the return type doesn't count to the
> method signature, but the JVM allows that.
> The ACC_BRIDGE flag means that the method was generated by the compiler to
> "bridge" between the original method declaration and the override.
>
>
> With that knowledge, my hunch is that even though the default method, which
> should call the correct method, can't because, well, Proxies do a lot of
> bytecode magic themselves.
>
>
> On Fri, Jun 23, 2023 at 8:22 PM Vangel V. Ajanovski 
> wrote:
>
> > On 21.6.23 20:32, Volker Lamp wrote:
> > > Is there any chance I can motivate you to contribute your test case as
> > > a unit test to the Tapestry code base? Have a look at the test apps in
> > > tapestry-jpa as a starting point.
> >
> > If I find some free time in the following months to look it up and learn
> > how to create an entire test case. For the time-being it will be faster
> > for me to create a docker container spec to reproduce the bug.
> >
> > As an alternative, I tried to modify the tapestry sources and the
> > existing tests. I have never tried to build tapestry from source in the
> > past, so bare with my ignorance. I cloned the sources from git, and
> > decided for the command line route and just did ./gradlew build.
> >
> > It seems successful. All the .jars are at the 

Re: Avoiding page loading

2023-06-17 Thread Thiago H. de Paula Figueiredo
Hello!

So I've just implemented what I suggested in Tapestry 5.8.3:
https://issues.apache.org/jira/browse/TAP5-2756. Example:

public static void contributePageCachingReferenceTypeService(
  OrderedConfiguration
configuration) {
configuration.add("VeryLarge", p -> p.equals("VeryLarge") ?
ReferenceType.STRONG : null);
}

This would cause the page named VeryLarge to be cached using a
regular, strong, non-garbage-collectable reference while leaving all
other pages cached with a soft, garbage-collectable reference.

Ben, I find your idea interesting, but I believe it's a bit orthogonal
to what I did, both being able to coexist.

On Thu, Jan 5, 2023 at 10:23 AM Thiago H. de Paula Figueiredo
 wrote:
>
> Hello, everyone!
>
> I prefer Ben's idea of a thread or cron job to keep it fresh other
> than overriding a service, especially now that I'm working on
> something (smarter page invalidation, which is actually smarter
> invalidation of some key Tapestry caches) which changes that
> PageSourceImpl a bit and this override would likely break live class
> reloading. I'd have the cron/thread call ComponentSource.getPage()
> instead, since PageSource is an internal service and ComponentSource
> isn't.
>
> Another possibility is to introduce a configuration to tell whether
> PageSource should use regular references or soft ones, defaulting to
> current behavior. Or a new service to tell whether a specific page
> class should use a regular reference instead of a soft one. This would
> be more flexible.
>
> On Wed, Dec 28, 2022 at 6:55 AM Ben Weidig  wrote:
> >
> > Hi Geoff,
> >
> > I've read through the SoftReference documentation and as far as I
> > understand it the references do only get garbage-collected in case of
> > memory-pressure.
> > However, the behavior to keep recently used objects is only encouraged, not
> > explicitly required.
> >
> > Looking over the source code, you mabye can replace PageSource with a
> > custom implementation that uses another caching implementation.
> > Something like this (untested) code maybe?
> >
> > package tapestry;
> >
> > import java.lang.ref.SoftReference;
> > import java.util.Map;
> >
> > import org.apache.tapestry5.commons.util.CollectionFactory;
> > import org.apache.tapestry5.internal.services.PageLoader;
> > import org.apache.tapestry5.internal.services.PageSourceImpl;
> > import org.apache.tapestry5.internal.structure.Page;
> > import
> > org.apache.tapestry5.services.pageload.ComponentRequestSelectorAnalyzer;
> > import org.apache.tapestry5.services.pageload.ComponentResourceSelector;
> >
> > public class CustomPageSourceImpl extends PageSourceImpl {
> >
> > private PageLoader   pageLoader;
> > private ComponentRequestSelectorAnalyzer selectorAnalyzer;
> >
> > public CustomPageSourceImpl(PageLoader pageLoader,
> > ComponentRequestSelectorAnalyzer selectorAnalyzer) {
> > super(pageLoader, selectorAnalyzer);
> > this.pageLoader = pageLoader;
> > this.selectorAnalyzer = selectorAnalyzer;
> >
> > }
> >
> > private static final record CachedPageKey(String pageName,
> > ComponentResourceSelector selector) {
> > }
> >
> > private final Map pageCache =
> > CollectionFactory.newConcurrentMap();
> >
> > public Page getPage(String canonicalPageName)
> > {
> > var selector = selectorAnalyzer.buildSelectorForRequest();
> >
> > var key = new CachedPageKey(canonicalPageName, selector);
> >
> > while (true)
> > {
> > Object cachedObject = pageCache.get(key);
> >
> > Page page = null;
> > if (cachedObject instanceof SoftReference ref) {
> > page = ref == null ? null : (Page) ref.get();
> > } else {
> > page = (Page) cachedObject;
> > }
> >
> > if (page != null)
> > {
> > return page;
> > }
> > // In rare race conditions, we may see the same page loaded
> > multiple times across
> > // different threads. The last built one will "evict" the
> > others from the page cache,
> > // and the earlier ones will be GCed.
> >
> > page = pageLoader.loadPage(canonicalPageName, selector);
> >
> > // TODO: Decide here if how you want to store the Page
> >
> > Object cacheValue = new SoftReference(page);
> 

Re: Problem running Tapestry 5.8.2 with Hibernate 5.4.32.Final

2023-06-15 Thread Thiago H. de Paula Figueiredo
Hello, everyone!

On Sun, Jun 11, 2023 at 2:04 PM Vangel V. Ajanovski  wrote:

> This bug prompts another question that bothers me.
>
> How come nobody else has noticed the bug for two years? I had a report
> in Sep 2021, which did not get an answer, there is another mention on
> Stack Overflow in the last month and now this thread here opened by Chris.

Well, I work with a fairly large project which uses tapestry-hibernate
and Hibernate a lot, in both web and non-web (typically, Quartz jobs,
but not only that) and I haven't run into this problem yet.

> Is this because the bug only occurs in some very specific environments
> (only some specific OS and some specific JDK combination and some
> specific DB driver),

Yeah, it doesn't seem to happen for everyone. tapestry-hibernate has
unit and integration tests and they have been successful.

> or tapestry-hibernate is not in use any more by
> committers and other developers and tapestry-jpa is the preferred way,

tapestry-hibernate is in use by the committers. There's no preference
for it over tapestry-jpa nor the other way around.

> or both are obsolete nowadays and one should pursue some other approach
> to persistence when using Tapestry?

That's definitely not the case.

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


-- 
Thiago

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



Re: Avoiding page loading

2023-01-05 Thread Thiago H. de Paula Figueiredo
Hello, everyone!

I prefer Ben's idea of a thread or cron job to keep it fresh other
than overriding a service, especially now that I'm working on
something (smarter page invalidation, which is actually smarter
invalidation of some key Tapestry caches) which changes that
PageSourceImpl a bit and this override would likely break live class
reloading. I'd have the cron/thread call ComponentSource.getPage()
instead, since PageSource is an internal service and ComponentSource
isn't.

Another possibility is to introduce a configuration to tell whether
PageSource should use regular references or soft ones, defaulting to
current behavior. Or a new service to tell whether a specific page
class should use a regular reference instead of a soft one. This would
be more flexible.

On Wed, Dec 28, 2022 at 6:55 AM Ben Weidig  wrote:
>
> Hi Geoff,
>
> I've read through the SoftReference documentation and as far as I
> understand it the references do only get garbage-collected in case of
> memory-pressure.
> However, the behavior to keep recently used objects is only encouraged, not
> explicitly required.
>
> Looking over the source code, you mabye can replace PageSource with a
> custom implementation that uses another caching implementation.
> Something like this (untested) code maybe?
>
> package tapestry;
>
> import java.lang.ref.SoftReference;
> import java.util.Map;
>
> import org.apache.tapestry5.commons.util.CollectionFactory;
> import org.apache.tapestry5.internal.services.PageLoader;
> import org.apache.tapestry5.internal.services.PageSourceImpl;
> import org.apache.tapestry5.internal.structure.Page;
> import
> org.apache.tapestry5.services.pageload.ComponentRequestSelectorAnalyzer;
> import org.apache.tapestry5.services.pageload.ComponentResourceSelector;
>
> public class CustomPageSourceImpl extends PageSourceImpl {
>
> private PageLoader   pageLoader;
> private ComponentRequestSelectorAnalyzer selectorAnalyzer;
>
> public CustomPageSourceImpl(PageLoader pageLoader,
> ComponentRequestSelectorAnalyzer selectorAnalyzer) {
> super(pageLoader, selectorAnalyzer);
> this.pageLoader = pageLoader;
> this.selectorAnalyzer = selectorAnalyzer;
>
> }
>
> private static final record CachedPageKey(String pageName,
> ComponentResourceSelector selector) {
> }
>
> private final Map pageCache =
> CollectionFactory.newConcurrentMap();
>
> public Page getPage(String canonicalPageName)
> {
> var selector = selectorAnalyzer.buildSelectorForRequest();
>
> var key = new CachedPageKey(canonicalPageName, selector);
>
> while (true)
> {
> Object cachedObject = pageCache.get(key);
>
> Page page = null;
> if (cachedObject instanceof SoftReference ref) {
> page = ref == null ? null : (Page) ref.get();
> } else {
> page = (Page) cachedObject;
> }
>
> if (page != null)
> {
> return page;
> }
> // In rare race conditions, we may see the same page loaded
> multiple times across
> // different threads. The last built one will "evict" the
> others from the page cache,
> // and the earlier ones will be GCed.
>
> page = pageLoader.loadPage(canonicalPageName, selector);
>
> // TODO: Decide here if how you want to store the Page
>
> Object cacheValue = new SoftReference(page);
>
> pageCache.put(key, cacheValue);
> }
> }
> }
>
> I'm not sure what the implications are if a page is kept forever, but as a
> SoftReference isn't guaranteed to be garbage-collected, I don't see an
> immediate downside, except needing more memory.
>
> Alternatively you could trigger the page with a cron job to keep it
> "fresh", but an overriden service is the more robust solution in my opinion.
>
> Cheers
> Ben
>
> On Tue, Dec 27, 2022 at 3:24 PM JumpStart <
> geoff.callender.jumpst...@gmail.com> wrote:
>
> > Hi,
> >
> > I have one page in my production app which takes a long time to load -
> > minimum 18 seconds. Once loaded, it is very quick to request. But from time
> > to time throughout the day, when this page is requested Tapestry decides it
> > has to reload it. I presume this is because the page cache uses
> > SoftReference (PageSourceImpl.pageCache) and the page has been garbage
> > collected. For the unlucky user, they have to wait an unbearably long time.
> > Sometimes when the system is under load the request can even time out. Is
> > there a simple, reliable, safe way to prevent it being garbage collected?
> > Or have I misunderstood what’s going on?
> >
> > Cheers,
> >
> > Geoff
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >



-- 
Thiago


Re: Variable translator for money

2022-08-09 Thread Thiago H. de Paula Figueiredo
Hello!

I'd try @Inject'ing FieldTranslatorSource and use its FieldTranslator
createTranslator(ComponentResources componentResources, String
translatorName) method. The type of the validate parameter of
TextField and any other AbstractTextField subclass isn't Translator,
but FieldTranslator. FieldTranslatorSource.createTranslator() is
exactly what's being used indirectly when you have a
translate="something" in your template (look at
TranslateBindingFactory if you're curious :) ).

On Tue, Aug 9, 2022 at 10:28 AM Adonique Pineda
 wrote:
>
> I would like to provide a variable translator to TextField depending on the
> currency of the user. For example:
>
> *"prop:moneyAmountTranslator"* />
>
> In AppModule I have two money translators defined:
>
> configuration.add("moneyamount_0", *new* MoneyAmountTranslator(
> "moneyamount_0", 0, threadLocale, *false*));
>
> configuration.add("moneyamount_2", *new* MoneyAmountTranslator(
> "moneyamount_2", 2, threadLocale, *false*));
>
> However, I can't figure out how to make one available to the translate
> parameter of the TextField as a variable. How can
> getMoneyAmountTranslator() retrieve one of the above translators? Can they
> be injected?
>
> Cheers,
> Adonique



-- 
Thiago

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



Re: JumpStart is up

2022-07-12 Thread Thiago H. de Paula Figueiredo
Great news! Thanks so much, Geoff! JumpStart is an invaluable resource
for Tapestry users.

On Sun, Jul 10, 2022 at 9:00 PM JumpStart
 wrote:
>
> JumpStart is up! Its new home is https://tapestry-jumpstart.org/jumpstart 
> . Yesterday it had the wrong 
> certificate but that has now been fixed.
>
> Would someone please update the links from the Tapestry site?
>
> Cheers,
>
> Geoff



-- 
Thiago

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



[CVE-2022-31781] Apache Tapestry denial of service vulnerability

2022-07-12 Thread Thiago H. de Paula Figueiredo
Regular Expression Denial of Service (ReDoS) in ContentType.java.
(GHSL-2022-022) (CVE-2022-31781)

PRODUCT AFFECTED:

This issue affects Apache Tapestry 5.8.1.

PROBLEM:

Severity: low

Apache Tapestry up to version 5.8.1 is vulnerable to Regular
Expression Denial of Service (ReDoS) in the way it handles Content
Types. Specially crafted Content Types may cause catastrophic
backtracking, taking exponential time to complete.

Specifically, this is about the regular expression used on the
parameter of the org.apache.tapestry5.http.ContentType class.

Apache Tapestry 5.8.2 has a fix for this vulnerability.

Notice the vulnerability cannot be triggered by web requests in
Tapestry code alone. It would only happen if there's some non-Tapestry
codepath passing some outside input to the ContentType class
constructor.

This issue has been assigned CVE-2022-31781.

MODIFICATION HISTORY:

: Initial Publication.

RELATED LINKS:

CVE-2022-31781 at cve.mitre.org

ACKNOWLEDGEMENTS:

CodeQL team members [@atorralba (Tony
Torralba)](https://github.com/atorralba) and [@joefarebrother (Joseph
Farebrother)](https://github.com/joefarebrother).

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



[ANNOUNCEMENT] Tapestry 5.8.2 released

2022-06-20 Thread Thiago H. de Paula Figueiredo
Hello, community!

Tapestry 5.8.2 has just been released. A drop-in replacement and
recommended upgrade for projects using 5.7.0+.

Besides the usual small fixes and enhancements, 5.8.2 introduces CORS
(Cross-Origin Resource Sharing) support. The goal was to cover as many
scenarios as possible by just setting configuration symbols, while
also allowing customization of almost all of the CORS support code in
a typical Tapestry-IoC way. Documentation at
https://tapestry.apache.org/cors-cross-origin-resource-sharing-support-582.html.

Full release notes at https://tapestry.apache.org/release-notes-582.html.

All feedback welcome!

Happy coding!

-- 
Thiago

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



Re: [ANNOUNCEMENT] Tapestry 5.8.1 released!

2022-04-05 Thread Thiago H. de Paula Figueiredo
Thanks Tim for spotting this and Ben for creating this ticket!

On Tue, Apr 5, 2022 at 3:32 AM D Tim Cummings 
wrote:

> Thanks Thiago
>
> I checked the updates in quickstart and they look great.
>
> One minor thing when running quickstart, the ascii art no longer knows
> which tapestry version is running :(
>
>   __  __ 
> /_  __/__   ___ ___ / /___ __  / __/
>   / / / _ `/ _ \/ -_|_- /_/  \_,_/ .__/\__/___/\__/_/  \_, / //
>  /_/   /___/  UNKNOWN (development mode)
>
> Cheers
>
> Tim
>
> On 4/4/22 21:53, Thiago H. de Paula Figueiredo wrote:
> > Hello, Tapestry community!
> >
> > We've just released Tapestry 5.8.1. It's mostly about getting
> Tapestry-IoC
> > to support all Java language features introduced between Java 9 and 17.
> It
> > also includes some other bug fixes and small improvements.
> >
> > Tapestry 5.8.1 is a drop-in replacement and recommended upgrade for
> > Tapestry 5.7.0+ projects.
> >
> > All the details are in the release notes:
> > https://tapestry.apache.org/release-notes-581.html.
> >
> > As always, if you have questions, post them here in the Tapestry users
> > mailing list.
> >
> > Happy coding!
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-- 
Thiago


[ANNOUNCEMENT] Tapestry 5.8.1 released!

2022-04-04 Thread Thiago H. de Paula Figueiredo
Hello, Tapestry community!

We've just released Tapestry 5.8.1. It's mostly about getting Tapestry-IoC
to support all Java language features introduced between Java 9 and 17.  It
also includes some other bug fixes and small improvements.

Tapestry 5.8.1 is a drop-in replacement and recommended upgrade for
Tapestry 5.7.0+ projects.

All the details are in the release notes:
https://tapestry.apache.org/release-notes-581.html.

As always, if you have questions, post them here in the Tapestry users
mailing list.

Happy coding!

-- 
Thiago


Re: Navigation to section of a page

2022-03-25 Thread Thiago H. de Paula Figueiredo
Nice! Thanks for sharing!

On Thu, Mar 24, 2022 at 10:56 PM Christopher Dodunski (Tapestry) <
chrisfromtapes...@christopher.net.nz> wrote:

> Hi Ben and Thiago,
>
> Thank you for your well considered suggestions on accommodating anchor
> points in returned pages.  I've stored them away for possible future
> use.  I wound up solving the original problem in a rather different way,
> using a RequireJS module.
>
> Background: My web application has a main dashboard page incorporating
> 10 expandable panels, and my original intention was simply in having
> users' browsers return to the correct place on the dashboard after
> temporarily exiting (usually to complete some CRUD action).  The
> particular panel they would've last been using would be in an 'expanded'
> (as opposed to 'collapsed') state, and so I implemented some JS to
> simply scroll the browser to this expanded panel on returning to the
> dashboard - should've thought of this to begin with!
>
> I've included the relevant code snippets below, as this may be of use to
> others looking to do similar. :-)
>
> Kind regards,
>
> Chris Dodunski.
>
>
> ** Dashboard.java **
>
>  @Environmental
>  private JavaScriptSupport javaScriptSupport;
>
>  /**
>   * Scroll to currently expanded panel/zone
>   */
>  public void afterRender(){
>
> javaScriptSupport.require("scroll-to-anchor").with(expandedPanel);
>  }
>
>
> ** scroll-to-anchor.js **
>
> define(["jquery"], function($) {
>
>  return function(aid){
>  var aTag = $("div[id='"+ aid +"']");
>  $('html,body').animate({scrollTop: aTag.offset().top},'slow');
>  }
>
> })
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-- 
Thiago


Re: Navigation to section of a page

2022-03-22 Thread Thiago H. de Paula Figueiredo
On Mon, Mar 21, 2022 at 4:24 AM Ben Weidig  wrote:

> Hi Chris,
>

Hello, Chris and Ben!


>- Allow an anchor at the end of the String, and set it
>PageNameComponentEventResultProcessor
>

You mean overriding the contribution to the ComponentEventResultProcessor
for the String.class key with your own alternate
PageNameComponentEventResultProcessor-inspired implementation? Yes, that
would work. Not something I'd do (I prefer having another return type and
ComponentEventResultProcessor, but it's definitely a valid approach.


>- Use an intermediate type holding all the options available for a Link
>with a fluent API instead, e.g.
>LinkParams.page("index").anchor("footer").addQueryParameter("foo",
>"bar").activationContext(myContext1, myContext2)
>

IMHO, it's too close to what Link and PageRenderLinkSource already does, so
I wouldn't do that.


> The first option would be the easiest to implement because it only affects
> a single class (if I'm correct).
>

I believe you're correct indeed. :)


> The second option would require a new ComponentEventResultProcessor and the
> holder type.
>

That's my recommended approach. Or just use PageRenderLinkSource and Link
if this would be only used in a few places.

--
Thiago


Re: Navigation to section of a page

2022-03-22 Thread Thiago H. de Paula Figueiredo
On Mon, Mar 21, 2022 at 1:34 AM Christopher Dodunski (Tapestry) <
chrisfromtapes...@christopher.net.nz> wrote:

> Hi,
>

Hi!


> Quick question: Tapestry is flexible when it comes to return types for
> page navigation.  "When a string is returned, it is expected to be the
> logical name of a page."  Although I've not tried it, presumably this
> means the likes of "Index#footer" isn't possible for navigating to a
> particular place in a page.  Is creating a 'Link' object along with
> setAnchor() the usual/only approach for achieving this from within a
> page's class?
>

Right now, out of the box, yes, it's the usual and only approach. Of
course, you can always create your own return type and corresponding
ComponentEventResultProcessor to tell Tapestry how to handle it and have
any logic you want.


>
> Thanks & regards,
>
> Chris.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-- 
Thiago


Re: Tapestry default style sheet change doesn't seem to kick in

2022-03-06 Thread Thiago H. de Paula Figueiredo
On Tue, Feb 15, 2022 at 4:13 PM Feng Gao  wrote:

> Hello!
>

Hello!


> I followed instructions on https://tapestry.apache.org/css.html to change
> Tapestry (v5.7.3) default stylesheet to use Bootstrap-4.6.1 stylesheet,
> instead of the default Bootstrap-4.3.1:
>
> Here's what I ended up with in AppModule.java
> @ImportModule(NoBootstrapModule.class)
> public class AppModule
> {
> ...
> @ApplicationDefaults
> @Contribute(SymbolProvider.class)
> public static void setupEnvironment(final MappedConfiguration String> configuration)
> {
> ..
>configuration.add(SymbolConstants.DEFAULT_STYLESHEET,
> "context:css/bootstrap-4.6.1-dist/css/bootstrap.css");
> }
> }
>

I believe you're making a contribution to the wrong service: it should be
to ApplicationDefaults directly, not to SymbolProvider.

I suggest you try this:

public static void contributeApplicationDefaults(final
> MappedConfiguration configuration)
> {
> ..
>configuration.add(SymbolConstants.DEFAULT_STYLESHEET,
> "context:css/bootstrap-4.6.1-dist/css/bootstrap.css");
> }
> }
>

Please let us know if it works.

Also, I believe the approach suggested by Bob is the most recommended one,
since you're just replacing the Bootstrap version. Using NoBootstrapModule
is intended for when you're not using Bootstrap at all.

--
Thiago


Re: Rendering a page without a .tml template?

2022-03-01 Thread Thiago H. de Paula Figueiredo
On Tue, Mar 1, 2022 at 1:44 AM Jonathan Meijer 
wrote:

> Hi,
>

Hello!


> In my tapestry app, in some cases, I want the HTML to be entirely generated
> without Tapestry's intervention.
>

As Volker mentioned, your page should have an onActivate() method that
returns a StreamResponse (maybe a TextStreamResponse if the context is
text) instance which wraps the content you want returned. The page wouldn't
have a template at all. That's a completely normal thing to do using this
framework.

--
Thiago


Re: quickstart navbar toggler not working

2022-02-10 Thread Thiago H. de Paula Figueiredo
On Thu, Feb 10, 2022 at 12:27 AM D Tim Cummings 
wrote:

> Thanks Vangel and Thiago.
>
> https://issues.apache.org/jira/browse/TAP5-2703


Thank you very much!


> I don't know the annotation @Include.


That's a typo of mine and I apologize for that. It's @Import.


> I tried Vangel's solution using
> @Import(stylesheet = "context:css/app.css",module = {
> "bootstrap/collapse", "bootstrap/dropdown"}) and that gave me some more
> errors in browser javascript console and still no success in displaying
> navigation menu.
>
> DevTools failed to load source map: Could not load content for
> +
> http://localhost:8080/assets/meta/zae851f6d/tapestry5/bootstrap4/css/bootstrap.css.map+:
>
> <
> http://localhost:8080/assets/meta/zae851f6d/tapestry5/bootstrap4/css/bootstrap.css.map+:>
>
> HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
> DevTools failed to load source map: Could not load content for
> +
> http://localhost:8080/assets/meta/z2779b2b3/tapestry5/bootstrap4/css/bootstrap-grid.css.map+:
>
> <
> http://localhost:8080/assets/meta/z2779b2b3/tapestry5/bootstrap4/css/bootstrap-grid.css.map+:>
>
> HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
> console.js:104 RequireJS error: require: Cannot set properties of null
> (setting '_isTransitioning')
> console.js:104 RequireJS error: require: Cannot set properties of null
> (setting '_element')
> DevTools failed to load source map: Could not load content for
> +http://localhost:8080/modules.gz/bootstrap/popper.js.map+:
> <http://localhost:8080/modules.gz/bootstrap/popper.js.map+:> HTTP error:
> status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
> DevTools failed to load source map: Could not load content for
> +http://localhost:8080/modules.gz/bootstrap/dropdown.js.map+:
> <http://localhost:8080/modules.gz/bootstrap/dropdown.js.map+:> HTTP
> error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
> DevTools failed to load source map: Could not load content for
> +http://localhost:8080/modules.gz/bootstrap/collapse.js.map+:
> <http://localhost:8080/modules.gz/bootstrap/collapse.js.map+:> HTTP
> error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
> DevTools failed to load source map: Could not load content for
> +http://localhost:8080/modules.gz/bootstrap/util.js.map+:
> <http://localhost:8080/modules.gz/bootstrap/util.js.map+:> HTTP error:
> status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
>
>
> Tim
>
> On 9/2/22 23:18, Thiago H. de Paula Figueiredo wrote:
> > Hi!
> >
> > This is most probably caused by the lack of inclusion of the JavaScript
> > module that implements the Bootstrap 4 behaviors. Jira ticket please? :)
> >
> > Meanwhile, you can try adding @Include(module = "bootstrap") to your
> Layout
> > class. I haven't tested this and it might not work.
> >
> > Cheers!
> >
> > On Mon, Feb 7, 2022 at 11:33 PM D Tim Cummings .invalid>
> > wrote:
> >
> >> I just tried out quickstart 5.8.0 and noticed that when the browser
> >> window is small it collapses the navbar behind a button. Unfortunately
> >> clicking the button doesn't show the navbar. It used to work in old
> >> versions of quickstart (eg 5.4.5) which used Bootstrap 3 but quickstart
> >> 5.8.0 uses Bootstrap 4.
> >>
> >> What changes are required to get the navbar toggler button working with
> >> Bootstrap 4?
> >>
> >> Thanks
> >>
> >> Tim
> >>
> >>
> >> -
> >> To unsubscribe, e-mail:users-unsubscr...@tapestry.apache.org
> >> For additional commands, e-mail:users-h...@tapestry.apache.org
> >>
> >>



-- 
Thiago


Re: quickstart navbar toggler not working

2022-02-09 Thread Thiago H. de Paula Figueiredo
Hi!

This is most probably caused by the lack of inclusion of the JavaScript
module that implements the Bootstrap 4 behaviors. Jira ticket please? :)

Meanwhile, you can try adding @Include(module = "bootstrap") to your Layout
class. I haven't tested this and it might not work.

Cheers!

On Mon, Feb 7, 2022 at 11:33 PM D Tim Cummings 
wrote:

> I just tried out quickstart 5.8.0 and noticed that when the browser
> window is small it collapses the navbar behind a button. Unfortunately
> clicking the button doesn't show the navbar. It used to work in old
> versions of quickstart (eg 5.4.5) which used Bootstrap 3 but quickstart
> 5.8.0 uses Bootstrap 4.
>
> What changes are required to get the navbar toggler button working with
> Bootstrap 4?
>
> Thanks
>
> Tim
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-- 
Thiago


Re: Re: quickstart pom.xml - update maven-war-plugin to 3.3.1

2022-02-07 Thread Thiago H. de Paula Figueiredo
On Thu, Feb 3, 2022 at 10:09 AM  wrote:

> Hi Thiago,
>

Hello!


> I'v created https://issues.apache.org/jira/browse/TAP5-2701.
>

Thanks!

It's fixed on 5.8.1-SNAPSHOT.




>
> Thanks, Peter
>
>  Originalnachricht 
> Betreff: Re: quickstart pom.xml - update maven-war-plugin to 3.3.1
> Datum: 03.02.2022 13:23
> Von: "Thiago H. de Paula Figueiredo" 
> An: Tapestry users 
> Antwort an: "Tapestry users" 
>
> Hello!
>
> Thanks for spotting that and proposing a solution!
>
> Could you please create a Jira ticket in the Tapestry issue tracker and
> post it here? I should be able to implement your solution soon.
>
> Cheers!
>
> On Wed, Feb 2, 2022 at 9:05 AM  wrote:
>
> > Hi,
> >
> > I'v just tried the quickstart application using
> >
> > mvn archetype:generate -Dfilter=org.apache.tapestry:quickstart
> >
> > with java open jdk-17-0.2 and maven 3.8.4.
> >
> > The build fails in the maven install phase.
> >
> > The solution ist to add
> >
> > 
> >  org.apache.maven.plugins
> >  maven-war-plugin
> >  3.3.1
> > 
> >
> >
> > to pom.xml.
> >
> > Even though  "mvn jetty:run" runs properly, it is better to produce
> > error free build during the first contact with tapestry.
> > Would you like to have look at the issue?
> >
> > Thanks, Peter Skala
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>


-- 
Thiago


Re: Newest Tapestry version for Java 8

2022-02-04 Thread Thiago H. de Paula Figueiredo
Hello, Bob!

Tapestry 5.8 should work with Java 8. It's compiled with that version as
both target and source. I do know a large webapp which runs on Java 8 and
Tapestry 5.7.3 (which is basically the same as 5.8.0 besides the later
version having a few new features and bug fixes).

On Fri, Feb 4, 2022 at 6:52 PM Bob Harner  wrote:

> I could probably figure this out myself eventually, but does anyone know
> whether the new Tapestry version 5.8 works with a Java 8 runtime?  The
> https://tapestry.apache.org/supported-environments-and-versions.html page
> doesn't quite say.
>


-- 
Thiago


Re: quickstart pom.xml - update maven-war-plugin to 3.3.1

2022-02-03 Thread Thiago H. de Paula Figueiredo
Hello!

Thanks for spotting that and proposing a solution!

Could you please create a Jira ticket in the Tapestry issue tracker and
post it here? I should be able to implement your solution soon.

Cheers!

On Wed, Feb 2, 2022 at 9:05 AM  wrote:

> Hi,
>
> I'v just tried the quickstart application using
>
> mvn archetype:generate -Dfilter=org.apache.tapestry:quickstart
>
> with java open jdk-17-0.2 and maven 3.8.4.
>
> The build fails in the maven install phase.
>
> The solution ist to add
>
> 
>  org.apache.maven.plugins
>  maven-war-plugin
>  3.3.1
> 
>
>
> to pom.xml.
>
> Even though  "mvn jetty:run" runs properly, it is better to produce
> error free build during the first contact with tapestry.
> Would you like to have look at the issue?
>
> Thanks, Peter Skala
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-- 
Thiago


Re: [RELEASE] Tapestry 5.8.0 released

2022-01-31 Thread Thiago H. de Paula Figueiredo
On Mon, Jan 31, 2022 at 7:01 PM Charles Karow  wrote:

> I am just getting to looking at the docs - this is great!
>

The documentation isn't that great yet, so please let me know what parts
need some love.


> I will be putting the new REST features to use right away; I have been
> implementing a REST-like API in the onActivate() event. The new REST
> support will make it so much easier and cleaner.
>

Awesome! Yeah, it was always possible to do REST in Tapestry, but it was
definitely unwieldy. We hope this shouldn't be a problem anymore with
proper REST support.

As always, all feedback is welcome!


>
> Many thanks to all!!!
>
> Charles
>
> On 1/26/22 9:38 AM, Thiago H. de Paula Figueiredo wrote:
> > Hello, Tapestry community!
> >
> > Tapestry 5.8.0 has just been released. It's focused on a couple of new
> > features:
> > * Support for writing REST endpoints. Read more about this on its
> > documentation page: https://tapestry.apache.org/rest-support-580.html.
> > * Support for Servlet API 3.0+ asynchronous requests.
> >
> > Full release notes at https://tapestry.apache.org/release-notes-580.html
> .
> >
> > Tapestry 5.8.0 is a drop-in replacement and recommended upgrade for
> > Tapestry 5.7.0+ projects. No backward-incompatible changes.
> >
> > All feedback is welcome.
> >
> > Happy coding!
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-- 
Thiago


Re: t:grid coercing value when it shouldn't

2022-01-31 Thread Thiago H. de Paula Figueiredo
On Sat, Jan 29, 2022 at 8:13 PM Jonathan Meijer 
wrote:

> Thank you to both for your replies.
>

My pleasure to help!


> After reading and rereading the documentation, I'm getting a much better
> understanding of how (and how not) to use Tapestry.
>

Tapestry does have some concepts you need to understand well to use the
framework well.


> I'm trying to integrate with Cayenne without using the outdated integration
> module, and so far it's going well and I figured out my way around the
> coercion. Since my background is in WebObjects, I had to get used to this
> completely different paradigm.
>

Interesting! As far as I remember, WebObjects was an inspiration for
Tapestry in the beginning.


>
> Jonathan
>
> On Thu, Jan 27, 2022, 16:26 Thiago H. de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > On Fri, Jan 21, 2022 at 12:56 AM Jonathan Meijer  >
> > wrote:
> >
> > > Hi,
> > >
> >
> > Hi!
> >
> >
> > > New Tapestry user here, started with a bootstrapped 5.7.3 and
> > > experimenting.
> > >
> >
> > Welcome to Tapestry! We just released 5.8.0, by the way.
> >
> >
> > >   Delete
> > >
> >
> > I suggest using EventLink instead of ActionLink. Very similar, but easier
> > and more elegant to use.
> >
> > Delete
> >
> > Object onDelete(...) { ... }
> >
> >
> > >   What am I doing wrong?  There is really no room for error, the Blah
> > class
> > > is defined right there in the same class and the current row object has
> > > absolutely no reason to be converted to String.
> > >
> >
> > You passed an instance of Blah as the context of an ActionLink. This
> > component needs to know how to convert Blah to a string to be put in the
> > link's URL and how to do the conversion back so Tapestry can provide the
> > Blah instance to be passed to the event handler method when you click the
> > link. This is done by implementing the ValueEncoder instance for your
> class
> > then contributing it to the ValueEncoderSource service. Internally, when
> a
> > ValueEncoder isn't found for a given type, Tapestry tries to fallback on
> > using a coercion from String to type and type to String from the
> > TypeCoercer service. That's why I'm suggesting ValueEncoder and Voker is
> > suggesting a coercion and both solutions are valid. :) I just prefer the
> > ValueEncoder route in this case because it's specific for URLs (including
> > page activation context, event handler parameters, etc) and TypeCoercer
> is
> > more general-purpose conversions, specially for component and page
> > parameters (for example, Grid's source parameter receives a
> GridDataSource
> > but you can pass a List to it).
> >
> > Example of ValueEncoder usage:
> >
> > public class BlahValueEncoder implements ValueEncoder {
> > public String toClient(Blah value) {
> > (...)
> > }
> >
> > public Blah toValue(String clientValue)
> > {
> > (...)
> > }
> > }
> >
> > In AppModule:
> >
> > public static void
> > contributeValueEncoderSource(MappedConfiguration
> > configuration) {
> > configuration.add(Blah.class, new BlahValueEncoder()); // or,
> with
> > dependency injection: configuration.addInstance(Object.class,
> > BlahValueEncoder.class);
> > }
> >
> >
> >
> > >
> > > Kindly help,
> > >
> > > Jonathan
> > >
> >
> >
> > --
> > Thiago
> >
>


-- 
Thiago


Re: [RELEASE] Tapestry 5.8.0 released

2022-01-27 Thread Thiago H. de Paula Figueiredo
On Wed, Jan 26, 2022 at 7:24 PM Volker Lamp  wrote:

> Hello Thiago & other contributors,
>

Hello!

Thank you very much for new release. The Rest API feature is a very useful
> addition.


Our pleasure! We're looking for your feedback on REST support! As much as
we try to architect it to be easy to use and useful, having it used in the
wild always sheds some light on situations we didn't foresee or stuff we
could have done better.


> Thank you all for the hours and brains you put into the new release.
>

Thanks!

-- 
Thiago


Re: Apache FOP integration

2022-01-27 Thread Thiago H. de Paula Figueiredo
On Thu, Jan 27, 2022 at 2:55 PM Jens Breitenstein  wrote:

> The only interaction with Tapestry is the StreamResponse from an
> EventHandler to the client.


Friendly reminder you can return StreamResponse from a page's onActivate()
method too.

--
Thiago


Re: t:grid coercing value when it shouldn't

2022-01-27 Thread Thiago H. de Paula Figueiredo
On Fri, Jan 21, 2022 at 12:56 AM Jonathan Meijer 
wrote:

> Hi,
>

Hi!


> New Tapestry user here, started with a bootstrapped 5.7.3 and
> experimenting.
>

Welcome to Tapestry! We just released 5.8.0, by the way.


>   Delete
>

I suggest using EventLink instead of ActionLink. Very similar, but easier
and more elegant to use.

Delete

Object onDelete(...) { ... }


>   What am I doing wrong?  There is really no room for error, the Blah class
> is defined right there in the same class and the current row object has
> absolutely no reason to be converted to String.
>

You passed an instance of Blah as the context of an ActionLink. This
component needs to know how to convert Blah to a string to be put in the
link's URL and how to do the conversion back so Tapestry can provide the
Blah instance to be passed to the event handler method when you click the
link. This is done by implementing the ValueEncoder instance for your class
then contributing it to the ValueEncoderSource service. Internally, when a
ValueEncoder isn't found for a given type, Tapestry tries to fallback on
using a coercion from String to type and type to String from the
TypeCoercer service. That's why I'm suggesting ValueEncoder and Voker is
suggesting a coercion and both solutions are valid. :) I just prefer the
ValueEncoder route in this case because it's specific for URLs (including
page activation context, event handler parameters, etc) and TypeCoercer is
more general-purpose conversions, specially for component and page
parameters (for example, Grid's source parameter receives a GridDataSource
but you can pass a List to it).

Example of ValueEncoder usage:

public class BlahValueEncoder implements ValueEncoder {
public String toClient(Blah value) {
(...)
}

public Blah toValue(String clientValue)
{
(...)
}
}

In AppModule:

public static void
contributeValueEncoderSource(MappedConfiguration
configuration) {
configuration.add(Blah.class, new BlahValueEncoder()); // or, with
dependency injection: configuration.addInstance(Object.class,
BlahValueEncoder.class);
}



>
> Kindly help,
>
> Jonathan
>


-- 
Thiago


[RELEASE] Tapestry 5.8.0 released

2022-01-26 Thread Thiago H. de Paula Figueiredo
Hello, Tapestry community!

Tapestry 5.8.0 has just been released. It's focused on a couple of new
features:
* Support for writing REST endpoints. Read more about this on its
documentation page: https://tapestry.apache.org/rest-support-580.html.
* Support for Servlet API 3.0+ asynchronous requests.

Full release notes at https://tapestry.apache.org/release-notes-580.html.

Tapestry 5.8.0 is a drop-in replacement and recommended upgrade for
Tapestry 5.7.0+ projects. No backward-incompatible changes.

All feedback is welcome.

Happy coding!

-- 
Thiago


Re: Deadlock on lazy services

2021-12-20 Thread Thiago H. de Paula Figueiredo
On Fri, Dec 17, 2021 at 10:48 AM Oliver Kaiser 
wrote:

> On 12/14/2021 10:40 PM, Dimitris Zenios wrote:
> > Hi all it seems there is a raise condition when realizing lazy loaded
> > services.
>

Indeed it is.


> if you want to do the same try marking your "service A" as eager load.
>

I was going to suggest that, but Oliver was faster than me. :D Marking the
other service with eager load would most probably solve the problem too.
Unless one of these services isn't always actually called during the app's
lifetime *and* it has a heavy resources usages, I don't see the downside of
this solution except a little slower startup.


> @Thiago: in case you are reading this;


I may not check this mailing list every day but I do read everything here.
:)


> w.r.t. Java 17 (ASM update); do
> you have a tool / mechanism to do that; or manually copy into "plastic"
> + adjust package name? anything else that needs to be done?
>

No tool other than the IDE's refactor support. I check out the ASM latest
release tag, refactor the packages so they align with the names used in
Tapestry (Plastic, to be more precise), copy them to the Tapestry sources,
and I just change the visibility of a single method there so it can be used
by Plastic and there's also some other place I need to remove an enum's
value so it doesn't use ASM experimental features, something that causes an
error.


> maybe i'll give that a try; no promises :-)
>

:) I did upgrade the Tapestry's embedded ASM version to the latest released
one, 9.2, last week. Thanks for the offer!


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

-- 
Thiago


Re: Best practice for health check URL?

2021-12-07 Thread Thiago H. de Paula Figueiredo
On Mon, Dec 6, 2021 at 1:25 PM JumpStart <
geoff.callender.jumpst...@gmail.com> wrote:

> I think you’d want to make it a configuration option, so that development
> can still come up quickly, but that sounds great for production.
>

Yes, my mental plan is to have it configurable, probably on by default,
just like production mode is.


> I’ve spent some time bouncing between Dmitry and Ben’s approaches. With
> the latter I simplified it with Jsoup, but there are considerable
> limitations to what can be preloaded that way.
>

I suppose we would need to make some changes to Tapestry and Tapestry-IoC
internals to offer the option to preload everything, plus maybe provide
some hook for user code to preload itself (although contributions to
RegistryStartup may be enough for that, but I haven't investigated yet).

-- 
Thiago


Re: Best practice for health check URL?

2021-12-03 Thread Thiago H. de Paula Figueiredo
Hi!

Today I started wondering about how we could get Tapestry to run under
Quarkus.io, including generating a native executable. Of course, this won't
include bytecode generated in runtime, something many libraries and
frameworks do, Tapestry very much included. Then I researched a bit and
found this: https://quarkus.io/guides/writing-extensions#bytecode-recording.
Basically, it's a hook for you to run the code that will generate bytecode
while the hook records everything (if I got it right). So, to write an
extension for Tapestry, we would need to have every page and and every
service (and maybe some other stuff too) fully realized, since Tapestry-IoC
and Tapestry load mostly everything in a lazy manner. This is something
that could also solve Geoff's question: if we can somehow force Tapestry to
preload everything, then the app is ready and (at least mostly) warm when
the first request is properly served.

With the code Dmitry shared here, I wonder if you want to collaborate on
implementing this preload feature on Tapestry itself out-of-the-box,
avoiding some ugly workarounds needed since there's no actual support for
that. :)

Cheers!

On Mon, Nov 29, 2021 at 7:36 PM Dmitry Gusev  wrote:

> Hi Geoff,
>
> I don't think there's a simpler way, we're doing something similar.
>
> We created a REST endpoint with tynamo-resteasy which is effectively a load
> balancer health check.
> On the first hit it starts the warmup process on the same request,
> following requests return an error instantly if the initial warmup routine
> is still in progress.
>
> Our warmup logic is heavily based on tapestry internals & reflection, in
> conjunction with eager loading services as described here:
> https://gist.github.com/dmitrygusev/5562739
>
> Warmup logic is a bit complicated, it's trying to:
> - "touch" each page using ComponentClassResolver.getPageNames()
> - recursively for each component with mixins on a page starting from root
> component,
> > find imported assets via reflection (fields with names starting as
> `importedAssets_`)
> > stream each asset via `StreamableResourceSource` into no-op consumer
> - find JS modules with `ModuleManager` and stream through no-op consumer
> - every JS stack returned from `JavaScriptStackSource` assemble with
> `JavaScriptStackAssembler` and stream through no-op consumer
> - repeat above for each locale/axis
>
> Entire process usually takes 3-5 minute in our setup.
> After it's done we return 200 to the load balancer and the first real
> request is handled with hot caches.
>
> Hope this helps,
> Dmitry
>
> On Mon, Nov 29, 2021 at 9:53 PM JumpStart <
> geoff.callender.jumpst...@gmail.com> wrote:
>
> > Any suggestions on best ways to write a “health check” page to be called
> > by load balancers?
> >
> > My app is getting big, and the traffic is big. If the app fails
> (hopefully
> > never, but it’s a JVM) and the traffic is heavy enough, startup never
> seems
> > to complete - every request times out, the app log goes quiet, and CPU
> goes
> > to 100%. It appears to be due to race conditions possibly involving asset
> > compression, minimising, and first time into the pages.
> >
> > I’m considering having a startup service crawl every page, in every
> > language, in every skinning, before setting a singleton flag that the
> > health check page will read to determine whether the app is ready to
> > receive traffic.
> >
> > Is there a simpler way?
> >
> > Geoff
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>


-- 
Thiago


Re: Variable translate in TextField

2021-11-03 Thread Thiago H. de Paula Figueiredo
On Tue, Nov 2, 2021 at 12:55 AM JumpStart <
geoff.callender.jumpst...@gmail.com> wrote:

> Hi all,
>

Hello!

I'd try using one of the methods of FieldTranslatorSource, starting
with createTranslator(ComponentResources componentResources, String
translatorName);. It's exactly the one used by the "translate" binding. The
ComponentResources should be the one of the field (i.e. you'll need
to @InjectComponent private Component price1; and pass
price1.getComponentResources() to FieldTranslatorSource.createTranslator().


>
> Does anyone have an example of a variable translate in a TextField? I want
> to switch between translators for different currencies because they have
> different numbers of decimal places.
>
>  t:mixins="touchspin" touchspin.max="999.99"
> touchspin.forceStepDivisibility="'none'"
> touchspin.decimals="prop:currencyDecimalPlaces"
> translate="prop:moneyAmountTranslator”/>
>
> Unfortunately I get error:
> org.apache.tapestry5.ioc.util.UnknownValueException: Could not find a
> coercion from type com.goxpro.xpro.web.translators.MoneyAmountTranslator to
> type org.apache.tapestry5.FieldTranslator.
>
> The background is that class MoneyAmountTranslator implements
> Translator. It’s contributed to TranslatorAlternatesSource in
> AppModule:
>
> @SuppressWarnings("rawtypes")
> public static void
> contributeTranslatorAlternatesSource(MappedConfiguration Translator> configuration,
> ThreadLocale threadLocale) {
> ...
> configuration.add("moneyamount_0", new
> MoneyAmountTranslator("moneyamount_0", 0, threadLocale, false));
> configuration.add("moneyamount_2", new
> MoneyAmountTranslator("moneyamount_2", 2, threadLocale, false));
> configuration.add("moneyamount_3", new
> MoneyAmountTranslator("moneyamount_3", 3, threadLocale, false));
> }
>
> In the page/component’s Java, I choose the translator...
>
> @Property
> private Translator moneyAmountTranslator;
> ...
> Map translatorAlternates =
> translatorAlternatesSource.getTranslatorAlternates();
>
> switch (currencyDecimalPlaces) {
> case 0:
> moneyAmountTranslator = (MoneyAmountTranslator)
> translatorAlternates.get("moneyamount_0");
> break;
> case 2:
> moneyAmountTranslator = (MoneyAmountTranslator)
> translatorAlternates.get("moneyamount_2");
> break;
> case 3:
> moneyAmountTranslator = (MoneyAmountTranslator)
> translatorAlternates.get("moneyamount_3");
> break;
> default:
> throw new
> IllegalStateException(paymentAgreement.toString());
> }
>
> But I am having difficulty wrapping it in a FieldTranslator.
>
> Strangely, this works…
>
>  t:mixins="touchspin" touchspin.max="999.99"
> touchspin.forceStepDivisibility="'none'"
> touchspin.decimals="prop:currencyDecimalPlaces"
> translate=“moneyamount_0”/>
>
> But this doesn't…
>
> @Property
> private String moneyAmountTranslatorStr;
> …
> moneyAmountTranslatorStr = “moneyamount_0”;
>
>  t:mixins="touchspin" touchspin.max="999.99"
> touchspin.forceStepDivisibility="'none'"
> touchspin.decimals="prop:currencyDecimalPlaces"
> translate="prop:moneyAmountTranslatorStr”/>
>
> Cheers,
>
> Geoff
>
>
>
>
>

-- 
Thiago


Re: Trigger event to outer component

2021-10-29 Thread Thiago H. de Paula Figueiredo
On Thu, Oct 28, 2021 at 1:26 PM Nathan Quirynen 
wrote:

> Thank you for your reply.
>

My pleasure to (at least try to) help!


> Are you sure this should work as I thought it would? I just cannot get
> it to work even in a simple case.
>

I've given some more thought to it and I discovered I was wrong. It
shouldn't work. The component triggering the event isn't actually a Layout
child, since the former wasn't declared inside the latter's template, and
that explains why the event isn't triggered there. It's instead a direct
page child. You can catch the event on the page and trigger a similar one
to Layout by using componentResources.getEmbeddedComopnent("layout" /* t:id
value */).getComponentResources().triggerEvent(...).


> PS: Tapestry version 5.7.1
>

You should definitely upgrade to 5.7.3 due to a couple of security fixes,
by the way.


>
> Op 28/10/2021 om 15:44 schreef Thiago H. de Paula Figueiredo:
> > Hello!
> >
> > Events do bubble up in the component hierarchy/tree until they're
> handled,
> > so the situation is a bit weird. Have you checked whether there's some
> > other component in between which is catching this event and thereby
> > avoiding Layout from receiving it?
> >
> > On Wed, Oct 27, 2021 at 3:38 PM Nathan Quirynen <
> nat...@pensionarchitects.be>
> > wrote:
> >
> >> Hi,
> >>
> >> I want to bubble up an event from a component, which is deeply nested in
> >> other components, to an outer component, but it only bubbles up to the
> >> page and not further to the component defined as t:type="***" in the
> page.
> >>
> >> Some simplified example code to clarify:
> >>
> >>
> >> Page:
> >>
> >> 
> >>   ...
> >>   
> >>   ...
> >> 
> >>
> >>
> >> DeeplyNestedComponent:
> >>
> >> componentResources.triggerEvent("someEvent", null, null);
> >>
> >>
> >> Following works up to the Page class, but not if I add it in the Layout
> >> component:
> >>
> >> @OnEvent(value = "someEvent")
> >> void doSomething() {}
> >>
> >>
> >> Is there anyway to catch this event in the Layout component?
> >>
> >>
> >>
> >> -
> >> 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: Getting Started with 5.7.2

2021-10-29 Thread Thiago H. de Paula Figueiredo
On Tue, Aug 31, 2021 at 7:38 AM pico.dev  wrote:

> Hello,
>

Hello, everyone!


> I created this issue https://issues.apache.org/jira/browse/TAP5-2690
> Update
> quickstart to make Spring Boot optional.
> I attached a patch in the issue and a summary with the main changes
> performed to the quickstart.
> Give a look and a test, if something should be changed leave a comment and
> I will do the change.
>

Thank you very much! I'm sorry for not having applied it earlier. I just
did it.


>
> Regards,
>
> El vie, 27 ago 2021 a las 7:52, pico.dev () escribió:
>
> > Hello,
> >
> > Just to say that I will start to work on updating quickstat to make
> spring
> > boot optional. Give me some days, I will come with a patch.
> >
> > Regards,
> >
> > El mar, 10 ago 2021 a las 23:36, Thiago H. de Paula Figueiredo (<
> > thiag...@gmail.com>) escribió:
> >
> >> On Thu, Aug 5, 2021 at 10:02 PM D Tim Cummings
> >> 
> >> wrote:
> >>
> >> > Hi Thiago
> >> >
> >>
> >> Hello!
> >>
> >>
> >> > I believe pico.dev is waiting for confirmation that you would like
> the
> >> > quickstart app reverted to jetty.
> >>
> >>
> >> I'm sorry I overlooked this. I prefer Quickstart to be as simple as
> >> possible, so I believe Jetty is the way to go. SpringBoot is better left
> >> being optional.
> >>
> >>
> >> > Personally I think it is great there
> >> > is a quickstart using springboot, but it should be in addition to the
> >> > quickstart using jetty, not replacing it. Also it should come with
> >> > instructions how to use it.
> >> >
> >>
> >> I also agree with this.
> >>
> >>
> >> > I have just tried quickstart again recently and the three issues
> listed
> >> > in my first email below, still exist.
> >> >
> >> > *An additional problem facing new users on the getting started page*
> >> >
> >> > Getting started https://tapestry.apache.org/getting-started.html
> >> suggests
> >> >
> >> > mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org
> >> >
> >> > However this no longer works on version 3 or later of the
> >> > maven-archetype-plugin. This has been flagged as issue
> >> > https://issues.apache.org/jira/projects/TAP5/issues/TAP5-2579 . I
> >> > suggest changing web page to use the command
> >> >
> >> > mvn archetype:generate -Dfilter=org.apache.tapestry:quickstart
> >> >
> >> > and then you could close that issue. If someone could give me edit
> >> > privileges on the getting started page I would be happy to do that.
> >> >
> >>
> >> Thanks for spotting that and volunteering for fixing it! I just fixed it
> >> myself, but it takes some time for the fix to be replicated to the site.
> >>
> >> Thank you!
> >>
> >> >
> >> > Thanks
> >> >
> >> > Tim
> >> >
> >> > On 1/5/21 17:17, pico.dev wrote:
> >> > > Hi!
> >> > >
> >> > > Sorry for the inconvenience.
> >> > >
> >> > > If Spring Boot is not desired in the app generated by quickstart, I
> >> could
> >> > > try to provide a new patch to remove it if you wish, I hope as soon
> >> as I
> >> > > can, just confirm me and I start doing the changes.
> >> > >
> >> > > Regards,
> >> > >
> >> > > El vie, 30 abr 2021 a las 22:43, Thiago H. de Paula Figueiredo (<
> >> > > thiag...@gmail.com>) escribió:
> >> > >
> >> > >> Hello!
> >> > >>
> >> > >> Thank you very much for spotting and warning us about these issues.
> >> > >>
> >> > >> You shouldn't need to use Spring Boot. The archetype needs to be
> >> fixed.
> >> > >>
> >> > >> On Sat, Apr 24, 2021 at 9:00 PM D Tim Cummings
> >> >  >> > >> wrote:
> >> > >>
> >> > >>> I have tried the instructions at
> >> > >>> https://tapestry.apache.org/getting-started.html using Tapestry
> >> 5.7.2
> >> > >>> archetype.
> >> > >>>
> >> > >>> 1. The code produced b

Re: Trigger event to outer component

2021-10-28 Thread Thiago H. de Paula Figueiredo
Hello!

Events do bubble up in the component hierarchy/tree until they're handled,
so the situation is a bit weird. Have you checked whether there's some
other component in between which is catching this event and thereby
avoiding Layout from receiving it?

On Wed, Oct 27, 2021 at 3:38 PM Nathan Quirynen 
wrote:

> Hi,
>
> I want to bubble up an event from a component, which is deeply nested in
> other components, to an outer component, but it only bubbles up to the
> page and not further to the component defined as t:type="***" in the page.
>
> Some simplified example code to clarify:
>
>
> Page:
>
> 
>  ...
>  
>  ...
> 
>
>
> DeeplyNestedComponent:
>
> componentResources.triggerEvent("someEvent", null, null);
>
>
> Following works up to the Page class, but not if I add it in the Layout
> component:
>
> @OnEvent(value = "someEvent")
> void doSomething() {}
>
>
> Is there anyway to catch this event in the Layout component?
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-- 
Thiago


Re: Java 17 Support

2021-10-19 Thread Thiago H. de Paula Figueiredo
On Mon, Oct 18, 2021 at 9:11 AM Bosch, Christian 
wrote:

> Hello,
>

Hello!


> Is it plan to support java 17 ?
>

What exactly do you mean by that? If that's about bytecode, Tapestry
supports what the ASM library (https://asm.ow2.io) does. Right now,
Tapestry uses ASM 8.0.1, which supports Java 14 bytecode. ASM 9.2 supports
Java 18, so I guess it's time for Tapestry to upgrade ASM again. Thanks for
the reminder!


>
> Regards,
> Christian.
>


-- 
Thiago


Re: Rendering a tapestry component to a string

2021-10-14 Thread Thiago H. de Paula Figueiredo
On Mon, Oct 11, 2021 at 12:47 PM Adriaan Joubert 
wrote:

> Hi,
>

Hello, Adriaan!


> We are starting to use a library called fancytree (
> http://wwwendt.de/tech/fancytree/demo/index.html). For basic trees this
> integrates really easily with tapestry.
>
> However for tree tables the simplest way to render the trees client-side is
> to ship the contents of the tree table down in a json structure. For simple
> values this works well.
>
> Ideally we would like to have tapestry components available in the tree
> table. We could come up with complicated ways of doing this (hidden divs
> for every cell etc), but it would be easy if we could render a tapestry
> component to a string, and simply ship this client side as a field in the
> json.
>
> Does this sound feasible at all? I found
> https://github.com/uklance/tapestry-offline, but is there a simpler
> built-in way?
>

tapestry-offline is great when you want to use Tapestry to generate some
content outside of Tapestry-handled requests.

For Tapestry-handled requests, you can use its own PartialTemplateRenderer
service:
https://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/PartialTemplateRenderer.html.
It works for component and block instances.

One example taken from one of the Tapestry internal testing apps:

public class PartialTemplateRendererDemo
{

@Inject
@Property
private Block someBlock;

@Inject
private PartialTemplateRenderer partialTemplateRenderer;

@InjectComponent
private BeanDisplay beanDisplay;

@Property
private Pojo object;

void setupRender() {
object = new Pojo();
object.setDate(new Date(2134234523L));
object.setString(String.valueOf(System.currentTimeMillis()));
object.setInteger((int) (System.currentTimeMillis() % 234123));
}

public String getServiceRenderedBlock() {
return partialTemplateRenderer.render(someBlock);
}

public String getServiceRenderedComponent() {
return partialTemplateRenderer.render(beanDisplay);
}

public static class Pojo
{
private int integer;
private String string;
private Date date;

public int getInteger()
{
return integer;
}

public void setInteger(int i)
{
this.integer = i;
}

public String getString()
{
return string;
}

public void setString(String s)
{
this.string = s;
}

public Date getDate()
{
return date;
}

public void setDate(Date date)
{
this.date = date;
}

}
}

 





















>
> If anybody has any ideas that would be great.
>
> Cheers,
>
> Adriaan
>


-- 
Thiago


Re: Getting Started with 5.7.2

2021-09-02 Thread Thiago H. de Paula Figueiredo
Awesome!

I'll take a look at it next week.

On Wed, Sep 1, 2021 at 7:35 AM pico.dev  wrote:

> Thanks Tim.
>
> Updated to use Jetty 10 and Java 11.
>
> El mié, 1 sept 2021 a las 4:07, D Tim Cummings
> ()
> escribió:
>
> > Thanks pico
> >
> > I had a quick look and see that you are targeting java 8 and jetty 9.4.
> > I think we should be targeting java 11 and jetty 10 at least. The
> > quickstart helps new users get familiar with tapestry and old users see
> > what is required to run tapestry on the latest java and jetty. I
> > remember when I first started with tapestry how frustrating it was for
> > me to have to learn really old versions of jetty just to get sample code
> > to run. Then my first task was to translate everything to new versions
> > of jetty, not knowing if it was even possible. Now we should say that
> > tapestry doesn't work with jetty 11 so we are providing an example with
> > jetty 10.
> >
> > Thanks for all your work. I will keep testing.
> >
> > Tim
> >
> > On 31/8/21 20:36, pico.dev wrote:
> > > Hello,
> > >
> > > I created this issue https://issues.apache.org/jira/browse/TAP5-2690
> > Update
> > > quickstart to make Spring Boot optional.
> > >
> > > I attached a patch in the issue and a summary with the main changes
> > > performed to the quickstart.
> > >
> > > Give a look and a test, if something should be changed leave a comment
> > and
> > > I will do the change.
> > >
> > > Regards,
> > >
> > > El vie, 27 ago 2021 a las 7:52, pico.dev ()
> > escribió:
> > >
> > >> Hello,
> > >>
> > >> Just to say that I will start to work on updating quickstat to make
> > spring
> > >> boot optional. Give me some days, I will come with a patch.
> > >>
> > >> Regards,
> > >>
> > >> El mar, 10 ago 2021 a las 23:36, Thiago H. de Paula Figueiredo (<
> > >> thiag...@gmail.com>) escribió:
> > >>
> > >>> On Thu, Aug 5, 2021 at 10:02 PM D Tim Cummings
> > >>> 
> > >>> wrote:
> > >>>
> > >>>> Hi Thiago
> > >>>>
> > >>> Hello!
> > >>>
> > >>>
> > >>>> I believe pico.dev is waiting for confirmation that you would like
> > the
> > >>>> quickstart app reverted to jetty.
> > >>>
> > >>> I'm sorry I overlooked this. I prefer Quickstart to be as simple as
> > >>> possible, so I believe Jetty is the way to go. SpringBoot is better
> > left
> > >>> being optional.
> > >>>
> > >>>
> > >>>> Personally I think it is great there
> > >>>> is a quickstart using springboot, but it should be in addition to
> the
> > >>>> quickstart using jetty, not replacing it. Also it should come with
> > >>>> instructions how to use it.
> > >>>>
> > >>> I also agree with this.
> > >>>
> > >>>
> > >>>> I have just tried quickstart again recently and the three issues
> > listed
> > >>>> in my first email below, still exist.
> > >>>>
> > >>>> *An additional problem facing new users on the getting started page*
> > >>>>
> > >>>> Getting started https://tapestry.apache.org/getting-started.html
> > >>> suggests
> > >>>> mvn archetype:generate -DarchetypeCatalog=
> http://tapestry.apache.org
> > >>>>
> > >>>> However this no longer works on version 3 or later of the
> > >>>> maven-archetype-plugin. This has been flagged as issue
> > >>>> https://issues.apache.org/jira/projects/TAP5/issues/TAP5-2579 . I
> > >>>> suggest changing web page to use the command
> > >>>>
> > >>>> mvn archetype:generate -Dfilter=org.apache.tapestry:quickstart
> > >>>>
> > >>>> and then you could close that issue. If someone could give me edit
> > >>>> privileges on the getting started page I would be happy to do that.
> > >>>>
> > >>> Thanks for spotting that and volunteering for fixing it! I just fixed
> > it
> > >>> myself, but it takes some time for the fix to be replicated to the
> > site.
> > >>>
> > >>> Thank you!
>

Re: Render a single Enum value

2021-08-30 Thread Thiago H. de Paula Figueiredo
Hello!

Have you tried ? This
component is used by BeanDisplay and Grid for outputting property values,
using the contributed display blocks to the BeanBlockSource, and uses
TapestryInternalUtils.getLabelForEnum(Messages, Enum).

On Wed, Aug 25, 2021 at 11:31 PM Paul Stanton  wrote:

> Using ${object.enumValue} renders the enum in raw form ie ENUM1
>
> How do I leverage "TapestryInternalUtils.getLabelForEnum" without having
> to use a BeanDisplay or Grid etc?
>
> Or is there super easy way to just render the Enum value formatted
> without rendering any wrapping html etc?
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-- 
Thiago


Re: [RELEASE] Apache Tapestry 5.7.3 released

2021-08-30 Thread Thiago H. de Paula Figueiredo
Hello! I'm sorry for the very late answer.

On Mon, Aug 16, 2021 at 11:29 AM Vangel V. Ajanovski 
wrote:

> I'm experiencing some issue where session.createQuery always returns a
> null in the constructor of a SessionState object, after moving to 5.7.3.
> Otherwise everything works and is a welcome upgrade.
> Are there any differences in how and when Tapestry creates the hibernate
> session and how this behaves after this upgrade?
>

No. The only difference is how tapestry-hibernate gets the list of entity
classes from Hibernate. No changes were done to Tapestry-IoC of
tapestry-core that could have affected dependency injection. Maybe some
change in Hibernate itself? You should be able to use tapestry-hibernate
and tapestry-hibernate-core 5.7.2 with Tapestry 5.7.3 without issues.

To be honest, I've never had anything injected into a @SessionState object
and that's something I'd avoid doing anyway. I consider @SessionState
object to be a data storage and prefer to keep any kind of logic, specially
querying, in services.

If you want to tell Tapestry how to build and initialize your @SessionState
objects, you can implement ApplicationStateCreator and contribute an
ApplicationStateContribution instance with it for a given class to the
distributed configuration of the ApplicationStateManager services. Your
ApplicationStateCreator implementation will be called by
ApplicationStateManagerImpl to get the object instead of using
ObjectLocator.autobuild(). This is probably the best way of implementing
the logic you want here.

Please let me know if you have further questions.


>
>
> More details:
>
> I have a @SessionState UserInfo in each page where the authenticated
> user details are needed.
>
> The UserInfo class constructor calls a PersonManager service to find the
> logged-in user details.
>
> Authentication is external so it is not part of the problem. Apereo CAS,
> over all paths of the server, so that request.remoteUser contains the
> loggedin user name.
>
> In this personManager i have @Inject Session session and i have
> session.createQuery.
>
> Now the strange change in behaviour is that after upgrade to 5.7.3, all
> calls to session.CreateQuery always return null when personManager is
> called in the UserInfo constructor. Whatever query I use, it returns a
> null. As if the session is not working. But the session is not null, the
> session object status is OK and session object connection status is ok.
>
> If I call the personManager directly from a page (setupRender or
> property getter) everything works fine.
>
> Probably something is not written as it supposed to be and I need to
> refactor. Maybe we are not supposed to fill-in the UserInfo session
> state object details during its construction, but later. But this piece
> of code is more than 10 years old and has survived over all the Tapestry
> 5.x.x upgrades in the meanwhile and worked fine until now.
>
> UserInfo example:
>
> https://github.com/ajanovski/eprms/blob/main/eprms-tap/src/main/java/info/ajanovski/eprms/tap/util/UserInfo.java
>
> PersonImpl example (nothing special here):
>
> public class PersonDaoImpl implements PersonDao {
>  @Inject private Loggerlogger;
>  @Inject private Sessionsession;
>
>  @Override
>  public List getAllPersons() {
>  try {
>  return session.createQuery("from Person order by
> lastName").list();
>  } catch (Exception e) {
>  return null;
>  }
>  }
>
>  @Override
>  public Person getPersonByUsername(String username) {
>  try {
>  return (Person) (session
>  .createQuery("from Person where userName=:param")
>  .setParameter("param", username).setReadOnly(true)
>  .setCacheable(true).uniqueResult());
>  } catch (Exception e) {
>  return null;
>  }
>  }
>
> In case it matters, there is a  ComponentRequestFilter to protect access
> to pages depending on the user role, implemented like this:
>
> https://github.com/ajanovski/eprms/blob/main/eprms-tap/src/main/java/info/ajanovski/eprms/tap/services/AccessController.java
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-- 
Thiago


Re: [RELEASE] Apache Tapestry 5.7.3 released

2021-08-16 Thread Thiago H. de Paula Figueiredo
I forgot to mention you can see the 5.7.3 release notes at
https://cwiki.apache.org/confluence/display/TAPESTRY/Release+Notes+5.7.3
until the main site is updated.

On Mon, Aug 16, 2021 at 9:45 AM Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> Hello, community!
>
> Tapestry 5.7.3 has just been released. It's a new release focused on some
> improvements and new features. Main ones are:
>
>
>- Upgrading Hibernate's version from 5.1.1.Final to 5.4.32.Final. This
>required some changes in tapestry-hibernate due to some
>non-backward-compatible changes between these 2 Hibernate versions. If your
>project doesn't work with this new Hibernate version, you should be able to
>use version 5.7.2 of tapestry-hibernate and tapestry-hibernate with 5.7.3
>of everything else without issues.
>- Introducing tapestry-spock, an integration of Tapestry with the
>Spock testing framework, which used to be part of the Spock project.
>
> Unfortunately, the Tapestry site isn't updating at the moment due to an
> internal process being broken.
>
> Your feedback is always welcome!
>
> Cheers!
>
> --
> Thiago
>


-- 
Thiago


[RELEASE] Apache Tapestry 5.7.3 released

2021-08-16 Thread Thiago H. de Paula Figueiredo
Hello, community!

Tapestry 5.7.3 has just been released. It's a new release focused on some
improvements and new features. Main ones are:


   - Upgrading Hibernate's version from 5.1.1.Final to 5.4.32.Final. This
   required some changes in tapestry-hibernate due to some
   non-backward-compatible changes between these 2 Hibernate versions. If your
   project doesn't work with this new Hibernate version, you should be able to
   use version 5.7.2 of tapestry-hibernate and tapestry-hibernate with 5.7.3
   of everything else without issues.
   - Introducing tapestry-spock, an integration of Tapestry with the Spock
   testing framework, which used to be part of the Spock project.

Unfortunately, the Tapestry site isn't updating at the moment due to an
internal process being broken.

Your feedback is always welcome!

Cheers!

-- 
Thiago


Re: Getting Started with 5.7.2

2021-08-10 Thread Thiago H. de Paula Figueiredo
On Thu, Aug 5, 2021 at 10:02 PM D Tim Cummings 
wrote:

> Hi Thiago
>

Hello!


> I believe pico.dev is waiting for confirmation that you would like the
> quickstart app reverted to jetty.


I'm sorry I overlooked this. I prefer Quickstart to be as simple as
possible, so I believe Jetty is the way to go. SpringBoot is better left
being optional.


> Personally I think it is great there
> is a quickstart using springboot, but it should be in addition to the
> quickstart using jetty, not replacing it. Also it should come with
> instructions how to use it.
>

I also agree with this.


> I have just tried quickstart again recently and the three issues listed
> in my first email below, still exist.
>
> *An additional problem facing new users on the getting started page*
>
> Getting started https://tapestry.apache.org/getting-started.html suggests
>
> mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org
>
> However this no longer works on version 3 or later of the
> maven-archetype-plugin. This has been flagged as issue
> https://issues.apache.org/jira/projects/TAP5/issues/TAP5-2579 . I
> suggest changing web page to use the command
>
> mvn archetype:generate -Dfilter=org.apache.tapestry:quickstart
>
> and then you could close that issue. If someone could give me edit
> privileges on the getting started page I would be happy to do that.
>

Thanks for spotting that and volunteering for fixing it! I just fixed it
myself, but it takes some time for the fix to be replicated to the site.

Thank you!

>
> Thanks
>
> Tim
>
> On 1/5/21 17:17, pico.dev wrote:
> > Hi!
> >
> > Sorry for the inconvenience.
> >
> > If Spring Boot is not desired in the app generated by quickstart, I could
> > try to provide a new patch to remove it if you wish, I hope as soon as I
> > can, just confirm me and I start doing the changes.
> >
> > Regards,
> >
> > El vie, 30 abr 2021 a las 22:43, Thiago H. de Paula Figueiredo (<
> > thiag...@gmail.com>) escribió:
> >
> >> Hello!
> >>
> >> Thank you very much for spotting and warning us about these issues.
> >>
> >> You shouldn't need to use Spring Boot. The archetype needs to be fixed.
> >>
> >> On Sat, Apr 24, 2021 at 9:00 PM D Tim Cummings
>  >> wrote:
> >>
> >>> I have tried the instructions at
> >>> https://tapestry.apache.org/getting-started.html using Tapestry 5.7.2
> >>> archetype.
> >>>
> >>> 1. The code produced by 5.7.2 archetype uses 5.6 packages
> >>> org.apache.tapestry5.services.Request, RequestFilter, RequestHandler,
> >>> Response so it won't compile.
> >>>
> >>> As there were only four to be fixed I manually changed them in
> >>> com.example.newapp.services.AppModule.java to
> >>>
> >>> import org.apache.tapestry5.http.services.Request;
> >>> import org.apache.tapestry5.http.services.RequestFilter;
> >>> import org.apache.tapestry5.http.services.RequestHandler;
> >>> import org.apache.tapestry5.http.services.Response;
> >>>
> >>> 2. Instructions say use 'mvn jetty:run' but there is no jetty plugin
> >>> defined in the pom so this doesn't work despite the nice screen shot
> >>> showing it working with 5.7.2.
> >>>
> >>> 3. I ran 'mvn spring-boot:run' and this ran successfully. However, one
> >>> of the reasons I was trying the archetype was because I was getting a
> >>> lot of duplicate jar warnings in the project I was migrating to 5.7.2.
> >>> Maybe spring-boot solves this problem by not copying duplicates into
> its
> >>> uber jar. Do I need to convert my existing project to include
> >>> spring-boot for building a war?
> >>>
> >>> Thanks
> >>>
> >>> Tim
> >>>
> >>>
> >>> -
> >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >>> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>>
> >>>
> >> --
> >> Thiago
> >>
>


-- 
Thiago


Re: Integrating Agrest in Tapestry app

2021-08-05 Thread Thiago H. de Paula Figueiredo
Ouch, I should have checked Ben's brilliant response before I wrote my own,
inferior one.

On Thu, Aug 5, 2021 at 1:12 PM Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Tue, Aug 3, 2021 at 8:12 AM D Tim Cummings 
> wrote:
>
>> I had a look at tapestry-resteasy but it seems to rely on hibernate or
>> jpa and I am using cayenne.
>
>
> tapestry-resteasy doesn't rely on either Hibernate or JPA nor any other
> ORM:
> https://repo1.maven.org/maven2/org/tynamo/tapestry-resteasy/0.7.0/tapestry-resteasy-0.7.0.pom
>
>
>> I am not sure what is required for
>> org.tynamo.services.PersistenceService.
>
>
> I don't think it's needed either. I guess you're confusing the code
> examples with requirements.
>
>
>> Also tapestry-resteasy says I
>> don't need to edit web.xml.
>>
>
> That's correct. tapestry-resteasy it takes care of telling
> Tapestry-the-page-framework to not handle requests to the REST URLs while
> also handling these URLs inside Tapestry (either as an RequestFilter or an
> HttpServletRequestFilter). Tapestry itself is implemented as a servlet
> filter receiving all requests, even though it may not actually provide the
> response for all of them.
>
> --
> Thiago
>


-- 
Thiago


Re: Integrating Agrest in Tapestry app

2021-08-05 Thread Thiago H. de Paula Figueiredo
On Tue, Aug 3, 2021 at 8:12 AM D Tim Cummings 
wrote:

> I had a look at tapestry-resteasy but it seems to rely on hibernate or
> jpa and I am using cayenne.


tapestry-resteasy doesn't rely on either Hibernate or JPA nor any other
ORM:
https://repo1.maven.org/maven2/org/tynamo/tapestry-resteasy/0.7.0/tapestry-resteasy-0.7.0.pom


> I am not sure what is required for
> org.tynamo.services.PersistenceService.


I don't think it's needed either. I guess you're confusing the code
examples with requirements.


> Also tapestry-resteasy says I
> don't need to edit web.xml.
>

That's correct. tapestry-resteasy it takes care of telling
Tapestry-the-page-framework to not handle requests to the REST URLs while
also handling these URLs inside Tapestry (either as an RequestFilter or an
HttpServletRequestFilter). Tapestry itself is implemented as a servlet
filter receiving all requests, even though it may not actually provide the
response for all of them.

--
Thiago


Re: JQuery and EasyUI problems of migrating Tapestry 5.3.8 to 5.5.0+

2021-07-27 Thread Thiago H. de Paula Figueiredo
Hello!

I believe the problem here is that it seems your code is preventing
Require.js from being loaded, thus causing the Uncaught TypeError: require
is not a function error and completely breaking the whole Tapestry's own
JavaScript. I'd try avoiding overriding/adding again the jQuery library,
which is included automatically when you use the jquery infrastructure,
then have your pms stack depend on the core stack (so it's guaranteed
jQuery and Require.js get included in the page).

On Mon, Jul 26, 2021 at 12:45 PM fred fred  wrote:

> Hello!
>
> Almost 7 Several years ago I developed an application with Tapestry 5.3.8 +
> EasyUI 1.3.5 (with JQuery 1.8.3) + tomcat 8.0+JDK8+Spring+OpenJPA. Now for
> some reason I have to migrate the JDK8 to OpenJDK11. So I have to upgrade
> Tapestry to version 5.5.0 or higher. I did below things:
>
> JqueryStack.java  (same as that in the application with Tapestry 5.3.8)
>
> public class JqueryStack implements JavaScriptStack {
> ...
> @Override
> public List getJavaScriptLibraries() {
> List ret = new ArrayList();
> ret.add(assetSource.getContextAsset("jquery/jquery-1.8.3.min.js", null));
> ret.add(assetSource.getContextAsset("jquery/jquery.json-2.4.min.js",null));
> ret.add(assetSource.getContextAsset("jquery/jquery.easyui.min.js", null));
> ret.add(assetSource.getContextAsset("jquery/validatebox-filter.js",null));
> ret.add(assetSource.getContextAsset("jquery/easyui-lang-zh_CN.js", null));
> ret.add(assetSource.getContextAsset("jquery/datagrid-groupview.js", null));
> ret.add(assetSource.getContextAsset("jquery/datagrid-pagerfilter.js",
> null));
> ret.add(assetSource.getContextAsset("jquery/jquery.ajaxfileupload-min.js",
> null));
> ret.add(assetSource.getContextAsset("jquery/noconflict.js", null));
> ret.add(assetSource.getContextAsset("script/pms.obj.min.js", null));
> ret.add(assetSource.getContextAsset("script/pms.min.js", null));
> return ret;
> }
>
> AppModule.java
> @Contribute(SymbolProvider.class)
> @ApplicationDefaults
> public static void setupEnvironment(MappedConfiguration
> configuration)
> {
> configuration.add(SymbolConstants.JAVASCRIPT_INFRASTRUCTURE_PROVIDER,
> "jquery");
> }
> @Core
> @Contribute(JavaScriptStack.class)
> public static void overrideJquery(OrderedConfiguration
> conf) {
> conf.override("jquery-library",
> StackExtension.library("context:jquery/jquery-1.8.3.min.js"));
> }
> @Contribute(JavaScriptStackSource.class)
> public static void addMyStack(
> MappedConfiguration configuration) {
> configuration.addInstance("pms", JqueryStack.class);
> }
>
> Then in Layout.java,
> @SetupRender
> void initScript() {
> javaScriptSupport.importStack("pms");
> }
>
> Deployed and started:
> The EasyUI tags are parsed and pages could be rendered correctly. But Tabs
> and Dialog did not works:
> Dialogs:
> Administrator
>
> function changePass(userId) {
> var href = contextPath + "/user/gadget/changepass";
> if (userId != null) {
> href += "/" + userId;
> }
>
> jQuery('#dd_edit').dialog({
> title : PMS.Messages.dialog_upass_change,
> width : 300,
> height : 190,
> closed : false,
> cache : false,
> href : href,
> modal : true,
> buttons : [ {
> text : PMS.Messages.btn_save_label,
> iconCls : 'icon-save',
> handler : saveUserPass
> } ],
> onLoad : function() {
> loadAdminView(userId);
> },onBeforeOpen:doNothing
> });
> }
>
> function loadAdminView(userId){
> if(userId != null){
> jQuery('.admin').hide();
> jQuery('#opassword').validatebox('disableValidation');
> }
> }
>
> When clicked on Administrator link, a blank page displayed, and browser
> console showed:
> pms.js.1.0.7.js (minified JavaScript library):4 Uncaught TypeError: require
> is not a function.
>
> It seems the RequireJS is not initialized.
>
> Tabs problem:
> 
> 
> 
> 
>  data-options="plain:true,iconCls:'icon-add'">${message:btn_fund_add}
> 
>  class="easyui-linkbutton"
>
> data-options="plain:true,iconCls:'icon-back'">${message:btn_return}${workspace.masterFund.fundName}
> 
> 
>  onclick="addpartner()"
> data-options="plain:true,iconCls:'icon-add'">${message:btn_partner_add}
> 
>  style="height:435px;">
> 
> 
> 
> data-options="field:'name',width:fixWidthTable(0.10)">${message:column_name}
> 
> data-options="field:'fullName',width:fixWidthTable(0.25)">${message:column_full_name}
> 
> data-options="field:'holderType',width:fixWidthTable(0.10)">${message:column_type}
> 
> data-options="field:'joinTime',width:fixWidthTable(0.10)">${message:column_join_time}
> 
> data-options="field:'subscribeAmount',width:fixWidthTable(0.10),formatter:numberFormatter">${message:column_subscribe_amount}
> 
> data-options="field:'raiseFee',width:fixWidthTable(0.10),formatter:numberFormatter">${message:column_raise_fee}
> 
> data-options="field:'participationFee',width:fixWidthTable(0.10),formatter:numberFormatter">${message:column_participation_fee}
> 
> data-options="field:'description',width:fixWidthTable(0.05),formatter:formatDescription">${message:column_description}
> 
> 

Re: upgrade from 3.0.1

2021-07-27 Thread Thiago H. de Paula Figueiredo
Hello!

I agree with Volker and Cezary. There would be no value to do any upgrade
other than 5.7. I haven't worked with Tapestry 3, but I did with 4 (even a
couple months ago) and I've been working daily with 5.7. Some of the main
concepts do carry over these versions (pages, the 1-1 relationship they
have with templates, components, heavy reliance on IoC for flexibility),
but the implementation is indeed very different. Unless you want to ditch
server-side rendering for client-side one (i.e. just JavaScript making
calls to REST endpoints), Tapestry 5.7 is the way to go.

Please let us know if you have further questions.

On Mon, Jul 26, 2021 at 4:20 PM Cezary Biernacki 
wrote:

> Hi,
> There is no point upgrading to Tapestry 4.x. Unfortunately Tapestry 3 is
> quite different from Tapestry 4.x, which is quite different from Tapestry
> 5.x. Differences are so significant, that you should consider this to be
> more of a total rewrite in a new framework, rather than upgrades. At this
> point it might be worth evaluating if Tapestry 5 is the right framework for
> your project.
>
> If you decide to go ahead with Tapestry 5, I think there is little reason
> to try any versions older than 5.7 (and certainly no reason older than
> 5.6).
>
> Best regards,
> Cezary
>
>
>
> On Mon, Jul 26, 2021 at 8:00 PM Chris Kujawa 
> wrote:
>
> > Hello!
> >
> > I recently started working for a company and am looking into what it will
> > take to upgrade our web application from Tapestry version 3.0.1 to
> > something a bit more...modern. I've read a bunch of the upgrade docs
> (both
> > older and new) and am wondering...are we better off if we do an
> > intermediate upgrade to 4.0.x first, then move to 5, or should we just go
> > straight to 5.x?
> >
> > IF we go to 5.x, is there any reason to start at 5.1...or should we just
> go
> > straight to 5.7? I realize that there's a bunch of 3rd party libraries
> you
> > don't know about, but I can handle determining what the need is there. I
> > just get the feeling that the stop at 4.0.x is a moot point, and that
> we've
> > got our work cut out for us.
> >
> > Thank you in advance for your help!
> >
> > -Chris
> >
>


-- 
Thiago


Re: Help overriding ComponentMessageSource service

2021-06-21 Thread Thiago H. de Paula Figueiredo
On Thu, Jun 17, 2021 at 8:29 AM Numa Schmeder  wrote:

> Hi,


Hi!


> Thanks for your help, no it doesn’t seem to work.  I found a solution
> using decorate method, but I am not sure it’s really clean.


I consider decoration really clean. Sometimes you cannot use service
override because it causes a circular service dependency (it ends up
depending on itself).


> public static ComponentMessagesSource
> decorateComponentMessagesSource(ComponentMessagesSource current, @Autobuild
> CustomComponentMessagesSourceImpl custom, UpdateListenerHub
> updateListenerHub)
> {
> updateListenerHub.addUpdateListener(custom);
> return custom;
> }
>

This looks good to me.


> Just wondering if there is no cleaner way.


I guess your problem in your original attempt was declaring your custom
messages source as a service, something you don't need. That way, you end
up with two services implementing the same service interface and
Tapestry-IoC doesn't know which one to use.

I'd try this:

@Contribute(ServiceOverride.class)
public static void
setupApplicationServiceOverrides(MappedConfiguration,Object>
configuration, @Autobuild YourCustomComponentMessagesSource messagesSource,
UpdateListenerHub updateListenerHub)
{
//  configuration.add(HibernateSessionSource.class,
hibernateSessionSource);
//overriding existing default component message source to add
MessageFormat
updateListenerHub.addUpdateListener(messagesSource);
configuration.override(ComponentMessagesSource.class, messagesSource);
}


> I believe message formatter should be a service that should be overridable.


Please create a Jira issue for this.

--
Thiago


Re: method varargs and property expression

2021-06-07 Thread Thiago H. de Paula Figueiredo
On Mon, Jun 7, 2021 at 5:38 AM Numa Schmeder  wrote:

> Hi Thiago,
>

Hello!


> Thank you for your feedback, yes indeed, I have checked the code of the
> property binding and the antler syntax.
> Indeed it compiles byte code based on real method signature, so you can’t
> be to generic or it won’t find the method you have written.


And that's exactly how Tapestry voids runtime reflection so property access
is as fast as handwritten code. :)


> I was actually thinking of implementing Spring Expression Language (SpEL),
> OGNL is getting a bit outdated and is now longer evolving.


Interesting! Planning to opensource it when it's done? It would be nice.


> Although I figured out my language issue, if you don’t call
> PersistentLocale on first render, URL won’t contain the locale virtual
> folder in the path.
> I think this is a bug, the natural behavior seems to be if you define
> multiple locales, on first render without local (index page for example) it
> should select the appropriate locale from request, browser etc.. (this
> works) and set it with persistentLocale, so links should be written
> correctly with the locale virtual folder. What do you think ?
>

Hmm, I have to think about this one. No ready-made answers like the other
ones in this thread. :)


> Lastly I wanted to override a value encoder for specific hibernate objects
> to create SEO friendly urls , but it was discarded because there is already
> an hibernate value encoder registered with tapestry hibernate, how can I
> override it for specific objects ?
>

ValueEncoderSource is a service with a mapped configuration: key is the
class of the object being encoded/decoded, ValueEncoderFactory (which is
usually implemented together with ValueEncoder in most but not all cases),
so this should be a very straightforward Tapestry-IoC service contribution
override. I'm not sure how you tried to do your override.


> Your help is very much appreciated.


It's always nice to help people, doubly if it's about Tapestry. :D


>
>
> Thank you.
>
> Best regards,
>
> Numa
>
> > Le 6 juin 2021 à 21:09, Thiago H. de Paula Figueiredo <
> thiag...@gmail.com> a écrit :
> >
> > On Wed, May 26, 2021 at 7:00 AM Numa Schmeder  n...@dfacto.ch>> wrote:
> >
> >> Hello,
> >>
> >
> > Hello!
> >
> >
> >> It seems method with varargs doesn’t work with property expression.
> >> If I put the following property expression, I get an error: Message
> >> doesn’t have a public “format" method.
> >> ${messages.format('priceFromPerGuest', travelMinPricePerGuest,
> >> displayedCurrency)}
> >> But If I write it as follow is works:
> >> messages.format('priceFromPerGuest', [travelMinPricePerGuest,
> >> displayedCurrency])
> >>
> >> Is this a bug ?
> >>
> >
> > I don't think so. Varargs, as far as I know, are implemented in Java
> purely
> > as a compiler feature, and Tapestry prop binding expressions work at
> > runtime, so it only sees method(arg, Object[] varargs) for something
> > declared as method(arg1, Object... varargs).
> >
> >
> >> Tapestry property expression is a bit limiting, particularly in
> conditions
> >> where you can’t have logical expression as:  test=“size > 10”
> >>
> >
> > Let me be pedantic here. :) Yes, it's the prop binding, short for
> property.
> > Being based on properties, it can be very fast, since Tapestry-IoC and
> > Tapestry can create code that calls properties without using reflection.
> > This binding was never supposed to have logical expressions.
> >
> >
> >> I know the rational is to keep property expression as simple as
> possible,
> >> but having some logic expressed in the template is not that bad,
> >
> >
> > Having logic expressed in the template is completely against the way the
> > prop binding was created and implemented, so I suggest you to not try or
> > want to do something one given tool doesn't want.
> >
> >
> >> because it’s in context ans sometimes makes more sense than having
> >> everything in java code.
> >
> >
> > Here comes one of the beauties of Tapestry: it's incredibly flexible and
> > customizable. You can create your own bindings with any logic you want!
> If
> > you don't know how, please let us know and we'll show you how.
> >
> > By the way, ChenilleKit, a third-party Tapestry add-on library, provides
> an
> > OGNL binding that provides a lot of expression power (but uses reflection
> > at runtime).
> >
> >
> >> Also if you work a lot with collection of 

Re: AssetDispatcher Tapestry 5.3.8

2021-06-06 Thread Thiago H. de Paula Figueiredo
On Fri, May 28, 2021 at 9:41 AM Reinhold Gruber  wrote:

> Hi!
>

Hello!


>
> Some emergency. Any help highly appreciated.
> The AssetDispatcher in Tapestry 5.3.8 allows harmful requests, reading
> contents from WEB-INF etc.
> We currently do not have the time to update to the newest Tapestry version
> and we need to to something quick, right now.
> So I would like to ask how the current AssetDispatcher can be replaced by
> a more secure version?
> What needs to be done in the application module class. Tried there various
> things but did not make it work.
> Does anyone maybe have already a patched class handy?
>

I suggest you try something different: instead of trying to override
AssetDispatcher, contribute a new Dispatcher before AssetDispatcher that
blocks requests to WEB-INF, META-INF and any other file that you don't want
to make public. You can do something simple but effective by just using
usual string matching functions like String.contains() (with WEB-INF and
META-INF) and String.endsWith() (with .properties, .class, .xml, etc) and
call Response.sendError(404, "some message").


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

-- 
Thiago


Re: method varargs and property expression

2021-06-06 Thread Thiago H. de Paula Figueiredo
On Wed, May 26, 2021 at 7:00 AM Numa Schmeder  wrote:

> Hello,
>

Hello!


> It seems method with varargs doesn’t work with property expression.
> If I put the following property expression, I get an error: Message
> doesn’t have a public “format" method.
> ${messages.format('priceFromPerGuest', travelMinPricePerGuest,
> displayedCurrency)}
> But If I write it as follow is works:
> messages.format('priceFromPerGuest', [travelMinPricePerGuest,
> displayedCurrency])
>
> Is this a bug ?
>

I don't think so. Varargs, as far as I know, are implemented in Java purely
as a compiler feature, and Tapestry prop binding expressions work at
runtime, so it only sees method(arg, Object[] varargs) for something
declared as method(arg1, Object... varargs).


> Tapestry property expression is a bit limiting, particularly in conditions
> where you can’t have logical expression as:  test=“size > 10”
>

Let me be pedantic here. :) Yes, it's the prop binding, short for property.
Being based on properties, it can be very fast, since Tapestry-IoC and
Tapestry can create code that calls properties without using reflection.
This binding was never supposed to have logical expressions.


> I know the rational is to keep property expression as simple as possible,
> but having some logic expressed in the template is not that bad,


Having logic expressed in the template is completely against the way the
prop binding was created and implemented, so I suggest you to not try or
want to do something one given tool doesn't want.


> because it’s in context ans sometimes makes more sense than having
> everything in java code.


Here comes one of the beauties of Tapestry: it's incredibly flexible and
customizable. You can create your own bindings with any logic you want! If
you don't know how, please let us know and we'll show you how.

By the way, ChenilleKit, a third-party Tapestry add-on library, provides an
OGNL binding that provides a lot of expression power (but uses reflection
at runtime).


> Also if you work a lot with collection of objects, you have to create a
> property for each type of element in the collections, the “var” keyword is
> not powerful to be used in complex property expressions.
> Exemple, this won’t work, but it would be very practical:
> 
> ${var:country.getName(locale)} - ${getPopulation(var:country)}
> 
>
> And if you use a generic property tempValue that you could reuse in
> different places, it won’t work because all conduits will be based on the
> Object Type and not Country type.
>
> @Property
> Object tempValue
>
> 
> ${tempValue.getName(locale)} - ${getPopulation(tempValue)}
> 
>
> Could we find a solution to avoir creating a lot of fields for all loops ?
>

The var binding only really accepts strings well because it doesn't use
reflection and being able to support arbitrary types would need reflection.


>
> Thank you for your help,
>
> Best!
>
>
>      Numa Schmederwww.dfacto.ch  <
> http://www.dfacto.ch/>
> n...@dfacto.ch    |   M +41 79 538 30 01
>
> DIGITAL STRATEGY   |   DESIGN   |   DEVELOPMENT
>
>
>
>
>

-- 
Thiago


Re: Tapestry 5.7+ and Spock

2021-05-25 Thread Thiago H. de Paula Figueiredo
Hello, Volker and other Tapestry users!

Thanks for the patch! Much appreciated! I'll try to take a look at it this
weekend.

Cheers!

On Sat, May 22, 2021 at 5:30 PM Volker Lamp  wrote:

> Just a quick email with some status information. The Spock project
> encouraged Tapestry should adopt 'spock-tapestry'. I contributed a patch
> today that will (if accepted) add 'tapestry-spock' to Tapestry as a drop-in
> replacement for 'spock-tapestry'. Anyone interested can follow-up in
> https://issues.apache.org/jira/projects/TAP5/issues/TAP5-2668.
>


-- 
Thiago


Re: Tapestry 5.7+ and Spock

2021-04-30 Thread Thiago H. de Paula Figueiredo
Thanks, Volker! I've just thumbed-up it!

On Wed, Apr 28, 2021 at 5:59 PM Volker Lamp  wrote:

> If you, like me, use Spock (and perhaps Geb) specification/tests for your
> Tapestry apps, please support my initiative to have Spock, or
> spock-tapestry, to be precise, support Tapestry 5.7+. Indicate your support
> by adding a 'thumbs up' to my contribution to the discussion of my pull
> request
> .
>
> The Spock specification (and test) framework has a sub-project named
> 'spock-tapestry' whose purpose it is to provide a Spock extension that
> knows how to deal with Tapestry's @ImportModule annotation, making it very
> convenient to test modules and services written in Tapestry. Spock is great
> and worth a closer look if you haven't heard of it before. The Spock
> maintainers have done a good job keeping up with different versions of
> Tapestry.
>
> As everyone on this list is probably aware, Tapestry 5.7 is not fully
> backwards-compatible with previous releases. Many classes were moved to
> other packages, and sometimes even to a different JAR. This was done to
> avoid split packages, making them easier to be used with Java 9+ modules.
>
> Unfortunately, 'spock-tapestry' is affected by those backward
> incompatibilities and the maintainers weren't too enthusiastic, at least
> initially, about accommodating another Tapestry version (see TAP5-2668
> ). However, after
> Thiago's
> judgement
> <
> https://github.com/spockframework/spock/issues/1312#issuecomment-826810060
> >
> that "another similar refactor isn't expected to happen again ever" it
> looks like they are willing to consider it.
>
> Currently, there seems to be discord if 'spock-tapestry' should continue
> supporting past verions of Tapestry (with the implication of having to
> include conditional code for some of the past versions) or if, from the
> next release, it should just upgrade its Tapestry dependency to 5.7+. My
> take is the latter. As software evolves over time it is reasonable to
> upgrade dependencies from time to time. Users of Tapestry up to release
> 5.6.+ would still be able to use Spock up to release 2.0-M5.
>
> If you agree, again, please add a 'thumbs up' to my contribution to the
> discussion of my pull request
> .
> However, I'm certainly interested in other points of view as well, so
> please let me know by responding to this post.
>
> Thank you.
>


-- 
Thiago


Re: Getting Started with 5.7.2

2021-04-30 Thread Thiago H. de Paula Figueiredo
Hello!

Thank you very much for spotting and warning us about these issues.

You shouldn't need to use Spring Boot. The archetype needs to be fixed.

On Sat, Apr 24, 2021 at 9:00 PM D Tim Cummings 
wrote:

> I have tried the instructions at
> https://tapestry.apache.org/getting-started.html using Tapestry 5.7.2
> archetype.
>
> 1. The code produced by 5.7.2 archetype uses 5.6 packages
> org.apache.tapestry5.services.Request, RequestFilter, RequestHandler,
> Response so it won't compile.
>
> As there were only four to be fixed I manually changed them in
> com.example.newapp.services.AppModule.java to
>
> import org.apache.tapestry5.http.services.Request;
> import org.apache.tapestry5.http.services.RequestFilter;
> import org.apache.tapestry5.http.services.RequestHandler;
> import org.apache.tapestry5.http.services.Response;
>
> 2. Instructions say use 'mvn jetty:run' but there is no jetty plugin
> defined in the pom so this doesn't work despite the nice screen shot
> showing it working with 5.7.2.
>
> 3. I ran 'mvn spring-boot:run' and this ran successfully. However, one
> of the reasons I was trying the archetype was because I was getting a
> lot of duplicate jar warnings in the project I was migrating to 5.7.2.
> Maybe spring-boot solves this problem by not copying duplicates into its
> uber jar. Do I need to convert my existing project to include
> spring-boot for building a war?
>
> Thanks
>
> Tim
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-- 
Thiago


CVE-2021-30638: An Information Disclosure due to insufficient input validation exists in Apache Tapestry 5.4.0 and later

2021-04-27 Thread Thiago H. de Paula Figueiredo
Description:

Information Exposure vulnerability in context asset handling of Apache
Tapestry allows an attacker to download files inside WEB-INF if using a
specially-constructed URL.  This was caused by an incomplete fix for
CVE-2020-13953.  This issue affects Apache Tapestry Apache Tapestry 5.4.0
version to Apache Tapestry 5.6.3; Apache Tapestry 5.7.0 version and Apache
Tapestry 5.7.1.

Solution:

For Tapestry 5.4.0 to 5.6.3: upgrade to 5.6.4

For Tapestry 5.7.0 and 5.7.1: upgrade to 5.7.2

 Problem Description 

An Information Disclosure due to insufficient input validation exists

in Apache Tapestry 5.6.1 and later (latest)

A recent patch for CVE-2020-13953

(
https://github.com/apache/tapestry-5/commit/cf1912291af9146ee86a4aef471ae2ab31d3a28b
)

fails to account for the backslash character in the filtering regex

An attacker is therefore able to list and download web app files from

the WEB-INF and META-INF directory using a crafted payload.

Credit:

This vulnerability was discovered by Kc Udonsi of Trend Micro

-- 
Thiago


Re: Coffeescript documentation is broken

2021-04-21 Thread Thiago H. de Paula Figueiredo
Hello!

Thanks again!

I've finally had some time to fix this. I've just committed the changes and
it takes some time, maybe an hour, for them to be replicated to the site.

On Fri, Apr 16, 2021 at 8:16 AM Chris Poulsen 
wrote:

> Hi
>
> Just checked
>
> https://tapestry.apache.org/documentation.html#Documentation-APIandComponentReference
> again, nothing has changed.
>
> In the "API (javadoc)" row in the table, only 5.4 and 5.5 links point to
> the correct page - 5.3.8, 5.6.2 and 5.7.0 (current) links all end with
> /apidocs/ which basically "hides" the index page with the links to the
> apidocs and coffeescript pages.
>
> Also the contents of the "jump to" (upper right corner) menu on
> http://tapestry.apache.org/5.7.0/coffeescript/t5-core-dom-jquery.html are
> still broken.
>
> --
> Chris
>
>
> On Wed, Apr 14, 2021 at 11:29 PM Thiago H. de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > Hello! Please check again and let me know whether the problems are
> actually
> > fixed.
> >
> > On Thu, Mar 25, 2021 at 7:52 AM Chris Poulsen 
> > wrote:
> >
> > > Hi
> > >
> > > I was just introducing a new employee to Tapestry and when I wanted to
> > walk
> > > through the coffeescript docs since I find them a little peculiar, I
> > > realized that they are hard to find - and their navigation is broken.
> > >
> > > The way I found them, was to go to Tapestry->Documentation, clicked one
> > of
> > > the "API (javadoc) links" (5.4 and 5.5 seems to link correctly) - the
> > rest
> > > of the links go directly to the javadoc part (url ends with /apidocs)
> > >
> > > Once the docs are located, the menu in the top right corner is
> > > non-functional - the text of the first link is:
> > >
> > >
> > >
> >
> "/home/thiago/workspace-tapestry/tapestry-5/tapestry-beanvalidator/src/main/coffeescript/META-INF/modules/t5/beanvalidator/beanvalidator-validation.coffee"
> > >
> > > I guess it should be something slightly shorter and at the very least
> not
> > > include Thiagos homedir ;)
> > >
> > > --
> > > Chris
> > >
> >
> >
> > --
> > Thiago
> >
>


-- 
Thiago


[SECURITY VULNERABILITY DISCLOSURE] CVE-2021-27850: Apache Tapestry: Bypass of the fix for CVE-2019-0195

2021-04-14 Thread Thiago H. de Paula Figueiredo
Description:

A critical unauthenticated remote code execution vulnerability was found

all recent versions of Apache Tapestry.

The affected versions include 5.4.5, 5.5.0, 5.6.2 and 5.7.0.

The vulnerability I have found is a bypass of the fix for CVE-2019-0195.

Recap:

Before the fix of CVE-2019-0195 it was possible to download arbitrary

class files from the classpath by providing a crafted

asset file URL.

An attacker was able to download the file `AppModule.class` by

requesting the URL

`http://localhost:8080/assets/something/services/AppModule.class`

which contains a HMAC secret key.

The fix for that bug was a blacklist filter that checks if the URL

ends with `.class`, `.properties` or `.xml`.

Bypass:

Unfortunately, the blacklist solution can simply be bypassed by

appending a `/` at the end of the URL:

`http://localhost:8080/assets/something/services/AppModule.class/`

The slash is stripped after the blacklist check and the file

`AppModule.class` is loaded into the response.

This class usually contains the HMAC secret key which is used to sign

serialized Java objects.

With the knowledge of that key an attacker can sign a Java gadget

chain that leads to RCE (e.g. CommonsBeanUtils1 from ysoserial).

Solution for this vulnerability:

* For Apache Tapestry 5.4.0 to 5.6.2, upgrade to 5.6.2 or later.

* For Apache Tapestry 5.7.0, upgrade to 5.7.1 or later.

This issue is being tracked as TAP5-2663

Credit:

Apache Tapestry would like to thank Johannes Moritz for finding and
notifying this vulnerability

-- 
Thiago


[ANNOUNCEMENT] Tapestry 5.7.2 released

2021-04-14 Thread Thiago H. de Paula Figueiredo
Tapestry 5.7.2 is a drop-in replacement and recommended upgrade for
previous 5.7.2 releases. To upgrade, just update the dependency in your
build configuration (Maven POM, Gradle build script, etc.) – or Download
the new JAR file -- and the new version will just work. However, please
review the How to Upgrade instructions before upgrading.

Full details at https://tapestry.apache.org/release-notes-572.html.

Thanks to everyone involved in this release!

Happy coding!

-- 
Thiago


[ANNOUNCEMENT] Tapestry 5.6.4 released

2021-04-14 Thread Thiago H. de Paula Figueiredo
Tapestry 5.6.5 is a drop-in replacement for Tapestry 5.4, 5.5 and 5.6
releases. It's a recommended upgrade for 5.4+ until 5.6.x. To upgrade, just
update the dependency in your build configuration (Maven POM, Gradle build
script, etc.) – or Download the new JAR file -- and the new version will
just work. However, please review the How to Upgrade instructions before
upgrading.

Full details at https://tapestry.apache.org/release-notes-564.html.

Thanks to everyone involved in this release!

Happy coding!

-- 
Thiago


Re: Coffeescript documentation is broken

2021-04-14 Thread Thiago H. de Paula Figueiredo
Hello! Please check again and let me know whether the problems are actually
fixed.

On Thu, Mar 25, 2021 at 7:52 AM Chris Poulsen 
wrote:

> Hi
>
> I was just introducing a new employee to Tapestry and when I wanted to walk
> through the coffeescript docs since I find them a little peculiar, I
> realized that they are hard to find - and their navigation is broken.
>
> The way I found them, was to go to Tapestry->Documentation, clicked one of
> the "API (javadoc) links" (5.4 and 5.5 seems to link correctly) - the rest
> of the links go directly to the javadoc part (url ends with /apidocs)
>
> Once the docs are located, the menu in the top right corner is
> non-functional - the text of the first link is:
>
>
> "/home/thiago/workspace-tapestry/tapestry-5/tapestry-beanvalidator/src/main/coffeescript/META-INF/modules/t5/beanvalidator/beanvalidator-validation.coffee"
>
> I guess it should be something slightly shorter and at the very least not
> include Thiagos homedir ;)
>
> --
> Chris
>


-- 
Thiago


Re: GridPager Component with Boostrap4

2021-04-13 Thread Thiago H. de Paula Figueiredo
On Thu, Apr 8, 2021 at 1:12 PM Georg Ragaller 
wrote:

> Hello all,
>

Hello, Georg!


> I am just starting with Tapestry (5.7.1) and use the grid component.
>

Welcome to the Tapestry community!


> Also, the application module is annotated with
> @ImportModule(Bootstrap4Module.class), as I want to use Bootstrap 4.x.
> However, with this combination the links of the embedded pager component
> are not drawn in the expected Bootstrap 4 style.
> In my opinion, this is because in
> org.apache.tapestry5.corelib.components.GridPager the render
> functionality does not distinguish between Bootstrap 3 and 4.
> As far as I can see, the pagination component in Bootstrap 4 needs
> additional CSS classes compared to version 3, namely 'page-item' and
> 'page-link'.
>
> See:
>
> https://getbootstrap.com/docs/3.4/components/#pagination
> https://getbootstrap.com/docs/4.3/components/pagination/
>
> So is the current behaviour a bug, or am I still doing something wrong?
>

It's a bug and thanks for reporting it. Unluckily, we cut 5.7.2 and 5.6.4
last Thursday, otherwise your very well written patch would have been
applied already. Thanks for the patch!

Meanwhile, you can fix this without touching Tapestry's sources in at least
4 different ways, and I'll really explain just one for now for time reasons:
1) Easier one: copy the Grid Java source file, rename it to something like
FixedGrid, then tell Tapestry to use FixedGrid anytime you use Grid by
adding this method to AppModule (not tested):
public static void contributeServiceOverride(MappedConfiguration configuration) {
configuration.add(Grid.class, FixedGrid.class);
}
2) Create a mixin to add the missing CSS classes through DOM rewriting and
apply it manually to your Grid instances through t:mixins
3) Create a mixin to add the missing CSS classes through DOM rewriting and
apply it automatically by adding a new component class transformer.
4) Create a GridWrapper class that passes all the parameters it gets to
Grid, then uses DOM rewriting to add the missing CSS classes.

Tapestry is very, very flexible and composable, which explains the variety
of ways you can use to solve your problem. :)


>
> Cheers,
> Georg
>
>
> P.S.: For me, I have solved the problem for the time being with the
> enclosed patch.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org



-- 
Thiago


Re: [ANNOUNCEMENT] Tapestry 5.6.2 released

2021-04-13 Thread Thiago H. de Paula Figueiredo
On Thu, Apr 8, 2021 at 2:49 AM Ben Weidig  wrote:

> Hi!
>

Hello!


> even though I've mentioned the signature changes as a risk in the ticket,
> it slipped my mind when it got merged into 5.6.x and not just 5.7.
>

The merge on 5.6.x is on me and I apologize for that. Considering the
breaking changes, it shouldn't have been done.


> There are 2 signature changes in JSONObject to match the Map interface:
>
> * Object get(String name) -> Object get(Object name)
> * JSONObject putAll(Map newProperties) -> void putAll(Map extends String, ? extends Object> newProperties)
>
> The first one could have been augmented with the previous one as
> @Deprecated, but the second one wouldn't work due to type erasure, so it
> would've been a breaking change either way.
>
> If you like I could make the changes to the release notes, and maybe wrote
> a few sentences about the JSON module. And I could update the Type Coercion
> page with the new JSR310 coercers.
>

Please do it.


> But I don't know how to edit the project page...
>

Basically, go to https://cwiki.apache.org/confluence/, log in with your ASF
credentials, then go here:
https://cwiki.apache.org/confluence/display/TAPESTRY/Home. From there, you
can click on links or use search to find specific pages. You should already
have edition permissions.

Cheers!


>
> Ben
>
>
> On Wed, Apr 7, 2021 at 11:43 PM Thiago H. de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > On Wed, Mar 31, 2021 at 1:40 PM Dmitry Gusev 
> > wrote:
> >
> > > Hello,
> > >
> >
> > Hello!
> >
> >
> > > I'm upgrading one of our apps to latest 5.6.3 and found that this
> release
> > > broke binary compatibility after tapestry-json improvements:
> > >
> > > https://issues.apache.org/jira/browse/TAP5-2640
> > >
> > > Libraries compiled with < 5.6.2 _and_ using JSONObject class,
> > > namely JSONObject#get(String), will fail with NoSuchMethodError at
> > runtime.
> > >
> >
> > The changes are indeed mentioned in
> > https://tapestry.apache.org/release-notes-562.html, but I didn't know
> they
> > would have binary compatibility broken. I'm sorry for that.
> >
> >
> > >
> > > Such libraries will need to be recompiled using 5.6.2+
> > >
> > > Release notes for 5.6.2 miss this detail.
> > >
> > > On Wed, Feb 24, 2021 at 3:01 PM Thiago H. de Paula Figueiredo <
> > > thiag...@gmail.com> wrote:
> > >
> > > > Tapestry 5.6.2 is a drop-in replacement for Tapestry 5.4, 5.5 and 5.6
> > > > releases. It's a recommended upgrade for 5.6.1 and 5.6.0. To upgrade,
> > > just
> > > > update the dependency in your build configuration (Maven POM, Gradle
> > > build
> > > > script, etc.) – or Download the new JAR file -- and the new version
> > will
> > > > just work. However, please review the How to Upgrade instructions
> > before
> > > > upgrading.
> > > >
> > > > The most interesting improvement is  TAP5-2640: better exceptions in
> > > > tapestry-json code, plus JSONArray now implementing Collection and
> > > > JSONObject implementing Map.
> > > >
> > > > Full details at https://tapestry.apache.org/release-notes-562.html.
> > > >
> > > > Thanks for everyone involved in this release!
> > > >
> > > > Happy coding!
> > > >
> > > > --
> > > > Thiago
> > > >
> > >
> > >
> > > --
> > > Dmitry Gusev
> > >
> > > AnjLab Team
> > > http://anjlab.com
> > >
> >
> >
> > --
> > Thiago
> >
>


-- 
Thiago


Re: [ANNOUNCEMENT] Tapestry 5.6.2 released

2021-04-07 Thread Thiago H. de Paula Figueiredo
On Wed, Mar 31, 2021 at 1:40 PM Dmitry Gusev  wrote:

> Hello,
>

Hello!


> I'm upgrading one of our apps to latest 5.6.3 and found that this release
> broke binary compatibility after tapestry-json improvements:
>
> https://issues.apache.org/jira/browse/TAP5-2640
>
> Libraries compiled with < 5.6.2 _and_ using JSONObject class,
> namely JSONObject#get(String), will fail with NoSuchMethodError at runtime.
>

The changes are indeed mentioned in
https://tapestry.apache.org/release-notes-562.html, but I didn't know they
would have binary compatibility broken. I'm sorry for that.


>
> Such libraries will need to be recompiled using 5.6.2+
>
> Release notes for 5.6.2 miss this detail.
>
> On Wed, Feb 24, 2021 at 3:01 PM Thiago H. de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > Tapestry 5.6.2 is a drop-in replacement for Tapestry 5.4, 5.5 and 5.6
> > releases. It's a recommended upgrade for 5.6.1 and 5.6.0. To upgrade,
> just
> > update the dependency in your build configuration (Maven POM, Gradle
> build
> > script, etc.) – or Download the new JAR file -- and the new version will
> > just work. However, please review the How to Upgrade instructions before
> > upgrading.
> >
> > The most interesting improvement is  TAP5-2640: better exceptions in
> > tapestry-json code, plus JSONArray now implementing Collection and
> > JSONObject implementing Map.
> >
> > Full details at https://tapestry.apache.org/release-notes-562.html.
> >
> > Thanks for everyone involved in this release!
> >
> > Happy coding!
> >
> > --
> > Thiago
> >
>
>
> --
> Dmitry Gusev
>
> AnjLab Team
> http://anjlab.com
>


-- 
Thiago


Re: [ANNOUNCEMENT] Tapestry 5.7.1 and 5.6.3 released

2021-03-22 Thread Thiago H. de Paula Figueiredo
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


[ANNOUNCEMENT] Tapestry 5.7.1 and 5.6.3 released

2021-03-16 Thread Thiago H. de Paula Figueiredo
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


[ANNOUNCEMENT] Tapestry 5.7.0 released

2021-02-24 Thread Thiago H. de Paula Figueiredo
Tapestry 5.7.0 is a new major version which needs a migration step for
projects using previous versions. To upgrade, update the dependency in your
build configuration (Maven POM, Gradle build script, etc.) – or Download
the new JAR file. Please check the Upgrade Guide section in the release
notes for details. This is a step that only needs to be done once. Please
also review the How to Upgrade instructions before upgrading.

The main new features are:

Partial Java 9+ modules (JPMS) support. It's partial because
module-info.java classes are not provided yet. On the other hand,
Tapestry's JARs don't have split packages anymore, making them easier to be
used with Java 9+ modules. Many classes had to be moved to other packages,
and sometimes even to a different JAR. The migration tool mentioned above
will take care of updating your code so it uses the correct new
fully-qualified class names for the ones that were moved and/or renamed.
TAP5-2641 - Turn the Tapestry subprojects into Java 9+ modules (JPMS)
RESOLVED TAP5-2627 - Fix split packages RESOLVED
TypeCoercer now uses mapped configuration so coercion overrides are done in
an explicit manner.
TAP5-2650 - Change TypeCoercer configuration to MappedConfiguration CLOSED
It's not possible to use the Tapestry request handling framework, specially
the RequestFilter, Dispatcher, Request, Response and
HttpServletRequestFilter classes, without the page framework. These classes
were moved to a new artifact, tapestry-http, which can be used in place of
tapestry-core (which depends on tapestry-http). tapestry-http Servlet
filter class is org.apache.tapestry5.http.TapestryFilter. The original
TapestryFilter, from org.apache.tapestry5, can be used in the same way way
as in past Tapestry versions.

Full details at https://tapestry.apache.org/release-notes-570.html.

Thanks for everyone involved in getting this new release done!

Happy coding!

-- 
Thiago


[ANNOUNCEMENT] Tapestry 5.6.2 released

2021-02-24 Thread Thiago H. de Paula Figueiredo
Tapestry 5.6.2 is a drop-in replacement for Tapestry 5.4, 5.5 and 5.6
releases. It's a recommended upgrade for 5.6.1 and 5.6.0. To upgrade, just
update the dependency in your build configuration (Maven POM, Gradle build
script, etc.) – or Download the new JAR file -- and the new version will
just work. However, please review the How to Upgrade instructions before
upgrading.

The most interesting improvement is  TAP5-2640: better exceptions in
tapestry-json code, plus JSONArray now implementing Collection and
JSONObject implementing Map.

Full details at https://tapestry.apache.org/release-notes-562.html.

Thanks for everyone involved in this release!

Happy coding!

-- 
Thiago


Re: Ecmascript5 and tapestry-webresources

2021-02-14 Thread Thiago H. de Paula Figueiredo
On Thu, Jan 28, 2021 at 9:59 PM JumpStart <
geoff.callender.jumpst...@gmail.com> wrote:

> As requested, I’ve created a ticket for it. TAP5-2661 - Allow options to
> be passed to GoogleClosureMinimizer <
> https://issues.apache.org/jira/browse/TAP5-2661> .
>

Ben implemented it and Tapestry 5.6.2, with that and some other stuff, is
up to voting in the Dev mailing list now. 5.7.0 too.


>
> Thanks for the responses, lads.
>
> > On 28 Jan 2021, at 9:32 pm, Ben Weidig  wrote:
> >
> > Hi,
> >
> > the GoogleClosureMinimizer and its non-configurability is on my personal
> > "things to look at" list for quite some time.
> > We ran into issues in the past, and it popped up on the mailing list last
> > year a few times IIRC.
> >
> > So far, you need either to set
> > TapestryConstants.DISABLE_JAVASCRIPT_MINIMIZATION in an appropriate place
> > like a RequestFilter, or disable minimization altogether.
> >
> > My initial thought is a CompilerOptionsFactory/Provider with a default
> > implementation.
> >
> > I didn't find any information if the options are thread-safe and could be
> > reused, so contributing it as a symbol (as an alternative to a factory)
> > might not be feasible.
> >
> > If I find some time this weekend I try to (finally) take a deeper look at
> > it.
> >
> > Cheers,
> > Ben
> >
> > On Thu, Jan 28, 2021 at 1:16 PM Thiago H. de Paula Figueiredo <
> > thiag...@gmail.com> wrote:
> >
> >> Hello, Geoff!
> >>
> >> Looking at GoogleClosureMinimizer, I cannot see how the options can be
> >> customized. Could you please create a Jira issue so we can fix this in
> >> 5.7.0? Thanks in advance.
> >>
> >> Cheers!
> >>
> >> On Thu, Jan 28, 2021 at 6:31 AM JumpStart <
> >> geoff.callender.jumpst...@gmail.com> wrote:
> >>
> >>> Can I pass options to GoogleClosureMinimizer at runtime?
> >>>
> >>> I have a 3rd party javascript file (html2canvas.min.js) that
> >>> tapestry-webresources is failing to parse because the JS is using
> >>> javascript getters, which I think were introduced in ECMASCRIPT5.
> >>>
> >>> 2021-01-28 04:31:40,536 ERROR [org.apache.tapestry5.ioc.Registry]
> >> (default
> >>> task-14) Compilation failed: JSC_PARSE_ERROR. Parse error. getters are
> >> not
> >>> supported in older versions of JavaScript. If you are targeting newer
> >>> versions of JavaScript, set the appropriate language_in option. at
> >>> StreamableResource >>> classpath:META-INF/modules/html2canvas.min.js COMPRESSABLE
> lastModified:
> >>> Thu Jan 28 03:44:05 UTC 2021 size: 165202> line 20 : 0.
> >>>
> >>> As I am targeting only modern versions of Chrome and Safari, it seems
> >> that
> >>> I could fix this by passing option —language_in=ECMASCRIPT5 to
> >>> google-closure-compiler, but how can I do this? Is there a system
> >> property
> >>> I can provide at runtime?
> >>>
> >>> In case it helps, here’s the stack trace...
> >>>
> >>> 2021-01-28 04:31:40,536 ERROR [org.apache.tapestry5.ioc.Registry]
> >> (default
> >>> task-14) Compilation failed: JSC_PARSE_ERROR. Parse error. getters are
> >> not
> >>> supported in older versions of JavaScript. If you are targeting newer
> >>> versions of JavaScript, set the appropriate language_in option. at
> >>> StreamableResource >>> classpath:META-INF/modules/html2canvas.min.js COMPRESSABLE
> lastModified:
> >>> Thu Jan 28 03:44:05 UTC 2021 size: 165202> line 20 : 0.
> >>> 2021-01-28 04:31:40,537 ERROR [org.apache.tapestry5.ioc.Registry]
> >> (default
> >>> task-14) Operations trace:
> >>> 2021-01-28 04:31:40,537 ERROR [org.apache.tapestry5.ioc.Registry]
> >> (default
> >>> task-14) [ 1] Streaming compressed module html2canvas.min
> >>> 2021-01-28 04:31:40,537 ERROR [org.apache.tapestry5.ioc.Registry]
> >> (default
> >>> task-14) [ 2] Streaming classpath:META-INF/modules/html2canvas.min.js
> >>> (compressed)
> >>> 2021-01-28 04:31:40,537 ERROR [org.apache.tapestry5.ioc.Registry]
> >> (default
> >>> task-14) [ 3] Minimizing StreamableResource >>> classpath:META-INF/modules/html2canvas.min.js COMPRESSABLE
> lastModified:
> >>> Thu Jan 28 03:44:05 UTC 2021 size: 165202>
> >>> 2021-01-28 04:3

Re: Ecmascript5 and tapestry-webresources

2021-01-28 Thread Thiago H. de Paula Figueiredo
Hello, Geoff!

Looking at GoogleClosureMinimizer, I cannot see how the options can be
customized. Could you please create a Jira issue so we can fix this in
5.7.0? Thanks in advance.

Cheers!

On Thu, Jan 28, 2021 at 6:31 AM JumpStart <
geoff.callender.jumpst...@gmail.com> wrote:

> Can I pass options to GoogleClosureMinimizer at runtime?
>
> I have a 3rd party javascript file (html2canvas.min.js) that
> tapestry-webresources is failing to parse because the JS is using
> javascript getters, which I think were introduced in ECMASCRIPT5.
>
> 2021-01-28 04:31:40,536 ERROR [org.apache.tapestry5.ioc.Registry] (default
> task-14) Compilation failed: JSC_PARSE_ERROR. Parse error. getters are not
> supported in older versions of JavaScript. If you are targeting newer
> versions of JavaScript, set the appropriate language_in option. at
> StreamableResource classpath:META-INF/modules/html2canvas.min.js COMPRESSABLE lastModified:
> Thu Jan 28 03:44:05 UTC 2021 size: 165202> line 20 : 0.
>
> As I am targeting only modern versions of Chrome and Safari, it seems that
> I could fix this by passing option —language_in=ECMASCRIPT5 to
> google-closure-compiler, but how can I do this? Is there a system property
> I can provide at runtime?
>
> In case it helps, here’s the stack trace...
>
> 2021-01-28 04:31:40,536 ERROR [org.apache.tapestry5.ioc.Registry] (default
> task-14) Compilation failed: JSC_PARSE_ERROR. Parse error. getters are not
> supported in older versions of JavaScript. If you are targeting newer
> versions of JavaScript, set the appropriate language_in option. at
> StreamableResource classpath:META-INF/modules/html2canvas.min.js COMPRESSABLE lastModified:
> Thu Jan 28 03:44:05 UTC 2021 size: 165202> line 20 : 0.
> 2021-01-28 04:31:40,537 ERROR [org.apache.tapestry5.ioc.Registry] (default
> task-14) Operations trace:
> 2021-01-28 04:31:40,537 ERROR [org.apache.tapestry5.ioc.Registry] (default
> task-14) [ 1] Streaming compressed module html2canvas.min
> 2021-01-28 04:31:40,537 ERROR [org.apache.tapestry5.ioc.Registry] (default
> task-14) [ 2] Streaming classpath:META-INF/modules/html2canvas.min.js
> (compressed)
> 2021-01-28 04:31:40,537 ERROR [org.apache.tapestry5.ioc.Registry] (default
> task-14) [ 3] Minimizing StreamableResource classpath:META-INF/modules/html2canvas.min.js COMPRESSABLE lastModified:
> Thu Jan 28 03:44:05 UTC 2021 size: 165202>
> 2021-01-28 04:31:40,544 ERROR
> [org.apache.tapestry5.modules.TapestryModule.RequestExceptionHandler]
> (default task-14) Processing of request failed with uncaught exception:
> org.apache.tapestry5.ioc.internal.OperationException: Compilation failed:
> JSC_PARS
> E_ERROR. Parse error. getters are not supported in older versions of
> JavaScript. If you are targeting newer versions of JavaScript, set the
> appropriate language_in option. at StreamableResource classpath:META-INF/modules/html2canvas.min.j
> s COMPRESSABLE lastModified: Thu Jan 28 03:44:05 UTC 2021 size: 165202>
> line 20 : 0.: org.apache.tapestry5.ioc.internal.OperationException:
> Compilation failed: JSC_PARSE_ERROR. Parse error. getters are not supported
> in older versions of JavaScript. If yo
> u are targeting newer versions of JavaScript, set the appropriate
> language_in option. at StreamableResource classpath:META-INF/modules/html2canvas.min.js COMPRESSABLE lastModified:
> Thu Jan 28 03:44:05 UTC 2021 size: 165202> line 20 : 0.
> …
> Caused by: java.lang.RuntimeException: Compilation failed:
> JSC_PARSE_ERROR. Parse error. getters are not supported in older versions
> of JavaScript. If you are targeting newer versions of JavaScript, set the
> appropriate language_in option. at StreamableResource classpath:META-INF/modules/html2canvas.min.js COMPRESSABLE lastModified:
> Thu Jan 28 03:44:05 UTC 2021 size: 165202> line 20 : 0.
> at
> org.apache.tapestry5.internal.webresources.GoogleClosureMinimizer.doMinimize(GoogleClosureMinimizer.java:97)
> at
> org.apache.tapestry5.internal.webresources.AbstractMinimizer$1.perform(AbstractMinimizer.java:72)
> at
> org.apache.tapestry5.internal.webresources.AbstractMinimizer$1.perform(AbstractMinimizer.java:68)
> at
> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.perform(OperationTrackerImpl.java:110)
> ... 101 more
>
> Cheers,
>
> Geoff



-- 
Thiago


CVE-2020-17531: Deserialization flaw in EOL Tapestry 4.

2020-12-08 Thread Thiago H. de Paula Figueiredo
Description:

A Java Serialization vulnerability was found in Apache Tapestry 4.
Apache Tapestry 4 will attempt to deserialize the "sp" parameter even
before invoking the page's validate method, leading to deserialization
without authentication.

Apache Tapestry 4 reached end of life in 2008 and no update to address
this issue will be released.  Apache Tapestry 5 versions are not
vulnerable to this issue.  Users of Apache Tapestry 4 should upgrade
to the latest Apache Tapestry 5 version.

Credit:

Apache Tapestry would like to thank Adrian Bravo (@adrianbravon) for
reporting this issue.


Re: Fw: Communication between Tapestry and Angular(inside of an iframe)

2020-10-21 Thread Thiago H. de Paula Figueiredo
On Fri, Oct 9, 2020 at 7:55 AM Dmitry Gusev  wrote:

> Hi Hristo,
>

Hello, everyone!


> > How could I possibly make an event listener inside Java?
>

Both options provided by Dmitry are good, but I'd prefer the Tapestry-only
(i.e. not REST framework needed) one.

If you're using Tapestry 5.4.2 or later, you don't even need to create and
pass the event URL to JavaScript. Check the documentation at
https://tapestry.apache.org/ajax-and-zones.html#AjaxandZones-Invokingserver-sideeventhandlermethodsfromJavaScript.
If you're not using zones,  dom.getEventUrl(eventName, null)  will give you
the URL for an event name in the page class.

>
> What events should the listener listen to, is it a client-side or
> server-side event?
>
> To call Java methods from JS you usually build an API endpoint, i.e. with
> Resteasy or GraphQL.
> I presume you'll need access to the Tapestry context, you can use on of the
> ready-to-use integrations,
> e.g. http://www.tynamo.org/tapestry-resteasy+guide/
>
> Alternatively, if you need to call a Tapestry page/component and
> potentially render some markup in response
> you can generate an event link from the page/component and pass it to JS
> via the initialiser, for example, in your page/component class:
>
> @Inject ComponentResources componentResources;
>
> public void afterRender()
> {
> JSONObject json = new JSONObject()
>
> .put("myEventURL",
> componentResources.createEventLink("myEvent").toRedirectURI());
>
> // this will invoke a client-side function with arguments
>
> javaScriptSupport.require("myJSModule").invoke("myInit").with(json);
> }
>
> @OnEvent("myEvent")
> public void onMyEvent() {
> // TODO Handle event on the server-side
> }
>
> and then create META-INF/modules/myJSModule.js and put the following code
> to receive the call on client-side:
>
> (function () {
>
> // you can define module dependencies if you need them
> define(["t5/core/ajax"], function (ajax) {
>
> function init(spec) {
> // read argument here, and when needed use the URL to call it
> with `ajax`
> alert(spec.myEventURL);
> }
>
> return {
> init: init
> };
> });
> })();
>
>
>
>
> On Fri, Oct 9, 2020 at 8:51 AM Hristo Stoyanov
> 
> wrote:
>
> > Hello everyone!
> >
> > I have been brought onboard to an Tapestry project(never heard of it
> > before) and I would like to create a 'communication channel' between the
> > tapestry and an iframe(displaying Angular application).
> >
> > Both projects are on the same domain and the Angular app inside the
> iframe
> > works as expected, but I would like to send data to the Angular project
> and
> > vice versa.
> >
> > I found out that you can communicate between parent window and iframe by
> > using cross-document messaging (
> > https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage)
> >
> > My question is:
> > How could I possibly make an event listener inside Java? The javascript
> > for doing so should look something like this
> > "window.document.addEventListener("myEvent", 'JS function to handle',
> > false);"
> > And also how to actually call a method inside Java from the JavaScript
> > code.
> >
> > I asked here and there and nobody was able to help me with that so far...
> > I will be very thankful if you can help me with that.
> >
> > There is a small image that can helpfully help you understand my idea:
> > [image: Inline image]
> >
> > Thank you in advance!
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
>
>
>
> --
> Dmitry Gusev
>
> AnjLab Team
> http://anjlab.com
>


-- 
Thiago


Re: How to Show a Div using Javascript

2020-10-08 Thread Thiago H. de Paula Figueiredo
On Mon, Oct 5, 2020 at 9:28 AM marwa hussein 
wrote:

> On Mon, Oct 5, 2020, 2:22 PM Thiago H. de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > On Sun, Oct 4, 2020 at 8:37 AM marwa hussein 
> > wrote:
> >
> > > Hi Thiago,
> > >
> >
> > Hello!
> >
> >
> > > Thanks a lot for your reply it works fine but the problem is using this
> > > line of code in beginRender() function shows the "div" when the page is
> > > loaded. but What I want is to show the div after a button is pressed.
> > >
> >
> > In this case, just write the same JavaScript you'd do as if you weren't
> > using Tapestry.
> >
>
>  Do you mean to write a JS function and call it from the onSubmit()
> function and not to use JavaScript support?.
>

No. Write it in a .js file you include in the page. That's what I meant by
writing the same JS as if you weren't using Tapestry.

-- 
Thiago


Re: How to Show a Div using Javascript

2020-10-05 Thread Thiago H. de Paula Figueiredo
On Sun, Oct 4, 2020 at 8:37 AM marwa hussein 
wrote:

> Hi Thiago,
>

Hello!


> Thanks a lot for your reply it works fine but the problem is using this
> line of code in beginRender() function shows the "div" when the page is
> loaded. but What I want is to show the div after a button is pressed.
>

In this case, just write the same JavaScript you'd do as if you weren't
using Tapestry.


> When I used this line of code in the onSubmit() button function it gives
> me  "No object of type
> org.apache.tapestry5.services.javascript.JavaScriptSupport is available
> from the Environment" exception!!
>

JavaScriptSupport is only available when the component is being rendered.
Form submission is not done during rendering, so you get this exception.

-- 
Thiago


Re: Tapestry 5.5 beta and Java Modularity

2020-10-03 Thread Thiago H. de Paula Figueiredo
Hello, Charles!

TAP5-2641 is taking care of fixing the split packages problem, plus setting
automatic module names for all the Tapestry JARs ("org.apache.tapestry" +
project name, except for tapestry5-annotations, which will be
org.apache.tapestry-annotations'). Lots of classes needed to be moved
around, but I'll try to provide a tool to rewrite imports to alleviate the
problem.

On Fri, Nov 8, 2019 at 7:03 PM Charles Roth  wrote:

> Thanks for announcing the Tapestry 5.5 beta, with Java 9+ support.
> We're experimenting with it now under Java 11 (since only 8 and 11 have
> long-term-support).
>
> We're finding that we must use java modules (module-info.java) in order
> to compile, due to issues with the java.xml packages that we use.  (Long
> story.)
>
> Has anyone done this (i.e., use java modules) successfully with Tapestry
> 5.5?  I keep getting errors like:
>
> error: the unnamed module reads package
> org.apache.tapestry5.internal.beaneditor from both tapestry.core and
> beanmodel
>
> ...which suggests that the Tapestry jars may have 'split packages', i.e.
> the same package name in different jars.
>
> We're still learning the ins-and-outs of Java Modularity, so it may
> simply be my confusion.  But any thoughts are most welcome!
>
> One possible (crude) workaround may be to merge the tapestry jars into a
> new (single) jar, and treat that as a single "automatic module".  I'll
> try that if nothing else works, and report back.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-- 
Thiago


Re: Open Discussion: remove Bootstrap from T5 core

2020-10-03 Thread Thiago H. de Paula Figueiredo
Hello, everyone!

I know this thread is a bit old already, but Tapestry 5.5.0 can be used
without Bootstrap at all: https://tapestry.apache.org/release-notes-550.html
, https://tapestry.apache.org/css.html, @ImportModule(NoBootstrapModule.class).
In addition, there's a number of configuration symbols controlling which
CSS classes are output by the components which use Bootstrap ones by
default but can be overriden. If there's some CSS class still hardcoded,
please let us know.

On Thu, Feb 14, 2019 at 7:14 AM Jens Breitenstein 
wrote:

> Hi Tapestry guys!
>
> I want to hear/read your opinion about getting rid of the Bootstrap
> Library from T5 core.
> I would like to move all BS related code (css/js) to a seperate module
> like "tapestry-bootstrap3" and decouple the hardcoded BS from T5.
> Furthermore I would like to see a second module "tapestry-bootstrap4"
> which uses BS4.
>
>  From the sources I see direct dependencies are less than expected. Some
> tml's use it (I just ignore the internal T5 pages for now):
>
>  AjaxFormLoop.tml
>  class="btn btn-default btn-sm"
>  
>
>  BeanEditForm.tml
>  class="btn-toolbar"
>  class="btn-group"
>  class="btn btn-primary"
>
>  DevTool.tml
>  
>  class="dropdown-menu"
>  class="dropdown-header"
>
>  ExceptionDisplay.tml
>  class="well"
>  class="pull-right"
>  class="checkbox"// ?
>
>  Palette.tml
>  class="btn-group-vertical"
>
> and some JAVA references like:
>
>  JavaScriptModule.java
>  configuration.add("bootstrap/ ...")
>
>  bundledModules=...
>
>
> Do you think it's worths looking into it, digging deeper?
> Any pitfalls I should consider?
> Anyone interested to discuss it?
>
>
> Jens
>
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-- 
Thiago


Re: How to Show a Div using Javascript

2020-10-03 Thread Thiago H. de Paula Figueiredo
Hello!

@Inject private JavaScriptSuport javaScriptSupport;

void beginRender() {

javaScriptSupport.addScript("document.getElementById("div1").style.display
= '';");
}

On Sat, Oct 3, 2020 at 10:06 AM marwa hussein 
wrote:

> Hello all,
> I am new to Tapestry and to Web development in general but I have to
> implement a simple web application for my research.
>
> I use a div that when loading the page I need to hide it, so I use this
> line:
>  
> The div contains "inside it" a grid that will contain some elements after a
> "load" button is pressed.
> how can I unhide the div again "after pressing the load button"?
>
> I know that I could do this with JS Line of code like:
>  document.getElementById("div1").style.display ="";
> But how and where can I add a javascrpt line of code directly in my Java
> class?
>
> Thansk in advance
>
> --
>
>
>
> *Marwa Hussein M. TA @ Information Systems Department Faculty of Computers
> & Information Assuit University*
> 
>


-- 
Thiago


[CVE-2020-13953] Apache Tapestry WEB-INF file download vulnerability

2020-09-26 Thread Thiago H. de Paula Figueiredo
CVE-2020-13953: Apache Tapestry: URL manipulation allows Java webapp files
inside WEB-INF to be listed and downloaded.

Vendor:
The Apache Software Foundation

Versions Affected:
Tapestry 5.4.0 to 5.5.0

Description:
Crafting specific URLs, an attacker can download files inside the WEB-INF
folder.

Mitigation:
Upgrade to Apache Tapestry 5.6.0 or later.

Credit:
This issue was discovered by Thomas Moore.

References:
https://tapestry.apache.org/security.html

-- 
Thiago


Re: Tapestry services lifecycle

2020-09-19 Thread Thiago H. de Paula Figueiredo
On Tue, Sep 15, 2020 at 7:50 PM Christopher Dodunski (Tapestry) <
chrisfromtapes...@christopher.net.nz> wrote:

> Hi all, just a quick question...
>

Hello!


> Once a Tapestry service implementation gets instantiated, and that
> service's status moves to "realised", at what point does that
> implementation get destroyed?
>

Only when Tapestry-IoC's Registry instance gets shutdown (i..e. by calling
its shutdown() method), since it keeps references to all service instances.


> Tapestry instantiates a service implementation the first time a service
> method gets called, and I'm just wondering whether the reverse is also
> true - eg. released for garbage collection if no method has been called
> after a period of time.
>

Tapestry-IoC doesn't track whether a service hasn't been called after a
period of time.


>
> In some cases it's needed for a service to retain state, such as keeping
> a 'static final' map of connected users.  This is thread safe, but would
> be lost without a single service implementation instance.
>
> Regards,
>
> Chris.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-- 
Thiago


[ANNOUNCEMENT] Apache Tapestry 5.6.1 released

2020-09-19 Thread Thiago H. de Paula Figueiredo
Hello!

Tapestry 5.6.1 has been released. Only change is fixing that issue that
caused asset requests to fail when your classpath doesn't have commons-lang.

-- 
Thiago


Re: no CSS since 5.6.0

2020-09-19 Thread Thiago H. de Paula Figueiredo
Hello, Marcel!

Tapestry 5.6.1 has been released and it fixes this issue without you having
to add commons-lang yourself.

On Fri, Sep 4, 2020 at 4:21 PM Marcel Schepers 
wrote:

>
> > This seems to be a dependency problem. What dependency management tool
> > you use? Until we have a proper fix for that in Tapestry itself, you
> > can add a dependency to org.apache.commons/commons-lang 3:3.4 to your
> > project.
> Maven 3 is what I am using.
>
> Adding the commons-lang 3.4 dependency resolved the problem.
>


-- 
Thiago


Re: Re: Spring Security Integration

2020-09-11 Thread Thiago H. de Paula Figueiredo
On Fri, Sep 11, 2020 at 4:48 AM Reinhold Gruber  wrote:

> Hi!
>

Hello!


> Yes, I looked into the quickstart archetype and Apache Shiro.
>
> One requirement of the project is to delegate Authentication/Authorization
> to an WSO2 Identity Server with the help of OpenId Connect.
> This can be done quite easily in Spring Boot + Security.
> I did not find this kind of integration in Shiro.
>

I'm definitely not an expert in that field so I'm afraid I cannot help you
further here.

Have you checked the Tapestry-Spring integration?
https://tapestry.apache.org/integrating-with-spring-framework.html


>
> Regards
> Reinhold
>
>
>
>
> Gesendet: Freitag, 11. September 2020 um 01:11 Uhr
> Von: "Thiago H. de Paula Figueiredo" 
> An: "Tapestry users" 
> Betreff: Re: Spring Security Integration
> On Thu, Sep 10, 2020 at 5:50 PM Reinhold Gruber  wrote:
>
> > Hi!
> >
>
> Hi!
>
> I have a hard time trying to integrate Tapesty within a Spring Boot
> > Application secured by Spring Security.
> > Did anyone have success in this area and wants to share his experience
> and
> > knowhow. I thought that it would be enough to simply append the
> > TapestryFilter after the Spring FilterChain but apparently it is not.
> >
>
> Have you tried creating a Tapestry project using the archetype
> (quickstart)? It's documented here:
> https://tapestry.apache.org/getting-started.html. It does create a project
> using Spring Boot.
>
> I know you're looking for Spring Security, but I'd like to mention anyway
> that Tapestry has a very good integration with Apache Shiro (another
> security framework) written by a committer of both Tapestry and Shiro:
>
> http://www.tynamo.org/tapestry-security+guide/[http://www.tynamo.org/tapestry-security+guide/]
> <http://www.tynamo.org/tapestry-security+guide/%5Bhttp://www.tynamo.org/tapestry-security+guide/%5D>
>
>
> >
> > Best Regards
> > Reinhold
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>
> --
> Thiago
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-- 
Thiago


Re: Spring Security Integration

2020-09-10 Thread Thiago H. de Paula Figueiredo
On Thu, Sep 10, 2020 at 5:50 PM Reinhold Gruber  wrote:

> Hi!
>

Hi!

I have a hard time trying to integrate Tapesty within a Spring Boot
> Application secured by Spring Security.
> Did anyone have success in this area and wants to share his experience and
> knowhow. I thought that it would be enough to simply append the
> TapestryFilter after the Spring FilterChain but apparently it is not.
>

Have you tried creating a Tapestry project using the archetype
(quickstart)? It's documented here:
https://tapestry.apache.org/getting-started.html. It does create a project
using Spring Boot.

I know you're looking for Spring Security, but I'd like to mention anyway
that Tapestry has a very good integration with Apache Shiro (another
security framework) written by a committer of both Tapestry and Shiro:
http://www.tynamo.org/tapestry-security+guide/


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

-- 
Thiago


Re: no CSS since 5.6.0

2020-09-03 Thread Thiago H. de Paula Figueiredo
On Thu, Sep 3, 2020 at 7:32 AM Marcel Schepers 
wrote:

> Hello,
>

Hello!

Please try running your site in production with
tapestry.production-mode=off to see whether the full stack trace is shown.

Attachments are discarded by the ASF mailing list server, so we cannot see
your screenshot.


>
> I am running into a problem eversince I switched to Tapestry 5.6.0.
>
> When I deploy my web application on a standalone Jetty web server the
> site's CSS file generates an exception. I've included a screen dump of
> that exception.  This exception only occurs on my server machine running
> Jetty version 9.4.31. It does not happen on my development machine when
> I am using the Jetty maven plugin version 9.4.31. Both my development
> machine and my server are fine when using Tapestry 5.5.0.
>
> I've modified the server's Jetty logging to include all org.apache
> related messages by setting the 'org.apache.LEVEL=ALL' in
> jetty-logging.properties, but unfortunately nothing related to this
> exception shows up.
>
> Another check I did was to run 'mvn dependency:tree -Dverbose
> -Dincludes=commons-lang ', but it did not provide any output. (I am not
> including the tapestry-javadoc dependency)
>
> Perhaps related, if I include the 'tapestry-webresources' dependency I
> get a 'java.lang.NoClassDefFoundError: Could not initialize class
> com.google.javascript.jscomp.CompilerOptions' error.
>
> Any suggestions where to look?
>
> Thanks!
>
> Marcel
>
> PS the problem is reproducable by visiting marcelhendinant.com. The site
> pops up without any CSS applied. Loading the corresponding CSS file
> using 'http://marcelhendinant.com/assets/ctx/z8e391fe2/css/site.css' the
> error page shows up.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org



-- 
Thiago


[ANNOUNCEMENT] Tapestry 5.6.0 release

2020-09-01 Thread Thiago H. de Paula Figueiredo
Hello, Tapestry community!

5.6.0 has just been released. Highlights are support for Java 14 bytecode
and better accessibility in forms with automatic generation of WAI-ARIA
attributes, All the details are described here:
https://tapestry.apache.org/release-notes-560.html.

I highly recommend every project using Tapestry 5.4.0 or later to upgrade
to 5.6.0. No breaking changes were introduced and it should be just a
matter of changing the dependency version on your tool of choice (Maven,
Gradle, Ivy, etc).

Happy coding!

-- 
Thiago


Re: redirect after javascript ajax call

2020-08-28 Thread Thiago H. de Paula Figueiredo
On Fri, Aug 28, 2020 at 2:39 PM Marcel Schepers 
wrote:

> Hello,
>

Hello!


> I am having a bit of a hard time to figure out what the best Tapestry
> way is to do the following. My application's main index page should
> forward the user to another page. I am able to do so by implementing the
> onActivate method and let it return the class of the page to go to. So
> far so good.
>
> What I would like to do now is to run a client-side script that sends
> some screen dimensions to the server _before_ the new page renders its
> response.
>
> A somewhat visual representation of the problem looks like:
> request -> index page -> javascript with a server call -> new page.
>
> Is there an easy way to get this done in Tapestry?
>

Check this and let us know whether it's what you need:
https://tapestry.apache.org/ajax-and-zones.html#AjaxandZones-Invokingserver-sideeventhandlermethodsfromJavaScript



>
> Many thanks in advance!
>
> Best,
> Marcel
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-- 
Thiago


Re: Making certain BeanEditForm fields 'read only'

2020-08-26 Thread Thiago H. de Paula Figueiredo
On Wed, Aug 26, 2020 at 7:27 AM Christopher Dodunski (Tapestry) <
chrisfromtapes...@christopher.net.nz> wrote:

> Thanks Thiago.
>

My pleasure to help!


> I guess it's something worth considering in the future - updating
> BeanEditor and related components to better leverage HTML5 features.
>

Which ones, specifically? And Tapestry form field components do handle
disabled="true" correctly as far as I remember, completely ignoring
disabled components when processing the form submission, so I don't think
your workaround described below is needed.

What HTML5 features do you mean?


>
> A workaround in my case was to have SelectModelFactory reduce the number
> of selectable elements down to one, making selecting something different
> impossible.  The fields of interest are synthetic properties added to
> the BeanModel, so this workaround was possible.
>
> Regards,
>
> Chris Dodunski.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-- 
Thiago


Re: Making certain BeanEditForm fields 'read only'

2020-08-25 Thread Thiago H. de Paula Figueiredo
Hello!

I don't think there's a way of doing that that doesn't require changing
BeanEditor (which does the heavy lifting for BeanEditForm) and one at least
one of PropertyModel and PropertyConduit.



On Tue, Aug 18, 2020 at 6:19 AM Christopher Dodunski (Tapestry) <
chrisfromtapes...@christopher.net.nz> wrote:

> Hi all,
>
> I'm just wondering whether there is a simple and elegant way of making
> certain BeanEditForm fields 'read only' within the controller class,
> rather than in the view template?  In certain circumstances I wish to
> dynamically prevent users from modifying certain fields (a pretty common
> scenario).
>
> It would be nice to inject a field component in the controller, and
> simply invoke setReadOnly() to have it display its value within the
> BeanEditForm, but grayed out and unable to be altered.  These fields are
> all 'Select' type in my case.
>
> The Select component has a 'disabled' parameter, but I suspect a
> disabled field would behave quite differently—possibly not even
> displaying its value.
>
> Below is an example field taken from the template.
>
>  
>  
>  
>   t:value="vesselSelected" t:model="vesselSelectModel"
> t:label="message:label.vessel"/>
>  
>  
>
> Regards,
>
> Chris.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-- 
Thiago


Re: Deadlock in IOC (ConcurrentBarrier vs JustInTimeObjectCreator)

2020-08-17 Thread Thiago H. de Paula Figueiredo
On Mon, Aug 17, 2020 at 6:42 AM Oliver Kaiser 
wrote:

> sure; that seems to fix it
>

Thank *you* for doing almost the whole work here: spotting the issue,
creating a test case, suggesting the fix (which was exactly what you
suggested) then confirming it. :)


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

-- 
Thiago


  1   2   3   4   5   6   7   8   9   10   >