RE: [ANNOUNCEMENT] Tapestry 5.7.1 and 5.6.3 released

2021-03-19 Thread Svein Erik Løken
Thank you! I using Tapestry in production with 1,5 million unique users
every year. It handles very high load 😊

S-E

-Original Message-
From: Thiago H. de Paula Figueiredo 
Sent: tirsdag 16. mars 2021 22:30
To: Tapestry users 
Subject: [ANNOUNCEMENT] Tapestry 5.7.1 and 5.6.3 released

Hello!

Both are recommended upgrades: 5.6.3 for 5.4 to 5.6.2, 5.7.1 for 5.7.0.

Please check the release notes for both:
5.6.3: https://tapestry.apache.org/release-notes-563.html
5.7.1: https://tapestry.apache.org/release-notes-561.html

Happy coding!

-- 
Thiago

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



RE: Updating ResourceMinimizer to handle ES6

2019-08-26 Thread Svein-Erik Løken
The topic I tried to answer was in the Dev Mailing List Archive


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



RE: Updating ResourceMinimizer to handle ES6

2019-08-26 Thread Svein-Erik Løken
The topic I tried to answer was in the d...@tapestry.apache.org Mailing List 
Archive

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



Re: Updating ResourceMinimizer to handle ES6

2019-08-26 Thread Svein-Erik Løken

org.apache.tapestry
tapestry-webresources


com.google.javascript
closure-compiler




com.google.javascript
closure-compiler

v20151216



@Contribute(ResourceMinimizer.class)
@Primary
public static void overrideJavaScriptMinimizer(final 
MappedConfiguration configuration) {
configuration.overrideInstance("text/javascript", 
MyGoogleClosureMinimizer.class);
}




package com.jacilla.core.services;

import com.google.javascript.jscomp.Compiler;
import com.google.javascript.jscomp.*;
import org.apache.commons.io.IOUtils;
import org.apache.tapestry5.internal.webresources.GoogleClosureMinimizer;
import org.apache.tapestry5.ioc.OperationTracker;
import org.apache.tapestry5.ioc.annotations.Symbol;
import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
import org.apache.tapestry5.ioc.internal.util.InternalUtils;
import org.apache.tapestry5.services.Request;
import org.apache.tapestry5.services.assets.AssetChecksumGenerator;
import org.apache.tapestry5.services.assets.StreamableResource;
import org.apache.tapestry5.webresources.WebResourcesSymbols;
import org.slf4j.Logger;

import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.util.Collections;
import java.util.List;

public class MyGoogleClosureMinimizer extends GoogleClosureMinimizer {
private final static String OUTPUT_CHARSET = "utf-8";

private final List EXTERNS = Collections.emptyList();

private final CompilationLevel compilationLevel;

public MyGoogleClosureMinimizer(Logger logger, OperationTracker tracker, 
AssetChecksumGenerator checksumGenerator, Request request, 
@Symbol(WebResourcesSymbols.COMPILATION_LEVEL) CompilationLevel 
compilationLevel) {
super(logger, tracker, checksumGenerator, request, compilationLevel);
this.compilationLevel = compilationLevel;
}

@Override
protected InputStream doMinimize(StreamableResource resource) throws 
IOException {
CompilerOptions options = new CompilerOptions();

compilationLevel.setOptionsForCompilationLevel(options);

options.setLanguage(CompilerOptions.LanguageMode.ECMASCRIPT6);


options.setCodingConvention(new ClosureCodingConvention());
options.setOutputCharset(OUTPUT_CHARSET);
options.setWarningLevel(DiagnosticGroups.CHECK_VARIABLES, 
CheckLevel.WARNING);

com.google.javascript.jscomp.Compiler compiler = new Compiler();

compiler.disableThreads();

SourceFile input = SourceFile.fromInputStream(resource.toString(), 
resource.openStream(), Charset.defaultCharset());

List inputs = Collections.singletonList(input);

Result result = compiler.compile(EXTERNS, inputs, options);

if (result.success) {
return IOUtils.toInputStream(compiler.toSource(), OUTPUT_CHARSET);
}

throw new RuntimeException(String.format("Compilation failed: %s.",
InternalUtils.join(CollectionFactory.newList(result.errors), 
";")));
}
}





tsconfig.json

{
  "compilerOptions": {
"target": "es2015",






RE: Jetbrains considers to deprecate Tapestry plugin in IntelliJ 2019.3

2019-07-12 Thread Svein-Erik Løken
After reading posts after posts that Tapestry is outdated - how is it outdated?

The last year I have used ReactJS/JSX/TypeScript/es2015/node, SCCS in a 
multimodule setup in Tapestry. I am using Tapestry Resteasy or just Tapestry 
Ajax() or Zone.deferredZoneUpdate() to nice error messages. 

Can anyone tell?

S-E



RE: Cannot execute Maven goal to build Tapestry 5.4.x from Getting started guide nor from the example source using Maven

2019-07-07 Thread Svein-Erik Løken
It seems that my comment was removed. This should also work:

mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate 
-DarchetypeCatalog=https://repository.apache.org/content/repositories/staging 
-Dfilter=org.apache.tapestry:quickstart



RE: Jetbrains considers to deprecate Tapestry plugin in IntelliJ 2019.3

2019-07-04 Thread Svein-Erik Løken
You don't have to tell us that, we know there is a world out there! I have 
tried Wicket - it is very good, but found Tapestry better for my needs. I am 
using ReactJS with Tapestry. It works very well. Tapestry is rock solid and I 
hope it will live forever!

S-E


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


RE: Jetbrains considers to deprecate Tapestry plugin in IntelliJ 2019.3

2019-06-20 Thread Svein-Erik Løken
I have built front-ends with Typescript,  JSX,  React, sometimes mixed with 
Tapestry Zones. I always tries use T5 components, but not too hard. The admin 
client don't need to be so fancy and is 95% Tapestry code. I found that the 
quality and code maintaining is much better when using Tapestry. For me 
Tapestry is almost perfect, but of course I hope the framework will evolve.

I am a huge fan of IntelliJ Ultimate. If the Tapestry plugin stops to work then 
don't know what to do! I think it is absolutely necessary for coding speed, 
navigating and quality check. 

I hope that having the IntelliJ Tapestry plugin open source then it can be even 
better. I have reported several issues to JetBrains, but they are still 
unresolved. The most important now is that the plugin will work in new versions 
of IntelliJ.

Again, a big thank to the guys that keeps Tapestry going.

S-E

 

-Original Message-
From: Qbyte Consulting  
Sent: torsdag 20. juni 2019 03:02
To: Tapestry users 
Subject: Re: Jetbrains considers to deprecate Tapestry plugin in IntelliJ 2019.3

React repeats the same sins as JSP by mixing code and presentation. A problem 
tapestry addressed. Its kind of strange seeing this JSP age issue afflict those 
“better frameworks”.

I’d also wager a SPA could be developed more quickly in tapestry than with any 
JS framework plus an API. Then there there’s also the fact that tapestry apps 
can be developed by any Java developer without a need for much additional JS 
expertise.

Can’t really compare apples and oranges.

John

Sent from my iPhone

> On 19 Jun 2019, at 16:18, Emmanuel Sowah  wrote:
> 
> Of course it's understandable that they are going to deprecate it. 
> What kind of creatures are you still stuck to a failed and stone-age 
> framework like Tapestry? Even the original creator, Howard Lewis Ship, 
> has abandoned it for better frameworks like React, Angular and Wicket. 
> Guys, wake up and stop wasting your time.
> 
> On Tue, Jun 18, 2019 at 10: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-intell
>> ij-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.
>> 

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



RE: How to let the last ajaxResponseRenderer win?

2019-06-12 Thread Svein-Erik Løken
I have tried several methods without luck, but found a solution now. I don't 
want to rewrite the Tapestry javascript code if I don't have to, but found a 
way by stopping propagation of the events.zone.update. I have a filter on a 
grid. The grid is big and when Tapestry calls $.append(content) to insert zone 
data the browser gets very laggy. By including the input value in the zone, 
then I can check on match with the current user input when zone is ready to 
update. The mixin accept multiple zones.

I tried http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/onevent, 
but I does not sync data and will display wrong result (om large zone updates).

Debugging:

STOP: stopPropagation
UPDT: Let zone update be handled as default
Test on currentInputVal vs inputValInZone

STOP: tes !== t zone:destinationTableZone
STOP: tes !== t zone:destinationCountZone
STOP: test !== te zone:destinationTableZone
STOP: test !== te zone:destinationCountZone
STOP: test !== tes zone:destinationTableZone
STOP: test !== tes zone:destinationCountZone
UPDT: test === test zone:destinationTableZone ZONEUPDATE 
UPDT: test === test zone:destinationCountZone ZONEUPDATE 
STOP: testla !== testl zone:destinationTableZone
STOP: testla !== testl zone:destinationCountZone
STOP: testlab !== testla zone:destinationTableZone
STOP: testlab !== testla zone:destinationCountZone
STOP: testlab2 !== testlab zone:destinationTableZone
STOP: testlab2 !== testlab zone:destinationCountZone
UPDT: testlab2 === testlab2 zone:destinationTableZone ZONEUPDATE 
UPDT: testlab2 === testlab2 zone:destinationCountZone ZONEUPDATE

The code:
mixins\ZoneSync.java: 
public class ZoneSync {
@Parameter(required = true, allowNull = false)
Object[] zones;
@Inject
JavaScriptSupport javaScriptSupport;
@InjectContainer
ClientElement clientElement;

@AfterRender
void afterRender() {
String zonesSelector = Arrays.stream(this.zones).map(zone -> "#" + 
((Zone) zone).getClientId()).collect(Collectors.joining(","));

javaScriptSupport.require("mixins/zone-sync").invoke("syncWithInput").with("#" 
+ clientElement.getClientId(), zonesSelector);
}
}

Zone-sync.ts:
export = class ZoneSync {
/*


${}
*/
static syncWithInput(textFieldSelector: string, zonesSelector: string) {
let textField = $(textFieldSelector);
Dom.on(zonesSelector, Events.zone.update, function (this: 
ElementWrapper, event: EventWrapper) {
let currentInputVal = textField.val();
let inputValInZone = 
$(`${(event.memo.content)}`).children(".sync").first().text();
if (currentInputVal !== inputValInZone) {
event.nativeEvent.stopPropagation();
console.log(`STOP: ${currentInputVal} !== ${inputValInZone} 
zone:${this.element.id}`);
} else {
console.log(`UPDT: ${currentInputVal} === ${inputValInZone} 
zone:${this.element.id}`);
}
});
}
}

TML:

Name:


${nameFilter}
${destinationBeans.size()}



${nameFilter}




S-E

-Original Message-
From: Cezary Biernacki  
Sent: lørdag 8. juni 2019 00:09
To: Tapestry users 
Subject: Re: How to let the last ajaxResponseRenderer win?

Hi,

A server-side solution will not solve the problem, as responses from the server 
can be re-ordered because of network transmission hick-ups. With Tapestry, you 
can the abort Ajax requests on client-side as well, it uses Jquery (or 
Prototype.js) under the hood.  I would monkey-patch dom.ajaxRequest function 
(see t5-core-dom-jquery.js or t5-core-dom-prototype.js depending if your are 
using Jquery or Prototype), to track currently running AJAX requests and abort 
it if a new one is issued using Jquery's or XMLHttpRequest's abort methods. A 
more advanced solution would allow multiple requests and only abort ones that 
are conflicting with each other.

Cezary


On Fri, Jun 7, 2019 at 8:44 PM Dmitry Gusev  wrote:

> 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" (some

How to let the last ajaxResponseRenderer win?

2019-06-07 Thread Svein-Erik Løken
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




Name:

${destinationBeans.size()}



DEBUG nameFilter: ${namefilterDebug}




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





RE: Browser History API

2019-02-23 Thread Svein-Erik Løken
On history back (back button I browser) an old page can be used (included 
outdated cookies).

I am using Tapestry templates if it fills my needs. The code gets more robust 
that way. On more complicated UX parts when state changes and fields need to be 
updated React is very nice. When Tapestry Zones gets to complicated I switch to 
React, or mix them.

The communication with Tapestry is done using ajax or forms. A snippet using 
Tapestry form:

   let $hiddenAirTemp = $("[data-id='hiddenAirTemp']");
let $waxDataForm = $(waxDataFormSelector);
WaxEndUser.stopCallback = (y: number) => {
$hiddenAirTemp.val(WaxEndUser.airTemp);
$waxDataForm.submit();
};

I use Tapestry Ajax to get good error messages:

   writeCookies() {
let options: MapUserSettings = {
focusSkateTrail: this.focusSkateTrail
};
TapestryUtil.ajax("/index" + ":writeMapUserSettingsCookies", {data: 
options});
};

tapestryutil.ts:
...
/*
 * @public
 * @param {string} url
 * @param {Object=} options
 * @param {{}|String|Array} [options.data]
 * @param {String} [options.method=POST]
 * @param {TapestryUtil.ResponseFunction} [options.success]
 * @param {TapestryUtil.ResponseFunction} [options.failure]
 * @param {Function} [options.complete]
 * @returns TapestryUtil.RequestWrapper
 */
static ajax(url: string, options?: AjaxOptions): RequestWrapper {
let newOptions = {...options};
return Ajax(url, newOptions);
};


I think TypeScript is a "must" to get good client code. I use also JSX. I am 
looking for a way to use the same interface for Tapstery/Java services and 
Typescript for data access. Maybe Kotlin can be used.

S-E


-Original Message-
From: JumpStart  
Sent: lørdag 23. februar 2019 03:01
To: Tapestry users 
Subject: Re: Browser History API

Very interesting. A couple of questions:

What issues is that header addressing?

What role is Tapestry playing in your spa? How is React communicating with 
Tapestry?

> On 22 Feb 2019, at 3:26 pm, Svein-Erik Løken  wrote:
> 
> For single page web apps I recommend setting:
> 
> response.setHeader("Cache-Control", "no-cache, max-age=0, must-revalidate, 
> no-store");
> 
> I am using Tapestry + React + Typescript for my single page application - 
> works very well 😊
> 
> -Original Message-
> From: JumpStart  
> Sent: fredag 22. februar 2019 02:16
> To: Tapestry users 
> Subject: Re: Browser History API
> 
> Thank you, but I think I’ll mostly want the server-side making the decision 
> on what to make navigable. We shall see how that pans out.
> 
>> On 21 Feb 2019, at 3:29 pm, Svein-Erik Løken  wrote:
>> 
>> You can manipulate the URL from Javascript/Typescript:
>> 
>> (history as History).replaceState(null, "", location.protocol + '//' + 
>> location.host + location.pathname + "/yourUrlPart");
>> 
>> -Original Message-
>> From: JumpStart  
>> Sent: torsdag 21. februar 2019 05:39
>> To: Tapestry users 
>> Subject: Browser History API
>> 
>> Has anyone made use of the browser History API with Tapestry AJAX calls?
>> 
>> I have an essentially single page app, all done with Zones and async event 
>> links. Tabs down one side flips between major functions (eg. Clients, 
>> Calendar, Billing), replacing the main pane contents, and clicking on 
>> buttons and links in the pane will often drill into a sub-function (eg. View 
>> Client, Pay Invoice). All requests are async=“true” and render Zones.
>> 
>> The problem is that the URL in the browser never changes, so if you choose 
>> Refresh then you’ll go back to the initially displayed page. 
>> 
>> But, the app does support query params in the URLs that can navigate to the 
>> right place (eg. ?fun=CLIENT&sub=UPDATE). I guess what I’d like is a way to 
>> tell AjaxResponseRenderer what URL I’d like handed to the browser History 
>> API, and for it to be done automatically.
>> 
>> Cheers,
>> 
>> Geoff
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>> 
>> 
>> -
>> 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

RE: Browser History API

2019-02-21 Thread Svein-Erik Løken
For single page web apps I recommend setting:

response.setHeader("Cache-Control", "no-cache, max-age=0, must-revalidate, 
no-store");

I am using Tapestry + React + Typescript for my single page application - works 
very well 😊

-Original Message-
From: JumpStart  
Sent: fredag 22. februar 2019 02:16
To: Tapestry users 
Subject: Re: Browser History API

Thank you, but I think I’ll mostly want the server-side making the decision on 
what to make navigable. We shall see how that pans out.

> On 21 Feb 2019, at 3:29 pm, Svein-Erik Løken  wrote:
> 
> You can manipulate the URL from Javascript/Typescript:
> 
> (history as History).replaceState(null, "", location.protocol + '//' + 
> location.host + location.pathname + "/yourUrlPart");
> 
> -Original Message-
> From: JumpStart  
> Sent: torsdag 21. februar 2019 05:39
> To: Tapestry users 
> Subject: Browser History API
> 
> Has anyone made use of the browser History API with Tapestry AJAX calls?
> 
> I have an essentially single page app, all done with Zones and async event 
> links. Tabs down one side flips between major functions (eg. Clients, 
> Calendar, Billing), replacing the main pane contents, and clicking on buttons 
> and links in the pane will often drill into a sub-function (eg. View Client, 
> Pay Invoice). All requests are async=“true” and render Zones.
> 
> The problem is that the URL in the browser never changes, so if you choose 
> Refresh then you’ll go back to the initially displayed page. 
> 
> But, the app does support query params in the URLs that can navigate to the 
> right place (eg. ?fun=CLIENT&sub=UPDATE). I guess what I’d like is a way to 
> tell AjaxResponseRenderer what URL I’d like handed to the browser History 
> API, and for it to be done automatically.
> 
> Cheers,
> 
> Geoff
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org


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



RE: Browser History API

2019-02-20 Thread Svein-Erik Løken
You can manipulate the URL from Javascript/Typescript:

(history as History).replaceState(null, "", location.protocol + '//' + 
location.host + location.pathname + "/yourUrlPart");

-Original Message-
From: JumpStart  
Sent: torsdag 21. februar 2019 05:39
To: Tapestry users 
Subject: Browser History API

Has anyone made use of the browser History API with Tapestry AJAX calls?

I have an essentially single page app, all done with Zones and async event 
links. Tabs down one side flips between major functions (eg. Clients, Calendar, 
Billing), replacing the main pane contents, and clicking on buttons and links 
in the pane will often drill into a sub-function (eg. View Client, Pay 
Invoice). All requests are async=“true” and render Zones.

The problem is that the URL in the browser never changes, so if you choose 
Refresh then you’ll go back to the initially displayed page. 

But, the app does support query params in the URLs that can navigate to the 
right place (eg. ?fun=CLIENT&sub=UPDATE). I guess what I’d like is a way to 
tell AjaxResponseRenderer what URL I’d like handed to the browser History API, 
and for it to be done automatically.

Cheers,

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



RE: QuickStart

2018-11-27 Thread Svein-Erik Løken
I think Tapestry is super for small to medium projects. Tapestry has bundled 
JQuery, datatable, boostrap, underscore etc. It comes with a lot of nice usable 
Tapestry components. Tapestry takes care of making everything working together, 
but you can use your own version of e.g. JQuery if you want. Tapestry is very 
customable. Live class reloading makes the development superfast. For easy UX I 
am using plain Tapestry templates. For more advanced applications (single page) 
I am using some React/JSX. Some elements in the page are still Tapestry Zones 
because they easy to use. Tapestry works nice as a service layer for serving 
data to my JavaScript when needed.

I think Spring is for large projects.

S-E

From: Qbyte Consulting [via Apache Tapestry Mailing List Archives] 

Sent: mandag 26. november 2018 09:13
To: Svein-Erik Løken 
Subject: Re: QuickStart

Setting up a tapestry project for building a trivial webapp for back office 
data entry is still very efficient.

Angular is a glorified java script library, not a web application framework.

Sent from my iPhone

> On 26 Nov 2018, at 14:09, Emmanuel Sowah <[hidden 
> email]> wrote:
>
> Dude,
>
> Really setting up tapestry for a new project? Are you out of your mind?
> Tapestry is a dying project, even it's founder Howard Lewis Ship has
> abandoned his ship long ago and jumped onto another modern framework.
> Pickup Angular or another modern framework for your new project.
> Cheers.
>
> On Mon, Nov 26, 2018 at 6:53 AM Qbyte Consulting <[hidden 
> email]>
> wrote:
>
>> Hi,
>>
>> I’m trying to setup a bare bones tapestry project in maven 3.
>>
>> Can anyone point me an example how to do that please?
>>
>> John
>>
>> Sent from my iPhone
>> -
>> To unsubscribe, e-mail: [hidden 
>> email]
>> For additional commands, e-mail: [hidden 
>> email]
>>
>>

-
To unsubscribe, e-mail: [hidden 
email]
For additional commands, e-mail: [hidden 
email]

If you reply to this email, your message will be added to the discussion below:
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/QuickStart-tp5734100p5734102.html
To unsubscribe from users@tapestry.apache.org<mailto:users@tapestry.apache.org> 
Mailing List Archives, click 
here<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2375125&code=c3ZlaW5AamFjaWxsYS5ub3wyMzc1MTI1fC0xNTM4NzY2ODg4>.
NAML<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


RE: Javacsript module problem

2018-03-26 Thread Svein-Erik Løken
Take a look at the page source in the browser. Tapestry 5.4 loads modules at 
the end of the page.

A sample of the tapestry way (what I know) to load shim:
In AppModule.java
@Contribute(ModuleManager.class)
public static void setupMyBaseModules(MappedConfiguration 
configuration,
  
@Path("META-INF/assets/jacillacore/highcharts/highcharts.src.js") Resource 
highchartsSrc,
  
@Path("META-INF/assets/jacillacore/highcharts/highcharts-more.src.js") Resource 
highchartsMoreSrc) {
configuration.add("highcharts", new 
JavaScriptModuleConfiguration(highchartsSrc));
configuration.add("highchartsMore", new 
JavaScriptModuleConfiguration(highchartsMoreSrc).dependsOn("highcharts"));
}

I would recommend to use AMD modules instead of inline javascript.

S-E

From: Ric-01 [via Apache Tapestry Mailing List Archives] 

Sent: mandag 26. mars 2018 23:07
To: Svein-Erik Løken 
Subject: Re: Javacsript module problem

Hi Cezary,

first thanks. Yes, it was a mixture of all that, meanwhile I studied the
requirejs documentation strongly and checked out the tapestry5-jquery
project, to learn from it.

And now a lot of things are already working!

A lot in requirejs and AMD semms to be magical and I prefer to do java
coding, but we'll never stop to learn...

Regards, Erich



Am 26.03.2018 17:21, schrieb Cezary Biernacki:

> Hi Erich,
>
> One problem I can see is that function showLoadingIndicator() is not
> exported from define(.., function() { ... }). You should add "return {
> showLoadingIndicator: showLoadingIndicator };" at the end of "function() {
> ... }".
>
> However I believe it will not solve a problem indicated by message
> "Couldn’t resolve classpath asset from path
> META-INF\modules\hotel\loadingIndicatorTrigger.js" (I guess you are on
> Windows, so slashes are translated to slashes, but it should not be an
> issue). It suggests that the JS file is missing. So either it was not
> copied from the source directories to the directories (or JARs) used during
> execution - check your build directories to see if the file is really
> there, if not, than run your build process. Or file name
> "hotel/loadingIndicatorTrigger"
> is misspelled in somewhere.
>
> Cezary
>
>
>
>
>
> On Sun, Mar 25, 2018 at 3:19 PM, Erich Gormann<[hidden 
> email]>  wrote:
>
>> Dear all,
>>
>>  From a java class I load a js module and try to invoke a method in it
>> using the following line:
>>
>> javaScriptSupport.require("hotel/loadingIndicatorTrigger").
>> invoke("showLoadingIndicator");
>>
>> The script file loadingIndicatorTrigger.js is in
>> src/main/resources/META-INF/modules/hotel/loadingIndicatorTrigger.js
>>
>> This is the content of the script:
>> requirejs.config({
>> "shim": {
>> "hotel/globals/jquery.loading.indicator": {
>> deps: ["jquery"]
>> }
>> }
>> });
>>
>> define(["hotel/globals/jquery.loading.indicator"], function() {
>>
>> function showLoadingIndicator() {
>> var homeLoader = jQuery('body').loadingIndicator({
>> useImage: false,
>> }).data("loadingIndicator");
>> homeLoader.show();
>> }
>>
>> });
>>
>> Now the browser console prompts always the following error: "RequireJS
>> error: require: moduleLib is undefined".
>>
>> In my Eclipse I see a warning in above line of java code: "Couldn’t
>> resolve classpath asset from path META-INF\modules\hotel\loading
>> IndicatorTrigger.js"
>>
>> I tried different things like
>> define(["jquery", "hotel/globals/jquery.loading.indicator"], function($) {
>> buterror is always the same.
>>
>> Is there something missing in my configuration or in the applications
>> module class?
>>
>> Thanks for your help!
>>
>>
>> Regards, Erich
>>
>>
>>
>>
>>
>> -
>> To unsubscribe, e-mail: [hidden 
>> email]
>> For additional commands, e-mail: [hidden 
>> email]
>>
>>


-
To unsubscribe, e-mail: [hidden 
email]
For additional commands, e-mail: [hidden 
email]



If you reply to this email, your message will be added to the discussion below:
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Javacsript-module-problem-tp5733870p5733873.html
To unsubscribe from users@tapestry.apache.org<mailto:users@tapestry.apache.org> 
Mailing List Archives, click 
here<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2375125&code=c3ZlaW5AamFjaWxsYS5ub3wyMzc1MTI1fC0xNTM4NzY2ODg4>.
NAML<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


RE: Contribute requirejs.config.paths to ModuleManager

2017-11-28 Thread Svein-Erik Løken
I tried to fight it too, but had to capitulate. 

After some debugging my @Contribute(JavaScriptStackSource.class) was not set:

public class ModuleManagerImpl implements ModuleManager
{
private Resource resolveModuleNameToResource(String moduleName)
{
Resource resource = shimModuleNameToResource.get(moduleName);

if (resource != null)
{
return resource;
}

// Tack on a fake extension; otherwise modules whose name includes a 
'.' get mangled
// by Resource.withExtension().
String baseName = String.format("/META-INF/modules/%s.EXT", moduleName);

Resource baseResource = classpathRoot.forFile(baseName);

for (String extension : extensions)
{
resource = baseResource.withExtension(extension);

if (resource.exists())
{
return resource;
}
}

// Return placeholder for null:
return classpathRoot;
}

My module is not listed in shimModuleNameToResource, and does not exist in 
/META-INF/modules/%s.EXT. The result is an empty classpathRoot.


I think I don't fully understand JavaScriptStack. I think a method is missing: 
Map getJavaScriptModules(). I would like 
to have a example of how to include a AMD/UMD module. What about support for 
CommonJS?




In the debugging process I found that @Contribute(ModuleManager.class) was the 
perfect choice for me.

@Contribute(ModuleManager.class)
public static void setupMyBaseModules(MappedConfiguration 
configuration, @Symbol(SymbolConstants.PRODUCTION_MODE) boolean productionMode) 
{
String[] reactModules = {"react", "react-dom"};
String ext = productionMode ? ".min.js" : ".js";
for (String m : reactModules) {
configuration.add(m, new JavaScriptModuleConfiguration(new 
ClasspathResource(String.format("META-INF/assets/js/%s%s", m, ext;
}
}

I think I was fooled by:

The documentation for ModuleManager.class say:
"...This is primarily used to wrap non-AMD compliant libraries for use with 
RequireJS"

The internal variable Map shimModuleNameToResource in 
ModuleManagerImpl. The shim prefix...

S-E




From: Chris Poulsen [via Apache Tapestry Mailing List Archives] 
[mailto:ml+s1045711n5733731...@n5.nabble.com] 
Sent: tirsdag 28. november 2017 08:34
To: Svein-Erik Løken 
Subject: Re: Contribute requirejs.config.paths to ModuleManager

Hi, 

It has been a while since I last fought the module system, but in some 
cases I've used a request filter to map between module and asset paths 
(triggering on known module paths and then returning permanent redirects to 
the actual asset urls in the filter) - This was necessary in order to get 
stuff like CK editor to load properly as a module and still allowing it to 
dynamically require its plugins IIRC. 

-- 
Chris 




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


RE: Contribute requirejs.config.paths to ModuleManager

2017-11-27 Thread Svein-Erik Løken
Got this error message (very informative):

org.apache.tapestry5.ioc.util.UnknownValueException
Unable to create a client URL for classpath resource 
META-INF/modules/react/react.min.js: The resource path was not within an 
aliased path.
availableValues
Aliased paths:
• META-INF/assets
• META-INF/assets/core
• META-INF/assets/democore
• com/demo/core
• com/demo/module1
• com/demo/module1
• org/apache/tapestry5
• org/apache/tapestry5



Tried other locations:

public class ReactStack implements JavaScriptStack {
private final AssetSource assetSource;

public ReactStack(final AssetSource assetSource) {
this.assetSource = assetSource;
}

public List getJavaScriptLibraries() {
List ret = new ArrayList<>();
//
ret.add(assetSource.getClasspathAsset("/META-INF/modules/react/react.min.js"));
//
ret.add(assetSource.getClasspathAsset("/META-INF/assets/react/react.min.js"));
//
ret.add(assetSource.getClasspathAsset("/META-INF/assets/react/react.js"));
//
ret.add(assetSource.getClasspathAsset("/META-INF/assets/react.min.js"));
ret.add(assetSource.getClasspathAsset("/META-INF/assets/react.js"));
return ret;
}


Still getting:
Loading 1 libraries
Loading library /assets/meta/z94ea83c9/react.js
Executing 3 inits
Loaded module bootstrap/collapse
GET http://localhost:9876/modules.gz/react.js 404 (No module for path 
'react.js'.)

Very strange that the virtual link does not work! 

S-E
 

From: Thiago H de Paula Figueiredo [via Apache Tapestry Mailing List Archives] 
[mailto:ml+s1045711n5733729...@n5.nabble.com] 
Sent: mandag 27. november 2017 13:32
To: Svein-Erik Løken 
Subject: Re: Contribute requirejs.config.paths to ModuleManager

On Sun, Nov 26, 2017 at 10:40 AM, Svein-Erik Løken 
 wrote: 

> Source code: 
> 

> @Contribute(JavaScriptStackSource.class) 
> public static void addMyStack(MappedConfiguration JavaScriptStack> configuration) { 
>     configuration.addInstance("react", ReactStack.class); 
> } 
> 
> @Contribute(JavaScriptStack.class) 
> @Core 
> public static void addAppModules(OrderedConfiguration 
> configuration) { 
>     configuration.add("react", StackExtension.module("react")); 
> } 
> 

These look correct. ^^^ 

> public class ReactStack implements JavaScriptStack { 
>     private final AssetSource assetSource; 
> 
>     public ReactStack(final AssetSource assetSource) { 
>         this.assetSource = assetSource; 
>     } 
> 
>     public List getJavaScriptLibraries() { 
>         List ret = new ArrayList<>(); 
>         ret.add(assetSource.getClasspathAsset("/META-INF/ 
> assets/react.min.js")); 
>         return ret; 
>     } 
> 
>     @Override 
>     public List getModules() { 
>         List ret = new ArrayList<>(); 
>         ret.add("react"); 
>         return ret; 
>     } 
> 

I believe your error was having the getModules() method above return a list 
with 'react'. According to its JavaDoc, getModules() must return the 
modules on which this stack depends. It doesn't actually depend on the 
'react' module. Please try having that method return an empty List and tell 
us what happens. 

You may also need to move react.min.js to 
/META-INF/modules/react/react.min.js. 


If you reply to this email, your message will be added to the discussion below:
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Contribute-requirejs-config-paths-to-ModuleManager-tp5733721p5733729.html
 
To unsubscribe from mailto:users@tapestry.apache.org Mailing List Archives, 
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2375125&code=c3ZlaW5AamFjaWxsYS5ub3wyMzc1MTI1fC0xNTM4NzY2ODg4.
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
 


RE: Contribute requirejs.config.paths to ModuleManager

2017-11-26 Thread Svein-Erik Løken
I think the JavaScriptStack is the correct way!



I cannot make it work! I thought my code would create a link from module 
"react" to /assets/meta/z94ea83c9/react.min.js.



JS: define(["react"], function (react) {

and/or

@AfterRender
void testReactModuleLoading() {
javaScriptSupport.require("react");
}

Log:

Loading 1 libraries

Loading library /assets/meta/z94ea83c9/react.min.js

Executing 3 inits

Loaded module bootstrap/collapse

GET http://localhost:9876/modules.gz/react.js 404 (No module for path 
'react.js'.)



Source code:

@Contribute(JavaScriptStackSource.class)
public static void addMyStack(MappedConfiguration 
configuration) {
configuration.addInstance("react", ReactStack.class);
}

@Contribute(JavaScriptStack.class)
@Core
public static void addAppModules(OrderedConfiguration 
configuration) {
configuration.add("react", StackExtension.module("react"));
}



public class ReactStack implements JavaScriptStack {
private final AssetSource assetSource;

public ReactStack(final AssetSource assetSource) {
this.assetSource = assetSource;
}

public List getJavaScriptLibraries() {
List ret = new ArrayList<>();
ret.add(assetSource.getClasspathAsset("/META-INF/assets/react.min.js"));
return ret;
}

@Override
public List getModules() {
List ret = new ArrayList<>();
ret.add("react");
return ret;
}







From: Thiago H de Paula Figueiredo [via Apache Tapestry Mailing List Archives] 
[mailto:ml+s1045711n5733724...@n5.nabble.com]
Sent: fredag 24. november 2017 22:03
To: Svein-Erik Løken 
Subject: Re: Contribute requirejs.config.paths to ModuleManager

I'm wondering here whether the best approach is the one you've chosen here,
usually used when you're dealing with non-AMD-module-compliant JavaScript
libraries, while React is compliant. I believe you should create a
JavaScriptStack with the React .js files, contribute it to the
JavaScriptStackSource service, then add your module to the core one (i.e.
the one included in all pages). See
https://tapestry.apache.org/javascript-modules.html, section Aggregating
Modules:

Because Tapestry is open, it is possible to contribute modules even into
the *core* JavaScript stack.  This is done using your application's module:
@Contribute(JavaScriptStack.class)
@Core
public static void addAppModules(OrderedConfiguration
configuration) {
configuration.add("tree-viewer", StackExtension.module("tree-viewer"));
configuration.add("app-utils", StackExtension.module("app-utils"));
}
So yes, Tapestry already supports what you want. :)


On Fri, Nov 24, 2017 at 3:20 PM, Svein-Erik Løken <[hidden 
email]> wrote:

> React can in theory be used in all pages (globally). It will be like a
> core library for me, like jquery, underscore, bootstrap, etc. In TypeScript
> I am using
> "compilerOptions": {
> "module": "amd".
>
> I have written a service:
> @Override
> public void appendToModulePath(JSONObject cfg) {
> javaScriptSupport.addModuleConfigurationCallback(configuration -> {
> if (!configuration.has("paths")) {
> configuration.put("paths", cfg);
> } else {
> configuration.getJSONObject("paths").putAll(cfg.toMap());
> }
> return configuration;
> });
> }
>
> I am now calling this in my global  like “leaflet”:”leaflet-src” on pages with a map.
>
> Setting requirejs.config.paths globally should not load anything until
> loaded by require.
> E.g: JS from a transpiled TypeScript with React: define(["require",
> "exports", "react", "react-dom"], function (require, exports, React,
> ReactDOM) {
>
> I can try the Mixin technique, but still think Tapestry should have a way
> of contribute requirejs.config.paths.  You have a nice way contribute
> requirejs.config.shim which maybe could be modified to also accept paths.
> To support modern JS frameworks I think setting requirejs.config.paths in a
> nice way globally should be implemented.
>
> S-E
>
> From: Thiago H de Paula Figueiredo [via Apache Tapestry Mailing List
> Archives] [mailto:[hidden 
> email]]
> Sent: fredag 24. november 2017 17.02
> To: Svein-Erik Løken <[hidden 
> email]>
> Subject: Re: Contribute requirejs.config.paths to ModuleManager
>
> On Fri, Nov 24, 2017 at 11:13 AM, Svein-Erik Løken <[hidden
> email]> wrote:
>
> Hello!
>
> Trying to use TypeScript and React with Tapestry:
> >
> > In TypeScript I need to use:  import * as React from "react";
> >
> > I would like to load react: react

RE: Contribute requirejs.config.paths to ModuleManager

2017-11-24 Thread Svein-Erik Løken
React can in theory be used in all pages (globally). It will be like a core 
library for me, like jquery, underscore, bootstrap, etc. In TypeScript I am 
using
"compilerOptions": {
"module": "amd".

I have written a service:
@Override
public void appendToModulePath(JSONObject cfg) {
javaScriptSupport.addModuleConfigurationCallback(configuration -> {
if (!configuration.has("paths")) {
configuration.put("paths", cfg);
} else {
configuration.getJSONObject("paths").putAll(cfg.toMap());
}
return configuration;
});
}

I am now calling this in my global mailto:ml+s1045711n5733722...@n5.nabble.com]
Sent: fredag 24. november 2017 17.02
To: Svein-Erik Løken 
Subject: Re: Contribute requirejs.config.paths to ModuleManager

On Fri, Nov 24, 2017 at 11:13 AM, Svein-Erik Løken <[hidden 
email]> wrote:

Hello!

Trying to use TypeScript and React with Tapestry:
>
> In TypeScript I need to use:  import * as React from "react";
>
> I would like to load react: react.min, so I have to set paths: {...}
>
> The configuration should be set at startup, but I cannot figure how to do
> it. I can set requirejs.config.shim, but not paths.
>

Are you using React in all pages or just some of them?

>
> I tried to load it with @Contribute(ModuleManager.class), but could not
> figure out how.
>
> PSEUDO CODE
> @Contribute(ModuleManager.class)
> public static void setupMyBaseModules(MappedConfiguration
> configuration) {
> JSONObject pathsConfig = new JSONObject(
> "react", "react.min",
> "react-dom", "react-dom.min"
> );
> AMDResourceConfiguration paths = new AMDResourceConfiguration("paths",
> pathsConfig);
> configuration.add(null, new JavaScriptModuleConfiguration(paths));
> }
>

MappedConfiguration, as far as I can remember, doesn't accept null as the
contribution id. Even if it does, it's a bad idea.

> Tried to load it this way:
> @Startup
> public void registerToClearPlasticProxyFactoryOnInvalidation(JavaScriptSupport
> javaScriptSupport) {
> ModuleConfigurationCallback callback = new
> ModuleConfigurationCallback() {
> @Override
> public JSONObject configure(JSONObject configuration) {
> configuration.put("paths",
> new JSONObject(
> "react", "react.min",
> "react-dom", "react-dom.min"
> ));
> return configuration;
> }
> };
> javaScriptSupport.addModuleConfigurationCallback(callback);
> }



> [ERROR] ioc.Registry org.apache.tapestry5.ioc.util.UnknownValueException:
> No object of type org.apache.tapestry5.services.javascript.JavaScriptSupport
> is available from the Environment.


I'm afraid this isn't the correct way of using
JavaScriptSupport.addModuleConfigurationCallback(). It should be used while
rendering a page or handling an event. The way you did it above, you're
trying to add JavaScript at application startup. You need to do this in
page or component classes.


> Now I am loading the configuration in @SetupRender, but it should be
> loaded globally.
>

Define "globally", please. All pages, including error ones? Most pages? The
better way of doing this is moving this code to a mixin and apply it to the
pages where you need React. If you want it in all pages, you can contribute
a ComponentClassTransformWorker2 to the service with the same name which
applies the mixin to all pages. See
MutableComponentModel.addMixinClassName().

--
Thiago


If you reply to this email, your message will be added to the discussion below:
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Contribute-requirejs-config-paths-to-ModuleManager-tp5733721p5733722.html
To unsubscribe from users@tapestry.apache.org<mailto:users@tapestry.apache.org> 
Mailing List Archives, click 
here<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2375125&code=c3ZlaW5AamFjaWxsYS5ub3wyMzc1MTI1fC0xNTM4NzY2ODg4>.
NAML<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


Contribute requirejs.config.paths to ModuleManager

2017-11-24 Thread Svein-Erik Løken
Trying to use TypeScript and React with Tapestry:

In TypeScript I need to use:  import * as React from "react";

I would like to load react: react.min, so I have to set paths: {...}

The configuration should be set at startup, but I cannot figure how to do it. I 
can set requirejs.config.shim, but not paths.

I tried to load it with @Contribute(ModuleManager.class), but could not figure 
out how.

PSEUDO CODE
@Contribute(ModuleManager.class)
public static void setupMyBaseModules(MappedConfiguration 
configuration) {
JSONObject pathsConfig = new JSONObject(
"react", "react.min",
"react-dom", "react-dom.min"
);
AMDResourceConfiguration paths = new AMDResourceConfiguration("paths", 
pathsConfig);
configuration.add(null, new JavaScriptModuleConfiguration(paths));
}


Tried to load it this way:


@Startup
public void registerToClearPlasticProxyFactoryOnInvalidation(JavaScriptSupport 
javaScriptSupport) {
ModuleConfigurationCallback callback = new
ModuleConfigurationCallback() {
@Override
public JSONObject configure(JSONObject configuration) {
configuration.put("paths",
new JSONObject(
"react", "react.min",
"react-dom", "react-dom.min"
));
return configuration;
}
};
javaScriptSupport.addModuleConfigurationCallback(callback);
}

[ERROR] ioc.Registry org.apache.tapestry5.ioc.util.UnknownValueException: No 
object of type org.apache.tapestry5.services.javascript.JavaScriptSupport is 
available from the Environment.






Now I am loading the configuration in @SetupRender, but it should be loaded 
globally.


@Inject
JavaScriptSupport javaScriptSupport;

private static final ModuleConfigurationCallback CALLBACK = new
ModuleConfigurationCallback() {
@Override
public JSONObject configure(JSONObject configuration) {
configuration.put("paths",
new JSONObject(
"react", "react.min",
"react-dom", "react-dom.min"
));
return configuration;
}
};

@SetupRender
public void configureRequireJS() {
javaScriptSupport.addModuleConfigurationCallback(CALLBACK);
}

Can this be configuration be contribute to the ModuleManager.class? I think 
this should be supported in Tapestry.

S-E





Re: Configuring RequireJS?

2017-11-22 Thread Svein-Erik Løken
Use configuration.put("paths",



not configuration.append("paths",



took me some time to find out...



In reply to 
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Configuring-RequireJS-td5732979.html



RE: Configuring RequireJS?

2017-11-22 Thread Svein-Erik Løken
Use configuration.put("paths",



not configuration.append("paths",



took me some time to find out...



In reply to 
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Configuring-RequireJS-td5732979.html



Configuring RequireJS?

2017-11-22 Thread Svein-Erik Løken
Use configuration.put("paths",



not configuration.append("paths",



took me some time to find out...



Lots of 'Unknown macro: {div}' in documentation

2017-10-31 Thread Svein-Erik Løken
E.g.: http://tapestry.apache.org/configuration.html


RE: Cannot clear validation errors when form onSuccess returns a StreamResponse

2017-09-04 Thread Svein-Erik Løken
Just curious: How can you return javascript code? / Without javaScriptSupport?




RE: Cannot clear validation errors when form onSuccess returns a StreamResponse

2017-09-04 Thread Svein-Erik Løken
Thanks!

I was able to make this work. Do you think my solution is too complex Thiago?


/external/TrackSegmentsExport (the form):
==

@Persist(PersistenceConstants.FLASH)
boolean download;

@AfterRender
void afterRender() {
if (download) {

javaScriptSupport.require("util/util").invoke("windowLocation").with("/external/TrackSegmentsExportDownload");
}
}

Object onSuccessFromTrackExpForm() throws ParserConfigurationException, 
JAXBException, TransformerException, IOException {
download = true;
return null;
}



Utils.js:
==
Util.windowLocation = function (href) {
window.location = href;
};



/external/TrackSegmentsExportDownload:
==

StreamResponse onActivate() {
...
return new AttachmentStreamResponse(stream, "TrackSegmentsExport.gpx");






From: Thiago H de Paula Figueiredo [via Apache Tapestry Mailing List Archives] 
[mailto:ml+s1045711n5733608...@n5.nabble.com] 
Sent: mandag 4. september 2017 13:48
To: Svein-Erik Løken 
Subject: Re: Cannot clear validation errors when form onSuccess returns a 
StreamResponse

Hi! 

This is due to HTTP, not Tapestry itself: you cannot have two different 
responses to the same request. So, you either rerender the page to clear 
the errors (which calling form.clearErrors() is actually doing, even if you 
cannot see the results) or returns a binary download (StreamResponse), but 
not both. 

You'll need to write some JavaScript for that, so either the form 
submission or the file download request is done through JavaScript. Maybe 
the easiest solution, even if not pretty, is to return null in onSuccess(), 
rendering a 

Cannot clear validation errors when form onSuccess returns a StreamResponse

2017-09-04 Thread Svein-Erik Løken
If I record an error for my  I cannot find out how to clear errors 
(tried form.clearErrors()).

Because onSuccess returns a StreamResponse to download a file the form need to 
have async="false"

The form should stay open so user can download several files with different 
parameters.

Can anyone help!

S-E


RE: how to reconfigure my app so that it runs without "context" in the uri path

2017-08-29 Thread Svein-Erik Løken
Command line in IntelliJ, maven:
jetty:run -Duser.timezone=UTC -Dtapestry.execution-mode=development 
-Dtapestry-web-server-port=

Maybe it's easier to start with this project: 
https://github.com/sveine/tapestry-multi-module-demo.



RE: how to reconfigure my app so that it runs without "context" in the uri path

2017-08-28 Thread Svein-Erik Løken

org.eclipse.jetty
jetty-maven-plugin
9.3.10.v20160621


/


   
  80
   




From: Mats Andersson-2 [via Apache Tapestry Mailing List Archives] 
[mailto:ml+s1045711n5733590...@n5.nabble.com]
Sent: mandag 28. august 2017 07:31
To: Svein-Erik Løken 
Subject: Re: how to reconfigure my app so that it runs without "context" in the 
uri path

Hi Joshua,

It depends only on the container you are using to deploy the Tapestry
application. This is not different from any other Java application. If
you use Tomcat, see:
https://stackoverflow.com/questions/7276989/how-to-set-the-context-path-of-a-web-application-in-tomcat-7-0

Best regards
Mats

Den 2017-08-28 kl. 06:50, skrev Joshua Richardson:

> Hi, I'm looking to build an app using Tapestry.  I'm able to run the 
> Quickstart 5.4 app and then I see my app by going to localhost:8080/site/, 
> because I configured my project with the name, "site".
>
>
> Since I do not intend to ever run any other apps on this same server/port, I 
> would like to avoid the "/site/" portion of the url.
>
>
> I have not been able to figure out how to reconfigure the app so that I can 
> access it at the top level.  If i go to localhost:8080/, I get a 404, "No 
> context on this server matched or handled this request."
>
>
> Is this a limitation of Tapestry, or just a limitation in my understanding?
>
>
> Sincerely,
>
>
>
> Joshua Richardson
>
> Email:   [hidden email]
>
> Phone: 408-205-4417
>
> Skype:  jricjr
>
> In: https://www.linkedin.com/in/joshua-richardson-878b8b1/
>

--
-- Mats Andersson | Ronsoft AB | +46(0)73 368 79 82

-
To unsubscribe, e-mail: [hidden 
email]
For additional commands, e-mail: [hidden 
email]



If you reply to this email, your message will be added to the discussion below:
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/how-to-reconfigure-my-app-so-that-it-runs-without-context-in-the-uri-path-tp5733589p5733590.html
To unsubscribe from users@tapestry.apache.org<mailto:users@tapestry.apache.org> 
Mailing List Archives, click 
here<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2375125&code=c3ZlaW5AamFjaWxsYS5ub3wyMzc1MTI1fC0xNTM4NzY2ODg4>.
NAML<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


RE: Tapestry QuickStart Project (build unsuccessful)

2017-08-24 Thread Svein-Erik Løken
You only have to run this once, so I would recommend command line. The Tapestry 
project will not use the maven-archetype-plugin.


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



RE: Tapestry QuickStart Project (build unsuccessful)

2017-08-20 Thread Svein-Erik Løken
https://issues.apache.org/jira/browse/TAP5-2579


RE: [Announcement] New feature for Tapestry 5.4.2 and 5.5: easily call event handler methods from JavaScript

2017-04-27 Thread Svein-Erik Løken
See my working demo above in this thread:
(https://github.com/sveine/tapestry-multi-module-demo/blob/master/module1-root/module1/src/main/resources/META-INF/modules/publisheventdemo.js)

From: Thiago H de Paula Figueiredo [via Apache Tapestry Mailing List Archives] 
[mailto:ml+s1045711n5733456...@n5.nabble.com]
Sent: 27. april 2017 14:11
To: Svein-Erik Løken 
Subject: Re: [Announcement] New feature for Tapestry 5.4.2 and 5.5: easily call 
event handler methods from JavaScript

On Thu, Apr 27, 2017 at 6:43 AM, abangkis <[hidden 
email]> wrote:

> Hi. Thanks for the awesome improvement. I want to adopt it immediately.


Hi! Nice! :)


> But I've stumbled to one problem. How do I pass a parameter to the event?
>

You don't pass it to the event, but to the t5/core/ajax() function. Check
the data property of the options parameter in
https://tapestry.apache.org/current/coffeescript/ajax.html. Basically, you
pass an object with the key/value pairs you want passed as parameters:

ajax('answer', {
element: $('#result'),
/* Here it goes */
data: {
queryParameter1: valueParameter1,
queryParameter2: valueParameter2
}
/* Here it ends */
success: function(response) {
$('#result').text(response.json.origin);
}
});


--
Thiago


If you reply to this email, your message will be added to the discussion below:
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Announcement-New-feature-for-Tapestry-5-4-2-and-5-5-easily-call-event-handler-methods-from-JavaScript-tp5733295p5733456.html
To unsubscribe from users@tapestry.apache.org<mailto:users@tapestry.apache.org> 
Mailing List Archives, click 
here<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2375125&code=c3ZlaW5AamFjaWxsYS5ub3wyMzc1MTI1fC0xNTM4NzY2ODg4>.
NAML<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


RE: [Announcement] New feature for Tapestry 5.4.2 and 5.5: easily call event handler methods from JavaScript

2017-04-21 Thread Svein-Erik Løken
The @PublishEvent was a big improvement 😊



I am using it already. I have created a working demo. I really like that it is 
so easy to stop hardcoding of event url.





https://github.com/sveine/tapestry-multi-module-demo/blob/master/module1-root/module1/src/main/java/com/demo/module1/pages/PublishEventDemo.java

https://github.com/sveine/tapestry-multi-module-demo/blob/master/module1-root/module1/src/main/resources/com/demo/module1/pages/PublishEventDemo.tml

https://github.com/sveine/tapestry-multi-module-demo/blob/master/module1-root/module1/src/main/resources/META-INF/modules/publisheventdemo.js

https://github.com/sveine/tapestry-multi-module-demo/blob/master/core/src/main/resources/META-INF/modules/util/tapestryutil.js
 (TapestryUtil.ajaxEvent)


RE: Tapestry Quickstart problems

2017-04-20 Thread Svein-Erik Løken
https://issues.apache.org/jira/browse/TAP5-2579
https://issues.apache.org/jira/browse/TAP5-2580




RE: Mouse tracking with Tapestry

2017-04-15 Thread Svein-Erik Løken
Maybe not exactly what you are looking for, but I have been using my 
tapestryutil.js for some years with luck 😊

https://github.com/sveine/tapestry-multi-module-demo/blob/master/core/src/main/resources/META-INF/modules/util/tapestryutil.js

A little demo:
https://github.com/sveine/tapestry-multi-module-demo/blob/master/module1-root/module1/src/main/java/com/demo/module1/pages/AjaxDemo.java




Tapestry Quickstart problems

2017-04-15 Thread Svein-Erik Løken
The Quickstart project demonstrates how fast it is to start developing a 
Tapestry project.

I have been using it for a new project, but could not debug JavaScript. (I am 
using IntelliJ). I could not understand why, but after several hour a found out 
that configuration.add(SymbolConstants.MINIFICATION_ENABLED, true); was set in 
AppModule.java. I don't understand why this is set. I should not be set!!! If 
SymbolConstants.PRODUCTION_MODE= true then SymbolConstants.MINIFICATION_ENABLED 
is set to true.

Using maven3  I got error:

mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate (default-cli) on 
project standalone-pom: archetypeCatalog 'http://tapestry.apache.org' is not 
supported anymore. Please read the plugin documentation for details. -> [Help 1]

It is working with:
mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate 
-DarchetypeCatalog=https://repository.apache.org/content/repositories/staging

If I used same values as in https://tapestry.apache.org/getting-started.html I 
was asked two times:
mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate 
-DarchetypeCatalog= http://tapestry.apache.org 
or 
mvn org.apache.maven.plugins:maven-archetype-plugin:2.2:generate 
-DarchetypeCatalog= http://tapestry.apache.org

Choose archetype:
1: http://tapestry.apache.org -> org.apache.tapestry:quickstart (Tapestry 5 
Quickstart Project)
2: http://tapestry.apache.org -> org.apache.tapestry:tapestry-archetype 
(Tapestry 4.1.6 Archetype)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive 
contains): : 1
Choose org.apache.tapestry:quickstart version:
1: 5.0.19
2: 5.1.0.5
3: 5.2.6
4: 5.3.7
5: 5.4.1
Choose a number: 5: 5
Define value for property 'groupId': : com.example
Define value for property 'artifactId': : newapp
Define value for property 'version':  1.0-SNAPSHOT: :
Define value for property 'package':  com.example: : com.example.newapp
Confirm properties configuration:
groupId: com.example
artifactId: newapp
version: 1.0-SNAPSHOT
package: com.example.newapp
 Y: : Y
[INFO] 

[INFO] Using following parameters for creating project from Archetype: 
quickstart:5.4.1
[INFO] 

[INFO] Parameter: groupId, Value: com.example
[INFO] Parameter: artifactId, Value: newapp
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.example.newapp
[INFO] Parameter: packageInPathFormat, Value: com/example/newapp
[INFO] Parameter: package, Value: com.example.newapp
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: groupId, Value: com.example
[INFO] Parameter: artifactId, Value: newapp
[WARNING] Don't override file C:\JacDev\tmp\New folder\newapp\src\test\java
[WARNING] Don't override file C:\JacDev\tmp\New folder\newapp\src\main\webapp
[WARNING] Don't override file C:\JacDev\tmp\New 
folder\newapp\src\main\resources\com\example\newapp
[WARNING] Don't override file C:\JacDev\tmp\New folder\newapp\src\test\resources
[WARNING] Don't override file C:\JacDev\tmp\New folder\newapp\src\test\conf
[WARNING] Don't override file C:\JacDev\tmp\New folder\newapp\src\site
[INFO] project created from Archetype in dir: C:\JacDev\tmp\New folder\newapp
[INFO]
[INFO] >>> maven-archetype-plugin:2.4:generate (default-cli) @ standalone-pom 
>>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.4:generate (default-cli) @ standalone-pom 
<<<
[INFO]
[INFO] --- maven-archetype-plugin:2.4:generate (default-cli) @ standalone-pom 
---
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart 
(org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: http://tapestry.apache.org -> org.apache.tapestry:quickstart (Tapestry 5 
Quickstart Project)
2: http://tapestry.apache.org -> org.apache.tapestry:tapestry-archetype 
(Tapestry 4.1.6 Archetype)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive 
contains): :

Do you agree? Should I file this as bugs to Jira?

S-E

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



RE: Swipe and touch

2016-09-06 Thread Svein-Erik Løken
E.g. having a sidebar-flip on the edge of the screen, people will swipe on 
touch devices. On PC people will click.

Swipe down if on top of to refresh/reload, swipe right to go back, swipe left 
to go forward/next etc…

S-E


From: JumpStart [via Apache Tapestry Mailing List Archives] 
[mailto:ml-node+s1045711n5732960...@n5.nabble.com]
Sent: 6. september 2016 05:58
To: Svein-Erik Løken 
Subject: Re: Swipe and touch

I think that embedding a “touch” solution in T5.4 is a bad idea. This has been 
a fast-moving area, with lots of device-, and OS-version-, compatibility 
issues. Witness all of iOS’s touch-scroll issues over various releases.

I think the best we could do is have a plugin if someone’s willing to support 
it, but who’s willing to keep lots of old and new devices of various brands 
around? The next best thing is to provide sample solutions in the wiki.

Having said that, I think most of my iOS issues (in Safari and Cordova-based 
apps) disappeared with iOS 8.0. Touch usually works without any coding. Is that 
true for Android and other? What is an example of a “touch” issue you have?

These days the only effort I have to put in for “touch” (i.e. explicitly 
converting taps to clicks) is sortable ( http://jqueryui.com/demos/sortable ) 
and Cordova calendar.

BTW, swipe may be different. Currently I don’t use it.

Geoff

> On 6 Sep 2016, at 2:00 AM, Svein-Erik Løken <[hidden 
> email]> wrote:
>
> I have no problem adding javascript libs using RequireJS. On my web site 60% 
> of the end-users are using touch devices. To support then I have to handle 
> some touch and swipe events. I think Tapestry also need to do that in 
> upcoming versions.
>
> From: Chris Poulsen [via Apache Tapestry Mailing List Archives] 
> [mailto:[hidden email]]
> Sent: mandag 5. september 2016 15.00
> To: Svein-Erik Løken <[hidden 
> email]>
> Subject: Re: Swipe and touch
>
> I think the way to go is not to expose them / use them directly in onClick.
> Instead you bind them in a module (either using t5/core/dom or jquery).
> That way you are also keeping your global (script) scope much cleaner.
>
> Lots of the tapestry framework client side code use this pattern.
>
> --
> Chris
>
>
> On Mon, Sep 5, 2016 at 11:52 AM, Qbyte Consulting <[hidden 
> email]
>> wrote:
>
>> Okay, after splitting my JS up into logical pieces and deploying them using
>> the module approach I can get jquery mobile to work. Perhaps the loading
>> times or sequence of script run was breaking things before?
>>
>> Some trivial behaviours I added to a sidebar including a swipe out:
>>
>> (function () {
>>define(["jquery"], function ($) {
>>
>>$("#go").click(function () {
>>$("#sidebar").show("fast");
>>});
>>$("#stop").click(function () {
>>$("#sidebar").hide("fast");
>>});
>>$("#sidebar").on("swipeleft", function () {
>>$("#sidebar").hide("slow");
>>});
>>});
>> }).call(this);
>>
>> My locate module, I couldn't get to drips with the utils url extender so
>> have coded manually:
>>
>> (function () {
>>define(["t5/core/ajax"], function (ajax) {
>>geoLocate = function (eventLinkURI) {
>>if (navigator.geolocation) {
>>navigator.geolocation
>>.getCurrentPosition(function (position)
>>{
>>var geolink = eventLinkURI
>>+ "?lat=" + position.coords.latitude
>>+ "&long=" + position.coords.longitude;
>>ajax(geolink, null);
>>}, geoError);
>>}
>>};
>>function geoError() {
>>alert('There was a problem determining your location. Some
>> features may not be available.');
>>}
>>return {
>>geoLocate: geoLocate
>>};
>>});
>> }).call(this);
>>
>> I still can't figure out how to access functions defined in modules
>> directly using onclick= though, any ideas how to export them for direct
>> client side access?
>>
>> On Fri, Sep 2, 2016 at 9:49 PM, Qbyte Consulting <
>> [hidden email]>
>> wrote:
>>
>>> I tried to add jquery mobile to my T5.4 project for swipe but it cracks
>>> up. Same for angularjs.
>>>
>>> Is there additional config

RE: Swipe and touch

2016-09-05 Thread Svein-Erik Løken
I have no problem adding javascript libs using RequireJS. On my web site 60% of 
the end-users are using touch devices. To support then I have to handle some 
touch and swipe events. I think Tapestry also need to do that in upcoming 
versions.

From: Chris Poulsen [via Apache Tapestry Mailing List Archives] 
[mailto:ml-node+s1045711n5732956...@n5.nabble.com]
Sent: mandag 5. september 2016 15.00
To: Svein-Erik Løken 
Subject: Re: Swipe and touch

I think the way to go is not to expose them / use them directly in onClick.
Instead you bind them in a module (either using t5/core/dom or jquery).
That way you are also keeping your global (script) scope much cleaner.

Lots of the tapestry framework client side code use this pattern.

--
Chris


On Mon, Sep 5, 2016 at 11:52 AM, Qbyte Consulting <[hidden 
email]
> wrote:

> Okay, after splitting my JS up into logical pieces and deploying them using
> the module approach I can get jquery mobile to work. Perhaps the loading
> times or sequence of script run was breaking things before?
>
> Some trivial behaviours I added to a sidebar including a swipe out:
>
> (function () {
> define(["jquery"], function ($) {
>
> $("#go").click(function () {
> $("#sidebar").show("fast");
> });
> $("#stop").click(function () {
> $("#sidebar").hide("fast");
> });
> $("#sidebar").on("swipeleft", function () {
> $("#sidebar").hide("slow");
> });
> });
> }).call(this);
>
> My locate module, I couldn't get to drips with the utils url extender so
> have coded manually:
>
> (function () {
> define(["t5/core/ajax"], function (ajax) {
> geoLocate = function (eventLinkURI) {
> if (navigator.geolocation) {
> navigator.geolocation
> .getCurrentPosition(function (position)
> {
> var geolink = eventLinkURI
> + "?lat=" + position.coords.latitude
> + "&long=" + position.coords.longitude;
> ajax(geolink, null);
> }, geoError);
> }
> };
> function geoError() {
> alert('There was a problem determining your location. Some
> features may not be available.');
> }
> return {
> geoLocate: geoLocate
> };
> });
> }).call(this);
>
> I still can't figure out how to access functions defined in modules
> directly using onclick= though, any ideas how to export them for direct
> client side access?
>
> On Fri, Sep 2, 2016 at 9:49 PM, Qbyte Consulting <
> [hidden email]>
> wrote:
>
> > I tried to add jquery mobile to my T5.4 project for swipe but it cracks
> > up. Same for angularjs.
> >
> > Is there additional config required to add js libraries? Since I have
> > jquery set up already I figured I could just add the mobile.
> >
> > Sent from my iPhone
> >
> > > On 2 Sep 2016, at 19:40, Thiago H de Paula Figueiredo <
> > [hidden email]> wrote:
> > >
> > >> On Fri, 02 Sep 2016 15:18:24 -0300, Svein-Erik Løken <
> [hidden email]>
> > wrote:
> > >>
> > >> I cannot find any swipe and touch JavaScript library in Tapestry. Are
> > there any plans to include one in Tapestry in the future?
> > >
> > > No, as it's pretty easy to use almost any JS library or framework
> inside
> > Tapestry. ;) :)
> > >
> > >> If it is - I will use that library now. The Tapestry dev team use to
> > find the best library :) It seems that Hammer JS and Touch Swipe are
> > popular(?). Any recommendation?
> > >
> > > I'm sorry, but I haven't used any of them.
> > >
> > > --
> > > Thiago H. de Paula Figueiredo
> > > Tapestry, Java and Hibernate consultant and developer
> > > http://machina.com.br
> > >
> > > -
> > > To unsubscribe, e-mail: [hidden 
> > > email]
> > > For additional commands, e-mail: [hidden 
> > > email]
> > >
> >
>


If you reply to this email, your message will be added to the discussion below:
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Swipe-and-touch-tp5732951p5732956.html
To unsubscribe from users@tapestry.apache.org<mailto:users@tapestry.apache.org> 
Mailing List Archives, click 
here<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2375125&code=c3ZlaW5AamFjaWxsYS5ub3wyMzc1MTI1fC0xNTM4NzY2ODg4>.
NAML<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


Swipe and touch

2016-09-02 Thread Svein-Erik Løken
I cannot find any swipe and touch JavaScript library in Tapestry. Are there any 
plans to include one in Tapestry in the future? If it is - I will use that 
library now. The Tapestry dev team use to find the best library :) It seems 
that Hammer JS and Touch Swipe are popular(?). Any recommendation?

S-E


RE: Logical Page Name Shortening

2016-08-29 Thread Svein-Erik Løken
@Contribute(PageRenderLinkTransformer.class)
@Primary
public static void 
provideURLRewriting(OrderedConfiguration 
configuration) {
configuration.addInstance("SupportOldPhpUrls", 
OldPhpSystemLinkTransformer.class);
}



public class OldPhpSystemLinkTransformer implements PageRenderLinkTransformer {

private static final String[] COUNTYS = {"oppland", "hedmark", 
"sortrondelag", "buskerud", "telemark", "nordtrondelag", "troms", "akershus", 
"nordland", "oslo", "hordaland", "austagder", "moreogromsdal", "vestagder", 
"rogaland", "sognogfjordane", "finnmark", "vestfold", "ostfold", "lappland"};

@Inject
private ContextValueEncoder contextValueEncoder;
@Inject
ComponentClassResolver componentClassResolver;

@Override
public Link transformPageRenderLink(Link defaultLink, 
PageRenderRequestParameters parameters) {
return defaultLink;
}

@Override
public PageRenderRequestParameters decodePageRenderRequest(Request request) 
{
String path = request.getPath();
if (urlStartsWithCounty(path)) {
String[] split = path.split("/");
if (split.length < 2) return null;
String county = split[1];
String destination = split.length > 2 ? split[2] :null;
return  new PageRenderRequestParameters(
 
componentClassResolver.resolvePageClassNameToPageName(OldPhpUrlHandler.class.getCanonicalName()),
new URLEventContext(contextValueEncoder, new 
String[]{county, destination}),
false);
}
return null;
}

private boolean urlStartsWithCounty(String path) {
for (String s : COUNTYS) {
if (path.startsWith("/" + s)) return true;
}
return false;
}
}




From: slqiTapestry [via Apache Tapestry Mailing List Archives] 
[mailto:ml-node+s1045711n573291...@n5.nabble.com]
Sent: 29. august 2016 13:28
To: Svein-Erik Løken 
Subject: RE: Logical Page Name Shortening

Okay thanks,


I read the https://tapestry.apache.org/url-rewriting.html and saw that Tapestry 
URL Rewriting API does not exist anymore and has been replaced with the 
LinkTransformer service.


Is there any example to use this service ?



De : Thiago H de Paula Figueiredo <[hidden 
email]>
Envoyé : vendredi 26 août 2016 15:18:31
À : Tapestry users
Objet : Re: Logical Page Name Shortening

You can always create a Jira ticket asking for a new configuration symbol
to be created to turn off logical page name shortening. Or, as Dmitry
already suggested, you can use URL rewriting to shape the URLs to your
needs. :)

On Thu, 25 Aug 2016 22:17:44 -0300, abangkis <[hidden 
email]> wrote:

> I encounter this problem too. I have a de folder (short for data entry)
> and
> add Node page inside it.
>
> Then the tapestry generated URL become mysite/de/train/addNo (supposed to
> mysite/de/train/addNode). In most cases the shortening work well, but in
> this case, it break REST :(. I later decided to rename and refactor the
> folder, but would be great if tapestry have better alternative to handle
> this case more elegantly in the future. :)
>
> On Thu, Aug 25, 2016 at 12:01 AM, Dmitry Gusev <[hidden 
> email]>
> wrote:
>
>> 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 <[hidden 
>> email]> 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 <[hidden 
>> > email]>
>> > 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 w

RE: TLS termination proxy and Tapestry

2016-07-22 Thread Svein-Erik Løken
My feeling is that it's for SSL/HTTPS set up in Jetty/Tomcat etc  (no proxy in 
front needed) use:

public void contributeMetaDataLocator(MappedConfiguration 
configuration) {
configuration.add(MetaDataConstants.SECURE_PAGE, "true");
}

-- or secure pages with annotation:

@Secure

-- or folders with:

public void contributeMetaDataLocator(MappedConfiguration 
configuration)
{
configuration.add("admin:" + MetaDataConstants.SECURE_PAGE, "true");
}


If behind a TLS termination proxy use:
tapestry.security-enabled= false

The latter seems most intuitive also, because pages are unsecured in the 
tapestry application/servlet. The TLS termination proxy takes care of the 
security.


From: Dimitris Zenios [via Apache Tapestry Mailing List Archives] 
[mailto:ml-node+s1045711n573279...@n5.nabble.com] 
Sent: 22. juli 2016 14:52
To: Svein-Erik Løken 
Subject: Re: TLS termination proxy and Tapestry

Forgot to mention that i also have tapestry.security-enabled= false in my 
app setings 

On Fri, Jul 22, 2016 at 3:50 PM, Dimitris Zenios 
 
wrote: 

> This  is a snippet of nginx configuration that proxies the request to 
> jetty on port 8080.Via this configuration i am able to have ssl and non ssl 
> versions of the tapestry application.If i want to enforce only ssl version 
> of tapestry i enforce it via nginx.Hope that was helpful 
> 
>     location / { 
>         proxy_set_header X-Forwarded-Host $host; 
>         proxy_set_header X-Forwarded-Server $host; 
>         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
>         proxy_set_header X-Forwarded-Proto $scheme; 
>         proxy_pass        href="http://127.0.0.1:8080;";>http://127.0.0.1:8080;
>     } 
> 
> 
> On Fri, Jul 22, 2016 at 3:31 PM, Svein-Erik Løken 
>  
> wrote: 
> 
>> With my configuration with -Dtapestry.secure-enabled=true the private 
>> String org.apache.tapestry5.internal.services. 
>> LinkImpl::buildURI(LinkSecurity security) return the absolute URI. 
>> 
>> Using: 
>> 
>>         public void contributeMetaDataLocator(MappedConfiguration> String> configuration) { 
>>                 configuration.add(MetaDataConstants.SECURE_PAGE, "true"); 
>>         } 
>> With -Dtapestry.secure-enabled=true also works. 
>> 
>> Still need to set X-Forwarded-Proto="https" to have request.isSecure() 
>> return true. 
>> 
>> Which one is the preferred method? 
>> 
>> S-E 
>> 
>> 
>> 
>> From: JumpStart [via Apache Tapestry Mailing List Archives] [mailto: 
>> /user/SendEmail.jtp?type=node&node=5732791&i=2] 
>> Sent: 22. juli 2016 13:24 
>> To: Svein-Erik Løken  
>> Subject: Re: TLS termination proxy and Tapestry 
>> 
>> When you say you are avoiding absolute URLs, where have you noticed this? 
>> I can’t recall this being a problem. 
>> 
>> Now, I’m no expert on this kind of configuration, and its a while since I 
>> set this all up, so forgive me if I have my wires crossed. Also, our site’s 
>> load is small so far but growing so all of this will be up for review soon. 
>> 
>> In production we run pure HTTPS. We force all HTTP traffic to HTTPS by 
>> setting this in AppModule: 
>> 
>>         public void contributeMetaDataLocator(MappedConfiguration> String> configuration) { 
>>                 configuration.add(MetaDataConstants.SECURE_PAGE, "true"); 
>>         } 
>> 
>> We’re using mod_proxy and mod_ssl in Apache, no HAProxy. So Apache is 
>> terminating the SSL/TLS. 
>> 
>> We use: 
>> 
>>         -Dtapestry.secure-enabled=true 
>> 
>> We tell mod_proxy this: 
>> 
>>         ProxyPreserveHost On 
>> 
>> and we use the following to convert the request to AJP, because app 
>> preserves the HTTPS headers. 
>> 
>>         ProxyPass /myapp ajp://app:8009/myapp retry=5 
>>         ProxyPassReverse /myapp ajp:app:8009/myapp retry=5 
>> 
>> This all works great for us. So what’s the URL issue again? 
>> 
>> Geoff 
>> 
>> 
>> 
> 


If you reply to this email, your message will be added to the discussion below:
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/TLS-termination-proxy-and-Tapestry-tp5732774p5732791.html
 
To unsubscribe from mailto:users@tapestry.apache.org Mailing List Archives, 
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2375125&code=c3ZlaW5AamFjaWxsYS5ub3wyMzc1MTI1fC0xNTM4NzY2ODg4.
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
 


RE: TLS termination proxy and Tapestry

2016-07-22 Thread Svein-Erik Løken
With my configuration with -Dtapestry.secure-enabled=true the private String 
org.apache.tapestry5.internal.services. LinkImpl::buildURI(LinkSecurity 
security) return the absolute URI.

Using: 

public void contributeMetaDataLocator(MappedConfiguration configuration) { 
configuration.add(MetaDataConstants.SECURE_PAGE, "true"); 
}
With -Dtapestry.secure-enabled=true also works.

Still need to set X-Forwarded-Proto="https" to have request.isSecure() return 
true.

Which one is the preferred method?

S-E



From: JumpStart [via Apache Tapestry Mailing List Archives] 
[mailto:ml-node+s1045711n5732786...@n5.nabble.com] 
Sent: 22. juli 2016 13:24
To: Svein-Erik Løken 
Subject: Re: TLS termination proxy and Tapestry

When you say you are avoiding absolute URLs, where have you noticed this? I 
can’t recall this being a problem. 

Now, I’m no expert on this kind of configuration, and its a while since I set 
this all up, so forgive me if I have my wires crossed. Also, our site’s load is 
small so far but growing so all of this will be up for review soon. 

In production we run pure HTTPS. We force all HTTP traffic to HTTPS by setting 
this in AppModule: 

        public void contributeMetaDataLocator(MappedConfiguration configuration) { 
                configuration.add(MetaDataConstants.SECURE_PAGE, "true"); 
        } 

We’re using mod_proxy and mod_ssl in Apache, no HAProxy. So Apache is 
terminating the SSL/TLS. 

We use: 

        -Dtapestry.secure-enabled=true 

We tell mod_proxy this: 

        ProxyPreserveHost On 

and we use the following to convert the request to AJP, because app preserves 
the HTTPS headers. 

        ProxyPass /myapp ajp://app:8009/myapp retry=5 
        ProxyPassReverse /myapp ajp:app:8009/myapp retry=5 

This all works great for us. So what’s the URL issue again? 

Geoff 




RE: TLS termination proxy and Tapestry

2016-07-22 Thread Svein-Erik Løken
Tanks for confirmation on this!

What about make note on this in the documentation 
https://tapestry.apache.org/security.html?

It's not obvious that X-Forwarded-Proto="https" should be set in the TLS 
termination proxy. Other X-Forwarded- is often set default in the proxy, like 
X-Forwarded-For.

And the tapestry.secure-enabled = false.


Web sites need to be encrypted in the future to work in Chrome, Firefox… Google 
Will Soon Shame All Websites That Are Unencrypted  
http://motherboard.vice.com/read/google-will-soon-shame-all-websites-that-are-unencrypted-chrome-https.



GeoLocation stopped to work I Chrome for desktop and Android, so I had to use 
encryption.




From: Chris Poulsen [via Apache Tapestry Mailing List Archives] 
[mailto:ml-node+s1045711n5732784...@n5.nabble.com]
Sent: 22. juli 2016 11:35
To: Svein-Erik Løken 
Subject: Re: TLS termination proxy and Tapestry

We are always setting tapestry.secure-enabled = false

--
Chris

On Fri, Jul 22, 2016 at 11:29 AM, Dimitris Zenios <[hidden 
email]
> wrote:

> When i am doing ssl out of the servlet container (eg jetty,apache etc) i
> always set secure enables to false.
>
> On 21 Jul 2016 12:07, "Svein-Erik Løken" <[hidden 
> email]> wrote:
>
> > Using HAProxy or Apache HTTP Server as a TLS termination proxy I found
> > that setting X-Forwarded-Proto="https" in the header on the proxy
> > org.apache.tapestry5.services.Request::isSecure returns true . That's
> good!
> > In tapestry.production-mode=true I am getting absolute URLs. E.g.
> > http://example.com/index.mycompo.form.
> > By setting -Dtapestry.secure-enabled=false seems to solve this. Now I am
> > getting a relative URL. (/index.mycompo.form).
> > I can see that with X-Forwarded-Proto="https" set,
> > org.apache.tapestry5.internal.services.
> > RequestSecurityManager::checkPageSecurity returns LinkSecurity.SECURE.
> > That's good!
> >
> > For me it seems that this is the correct solution, but I find it nice if
> > some tapestry experts can confirm this!
> >
> >
>


If you reply to this email, your message will be added to the discussion below:
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/TLS-termination-proxy-and-Tapestry-tp5732774p5732784.html
To unsubscribe from users@tapestry.apache.org<mailto:users@tapestry.apache.org> 
Mailing List Archives, click 
here<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2375125&code=c3ZlaW5AamFjaWxsYS5ub3wyMzc1MTI1fC0xNTM4NzY2ODg4>.
NAML<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


TLS termination proxy and Tapestry

2016-07-21 Thread Svein-Erik Løken
Using HAProxy or Apache HTTP Server as a TLS termination proxy I found that 
setting X-Forwarded-Proto="https" in the header on the proxy 
org.apache.tapestry5.services.Request::isSecure returns true . That's good!
In tapestry.production-mode=true I am getting absolute URLs. E.g. 
http://example.com/index.mycompo.form.
By setting -Dtapestry.secure-enabled=false seems to solve this. Now I am 
getting a relative URL. (/index.mycompo.form).
I can see that with X-Forwarded-Proto="https" set, 
org.apache.tapestry5.internal.services. 
RequestSecurityManager::checkPageSecurity returns LinkSecurity.SECURE. That's 
good!

For me it seems that this is the correct solution, but I find it nice if some 
tapestry experts can confirm this!



RE: Making a grid's checkbox column preserve its checked state across pages

2016-02-27 Thread Svein-Erik Løken
A working example if needed :



Route Edit ${routeEditChangedIndicator}
Create
Update
Delete



Route Id: ${routeId}
Selected ts2Id: ${ts2Id}
Route length: ${routeLengthInKmFormatted} km





Close


 















Ctrl + Click to Add
Ctrl + Shift + Click to Remove




void onSubmitUpdate() {
isRouteChanged = true;
routeChangedAjaxResponse();
}

void onSubmitSave() {
routeService.saveRoute(routeId, routeElements);
isRouteChanged = false;
routeChangedAjaxResponse();
}


private void routeChangedAjaxResponse() {
if (request.isXHR()) {
final JSONArray jsonRouteElements = new JSONArray();
for (final FreshRouteelement freshRouteelement : this.routeElements) {
JSONArray latLngs = new JSONArray();
for (Coordinate coordinate : 
freshRouteelement.getTracksegment2ByTrackSegment2Id().getLineString().getCoordinates())
 {
latLngs.put(new LatLng(coordinate.y, 
coordinate.x).getJsonObject());
}
jsonRouteElements.put(new JSONObject(
"ts2Id", freshRouteelement.getTrackSegment2Id(),
"rev", freshRouteelement.getReverseDirection(),
"latLngs", latLngs));
}
ajaxResponseRenderer
.addRender(routeEditZone)
.addCallback(new JavaScriptCallback() {
@Override
public void run(JavaScriptSupport javascriptSupport) {

javascriptSupport.require("map/map-superadmin").invoke("updateRouteHelperLine")
.with(new JSONObject("routeElements", 
jsonRouteElements));
}
});
setRouteChangedFlagAjaxResponse(isRouteChanged);
}
}



RE: Tapestry is a sinking Ship

2016-02-13 Thread Svein-Erik Løken
In Norway we had trolls, but not anymore! This gay know how to get rid of them: 
http://www.imdb.com/title/tt1740707.

BTW: I have been using T54 since the first beta and think it is a huge 
improvement from 5.3. You are moving Tapestry in the right direction. I have a 
lot of javascript interacting with T54 and uses ajax, zones, bootstrap without 
problems.

BTW2: Is there any books covering Tapestry 5.4 in English? I have this 
excellent book: http://www.tapestry5book.com/ for T53, but it's a lot of new 
features in T54 to cover.

S-E

From: Ilya Obshadko-2 [via Apache Tapestry Mailing List Archives] 
[mailto:ml-node+s1045711n5732111...@n5.nabble.com]
Sent: 13. februar 2016 09:20
To: Svein-Erik Løken 
Subject: Re: Tapestry is a sinking Ship

Thiago, I have an idea.

Why don't we ban this poor excuse of an idiot from a mailing list and
address real problems latest release has?

On Fri, Feb 12, 2016 at 10:53 PM, Thiago H de Paula Figueiredo <
[hidden email]> wrote:

> On Fri, 12 Feb 2016 17:19:28 -0200, Emmanuel Sowah <[hidden 
> email]>
> wrote:
>
> Hi Tapestry sect,
>>
>
> Hi, insistent, annoying, repetitive, low-quality troll!
>
> The state of Tapestry now is very bad, as Howard and all the other
>> commiters have abandoned it.
>>
>
> This is not true. Just check Jira and the Git logs.
>
> Even Thiago has secretly abandoned Tapestry.
>>
>
> I have not, and you're telling a lie.
>
> I'm just answering this troll because of the lies he keeps on spreading,
> which are bordering on defamation.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
>
> -
> To unsubscribe, e-mail: [hidden 
> email]
> For additional commands, e-mail: [hidden 
> email]
>
>


--
Ilya Obshadko


If you reply to this email, your message will be added to the discussion below:
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Tapestry-is-a-sinking-Ship-tp5732095p5732111.html
To unsubscribe from users@tapestry.apache.org<mailto:users@tapestry.apache.org> 
Mailing List Archives, click 
here<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2375125&code=c3ZlaW5AamFjaWxsYS5ub3wyMzc1MTI1fC0xNTM4NzY2ODg4>.
NAML<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


Re: [ANNOUNCE] Apache Tapestry 5.4

2015-12-25 Thread Svein-Erik Løken
I think 5.4 is a fantastic release:-)

Sendt fra Outlook Mobile




On Fri, Dec 25, 2015 at 4:08 AM -0800, "Carlos Montero Canabal [via Apache 
Tapestry Mailing List Archives]" 
mailto:ml-node+s1045711n5731596...@n5.nabble.com>>
 wrote:

Hi Tapestry team.

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

Carlos Montero

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




If you reply to this email, your message will be added to the discussion below:
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/ANNOUNCE-Apache-Tapestry-5-4-tp5731585p5731596.html
To unsubscribe from users@tapestry.apache.org Mailing List Archives, click 
here.
NAML


RE: Updated Hotel Booking demo app

2015-11-13 Thread Svein-Erik Løken
Superb! The best way to learn ☺


RE: jumpstart - ajax crud, doesn't work without @persist for me

2015-10-30 Thread Svein-Erik Løken
Is it possible to download and install Jumpstart7?

From: Paul Stanton [via Apache Tapestry Mailing List Archives] 
[mailto:ml-node+s1045711n5731413...@n5.nabble.com]
Sent: 29. oktober 2015 23:53
To: Svein-Erik Løken 
Subject: Re: jumpstart - ajax crud, doesn't work without @persist for me

Sorry! I had forgotten the 'async' parameter on the eventlink and it was
a non-ajax request so an entirely different use case!

Please ignore me, it now works just fine.

FYI i am using T5.4 and jumpstart7 intentionally.

On 29/10/2015 10:30 PM, Barry Books wrote:

> I believe jumpstart in the link below in running under 5.4 beta. I have not
> run 5.3 in a long time but I believe it requires @Persist in this case.
> What version are you running?
>
> On Thursday, October 29, 2015, Paul Stanton <[hidden 
> email]> wrote:
>
>> Hi,
>>
>> I've modelled a form using jumpstart's (7) ajax crud however in my case I
>> seem to have to @persist(flash) the equivalent of 'function'
>>
>>
>> http://jumpstart.doublenegative.com.au/jumpstart7/together/ajaxcomponentscrud/persons
>>
>> I think this is because there are two page instances: one to handle the
>> event, another to render.
>>
>> How does it work in jumpstart without persist?
>>
>> thanks, p.
>>
>> -
>> To unsubscribe, e-mail: [hidden 
>> email]
>> For additional commands, e-mail: [hidden 
>> email]
>>
>>


-
To unsubscribe, e-mail: [hidden 
email]
For additional commands, e-mail: [hidden 
email]



If you reply to this email, your message will be added to the discussion below:
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/jumpstart-ajax-crud-doesn-t-work-without-persist-for-me-tp5731402p5731413.html
To unsubscribe from users@tapestry.apache.org<mailto:users@tapestry.apache.org> 
Mailing List Archives, click 
here<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2375125&code=c3ZlaW5AamFjaWxsYS5ub3wyMzc1MTI1fC0xNTM4NzY2ODg4>.
NAML<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


RE: Make Tapestry add an id to the tag of the grid

2015-09-20 Thread Svein-Erik Løken
I think data-id is cleaner than setting some class attributes. I use class 
attributes for style/css.

What if tapesty used data-tapestry-id internally t:id=""? Users could then use 
the id="" attribute directly from javascript for elements in zones.

S-E

From: Geoff Callender-2 [via Apache Tapestry Mailing List Archives] 
[mailto:ml-node+s1045711n5731255...@n5.nabble.com]
Sent: 19. september 2015 05:19
To: Svein-Erik Løken 
Subject: Re: Make Tapestry add an id to the  tag of the grid

Tapestry does generate some “data" attributes, eg. data-validate, 
data-update-zone, data-async-trigger, and data-dismiss-url; but data-id is not 
one of them. Svein added data-id himself, but he could have called it anything 
so long as its name doesn’t clash with a Tapestry-generated one.

For anyone unfamiliar with “data” attributes, here’s some good info:


http://webdesign.tutsplus.com/tutorials/all-you-need-to-know-about-the-html5-data-attribute--webdesign-9642

> On 18 Sep 2015, at 7:18 pm, Davide Vecchi <[hidden 
> email]> wrote:
>
> Thanks, it sounds interesting. I will have to find out what the data-id 
> "does" in Tapestry in general though, and whether it's already used for 
> something else in this web app, because I don't want to interfer with other 
> functionalities. So far I couldn't find much info about data-id but I will 
> definitely keep this as a possible option.
>
> -Original Message-
> From: Svein-Erik Løken
> Sent: Friday, September 18, 2015 10:16
> To: [hidden email]
> Subject: RE: Make Tapestry add an id to the  tag of the grid
>
> In zone I am using data-id:
>
>
> Eg: 
> $("select[data-id='typeSelect']")
>
> I think you can do the same!
>
> -
> To unsubscribe, e-mail: [hidden 
> email]
> For additional commands, e-mail: [hidden 
> email]
>


-
To unsubscribe, e-mail: [hidden 
email]
For additional commands, e-mail: [hidden 
email]



If you reply to this email, your message will be added to the discussion below:
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Make-Tapestry-add-an-id-to-the-table-tag-of-the-grid-tp5731247p5731255.html
To unsubscribe from users@tapestry.apache.org<mailto:users@tapestry.apache.org> 
Mailing List Archives, click 
here<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2375125&code=c3ZlaW5AamFjaWxsYS5ub3wyMzc1MTI1fC0xNTM4NzY2ODg4>.
NAML<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


RE: Make Tapestry add an id to the tag of the grid

2015-09-18 Thread Svein-Erik Løken
In zone I am using data-id:


Eg: mailto:ml-node+s1045711n5731247...@n5.nabble.com]
Sent: 18. september 2015 09:59
To: Svein-Erik Løken 
Subject: Make Tapestry add an id to the  tag of the grid

Hi everybody,

I have the same need described in the thread at 
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/How-to-add-table-id-into-the-Grid-td2417082.html
 : although in my .tml I do have a t:id attribute in the  tag, the 
resulting HTML does not have an id attribute in the corresponding  tag, 
so I cannot select the table through jQuery or retrieve it through JavaScript; 
I cannot assume that the page has only one grid so I need the  tag to 
have an id.

I am using Tapestry 5.3.7. In the above mentioned thread the guy asked how to 
report a bug about this issue but he got no reply. Is that fix already 
implemented in some newer version or is it planned to be implemented in future 
? Or is there some known workaround to get the  tag to have an id 
attribute in other ways ?

If you reply to this email, your message will be added to the discussion below:
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Make-Tapestry-add-an-id-to-the-table-tag-of-the-grid-tp5731247.html
To unsubscribe from users@tapestry.apache.org<mailto:users@tapestry.apache.org> 
Mailing List Archives, click 
here<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2375125&code=c3ZlaW5AamFjaWxsYS5ub3wyMzc1MTI1fC0xNTM4NzY2ODg4>.
NAML<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


RE: Inspection of Tapestry applications in IntelliJ

2015-08-25 Thread Svein-Erik Løken
Property need to be private to be resolved in the .tml

I use to add @SuppressWarnings("unused") when needed. I like to have no 
analysis error or warnings.  I wish that for my TML files too, but 
xmlns:p="tapestry:parameter" is not understood.  after  also 
gives me analysis error. I hope JetBrains will improve the Tapestry plugin when 
5.4 is released.

@SuppressWarnings("unused")
@Property
private String myProp;


My prop: ${myProp}

BTW: IntelliJ IU-142.4083 seems to be the best v15 EAP.




From: Chris Poulsen [via Apache Tapestry Mailing List Archives] 
[mailto:ml-node+s1045711n573113...@n5.nabble.com]
Sent: 25. august 2015 14:44
To: Svein-Erik Løken 
Subject: Re: Inspection of Tapestry applications in IntelliJ

There have been some improvements in the recent v15 EAPs.

Also you can adjust the unused inspection to not trigger on certain
annotations. (I think it is some sub-menu found under the "light bulb" when
having an unused field marked)

On Tue, Aug 25, 2015 at 2:29 PM, Poggenpohl, Daniel <
[hidden email]> wrote:

> Hello again,
>
> right after solving after another problem, I thought that maybe you could
> help me with another one regarding IntelliJ and Tapestry.
>
> The IDE has Tapestry support, but it seems to use a rather old Tapestry
> version (5.1?).
> The code inspections seem to be relatively dumb because @Property
> annotated members are seen as "never used". In tml files, sometimes I get
> error messages like "can't coerce List to selectModel" or "Cannot resolve
> symbol ${someSymbol}" when I have a getSomeSymbol() in my java class.
>
> How do you deal with that?
>
> Regards,
> Daniel P.
>


If you reply to this email, your message will be added to the discussion below:
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Inspection-of-Tapestry-applications-in-IntelliJ-tp5731132p5731133.html
To unsubscribe from users@tapestry.apache.org<mailto:users@tapestry.apache.org> 
Mailing List Archives, click 
here<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2375125&code=c3ZlaW5AamFjaWxsYS5ub3wyMzc1MTI1fC0xNTM4NzY2ODg4>.
NAML<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


RE: Debugging Tapestry with IntelliJ IDEA

2015-08-25 Thread Svein-Erik Løken
It is very good! Also for multi-module development and JavaScript debugging.

S-E

From: Charlouze [via Apache Tapestry Mailing List Archives] 
[mailto:ml-node+s1045711n5731127...@n5.nabble.com]
Sent: 25. august 2015 13:43
To: Svein-Erik Løken 
Subject: Re: Debugging Tapestry with IntelliJ IDEA

+1 (non-binding :D)

Le mar. 25 août 2015 à 13:25, Stephen Nutbrown <[hidden 
email]> a
écrit :

> Just to confirm it also works fine here too. I've found IntelliJ to be
> absolutely fantastic so far. I'm running it using jetty but I know there is
> an option for tomcat... I don't know if that could make a difference?
> On 25 Aug 2015 11:33 am, "Chris Poulsen" <[hidden 
> email]> wrote:
>
> > It works fine with IDEA here. A possibility could be that you are running
> > in production mode?
> >
> > On Tue, Aug 25, 2015 at 12:04 PM, Poggenpohl, Daniel <
> > [hidden email]> wrote:
> >
> > > Hello everyone,
> > >
> > > we are evaluating IntelliJ IDEA for development and so far it has been
> > > quite good.
> > > But the Tapestry specifics seem to hinder further evaluation.
> > > Does anyone here use IntelliJ for development?
> > >
> > > When we debug code, page properties are always seen as having a "null"
> > > value instead of the proxy that Eclipse used to show. What are we doing
> > > wrong?
> > >
> > > Regards,
> > > Daniel P.
> > >
> >
>


If you reply to this email, your message will be added to the discussion below:
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Debugging-Tapestry-with-IntelliJ-IDEA-tp5731124p5731127.html
To unsubscribe from users@tapestry.apache.org<mailto:users@tapestry.apache.org> 
Mailing List Archives, click 
here<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2375125&code=c3ZlaW5AamFjaWxsYS5ub3wyMzc1MTI1fC0xNTM4NzY2ODg4>.
NAML<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


No change event when datePicker updates t:datefield

2015-08-24 Thread Svein-Erik Løken
When fields in my side panel are updated, I call submit on the change event. If 
datePicker is used no change event are fired.

I could find a workaround without modification of datefield.js. Any suggestion?

One line added by me: _this.field.$.change();

Controller.prototype.onSelect = function() {
  var date;
  date = this.datePicker.getDate();
  if (date === null) {
this.hidePopup();
this.clearFieldError();
this.field.value("");
return;
  }
  this.field.addClass("ajax-wait");
  return ajax(this.container.attr("data-format-url"), {
data: {
  input: date.getTime()
},
failure: (function(_this) {
  return function(response, message) {
_this.field.removeClass("ajax-wait");
return _this.fieldError(message);
  };
})(this),
success: (function(_this) {
  return function(response) {
_this.field.removeClass("ajax-wait");
_this.clearFieldError();
_this.field.value(response.json.result);

//trigger change event on field
_this.field.$.change();

return _this.hidePopup();
  };
})(this)
  });
};







RE: Multiple domains, one webapp

2015-08-11 Thread Svein-Erik Løken
> 
> > Is the "@ImportModule(CommonModule.class)" required?
> 
> For multi-module development with the common module project open and
> live-class-reloadable, yes. If you're just adding the common module JAR to
> the main project (or any project using it as a dependency) as a JAR
> directly, no. You can use both @ImportModule/@SubModule and the
> manifest

The Manifest configuration is back! Thank you for clarification Thiago!

> entry at the same time without problems: Tapestry-IoC will only include
> one module class once no matter how many different times and ways you
> include it.
> 
> > But of course I had the problem that it doesn't seem to run my
> > contributeHibernateEntityPackageManager in HappyModule to add my
> entities
> > package (in my common module) to hibernate - maybe this is why. I'm
> away
> > from my work PC so I will have to check next time.
> 
> That's why.
> 
> > Also, is AppModule here needed?
> > https://github.com/sveine/tapestry-multi-module-
> demo/blob/master/common/src/main/java/com/demo/commonlib/service
> s/AppModule.java
> 
> If you main webapp project has anything Tapestry-IoC-related, like
> declaring services, contributing to them, decorating them or advising
> them, yes.

Is this correct? Isn't only 
https://github.com/sveine/tapestry-multi-module-demo/blob/master/common/src/main/java/com/demo/commonlib/services/CommonModule.java
 read in commonlib, not AppModule.java?

> 
> > If we do have to put "@ImportModule(CommonModule.class)" in the
> > non-common appmodules then it means that if we grab a module from
> some
> > library or
> > repository that we need to know the name of the module which needs to
> be
> > imported for it to work (i'm sure this can't be right).
> 
> Yes, but you'll only use that when you have the library open as a project
> in your IDE. Remember, you still should add the manifest file entry to
> your library JARs.
> 
> > There is a good chance my understanding is wrong, but in my
> understanding
> > it's best to have the module be auto loaded without it needing importing,
> > simply by adding it to the classpath (or pom.xml), otherwise the main
> > projects need to know about the details of how the shared module work.
> 
> Same sentence above. Use both when developing in parallel.
> 

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



RE: Multiple domains, one webapp

2015-08-10 Thread Svein-Erik Løken
> This looks really good and will be really helpful to lots of people - thank
> you!
> I've had a look and have learnt some things from it myself, however I have
> a few questions.
> 
> Is the "@ImportModule(CommonModule.class)" required?
> 
> Instead of that I have something like this in my pom.xml
> 
>            org.apache.maven.plugins
>            maven-jar-plugin
>            
>            
>              
> 
>   Classes>org.example.happylib.services.HappyModule Classes>
>              
>            
>            
>        
> 

No! But I find this method much easier (This was a tip from Kalle Korhonen in 
this thread)

> But of course I had the problem that it doesn't seem to run my
> contributeHibernateEntityPackageManager in HappyModule to add my
> entities
> package (in my common module) to hibernate - maybe this is why. I'm away
> from my work PC so I will have to check next time.

It should run for both methods.

BTW: In my real project I am not using contributeHibernateEntityPackageManager 
but  in hibernate.cfg.xml because IntelliJ use it to 
resolve table information.


> 
> Also, is AppModule here needed?
> https://github.com/sveine/tapestry-multi-module-
> demo/blob/master/common/src/main/java/com/demo/commonlib/service
> s/AppModule.java

No! Can be removed.

> 
> If we do have to put "@ImportModule(CommonModule.class)" in the non-
> common
> appmodules then it means that if we grab a module from some library or
> repository that we need to know the name of the module which needs to be
> imported for it to work (i'm sure this can't be right).

> 
> There is a good chance my understanding is wrong, but in my understanding
> it's best to have the module be auto loaded without it needing importing,
> simply by adding it to the classpath (or pom.xml), otherwise the main
> projects need to know about the details of how the shared module work.

The way this is done in tapestry makes sense for me. My main module is addicted 
to the common module. I don't want a loose coupling. I want to make code in the 
common module (code-)shared between different front-end modules (end-user, 
admin, web-service).

 
> On 10 August 2015 at 15:51, Svein-Erik Løken <[hidden email]> wrote:
> 
> > >
> > > > Read about URL rewriting at
> > > > https://tapestry.apache.org/url-rewriting.html, but cannot figure out
> > > > how this can solve my question of how to access assets from javascript.
> > >
> > > Pass the asset URLs from Tapestry to JavaScript.
> > >
> >
> > Thank you Thiago!
> >
> >
> >
> > I have created a project for people who want a quick start with a
> > multi-module tapestry/maven project.
> >
> > https://github.com/sveine/tapestry-multi-module-demo
> >
> >
> > -
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> 
> 
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-tapestry-mailing-list-
> archives.1045711.n5.nabble.com/Multiple-domains-one-webapp-
> tp5730972p5731050.html
> To unsubscribe from users@tapestry.apache.org Mailing List Archives, click
> here.
> NAML

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


RE: Multiple domains, one webapp

2015-08-10 Thread Svein-Erik Løken
> 
> > Read about URL rewriting at
> > https://tapestry.apache.org/url-rewriting.html, but cannot figure out
> > how this can solve my question of how to access assets from javascript.
> 
> Pass the asset URLs from Tapestry to JavaScript.
> 

Thank you Thiago!



I have created a project for people who want a quick start with a multi-module 
tapestry/maven project.

https://github.com/sveine/tapestry-multi-module-demo


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


RE: Multiple domains, one webapp

2015-08-10 Thread Svein-Erik Løken
Read about URL rewriting at https://tapestry.apache.org/url-rewriting.html, but 
cannot figure out how this can solve my question of how to access assets from 
javascript. 

> 
> I use to host tons of dealer websites on a single Tapestry application all
> with their own unique domain. I used a combination of Mod rewrite and
> Tapestry's URL rewriter. It worked flawlessly.
> 
> On Fri, Aug 7, 2015 at 8:00 AM, Svein-Erik Løken <[hidden email]> wrote:
> 
> > >
> > > > WOW! Multi-module in Tapestry with Live Class Reloading is fantastic!
> > > > Thanks for pointing me in the right direction Thiago!
> > >
> > > Yay! Virtual high-five! :D Tapestry is awesome, isn't it? ;)
> > >
> >
> > Oh yea! T5.4 is a success!
> >
> > > specify @SubModule(HappyModule.class) (or @ImportModule in T5.4) in
> your
> > Tanks Kalle! A good replacement for
> > 
> >
> >
> > I am moving a lot of code to my common module. I think the biggest
> > challenge is how to access assets from JavaScript.
> >
> > I moved the box_1.png, box_2.png, ... images to my common modules
> > META-INF.assets.jacillacore.img.destinationStatus
> >
> > public static void
> > contributeComponentClassResolver(Configuration
> > configuration) {
> >         configuration.add(new LibraryMapping("jacillacore",
> > "com.jacilla.core"));
> > }
> >
> > My original code:
> > var iconUrl = "/img/destinationStatus/box_" + prepStatus + ".png";
> >
> > Tried:
> > var iconUrl = "${asset:jacillacore/img/destinationStatus/box_" +
> > prepStatus + ".png}";
> > and:
> > var iconUrl = "/jacillacore/assets/jacillacore/img/destinationStatus/box_"
> > + prepStatus + ".png";
> >
> >
> > It did not work! Is it possible to access then directly for javascript?
> >
> > To make it work I had to send the asset url's to the javascript module:
> >         final JSONObject statusImages = new JSONObject();
> >         for (int i = 1; i <= maxStatus; i++) {
> >             final String format =
> > String.format("/META-
> INF/assets/jacillacore/img/destinationStatus/box_%d.png",
> > i);
> >             Asset asset = assetSource.getExpandedAsset(format);
> >             statusImages.put(String.valueOf(i), asset.toClientURL());
> >         }
> >         return new JSONObject(
> >                 "statusImages", statusImages,
> >                 "symbols", symbols);
> >
> > Is this the correct way of doing this in T5.4, or could it be simpler?
> >


RE: Multiple domains, one webapp

2015-08-07 Thread Svein-Erik Løken
> 
> > WOW! Multi-module in Tapestry with Live Class Reloading is fantastic!
> > Thanks for pointing me in the right direction Thiago!
> 
> Yay! Virtual high-five! :D Tapestry is awesome, isn't it? ;)
> 

Oh yea! T5.4 is a success!

> specify @SubModule(HappyModule.class) (or @ImportModule in T5.4) in your
Tanks Kalle! A good replacement for  


I am moving a lot of code to my common module. I think the biggest challenge is 
how to access assets from JavaScript.

I moved the box_1.png, box_2.png, ... images to my common modules 
META-INF.assets.jacillacore.img.destinationStatus

public static void 
contributeComponentClassResolver(Configuration configuration) {
configuration.add(new LibraryMapping("jacillacore", 
"com.jacilla.core"));
}

My original code:
var iconUrl = "/img/destinationStatus/box_" + prepStatus + ".png";

Tried: 
var iconUrl = "${asset:jacillacore/img/destinationStatus/box_" + prepStatus + 
".png}";
and:
var iconUrl = "/jacillacore/assets/jacillacore/img/destinationStatus/box_" + 
prepStatus + ".png";


It did not work! Is it possible to access then directly for javascript?

To make it work I had to send the asset url's to the javascript module:
final JSONObject statusImages = new JSONObject();
for (int i = 1; i <= maxStatus; i++) {
final String format = 
String.format("/META-INF/assets/jacillacore/img/destinationStatus/box_%d.png", 
i);
Asset asset = assetSource.getExpandedAsset(format);
statusImages.put(String.valueOf(i), asset.toClientURL());
}
return new JSONObject(
"statusImages", statusImages,
"symbols", symbols);

Is this the correct way of doing this in T5.4, or could it be simpler?







RE: Multiple domains, one webapp

2015-08-05 Thread Svein-Erik Løken
Do you have Tapestry-Module-Classes set up in the common module? 
https://tapestry.apache.org/autoloading-modules.html

The hibernate.cfg.xml and maven dependency to hibernate should be set up in the 
main module.
E.g.

    org.hibernate
    hibernate-c3p0



> The only issue I am having is that my code for hibernate doesn't seem to 
> work quite as expexted. Ideally, this should be picked up from the happylib 
>
> public static void 
> contributeHibernateEntityPackageManager(Configuration 
> configuration) { 
>        configuration.add("com.my.package.myentities"); 
>    } 
>
> However I am finding it only seems to work for me if it's in the main 
> projects AppModule.java, perhaps I have configured something wrong, or 
> perhaps this has to be in app module rather than in my shared jar? 
>
> I've put the hibernate entities that are shared between the projects in 
> there and so ideally the code should be in the shared library rather than 
> duplicated in both webapps (although it works as it is... any ideas what 
> may cause that?) 


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


RE: Multiple domains, one webapp

2015-08-05 Thread Svein-Erik Løken
Do you have Tapestry-Module-Classes set up in the common module? 
https://tapestry.apache.org/autoloading-modules.html



The hibernate.cfg.xml and maven dependency to hibernate should be set up in the 
main module.

E.g.


org.hibernate
hibernate-c3p0




The only issue I am having is that my code for hibernate doesn't seem to
work quite as expexted. Ideally, this should be picked up from the happylib

public static void
contributeHibernateEntityPackageManager(Configuration
configuration) {
configuration.add("com.my.package.myentities");
}

However I am finding it only seems to work for me if it's in the main
projects AppModule.java, perhaps I have configured something wrong, or
perhaps this has to be in app module rather than in my shared jar?

I've put the hibernate entities that are shared between the projects in
there and so ideally the code should be in the shared library rather than
duplicated in both webapps (although it works as it is... any ideas what
may cause that?)




RE: Multiple domains, one webapp

2015-08-05 Thread Svein-Erik Løken
WOW! Multi-module in Tapestry with Live Class Reloading is fantastic! Thanks 
for pointing me in the right direction Thiago!

To get live class reloading work for the common module in IntelliJ: Open 
Project Structure, Project Settings > Modules. Select the common module > Paths 
> Compiler output. Set Output path to the same path as the main project output 
path.

I have created a multi-module maven demo project for test and documentation. A 
page in the main project includes a component-class from the common module. I 
have demo of using assets (img and js-modules) and IoC service. Everything 
works with Live Class Reloading.

I am using a top-level pom (dependencyManagement, pluginManagement, 
properties), a modules pom (maven-root), the main project (war), and the common 
module (jar).

The main project and common module is both created from mvn 
-DarchetypeArtifactId=quickstart ..., with necessary modification.

I have documented all steps to make everything working in IntelliJ (plugin 
configuration etc).


> 
> As long as the compiler target folder of the included
> library/module/subproject is included in the classpath of the main
> project, regardless of what tool you're using, live class reloading will
> work after a class in the library/module/subproject is recompiled. Maybe
> Eclipse makes it easier because it compiles automatically on save. I don't
> know how IDEA handles this.
> 
> 
> --
> 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



RE: Multiple domains, one webapp

2015-08-04 Thread Svein-Erik Løken
> >> 4) You can't use Tapestry's Live Class Reloading on any class in the
> >> common
> >> JAR (e.g. Tapestry IOC service implementation classes).
> >
> > I think 4) is the biggest downside in a multi-module project. Do you
> > think Tapestry can do a Live Class Reloading of the common JAR included
> > with contributeCoreLibComponentClasses?
> 
> If this is about Eclipse (I'm not sure about other IDEs, since I haven't
> used any besides Eclipse for many years), if you have all the projects
> open at the same time, you can use live class reloading on all of them at
> the same, and I do this all the time.
> 

Really! I am using IntelliJ IDEA Ultimate and NEED this functionality. Today I 
need to recompile all maven projects and restart jetty for every change to 
components and JavaScript modules (all resources) in the common JAR.

The common JAR project is included in the Project view. Has anyone solved this 
in IntelliJ IDEA?



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


RE: Multiple domains, one webapp

2015-08-04 Thread Svein-Erik Løken
> 1) You have to maintain three projects (or a Maven multi-module project if
> you're using Maven) instead of one.
> 2) You'll have two different app servers to configure & maintain.
> 3) You'll probably need to maintain database credentials in two different
> places.
> 4) You can't use Tapestry's Live Class Reloading on any class in the common
> JAR (e.g. Tapestry IOC service implementation classes).


I think 4) is the biggest downside in a multi-module project. Do you think 
Tapestry can do a Live Class Reloading of the common JAR included with 
contributeCoreLibComponentClasses?



> 5) If you use an automated build server like Jenkins then you'll have to
> set up and maintain triple the number of jobs.
> 6) Your build process will be slower and more error prone because you'll
> often have to build the common JAR before building and deploying you'll
> have different log files.

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



RE: Detect jqXHR.abort()

2015-05-11 Thread Svein Erik Løken
I am now running Jetty 9.2.10.v20150310, but getting the same problem with a
similar warning in the log:

2015-05-11 09:25:55.695:WARN:oejs.Request:qtp1283939356-46:
org.eclipse.jetty.io.EofException: Early EOF

After some Googling it seems that this can happen on a server time out, or
if the client aborts the call.

I think Tapestry should stop this incomplete request from running any event
method. A request parameter = null could be coded to delete something.

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



RE: Detect jqXHR.abort()

2015-05-08 Thread Svein Erik Løken
Fiddler2 reports that the request is aborted most of the time. But some
request gets this warning from Fiddler2:



369 Content-Length mismatch: Request Header indicated 95 876 bytes,
but client sent 65 536 bytes.

369 Failed to obtain request body. System.IO.InvalidDataException
The request body did not contain the specified number of bytes. Got 65536,
expected 95876



This is the situation where _state = -13 and RequestParameter is null.
The request should be thrown and never call any methods which can lead
to unexpected result. Isn't this a security issue too?



Maybe this is a jetty bug?





<*groupId*>org.mortbay.jetty
<*artifactId*>maven-jetty-plugin
<*version*>6.1.16



*From:* Lance Java [via Apache Tapestry Mailing List Archives] [mailto:
ml-node+s1045711n5730616...@n5.nabble.com]
*Sent:* 8. mai 2015 17:43
*To:* Svein
*Subject:* RE: Detect jqXHR.abort()



Ah, sorry... It looks like the browser actually closes the connection on
abort which is resulting in a partial request being sent to the server. I
have no idea how to detect this (possibly different per container too).

Since you've found a solution which doesn't abort I'd use that.

Cheers,
Lance.

--

*If you reply to this email, your message will be added to the discussion
below:*

http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Detect-jqXHR-abort-tp5730595p5730616.html

To unsubscribe from users@tapestry.apache.org Mailing List Archives, click
here

.
NAML



RE: Detect jqXHR.abort()

2015-05-08 Thread Svein Erik Løken
Is it a bug in the JQuery xhr.abort() then? Debugging RequestFilter.service
I found that request.request.request._connection._parser._state = -13 (
org.mortbay.jetty.HttpParser.STATE_START) when things goes wrong (Should be
org.mortbay.jetty.HttpParser.STATE_CONTENT). I did not figure out how I can
test on this value, so I change my JavaScript code:





owner.simplifyPolylineLastCallCnt = 0;

owner.simplifyPolyline = function (tolerance) {

owner.simplifyPolylineLastCallCnt++;

var callId = owner.simplifyPolylineLastCallCnt;

$.post("/map/client/trackdraw:DouglasPeuckerSimplifier", {

}).done(function (data) {

if (callId != owner.simplifyPolylineLastCallCnt) return;

// DO THE WORK



Now I can set onDouglasPeuckerSimplifier back to allowBlank = false and
skip the == null test :-)



Forgot to tell that I am running Tapestry 5.4-beta-26.





*From:* Lance Java [via Apache Tapestry Mailing List Archives] [mailto:
ml-node+s1045711n5730599...@n5.nabble.com]
*Sent:* 7. mai 2015 11:39
*To:* Svein
*Subject:* Re: Detect jqXHR.abort()



The server will know about an aborted request as it's too late, the request
has already been sent. Abort is a clientside concept AFAIK which stops the
client from waiting for the response / processing it.
--

*If you reply to this email, your message will be added to the discussion
below:*

http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Detect-jqXHR-abort-tp5730595p5730599.html

To unsubscribe from Apache Tapestry Mailing List Archives, click here

.
NAML



Detect jqXHR.abort()

2015-05-06 Thread Svein Erik Løken
In the web client the user can use a  slider to
reduce number of points on a polyline.

To be sure to only pick last XHR request I call xhr.abort() on the
previous call.

The problem is that the onDouglasPeuckerSimplifier(...) fail. I found a
bad(!?) workaround by adding @RequestParameter(allowBlank = true) to
both/all parameters and return if some of them are null.

I was looking for values indicating that the request was aborted in
org.apache.tapestry5.services.Request.

In my log I am getting: WARN:  org.mortbay.jetty.EofException

How can I detect if the XHR request is aborted?

JavaScript:
owner.simplifyPolyline = function (tolerance) {
if (owner._xhr != null) {
owner._xhr.abort();
owner._xhr = null;
}
owner._xhr =
   $.post("/map/client/trackdraw:DouglasPeuckerSimplifier", {...
   }).done(function (data) {...
   }).always(function () {
 owner._xhr = null;
   });
…

Java:
private JSONObject onDouglasPeuckerSimplifier(
@RequestParameter(value = "latLngs", allowBlank = true) JSONArray
latLngs,
@RequestParameter(value = "distanceTolerance", allowBlank = true)
Double distanceTolerance) {
if (latLngs == null || distanceTolerance == null) {
return null;
}
...

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



Live Class Reloading of Autoloading Modules

2015-03-02 Thread Svein Erik Løken
How can I get an auto loaded module live reloaded?

Confiuration:

maven-jar-plugin




com.company.core.services.Tjac3CommonModule






@Contribute(ComponentClassResolver.class)
public static void
contributeCoreLibComponentClasses(Configuration
configuration) {
configuration.add(new LibraryMapping("companycore",
"com.company.core"));
}



I added a symbolic directory link in the tapestry.app-package:

src\main\java\com\company>mklink /d core
..\..\..\..\..\..\..\tjac-common\tjac-core\src\main\java\com\company\core

Now it works, but in IntelliJ all classes in the core module duplicated.

I have been searching for a way to contribute the core library to be live
class reloaded.

Is it possible?


How to clear the autocomplete cache?

2015-02-10 Thread Svein Erik Løken
Search box on a map:



I need to call Bloodhound.clearRemoteCache() in typeahead.js

Did not find out how to access the engine variable in autocomplete.js.



Temporary hack/workaround:

I added $field.data("engine", engine); to autocomplete.js

engine.initialize();
dataset = {
name: spec.id,
displayKey: _.identity,
source: engine.ttAdapter()
  };
*  $field.data("engine", engine);*
  return $field.typeahead({
minLength: spec.minChars
  }, dataset);
};
return exports = init;
  });



Now I can clear cache with:

var ttInput = $(this._searchField).find("input.tt-input");
ttInput.data('engine').clearRemoteCache();



I don't want to modify t5/core/autocomplete.js



Hope someone can help me with a better solution!


IntelliJ IDEA 13.0.2 x64 Tapestry plugin not working correctly or lacks functionality for TML files

2014-03-07 Thread Svein Erik Løken
For ordinary HTML code, like , navigation/usage is
not working for included CSS files.

Code completion does not work for: ${asset: |}, ${message: |}, .

Because Tapestry gives excellent exceptions for wrong ${asset: |},
${message: |} etc, I think lack of navigation for CSS is the biggest
issue.

I tried to reassign *.tml to other File Types (Settings > Editor > File
Types). I found "Jinja 2 template files" usable. This template accepts the
':' inside ${ }. It is now possible to navigate to declaration (Ctrl+B)
and find usages (Alt+F7). Switching file type back and forth if not a good
solution.

My Tapestry plugin info:
   Name: Tapestry support (Bundled)
   Description: Provides Tapestry 5.1 integration.


Is my IntelliJ configuration wrong or does the Tapestry plugin lack this
functionality?

S-E

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



RE: IntelliJ IDEA Tapestry plugin existence

2014-02-27 Thread Svein Erik Løken
Great to hear! I am using the Ultimate Edition of IDEA and the Tapestry
plugin. After reading your mail I found this project
https://github.com/Widen/tapestry5-idea and feel relieved that the plugin
is under active development.

-Original Message-
From: Stephan Windmüller [mailto:stephan.windmuel...@tu-dortmund.de]
Sent: 27. februar 2014 12:00
To: users@tapestry.apache.org
Subject: Re: IntelliJ IDEA Tapestry plugin existence

On 27.02.2014 10:40 Svein Erik Løken wrote:

> After a lot of research Tapestry seems to be the right choice for my
> next project. I found Tapestry through the New Project Wizard in
> IntelliJ. The plugin project TapIDEA/Loomy does not exist anymore, so
> I am worry about updates to this Tapestry plugin. Do you think this
> plugin will be removed in some future IntelliJ release?

IntelliJ IDEA comes with a great Tapestry Plugin which is under active
development:

http://www.jetbrains.com/idea/webhelp/tapestry.html

However, it is only included in the Ultimate Edition of IDEA:

http://www.jetbrains.com/idea/features/editions_comparison_matrix.html

- Stephan

-
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



IntelliJ IDEA Tapestry plugin existence

2014-02-27 Thread Svein Erik Løken
After a lot of research Tapestry seems to be the right choice for my next
project. I found Tapestry through the New Project Wizard in IntelliJ. The
plugin project TapIDEA/Loomy does not exist anymore, so I am worry about
updates to this Tapestry plugin. Do you think this plugin will be removed
in some future IntelliJ release?