Re: [Informal poll] Version number for Jakarta EE-supporting Tapestry version

2024-08-07 Thread Dmitry Gusev
Hi Thiago,

Just a thought, but did you consider to have a `jakarta` word somewhere in
the artifact coordinates?

Either in the artifact names or as a classifier in the versions. This way
we could still have release numbers continue naturally and let the users
pick the flavor. We can eventually stop producing non-jakarta flavors when
time comes, if ever, or do javax/jakarta-only fixes if necessary skipping
the flavors where it would make sense.

Having holes (regardless how big or small they are) in version numbers will
break semver and tooling that rely on its conventions potentially.


Regards,
Dmitry


On Wednesday, July 31, 2024, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> Hello, Tapestry community!
>
> As already discussed, the Jakarta EE an javax.servlet versions of the
> Servlet API have some differences that go beyond the package rename, but,
> at the same time, the Tapestry team won't leave the javax.servlet users
> behind. We'll have 2 different branches, master on Jakarta EE) and javax,
> and we'll keep them in feature parity as much as possible (of course,
> Jakarta EE is the living API, while javax.servlet is dead, so any future
> Tapestry feature that depends on something Jakarta EE has but javax.servlet
> doesn't won't be backported to the javax branch).
>
> With the approach decided, we arrive at a problem similar to what same say
> is the most difficult one in software development: naming things. Current
> Tapestry is at version 5.8.6. What should be the version number for the
> upcoming Jakarta EE-supporting version? I'd like to remind everyone that
> the project itself is Tapestry 5, given it's a complete rewrite that shares
> no code with Tapestry 4 and other previous versions, so, for example,
> version 5.8.6 should actually be considered version 8.6 of Tapestry 5.
>
>  The Tapestry team has come up with some suggestions:
>
> * 5.50: Pros: 50 is a round number, half of 100, a lot larger than 8, so we
> have a lot of room for new Tapestry major releases of the javax branch to
> be 5.9.x, 5.10.x, etc. Con: no easy association between javax and Jakarta
> version.
>
> * 5.19: Pros: 9 is the Jakarta EE version containing the Servlet API
> version with the jakarta.servlet package used by Tapestry in the branch
> that supports it. While it doesn't leave as much room for new major
> releases of the javax branch, it does leave a good number. Con: no easy
> association between javax and Jakarta version.
>
> * 5.18: Pro: easy association between versions of javax and Jakarta
> branches, which would be kept in a constant version difference. We could
> even have the first Jakarta release to be 5.18.7 while the javax release
> would be 5.8.7 (we're planning to release it in the upcoming weeks). Con:
> less room for major releases.
>
> * 5.28: Mostly same as above, but with larger room for major releases.
>
> * 5.9: Pro: matches the Jakarta EE version. Cons: no room for major
> releases at all. (Me, Thiago, really dislike this idea, but another
> committer suggested it and really loves it, so here it is, hehehe).
>
> * Something else you suggest (with rationale, please).
>
> There's no perfect solution. All of them come with a bit of confusion. I
> personally would go with either 5.18 or 5.28 and have the first release
> being 5.18.7 or 5.28.7 to align with the upcoming 5.8.7 release.
>
> I'm looking forward to your feedback.
>
> Cheers!
>
> --
> Thiago H. de Paula Figueiredo
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Updating specific zone instances in a loop.

2023-01-03 Thread Dmitry Gusev
Hi Geoff,

You can pass an instance of the RenderCommand that could capture the
context, hopefully this snippet can give a hint.

Regards,
Dmitry

for (int i = 0; i < emailIds.length; i++)
{
String emailId = emailIds[i];
boolean display = displayStatusArray[i];

// Set tempId for getEmailStatusZoneId()
tempId = emailId;

// There may be multiple instances of this component being
refreshed at the same time,
// so we need to render it immediately
ajaxResponseRenderer.addRender(getEmailStatusZoneId(),
(RenderCommand) (writer, queue) -> {
// Initialise before rendering
EmailDeliveryStatus.this.tempId = emailId;
EmailDeliveryStatus.this.show = display;
setupEmail();

((RenderCommand) emailStatusZone.getBody()).render(writer, queue);

initJavaScript();
});
}



On Tue, Jan 3, 2023 at 2:47 PM JumpStart <
geoff.callender.jumpst...@gmail.com> wrote:

> Hi all,
>
> Let’s say I have loop around a zone, and on a particular event I want to
> render just the 2nd and 4th instances of the zone. How do I do that?
>
> 
>
>  }
>
> My problem is that the following does not correctly render thing 2 and 4.
>
> public String onMyEvent() {
>
> thing = getThing(2);
> zoneIndex = 2;
> ajaxResponseRenderer.addRender(thingZone);
>
> thing = getThing(4);
> zoneIndex = 4;
> ajaxResponseRenderer.addRender(thingZone);
>
> thing = null;
>
> }
>
> As you can see below, the response includes the right zone names, but the
> rendered content of them is the same and is based on whatever the final
> values were. In this case the final value of thing was null, so white space
> was rendered into both zones.
>
> {
>   "_tapestry" : {
> "content" : [
>   [
> “thingZone_4",
> "\n\t\t\t\t\t\t\t\t\n\t\t\t\t"
>   ],
>   [
> “thingZone_2",
> "\n\t\t\t\t\t\t\t\t\n\t\t\t\t"
>   ]
> ],
> "inits" : [
>
> So addRender(ClientBodyElementZone zone) queues up the request for later.
> Can I somehow queue up each request with the current values that I want it
> to use when rendering?
>
> Cheers,
>
> Geoff



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: New update site for anjlab/eclipse-tapestry5-plugin

2022-03-04 Thread Dmitry Gusev
Hi,

Hosting on GitHub's raw repository worked, the new update site is here:

https://raw.githubusercontent.com/wiki/anjlab/eclipse-tapestry5-plugin/update-site

I've also released a change from an open PR, a fix for handling file
separators properly on Windows:

https://github.com/anjlab/eclipse-tapestry5-plugin/releases/tag/2.13.6

Regards,
Dmitry

On Wed, Mar 2, 2022 at 9:31 AM Ben Weidig  wrote:

> Thank you Dmitry!
>
> Maybe hosting it as a GitHub page would be an option?
>
>
> https://www.lorenzobettini.it/2021/03/publishing-an-eclipse-p2-composite-repository-on-github-pages/
>
> Or just as a raw repo?
>
>
> https://microeducate.tech/is-it-possible-to-host-an-eclipse-update-site-on-github/
>
> Or my company could host it, too.
>
> Cheers
> Ben
>
>
>
> On Wed, Mar 2, 2022 at 4:23 AM JumpStart <
> geoff.callender.jumpst...@gmail.com> wrote:
>
> > Magnificent, thank you.
> >
> > I will consider in the coming months whether I can host the update site.
> > Unfortunately, right now my team and I don't have the time to spend on
> it.
> >
> > > On 2 Mar 2022, at 10:55 am, Dmitry Gusev 
> wrote:
> > >
> > > Hi,
> > >
> > > Until we find a better way of hosting the update site we can use GitHub
> > > releases:
> > > https://github.com/anjlab/eclipse-tapestry5-plugin/releases
> > >
> > > I just published new version and updated installation instructions in
> > > README:
> > > https://github.com/anjlab/eclipse-tapestry5-plugin#install
> > >
> > > There's also a quick note on how to build the project locally should
> > > you need it:
> > > https://github.com/anjlab/eclipse-tapestry5-plugin#how-to-build
> > >
> > > Regards,
> > > Dmitry
> > >
> > > On Tue, Mar 1, 2022 at 10:38 AM Ben Weidig  wrote:
> > >
> > >> Hi Geoff,
> > >>
> > >> AFAIK there's no alternative since bintray was shutdown.
> > >> We've tried to get it up and running, but Eclipse Plugin stuff is
> > weird...
> > >>
> > >> In theory you can copy it directly into a dropins folder, or put in in
> > the
> > >> correct location.
> > >> But it hasn't worked for us reliably, or even at all, and most
> > >> documentation is outdated.
> > >>
> > >> Only thing that worked was setting up Plugin-Development in Eclipse
> and
> > >> running the plugin directly, because it gets installed that way. But I
> > >> can't remember how much work was needed to get it up and running.
> > >>
> > >> Maybe we give it another try and create a how-to guide.
> > >> Or even better, hosting it somewhere for easier usage.
> > >>
> > >> Cheers
> > >> Ben
> > >>
> > >>
> > >> On Tue, Mar 1, 2022 at 9:38 AM JumpStart <
> > >> geoff.callender.jumpst...@gmail.com> wrote:
> > >>
> > >>> Does anyone know whether there is a new update site for the Eclipse
> > >> plugin
> > >>> anjlab/eclipse-tapestry5-plugin ?
> > >>>
> > >>> With the original site we're getting:
> > >>>
> > >>> HTTP Server 'Bad Gateway' :
> > >>> https://dl.bintray.com/anjlab/eclipse-tapestry5-plugin/content.xml
> > >>> HttpComponents connection error response code 502.
> > >>>
> > >>> I really loved this plugin, so it’s a shame to see the good work go
> to
> > >>> waste.
> > >>>
> > >>> Cheers,
> > >>>
> > >>> Geoff
> > >>>
> > >>>
> > >>>
> > >>> -
> > >>> 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
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>
> --
>
> Netzgut GmbH
>
> Kirchstr. 18
> 69115 Heidelberg
>
> Telefon:
> +49 6221 39298 53
>
> Telefax:
> +49 6221 39298 59
>
> E-Mail:b...@netzgut.net
>
> Handelsregister: Amtsgericht Mannheim, HRB 709833
> Sitz der Gesellschaft: Heidelberg
> Geschäftsführer: Felix Gonschorek, Benjamin Weidig
> Ust-IdNr.: DE272871752
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: New update site for anjlab/eclipse-tapestry5-plugin

2022-03-01 Thread Dmitry Gusev
Hi,

Until we find a better way of hosting the update site we can use GitHub
releases:
https://github.com/anjlab/eclipse-tapestry5-plugin/releases

I just published new version and updated installation instructions in
README:
https://github.com/anjlab/eclipse-tapestry5-plugin#install

There's also a quick note on how to build the project locally should
you need it:
https://github.com/anjlab/eclipse-tapestry5-plugin#how-to-build

Regards,
Dmitry

On Tue, Mar 1, 2022 at 10:38 AM Ben Weidig  wrote:

> Hi Geoff,
>
> AFAIK there's no alternative since bintray was shutdown.
> We've tried to get it up and running, but Eclipse Plugin stuff is weird...
>
> In theory you can copy it directly into a dropins folder, or put in in the
> correct location.
> But it hasn't worked for us reliably, or even at all, and most
> documentation is outdated.
>
> Only thing that worked was setting up Plugin-Development in Eclipse and
> running the plugin directly, because it gets installed that way. But I
> can't remember how much work was needed to get it up and running.
>
> Maybe we give it another try and create a how-to guide.
> Or even better, hosting it somewhere for easier usage.
>
> Cheers
> Ben
>
>
> On Tue, Mar 1, 2022 at 9:38 AM JumpStart <
> geoff.callender.jumpst...@gmail.com> wrote:
>
> > Does anyone know whether there is a new update site for the Eclipse
> plugin
> > anjlab/eclipse-tapestry5-plugin ?
> >
> > With the original site we're getting:
> >
> > HTTP Server 'Bad Gateway' :
> > https://dl.bintray.com/anjlab/eclipse-tapestry5-plugin/content.xml
> > HttpComponents connection error response code 502.
> >
> > I really loved this plugin, so it’s a shame to see the good work go to
> > waste.
> >
> > Cheers,
> >
> > Geoff
> >
> >
> >
> > -
> > 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


Re: Ressource Minimization - Ahead of time

2021-12-23 Thread Dmitry Gusev
Hello,

Somehow the links above don't provide access to recent (December) replies
for that thread, here's continuation with actual shared code:

http://mail-archives.apache.org/mod_mbox/tapestry-users/202112.mbox/%3cCA+v6cT9aLp3EA0FwfZqa4W0nhMreH5rKQX5o7=_a_mzx+hn...@mail.gmail.com%3e

Regards,
Dmitry

On Thu, Dec 23, 2021 at 2:10 PM Ben Weidig  wrote:

> Hello Stefan,
>
> we had a thread recently about health checks and possible warmup techniques
> on the mailing list:
>
>
> http://mail-archives.apache.org/mod_mbox/tapestry-users/202111.mbox/%3c92ee40fb-cb4c-4a6d-8257-b8215a136...@gmail.com%3e
>
> Dmitry shared some awesome code to warmup without needing to call pages
> manually, see
>
> http://mail-archives.apache.org/mod_mbox/tapestry-users/202111.mbox/%3cCA+v6cT9C4XmkSmp=2nfs_vobw30qwgvzurbaprefwww_do6...@mail.gmail.com%3e
>
> Doing Resource-minification at build-/deploy-time is a whole other can of
> worms...
> The first thing that comes to mind is a Gradle task preparing the assets as
> needed and Tapestry to load them directly on startup and fill it caches.
> Both functionalities don't exist (yet).
>
> Hope this helps as a starting point.
>
> Cheers,
> Ben
>
>
> On Thu, Dec 23, 2021 at 2:43 PM Stefan Starke <
> stefan.sta...@cloudflight.io>
> wrote:
>
> > Hello,
> >
> > I am currently looking into the topic of minimizing resources like JS,
> CSS
> > ahead of time and not before they are requested for the first time.
> >
> > I already know that the resource minimizations are cached on a per-locale
> > base inside JavaScriptStackAssemblerImpl.
> >
> > Unfortunately I can not find a way on how to minimize all resources
> before
> > a user first requests them.
> >
> > My current approach would is to call a Tapestry page that loops over all
> > javascript resources and therefore triggers the minimization
> > Something like
> >
> > @Inject
> >
> > private JavaScriptStackSource javaScriptStackSource;
> >
> >
> > @Inject
> >
> > private JavaScriptStackPathConstructor javaScriptStackPathConstructor;
> >
> >
> > /*
> >
> *
> >
> > * Event Handlers
> >
> > */
> >
> >
> > public void minimizeJS()
> >
> > {
> >
> > for (String stackName : javaScriptStackSource.getStackNames())
> >
> > {
> >
> >
> >
> >
> javaScriptStackPathConstructor.constructPathsForJavaScriptStack(stackName);
> >
> > }
> >
> >
> > }
> >
> > But I do not really like this approach as it implies that somehow I have
> > to open this URL to make the minimization ahead of time - and even worse
> I
> > would need to do this on every machine in a clustered setup.
> >
> > So basically I am looking for a way to minimize the resources together
> > with starting the server or even at build time if possible.
> >
> > Thanks for hints and advices!
> > Stefan
> >
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Best practice for health check URL?

2021-12-06 Thread Dmitry Gusev
Hi Geoff,

I extracted all the important bits from our implementation into this gist:

https://gist.github.com/dmitrygusev/486ad56174450299b94cc364d3630b28

I'd start exploring it from here:

https://gist.github.com/dmitrygusev/486ad56174450299b94cc364d3630b28#file-eagerloadresourceimpl-java-L94

In the gist you'll find full implementation, but configuration will likely
be different depending on your project setup.

You can find some examples in `TapestryEagerLoadModule` for how you can
contribute variations to the warmup, e.g.:
  -- different locales, or other behaviours that can prepare a request
thread for serving custom responses
  -- an example of contributing warmup logic as one of the health checks to
the Dropwizard's healthcheck registry
  -- contributions to the `SkipEagerLoadForPatterns` to ignore certain
files from direct access during warmup
  -- etc.

Any questions or suggestions, please let me know.

Regards,
Dmitry



On Mon, Dec 6, 2021 at 4:24 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.
>
> 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.
>
> Dmitry, I have tried to flesh out what you’ve done, but I think my
> knowledge of Tapestry internals is holding me back. You seem to have taken
> a really deep dive! Is there any code that you’d feel comfortable sharing?
>
> Cheers,
>
> Geoff
>
> > On 4 Dec 2021, at 6:00 am, Thiago H. de Paula Figueiredo <
> thiag...@gmail.com> wrote:
> >
> > 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 r

Re: Best practice for health check URL?

2021-11-30 Thread Dmitry Gusev
Hi Geoff,

RESTEasy services are singletons, so we simply created an `AtomicReference`
field and used `compareAndSet()`,
something like this:

private final AtomicReference warmUpStatus = new
AtomicReference<>(WarmUpStatus.EMPTY);


@Override
public Response warmUp()
{
if (warmUpStatus.compareAndSet(WarmUpStatus.EMPTY,
WarmUpStatus.IN_PROGRESS))
{


Regards,
Dmitry

On Tue, Nov 30, 2021 at 1:41 AM JumpStart <
geoff.callender.jumpst...@gmail.com> wrote:

> Hi Dmitry,
>
> That is spectacularly helpful!
>
> We’re about to write a headless smoke test anyway that will visit every
> page. Do you see any downside to using that to do the warmup?
>
> Where do you keep your shared “warmup in progress” flag so that it is
> rapidly accessible on every health check request?
>
> Cheers,
>
> Geoff
>
> > On 30 Nov 2021, at 6:35 am, 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
> >>
> >>
>
>
> -
> 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


Re: Best practice for health check URL?

2021-11-29 Thread Dmitry Gusev
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
>
>


Re: Render a single Enum value

2021-08-27 Thread Dmitry Gusev
You could build a custom component, e.g.:

public class OutputEnum
{
@Inject
private Messages messages;

@Parameter(required = true)
private Enum value;

@BeginRender
void begin(MarkupWriter writer)
{
if (value == null)
{
return;
}

Element element = writer.element("span");

element.text(getLabelForEnum(messages, value));

writer.end(); // span
}
}


On Thu, Aug 26, 2021 at 3:31 AM 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
>
>

-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: AssetDispatcher Tapestry 5.3.8

2021-05-28 Thread Dmitry Gusev
Hi!

AssetDispatcher is a regular tapestry service, I'd expect that you can
replace it with your own implementation using service overrides:
https://tapestry.apache.org/ioc-cookbook-overriding-ioc-services.html

The service is bound with marker annotation and
AssetRequestDispatcher.class, with id=AssetDispatcher.

You can try the latest implementation from 5.6 branch, it should be
compatible with 5.3 I think:
https://github.com/apache/tapestry-5/blob/5.6.x/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetDispatcher.java

Hope this helps,
Dmitry

On Fri, May 28, 2021 at 1:41 PM Reinhold Gruber  wrote:

> Hi!
>
> 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?
>
> Best Regards,
> Reinhold
>
>
> -
> 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


Re: Question about JSONObject in versions 5.6.2, 5.6.3. and 5.6.4

2021-04-20 Thread Dmitry Gusev
Hi,

In addition to what Ben said, there's an open PR in tapestry-jquery that
fixes 5.6.2+ compatibility:

https://github.com/got5/tapestry5-jquery/pull/394

Not yet merged, but you may release from your own fork if it's really
necessary.

On Tue, Apr 20, 2021 at 7:07 AM Ben Weidig  wrote:

> Hi,
>
> it's a known problem with 5.6.2+ and JSONObject that came to light
> recently.
>
> An updated version of tapestry-json improvements were introduced with
> 5.7.0, but got backported to 5.6.2.
>
> JSONObject is now a full-fledged Map, which lead to a
> signature change being introduced. It slipped through into the backport,
> resulting in the NoSuchMethodError for any dependency being compiled with <
> 5.6.2.
>
> Due to the generic-nature of Map and Java's type erasure, the old methods
> can't be retro-fitted in an update.
>
> The are the possible workarounds I can think of:
>
> - Update the dependency to a newer version using 5.6.2+.
>
> - Shade the dependency and make the changes yourself
>
> - Stay on 5.6.1 until the dependency is updated
>
>
> I'm in the process of updating the documentation/release notes, so it's
> clearer what the problem is.
>
> Ben
>
> On Tue, Apr 20, 2021 at 12:30 AM Wilson Velez  >
> wrote:
>
> > There is a weird behavior with the tags 5.6.2, 5.6.3. and 5.6.4, I don't
> > know if this is expected.
> >
> > I'm having a problem trying to upgrade from 5.6.1. When I change the
> > version to 5.6.2, 5.6.3. or 5.6.4
> > the org.got5.tapestry5.jquery.utils.JQueryUtils#merge method throws the
> > exception:
> >
> > java.lang.NoSuchMethodError
> >
> >
> org.apache.tapestry5.json.JSONObject.get(Ljava/lang/String;)Ljava/lang/Object;
> >
> > and clearly the method with that signature doesn't exist anymore, that's
> > fine, I can understand that and probably I'm not going to be able to go
> > beyond this point in the upgrade.
> >
> > However when I go to to
> >
> >
> https://github.com/apache/tapestry-5/blob/5.6.4/tapestry-json/src/main/java/org/apache/tapestry5/json/JSONObject.java
> > to see the new source code I see comments referencing the 5.7 version.
> >
> > Is that expected being in the 5.6.x?
> >
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: [ANNOUNCEMENT] Tapestry 5.6.2 released

2021-03-31 Thread Dmitry Gusev
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.

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


Re: [ANNOUNCEMENT] Tapestry 5.7.1 and 5.6.3 released

2021-03-17 Thread Dmitry Gusev
Thanks for your efforts Thiago! 🌟

There's a typo in release notes link for 5.7.1:

https://tapestry.apache.org/release-notes-571.html

On Tue, Mar 16, 2021 at 9:30 PM Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

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


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: How to bind Tapestry 5.4 app to 0.0.0.0 instead of default localhost

2021-03-03 Thread Dmitry Gusev
Hi,

Binding is a deployment concern, it has nothing to do with Tapestry the web
framework.

You should seek documentation of your application server.

Regards,
Dmitry

On Wed, Mar 3, 2021 at 2:14 PM Karoly Guba  wrote:

> Dear all,
>
> I am using Tapestry 5.4, Java 8, Maven.  Just wondering if this is
> possible to bind the Tapestry application to “0.0.0.0" instead of default
> “localhost”.
>
> Thanks,
> Karoly
> -
> 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


Re: [ANNOUNCEMENT] Tapestry 5.7.0 released

2021-02-24 Thread Dmitry Gusev
Hooray, that's a big milestone!

Thank you to everyone involved!

On Wed, Feb 24, 2021 at 3:03 PM Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

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


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


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

2020-10-09 Thread Dmitry Gusev
Hi Hristo,

This mailing list isn't allowing attachments, we cannot see it, so it's a
bit unclear what you need.

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

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


Re: out of order in T5.5

2020-04-09 Thread Dmitry Gusev
Hi Lothar,

There were some changes in the form submission logic in Tapestry 5.4:

http://tapestry.apache.org/forms-and-validation.html#FormsandValidation-TrackingValidationErrors

Try to move the login logic to onValidate() and see if it makes any
difference.

Regards,
Dmitry

On Thu, Apr 9, 2020 at 4:59 PM Lothar Nieswandt  wrote:

> Hello everybody,
>
> I have now migrated my Tapestry 5.3 application to Tapestry 5.5, which is
> now final. Thanks a lot, it makes me feel much more confident about the
> future applicability of Tapestry.
>
> One remaining issue: it seems to me like the  component does not
> work anymore.
>
> I can record anything I want by means of form.recordError(), but it does
> not get displayed anymore. At first I thought it could be a client side
> validation or CSS/bootstrap issue, but now I think, there must be server
> side cause?
>
> 
> 
> >>>
> 
> 
> Benutzername:
>  t:id="username"/>
> 
> 
> Kennwort:
>  t:id="password"/>
> 
> 
> 
>  class="button"/>
> 
> 
>
>
> public class Index extends BasePage {
>
> @Property
> @NotNull
> private String username;
> @Property
> @NotNull
> private String password;
> @Inject
> private LocalLoginService loginService;
> @InjectPage
> private Menu indexPage;
> @SessionState
> private UserData user;
> @Component
> private Form loginForm;
> Object onLogin() {
> Session session = loginService.login(username, password);
> if (session == null) { // authentication failed
> >>>loginForm.recordError("Die verwendeten Anmeldedaten sind
> ungültig.");
> return this;
> }
> user.setPrincipal(session.getPrincipal());
> user.setRealname(session.getRealname());
> return indexPage;
> }
> }
>
> This worked perfectly in T5.3, but not in T5.5.
>
> Any ideas?
> Lothar
>
> -
> 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


Re: Roadmap proposal

2020-03-28 Thread Dmitry Gusev
Hi Thiago,

Just a small correct, the next LTS is Java 17 to be released in 2021.

It would definitely be nice to provide intermediate releases that support
byte code for non-LTS versions to let us use newest language features.

Not sure about java 9 modules though, will tapestry development actually
benefit from them?
Or end projects built on top of/with tapestry?
Are there any projects apart from JDK itself benefiting from modules?
Would be nice to hear users feedback here.

One idea that crossed my mind few times is adding support for ByteBuddy in
favour of, or in addition to tapestry-plastic.
Mostly to improve generics support in proxies, but may also benefit from
other latest language features, not existing and newcoming.

Regards,
Dmitry

On Fri, Mar 27, 2020 at 7:44 PM Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> Hello, Tapestry community!
>
> I have some ideas for Tapestry's next steps and I'd like to receive your
> input about them.
>
> Tapestry 5.5 supports Java 12 bytecode. This is done through an embedded
> copy of the ASM bytecode library. We change the package names so they don't
> clash with the ASM version eventually used by other dependencies of your
> project. A few other changes are also needed, the only one I recall right
> now is changing one specific method visibility to public so it can be used
> in Plastic.
>
> For 5.6, since Java 14, a long term support release, was released last week
> and I guess lots of people are eager to try it, I was thinking of grabbing
> the latest stable version of ASM to pick up its support for Java 14
> bytecode. We could have 5.6 released next month just for that and then have
> later minor versions for fixes and improvements or wait a bit and have a
> single release for everything. I prefer the first option.
>
> For 5.7, I was thinking of implementing something suggested by more than
> one people (I apologize for not recalling who): separating the page library
> (i.e. all the support for pages, components and mixins) from the rest of
> tapestry-core (i.e. the request handling part: HttpServletRequestFilter,
> RequestFilter, Dispatcher, asset support, etc). Ilya also suggested the
> possibility of separating corelib (the component library provided by
> Tapestry out of the box) from the rest of the framework, an interesting
> idea, but I'm not sure that's really needed. If you need you own version of
> some components, you can use the ComponentOverride service. This way, for
> example, you can have your own implementation of Grid and have it
> automatically used in all  or  usages. But I'm
> open to different opinions. I'm actually inviting them, and I may even
> change my opinions.  :)
>
> Also for 5.7, I'm planning to make the Tapestry JARs proper Java 9 modules.
> This will require moving classes, maybe a lot of them, from one package to
> another, since a package cannot be in more than one module and Tapestry has
> a number of cases of this.
>
> Also for 5.7, build Tapestry with Java 11 instead of 8, which has mostly
> reached its end of life already, not getting more updates and fixes from
> Oracle unless you have a support contract. I don't want anyone sticking to
> old Tapestry versions because they're still stuck with an old Java version,
> but I guess we can agree Java 8 is pretty old by now. 2 major (i.e. LTS
> releases) behind.
>
> Comments? Suggestions? Ideas? Please post them here!
>
> Cheers!
>
> --
> Thiago
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Tapestry exposes the list of css/js files in assets

2020-01-17 Thread Dmitry Gusev
My previous rule didn't work for JAR resources, here's an improved version
of regex pattern rule:

import org.apache.tapestry5.SymbolConstants;
import org.apache.tapestry5.ioc.annotations.Symbol;
import org.apache.tapestry5.services.ClasspathAssetProtectionRule;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class DirectoryListingAssetProtectionRule implements
ClasspathAssetProtectionRule
{
public static final Pattern LAST_SEGMENT_PATTERN =
Pattern.compile("[^/]+$");

private final String modulePathPrefixGZ;

public DirectoryListingAssetProtectionRule(
@Symbol(SymbolConstants.MODULE_PATH_PREFIX) String modulePathPrefix)
{
this.modulePathPrefixGZ = modulePathPrefix.toLowerCase() + ".gz";
}

@Override
public boolean block(String path)
{
final Matcher matcher = LAST_SEGMENT_PATTERN.matcher(path);

if (!matcher.find())
{
//  Empty last segment?
return true;
}

final String match = matcher.group().toLowerCase();

return match.equals(modulePathPrefixGZ) || !match.contains(".");
    }
}


On Thu, Jan 16, 2020 at 1:35 PM Dmitry Gusev  wrote:

> Looking a bit further, it does make sense to me to block all directory
> requests in ClasspathAssetRequestHandler by default,
> as directory listing is not something you'd expect to receive via HTTP.
>
> That workaround won't work if you have folder with dot in the name though,
> so something more type-safe may be required.
>
> At first glance I couldn't find any existing API that would expose
> underlying File object from an instance of Resource, but for
> ClasspathResource (and maybe some other resources, like FileResource,
> ContextResource, etc.) this implementation could probably work better (not
> tested):
>
> @Contribute(ClasspathAssetProtectionRule.class)
> public static void contributeClasspathAssetProtectionRule(
> OrderedConfiguration configuration,
> AssetSource assetSource)
> {
> configuration.add("DirectoryListing", path ->
> {
> Resource resource = assetSource.resourceForPath(path);
>
> if (resource == null)
> {
> //  Nothing to serve
> return true;
> }
>
> URL resourceUrl = resource.toURL();
>
> if (resourceUrl != null)
> {
> try
> {
> return Path.of(resourceUrl.toURI()).toFile().isDirectory();
> }
> catch (URISyntaxException e)
> {
> throw new RuntimeException(e);
> }
> }
>
> return false;
> });
> }
>
>
> On Thu, Jan 16, 2020 at 1:19 PM Nicolas Bouillon 
> wrote:
>
>> Hi,
>> Thank you for the quick reply, I've added the following rule in my
>> AppModule.
>>
>> @Contribute(ClasspathAssetProtectionRule.class)
>> public static void contributeClasspathAssetProtectionRule(
>> OrderedConfiguration configuration)
>> {
>> ClasspathAssetProtectionRule fileWithDot = (s) ->
>> !s.toLowerCase().matches(".*\\.[^/]+");
>> configuration.add("DirectoryListing", fileWithDot);
>> }
>>
>> Note that the directory listing is displayed even without any ending
>> forwarding slash. Then I've forced the requested file name to end with
>> a . followed by some chars (anything but a forward slash).
>>
>> I wonder if that configuration should be put by default, or activable
>> using a configuration switch described in
>> https://tapestry.apache.org/security.html
>>
>> Thank you again.
>> Nicolas.
>>
>> Le jeu. 16 janv. 2020 à 10:43, Dmitry Gusev  a
>> écrit :
>> >
>> > Hi,
>> >
>> > I wasn't aware of it, thanks for bringing it up.
>> >
>> > From what I found in code, AssetsModule contributes three asset
>> protection
>> > rules: for .xml, .class, and .properties files:
>> >
>> > public static void contributeClasspathAssetProtectionRule(
>> > OrderedConfiguration
>> configuration)
>> > {
>> > ClasspathAssetProtectionRule classFileRule = (s) ->
>> > s.toLowerCase().endsWith(".class");
>> > configuration.add("ClassFile", classFileRule);
>> > ClasspathAssetProtectionRule propertiesFileRule = (s) ->
>> > s.toLowerCase().endsWith(".properties");
>> > configuration.add("PropertiesFile", propertiesFileRule);
>> > ClasspathAssetProtectionRule xmlFileRu

Re: Tapestry exposes the list of css/js files in assets

2020-01-16 Thread Dmitry Gusev
Looking a bit further, it does make sense to me to block all directory
requests in ClasspathAssetRequestHandler by default,
as directory listing is not something you'd expect to receive via HTTP.

That workaround won't work if you have folder with dot in the name though,
so something more type-safe may be required.

At first glance I couldn't find any existing API that would expose
underlying File object from an instance of Resource, but for
ClasspathResource (and maybe some other resources, like FileResource,
ContextResource, etc.) this implementation could probably work better (not
tested):

@Contribute(ClasspathAssetProtectionRule.class)
public static void contributeClasspathAssetProtectionRule(
OrderedConfiguration configuration,
AssetSource assetSource)
{
configuration.add("DirectoryListing", path ->
{
Resource resource = assetSource.resourceForPath(path);

if (resource == null)
{
//  Nothing to serve
return true;
}

URL resourceUrl = resource.toURL();

if (resourceUrl != null)
{
try
{
return Path.of(resourceUrl.toURI()).toFile().isDirectory();
}
catch (URISyntaxException e)
{
throw new RuntimeException(e);
}
}

return false;
});
}


On Thu, Jan 16, 2020 at 1:19 PM Nicolas Bouillon 
wrote:

> Hi,
> Thank you for the quick reply, I've added the following rule in my
> AppModule.
>
> @Contribute(ClasspathAssetProtectionRule.class)
> public static void contributeClasspathAssetProtectionRule(
> OrderedConfiguration configuration)
> {
> ClasspathAssetProtectionRule fileWithDot = (s) ->
> !s.toLowerCase().matches(".*\\.[^/]+");
> configuration.add("DirectoryListing", fileWithDot);
> }
>
> Note that the directory listing is displayed even without any ending
> forwarding slash. Then I've forced the requested file name to end with
> a . followed by some chars (anything but a forward slash).
>
> I wonder if that configuration should be put by default, or activable
> using a configuration switch described in
> https://tapestry.apache.org/security.html
>
> Thank you again.
> Nicolas.
>
> Le jeu. 16 janv. 2020 à 10:43, Dmitry Gusev  a
> écrit :
> >
> > Hi,
> >
> > I wasn't aware of it, thanks for bringing it up.
> >
> > From what I found in code, AssetsModule contributes three asset
> protection
> > rules: for .xml, .class, and .properties files:
> >
> > public static void contributeClasspathAssetProtectionRule(
> > OrderedConfiguration configuration)
> > {
> > ClasspathAssetProtectionRule classFileRule = (s) ->
> > s.toLowerCase().endsWith(".class");
> > configuration.add("ClassFile", classFileRule);
> > ClasspathAssetProtectionRule propertiesFileRule = (s) ->
> > s.toLowerCase().endsWith(".properties");
> > configuration.add("PropertiesFile", propertiesFileRule);
> > ClasspathAssetProtectionRule xmlFileRule = (s) ->
> > s.toLowerCase().endsWith(".xml");
> > configuration.add("XMLFile", xmlFileRule);
> > }
> >
> > So as a possible workaround you could contribute another rule that vetoes
> > asset requests that have no file extension (or end with forward slash),
> > which should cover directory entries.
> >
> > On Thu, Jan 16, 2020 at 12:22 PM Nicolas Bouillon 
> > wrote:
> >
> > > Hi all,
> > >
> > > Following a pen-test of our application, it has been raised that the
> > > list of assets if visible as a directory listing.
> > >
> > > For example, we have a javascript file available at this location
> > > /assets/meta/z58f7f3d4/javascript/library.js but when we access
> > > /assets/meta/z58f7f3d4/javascript/ the web server lists all files
> > > available in META-INF.assets.javascript directory of the project.
> > >
> > > Do you know how to prevent this listing?
> > >
> > > Looks like to me it's happening in
> > >
> > >
> org.apache.tapestry5.internal.services.assets.ClasspathAssetRequestHandler#handleAssetRequest
> > > and then in
> > >
> org.apache.tapestry5.internal.services.ResourceStreamerImpl#streamResource(org.apache.tapestry5.ioc.Resource,
> > > org.apache.tapestry5.services.assets.StreamableResource,
> > > java.lang.String,
> > >
> > >
> java.util.Set)
> > >
> > > Thank you,
> > > Nicolas.
> > >
> > > -
> > > 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
>
> -
> 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


Re: Tapestry exposes the list of css/js files in assets

2020-01-16 Thread Dmitry Gusev
Hi,

I wasn't aware of it, thanks for bringing it up.

>From what I found in code, AssetsModule contributes three asset protection
rules: for .xml, .class, and .properties files:

public static void contributeClasspathAssetProtectionRule(
OrderedConfiguration configuration)
{
ClasspathAssetProtectionRule classFileRule = (s) ->
s.toLowerCase().endsWith(".class");
configuration.add("ClassFile", classFileRule);
ClasspathAssetProtectionRule propertiesFileRule = (s) ->
s.toLowerCase().endsWith(".properties");
configuration.add("PropertiesFile", propertiesFileRule);
ClasspathAssetProtectionRule xmlFileRule = (s) ->
s.toLowerCase().endsWith(".xml");
configuration.add("XMLFile", xmlFileRule);
}

So as a possible workaround you could contribute another rule that vetoes
asset requests that have no file extension (or end with forward slash),
which should cover directory entries.

On Thu, Jan 16, 2020 at 12:22 PM Nicolas Bouillon 
wrote:

> Hi all,
>
> Following a pen-test of our application, it has been raised that the
> list of assets if visible as a directory listing.
>
> For example, we have a javascript file available at this location
> /assets/meta/z58f7f3d4/javascript/library.js but when we access
> /assets/meta/z58f7f3d4/javascript/ the web server lists all files
> available in META-INF.assets.javascript directory of the project.
>
> Do you know how to prevent this listing?
>
> Looks like to me it's happening in
>
> org.apache.tapestry5.internal.services.assets.ClasspathAssetRequestHandler#handleAssetRequest
> and then in
> org.apache.tapestry5.internal.services.ResourceStreamerImpl#streamResource(org.apache.tapestry5.ioc.Resource,
> org.apache.tapestry5.services.assets.StreamableResource,
> java.lang.String,
>
> java.util.Set)
>
> Thank you,
> Nicolas.
>
> -----
> 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


Re: Apache Tapestry for Java 11

2019-10-25 Thread Dmitry Gusev
Hi Paul,

it's in latest 5.5.0-beta-3

On Sat, Oct 26, 2019 at 12:55 AM Paul Stanton  wrote:

> "We can push a new 5.5 beta for early testers."
>
> ^-- is this available? if not, any eta?
>
> On 11/09/2019 4:43 am, Thiago H. de Paula Figueiredo wrote:
> > On Tue, Sep 10, 2019 at 4:31 AM Chris Poulsen 
> > wrote:
> >
> >> I did roll an "internal" 5.5-beta version based on the code from 12th
> July
> >> as there are some fixes in HEAD that are not in the beta-2 and that
> bastard
> >> build is what we currently are using without problems.
> >>
> > We can push a new 5.5 beta for early testers.
> >
> >
> >> If 5.5 isn't 100% ready for release yet, it seems to be really close
> and it
> >> would be good to get it finalized IMO.
> >>
> > Yes, we're close. I'd just want to finish the support for running without
> > Bootstrap (or with Bootstrap 4) before releasing 5.5. I don't see any
> other
> > blockers or nice-to-haves. Other people may have their own, of course. :)
> >
> > And yes, 5.5 supports Java 11 bytecode, and that's exactly the issue that
> > most probably took the team the longer to develop.
> >
> >
> >> --
> >> Chris
> >>
> >> On Mon, Sep 9, 2019 at 9:11 PM Charles Roth  wrote:
> >>
> >>> Sounds good to me.  We'd be very happy to test a 5.5-beta. (Large
> >>> application that has about 1M LOC, including unit-tests, TML, etc.)
> >>>
> >>> On 9/9/2019 3:08 PM, Dmitry Gusev wrote:
> >>>> Hi Charles,
> >>>>
> >>>> Current state of the master branch should run just fine on Java 11;
> >>> there's
> >>>> no release you can download though.
> >>>>
> >>>> We should probably start a vote on another Tapestry 5.5-beta soon to
> >>>> release current state of the master branch,
> >>>> and maybe make a first 5.5.0 release right after we get some feedback
> >>> from
> >>>> community.
> >>>>
> >>>>
> >>>> On Mon, Sep 9, 2019 at 9:54 PM Charles Roth 
> >> wrote:
> >>>>> Is there any new(ish) word on Tapestry 5.5 or any other release that
> >>>>> will run under Java 9, 10, and maybe 11?
> >>>>>
> >>>>> Thanks!
> >>>>>
> >>>>> On 10/8/2018 12:54 PM, Bob Harner wrote:
> >>>>>> Yes. The unreleased 5.5 version passses all tests with the Java 9+
> >>>>>> compatible version of ASM (which was the obstacle for running
> >> Tapestry
> >>>>> 5.4
> >>>>>> under Java 9+) and should be usable for Java 9 and 10 now (once
> >>>>> released),
> >>>>>> although it hasn't been tested enough by others. I haven't checked
> it
> >>>>> with
> >>>>>> Java 11 yet. The Tapestry nightly snapshot process is broken
> >> currently,
> >>>>> and
> >>>>>> that's the principal obstacle to the 5.5 release.
> >>>>>>
> >>>>>>
> >> https://issues.apache.org/jira/plugins/servlet/mobile#issue/TAP5-2588
> >>>>>> My weekends have been occupied by other projects the last few weeks
> >>> but I
> >>>>>> hope to get back on it next weekend.
> >>>>>>
> >>>>>> On Mon, Oct 8, 2018, 9:49 AM gard sæbø
>  >>>>>> wrote:
> >>>>>>
> >>>>>>> Hi!
> >>>>>>>
> >>>>>>> We are upgrading all our Java applications, which currently runs on
> >>> Java
> >>>>>>> 8, to Java 11.
> >>>>>>>
> >>>>>>> Our web applications use Apache Tapestry as the frontend framework,
> >>> but
> >>>>> it
> >>>>>>> seems a bit quite on the Tapestry commit log in comparison with
> >> other
> >>>>>>> frontend frameworks.
> >>>>>>>
> >>>>>>> Will there be any upgrade which will support Java 11 and future
> Java
> >>>>>>> versions?
> >>>>>>>
> >>>>>>> Best regards,
> >>>>>>> Gard Sæbø
> >>>>>>>
> >> -
> >>>>>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >>>>>>> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>>>>>>
> >>>>>>>
> >>>>> -
> >>>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >>>>> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>>>>
> >>>>>
> >>> -
> >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >>> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>>
> >>>
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Apache Tapestry for Java 11

2019-09-09 Thread Dmitry Gusev
Hi Charles,

Current state of the master branch should run just fine on Java 11; there's
no release you can download though.

We should probably start a vote on another Tapestry 5.5-beta soon to
release current state of the master branch,
and maybe make a first 5.5.0 release right after we get some feedback from
community.


On Mon, Sep 9, 2019 at 9:54 PM Charles Roth  wrote:

> Is there any new(ish) word on Tapestry 5.5 or any other release that
> will run under Java 9, 10, and maybe 11?
>
> Thanks!
>
> On 10/8/2018 12:54 PM, Bob Harner wrote:
> > Yes. The unreleased 5.5 version passses all tests with the Java 9+
> > compatible version of ASM (which was the obstacle for running Tapestry
> 5.4
> > under Java 9+) and should be usable for Java 9 and 10 now (once
> released),
> > although it hasn't been tested enough by others. I haven't checked it
> with
> > Java 11 yet. The Tapestry nightly snapshot process is broken currently,
> and
> > that's the principal obstacle to the 5.5 release.
> >
> > https://issues.apache.org/jira/plugins/servlet/mobile#issue/TAP5-2588
> >
> > My weekends have been occupied by other projects the last few weeks but I
> > hope to get back on it next weekend.
> >
> > On Mon, Oct 8, 2018, 9:49 AM gard sæbø 
> > wrote:
> >
> >> Hi!
> >>
> >> We are upgrading all our Java applications, which currently runs on Java
> >> 8, to Java 11.
> >>
> >> Our web applications use Apache Tapestry as the frontend framework, but
> it
> >> seems a bit quite on the Tapestry commit log in comparison with other
> >> frontend frameworks.
> >>
> >> Will there be any upgrade which will support Java 11 and future Java
> >> versions?
> >>
> >> Best regards,
> >> Gard Sæbø
> >> -
> >> 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
>
>

-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Jetbrains considers to deprecate Tapestry plugin in IntelliJ 2019.3

2019-06-19 Thread Dmitry Gusev
Hi,

To be fair Tapestry support as implemented in the plugin was and is still
very limited and sometimes even misleading, and there's definitely room for
improvements.

But it's still the best we have.

In case you didn't notice, the plugin has been open sourced few months ago:

https://github.com/JetBrains/intellij-plugins/tree/master/tapestry

so maybe we can pick it up from there and build on top of it.

On Tue, Jun 18, 2019 at 11:46 PM Nicolas Bouillon 
wrote:

> Hi,
>
> Not sure if many of you are using the Tapestry plugins of IntellJ Ultimate.
>
> I do and it's very handy to navigate fastly between components and for code
> completion in templates.
>
>
> https://blog.jetbrains.com/idea/2019/06/plugin-deprecations-in-intellij-idea-v2019-2/
>
> Tapestry is my favorite framework, and I haven't found any replacement with
> the killing features such as Live Class Reloading (natively) and excellent
> error reporting.
>
> Keep up the good work.
>
> Nicolas.
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Accessing a page over HTTPS results in infinite 302 redirects

2019-06-17 Thread Dmitry Gusev
Show configuration of the app server for the header?
Tomcat, for example, needs custom valve to acknowledge x-forwarded headers.

On Mon, Jun 17, 2019 at 9:36 AM Kim Syväluoma  wrote:

> We have now added the X-Forwarded-Proto and X-Forwarded-For to the
> requests but we still get 302 loop:
>
> GET /ngm/start HTTP/1.1
> Host: bo-ci.eget.fi
> Connection: keep-alive
> Upgrade-Insecure-Requests: 1
> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5)
> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169
> Safari/537.36
> Accept:
>
> text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3
> Accept-Encoding: gzip, deflate, br
> Accept-Language: en-US,en;q=0.9,sv;q=0.8,fi;q=0.7,lv;q=0.6,es;q=0.5
> Cookie: _ga=GA1.2.2095789035.1543389393;
> AMCV_A5A139F7569D5CB57F000101%40AdobeOrg=1406116232%7CMCIDTS%7C17864%7CMCMID%7C21405024211598008102491243369473793569%7CMCAAMLH-1543994214%7C6%7CMCAAMB-1543994214%7CRKhpRz8krg2tLO6pguXWp5olkAcUniQYPHaMWWgdJ3xzPWQmdj0y%7CMCOPTOUT-1543396614s%7CNONE%7CMCAID%7CNONE%7CvVersion%7C2.5.0;
>
> _gcl_au=1.1.558442318.1553672462;
> __cfduid=d3fcfc204dc54bf4c4d94a53ee955a6581557830653;
> NGM=g49j5fJxzz-XyMWzYBJ4YoebaB8rgEwPw_gG2tEjudRZqYbykvGY!-2115956942
> X-Forwarded-For: 10.5.128.233
> X-Forwarded-Proto: https
>
> HTTP/1.1 302 Moved Temporarily
> Connection: close
> Date: Mon, 17 Jun 2019 06:23:19 GMT
> Transfer-Encoding: chunked
> Location: https://bo-ci.eget.fi/ngm/start
>
> 0103
> 302 Moved Temporarily
> 
> This document you requested has moved
> temporarily.
> It's now at  href="https://bo-ci.eget.fi/ngm/start";>https://bo-ci.eget.fi/ngm/start
> .
> 
>
> 
>
>
> Any more tips?
>
> Br,
> Kim
>
>
> 2019-06-14 12:24 skrev Kim Syväluoma:
> > Thanks for the answers. We will try adding the "X-Forwarded-Proto:
> > https" header to our requests.
> >
> > /Kim
> >
> > 2019-06-14 11:34 skrev Chris Poulsen:
> >> Hi,
> >>
> >> We use:
> >>
> >> // default to non-secure pages (allows us to support both http and
> >> https
> >> based on the request)
> >> configuration.add( SymbolConstants.SECURE_ENABLED, "false" );
> >>
> >> And always have an upstream proxy for performing SSL termination. This
> >> relies on the X-Forward-* headers being set and handled correctly by
> >> the
> >> various servers.
> >>
> >> --
> >> Chris
> >>
> >> On Fri, Jun 14, 2019 at 10:06 AM Dmitry Gusev 
> >> wrote:
> >>
> >>> Hi,
> >>>
> >>> I'd suggest to check value of `Request#isSecure()`, it looks like
> >>> it's
> >>> false.
> >>>
> >>> It can happen if your WebSphere is behind a proxy/load balancer which
> >>> terminates SSL,
> >>> in this case you may need to configure WebSphere to acknowledge the
> >>> x-forwarded-proto HTTP header.
> >>>
> >>> On Fri, Jun 14, 2019 at 9:17 AM Kim Syväluoma 
> >>> wrote:
> >>>
> >>> > We have a Tapestry application which we need to use over HTTPS only.
> We
> >>> > are using Weblogic only.
> >>> >
> >>> > We have these set in the AppModule of the Tapestry application:
> >>> >
> >>> > public static void contributeApplicationDefaults(
> >>> >  final MappedConfiguration configuration) {
> >>> >  configuration.add("tapestry.supported-locales", "en");
> >>> >  configuration.add("tapestry.start-page-name", "start");
> >>> >  configuration.add(SymbolConstants.HOSTPORT_SECURE, "443");
> >>> >  configuration.add(SymbolConstants.SECURE_ENABLED, "true");
> >>> > }
> >>> >
> >>> > public static void contributeMetaDataLocator(final
> >>> > MappedConfiguration configuration) {
> >>> >  configuration.add(MetaDataConstants.SECURE_PAGE, "true");
> >>> > }
> >>> >
> >>> > In the Start page we have a redirect like this:
> >>> >
> >>> > final Object onActivate() {
> >>> >  if (!this.sessionHandler.isLoggedIn()) {
> >>> >  return this.loginPage;
> >>> >  }
> >>> >  return this.mainFrameSet;
> >>> > }
> >>> >
> >>> > We we try to access our app by HTTPS at root or directly at the start
> >>> > page, loginPage or mainFrameSet page we get infinite redirect loop
> (302)
> >>> > to the same page we are accessing.
> >>> >
> >>> > If we set the MetaDataConstants.SECURE_PAGE to false we can access
> our
> >>> > app over HTTPS but all page requests/links within the app is then
> done
> >>> > over HTTP and that does not work.
> >>> > We need to have all functionality within the app to work over, and
> using
> >>> > only, HTTPS.
> >>> >
> >>> > What have we missed?
> >>> >
> >>> > Br,
> >>> > Kim
> >>> >
> >>>
> >>> --
> >>> Dmitry Gusev
> >>>
> >>> AnjLab Team
> >>> http://anjlab.com
> >>>
>
> -
> 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


Re: Accessing a page over HTTPS results in infinite 302 redirects

2019-06-14 Thread Dmitry Gusev
Hi,

I'd suggest to check value of `Request#isSecure()`, it looks like it's
false.

It can happen if your WebSphere is behind a proxy/load balancer which
terminates SSL,
in this case you may need to configure WebSphere to acknowledge the
x-forwarded-proto HTTP header.

On Fri, Jun 14, 2019 at 9:17 AM Kim Syväluoma  wrote:

> We have a Tapestry application which we need to use over HTTPS only. We
> are using Weblogic only.
>
> We have these set in the AppModule of the Tapestry application:
>
> public static void contributeApplicationDefaults(
>  final MappedConfiguration configuration) {
>  configuration.add("tapestry.supported-locales", "en");
>  configuration.add("tapestry.start-page-name", "start");
>  configuration.add(SymbolConstants.HOSTPORT_SECURE, "443");
>  configuration.add(SymbolConstants.SECURE_ENABLED, "true");
> }
>
> public static void contributeMetaDataLocator(final
> MappedConfiguration configuration) {
>  configuration.add(MetaDataConstants.SECURE_PAGE, "true");
> }
>
> In the Start page we have a redirect like this:
>
> final Object onActivate() {
>  if (!this.sessionHandler.isLoggedIn()) {
>  return this.loginPage;
>  }
>  return this.mainFrameSet;
> }
>
> We we try to access our app by HTTPS at root or directly at the start
> page, loginPage or mainFrameSet page we get infinite redirect loop (302)
> to the same page we are accessing.
>
> If we set the MetaDataConstants.SECURE_PAGE to false we can access our
> app over HTTPS but all page requests/links within the app is then done
> over HTTP and that does not work.
> We need to have all functionality within the app to work over, and using
> only, HTTPS.
>
> What have we missed?
>
> Br,
> Kim
>
> --
> ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤øø¤º°`°º¤ø,¸¸,ø¤
> Name:   |   Kim Syväluoma|
> Email:  |   kim@aland.net|
> Tel (GSM):  |   +358 (0)40 592 5267  |
> Tel Work:   |   +358 (0)20 7910 666  |
> =====
>
> -
> 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


Re: How to let the last ajaxResponseRenderer win?

2019-06-07 Thread Dmitry Gusev
Hi,

There’s no reliable way to do so as all requests arrive simultaneously on
the server side, so unless you do a distributed lock — which is not a good
idea usually — there’s no way to do so.

One of ideas is: you could pass sequential number with every request, put
that number in a storage (like Redis) using compare and set, and if request
is older than the one already in storage — do nothing.

Usually such requests are throttled on the client side, I.e.:
https://github.com/cowboy/jquery-throttle-debounce

On Friday, June 7, 2019, Svein-Erik Løken  wrote:

> When typing "test" pretty fast into textfield id=nameFilter the result is
> wrong. I am typical getting "DEBUG nameFilter: te" (sometimes just "t").
> The grid data corresponds to the nameFilter output.
>
> The output from  getNamefilterDebug() is always:
> getNamefilterDebug: t
> getNamefilterDebug: te
> getNamefilterDebug: tes
> getNamefilterDebug: test
>
>
>
>  autofocus="true" style="display:flex;align-items: center;">
> Name:
>  style="vertical-align: top" value="nameFilter" autocomplete="off"/>
> ${destinationBeans.size()} zone>
> 
>
> 
> DEBUG nameFilter: ${namefilterDebug}
>
>  source="destinationBeans" rowClass="prop:rowClass" class="table table-hover
> table-bordered" t:row="destinationBean" model="model" rowsPerPage="1000"
> t:pagerPosition="top">
>
>
> void onSubmitFromNameFilterForm() {
> applyFilter();
> ajaxResponseRenderer.addRender(destinationTableZone);
> }
>
>
> public String getNamefilterDebug() {
> System.err.format("getNamefilterDebug: %s%n",nameFilter);
> return nameFilter;
> }
>
>
> When using JavaScript/React I just call XMLHttpRequest.abort() for all
> ongoing XHR's.
>
>
> I cannot figure out how to do this in Tapestry 5.4.4. I was looking for
> AjaxResponseRenderer addRender(ClientBodyElement zone, abortPrevious);
>
> S-E
>
>
>
>

-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Laggy response after a quiet time

2019-05-16 Thread Dmitry Gusev
Hi,

I'd also try to collect thread dump when you see this happening to get an
idea where the CPU is wasted.

On Thu, May 16, 2019 at 10:38 AM Mats Andersson 
wrote:

> Do you have some scheduled services that could eat memory? I would
> suspect that the garbage collector is using most of that CPU. Monitor
> the GC and how memory is used over time. Maybe there is a mismatch
> between the memory configurations in Docker and the JVM.
>
> It seems like it is repeatable, that is good for troubleshooting at least.
>
> Mats
>
>
> On 2019-05-16 03:33, JumpStart wrote:
> > Hi all,
> >
> > My app is working brilliantly under load, but after a quiet time it can
> be very slow to respond, leading our first user of the day to tap the same
> thing multiple times, and the next thing you know is CPU hits 100% and is
> stuck there, and none of those requests returns a response. Nor do any new
> requests return a response. Apache logs show that all the requests time out
> after 60 secs, unanswered, and the health checkers start messaging the
> support staff.
> >
> > Has anyone else experienced this kind of thing?
> >
> > Perhaps it’s something to do with our infrastructure? We’re running
> Tapestry from an EAR in Wildfly in Docker in an AWS EC2 instance. Also in
> that EC2 instance is Apache HTTPD in Docker.
> >
> > Any thoughts, please! It’s a crazy problem.
> >
> > Cheers,
> >
> > Geoff
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> --
> -- Mats Andersson | Ronsoft AB | +46(0)73 368 79 82
>
>

-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: ASM7 required

2019-04-12 Thread Dmitry Gusev
Hi Thiago!


>From 1f428d21610ca2ee4a0b0630b1e3d1c693a5a7e6 Mon Sep 17 00:00:00 2001
From: Mats Andersson 
Date: Mon, 1 Apr 2019 17:52:26 +0200
Subject: [PATCH] ASM7 dependencies

---
  .../apache/tapestry5/internal/plastic/PlasticInternalUtils.java | 2 +-
  .../tapestry5/ioc/internal/AbstractReloadableObjectCreator.java | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

diff --git
a/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticInternalUtils.java
b/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticInternalUtils.java
index f0ea0fb5e..4a6df1835 100644
---
a/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticInternalUtils.java
+++
b/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticInternalUtils.java
@@ -426,7 +426,7 @@ public class PlasticInternalUtils

  ClassNode result = new ClassNode();

-ClassVisitor adapter = new ClassVisitor(Opcodes.ASM4, result)
+ClassVisitor adapter = new ClassVisitor(Opcodes.ASM7, result)
  {
  @Override
  public MethodVisitor visitMethod(int access, String name,
String desc, String signature, String[] exceptions)
diff --git
a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/AbstractReloadableObjectCreator.java
b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/AbstractReloadableObjectCreator.java
index 1dfd26250..33096341a 100644
---
a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/AbstractReloadableObjectCreator.java
+++
b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/AbstractReloadableObjectCreator.java
@@ -211,7 +211,7 @@ public abstract class
AbstractReloadableObjectCreator implements ObjectCreator,

  public Class doClassLoad(String className) throws IOException
  {
-ClassVisitor analyzer = new ClassVisitor(Opcodes.ASM4)
+ClassVisitor analyzer = new ClassVisitor(Opcodes.ASM7)
  {
  @Override
  public void visit(int version, int access, String name,
String signature, String superName, String[] interfaces)

These ^

On Sat, Apr 13, 2019 at 12:43 AM Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> Hello!
>
> Which edits?
>
> On Thu, Apr 11, 2019 at 3:01 PM Dmitry Gusev 
> wrote:
>
> > Hello Mats and Thiago,
> >
> > I guess we need to reopen
> https://issues.apache.org/jira/browse/TAP5-2588
> > or
> > just don't forget to commit the last two edits.
> > I also got failures trying to run our test suite against 5.5-beta-2 &
> Java
> > 11. With the two last changes the errors are gone.
> >
> > Thanks!
> >
> >
> >
> > On Sat, Apr 6, 2019 at 12:14 PM Mats Andersson <
> mats.anders...@ronsoft.se>
> > wrote:
> >
> > > Yes of course, did that now. Thanks Thiago!
> > >
> > > /Mats
> > >
> > > On 2019-04-05 19:46, Thiago H. de Paula Figueiredo wrote:
> > > > Hello, Mats!
> > > >
> > > > On Tue, Apr 2, 2019 at 12:42 PM Mats Andersson <
> > > mats.anders...@ronsoft.se>
> > > > wrote:
> > > >
> > > >> Continuing the attempt to upgrade an application from 5.4.4 to
> > > >> 5.5.0-beta-2 I stepped into a couple of issues related to ASM. In
> > > >>
> org.apache.tapestry5.internal.plastic.asm.ClassVisitor#visitNestMember
> > > >> ASM7 is required, but calls from internal/plastic and ioc modules
> are
> > > >> made using ASM4 as parameter. See patch below for details:
> > > >>
> > > > Oh, thanks for spotting that. For legal purposes, could you please
> > attach
> > > > the patch into https://issues.apache.org/jira/browse/TAP5-2588?
> After
> > > that,
> > > > I'll be able to apply the patch.
> > > >
> > > >
> > > >>
> > > >>   From 1f428d21610ca2ee4a0b0630b1e3d1c693a5a7e6 Mon Sep 17 00:00:00
> > 2001
> > > >> From: Mats Andersson 
> > > >> Date: Mon, 1 Apr 2019 17:52:26 +0200
> > > >> Subject: [PATCH] ASM7 dependencies
> > > >>
> > > >> ---
> > > >>.../apache/tapestry5/internal/plastic/PlasticInternalUtils.java
> | 2
> > > +-
> > > >>.../tapestry5/ioc/internal/AbstractReloadableObjectCreator.java
> | 2
> > > +-
> > > >>2 files changed, 2 insertions(+), 2 deletions(-)
> > > >>
> > > >> diff --git
> > > >>
> > >
> >
> a/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticInternalUtils.java
> > > >>
> > > >&g

Re: ASM7 required

2019-04-11 Thread Dmitry Gusev
Hello Mats and Thiago,

I guess we need to reopen https://issues.apache.org/jira/browse/TAP5-2588 or
just don't forget to commit the last two edits.
I also got failures trying to run our test suite against 5.5-beta-2 & Java
11. With the two last changes the errors are gone.

Thanks!



On Sat, Apr 6, 2019 at 12:14 PM Mats Andersson 
wrote:

> Yes of course, did that now. Thanks Thiago!
>
> /Mats
>
> On 2019-04-05 19:46, Thiago H. de Paula Figueiredo wrote:
> > Hello, Mats!
> >
> > On Tue, Apr 2, 2019 at 12:42 PM Mats Andersson <
> mats.anders...@ronsoft.se>
> > wrote:
> >
> >> Continuing the attempt to upgrade an application from 5.4.4 to
> >> 5.5.0-beta-2 I stepped into a couple of issues related to ASM. In
> >> org.apache.tapestry5.internal.plastic.asm.ClassVisitor#visitNestMember
> >> ASM7 is required, but calls from internal/plastic and ioc modules are
> >> made using ASM4 as parameter. See patch below for details:
> >>
> > Oh, thanks for spotting that. For legal purposes, could you please attach
> > the patch into https://issues.apache.org/jira/browse/TAP5-2588? After
> that,
> > I'll be able to apply the patch.
> >
> >
> >>
> >>   From 1f428d21610ca2ee4a0b0630b1e3d1c693a5a7e6 Mon Sep 17 00:00:00 2001
> >> From: Mats Andersson 
> >> Date: Mon, 1 Apr 2019 17:52:26 +0200
> >> Subject: [PATCH] ASM7 dependencies
> >>
> >> ---
> >>.../apache/tapestry5/internal/plastic/PlasticInternalUtils.java | 2
> +-
> >>.../tapestry5/ioc/internal/AbstractReloadableObjectCreator.java | 2
> +-
> >>2 files changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git
> >>
> a/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticInternalUtils.java
> >>
> >>
> >>
> b/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticInternalUtils.java
> >> index f0ea0fb5e..4a6df1835 100644
> >> ---
> >>
> >>
> a/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticInternalUtils.java
> >> +++
> >>
> >>
> b/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticInternalUtils.java
> >> @@ -426,7 +426,7 @@ public class PlasticInternalUtils
> >>
> >>ClassNode result = new ClassNode();
> >>
> >> -ClassVisitor adapter = new ClassVisitor(Opcodes.ASM4, result)
> >> +ClassVisitor adapter = new ClassVisitor(Opcodes.ASM7, result)
> >>{
> >>@Override
> >>public MethodVisitor visitMethod(int access, String name,
> >> String desc, String signature, String[] exceptions)
> >> diff --git
> >>
> a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/AbstractReloadableObjectCreator.java
> >>
> >>
> >>
> b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/AbstractReloadableObjectCreator.java
> >> index 1dfd26250..33096341a 100644
> >> ---
> >>
> >>
> a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/AbstractReloadableObjectCreator.java
> >> +++
> >>
> >>
> b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/AbstractReloadableObjectCreator.java
> >> @@ -211,7 +211,7 @@ public abstract class
> >> AbstractReloadableObjectCreator implements ObjectCreator,
> >>
> >>    public Class doClassLoad(String className) throws IOException
> >>{
> >> -ClassVisitor analyzer = new ClassVisitor(Opcodes.ASM4)
> >> +ClassVisitor analyzer = new ClassVisitor(Opcodes.ASM7)
> >>{
> >>@Override
> >>public void visit(int version, int access, String name,
> >> String signature, String superName, String[] interfaces)
> >> --
> >> 2.17.1
> >>
> >>
> >> --
> >> -- Mats Andersson | Ronsoft AB | +46(0)73 368 79 82
> >>
> >>
> --
> -- Mats Andersson | Ronsoft AB | +46(0)73 368 79 82
>
>

-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Jetty not reloading

2018-11-28 Thread Dmitry Gusev
Yeah, sorry, I wasn't clear, the tapestry.production-mode should be FALSE
in development mode.

On Wed, Nov 28, 2018 at 11:34 AM Mats Andersson 
wrote:

> Usually tapestry.production-mode is used to check for updates less often
> so how can that help?
>
> Maybe tapestry.file-check-interval is defined somewhere? Default is 1s
> which should be enough in development. Also, make sure resources are
> actually copied to the target directory when they are changed in the
> souce. This is needed to make Tapestry aware of changes.
>
>
> /Mats
>
>
> On 2018-11-28 09:09, Dmitry Gusev wrote:
> > Hi!
> >
> > Make sure you have tapestry.production-mode=true set in one of your
> > tapestry modules, or set in the system properties section in your
> pom.xml.
> >
> > Execution mode only specifies a list of additional tapestry modules
> > (usually just one) for runtime configuration.
> >
> > On Wed, Nov 28, 2018 at 6:12 AM Qbyte Consulting <
> qbyteconsult...@gmail.com>
> > wrote:
> >
> >> I’m finding resources are not dynamically reloading. Jetty config below,
> >> what do I need to do?
> >>
> >>
> >> 
> >>  org.eclipse.jetty
> >>
> jetty-maven-plugin
> >>  9.2.0.M0
> >>  
> >>  
> >>  9095
> >>  
> >>  
> >>  
> >>
> >> tapestry.execution-mode
> >>
> >> development
> >>  
> >>  
> >>
> >> version
> >>
> >> ${project.version}
> >>  
> >>  
> >>  
> >>  
> >>
> >>
> >>
> >> Sent from my iPhone
> >> -----
> >> 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
>
>

-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Jetty not reloading

2018-11-28 Thread Dmitry Gusev
Hi!

Make sure you have tapestry.production-mode=true set in one of your
tapestry modules, or set in the system properties section in your pom.xml.

Execution mode only specifies a list of additional tapestry modules
(usually just one) for runtime configuration.

On Wed, Nov 28, 2018 at 6:12 AM Qbyte Consulting 
wrote:

> I’m finding resources are not dynamically reloading. Jetty config below,
> what do I need to do?
>
>
> 
> org.eclipse.jetty
> jetty-maven-plugin
> 9.2.0.M0
> 
> 
> 9095
> 
> 
> 
>
> tapestry.execution-mode
>
> development
> 
> 
>
> version
>
> ${project.version}
> 
> 
> 
> 
>
>
>
> Sent from my iPhone
> -
> 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


Re: Get link to the page that contains custom component

2018-10-26 Thread Dmitry Gusev
For forms you can use:

@Environmental
private ValidationTracker validationTracker;

and then

validationTracker.recordError(...)


On Fri, Oct 26, 2018 at 6:45 PM abangkis  wrote:

> Thanks a lot Dmitry. It's working great.
>
> There's another thing. If the custom component inside a form and like to
> set some error message.
> If it's a page we can do something like:
>
> @InjectComponent
> private Form form;
>
> form.recordError(message);
>
> How to do something like that in a component?
>
> Thanks a lot.
>
>
>
> On Fri, Oct 26, 2018 at 7:59 PM Dmitry Gusev 
> wrote:
>
> > Hi,
> >
> > I would try something like this:
> >
> > @Inject ComponentResources resources;
> >
> > and then
> >
> > pageRenderLinkSource.createPageRenderLink(resources.getPageName());
> >
> > On Fri, Oct 26, 2018 at 2:07 PM abangkis  wrote:
> >
> > > Hi guys. I'm moving parts of of my page to a custom component. In the
> > page
> > > there's a method that will go to another page and go back to the
> original
> > > page when finished. Here's the code:
> > >
> > > @OnEvent("AddDoc")
> > > Object addDoc() {
> > > Link thisPage =
> > pageRenderLinkSource.createPageRenderLink(this.getClass());
> > > addLoanDocPage.setLoanApplicationId(loanApplication.getId());
> > > addLoanDocPage.setLinkBack(thisPage);
> > > return addLoanDocPage;
> > > }
> > >
> > > I'm moving that method to the custom component. How can  the component
> > > generate the Link to the page that contains it?
> > >
> > > Thanks
> > >
> > > --
> > > http://www.mreunionlabs.net/ <http://www.mreunion-labs.net/>
> > > twitter : @mreunionlabs @abangkis
> > > page : https://plus.google.com/104168782385184990771
> > >
> >
> >
> > --
> > Dmitry Gusev
> >
> > AnjLab Team
> > http://anjlab.com
> >
>
>
> --
> http://www.mreunionlabs.net/ <http://www.mreunion-labs.net/>
> twitter : @mreunionlabs @abangkis
> page : https://plus.google.com/104168782385184990771
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Get link to the page that contains custom component

2018-10-26 Thread Dmitry Gusev
Hi,

I would try something like this:

@Inject ComponentResources resources;

and then

pageRenderLinkSource.createPageRenderLink(resources.getPageName());

On Fri, Oct 26, 2018 at 2:07 PM abangkis  wrote:

> Hi guys. I'm moving parts of of my page to a custom component. In the page
> there's a method that will go to another page and go back to the original
> page when finished. Here's the code:
>
> @OnEvent("AddDoc")
> Object addDoc() {
> Link thisPage = pageRenderLinkSource.createPageRenderLink(this.getClass());
> addLoanDocPage.setLoanApplicationId(loanApplication.getId());
> addLoanDocPage.setLinkBack(thisPage);
> return addLoanDocPage;
> }
>
> I'm moving that method to the custom component. How can  the component
> generate the Link to the page that contains it?
>
> Thanks
>
> --
> http://www.mreunionlabs.net/ <http://www.mreunion-labs.net/>
> twitter : @mreunionlabs @abangkis
> page : https://plus.google.com/104168782385184990771
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: No uploaded file when upgrading to new Tapestry version (Spring Boot jar, embedded Tomcat...)

2018-06-19 Thread Dmitry Gusev
Hi,

judging by the code you submitted, it should only return an empty list in
case of FileUploadException.

Did you try to attach with debugger and checking the exception object?

On Tue, Jun 19, 2018 at 7:28 PM, Vjeran Marcinko <
vjeran.marci...@email.t-com.hr> wrote:

>  Hi,
>
> I am upgrading my old Tapestry 4.3.7 app (java-7, standalone Tomcat...) to
> newer tech stack (java 8, Spring Boot with embeddable Tomcat deployed as
> single jar...). I wan't to leave tapestry untouched as much as possible, so
> I just upgraded from 4.3.7 to 4.3.8 because of Java-8 requirement.
>
> And practically everything works perfectly except that my Upload component
> stopped working. It doesn't raise any error, its just that after form
> submit, my UploadedFile instance is always null.
>
> I debugged a bit, and found out that within Tapestry's
> MultipartDecoderImpl there is this part that should parse FileItems from
> HTTP request, but it always parses empty list. I udnerstand that here
> Taestry uses Apache Commons-FileUpload, but I have no idea what has changed
> for this to stop working properly?
>
> protected ListparseRequest(HttpServletRequest request)
> {
> try {
> return createFileUpload().parseRequest(request); }catch
> (FileUploadException ex)
> {
> uploadException = ex; return Collections.emptyList(); }
> }
>
> Dunno if Spring Boot and its embeeded Tomcat are making some difference
> here...
>
> Any idea?
>
> -Vjeran
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Odd breaking exception in 5.4

2018-05-24 Thread Dmitry Gusev
. I
> just restarted Tomcat, and it now loads. How do I find root cause? I've
> turned logging all the way up, and then there is too much noise. Since I
> can't get it to trigger on my workstation, I can't get a debugger connected
> to figure it out from there.
>
> Thanks,
>
> Richard
>
>
> -
> 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


Re: Access request from tml / standard servlet api role support

2018-04-28 Thread Dmitry Gusev
Hi Luca,

Component parameters syntax is built about binding expressions [1], i.e.
"prefix:expression".

By default the prefix is "prop:", unless explicitly overridden for specific
parameter [2].

You can find detailed explanation for property expressions, including its
BNF grammar, in official Tapestry documentation [3].

Property expressions are always evaluated in the context of current
page/component.

It's called "property" expression, because it uses JavaBean-notation
properties (@Property annotation can generate get/set methods around field
at runtime).

So in order for your expression `request.isUserInRole("ADMIN")` to work,
the `request` must be a @Property (or has `getRequest()` method) in your
page/component, i.e.:

@Inject
@Property
Request request;

There are no special cases for the built-in services in the BNF
for property expressions [3].

As others pointed in this thread, the Tapestry way of dealing with your
requirement is to create a new component,
similar to `t:If`, that would accept a role name as it's parameter so you
could render it's body conditionally if user is in role, i.e.:

public class HasRole extends
org.apache.tapestry5.corelib.base.AbstractConditional
{
@Inject RequestGlobals requestGlobals;
@Parameter(required=true, defaultPrefix=BindingConstants.LITERAL)
String role;

@Override
protected boolean test()
{
return requestGlobals.getHTTPServletRequest().isUserInRole(role);
}
}

Above code is almost a copy-paste of tapestry-security's HasRole component
[4].

The only difference is this component uses servlet API directly for role
checking,
while is tapestry-security is built around Apache Shiro [5],
and provides more advanced security model than simple role model of the
servlet API.

I highly recommend tapestry-security if you need anything more than
built-in servlet API role model.

[1]
http://tapestry.apache.org/component-parameters.html#ComponentParameters-BindingExpressions
[2]
https://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/annotations/Parameter.html#defaultPrefix()
[3] http://tapestry.apache.org/property-expressions.html
[4] http://www.tynamo.org/tapestry-security+guide/
[5] https://shiro.apache.org

On Sat, Apr 28, 2018 at 1:12 AM, Luca Arzeni  wrote:

> Hi,
> I'm using tapestry5.4 with java 8.
>
> I am using the standard servlet API to check if a user is in role or not,
> to hide or show buttons, links, and so on.
>
> For example, I need to show a button to the user only if the user has been
> granted a role.
>
> My usual way to to this is:
>
> 1) create a method in the page, for example:
>
> @Inject
> RequestGlobals m_requestGlobals;
>
> public boolean isUserAdmin() {
> if (m_requestGlobals == null) {
> return false;
> }
> return m_requestGlobals.isUserInRole("ADMIN");
> }
>
> 2) then, in the tml, check the method using a t:if component, for example:
>
> 
> SAVE DATA
> 
>
> This is not so good, since I must reimplement the same method in many
> pages.
>
> Is there any way could I access the requestGlobals directly from tml?
>
> My goql would be to write, directly in the tml, something like:
>
>
> 
> SAVE DATA
> 
>
>
> Is it possible to do this with tapestry5?
>
> Thanks in advance,
> larzeni
>
> -----
> 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


Re: requirejs question

2018-03-24 Thread Dmitry Gusev
Hi Erich,

one example of using jQuery in inline scripts can be:


require(['jquery'], function($) {
<!-- Use $ as usual here -->
});


I would suggest to replace inline scripts with JavaScript modules,
i.e. one per component/page:

http://tapestry.apache.org/javascript-modules.html


You can override jQuery version with the one you need, check
configuration symbols here:

https://github.com/apache/tapestry-5/blob/b3db0dd817d709a646b0a3e754f2e710c8f2a86f/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java#L91


If you haven't already, check http://tapestry5-jquery.com, it can
still be helpful for 5.4.x, especially if you're using jQuery IU.

Here are the configuration symbols for tapestry5-jquery:

https://github.com/got5/tapestry5-jquery/blob/master/src/main/java/org/got5/tapestry5/jquery/services/JQueryModule.java



On Sat, Mar 24, 2018 at 2:51 PM, Erich Gormann  wrote:

> Dear all,
>
> after migrating to tapestry 5.4.3 it is not possible anymore, to use
> inlines scripts in tml files.
>
> In principle I understood the idea and usgage of requirejs, but I'm
> confused, because they seem to be several ways to achieve certain goals for
> individual solutions.
>
> So I try to give a concrete example to illustrate my problems during
> restructuring our inline scripts wiith requirejs. As precondition I would
> like to say, that I set the javascipt infrastucture provider in Tapestry to
> "jquery".
>
> Currently we have these two kind of scripting in our Tapestry 5.3.8
> project (I show them only because of the use of the aliases):
>
> if ( jQuery( "#searchFilterSelector" ).length ) {
>   jQuery("#deleteSearchFilter").show();
> } else {
>  jQuery("#deleteSearchFilter").hide();
> }
>
> (function($) {
>  $('#finderSearchBtn').click(function() {
> showLoadingIndicator();
>   });
> })(jQuery);
>
> 1. question: what if my scripts need jquery or jqueryui? Do I have to put
> a jquery.js and jqueryui.js in my own poject or can I use the one of
> Tapestry 5.4.3?
> 2, question: If I can use the jquery libs of Tapestry, how do I have to
> make them known to my appkication? Must I put them in requirejs.config
> section and how (because they are in the Tapestry libs, not in the path of
> may appliaction)
> 3. question: Do I have to reqrite the above inline scripts and make use of
> another jquery alias?
> 4. question: How to process with already existing "browser global
> scripts"? I read about the shim config framework as part of requirejs, but
> it seems, that no scripts using define calls and such ones defined via shim
> can be used together in one appliaction, or am I wrong?
>
> I would appreciate, if you can give me an example how to make old scripst
> work again under Tapestry 5.4.3
>
> Thanks for your support!
>
> Regards, Erich
>
>
>
>
>
> -
> 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


Re: ClassNotFoundException: org.apache.tapestry5.ioc.services.ClassFactory

2018-03-19 Thread Dmitry Gusev
Then I'd recommend to attach to it with a debugger and look around to check
which class is causing this exception.

I.e. put a breakpoint in constructors of NoClassDefFoundError.

On Mon, Mar 19, 2018 at 5:04 PM, Erich Gormann  wrote:

> Hi Dmitry,
>
> I'm sure that there aro no old libs on classpath...
>
> Regards, Erich
>
>
>
>
> Am 19.03.2018 14:56, schrieb Dmitry Gusev:
>
>> Hi,
>>
>> It can still be loaded if you have Tapestry 5.3 jars on classpath, make
>> sure to remove them.
>>
>> On Mon, Mar 19, 2018 at 4:41 PM, Erich Gormann
>> wrote:
>>
>> Dear all,
>>>
>>> after migrating our application from tapestry 5.3.8 to Tapestry 5.4.3 I'm
>>> fighting with the exception shown in the stacktrace below.
>>>
>>> I'm aware that the ClassFactory is not present in Tapestry 5.4 anymore,
>>> but we do not use it explicetely. I wonder why our application should try
>>> to load it.
>>>
>>> Can it be loaded reflexive by another API?
>>>
>>> Any hints are welcome! Thanks in advance.
>>>
>>> Greetings, Erich
>>>
>>>
>>> ERROR 13:59:41,916 (ServerService Thread Pool -- 112)
>>> (StandardContext.java:filterStart:3228) -JBWEB000284: Exception starting
>>> filter tapestryFilter: java.lang.NoClassDefFoundError:
>>> org/apache/tapestry5/ioc/services/ClassFactory
>>>
>>>  at java.lang.Class.getDeclaredConstructors0(Native Method)
>>>
>>>  at java.lang.Class.privateGetDeclaredConstructors(Class.java:
>>> 2671)
>>>
>>>  at java.lang.Class.getConstructors(Class.java:1651)
>>>
>>>  at org.apache.tapestry5.ioc.internal.util.InternalUtils.findAut
>>> obuildConstructor(InternalUtils.java:562)
>>>
>>>  at org.apache.tapestry5.ioc.internal.ServiceBinderImpl.createSt
>>> andardConstructorBasedObjectCreatorSource(ServiceBinderImpl.java:146)
>>>
>>>  at org.apache.tapestry5.ioc.internal.ServiceBinderImpl.createOb
>>> jectCreatorSourceFromImplementationClass(ServiceBinderImpl.java:129)
>>>
>>>  at org.apache.tapestry5.ioc.internal.ServiceBinderImpl.flush(Se
>>> rviceBinderImpl.java:96)
>>>
>>>  at org.apache.tapestry5.ioc.internal.ServiceBinderImpl.finish(S
>>> erviceBinderImpl.java:84)
>>>
>>>  at org.apache.tapestry5.ioc.internal.DefaultModuleDefImpl.bind(
>>> DefaultModuleDefImpl.java:601)
>>>
>>>  at org.apache.tapestry5.ioc.internal.DefaultModuleDefImpl.>>
>>>> (DefaultModuleDefImpl.java:148)
>>>>
>>>  at org.apache.tapestry5.ioc.RegistryBuilder.add(RegistryBuilder
>>> .java:123)
>>>
>>>  at org.apache.tapestry5.ioc.RegistryBuilder.add(RegistryBuilder
>>> .java:161)
>>>
>>>  at org.apache.tapestry5.ioc.IOCUtilities.addModulesInList(IOCUt
>>> ilities.java:132)
>>>
>>>  at org.apache.tapestry5.ioc.IOCUtilities.addModulesInManifest(I
>>> OCUtilities.java:105)
>>>
>>>  at org.apache.tapestry5.ioc.IOCUtilities.addDefaultModules(IOCU
>>> tilities.java:76)
>>>
>>>  at org.apache.tapestry5.internal.TapestryAppInitializer.(
>>> TapestryAppInitializer.java:97)
>>>
>>>  at org.apache.tapestry5.TapestryFilter.init(TapestryFilter.java
>>> :95)
>>>
>>> at org.apache.catalina.core.ApplicationFilterConfig.getFilter(A
>>> pplicationFilterConfig.java:416)
>>>
>>>  at org.apache.catalina.core.StandardContext.filterStart(Standar
>>> dContext.java:3225)
>>>
>>>  at org.apache.catalina.core.StandardContext.start(StandardConte
>>> xt.java:3794)
>>>
>>> at org.jboss.as.web.deployment.WebDeploymentService.doStart(Web
>>> DeploymentService.java:163)
>>>
>>>  at org.jboss.as.web.deployment.WebDeploymentService.access$000(
>>> WebDeploymentService.java:61)
>>>
>>>  at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDe
>>> ploymentService.java:96)
>>>
>>>  at java.util.concurrent.Executors$RunnableAdapter.call(Executor
>>> s.java:511)
>>>
>>>  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>>>
>>>  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPool
>>> Executor.java:1142)
>>>

Re: ClassNotFoundException: org.apache.tapestry5.ioc.services.ClassFactory

2018-03-19 Thread Dmitry Gusev
Hi,

It can still be loaded if you have Tapestry 5.3 jars on classpath, make
sure to remove them.

On Mon, Mar 19, 2018 at 4:41 PM, Erich Gormann  wrote:

> Dear all,
>
> after migrating our application from tapestry 5.3.8 to Tapestry 5.4.3 I'm
> fighting with the exception shown in the stacktrace below.
>
> I'm aware that the ClassFactory is not present in Tapestry 5.4 anymore,
> but we do not use it explicetely. I wonder why our application should try
> to load it.
>
> Can it be loaded reflexive by another API?
>
> Any hints are welcome! Thanks in advance.
>
> Greetings, Erich
>
>
> ERROR 13:59:41,916 (ServerService Thread Pool -- 112)
> (StandardContext.java:filterStart:3228) -JBWEB000284: Exception starting
> filter tapestryFilter: java.lang.NoClassDefFoundError:
> org/apache/tapestry5/ioc/services/ClassFactory
>
> at java.lang.Class.getDeclaredConstructors0(Native Method)
>
> at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
>
> at java.lang.Class.getConstructors(Class.java:1651)
>
> at org.apache.tapestry5.ioc.internal.util.InternalUtils.findAut
> obuildConstructor(InternalUtils.java:562)
>
> at org.apache.tapestry5.ioc.internal.ServiceBinderImpl.createSt
> andardConstructorBasedObjectCreatorSource(ServiceBinderImpl.java:146)
>
> at org.apache.tapestry5.ioc.internal.ServiceBinderImpl.createOb
> jectCreatorSourceFromImplementationClass(ServiceBinderImpl.java:129)
>
> at org.apache.tapestry5.ioc.internal.ServiceBinderImpl.flush(Se
> rviceBinderImpl.java:96)
>
> at org.apache.tapestry5.ioc.internal.ServiceBinderImpl.finish(S
> erviceBinderImpl.java:84)
>
> at org.apache.tapestry5.ioc.internal.DefaultModuleDefImpl.bind(
> DefaultModuleDefImpl.java:601)
>
> at org.apache.tapestry5.ioc.internal.DefaultModuleDefImpl. >(DefaultModuleDefImpl.java:148)
>
> at org.apache.tapestry5.ioc.RegistryBuilder.add(RegistryBuilder
> .java:123)
>
> at org.apache.tapestry5.ioc.RegistryBuilder.add(RegistryBuilder
> .java:161)
>
> at org.apache.tapestry5.ioc.IOCUtilities.addModulesInList(IOCUt
> ilities.java:132)
>
> at org.apache.tapestry5.ioc.IOCUtilities.addModulesInManifest(I
> OCUtilities.java:105)
>
> at org.apache.tapestry5.ioc.IOCUtilities.addDefaultModules(IOCU
> tilities.java:76)
>
> at org.apache.tapestry5.internal.TapestryAppInitializer.(
> TapestryAppInitializer.java:97)
>
> at org.apache.tapestry5.TapestryFilter.init(TapestryFilter.java
> :95)
>
> at org.apache.catalina.core.ApplicationFilterConfig.getFilter(A
> pplicationFilterConfig.java:416)
>
> at org.apache.catalina.core.StandardContext.filterStart(Standar
> dContext.java:3225)
>
> at org.apache.catalina.core.StandardContext.start(StandardConte
> xt.java:3794)
>
> at org.jboss.as.web.deployment.WebDeploymentService.doStart(Web
> DeploymentService.java:163)
>
> at org.jboss.as.web.deployment.WebDeploymentService.access$000(
> WebDeploymentService.java:61)
>
> at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDe
> ploymentService.java:96)
>
> at java.util.concurrent.Executors$RunnableAdapter.call(Executor
> s.java:511)
>
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPool
> Executor.java:1142)
>
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo
> lExecutor.java:617)
>
> at java.lang.Thread.run(Thread.java:745)
>
> at org.jboss.threads.JBossThread.run(JBossThread.java:122)
>
> Caused by: java.lang.ClassNotFoundException:
> org.apache.tapestry5.ioc.services.ClassFactory from [Module
> "deployment.msp.war:main" from Service Module Loader]
>
> at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoa
> der.java:213)
>
> at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnch
> ecked(ConcurrentClassLoader.java:459)
>
> at org.jboss.modules.ConcurrentClassLoader.performLoadClassChec
> ked(ConcurrentClassLoader.java:408)
>
> at org.jboss.modules.ConcurrentClassLoader.performLoadClass(Con
> currentClassLoader.java:389)
>
> at org.jboss.modules.ConcurrentClassLoader.loadClass(Concurrent
> ClassLoader.java:134)
>
> ... 29 more
>
>
>
> -
> 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


Re: PDF rendering in background blocks other requests

2018-03-18 Thread Dmitry Gusev
Take a thread dump and see what other blocked requests are waiting for?

On Sunday, March 18, 2018, Ilya Obshadko  wrote:

> Hi everyone,
>
> I’m struggling to understand the cause of the following issue:
>
> - my Tapestry application generates certain PDF files using Apache FOP and
> Saxon
> - when PDF generator process is started, other requests to that instance
> are blocked until it’s finished
> - moving FOP processing to a new thread using ParallelExecutor.invoke()
> doesn’t seem to affect anything
>
> Any ideas why?
>
> I had a hypothesis that FOP processing actually blocks the whole thing
> because of AWT usage, but couldn’t find any confirmations yet.
>
> --
> Ilya Obshadko
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: [ANN] JumpStart 7 Released!

2018-01-12 Thread Dmitry Gusev
Thanks for the great job, Geoff!

On Thu, Jan 11, 2018 at 4:14 PM, JumpStart <
geoff.callender.jumpst...@gmail.com> wrote:

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




-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: problems with Tapestry 5.4.3+JPA and jetty plugin

2017-11-18 Thread Dmitry Gusev
LMGTFY: https://stackoverflow.com/a/2877355/2414933

On Sat, Nov 18, 2017 at 3:43 PM, Qbyte Consulting  wrote:

> Hi,
>
> I can run my app better with glassfish but get problems with the postgres
> driver.
>
> With Jetty I get this below, any ideas please?
>
> John
>
> [INFO] --- jetty-maven-plugin:9.2.0.M0:run (default-cli) @ AuditServices
> ---
> [INFO] Logging initialized @2422ms
> [INFO] Configuring Jetty for project: Audit Services
> [INFO] webAppSourceDirectory not set. Trying src\main\webapp
> [INFO] Reload Mechanic: automatic
> [INFO] Classes = D:\Temp\colemanj\workspace\AuditServices\target\classes
> [INFO] Context path = /
> [INFO] Tmp directory = D:\Temp\colemanj\workspace\AuditServices\target\tmp
> [INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
> [INFO] Web overrides =  none
> [INFO] web.xml file =
> file:/D:/Temp/colemanj/workspace/AuditServices/src/main/we
> bapp/WEB-INF/web.xml
> [INFO] Webapp directory =
> D:\Temp\colemanj\workspace\AuditServices\src\main\weba
> pp
> [INFO] jetty-9.2.0.M0
> [INFO] Warning: No org.apache.tomcat.JarScanner set in ServletContext.
> Falling b
> ack to default JarScanner implementation.
> SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
> SLF4J: Defaulting to no-operation (NOP) logger implementation
> SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further
> detail
> s.
> [WARNING] Failed startup of context o.e.j.m.p.JettyWebAppContext@e22d35
> {/AuditSe
> rvices,file:/D:/Temp/colemanj/workspace/AuditServices/src/
> main/webapp/,STARTING}
> {file:/D:/Temp/colemanj/workspace/AuditServices/src/main/webapp/}
> java.lang.RuntimeException: Error invoking service binder method
> epulse.audit.ma
> nager.services.AppModule.bind(ServiceBinder) (at AppModule.java:68): class
> "java
> x.persistence.TupleElement"'s signer information does not match signer
> informati
> on of other classes in the same package
> at
> org.apache.tapestry5.ioc.internal.DefaultModuleDefImpl.bind(DefaultMo
> duleDefImpl.java:624)
> at
> org.apache.tapestry5.ioc.internal.DefaultModuleDefImpl.(Default
> ModuleDefImpl.java:148)
> at
> org.apache.tapestry5.ioc.RegistryBuilder.add(RegistryBuilder.java:123
> )
> at
> org.apache.tapestry5.internal.TapestryAppInitializer.(TapestryA
> ppInitializer.java:115)
> at org.apache.tapestry5.TapestryFilter.init(
> TapestryFilter.java:95)
> at
> org.eclipse.jetty.servlet.FilterHolder.initialize(FilterHolder.java:1
> 37)
> at
> org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.ja
> va:817)
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Discussion: make duplicate contributions to services with ordered configurations an error

2017-10-27 Thread Dmitry Gusev
Hi Thiago,

I would expect this to throw an exception on application start.

I would also expected that `configuration.override` would fix this,
although it's not that clear what should happen if you're overriding a
contribution twice, say, in different modules.

Can we order the overrides somehow?

If so I'd expected the last override would win if ordered, if override
isn't ordered anyhow -- should fail with an error due to ambiguity. Not
sure if that's doable at the moment, so just theorising.

On Fri, Oct 27, 2017 at 4:40 PM, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> Hello!
>
> I've just stumbled again at https://issues.apache.org/
> jira/browse/TAP5-1305,
> which boiled down to Tapestry-IoC dropping a contribution to an ordered
> configuration if there's another contribution with the same id. I fixed it
> specifically for service decorators. For service configurations, it
> remained the same: the contribution is dropped with a warning in the log,
> but I think this is easy to overlook and can cause errors which are
> difficult to spot since you consider that all contributions.
>
> What do you think of making contributing two different values to an ordered
> configuration with the same id a show-stopping error?
>
> --
> Thiago
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: IoC Question

2017-10-05 Thread Dmitry Gusev
Hi,

By default services are singletons, which means all injections reference
the same object, so all your events will be available at every injection.

You can read about defining service scopes here:
http://tapestry.apache.org/defining-tapestry-ioc-services.html

On Thursday, October 5, 2017, Tyler Wilcock  wrote:

> Question about Tapestry's IoC system.  Let's pretend I register a service
> called EventTracker.java.  EventTracker has a private List field containing
> a list of Events, a method to add those events, and a method to retrieve
> those events.  Now let's say I have another class that @Inject's that
> EventTracker service and records a bunch of events.
>
> If I @Inject the EventTracker service into yet another class, can I read
> those events that the previous class added?  Or will it be an empty slate?
> Generally, my question is this: do services save their state in between
> injections in different classes?
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: tapestry background jobs in a clustered environment

2017-07-10 Thread Dmitry Gusev
Hey Barry,

you're talking about scheduled jobs. With scheduled jobs external trigger
may work well.

In our apps we're using embedded Quartz and anjlab-tapestry-quartz [1] for
scheduled jobs to do the same without external process like Jenkins. We've
implemented simple REST interface to get quartz runtime and trigger the
jobs, and a simple admin UI for that -- works good enough for our
use-cases. This is better than standalone Jenkins in some aspects, i.e. you
can configure your scheduled jobs from Java (using Tapestry IoC's
distributed configuration) and don't have to maintain Jenkins's home folder
separately.

But as I understood, Ilya was asking about messaging systems, where jobs
triggered not only by schedule, but by user actions or other events. In
this case common approach is to have a queue where you put your jobs and
have a set of workers that process these jobs somehow. Quartz or Jenkins
can be just another source/trigger for those jobs, i.e. by Jenkins trigger
in your page you create a job instance and send it to a queue where it gets
processed later.

[1]
https://github.com/anjlab/anjlab-tapestry-commons/tree/master/anjlab-tapestry-quartz

On Mon, Jul 10, 2017 at 2:28 PM, Barry Books  wrote:

> While it does create a separate process I run my batch jobs with Jenkins.
> The jobs are just pages so you don't have weird lifecycle problems and they
> are easy to test because you can just go to the page. Your load balancer
> will distribute the load, you get history and you don't need to write any
> code. Just drop the war file into your server.
>
> On Thu, Jun 29, 2017 at 1:18 AM, Ilya Obshadko 
> wrote:
>
> > Yes, my case is about the same logical queue. I currently don’t have any
> > abstraction for “units of work” or whatever you may call it - application
> > didn’t need it when it was running on a single machine. I’ll have to
> > introduce something similar to isolate jobs from actual business objects.
> >
> >
> > On Wed, Jun 28, 2017 at 11:24 PM, Dmitry Gusev 
> > wrote:
> >
> > > Not sure I understand where those pessimistic locks came from.
> > >
> > > In out case there's no locking at all, every machine in a cluster
> > processes
> > > jobs simultaneously, unless, of course, the jobs are not from the same
> > > logical queue and must be executed in order.
> > >
> > > By row-level locking I mean PostgreSQL's SELECT ... FOR UPDATE, i.e.:
> > >
> > > UPDATE units_of_work
> > > SET started_at = ?
> > > WHERE id = (SELECT id
> > > FROM units_of_work
> > > WHERE started_at IS NULL
> > > LIMIT 1
> > > FOR UPDATE)
> > > RETURNING id
> > >
> > > This is a simplified version of what's actually happening, but
> > illustrates
> > > the idea: different coordinators don't lock each other.
> > >
> > >
> > > On Wed, Jun 28, 2017 at 11:05 PM, Ilya Obshadko <
> ilya.obsha...@gmail.com
> > >
> > > wrote:
> > >
> > > > I was actually looking at Spring Batch (and a couple of other
> > > solutions). I
> > > > don’t think Spring Batch could be of much help here.
> > > >
> > > > My conclusion is similar to what you are saying - implementing
> > > lightweight
> > > > job coordinator is much easier.
> > > >
> > > > Row-level locking works well when you are dealing with a simple queue
> > > table
> > > > - you do a pessimistic lock on N rows, process them and give a chance
> > to
> > > > another host in the cluster. Unfortunately only one of my background
> > jobs
> > > > is suitable for this type of refactoring.
> > > >
> > > > Other jobs process records that shouldn’t be locked for a
> considerable
> > > > amount of time.
> > > >
> > > > So currently I’m thinking of the following scenario:
> > > >
> > > > - pass deployment ID via environment to all containers (ECS can do
> this
> > > > quite easily)
> > > > - use a simple table with records containing job name, current
> cluster
> > > > deployment ID and state
> > > > - first background executor that is able to lock an appropriate job
> row
> > > > starts working, the other(s) are cancelled
> > > >
> > > >
> > > >
> > > > On Tue, Jun 27, 2017 at 10:16 PM, Dmitry Gusev <
> dmitry.gu...@gmail.com
> > >
> > > > wrote:
> > > >
> > 

Re: tapestry background jobs in a clustered environment

2017-06-28 Thread Dmitry Gusev
Not sure I understand where those pessimistic locks came from.

In out case there's no locking at all, every machine in a cluster processes
jobs simultaneously, unless, of course, the jobs are not from the same
logical queue and must be executed in order.

By row-level locking I mean PostgreSQL's SELECT ... FOR UPDATE, i.e.:

UPDATE units_of_work
SET started_at = ?
WHERE id = (SELECT id
FROM units_of_work
WHERE started_at IS NULL
LIMIT 1
FOR UPDATE)
RETURNING id

This is a simplified version of what's actually happening, but illustrates
the idea: different coordinators don't lock each other.


On Wed, Jun 28, 2017 at 11:05 PM, Ilya Obshadko 
wrote:

> I was actually looking at Spring Batch (and a couple of other solutions). I
> don’t think Spring Batch could be of much help here.
>
> My conclusion is similar to what you are saying - implementing lightweight
> job coordinator is much easier.
>
> Row-level locking works well when you are dealing with a simple queue table
> - you do a pessimistic lock on N rows, process them and give a chance to
> another host in the cluster. Unfortunately only one of my background jobs
> is suitable for this type of refactoring.
>
> Other jobs process records that shouldn’t be locked for a considerable
> amount of time.
>
> So currently I’m thinking of the following scenario:
>
> - pass deployment ID via environment to all containers (ECS can do this
> quite easily)
> - use a simple table with records containing job name, current cluster
> deployment ID and state
> - first background executor that is able to lock an appropriate job row
> starts working, the other(s) are cancelled
>
>
>
> On Tue, Jun 27, 2017 at 10:16 PM, Dmitry Gusev 
> wrote:
>
> > Hi Ilya,
> >
> > If you have Spring in your classpath you may look at Spring Batch.
> >
> > For our projects we've built something similar -- a custom jobs framework
> > on top of PostgreSQL.
> >
> > The idea is that there a coordinator service (Tapestry service) that runs
> > in a thread pool and constantly polls special DB tables for new records.
> > For every new unit of work it creates instance of a worker (using
> > `ObjectLocator.autobuild()`) that's capable of processing the job.
> >
> > The polling can be optimised well for performance using row-level locks &
> > DB indexing.
> >
> > Coordinator runs in the same JVM as the rest of the app so there's no
> > dedicated process.
> > It integrates with tapestry's EntityManager so that you could create a
> job
> > in transaction.
> >
> > When running in a cluster every JVM has its own coordinator -- this it
> how
> > the jobs get distributed.
> >
> > But you're saying that row-level locking doesn't work for some of your
> > use-cases, can you be more concrete here?
> >
> >
> > On Tue, Jun 27, 2017 at 9:35 PM, Ilya Obshadko 
> > wrote:
> >
> > > I’ve recently expanded my Tapestry application to run multiple hosts.
> > While
> > > it’s quite OK for the web-faced part (sticky load balancer does most of
> > the
> > > job), it’s not very straightforward with background jobs.
> > >
> > > Some of them can be quite easily distributed using database row-level
> > > locks, but this doesn’t work for every use case I have.
> > >
> > > Are there any suggestions about this? I’d prefer not to have a
> dedicated
> > > process running background tasks. Ideally, I want to dynamically
> > distribute
> > > background jobs between hosts in cluster, based on current load status.
> > >
> > >
> > > --
> > > Ilya Obshadko
> > >
> >
> >
> >
> > --
> > Dmitry Gusev
> >
> > AnjLab Team
> > http://anjlab.com
> >
>
>
>
> --
> Ilya Obshadko
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: tapestry background jobs in a clustered environment

2017-06-27 Thread Dmitry Gusev
Hi Ilya,

If you have Spring in your classpath you may look at Spring Batch.

For our projects we've built something similar -- a custom jobs framework
on top of PostgreSQL.

The idea is that there a coordinator service (Tapestry service) that runs
in a thread pool and constantly polls special DB tables for new records.
For every new unit of work it creates instance of a worker (using
`ObjectLocator.autobuild()`) that's capable of processing the job.

The polling can be optimised well for performance using row-level locks &
DB indexing.

Coordinator runs in the same JVM as the rest of the app so there's no
dedicated process.
It integrates with tapestry's EntityManager so that you could create a job
in transaction.

When running in a cluster every JVM has its own coordinator -- this it how
the jobs get distributed.

But you're saying that row-level locking doesn't work for some of your
use-cases, can you be more concrete here?


On Tue, Jun 27, 2017 at 9:35 PM, Ilya Obshadko 
wrote:

> I’ve recently expanded my Tapestry application to run multiple hosts. While
> it’s quite OK for the web-faced part (sticky load balancer does most of the
> job), it’s not very straightforward with background jobs.
>
> Some of them can be quite easily distributed using database row-level
> locks, but this doesn’t work for every use case I have.
>
> Are there any suggestions about this? I’d prefer not to have a dedicated
> process running background tasks. Ideally, I want to dynamically distribute
> background jobs between hosts in cluster, based on current load status.
>
>
> --
> Ilya Obshadko
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Announcing Configuration Helpers for Tapestry5

2017-06-20 Thread Dmitry Gusev
Hello Tapestry users,

I'd like to share a small library that we use to manage & validate
configuration symbols for Tapestry5 application:

https://github.com/anjlab/anjlab-tapestry-commons/tree/master/anjlab-tapestry-config

README with some examples available by above link.

-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


users@tapestry.apache.org

2017-05-09 Thread Dmitry Gusev
e.tapestry5.ioc.internal.util.ConcurrentBarrier.withWrite(
> >>>> ConcurrentBarrier.java:139)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.ModuleImpl$2.invoke(
> >> ModuleImpl.java:215)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(
> >>>> ConcurrentBarrier.java:83)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.ModuleImpl.
> >> findOrCreate(ModuleImpl.java:
> >>>> 221)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.ModuleImpl.
> >> getService(ModuleImpl.java:
> >>>> 112)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.RegistryImpl.
> >>>> getService(RegistryImpl.java:497)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.ObjectLocatorImpl.
> >>>> getService(ObjectLocatorImpl.java:43)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.util.InternalUtils$
> >>>> 22.run(InternalUtils.java:1429)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.
> >>>> run(OperationTrackerImpl.java:56)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.run(
> >>>> PerThreadOperationTracker.java:60)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.RegistryImpl.run(
> >> RegistryImpl.java:1254)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.util.InternalUtils.
> >>>> extendPlanForInjectedFields(InternalUtils.java:1419)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.util.InternalUtils.
> >>>> access$200(InternalUtils.java:50)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.util.InternalUtils$
> >>>> 20.invoke(InternalUtils.java:1380)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.util.InternalUtils$
> >>>> 20.invoke(InternalUtils.java:1366)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.
> >>>> invoke(OperationTrackerImpl.java:82)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(
> >>>> PerThreadOperationTracker.java:72)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(
> >>>> RegistryImpl.java:1260)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.util.InternalUtils.
> >>>> createConstructorConstructionPlan(InternalUtils.java:1363)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.ConstructorServiceCreator.getPlan(
> >>>> ConstructorServiceCreator.java:52)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.ConstructorServiceCreator.
> >> createObject(
> >>>> ConstructorServiceCreator.java:62)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.ReloadableServiceImplementatio
> >>>> nObjectCreator.createInstance(ReloadableServiceImplementatio
> >>>> nObjectCreator.java:54)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.AbstractReloadableObjectCreato
> >>>> r$1.invoke(AbstractReloadableObjectCreator.java:136)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.
> >>>> invoke(OperationTrackerImpl.java:82)
> >>>> 2017-05-08 07:31:02 ERROR Registry:208 - Duplicate method
> name&signature
> >>>> in class file $Session_350f95bde0b5
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(
> >>>> PerThreadOperationTracker.java:72)
> >>>> 2017-05-08 07:31:02 ERROR Registry:209 - Operations trace:
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(
> >>>> RegistryImpl.java:1260)
> >>>> 2017-05-08 07:31:02 ERROR Registry:218 - [ 1] Reloading class
> >>>> dbla.dbla.controller.TraceImportController.
> >>>> 2017-05-08 07:31:02 ERROR Registry:218 - [ 2] Creating plan to
> >>>> instantiate dbla.dbla.controller.TraceImportController via public
> >>>> dbla.dbla.controller.TraceImportController()
> >>>> 2017-05-08 07:31:02 ERROR Registry:218 - [ 3] Calculating possible
> >>>> injection value for field
> >>>> dbla.dbla.controller.TraceImportController.hibernateSession
> >>>> (org.hibernate.Session)
> >>>> 2017-05-08 07:31:02 ERROR Registry:218 - [ 4] Creating proxy for
> service
> >>>> HibernateSession
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.AbstractReloadableObjectCreato
> >>>> r.createInstance(AbstractReloadableObjectCreator.java:129)
> >>>> at
> >>>> org.apache.tapestry5.ioc.internal.AbstractReloadableObjectCreato
> >>>> r.createObject(AbstractReloadableObjectCreator.java:121)
> >>>> at $ControllerInterface_350f95bde0af.delegate(Unknown Source)
> >>>> at $ControllerInterface_350f95bde0af.execute(Unknown Source)
> >>>> at $ControllerInterface_350f95bde0ad.execute(Unknown Source)
> >>>> at dbla.dbla.DbLogAnonymizer.main(DbLogAnonymizer.java:19)
> >>>>
> >>>>
> >>>> -
> >>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >>>> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>>>
> >>>>
> >>>
> >>>
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>
> >>
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


users@tapestry.apache.org

2017-05-09 Thread Dmitry Gusev
OperationTracker.run(
> PerThreadOperationTracker.java:60)
> at
> org.apache.tapestry5.ioc.internal.RegistryImpl.run(RegistryImpl.java:1254)
> at
> org.apache.tapestry5.ioc.internal.util.InternalUtils.
> extendPlanForInjectedFields(InternalUtils.java:1419)
> at
> org.apache.tapestry5.ioc.internal.util.InternalUtils.
> access$200(InternalUtils.java:50)
> at
> org.apache.tapestry5.ioc.internal.util.InternalUtils$
> 20.invoke(InternalUtils.java:1380)
> at
> org.apache.tapestry5.ioc.internal.util.InternalUtils$
> 20.invoke(InternalUtils.java:1366)
> at
> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.
> invoke(OperationTrackerImpl.java:82)
> at
> org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(
> PerThreadOperationTracker.java:72)
> at
> org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(
> RegistryImpl.java:1260)
> at
> org.apache.tapestry5.ioc.internal.util.InternalUtils.
> createConstructorConstructionPlan(InternalUtils.java:1363)
> at
> org.apache.tapestry5.ioc.internal.ConstructorServiceCreator.getPlan(
> ConstructorServiceCreator.java:52)
> at
> org.apache.tapestry5.ioc.internal.ConstructorServiceCreator.createObject(
> ConstructorServiceCreator.java:62)
> at
> org.apache.tapestry5.ioc.internal.ReloadableServiceImplementatio
> nObjectCreator.createInstance(ReloadableServiceImplementatio
> nObjectCreator.java:54)
> at
> org.apache.tapestry5.ioc.internal.AbstractReloadableObjectCreato
> r$1.invoke(AbstractReloadableObjectCreator.java:136)
> at
> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.
> invoke(OperationTrackerImpl.java:82)
> 2017-05-08 07:31:02 ERROR Registry:208 - Duplicate method name&signature
> in class file $Session_350f95bde0b5
> at
> org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(
> PerThreadOperationTracker.java:72)
> 2017-05-08 07:31:02 ERROR Registry:209 - Operations trace:
> at
> org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(
> RegistryImpl.java:1260)
> 2017-05-08 07:31:02 ERROR Registry:218 - [ 1] Reloading class
> dbla.dbla.controller.TraceImportController.
> 2017-05-08 07:31:02 ERROR Registry:218 - [ 2] Creating plan to
> instantiate dbla.dbla.controller.TraceImportController via public
> dbla.dbla.controller.TraceImportController()
> 2017-05-08 07:31:02 ERROR Registry:218 - [ 3] Calculating possible
> injection value for field
> dbla.dbla.controller.TraceImportController.hibernateSession
> (org.hibernate.Session)
> 2017-05-08 07:31:02 ERROR Registry:218 - [ 4] Creating proxy for service
> HibernateSession
> at
> org.apache.tapestry5.ioc.internal.AbstractReloadableObjectCreato
> r.createInstance(AbstractReloadableObjectCreator.java:129)
> at
> org.apache.tapestry5.ioc.internal.AbstractReloadableObjectCreato
> r.createObject(AbstractReloadableObjectCreator.java:121)
> at $ControllerInterface_350f95bde0af.delegate(Unknown Source)
> at $ControllerInterface_350f95bde0af.execute(Unknown Source)
> at $ControllerInterface_350f95bde0ad.execute(Unknown Source)
> at dbla.dbla.DbLogAnonymizer.main(DbLogAnonymizer.java:19)
>
>
> -
> 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


Re: JPA with pure hibernate

2017-01-18 Thread Dmitry Gusev
There must be a cause why the connection has failed, could be a typo in
JDBC url, username or password.

If you can copy full stack trace it may help.

On Wed, Jan 18, 2017 at 8:07 PM, Jochimsen, Janko <
janko.jochim...@urios-beratung.de> wrote:

> Hey Dmitry,
>
> thank you for your input and the direction.
>
> Sadly it doesn’t solves the problem but it seems we are getting closer.
>
> First of all there seems to be a ‘problem’ in your persistence.xml. The
> version you send me starts with
>
> 
> http://java.sun.com/xml/ns/persistence";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
> http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd";
> version="1.0">
>
> The last line make my eclipse complain and I googled the problem. It seems
> that the last line must read:
>  version="2.1">
> see: http://stackoverflow.com/questions/20818737/can-not-
> find-the-declaration-of-element-persistence
>
> The next problem is the
> orm.xml
>
> My eclipse complains that
> vc-complex-type.2.4.a: Invalid content was found starting with element
> 'mapping-file'. One of '{"http://xmlns.jcp.org/xml/ns/persistence
> ":shared-cache-
>  mode, "http://xmlns.jcp.org/xml/ns/persistence":validation-mode, "
> http://xmlns.jcp.org/xml/ns/persistence":properties}' is expected.
>
> I didn’t really found a solution for this problem at a first approach.
> Therefor I try to omit this line. If I do this and include the
>
> configurePersistenceUnitInfos(MappedConfiguration
> cfg)
>
> method. I still get another but more concrete error message.
>
>
> Now the output says:
>
> [INFO] util.LogHelper HHH000204: Processing PersistenceUnitInfo [
> name: DemoUnit
> ...]
> [INFO] hibernate.Version HHH000412: Hibernate Core {5.2.2.Final}
> [INFO] cfg.Environment HHH000206: hibernate.properties not found
> [INFO] cfg.Environment HHH21: Bytecode provider name : javassist
> [INFO] common.Version HCANN01: Hibernate Commons Annotations
> {5.0.1.Final}
> [WARN] internal.ConnectionProviderInitiator HHH000181: No appropriate
> connection provider encountered, assuming application will be supplying
> connections
> [WARN] internal.JdbcEnvironmentInitiator HHH000342: Could not obtain
> connection to query metadata : The application must supply JDBC connections
> [ERROR] ioc.Registry org.hibernate.service.spi.ServiceException: Unable
> to create requested service [org.hibernate.engine.jdbc.
> env.spi.JdbcEnvironment]
> [ERROR] ioc.Registry Operations trace:
> [ERROR] ioc.Registry [ 1] Invoking startup method org.apache.tapestry5.jpa.
> modules.JpaModule.startupEarly(EntityManagerManager, boolean).
> [ERROR] failed app
>
> The first lines suggest that now the setup seems to work. But then the the
> jdbc connection fails. Weird
>
> Thanks anyhow for the input.
>
>
>
> Janko
>
> -Ursprüngliche Nachricht-
> Von: Dmitry Gusev [mailto:dmitry.gu...@gmail.com]
> Gesendet: Mittwoch, 18. Januar 2017 13:39
> An: Tapestry users 
> Betreff: Re: JPA with pure hibernate
>
> Hey,
>
> tapestry-jpa supports latest Hibernate 5.x, at least we have it running in
> production with 5.2.5.Final You don't have to provide hibernate.cfg.xml,
> although the settings you have in your persistence.xml are not correct for
> 5.2.x Hibernate
>
> Here's a working persistence.xml that we use in our apps:
>
> 
> http://java.sun.com/xml/ns/persistence";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
> http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd";
> version="1.0">
>
> 
> org.hibernate.jpa.HibernatePersistenceProvider provider>
> true
> META-INF/orm.xml
> 
>  value="jdbc:postgresql://localhost/dbname"/>
>  value="username"/>
>  value="password"/>
> 
> 
>  value="org.hibernate.hikaricp.internal.HikariCPConnectionProvider"/>
> 
>  value="30" />
>  />
> 
>  value="org.postgresql.ds.PGSimpleDataSource" />
> 
> 
> 
>
> Above configuration uses HikariCP for connection pooling.
>
> Some relevant dependencies:
>
> compile ("org.hibernate:hibernate-core:5.2.5.Final") {
> exclude 

Re: JPA with pure hibernate

2017-01-18 Thread Dmitry Gusev
public static void configurePersistenceUnitInfos(
> MappedConfiguration cfg) {
>
>   PersistenceUnitConfigurer configurer = new
> PersistenceUnitConfigurer() {
>  public void configure(TapestryPersistenceUnitInfo
> unitInfo) {
> unitInfo.addManagedClass(User.class);
>  }
>  };
>  cfg.add("DemoUnit", configurer);
>}
>
> This crashes the App on start up  with the following Error Massage:
> org.apache.tapestry5.ioc.internal.OperationException: 
> javax.persistence.PersistenceException:
> [PersistenceUnit: DemoUnit] Unable to build EntityManagerFactory
>
> Deep down in the Exception Stack there
> Caused by: org.hibernate.HibernateException: Connection cannot be null
> when 'hibernate.dialect' not set
>
> This is all not really helpful at least to me.
>
>
> If I omit the statement  configurePersistenceUnitInfos ...
>
> The App starts. But as soon as it calls the entityManager in the following
> class via add(User user);
> public class UserDAOImpl implements UserDAO
> {
> @PersistenceContext(unitName = "DemoUnit")
>  private EntityManager entityManager;
>
> @Override
> @PersistenceContext(unitName = "DemoUnit")
> public void add(final User user)
> {
> entityManager.persist(user);
> }
>
> @Override
> @SuppressWarnings(
> { "unchecked" })
> public List findAll()
> {
> return entityManager.createQuery("select u from User u order by
> u.id desc").getResultList();
> }
>
> @Override
> public void delete(final User... users)
> {
> for (final User user : users)
> entityManager.remove(user);
> }
>
> @Override
> public void deleteAll()
> {
> for (final User u : findAll())
> {
> entityManager.remove(u);
> }
> }
> }
>
> I get the error message:
>
> Unable to locate a single EntityManager. You must provide ...
>
>
> From the comments and other posts it is clear that the documentation is
> outdated and not really working. But there seems to be no really helpful
> alternative. I would be very grateful if someone could give me a hint where
> to look or explain to me what is going on here.
>
>
> Cheers
>
> Janko
>
>
>
>
>
>
>
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Logical Page Name Shortening

2016-08-24 Thread Dmitry Gusev
Looking at code I don't think this is something you can configure easily
with a symbol.

If you really need to change page URLs you may use one of the URL rewriting
techniques, i.e.:

https://tapestry.apache.org/url-rewriting.html
http://www.tynamo.org/tapestry-routing+guide/


On Wed, Aug 24, 2016 at 6:26 PM, Lherm Nicolas  wrote:

> Okay I understand this.
>
>
> However , would it posssible to keep the name without the "cut" by
> Tapestry .
>
>
> I mean create a page like address / CreateAddress and have the url ending
> with CreateAdress ?
>
>
> ____
> De : Dmitry Gusev 
> Envoyé : mercredi 24 août 2016 17:18:49
> À : Tapestry users
> Objet : Re: Logical Page Name Shortening
>
> To make URLs shorter/prettier, so you could name your java classes & TMLs
> differently, i.e.:
>
> address/CreateAddress => address/create
> user/CreateUser => user/create
>
> Without this feature your URLs would be address/createaddress and
> user/createuser, or you would have to name your pages the same but put them
> to different packages, which may be not convenient when you want to lookup
> a class by its name or when you want to import one user.Create to
> address.Create -- in java you'd have to use fully qualified names.
>
> On Wed, Aug 24, 2016 at 6:12 PM, Lherm Nicolas  wrote:
>
> > Hi,
> >
> >
> > Yes I saw it, but I don't understand why tapestry removed the suffix.
> >
> > 
> > De : Dmitry Gusev 
> > Envoyé : mercredi 24 août 2016 16:54:46
> > À : Tapestry users
> > Objet : Re: Logical Page Name Shortening
> >
> > Hi, have you seen this?
> >
> > http://tapestry.apache.org/page-navigation.html
> >
> > On Wed, Aug 24, 2016 at 5:38 PM, Lherm Nicolas  wrote:
> >
> > > Hello,
> > >
> > >
> > > I have a question about the shortheneng URL's of somes page names.
> > >
> > >
> > > I read that Tapestry removed the redundant suffix of the URL in
> certains
> > > cases, and and wanna know why or where do they do this ?
> > >
> > >
> > > Thanks
> > >
> > >
> >
> >
> > --
> > Dmitry Gusev
> >
> > AnjLab Team
> > http://anjlab.com
> >
>
>
>
> --
> Dmitry Gusev
>
> AnjLab Team
> http://anjlab.com
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Logical Page Name Shortening

2016-08-24 Thread Dmitry Gusev
To make URLs shorter/prettier, so you could name your java classes & TMLs
differently, i.e.:

address/CreateAddress => address/create
user/CreateUser => user/create

Without this feature your URLs would be address/createaddress and
user/createuser, or you would have to name your pages the same but put them
to different packages, which may be not convenient when you want to lookup
a class by its name or when you want to import one user.Create to
address.Create -- in java you'd have to use fully qualified names.

On Wed, Aug 24, 2016 at 6:12 PM, Lherm Nicolas  wrote:

> Hi,
>
>
> Yes I saw it, but I don't understand why tapestry removed the suffix.
>
> ________
> De : Dmitry Gusev 
> Envoyé : mercredi 24 août 2016 16:54:46
> À : Tapestry users
> Objet : Re: Logical Page Name Shortening
>
> Hi, have you seen this?
>
> http://tapestry.apache.org/page-navigation.html
>
> On Wed, Aug 24, 2016 at 5:38 PM, Lherm Nicolas  wrote:
>
> > Hello,
> >
> >
> > I have a question about the shortheneng URL's of somes page names.
> >
> >
> > I read that Tapestry removed the redundant suffix of the URL in certains
> > cases, and and wanna know why or where do they do this ?
> >
> >
> > Thanks
> >
> >
>
>
> --
> Dmitry Gusev
>
> AnjLab Team
> http://anjlab.com
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Logical Page Name Shortening

2016-08-24 Thread Dmitry Gusev
Hi, have you seen this?

http://tapestry.apache.org/page-navigation.html

On Wed, Aug 24, 2016 at 5:38 PM, Lherm Nicolas  wrote:

> Hello,
>
>
> I have a question about the shortheneng URL's of somes page names.
>
>
> I read that Tapestry removed the redundant suffix of the URL in certains
> cases, and and wanna know why or where do they do this ?
>
>
> Thanks
>
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: FW: Null pointer on sort with 5.3.8 that didn't occur with 5.3.7

2016-06-29 Thread Dmitry Gusev
Just a correction, that t:add is not just unnecessary, but it will be
ignored if you specify the beanModel explicitly:


> A comma-seperated list of property names to be added to the
> org.apache.tapestry5.beaneditor.BeanModel. Cells for added columns will be
> blank unless a cell override is provided. This parameter is only used when
> a default model is created automatically.



http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html




On Wed, Jun 29, 2016 at 5:57 PM, Chris Poulsen 
wrote:

> I'm guessing that something in the sorting part attempts to pull out the
> value from your passed data source (possibly coerced from a collection).
>
> The thing is that your data source does not contain the property (as it is
> synthetic) and you do not really pull the value from the data source ever,
> but from the "getMyColumn3" getter instead. The sorting stuff that attempts
> to extract the value for comparison has no way of knowing how to retrieve
> the value as the conduit is null.
>
> In order to provide the grid with the means to extract the value for
> "myColumn3" you should provide a conduit (can be done by creating a
> BeanModel and adding your column(s) with proper conduits. Judging from your
> example you can specify the data type as text (or string or what ever it is
> called in DataTypeConstants).
>
> Then the override (p:myColumn3Cell) and the t:add="." is not
> necessary.. You can keep the override if you need to.
>
> --
> Chris
>
> On Wed, Jun 29, 2016 at 12:04 PM, Davide Vecchi  wrote:
>
> > I changed my plan of finding out what causes this difference between
> 5.3.7
> > and 5.3.8. Instead I will go with some re-design, using some suggestions
> I
> > got here.
> >
> > However I am still very interested in knowing whether my way of defining
> > these t:add columns (pasted below) in general has something wrong or not
> so
> > right or not Tapestry-friendly. If it does, I might try to rectify that
> to
> > see if that helps.
> >
> > The column is defined like this:
> >
> > - In the page template, one param of the grid tag is
> >
> > t:add="prop:gridAdd"
> >
> > - In the page Java code, there is the corresponding
> >
> > public String getGridAdd() {
> > return " myColumn1, myColumn2, myColumn3, myColumn4";
> > }
> >
> >   where let's say that "myColumn3" is the column whose sorting fails.
> >
> > - In the page template, within the t:grid tag there is the definition of
> > the customized content of that column:
> >
> > ${ myColumn3}
> >
> > - In the page Java code, there is the method returning the value for that
> > column:
> >
> > public String getMyColumn3()
> > {
> >     return aStringThatIsNeverNull;
> > }
> >
> > Thanks in advance for any possible feedback or hint or any related
> thought.
> >
> > -
> > 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


Re: Dynamic Security Role Value - Tynamo Security

2016-06-29 Thread Dmitry Gusev
Just specify the prop: binding prefix explicitly, i.e.:

role="prop:dynamicRoles"

This parameter just uses literal: binding prefix by default.

Also make sure you read this:
http://tapestry.apache.org/component-parameters.html#ComponentParameters-BindingExpressions

On Wednesday, June 29, 2016, Matthew Bush <
matthew.b...@jetinteractive.com.au> wrote:

> I want to dynamically set required roles at runtime dynamically rather
> than have them statically coded.  Is this possible?
>
> Taken from the tynamo-security page (
> http://www.tynamo.org/tapestry-security+guide/ <
> http://www.tynamo.org/tapestry-security+guide/>)
>
> 
>   delete user
> 
> What I would like to be able to do is set the required role or role list
> based on a bound parameter, is that possible?
>
> Example syntax -
>
> 
>   delete user
> 
>
>
> Cheers,
> Matthew Bush
>
>
>

-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Canceling Periodic Job

2016-06-17 Thread Dmitry Gusev
We use quartz for background jobs:

https://github.com/anjlab/anjlab-tapestry-commons/tree/master/anjlab-tapestry-quartz

There you have fine control on both scheduled and currently executing jobs,
i.e. scheduler.getCurrenlyExecutingJobs() and then
scheduler.interrupt(jobKey)


On Fri, Jun 17, 2016 at 2:54 PM, Barry Books  wrote:

> see
>
>
> https://github.com/trsvax/Jacquard/blob/master/src/main/java/com/trsvax/jacquard/services/JobRunnerTapestry.java
>
>
> https://github.com/trsvax/Jacquard/blob/master/src/main/java/com/trsvax/jacquard/pages/job/JobIndex.java
>
> Jobs are started in the JobRunnerTapestry service and the set of jobs is
> made available via getJobs(). I have not implemented cancel but I think all
> that's needed would be to call the cancel method on the job
>
> On Friday, June 17, 2016, abangkis  wrote:
>
> > Hai, I'm creating a periodic job on startup from this link.
> >
> >
> >
> http://blog.tapestry5.de/index.php/2011/09/18/scheduling-jobs-with-tapestry/
> >
> > So i wonder how can i stop the job using a button? Since the periodic job
> > is created on startup so the returned PeriodicJob is inaccessible from a
> > page?
> >
> > --
> > http://www.mreunionlabs.net/ <http://www.mreunion-labs.net/>
> > twitter : @mreunionlabs @abangkis
> > page : https://plus.google.com/104168782385184990771
> >
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Informal Parameter

2016-06-10 Thread Dmitry Gusev
Hi,

if some component doesn't support informal parameters then there's no place
in UI where they could be rendered, and you won't have them in resulting
DOM. So you need to either: add @SupportInformalParameters to a component
if this is your component and render them using
ComponentResources#renderInformalParameters(MarkupWriter); or create a
mixin that would accept the parameters you're passing and that mixin would
be responsible for modifying DOM with these parameters.

On Fri, Jun 10, 2016 at 5:06 PM, Lherm Nicolas  wrote:

> Hello,
>
>
> I've this exception in my application :
>
>
> Binding parameter %s as an informal parameter does not make sense, as %s
> does not support informal parameters
>
>
> How can I resolve it without using @SupportInformalParameters ?
>
>
> Thanks
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Calling method after CommitAfter call

2016-02-26 Thread Dmitry Gusev
Hi,

The tapestry-jpa-transactions module doesn't use any JPA interceptors, its
before/after commit hooks are implemented in the same advice that opens and
commits transactions for @CommitAfter. In theory you could do the same for
Hibernate too.

But in your case you could extract business logic that deals with
applicationDao to another service's method, put @CommitAfter annotation on
that method, and you're done, i.e.:

public void onFormSubmit(Object observable, Object o)
{
Application application = (Application) o;
applicationService.updateUser(application, user);

// transaction will be committed here
publisher.sendApplicationSubmittedMessage(
user.getId(), application.getId());
}

public interface ApplicationService
{
@CommitAfter
void updateUser(Application application, User user);
}

On Fri, Feb 26, 2016 at 1:54 PM, g kuczera  wrote:

> Thanks for the comprehensive answer. Right now I am testing the
> HibernateSessionManager usage.
> I added it as the field in my page:
>   @Inject
>   private HibernateSessionManager hibernateSessionManager;
>
> and then I commit it in the onFormSubmit method:
>
>   public void onFormSubmit(Object observable, Object o) {
> Application application = (Application) o;
> application.setUser(user);
> applicationDao.save(application);
> hibernateSessionManager.commit();
>
> publisher.sendApplicationSubmittedMessage(user.getId(),
> application.getId());
>   }
>
> But I feel quite ashamed of this solution. It's like forcing the inner
> mechanism of Tapestry's Hibernate Wrapper (or even the Hibernate by itself,
> it's flow) to commit the thing before it is appropriate.
>
> However switching from Hibernate to JPA is not an option for me and
> Interceptors, if I understand them well, seems like an overhead.
>
> 2016-02-25 15:52 GMT+01:00 Thiago H de Paula Figueiredo <
> thiag...@gmail.com>
> :
>
> > On Thu, 25 Feb 2016 11:30:44 -0300, g kuczera 
> wrote:
> >
> > In the end I gave up implementing the JPA, because I do not want to mix
> >> these two different approaches (Hibernate sessions and JPA).
> >>
> >
> > The suggestion would be using JPA instead of Hibernate, not mixing them.
> >
> > So I have one questions: where do I find the HibernateSessionManager
> >> implementation?
> >>
> >
> >
> >
> https://github.com/apache/tapestry5/blob/master/tapestry-hibernate-core/src/main/java/org/apache/tapestry5/internal/hibernate/HibernateSessionManagerImpl.java
> >
> > It looks that I can't use regular
> >> session.getTransaction().commit() becase it gives me *Transaction not
> >> successfully started *error.
> >>
> >
> > In this case, you should start the transaction manually, just as you
> > commit it manually.
> >
> > I have been reading about these (hibernate and tapestry) machanisms and
> it
> >> looks that every thread has it's own session, which is being managed by
> >> HibernateSessionManager. I am not pretty sure how to obtain that
> manager,
> >> to safely commit the transaction.
> >>
> >
> > It's a Tapestry-IoC service, so you can @Inject it in your pages or have
> > it automatically injected into your services' constructors.
> >
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Tapestry, Java and Hibernate consultant and developer
> > http://machina.com.br
> >
> > -
> > 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


Re: Commit After not working after migrating to IntelliJ

2016-02-04 Thread Dmitry Gusev
Hi,

I think you're missing the transaction advice, it's mentioned at the bottom
on this page:
https://tapestry.apache.org/hibernate-user-guide.html

Finally, you should use the HibernateTransactionAdvisor to add transaction
advice:
@Match("*DAO")
public static void adviseTransactions(HibernateTransactionAdvisor advisor,
MethodAdviceReceiver receiver)
{
advisor.addTransactionCommitAdvice(receiver);
}

This advice method is configured to match against any service whose id ends
with "DAO", such as "PersonDAO".

The advisor scans the service interface and identifies any methods with the
@CommitAfter annotation.

On Thu, Feb 4, 2016 at 4:03 PM, abangkis  wrote:

> I managed to setup and import the simple project to github if anyone have
> the time to look at it. https://github.com/abangkis/CommitTest. First time
> using git, let me know if something is missing.
>
> Thanks
>
> On Thu, Feb 4, 2016 at 5:53 AM, abangkis  wrote:
>
> > Hello, I've just recently migrated from Eclipse + Ant + Tomcat to
> IntelliJ
> > IDEA 15 CE + Gradle + Jetty. At first all of my development setup is
> > working fine and then I realized that my @CommitAfter annotation is not
> > being honored, while other query runs fine. I'm using Tapestry 5.4.0 from
> > jcenter.
> >
> > To confirm my problem, I created a simple project with a single page with
> > an add method:
> >
> > @CommitAfter
> > public void onActionFromAdd(){
> > logger.debug("trying add with commit after");
> >
> > User user = new User();
> > user.setPassword("");
> > user.setName("testing user 3");
> >
> > userManager.add(user);
> > //try {
> > //manager.commit();
> > //} catch (Exception e) {
> > //e.printStackTrace();
> > //}
> >
> > }
> >
> >
> > If i manually commit using Injected HibernateSessionManager in the page,
> > it will work. But using @CommitAfter annotation isn't. Anybody know why
> is
> > this happening?
> >
> > Thanks
> >
> > --
> > http://www.mreunionlabs.net/ <http://www.mreunion-labs.net/>
> > twitter : @mreunionlabs @abangkis
> > page : https://plus.google.com/104168782385184990771
> >
>
>
>
> --
> http://www.mreunionlabs.net/ <http://www.mreunion-labs.net/>
> twitter : @mreunionlabs @abangkis
> page : https://plus.google.com/104168782385184990771
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


New release of Eclipse Tapestry Plugin available for download

2016-01-23 Thread Dmitry Gusev
Hi Tapestry users,

Two major features in new 2.13.x release:

- Customizable templates
   https://github.com/anjlab/eclipse-tapestry5-plugin#edit-templates

- File naming conventions when creating new files

https://github.com/anjlab/eclipse-tapestry5-plugin#file-naming-conventions

There are some other advanced options that may be helpful for those who
have complex runtime configurations:
https://github.com/anjlab/eclipse-tapestry5-plugin#advanced-configuration


Installation instructions:
https://github.com/anjlab/eclipse-tapestry5-plugin#install


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: New release of Eclipse Tapestry Plugin available for download

2015-09-03 Thread Dmitry Gusev
Hi Diego,

it's hard to tell what could go wrong from this description.

We can chat about it in the #tapestry IRC channel on irc.freenode.net if
you want.

On Thu, Sep 3, 2015 at 11:10 PM, Diego Socaceti  wrote:

> Hi Dmitry,
>
> there are no errors in the Error Log.
>
> I've tried
> - it with a new workspace
> - it with HTML and XML editor of eclipse. For both i get
> the message 'content assistant not available at the current location' in
> the status bar
>
> Kind regards
>
> On Fri, Aug 28, 2015 at 3:20 PM, Dmitry Gusev 
> wrote:
>
> > Hi Diego!
> >
> > Maybe you have any errors in Error Log view?
> > (Window -> Show View -> Error Log)
> >
> >
> > On Fri, Aug 28, 2015 at 3:03 PM, Diego Socaceti 
> > wrote:
> >
> > > Hi Dmitry,
> > >
> > > i just installed it for the 1st time, but there are two features with
> > > aren't working for me
> > > 1. Jump to Definition in tml files
> > > 2. Completion Proposals in tml files
> > >
> > > Any idea, what i did wrong?
> > >
> > >
> > > Kind regards
> > > Diego
> > >
> > >
> > > On Fri, Aug 28, 2015 at 1:59 PM, Bob Harner 
> wrote:
> > >
> > > > Nice! Thanks for all these improvements, Dmitry!
> > > > On Aug 26, 2015 7:52 AM, "Dmitry Gusev" 
> > wrote:
> > > >
> > > > > Hi Tapestry users,
> > > > >
> > > > > New release (only tested in Eclipse Mars) available for download
> now:
> > > > >
> > > > > https://github.com/anjlab/eclipse-tapestry5-plugin#install
> > > > >
> > > > > It includes:
> > > > >
> > > > >  - Performance improvements on big projects.
> > > > >
> > > > >It should work faster, cache more aggressively and should stop
> > > > hammering
> > > > > your Eclipse with analyzing project configuration when you have
> build
> > > > > errors.
> > > > >
> > > > >  - Tapestry Context view & Quick Switch popup now support
> > > service/module
> > > > > configurations:
> > > > >
> > > > >With this feature it's possible to inspect service's advisors,
> > > > > contributions, decorations, implementors, markers etc. for
> currently
> > > > > selected service/module. I.e. you can see who contributes to every
> > > > tapestry
> > > > > service & quickly navigate to declarations of these contributions.
> > > > >
> > > > >  - Quick Switch popup provides filtering & quick navigation through
> > > > current
> > > > > tapestry context, similar to CMD+O for quick java outline
> > > > >
> > > > >  - New feature "Quick Navigation within Tapestry Project Outline"
> is
> > > > > similar to Quick Switch popup, but provides filtering & navigation
> > > within
> > > > > project outline. This may still need some performance
> optimizations,
> > > but
> > > > > it's quite usable when you need a quick introspection/search within
> > > your
> > > > > project configuration.
> > > > >
> > > > >There's a new shortcut for this feature: CMD+Shift+;
> > > > >
> > > > >
> > > > > Give it a try & share your feedback.
> > > > >
> > > > > --
> > > > > Dmitry Gusev
> > > > >
> > > > > AnjLab Team
> > > > > http://anjlab.com
> > > > >
> > > >
> > >
> >
> >
> >
> > --
> > Dmitry Gusev
> >
> > AnjLab Team
> > http://anjlab.com
> >
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: New release of Eclipse Tapestry Plugin available for download

2015-08-28 Thread Dmitry Gusev
Hi Diego!

Maybe you have any errors in Error Log view?
(Window -> Show View -> Error Log)


On Fri, Aug 28, 2015 at 3:03 PM, Diego Socaceti  wrote:

> Hi Dmitry,
>
> i just installed it for the 1st time, but there are two features with
> aren't working for me
> 1. Jump to Definition in tml files
> 2. Completion Proposals in tml files
>
> Any idea, what i did wrong?
>
>
> Kind regards
> Diego
>
>
> On Fri, Aug 28, 2015 at 1:59 PM, Bob Harner  wrote:
>
> > Nice! Thanks for all these improvements, Dmitry!
> > On Aug 26, 2015 7:52 AM, "Dmitry Gusev"  wrote:
> >
> > > Hi Tapestry users,
> > >
> > > New release (only tested in Eclipse Mars) available for download now:
> > >
> > > https://github.com/anjlab/eclipse-tapestry5-plugin#install
> > >
> > > It includes:
> > >
> > >  - Performance improvements on big projects.
> > >
> > >It should work faster, cache more aggressively and should stop
> > hammering
> > > your Eclipse with analyzing project configuration when you have build
> > > errors.
> > >
> > >  - Tapestry Context view & Quick Switch popup now support
> service/module
> > > configurations:
> > >
> > >With this feature it's possible to inspect service's advisors,
> > > contributions, decorations, implementors, markers etc. for currently
> > > selected service/module. I.e. you can see who contributes to every
> > tapestry
> > > service & quickly navigate to declarations of these contributions.
> > >
> > >  - Quick Switch popup provides filtering & quick navigation through
> > current
> > > tapestry context, similar to CMD+O for quick java outline
> > >
> > >  - New feature "Quick Navigation within Tapestry Project Outline" is
> > > similar to Quick Switch popup, but provides filtering & navigation
> within
> > > project outline. This may still need some performance optimizations,
> but
> > > it's quite usable when you need a quick introspection/search within
> your
> > > project configuration.
> > >
> > >There's a new shortcut for this feature: CMD+Shift+;
> > >
> > >
> > > Give it a try & share your feedback.
> > >
> > > --
> > > Dmitry Gusev
> > >
> > > AnjLab Team
> > > http://anjlab.com
> > >
> >
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


New release of Eclipse Tapestry Plugin available for download

2015-08-26 Thread Dmitry Gusev
Hi Tapestry users,

New release (only tested in Eclipse Mars) available for download now:

https://github.com/anjlab/eclipse-tapestry5-plugin#install

It includes:

 - Performance improvements on big projects.

   It should work faster, cache more aggressively and should stop hammering
your Eclipse with analyzing project configuration when you have build
errors.

 - Tapestry Context view & Quick Switch popup now support service/module
configurations:

   With this feature it's possible to inspect service's advisors,
contributions, decorations, implementors, markers etc. for currently
selected service/module. I.e. you can see who contributes to every tapestry
service & quickly navigate to declarations of these contributions.

 - Quick Switch popup provides filtering & quick navigation through current
tapestry context, similar to CMD+O for quick java outline

 - New feature "Quick Navigation within Tapestry Project Outline" is
similar to Quick Switch popup, but provides filtering & navigation within
project outline. This may still need some performance optimizations, but
it's quite usable when you need a quick introspection/search within your
project configuration.

   There's a new shortcut for this feature: CMD+Shift+;


Give it a try & share your feedback.

-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Running tapestry app using embedded container in production

2015-07-28 Thread Dmitry Gusev
Hi Barry,

we use slf4j/logback passing
"-Dlogback.configurationFile=/path/to/config.xml" to JVM that's picked up
by tomcat
logback.xml sources shared app.properties file to get values for
configuring appenders, smth like this:

http://stackoverflow.com/questions/11105652/how-do-i-make-logback-read-a-properties-file-which-name-is-a-variable

We're using Sentry to collect errors, and file appender for the rest.

Don't know what logging Jenkins uses, but I suspect that you may override
its logging to use slf4j by placing slf4j bridges to shared classpath:
http://www.slf4j.org/legacy.html



On Tue, Jul 28, 2015 at 3:04 PM, Barry Books  wrote:

> How do you handle logging configuration? At first I used different
> log4j.properties files and specified which one to use on the command line
> but now I often deploy Jenkins in the same Tomcat so I switched to messing
> with the class path to get the right properties file. Neither solution is
> ideal. Anyone come up with anything else?
>
>
>
> On Tuesday, July 28, 2015, Dmitry Gusev  wrote:
>
> > Got it, thank you.
> >
> > This is exactly how we do it currently with standalone tomcat, with one
> > difference -- we implemented our own symbol resolution strategy to get
> > symbols from an external file, instead of passing them all through
> command
> > line.
> >
> > I was just curios if somebody created some tapestry module with
> predefined
> > set of tapestry symbols that would start & configure container for us.
> > This way we could still be able to override some symbols when needed as
> we
> > usually do in tapestry.
> >
> >
> >
> > On Tue, Jul 28, 2015 at 2:11 PM, Thilo Tanner  > >
> > wrote:
> >
> > > Hi Dmitry,
> > >
> > > In our case, yes we hardcode and commit those credentials to our
> > > repositories. In my defense, we host all our code in-house and have
> > various
> > > other security measures in place. Database credentials are normally
> > > different from client host to client host and therefore such
> credentials
> > > are normally useless unless you also have access to this particular
> host.
> > >
> > > If you prefer to set your credentials directly on your host, use
> symbols
> > > (as described in the previous email) and make sure to correctly unset
> the
> > > shell environment variables after application startup. You could do
> > > something like this in your startup script:
> > >
> > > java -Dmyapp.db.username=DB_USERNAME -Dmyapp.db.password=DB_PASSWORD
> -jar
> > > myapp.jar
> > >
> > > where myapp.db.username and myapp.db.password are user-defined T5
> > symbols.
> > >
> > > Using such a strategy, you can avoid committing your credentials.
> > >
> > > Best,
> > > Thilo
> > >
> > > --
> > > Thilo Tanner
> > > Technology Lead
> > >
> > > Direct +41 43 300 54 42
> > > Mobile +41 79 506 46 36
> > > thilo.tan...@reprisk.com 
> > >
> > > RepRisk AG, Stampfenbachstrasse 42, 8006 Zurich, Switzerland
> > > Tel. +41 43 300 54 40, Fax +41 43 300 54 46
> > > www.reprisk.com
> > >
> > > Follow us on Facebook or Twitter:
> > > www.facebook.com/RepRisk | www.twitter.com/RepRisk
> > >
> > > If you are not the intended recipient, please notify the sender - thank
> > > you.
> > >
> > >
> > >
> > >
> > >
> > >
> > > Am 28.07.15 12:54 schrieb "Dmitry Gusev" unter  > >:
> > >
> > > >Hi Thilo,
> > > >
> > > >So you're hardcoding all your staging/production settings in special
> > > >tapestry modules,
> > > >and committing them to the same source code repository as your app's
> > > >codebase, right?
> > > >
> > > >
> > > >On Tue, Jul 28, 2015 at 1:47 PM, Thilo Tanner <
> thilo.tan...@reprisk.com
> > >
> > > >wrote:
> > > >
> > > >> Hi Dmitry,
> > > >>
> > > >> To configure our apps, we mainly use what Tapestry offers
> > > out-of-the-box.
> > > >> I recommend to create a dedicated Tapestry module for each of your
> > > >> environments as described here:
> > > >>
> > >
> >
> http://tapestry.apache.org/configuration.html#Configuration-SettingExecutionModes
> > > >>
> > > >> In such a module, you can override your database setti

Re: Running tapestry app using embedded container in production

2015-07-28 Thread Dmitry Gusev
Got it, thank you.

This is exactly how we do it currently with standalone tomcat, with one
difference -- we implemented our own symbol resolution strategy to get
symbols from an external file, instead of passing them all through command
line.

I was just curios if somebody created some tapestry module with predefined
set of tapestry symbols that would start & configure container for us.
This way we could still be able to override some symbols when needed as we
usually do in tapestry.



On Tue, Jul 28, 2015 at 2:11 PM, Thilo Tanner 
wrote:

> Hi Dmitry,
>
> In our case, yes we hardcode and commit those credentials to our
> repositories. In my defense, we host all our code in-house and have various
> other security measures in place. Database credentials are normally
> different from client host to client host and therefore such credentials
> are normally useless unless you also have access to this particular host.
>
> If you prefer to set your credentials directly on your host, use symbols
> (as described in the previous email) and make sure to correctly unset the
> shell environment variables after application startup. You could do
> something like this in your startup script:
>
> java -Dmyapp.db.username=DB_USERNAME -Dmyapp.db.password=DB_PASSWORD -jar
> myapp.jar
>
> where myapp.db.username and myapp.db.password are user-defined T5 symbols.
>
> Using such a strategy, you can avoid committing your credentials.
>
> Best,
> Thilo
>
> --
> Thilo Tanner
> Technology Lead
>
> Direct +41 43 300 54 42
> Mobile +41 79 506 46 36
> thilo.tan...@reprisk.com
>
> RepRisk AG, Stampfenbachstrasse 42, 8006 Zurich, Switzerland
> Tel. +41 43 300 54 40, Fax +41 43 300 54 46
> www.reprisk.com
>
> Follow us on Facebook or Twitter:
> www.facebook.com/RepRisk | www.twitter.com/RepRisk
>
> If you are not the intended recipient, please notify the sender - thank
> you.
>
>
>
>
>
>
> Am 28.07.15 12:54 schrieb "Dmitry Gusev" unter :
>
> >Hi Thilo,
> >
> >So you're hardcoding all your staging/production settings in special
> >tapestry modules,
> >and committing them to the same source code repository as your app's
> >codebase, right?
> >
> >
> >On Tue, Jul 28, 2015 at 1:47 PM, Thilo Tanner 
> >wrote:
> >
> >> Hi Dmitry,
> >>
> >> To configure our apps, we mainly use what Tapestry offers
> out-of-the-box.
> >> I recommend to create a dedicated Tapestry module for each of your
> >> environments as described here:
> >>
> http://tapestry.apache.org/configuration.html#Configuration-SettingExecutionModes
> >>
> >> In such a module, you can override your database settings for example.
> >>
> >> Additional environment modules are then easy to load via command line.
> For
> >> example:
> >>
> >> java -Dtapestry.execution-mode=staging -jar myapp.war
> >>
> >> Compared to other injection containers, Tapestry’s IOC has lots of
> >> built-in features that will help you configuring your application.
> Another
> >> concept worth mentioning here are Symbols:
> >> http://tapestry.apache.org/symbols.html
> >> Symbols can be predefined, but also overridden during application
> startup
> >> (in fact, tapestry.execution-mode is a built-in T5 symbol used to load
> >> additional modules during startup)
> >>
> >> Best,
> >> Thilo
> >>
> >>
> >>
> >>
> >> Am 28.07.15 12:06 schrieb "Dmitry Gusev" unter  >:
> >>
> >> >Hi Thilo,
> >> >
> >> >and how in this case you configure your executable JAR?
> >> >
> >> >Are you using maven profiles & that war file contains all
> configuration,
> >> >or you create "universal" binary and provide configuration at runtime
> via
> >> >system properties or external .properties file?
> >> >
> >> >I know this should be pretty easy to code, just wondering if there's
> >> >anything ready that may be reused without reinventing the wheel.
> >> >
> >> >On Tue, Jul 28, 2015 at 12:30 PM, Thilo Tanner <
> thilo.tan...@reprisk.com>
> >> >wrote:
> >> >
> >> >> Hi Dmitry,
> >> >>
> >> >> Yes, we are running T5.4 apps in production by embedding Undertow
> >> (Servlet
> >> >> container from Wildfly). With Tapestry, such a setup is relatively
> easy
> >> to
> >> >> achieve:
> >> >>
> >> >> You cre

Re: Running tapestry app using embedded container in production

2015-07-28 Thread Dmitry Gusev
Hi Thilo,

So you're hardcoding all your staging/production settings in special
tapestry modules,
and committing them to the same source code repository as your app's
codebase, right?


On Tue, Jul 28, 2015 at 1:47 PM, Thilo Tanner 
wrote:

> Hi Dmitry,
>
> To configure our apps, we mainly use what Tapestry offers out-of-the-box.
> I recommend to create a dedicated Tapestry module for each of your
> environments as described here:
> http://tapestry.apache.org/configuration.html#Configuration-SettingExecutionModes
>
> In such a module, you can override your database settings for example.
>
> Additional environment modules are then easy to load via command line. For
> example:
>
> java -Dtapestry.execution-mode=staging -jar myapp.war
>
> Compared to other injection containers, Tapestry’s IOC has lots of
> built-in features that will help you configuring your application. Another
> concept worth mentioning here are Symbols:
> http://tapestry.apache.org/symbols.html
> Symbols can be predefined, but also overridden during application startup
> (in fact, tapestry.execution-mode is a built-in T5 symbol used to load
> additional modules during startup)
>
> Best,
> Thilo
>
>
>
>
> Am 28.07.15 12:06 schrieb "Dmitry Gusev" unter :
>
> >Hi Thilo,
> >
> >and how in this case you configure your executable JAR?
> >
> >Are you using maven profiles & that war file contains all configuration,
> >or you create "universal" binary and provide configuration at runtime via
> >system properties or external .properties file?
> >
> >I know this should be pretty easy to code, just wondering if there's
> >anything ready that may be reused without reinventing the wheel.
> >
> >On Tue, Jul 28, 2015 at 12:30 PM, Thilo Tanner 
> >wrote:
> >
> >> Hi Dmitry,
> >>
> >> Yes, we are running T5.4 apps in production by embedding Undertow
> (Servlet
> >> container from Wildfly). With Tapestry, such a setup is relatively easy
> to
> >> achieve:
> >>
> >> You create an application class that bootstraps the Tapestry filter in
> >> Undertow:
> >>
> http://undertow.io/undertow-docs/undertow-docs-1.2.0/index.html#creating-a-servlet-deployment
> >>
> >> Such a class will allow you to start your T5 app directly from a main
> >> method (great for development).
> >>
> >> For a deployment, you can use the two following Maven plugins to
> generate
> >> „executable WAR files“:
> >>
> >> maven-war-plugin
> >> Define the main class in the manifest file (pointing to your bootstrap
> >> class above)
> >>
> >> spring-boot-maven-plugin
> >> The plugin will repackage your WAR file to make it executable (by using
> >> java -jar myapp.war); WAR files per-se are not directly executable.
> >>
> >>
> >> If you’re interested in such a solution, I can post more details here.
> >>
> >> Best regards,
> >> Thilo
> >>
> >>
> >>
> >>
> >>
> >>
> >> Am 28.07.15 11:09 schrieb "Dmitry Gusev" unter  >:
> >>
> >> >Hello,
> >> >
> >> >Do you run tapestry apps in embedded container in production?
> >> >
> >> >If yes, how do you configure embedded container (ports, SSL, valves,
> >> etc.)?
> >> >
> >> >Maybe there's some tapestry integration that configures tomcat instance
> >> >using tapestry-ioc and symbols?
> >> >
> >> >--
> >> >Dmitry Gusev
> >> >
> >> >AnjLab Team
> >> >http://anjlab.com
> >>
> >
> >
> >
> >--
> >Dmitry Gusev
> >
> >AnjLab Team
> >http://anjlab.com
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Running tapestry app using embedded container in production

2015-07-28 Thread Dmitry Gusev
Hi Thilo,

and how in this case you configure your executable JAR?

Are you using maven profiles & that war file contains all configuration,
or you create "universal" binary and provide configuration at runtime via
system properties or external .properties file?

I know this should be pretty easy to code, just wondering if there's
anything ready that may be reused without reinventing the wheel.

On Tue, Jul 28, 2015 at 12:30 PM, Thilo Tanner 
wrote:

> Hi Dmitry,
>
> Yes, we are running T5.4 apps in production by embedding Undertow (Servlet
> container from Wildfly). With Tapestry, such a setup is relatively easy to
> achieve:
>
> You create an application class that bootstraps the Tapestry filter in
> Undertow:
> http://undertow.io/undertow-docs/undertow-docs-1.2.0/index.html#creating-a-servlet-deployment
>
> Such a class will allow you to start your T5 app directly from a main
> method (great for development).
>
> For a deployment, you can use the two following Maven plugins to generate
> „executable WAR files“:
>
> maven-war-plugin
> Define the main class in the manifest file (pointing to your bootstrap
> class above)
>
> spring-boot-maven-plugin
> The plugin will repackage your WAR file to make it executable (by using
> java -jar myapp.war); WAR files per-se are not directly executable.
>
>
> If you’re interested in such a solution, I can post more details here.
>
> Best regards,
> Thilo
>
>
>
>
>
>
> Am 28.07.15 11:09 schrieb "Dmitry Gusev" unter :
>
> >Hello,
> >
> >Do you run tapestry apps in embedded container in production?
> >
> >If yes, how do you configure embedded container (ports, SSL, valves,
> etc.)?
> >
> >Maybe there's some tapestry integration that configures tomcat instance
> >using tapestry-ioc and symbols?
> >
> >--
> >Dmitry Gusev
> >
> >AnjLab Team
> >http://anjlab.com
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Running tapestry app using embedded container in production

2015-07-28 Thread Dmitry Gusev
Hello,

Do you run tapestry apps in embedded container in production?

If yes, how do you configure embedded container (ports, SSL, valves, etc.)?

Maybe there's some tapestry integration that configures tomcat instance
using tapestry-ioc and symbols?

-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: decoupling business logic and frontend

2015-07-25 Thread Dmitry Gusev
Hi,

You may be mixing "business logic" with tapestry's page/component classes.

You shouldn't put any business logic to the presentation layer
(which is TMLs and page/component java classes).

All logic should be extracted to tapestry services, or even EJB as in the
JumpStart examples:
http://jumpstart.doublenegative.com.au/jumpstart/examples/state/atejb

If you don't like tapestry services nor EJB, then nothing really stops you
from wrapping your tapestry services or EJBs with REST API and creating
client API
that will be consumed from tapestry page/component classes.

With this approach you may develop backend separately from backend.

If you're going to deploy your app as a single monolith app you
can move your BL to tapestry services and that's it -- you don't need to
create
any API between them if they live in the same JVM.

You may even package you services in a separate JAR containing tapestry
modules
and add these JARs to your frontend app.

If you want to deploy them separately -- you obviously need some
communication protocol,
like REST or EJB. In this case you may continue using tapestry+tynamo
resteasy to implement your services,
but it could be any other technology stack, like Spring Boot or anything
else.

I'd also advise you to think of splitting your app not by layers (frontend
vs. business logic),
but using functional aspects, each function would include both frontend &
backend and be sufficient by itself.
For example, you may extract part of your pages into a separate tapestry
app and run it next to your "main" app,
maybe even in the same JVM, or package these apps all together during build
time into one monolith.

As you see there are many options.
You need to decide how are you going to deploy resulting app(s).

General advise here may be that one deployable unit should have one
dedicated team of developers
who are responsible for that unit.

Unless this is a really simple service that once developed & deployed stays
untouched,
otherwise I don't think you'll have any benefits from delegating your
workload.

On Sat, Jul 25, 2015 at 3:16 PM, Ilya Obshadko 
wrote:

> At this moment, my own project has grown big enough, so I've started to
> consider delegating various parts of the workload to others.
>
> However, there is one particular issue: when the whole thing is built on
> Tapestry, any person involved should understand the framework, and it's not
> possible to isolate frontend tasks from backend ones (because all the
> Tapestry "endpoints" are in fact event handlers and all AJAX requests are
> handled through usual event processing chain).
>
> One obvious solution is Tapestry+RestEASY (or any other similar REST
> module) and moving all controller logic to JS on the frontend and to REST
> handlers on the backend. This way pages/components are becoming just
> "stubs" that initialize required HTML/JS.
>
> Any other thoughts maybe?
>
> --
> Ilya Obshadko
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Advanced transaction support for tapestry JPA applications

2015-07-24 Thread Dmitry Gusev
Hi Kalle,

In JPA 2.1 it's BeanManager that is responsible for creating objects of
entity listeners.
BeanManager implementation from this library uses ObjectLocator.autobuild()
to create these instances,
so you may @Inject pretty much everything as you do with regular tapestry
services.

As for configuration property, maybe this:
https://docs.oracle.com/middleware/1213/toplink/java-reference/org/eclipse/persistence/config/PersistenceUnitProperties.html#CDI_BEANMANAGER


On Fri, Jul 24, 2015 at 8:12 PM, Kalle Korhonen 
wrote:

> Thanks Dmitry, looks excellent. Even so that I don't see any reason we
> shouldn't merge this to tapestry's core JPA integration at some point. I
> didn't read the code that carefully, but do the injectable JPA
> entitylisteners also support (totally non-spec) constructor injection? Do
> you know if the corresponding
> org.hibernate.jpa.AvailableSettings.CDI_BEAN_MANAGER
> is available in EclipseLink configuration and if so, what's the name of the
> property?
>
> Kalle
>
> On Thu, Jul 23, 2015 at 2:03 PM, Dmitry Gusev 
> wrote:
>
> > Hello Tapestry users!
> >
> > I would like to share with you a new small tapestry5 library that may be
> > helpful for tapestry JPA applications:
> >
> > https://github.com/satago/tapestry-jpa-transactions
> >
> > 1) It overrides @CommitAfter annotation with support for nested calls
> (only
> > top-most method will actually commit transaction)
> > 2) Simple service for wrapping Runnable/Invokable objects with
> transactions
> > when you need precise control over transactions
> > 3) Before/after commit callbacks
> > 4) Support @Injects in entity listeners when used with JPA 2.1
> >
> > Please see GitHub readme for details.
> >
> > It's built against tapestry 5.3.7, but should also work with latest 5.4
> > versions (not tested).
> >
> >
> > --
> > Dmitry Gusev
> >
> > AnjLab Team
> > http://anjlab.com
> >
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Advanced transaction support for tapestry JPA applications

2015-07-24 Thread Dmitry Gusev
Hi Tony,

I think so, but new TransactionalUnitWorker works the same as default one (
CommitAfterWorker).
It won't start a transaction unless you have @CommitAfter on execution path.

Maybe you're talking about starting transactions if no DB calls were made
from method annotated with @CommitAfter?

If that's the case, the answer is no -- it will begin a transaction anyway.

I did lazy such transactions some time ago when transaction created only on
first call to database:
http://dmitrygusev.blogspot.ru/2010/09/gae-and-tapestry5-data-access-layer.html

(referenced source code is lost somewhere on GitHub, but I can find it for
you if you're interested).

This was good for GAE, because GAE bills you for number of API calls.
I might add it at some point if there will be an interest.

On Fri, Jul 24, 2015 at 3:10 PM, Tony Nelson  wrote:

> This does look very interesting.
>
> A while back, Howard built a custom commit handler for me, that delays
> creating the transaction until a method with @CommitAfter is seen.  Does
> your library have a similar side effect, of not starting the transaction
> because only methods marked with @CommitAfter get wrapped in a
> TransactionalUnit?
>
> I look forward to testing out your library when time permits.
>
> Thanks
> Tony
>
> > On Jul 23, 2015, at 5:03 PM, Dmitry Gusev 
> wrote:
> >
> > Hello Tapestry users!
> >
> > I would like to share with you a new small tapestry5 library that may be
> > helpful for tapestry JPA applications:
> >
> > https://github.com/satago/tapestry-jpa-transactions
> >
> > 1) It overrides @CommitAfter annotation with support for nested calls
> (only
> > top-most method will actually commit transaction)
> > 2) Simple service for wrapping Runnable/Invokable objects with
> transactions
> > when you need precise control over transactions
> > 3) Before/after commit callbacks
> > 4) Support @Injects in entity listeners when used with JPA 2.1
> >
> > Please see GitHub readme for details.
> >
> > It's built against tapestry 5.3.7, but should also work with latest 5.4
> > versions (not tested).
> >
> >
> > --
> > Dmitry Gusev
> >
> > AnjLab Team
> > http://anjlab.com
>
>
> Since 1982, Starpoint Solutions has been a trusted source of human capital
> and solutions. We are committed to our clients, employees, environment,
> community and social concerns.  We foster an inclusive culture based on
> trust, respect, honesty and solid performance. Learn more about Starpoint
> and our social responsibility at
> http://www.starpoint.com/social_responsibility
>
> This email message from Starpoint Solutions LLC is for the sole use of
> the intended recipient(s) and may contain confidential and privileged
> information.  Any unauthorized review, use, disclosure or distribution is
> prohibited.  If you are not the intended recipient, please contact the
> sender by reply email and destroy all copies of the original message.
> Opinions, conclusions and other information in this message that do not
> relate to the official business of Starpoint Solutions shall be understood
> as neither given nor endorsed by it.
>
> -
> 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


Advanced transaction support for tapestry JPA applications

2015-07-23 Thread Dmitry Gusev
Hello Tapestry users!

I would like to share with you a new small tapestry5 library that may be
helpful for tapestry JPA applications:

https://github.com/satago/tapestry-jpa-transactions

1) It overrides @CommitAfter annotation with support for nested calls (only
top-most method will actually commit transaction)
2) Simple service for wrapping Runnable/Invokable objects with transactions
when you need precise control over transactions
3) Before/after commit callbacks
4) Support @Injects in entity listeners when used with JPA 2.1

Please see GitHub readme for details.

It's built against tapestry 5.3.7, but should also work with latest 5.4
versions (not tested).


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Multi threading in a service

2015-07-08 Thread Dmitry Gusev
Hi,

Why don't you want to use ParallelExecutor?
https://tapestry.apache.org/parallel-execution.html

It does exactly this.

If you want to do this yourself you'll need to invoke
PerthreadManager.cleanup() after each iteration to support per thread
services, like JPA's entity manager, etc.


On Wed, Jul 8, 2015 at 8:59 PM, George Christman 
wrote:

> I'm wondering what the best approach would be to handle multi threading in
> a service so that I have other service classes available to me.
>
> I'm passing in PDFService, but I'd like to pass it in through constructor
> injection.
>
> I'm assuming I'd have to instantiate the pool within archiveQueue and not
> set a class variable followed by me binding WorkQueue to an interface? I
>
> Current Code
>
> public class WorkQueue {
>
> private final ExecutorService pool;
>
> private final PDFService pdfService;
>
> public WorkQueue(PDFService pdfService, int poolSize) {
> this.pdfService = pdfService;
> this.pool = Executors.newFixedThreadPool(poolSize);
> }
>
> public void archiveQueue(List timeSheets) {
> try {
> for (final TimeSheet timeSheet : timeSheets) {
> pool.execute(new Runnable() {
> @Override
> public void run() {
> pdfService.generatePDF(null, timeSheet);
> }
> });
> }
> } catch (Exception ex) {
> Logger.getLogger(WorkQueue.class.getName()).log(Level.SEVERE,
> null, ex);
> }
> }
>
> void shutdownAndAwaitTermination(ExecutorService pool) {
> pool.shutdown(); // Disable new tasks from being submitted
> try {
> // Wait a while for existing tasks to terminate
> if (!pool.awaitTermination(60, TimeUnit.SECONDS)) {
> pool.shutdownNow(); // Cancel currently executing tasks
> // Wait a while for tasks to respond to being cancelled
> if (!pool.awaitTermination(60, TimeUnit.SECONDS)) {
> System.err.println("Pool did not terminate");
> }
> }
> } catch (InterruptedException ie) {
> // (Re-)Cancel if current thread also interrupted
> pool.shutdownNow();
> // Preserve interrupt status
> Thread.currentThread().interrupt();
> }
> }
>
> }
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Customizing the Tree Component

2015-05-26 Thread Dmitry Gusev
Hi,

using CSS?

On Tue, May 26, 2015 at 11:29 AM, Poggenpohl, Daniel <
daniel.poggenp...@isst.fraunhofer.de> wrote:

> Hello everyone,
>
> we want to customize the Tapestry tree component.
> One of our first problems is to change the icons used in leaves and nodes.
> How could we do that?
>
> Regards,
> Daniel P.
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: tml reloading

2015-05-23 Thread Dmitry Gusev
t;>>
> >>>
> >>>
> >>>
> >>> -----
> >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >>> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: tml reloading

2015-05-23 Thread Dmitry Gusev
Make sure you've disabled production mode

On Saturday, May 23, 2015, Veit Guna  wrote:

> Hi.
>
> I'm a new user of tapestry and struggling to get tml files reloaded
> during development.
> I'm using Tomcat 8 with JDK 7 and the tapestry archetype demo using
> version 5.3.8.
>
> I've configured a tomcat server within Eclipse WTP and normally using
> other web development
> frameworks it's enough to save a file and it gets automatically
> published to tomcat
> without a redeployment. So it uses HCR unter the hood. Simply reloading
> the page and
> voila. That works with classes and resources (pages etc.). Tomcat is
> started in Debug mode.
>
> With tapestry, the class reloading works, but not with the .tml files.
> If I look at the
> internal deployment location of WTP (under .metadata), I can see that
> the resources
> get replaced correctly by Eclipse. But tapestry doesn't pick them up.
>
> I've also tried -Dorg.apache.tapestry.disable-caching=true on container
> start, but without
> luck.
>
> I want to avoid deploying via maven, restarting tomcat or reloading the
> context.
>
> Does anybody have a clue what I'm missing?
>
> Regards,
> Veit
>
>
>
>
> -----
> 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


Re: ActionLink event handlers in Parent Page causing errors in Child

2015-05-08 Thread Dmitry Gusev
Hi,

just a guess: maybe it'll work if you declare parentAction as @Property in
ParentPage?
Like:

@Property
@InjectComponent
private ActionLink parentAction;

On Fri, May 8, 2015 at 1:35 PM, Casey Link  wrote:

> I'm upgrading a very old tapestry 5.0 project to 5.3
>
> One very common convention in this project was for a setup like this
>
> // ParentPage.java
> class ParentPage {
> ...
> Object onActionFromParentAction  {...}
> ...
> }
>
> // ParentPage.tml:
> ..
>   foo 
> ...
>
> // ChildPage.java
> class ChildPage extends ParentPage {
> ...
> Object onActionFromChildAction  {...}
> ...
> }
>
> // ChildPage.tml
> ...
>   foo 
> ...
>
> The problem in Tapestry 5.3 is I am getting:
> Component package/ChildPage does not contain embedded component
> 'ParentAction'.
>
> Because the ChildPage doesn't have an actionlink for ParentAction, as it
> is handled purely on the ParentPage.
>
> What's the ideal solution here? What's the most practical to fix this? Can
> I get tapestry to ignore event handlers that don't have a tml component?
>
> Thanks,
>
> Casey
>
> -----
> 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


New version with performance improvements for Eclipse Tapestry5 plugin

2015-05-08 Thread Dmitry Gusev
Available for download now:

https://github.com/anjlab/eclipse-tapestry5-plugin#install

It's highly recommended to install this version if you're using version
2.10.0.

Latest update (2.10.3) contains significant performance improvements in
project's structure analysis after you edited your tapestry modules.

-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Splitting a tapestry web app into modules

2015-04-16 Thread Dmitry Gusev
Hi,

Java doesn't know anything about projects & modules. It works with
classpath.

Just make sure all your packages & entities on the same classpath and you
should be good.

On Thu, Apr 16, 2015 at 1:10 PM, Poggenpohl, Daniel <
daniel.poggenp...@isst.fraunhofer.de> wrote:

> Hi,
>
> I'm not sure I get how you do it.
> Reading up on
> http://tapestry.apache.org/ioc.html
> http://tapestry.apache.org/starting-the-ioc-registry.html
> http://tapestry.apache.org/registry-startup.html
> I'm not connecting what is described with my problem yet.
>
> Perhaps using an example would help me.
> Let's say I have two Eclipse projects, "webui" and "model".
> model contains a package model.entities for the DB entities.
> webui contains, for the sake of simplicity, the rest of the Tapestry
> application.
>
> It seems that I have to configure the application to register the model
> project or the package...?
> Probably in AppModule, but how?
>
> Regards,
> Daniel P.
>
> -Ursprüngliche Nachricht-
> Von: Charlouze [mailto:m...@charlouze.com]
> Gesendet: Donnerstag, 16. April 2015 10:43
> An: Tapestry users
> Betreff: Re: Splitting a tapestry web app into modules
>
> Sure you can ... You just have to make sure that the module is used upon
> registry configuration.
>
> Le jeu. 16 avr. 2015 à 10:41, Poggenpohl, Daniel <
> daniel.poggenp...@isst.fraunhofer.de> a écrit :
>
> > Hi,
> >
> > I'm using tapestry-jpa.
> > I've found a reference to JpaEntityPackageManager. I can contribute
> > package names, but can I contribute packages in other projects?
> >
> > Regards,
> > Daniel P.
> >
> > -Ursprüngliche Nachricht-
> > Von: Charlouze [mailto:m...@charlouze.com]
> > Gesendet: Donnerstag, 16. April 2015 10:36
> > An: users@tapestry.apache.org
> > Betreff: Re: Splitting a tapestry web app into modules
> >
> > Hey
> >
> > Are you using JPA or Hibernate ?
> >
> > Charles
> >
> > Le jeu. 16 avr. 2015 à 10:21, Poggenpohl, Daniel <
> > daniel.poggenp...@isst.fraunhofer.de> a écrit :
> >
> > > Hello everyone,
> > >
> > > I'm trying to enable reuse for our projects by splitting our
> > > application into separate modules for the data model and the web ui,
> > > among others. When starting a Tapestry application, it looks for the
> > > entities in the entities package of the same project. Is it even
> > > possible that I put the entities for the application in a different
> > Maven project?
> > >
> > > Regards,
> > > Daniel P.
> > >
> >
>
> -
> 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


Re: parallel remote requests in Tapestry

2015-04-14 Thread Dmitry Gusev
Hi,

could you create a Future in your setupRender and use actual results w/
Future.get() during the rendering?

As Chris said I'd also recommend you looking at the ProgressiveDisplay
component.



On Tue, Apr 14, 2015 at 2:56 PM, Тимур Бухараев  wrote:

> I can't call both in setupRender, because i need one blocking wait to
> receive all requests in parallel.
>
> Steps:
> 1. prepareData(), all components send their request for data, remember all
> requests.
> 2. setupRender(), all components gets data from tokens. getData() could be
> like this:
>Response getData() {
>while ( !allRequestsAreRecieved() ) {
>Thread.sleep( 10 );
>}
>return data;
>}
>
> Now, we if we need 3 data: data1, data2, data3, we dont wait on blocking
> calls 3 times one after one. We do one blocking call. So overall delay
> would be max( delay1. delay2, delay3), not delay1 + delay2 + delay3
>
> On Tue, Apr 14, 2015 at 2:39 PM, Chris Poulsen 
> wrote:
>
> > Or maybe you can use progressive display?
> >
> >
> http://jumpstart.doublenegative.com.au/jumpstart7/examples/ajax/progressivedisplayvariations
> >
> > On Tue, Apr 14, 2015 at 1:36 PM, Chris Poulsen 
> > wrote:
> >
> > > If your prepareData() is non-blocking, why not just call it right
> before
> > > you do the token.getData() ? (both in setupRender() )
> > >
> > > On Tue, Apr 14, 2015 at 1:03 PM, Тимур Бухараев 
> > > wrote:
> > >
> > >> Hi,
> > >>
> > >> My pages consist page class and several components inside.
> > >>
> > >> Page and its components needs some information from remote services. I
> > get
> > >> this information with blocking calls in setupRender(). For example,
> if i
> > >> need user's profile data, i get it like this:
> > >>
> > >> setupRender() {
> > >>  profileData = loadProfileDate(); // blocking call, waiting for the
> > >> response
> > >> }
> > >>
> > >> And now i can use profileData in render to show some information.
> > >>
> > >> The problem is page and components need many remote data, so there are
> > >> many
> > >> serial requests to remote services. It harms latency, because overall
> > >> latency is sum of serial requests delays.
> > >>
> > >> I have idea to improve latency, sending requests in parallel. I want
> > make
> > >> non blocking function sendRequest, which returns me token. All
> > components
> > >> call non blocking sendRequest for remote data, then i'll wait in
> > blocking
> > >> call waitResponses(), which wait for all responses.Then component get
> > >> their
> > >> data from token.
> > >>
> > >> Some code for illustration:
> > >>
> > >> MyComponent {
> > >> @Inject
> > >> private RemoteService remoteService;
> > >>
> > >> private Token token;
> > >> }
> > >>
> > >> void prepareData() {
> > >> token = remoteService.sendRequest(); // non blocking call
> > >> }
> > >>
> > >> void setupRender() {
> > >> Response response = token.getData(); // first call is blocking,
> wait
> > >> for all responses, other calls just return data;
> > >> }
> > >>
> > >> Why i did not just realize my idea and write this post?
> > >>
> > >> Because i need two separate phases: first for send request, and second
> > for
> > >> prepare rendering. All componets should send in first phase, and after
> > get
> > >> data in second.
> > >>
> > >> Tapestry have setupRender and beginRender, but they have another
> order.
> > It
> > >> call setupRender and beginRender for first component, and then - for
> > >> second. But i need phase 1 calls for all components, then phase 2 call
> > for
> > >> all components.
> > >>
> > >> And now my question is: is there any way in Tapestry to create this
> > >> phases?
> > >> Thank you for your attention, sorry for my English.
> > >>
> > >
> > >
> >
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Startup service needs Request

2015-04-03 Thread Dmitry Gusev
Another option is to mock Request object and store it to RequestGlobals:

http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/services/RequestGlobals.html#storeRequestResponse(org.apache.tapestry5.services.Request,
org.apache.tapestry5.services.Response)

With this you may use default link source I reckon

On Fri, Apr 3, 2015 at 12:41 PM, Dmitry Gusev 
wrote:

> Hi,
>
> You'll need to implement your own LinkSource, like in this example:
>
> https://gist.github.com/dmitrygusev/6980210
>
> You may also want to set tapestry.hostname symbol:
>
> http://tapestry.apache.org/configuration.html#Configuration-tapestry.hostname
>
> Or you may use tapestry-offline module that may help you here:
> https://github.com/uklance/tapestry-offline
>
>
>
> On Fri, Apr 3, 2015 at 12:13 PM, TNO  wrote:
>
>> Hi,
>>
>> I'm using Tapestry 5.3.7, and I'm trying to send mails at tapestry
>> startup application.
>> In these mails,  I need the full url of the website to create dynamic
>> links.
>>
>> I create a service which needs org.apache.tapestry5.services.Request
>> (Usually, I use getServerName and getContextPath from Request to create
>> the url),
>> but I would like to use it outside the pages at the startup application.
>>
>> But the request is always null.
>>
>> Is there a solution to use the Request or to get the full path outside
>> tapestry pages ?
>>
>> Any help is welcome
>>
>> Thanks, Thomas
>>
>> -----
>> 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
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Startup service needs Request

2015-04-03 Thread Dmitry Gusev
Hi,

You'll need to implement your own LinkSource, like in this example:

https://gist.github.com/dmitrygusev/6980210

You may also want to set tapestry.hostname symbol:
http://tapestry.apache.org/configuration.html#Configuration-tapestry.hostname

Or you may use tapestry-offline module that may help you here:
https://github.com/uklance/tapestry-offline



On Fri, Apr 3, 2015 at 12:13 PM, TNO  wrote:

> Hi,
>
> I'm using Tapestry 5.3.7, and I'm trying to send mails at tapestry startup
> application.
> In these mails,  I need the full url of the website to create dynamic
> links.
>
> I create a service which needs org.apache.tapestry5.services.Request
> (Usually, I use getServerName and getContextPath from Request to create
> the url),
> but I would like to use it outside the pages at the startup application.
>
> But the request is always null.
>
> Is there a solution to use the Request or to get the full path outside
> tapestry pages ?
>
> Any help is welcome
>
> Thanks, Thomas
>
> -
> 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


Re: Upgrade hibernate core from 4.3.6 to 4.3.8

2015-02-25 Thread Dmitry Gusev
Hey,

Just add latest version to your project's pom.xml / build.gradle and you
should be fine,
it will override any transitive dependencies you might have from Tapestry
JARs.

On Wed, Feb 25, 2015 at 6:16 PM, George Christman 
wrote:

> Hi guys, it looks like we are a couple point releases behind on hibernate
> core. I'm trying to upgrade to hibernate-search 5.0.1 but it requires core
> 4.3.8, any chance we could upgrade the version?
>
> thanks
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Eclipse Tapestry5 Project version 2.8.0 available for download

2015-02-08 Thread Dmitry Gusev
Hi Norman,

Please try new version with a proper symbols support.

Let me know how this works for you.


https://github.com/anjlab/eclipse-tapestry5-plugin#support-for-tapestry-symbols



On Wed, Feb 4, 2015 at 10:47 PM, Norman Franke  wrote:

> Ignoring paths containing symbols works fine with me. I’d otherwise not
> have a problem with a project-based configuration file. Maybe it should
> live under WEB-INF or even META-INF.
>
> Norman Franke
> Answering Service for Directors, Inc.
> www.myasd.com
>
>
>
> On Feb 4, 2015, at 11:46 AM, Dmitry Gusev  wrote:
>
> > Hey Norman,
> >
> > I'll come with some solution in the next release. Probably will just
> ignore
> > validation for paths containing symbols.
> >
> > Regarding static analysis of tapestry's symbols - it won't be easy to do,
> > because the values for them calculated at runtime using method
> invocations
> > and string manipulations... Probably time for some configuration file
> where
> > one can specify missing bits & pieces.
> >
> > I was thinking to store plugin configuration in the project's source
> code.
> > Somewhere under 'src/main/tapestry/eclipse-plugin-config.json'. What do
> you
> > think?
> >
> > On Wed, Feb 4, 2015 at 7:29 PM, Norman Franke  wrote:
> >
> >> Speaking of which, any chance the plugin could not warn about @Import
> >> using "${tapestry.scriptaculous}/“ paths? Or is there a better way to
> >> include things like effects.js and builder.js?
> >>
> >> Norman Franke
> >> Answering Service for Directors, Inc.
> >> www.myasd.com
> >>
> >>
> >>
> >> On Feb 4, 2015, at 2:15 AM, Dmitry Gusev 
> wrote:
> >>
> >>> Hi Martin,
> >>>
> >>> I'm sorry I was unclear, the symbol expansion support is not yet in the
> >>> plugin.
> >>> I was just saying that it shouldn't be hard to add the support for
> simple
> >>> symbol contributions :)
> >>>
> >>> I'll try to add it in the next release.
> >>>
> >>> On Wed, Feb 4, 2015 at 7:15 AM, Martin Papy 
> >> wrote:
> >>>
> >>>> Hi Dmitry,
> >>>>
> >>>> My code was slightly different, but I updated it to see if there was
> any
> >>>> difference. So now I have this :
> >>>>
> >>>>   public static void
> >>>> contributeApplicationDefaults(MappedConfiguration
> >>>> configuration) {
> >>>>   configuration.add("layout.assets", "META-INF/assets");
> >>>>   configuration.add("layout.scripts", "META-INF/assets/js");
> >>>>   configuration.add("layout.styles", "META-INF/assets/css");
> >>>>   configuration.add("layout.images", "META-INF/assets/images");
> >>>>   }
> >>>>
> >>>> But the Tapestry Context is still unable to resolve the following :
> >>>>
> >>>> @Import(library={
> >>>>   "${layout.scripts}/jquery.confirm.js"
> >>>> }, module={
> >>>>   "bootstrap/modal",
> >>>>   "bootstrap/transition",
> >>>> })
> >>>>
> >>>> None of the 3 assets can be properly resolved... Not the end of the
> >> world
> >>>> of course :) Just a heads up.
> >>>>
> >>>> Again I love this plugin ^^
> >>>>
> >>>> -- Martin
> >>>>
> >>>> On Tue, Feb 3, 2015 at 4:16 PM, Dmitry Gusev 
> >>>> wrote:
> >>>>
> >>>>> Hi Martin,
> >>>>>
> >>>>> My current goal is to avoid configuration files at this stage if
> >>>> possible,
> >>>>> but try to get all the data via static code analysis.
> >>>>>
> >>>>> In this sense capabilities of the plugin are somewhat limited, for
> >>>> example,
> >>>>> this may be implemented with a little effort if you define your
> symbols
> >>>> via
> >>>>> SymbolSource configuration add/override (simple case without
> >> conditional
> >>>>> statements), something like:
> >>>>>
> >>>>>   public static void contributeApplicationDefaults(
> >>>>>
> >>>&g

Re: Eclipse Tapestry5 Project version 2.8.0 available for download

2015-02-08 Thread Dmitry Gusev
Hi Martin,

Try latest release (2.9.6), all three assets should be resolved now.

See notes here:
https://github.com/anjlab/eclipse-tapestry5-plugin#support-for-tapestry-symbols


On Wed, Feb 4, 2015 at 7:15 AM, Martin Papy  wrote:

> Hi Dmitry,
>
> My code was slightly different, but I updated it to see if there was any
> difference. So now I have this :
>
> public static void
> contributeApplicationDefaults(MappedConfiguration
> configuration) {
> configuration.add("layout.assets", "META-INF/assets");
> configuration.add("layout.scripts", "META-INF/assets/js");
> configuration.add("layout.styles", "META-INF/assets/css");
> configuration.add("layout.images", "META-INF/assets/images");
> }
>
> But the Tapestry Context is still unable to resolve the following :
>
> @Import(library={
> "${layout.scripts}/jquery.confirm.js"
> }, module={
> "bootstrap/modal",
> "bootstrap/transition",
> })
>
> None of the 3 assets can be properly resolved... Not the end of the world
> of course :) Just a heads up.
>
> Again I love this plugin ^^
>
> -- Martin
>
> On Tue, Feb 3, 2015 at 4:16 PM, Dmitry Gusev 
> wrote:
>
> > Hi Martin,
> >
> > My current goal is to avoid configuration files at this stage if
> possible,
> > but try to get all the data via static code analysis.
> >
> > In this sense capabilities of the plugin are somewhat limited, for
> example,
> > this may be implemented with a little effort if you define your symbols
> via
> > SymbolSource configuration add/override (simple case without conditional
> > statements), something like:
> >
> > public static void contributeApplicationDefaults(
> >
> > MappedConfiguration configuration)
> >
> > {
> >
> > configuration.add("layout.scripts", "foo");
> >
> > configuration.add("layout.styles", Constants.BAR);
> >
> > }
> >
> > Is this your case?
> >
> > On Tue, Feb 3, 2015 at 7:45 AM, Martin Papy 
> wrote:
> >
> > > That is indeed a GREAT work :) Awesome :)
> > >
> > > If I have 1 quick idea, it would be to be able to configure a symbol
> list
> > > so that we can open properly assets from the Import Annotation :). Here
> > > bellow I would like to defined what ${layout.scripts} points to.
> > >
> > > @Import(library={
> > > "${layout.scripts}/html5shiv-printshiv.js"
> > > },
> > > stylesheet={
> > > "${layout.styles}/chronicles/bootstrap.css"
> > > })
> > >
> > > -- Martin
> > >
> > > On Tue, Feb 3, 2015 at 10:01 AM, Bob Harner 
> wrote:
> > >
> > > > Awesome work, Dmitry! It just gets better and better...
> > > >
> > > > On Mon, Feb 2, 2015 at 1:51 AM, Dmitry Gusev  >
> > > > wrote:
> > > > > Hey Tapestry Users,
> > > > >
> > > > > I haven't updated release notes for the plugin for almost a year,
> > lots
> > > of
> > > > > minor features & improvements were released since then.
> > > > >
> > > > > Release 2.8.0 is different, because it introduces basic support for
> > > > > Tapestry 5.4.
> > > > >
> > > > > Some major changes:
> > > > >
> > > > >- Tapestry Context View
> > > > >   - Now shows JavaScript modules, both imported via
> > > > >   @Import(module="...") and required with
> > > > JavaScriptSupport.require("...")
> > > > >   - Validation rules for assets updated to include new
> location:
> > > > >   META-INF/assets
> > > > >
> > > > >
> > > > >- Tapestry Project Outline View
> > > > >   - Added support for @ImportModule annotation
> > > > >   - You can now see a list of services, decorators, advisors,
> and
> > > > >   contributors defined in each module. This is in addition to
> > > Library
> > > > >   Mappings & JavaScript Stacks. All are clickable and
> selectable
> > > > >   - Double click to jump to definition
> > > > >   - Selecting items in this view updates the JavaDoc view &
> > source
> > > > >   range in Java editor if open (handy for learning the source
> > code)
> > > > >
> > > > > As usual you can find updated README with screenshots and download
> > > > > instructions on Github:
> > > > >
> > > > > https://github.com/anjlab/eclipse-tapestry5-plugin#readme
> > > > >
> > > > >
> > > > > --
> > > > > Dmitry Gusev
> > > > >
> > > > > AnjLab Team
> > > > > http://anjlab.com
> > > >
> > > > -
> > > > 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
> >
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Eclipse Tapestry5 Plugin version 2.9.x with Symbol support available for download

2015-02-08 Thread Dmitry Gusev
Hi Tapestry Users!

New version of the plugin with support for Tapestry symbols available for
download.

All symbols declared in a project collected & presented in one place.
>
>- For every symbol you can find provider name (i.e. ApplicationDefauls
>or FactoryDefaults), tapestry module where this symbol declared, and even
>value of the symbol.
>- Markers for new, override, and overridden symbols.
>- Double-click on symbol to open source code of the declaration.
>
>
See screenshot:
https://github.com/anjlab/eclipse-tapestry5-plugin#support-for-tapestry-symbols


Symbols are now supported in Tapestry Context View to resolve referenced
assets that contain symbols in path.

Tapestry 5.4 modules (like bootstrap) should now resolve correctly too.


I've tested this on few my projects and fixed minor issues I could find.
Please let me know how it works for you.


As usual, installation instructions can be found here:
https://github.com/anjlab/eclipse-tapestry5-plugin#install


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Eclipse Tapestry5 Project version 2.8.0 available for download

2015-02-04 Thread Dmitry Gusev
Hey Norman,

I'll come with some solution in the next release. Probably will just ignore
validation for paths containing symbols.

Regarding static analysis of tapestry's symbols - it won't be easy to do,
because the values for them calculated at runtime using method invocations
and string manipulations... Probably time for some configuration file where
one can specify missing bits & pieces.

I was thinking to store plugin configuration in the project's source code.
Somewhere under 'src/main/tapestry/eclipse-plugin-config.json'. What do you
think?

On Wed, Feb 4, 2015 at 7:29 PM, Norman Franke  wrote:

> Speaking of which, any chance the plugin could not warn about @Import
> using "${tapestry.scriptaculous}/“ paths? Or is there a better way to
> include things like effects.js and builder.js?
>
> Norman Franke
> Answering Service for Directors, Inc.
> www.myasd.com
>
>
>
> On Feb 4, 2015, at 2:15 AM, Dmitry Gusev  wrote:
>
> > Hi Martin,
> >
> > I'm sorry I was unclear, the symbol expansion support is not yet in the
> > plugin.
> > I was just saying that it shouldn't be hard to add the support for simple
> > symbol contributions :)
> >
> > I'll try to add it in the next release.
> >
> > On Wed, Feb 4, 2015 at 7:15 AM, Martin Papy 
> wrote:
> >
> >> Hi Dmitry,
> >>
> >> My code was slightly different, but I updated it to see if there was any
> >> difference. So now I have this :
> >>
> >>public static void
> >> contributeApplicationDefaults(MappedConfiguration
> >> configuration) {
> >>configuration.add("layout.assets", "META-INF/assets");
> >>configuration.add("layout.scripts", "META-INF/assets/js");
> >>configuration.add("layout.styles", "META-INF/assets/css");
> >>configuration.add("layout.images", "META-INF/assets/images");
> >>}
> >>
> >> But the Tapestry Context is still unable to resolve the following :
> >>
> >> @Import(library={
> >>"${layout.scripts}/jquery.confirm.js"
> >> }, module={
> >>"bootstrap/modal",
> >>"bootstrap/transition",
> >> })
> >>
> >> None of the 3 assets can be properly resolved... Not the end of the
> world
> >> of course :) Just a heads up.
> >>
> >> Again I love this plugin ^^
> >>
> >> -- Martin
> >>
> >> On Tue, Feb 3, 2015 at 4:16 PM, Dmitry Gusev 
> >> wrote:
> >>
> >>> Hi Martin,
> >>>
> >>> My current goal is to avoid configuration files at this stage if
> >> possible,
> >>> but try to get all the data via static code analysis.
> >>>
> >>> In this sense capabilities of the plugin are somewhat limited, for
> >> example,
> >>> this may be implemented with a little effort if you define your symbols
> >> via
> >>> SymbolSource configuration add/override (simple case without
> conditional
> >>> statements), something like:
> >>>
> >>>public static void contributeApplicationDefaults(
> >>>
> >>>MappedConfiguration configuration)
> >>>
> >>>{
> >>>
> >>>configuration.add("layout.scripts", "foo");
> >>>
> >>>configuration.add("layout.styles", Constants.BAR);
> >>>
> >>>}
> >>>
> >>> Is this your case?
> >>>
> >>> On Tue, Feb 3, 2015 at 7:45 AM, Martin Papy 
> >> wrote:
> >>>
> >>>> That is indeed a GREAT work :) Awesome :)
> >>>>
> >>>> If I have 1 quick idea, it would be to be able to configure a symbol
> >> list
> >>>> so that we can open properly assets from the Import Annotation :).
> Here
> >>>> bellow I would like to defined what ${layout.scripts} points to.
> >>>>
> >>>> @Import(library={
> >>>>"${layout.scripts}/html5shiv-printshiv.js"
> >>>> },
> >>>> stylesheet={
> >>>>"${layout.styles}/chronicles/bootstrap.css"
> >>>> })
> >>>>
> >>>> -- Martin
> >>>>
> >>>> On Tue, Feb 3, 2015 at 10:01 AM, Bob Harner 
> >> wrote:
> >>>>
> >>>

Re: Eclipse Tapestry5 Project version 2.8.0 available for download

2015-02-04 Thread Dmitry Gusev
Hi Geoff,

Yes, this is a known "bug".

I know that CMD+R (Ctrl+R) sometimes stops working in the Debug
Perspective, and keeps broken after returning from Debug to the Java
Perspective.

This happens after you set a breakpoint in the Java code and debugger hits
that.

It becomes broken because Debug Perspective declares its own CMD+R
shortcut, which maps to "Run to Line" action.

I can reproduce this issue on my machine, and it reverted to normal after
stopping the Java process that was under debugging in Eclipse.

After you stop the process CMD+R starts working again.

So if you feel uncomfortable with that, just remap the shortcut to
something else (either plugin's or of "Run to Line").

Personally I use non-default configuration, the one that's mentioned in the
README:

https://github.com/anjlab/eclipse-tapestry5-plugin#quick-switch-shortcut

*Tip:* If you installed Quick Switch feature, I recommend you to change key
> bindings vice versa:CMD+; for Code/Design switch and CMD+R for the Quick
> Switch pop-up:
>


On Wed, Feb 4, 2015 at 3:00 PM, Geoff Callender <
geoff.callender.jumpst...@gmail.com> wrote:

> Hi Dmitry,
>
> I find this tool utterly invaluable, even though I keep related java, tml,
> and properties in the same folder. There is one problem, though - the
> keyboard shortcuts get corrupted as the day goes on - probably by clashes
> with other editors (javascript editor in particular? I'm not sure). Do you
> have any advice on how to avoid or prevent this happening?
>
> Cheers,
> Geoff
>
> On 4 Feb 2015, at 6:15 pm, Dmitry Gusev  wrote:
>
> > Hi Martin,
> >
> > I'm sorry I was unclear, the symbol expansion support is not yet in the
> > plugin.
> > I was just saying that it shouldn't be hard to add the support for simple
> > symbol contributions :)
> >
> > I'll try to add it in the next release.
> >
> > On Wed, Feb 4, 2015 at 7:15 AM, Martin Papy 
> wrote:
> >
> >> Hi Dmitry,
> >>
> >> My code was slightly different, but I updated it to see if there was any
> >> difference. So now I have this :
> >>
> >>public static void
> >> contributeApplicationDefaults(MappedConfiguration
> >> configuration) {
> >>configuration.add("layout.assets", "META-INF/assets");
> >>configuration.add("layout.scripts", "META-INF/assets/js");
> >>configuration.add("layout.styles", "META-INF/assets/css");
> >>configuration.add("layout.images", "META-INF/assets/images");
> >>}
> >>
> >> But the Tapestry Context is still unable to resolve the following :
> >>
> >> @Import(library={
> >>"${layout.scripts}/jquery.confirm.js"
> >> }, module={
> >>"bootstrap/modal",
> >>"bootstrap/transition",
> >> })
> >>
> >> None of the 3 assets can be properly resolved... Not the end of the
> world
> >> of course :) Just a heads up.
> >>
> >> Again I love this plugin ^^
> >>
> >> -- Martin
> >>
> >> On Tue, Feb 3, 2015 at 4:16 PM, Dmitry Gusev 
> >> wrote:
> >>
> >>> Hi Martin,
> >>>
> >>> My current goal is to avoid configuration files at this stage if
> >> possible,
> >>> but try to get all the data via static code analysis.
> >>>
> >>> In this sense capabilities of the plugin are somewhat limited, for
> >> example,
> >>> this may be implemented with a little effort if you define your symbols
> >> via
> >>> SymbolSource configuration add/override (simple case without
> conditional
> >>> statements), something like:
> >>>
> >>>public static void contributeApplicationDefaults(
> >>>
> >>>MappedConfiguration configuration)
> >>>
> >>>{
> >>>
> >>>configuration.add("layout.scripts", "foo");
> >>>
> >>>    configuration.add("layout.styles", Constants.BAR);
> >>>
> >>>}
> >>>
> >>> Is this your case?
> >>>
> >>> On Tue, Feb 3, 2015 at 7:45 AM, Martin Papy 
> >> wrote:
> >>>
> >>>> That is indeed a GREAT work :) Awesome :)
> >>>>
> >>>> If I have 1 quick idea, it would be to be able to configure a symbol
> >> list
> >>>> so that we c

Re: Eclipse Tapestry5 Project version 2.8.0 available for download

2015-02-03 Thread Dmitry Gusev
Hi Martin,

I'm sorry I was unclear, the symbol expansion support is not yet in the
plugin.
I was just saying that it shouldn't be hard to add the support for simple
symbol contributions :)

I'll try to add it in the next release.

On Wed, Feb 4, 2015 at 7:15 AM, Martin Papy  wrote:

> Hi Dmitry,
>
> My code was slightly different, but I updated it to see if there was any
> difference. So now I have this :
>
> public static void
> contributeApplicationDefaults(MappedConfiguration
> configuration) {
> configuration.add("layout.assets", "META-INF/assets");
> configuration.add("layout.scripts", "META-INF/assets/js");
> configuration.add("layout.styles", "META-INF/assets/css");
> configuration.add("layout.images", "META-INF/assets/images");
> }
>
> But the Tapestry Context is still unable to resolve the following :
>
> @Import(library={
> "${layout.scripts}/jquery.confirm.js"
> }, module={
> "bootstrap/modal",
> "bootstrap/transition",
> })
>
> None of the 3 assets can be properly resolved... Not the end of the world
> of course :) Just a heads up.
>
> Again I love this plugin ^^
>
> -- Martin
>
> On Tue, Feb 3, 2015 at 4:16 PM, Dmitry Gusev 
> wrote:
>
> > Hi Martin,
> >
> > My current goal is to avoid configuration files at this stage if
> possible,
> > but try to get all the data via static code analysis.
> >
> > In this sense capabilities of the plugin are somewhat limited, for
> example,
> > this may be implemented with a little effort if you define your symbols
> via
> > SymbolSource configuration add/override (simple case without conditional
> > statements), something like:
> >
> > public static void contributeApplicationDefaults(
> >
> > MappedConfiguration configuration)
> >
> > {
> >
> > configuration.add("layout.scripts", "foo");
> >
> > configuration.add("layout.styles", Constants.BAR);
> >
> > }
> >
> > Is this your case?
> >
> > On Tue, Feb 3, 2015 at 7:45 AM, Martin Papy 
> wrote:
> >
> > > That is indeed a GREAT work :) Awesome :)
> > >
> > > If I have 1 quick idea, it would be to be able to configure a symbol
> list
> > > so that we can open properly assets from the Import Annotation :). Here
> > > bellow I would like to defined what ${layout.scripts} points to.
> > >
> > > @Import(library={
> > > "${layout.scripts}/html5shiv-printshiv.js"
> > > },
> > > stylesheet={
> > > "${layout.styles}/chronicles/bootstrap.css"
> > > })
> > >
> > > -- Martin
> > >
> > > On Tue, Feb 3, 2015 at 10:01 AM, Bob Harner 
> wrote:
> > >
> > > > Awesome work, Dmitry! It just gets better and better...
> > > >
> > > > On Mon, Feb 2, 2015 at 1:51 AM, Dmitry Gusev  >
> > > > wrote:
> > > > > Hey Tapestry Users,
> > > > >
> > > > > I haven't updated release notes for the plugin for almost a year,
> > lots
> > > of
> > > > > minor features & improvements were released since then.
> > > > >
> > > > > Release 2.8.0 is different, because it introduces basic support for
> > > > > Tapestry 5.4.
> > > > >
> > > > > Some major changes:
> > > > >
> > > > >- Tapestry Context View
> > > > >   - Now shows JavaScript modules, both imported via
> > > > >   @Import(module="...") and required with
> > > > JavaScriptSupport.require("...")
> > > > >   - Validation rules for assets updated to include new
> location:
> > > > >   META-INF/assets
> > > > >
> > > > >
> > > > >- Tapestry Project Outline View
> > > > >   - Added support for @ImportModule annotation
> > > > >   - You can now see a list of services, decorators, advisors,
> and
> > > > >   contributors defined in each module. This is in addition to
> > > Library
> > > > >   Mappings & JavaScript Stacks. All are clickable and
> selectable
> > > > >   - Double click to jump to definition
> > > > >   - Selecting items in this view updates the JavaDoc view &
> > source
> > > > >   range in Java editor if open (handy for learning the source
> > code)
> > > > >
> > > > > As usual you can find updated README with screenshots and download
> > > > > instructions on Github:
> > > > >
> > > > > https://github.com/anjlab/eclipse-tapestry5-plugin#readme
> > > > >
> > > > >
> > > > > --
> > > > > Dmitry Gusev
> > > > >
> > > > > AnjLab Team
> > > > > http://anjlab.com
> > > >
> > > > -
> > > > 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
> >
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Eclipse Tapestry5 Project version 2.8.0 available for download

2015-02-03 Thread Dmitry Gusev
Hi Martin,

My current goal is to avoid configuration files at this stage if possible,
but try to get all the data via static code analysis.

In this sense capabilities of the plugin are somewhat limited, for example,
this may be implemented with a little effort if you define your symbols via
SymbolSource configuration add/override (simple case without conditional
statements), something like:

public static void contributeApplicationDefaults(

MappedConfiguration configuration)

{

configuration.add("layout.scripts", "foo");

configuration.add("layout.styles", Constants.BAR);

}

Is this your case?

On Tue, Feb 3, 2015 at 7:45 AM, Martin Papy  wrote:

> That is indeed a GREAT work :) Awesome :)
>
> If I have 1 quick idea, it would be to be able to configure a symbol list
> so that we can open properly assets from the Import Annotation :). Here
> bellow I would like to defined what ${layout.scripts} points to.
>
> @Import(library={
> "${layout.scripts}/html5shiv-printshiv.js"
> },
> stylesheet={
> "${layout.styles}/chronicles/bootstrap.css"
> })
>
> -- Martin
>
> On Tue, Feb 3, 2015 at 10:01 AM, Bob Harner  wrote:
>
> > Awesome work, Dmitry! It just gets better and better...
> >
> > On Mon, Feb 2, 2015 at 1:51 AM, Dmitry Gusev 
> > wrote:
> > > Hey Tapestry Users,
> > >
> > > I haven't updated release notes for the plugin for almost a year, lots
> of
> > > minor features & improvements were released since then.
> > >
> > > Release 2.8.0 is different, because it introduces basic support for
> > > Tapestry 5.4.
> > >
> > > Some major changes:
> > >
> > >- Tapestry Context View
> > >   - Now shows JavaScript modules, both imported via
> > >   @Import(module="...") and required with
> > JavaScriptSupport.require("...")
> > >   - Validation rules for assets updated to include new location:
> > >   META-INF/assets
> > >
> > >
> > >- Tapestry Project Outline View
> > >   - Added support for @ImportModule annotation
> > >   - You can now see a list of services, decorators, advisors, and
> > >   contributors defined in each module. This is in addition to
> Library
> > >   Mappings & JavaScript Stacks. All are clickable and selectable
> > >   - Double click to jump to definition
> > >   - Selecting items in this view updates the JavaDoc view & source
> > >   range in Java editor if open (handy for learning the source code)
> > >
> > > As usual you can find updated README with screenshots and download
> > > instructions on Github:
> > >
> > > https://github.com/anjlab/eclipse-tapestry5-plugin#readme
> > >
> > >
> > > --
> > > Dmitry Gusev
> > >
> > > AnjLab Team
> > > http://anjlab.com
> >
> > -
> > 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


Re: [T5.4] How to exclude twitter bootstrap from app pages?

2015-02-02 Thread Dmitry Gusev
Hi Chris,

this is what I did at the end - replaced Bootstrap CSS/JS with blank files.
This worked.

The only component I used and that I found broken so far is t:Alerts, which
relies on bootstrap heavily.


On Tue, Feb 3, 2015 at 1:33 AM, Chris Mylonas  wrote:

> hi Dmitry
>
> there was a thread here a couple of months back about importing a blank css
> file so that one could have total control.
>
> perhaps the css ordering would suit your circumstance?
>
> cm
> On 30/01/2015 1:45 am, "Dmitry Gusev"  wrote:
>
> > Hello,
> >
> > I've just started migrating existing app from T5.3 to T5.4 and have some
> > problems with twitter bootstrap CSS, because it conflicts with existing
> CSS
> > framework.
> >
> > I'd like to exclude all twitter bootstrap CSS/JS from my app pages (I
> don't
> > mind having it on tapestry's internal pages).
> >
> > How can I do this? Maybe any alternatives?
> >
> > --
> > Dmitry Gusev
> >
> > AnjLab Team
> > http://anjlab.com
> >
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Eclipse Tapestry5 Project version 2.8.0 available for download

2015-02-01 Thread Dmitry Gusev
Hey Tapestry Users,

I haven't updated release notes for the plugin for almost a year, lots of
minor features & improvements were released since then.

Release 2.8.0 is different, because it introduces basic support for
Tapestry 5.4.

Some major changes:

   - Tapestry Context View
  - Now shows JavaScript modules, both imported via
  @Import(module="...") and required with JavaScriptSupport.require("...")
  - Validation rules for assets updated to include new location:
  META-INF/assets


   - Tapestry Project Outline View
  - Added support for @ImportModule annotation
  - You can now see a list of services, decorators, advisors, and
  contributors defined in each module. This is in addition to Library
  Mappings & JavaScript Stacks. All are clickable and selectable
  - Double click to jump to definition
  - Selecting items in this view updates the JavaDoc view & source
  range in Java editor if open (handy for learning the source code)

As usual you can find updated README with screenshots and download
instructions on Github:

https://github.com/anjlab/eclipse-tapestry5-plugin#readme


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


[T5.4] How to exclude twitter bootstrap from app pages?

2015-01-29 Thread Dmitry Gusev
Hello,

I've just started migrating existing app from T5.3 to T5.4 and have some
problems with twitter bootstrap CSS, because it conflicts with existing CSS
framework.

I'd like to exclude all twitter bootstrap CSS/JS from my app pages (I don't
mind having it on tapestry's internal pages).

How can I do this? Maybe any alternatives?

-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Tapestry URLEncoder

2014-12-24 Thread Dmitry Gusev
Hi,

as far as I know, Tapestry's URLEncoder allows you to not think about
encoding, it forces to UTF-8.

Default URLEncoder asks you to specify encoding as a separate parameter,
which you normally pass as another URL parameters, for example, look at
ie/oe parameters that Safari adds to Google request URL when you search
from Safari's address bar:

https://www.google.com/search?client=safari&rls=en&q=help&ie=UTF-8&oe=UTF-8


On Wed, Dec 24, 2014 at 11:22 PM, George Christman 
wrote:
>
> Hi guys, I'm just wondering why Tapestry decided to build their own
> URLEncoder over using an existing one like java.net.URLEncoder? I'd
> like to clean up my URLs removing a lot of the encoding making them
> more search friendly, so I'm wondering what the impact of overriding
> the URLEncoder service and implementing a more standard one would be?
> Thanks.
>
> -
> 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


Re: What happens when Boootstrap 4 is released?

2014-12-12 Thread Dmitry Gusev
Correct me if I'm wrong, but 5.4 doesn't provide default CSS. It uses
hardcoded bootstrap HTML/CSS instead.

It could produce default HTML (or even XML) without CSS at all and provide
default bootstrap module that converts this markup to bootstrap - voila -
you have default CSS, but also a more or less stable API for 3rd party CSS
frameworks.

I'm sure you know that adopting modern CSS framework is not that simple as
updating CSS rules, it also includes DOM rewrite.

And as far as I know 5.4 isn't backward compatible here, so overriding CSS
and rewriting DOM in a T5.3 app won't help during upgrade.

You mentioned component replacement, but that's not an option too. Try to
replace the t:Form component and form fields - that's not a trivial task.

So that's a real issue to our app.


On Fri, Dec 12, 2014 at 3:48 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:
>
> On Fri, 12 Dec 2014 05:24:33 -0200, Dmitry Gusev 
> wrote:
>
>> So I highly support Barry's suggestions on no framework specific html and
>> css.
>>
>
> Easier said than done. If Tapestry provides no default CSS, new
> applications will look very badly. Anyway, you can easily override any CSS
> provided by Tapestry plus CSS classes can be easily overriden through CSS
> alone, not to mention what you can do with DOM rewriting and component
> replacement (5.4), so I don't think this should be an issue at all for
> upgrading to 5.4.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> -
> 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


Re: What happens when Boootstrap 4 is released?

2014-12-11 Thread Dmitry Gusev
o
>>> that would mean I’m about 6 months ahead of that.
>>>
>>>
>>>
>>> Related to this does it make sense to switch to jQuery 2.X if the default
>>> styles do not support IE8?
>>>
>>>
>>>
>>> I think I’m OK with giving up on IE8 but I’ll like to see IE 8 render a
>>> Bootstrap 4.X site before I really decide.
>>>
>>>
>>>
>>> What do you think?
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
> --
> Using Opera's mail client: http://www.opera.com/mail/
>
>
> -
> 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


Deprecate t:formdata in favor of REST?

2014-10-24 Thread Dmitry Gusev
Hello,

Just wonder if anybody have any ideas how we can deprecate usage os  element?

Tapestry5.x form submission logic heavily relies on the value of t:formdata
at the moment.

This approach just doesn't play well with REST. Which means in practice
that we can't integrate well with modern JS frameworks when we talk about
form submissions.

And by "well" I mean that we cannot reuse T5 support for validation, value
encoders, translators, etc.

We simply cannot use them without t:formdata that MUST be generated on the
server-side, though all modern JS frameworks tend to generate HTML DOM
client-side.

Using Tapestry5-powered REST endpoints, like tapestry-resteasy provides,
helps integrating client-side JS with T5 applications, but we lose all T5's
form support in this case.

Hence my question: Does anybody have any ideas or plans how can we
deprecate t:formdata?

Would be nice if Howard or any other committers share their thoughts on
this.

-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


  1   2   3   4   5   >