Re: [ANNOUNCEMENT] Project Arras

2014-11-13 Thread Felix Scheffer
Hi Nathan,

there is an online demo for arras-components:

https://arras-components.herokuapp.com/


I am still trying to get the demo for arras-cms up and running, but you can
also download the war file from
https://oss.sonatype.org/content/groups/public/com/github/fscheffer/arras-cms-demo/1.1.1/arras-cms-demo-1.1.1.war

and deploy it yourself (the demo is using the h2 in-memory database by
default).

Felix



2014-11-13 14:48 GMT+01:00 Nathan Quirynen :

>  Looks nice (looking at the code)!
>
> Are there online demos running to show everything?
>
> Congratz on the work ;)
>
> Nathan
>
> On 13/11/14 14:43, George Christman wrote:
>
> Excellent, congrats!
>
> On Wed, Nov 12, 2014 at 1:44 PM, Kalle Korhonen  
> 
> wrote:
>
>
>  Looks nice, congrats!
>
> Kalle
>
> On Wed, Nov 12, 2014 at 9:27 AM, Felix Scheffer  
> 
> wrote:
>
>
>  Hi all,
>
> I'm pleased to announce the release of arras-components and arras-cms.
> https://github.com/fscheffer/arras/
>
> *Arras-components* is set of components for Tapestry 5.4 (based on beta
> 22).
> Currently the following components are part of the project:
> TabGroup, Dropdown, Lightbox, DataTable, Icon (fontawesome),
>
>  RemoteSubmit,
>
>  MediumEditor and Player (video and audio).
>
> Hopefully this list will grow further in the future.
>
> *Arras-cms* provides simple functionality to change the content of your
> site without actually having to redeploy it. It's using a WYSIWYG
>
>  approach
>
>  to change the content and is using tapestry-jpa to read and write content
> from and to a database.
>
> The jar files for both, arras-components and arras-cms, are available on
> Maven Central.
>
> If there are any questions or suggestions or feedback, feel free to
>
>  contact
>
>  me.
>
> Felix Scheffer
>
>
>
>
> --
>
>
> Een klare kijk op aanvullende pensioenen
>
> *Nathan Quirynen*
> 03 340 04 60 | 0494 28 45 15
> nat...@pensionarchitects.be
>
> Follow us on Web  | Twitter
>  | LinkedIn
>  | RSS
>  | YouTube
> 
>
>


Re: [5.4] javascript - simplify the new paradigm please

2014-11-13 Thread Geoff Callender
I don't think so. I believe the rule of thumb is to use JavaScriptSupport 
during render, and use an AJAX callback during partial page render. 

IIRC, the JavaScriptSupport environmental is not available when you're handling 
an AJAX component event request. 

On 13 Nov 2014, at 6:08 pm, Chris Poulsen  wrote:

> can't you just use javascriptsupport to require and invoke your js module
> function?
> 
> -- 
> Chris
> 
> On Thu, Nov 13, 2014 at 6:34 AM, Geoff Callender <
> geoff.callender.jumpst...@gmail.com> wrote:
> 
>> Have you had a look at these two:
>> 
>> 
>> http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/modal/1
>> 
>> http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/reusablemodal/1
>> 
>> Do they fit your scenario?
>> 
>> On 13 Nov 2014, at 3:40 pm, Paul Stanton  wrote:
>> 
>>> Hi Geoff,
>>> 
>>> I have found your examples invaluable in learning some of the basics of
>> this (and other) concepts. I can't thank you enough
>>> 
>>> .. the only thing I can see is missing currently is the example I asked
>> about in the previous mail:
>>> 
>>> Basically, how do I interact with a js module instance after it is
>> created?
>>> 
>>> pretend some server-side state changes between afterRender and
>> onSomeEvent, and the client needs to react accordingly.
>>> 
>>> jss.addScript is deprecated, so I "shouldn't" be telling the client to
>> execute script apparently...
>>> 
>>> cheers, p.
>>> 
>>> On 13/11/2014 2:36 PM, Geoff Callender wrote:
 do these examples cover the situations you are describing?
>>> 
>>> 
>>> -
>>> 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: [5.4] javascript - simplify the new paradigm please

2014-11-13 Thread Geoff Callender
I accidentally left out the object's state vars. Added below.

On 14 Nov 2014, at 10:00 am, Geoff Callender 
 wrote:

> Yep, that's a valid case, and it's one I have to put into JumpStart.
> 
> Here's the way I handle it. I'd like to see what others do.
> 
> Have the module keep an array of objects, identified by a key. The 
> server-side can provide the key when initialising and later whenever invoking 
> a function. The component can use any value for the key as long as it is 
> unique on the page and as long as it is repeatable (eg. the component might 
> need to derive the key from its container or context). 
> 
> Here's an example snippet from a module I called "activate-selectables". More 
> than one component on my page uses this module. A typical case is when I have 
> a list of items on the page, and a button that pops up a modal with another 
> list of items. When an item is selected, the server-side has to set the 
> currentElement on the correct list.
> 
> define([ "jquery", "t5/core/console" ], function($, console) {
> 
>   var selectablesContainers = [];
> 
>   SelectablesContainer = function() {

var containerId = "", selectableClass = "", selectedClass = "", 
currentClass = "";

>   init = function(params) {
>   containerId = params.containerId;
>   selectableClass = params.selectableCssClass;
>   selectedClass = params.selectedCssClass;
>   // etc
>   var $container = $('#' + containerId);
>   $container.on('click', '.' + selectableClass, 
> doSelected);
>   };
> 
>   doSelected = function() {
>   var $clicked = $(this);
>   $clicked.addClass(selectedClass);
>   $clicked.trigger('selected');
>   };
> 
>   setCurrentElement = function(selectableName) {
>   // etc.
>   };
> 
>   return {
>   init : init,
>   setCurrentElement : setCurrentElement
>   };
>   };
> 
>   init = function(key, params) {
>   var selectablesContainer = new SelectablesContainer();
>   selectablesContainer.init(params);
>   selectablesContainers[key] = selectablesContainer;
>   };
> 
>   setCurrentElement = function(key, currentElementName) {
>   var selectablesContainer = selectablesContainers[key];
>   selectablesContainer.setCurrentElement(currentElementName);
>   };
> 
>   return {
>   init : init,
>   setCurrentElement : setCurrentElement
>   };
> 
> });
> 
> And some corresponding java:
> 
>   void afterRender() {
>   JSONObject params = new JSONObject();
>   params.put("containerId", thingsDiv.getClientId());
>   //etc
>   
> javaScriptSupport.require("activate-selectables").invoke("init").with(SELECTABLES_KEY,
>  params);
>   }
> 
>   Object onThingSelected(Integer thingId) {
>   this.thingId = thingId;
>   // etc
>   
> ajaxResponseRenderer.addCallback(makeScriptToSetCurrentElement(selectableName));
>   // etc
>   }
> 
>   private JavaScriptCallback makeScriptToSetCurrentElement(final String 
> selectableName) {
> 
>   return new JavaScriptCallback() {
> 
>   public void run(JavaScriptSupport javaScriptSupport) {
>   
> javaScriptSupport.require("activate-selectables").invoke("setCurrentElement")
>   .with(SELECTABLES_KEY, 
> selectableName);
>   }
> 
>   };
> 
>   }
> 
> In this case I get away with SELECTABLES_KEY being a constant but, as I said 
> above, sometimes you have to derive its value from its container or event 
> context.
> 
> Geoff
> 
> On 14 Nov 2014, at 9:18 am, Paul Stanton  wrote:
> 
>> Oh,
>> 
>> so calling
>> require("modal").invoke("activate")
>> 
>> and then later
>> require("modal").invoke("deactivate")
>> 
>> .. both re-construct a seperate "modal" js object and then call one of the 
>> two published functions...
>> 
>> what if you have two different modals? what if they are init-ed differently:
>> 
>> java:afterRender() {
>>require("modal").invoke("init").with("message 1");
>>require("modal").invoke("init").with("message 2");
>> }
>> 
>> and then later
>> java:onSomeEvent() {
>>require("modal").invoke("activate");
>> }
>> 
>> this flow would essentially construct the modal module instance 3 times, and 
>> the "activate" wouldn't know about "message 1" or "message 2".
>> 
>> Therefore, how would I re-aquire a handle to a specific module instance 
>> later on? for eg:
>> 
>> java:onSomeEvent(){
>>// activate modal with "message 1"
>>require("modal").invo

Re: [ANNOUNCEMENT] Project Arras

2014-11-13 Thread Chris Mylonas

This is great!!

I just cloned the github repo, went into the arras-cms-demo directory and  
changed pom.xml values from 1.1.2-SNAPSHOT to 1.1.0

mvn jetty:run

in place editing is sweet



On Fri, 14 Nov 2014 00:48:18 +1100, Nathan Quirynen  
 wrote:



Looks nice (looking at the code)!

Are there online demos running to show everything?

Congratz on the work ;)

Nathan

On 13/11/14 14:43, George Christman wrote:

Excellent, congrats!

On Wed, Nov 12, 2014 at 1:44 PM, Kalle Korhonen  


wrote:


Looks nice, congrats!

Kalle

On Wed, Nov 12, 2014 at 9:27 AM, Felix Scheffer  


wrote:


Hi all,

I'm pleased to announce the release of arras-components and arras-cms.

https://github.com/fscheffer/arras/

*Arras-components* is set of components for Tapestry 5.4 (based on  
beta

22).
Currently the following components are part of the project:
TabGroup, Dropdown, Lightbox, DataTable, Icon (fontawesome),

RemoteSubmit,

MediumEditor and Player (video and audio).

Hopefully this list will grow further in the future.

*Arras-cms* provides simple functionality to change the content of  
your

site without actually having to redeploy it. It's using a WYSIWYG

approach
to change the content and is using tapestry-jpa to read and write  
content

from and to a database.

The jar files for both, arras-components and arras-cms, are available  
on

Maven Central.

If there are any questions or suggestions or feedback, feel free to

contact

me.

Felix Scheffer







--

Een klare kijk op aanvullende pensioenen

Nathan Quirynen
03 340 04 60 | 0494 28 45 15
nat...@pensionarchitects.be

Follow us on Web | Twitter | LinkedIn | RSS | YouTube





--
Using Opera's mail client: http://www.opera.com/mail/

Re: [5.4] javascript - simplify the new paradigm please

2014-11-13 Thread Geoff Callender
A better example would be where the client-side objects have considerable 
state, eg. a Graph object or, more complex still, a Graph editor. 

Of course, client-side objects may be avoided having your javascript 
save/retrieve all state to/from hidden fields in the relevant part of the DOM, 
but that's just another implementation choice.

On 14 Nov 2014, at 10:00 am, Geoff Callender 
 wrote:

> Yep, that's a valid case, and it's one I have to put into JumpStart.
> 
> Here's the way I handle it. I'd like to see what others do.
> 
> Have the module keep an array of objects, identified by a key. The 
> server-side can provide the key when initialising and later whenever invoking 
> a function. The component can use any value for the key as long as it is 
> unique on the page and as long as it is repeatable (eg. the component might 
> need to derive the key from its container or context). 
> 
> Here's an example snippet from a module I called "activate-selectables". More 
> than one component on my page uses this module. A typical case is when I have 
> a list of items on the page, and a button that pops up a modal with another 
> list of items. When an item is selected, the server-side has to set the 
> currentElement on the correct list.
> 
> define([ "jquery", "t5/core/console" ], function($, console) {
> 
>   var selectablesContainers = [];
> 
>   SelectablesContainer = function() {
> 
>   init = function(params) {
>   containerId = params.containerId;
>   selectableClass = params.selectableCssClass;
>   selectedClass = params.selectedCssClass;
>   // etc
>   var $container = $('#' + containerId);
>   $container.on('click', '.' + selectableClass, 
> doSelected);
>   };
> 
>   doSelected = function() {
>   var $clicked = $(this);
>   $clicked.addClass(selectedClass);
>   $clicked.trigger('selected');
>   };
> 
>   setCurrentElement = function(selectableName) {
>   // etc.
>   };
> 
>   return {
>   init : init,
>   setCurrentElement : setCurrentElement
>   };
>   };
> 
>   init = function(key, params) {
>   var selectablesContainer = new SelectablesContainer();
>   selectablesContainer.init(params);
>   selectablesContainers[key] = selectablesContainer;
>   };
> 
>   setCurrentElement = function(key, currentElementName) {
>   var selectablesContainer = selectablesContainers[key];
>   selectablesContainer.setCurrentElement(currentElementName);
>   };
> 
>   return {
>   init : init,
>   setCurrentElement : setCurrentElement
>   };
> 
> });
> 
> And some corresponding java:
> 
>   void afterRender() {
>   JSONObject params = new JSONObject();
>   params.put("containerId", thingsDiv.getClientId());
>   //etc
>   
> javaScriptSupport.require("activate-selectables").invoke("init").with(SELECTABLES_KEY,
>  params);
>   }
> 
>   Object onThingSelected(Integer thingId) {
>   this.thingId = thingId;
>   // etc
>   
> ajaxResponseRenderer.addCallback(makeScriptToSetCurrentElement(selectableName));
>   // etc
>   }
> 
>   private JavaScriptCallback makeScriptToSetCurrentElement(final String 
> selectableName) {
> 
>   return new JavaScriptCallback() {
> 
>   public void run(JavaScriptSupport javaScriptSupport) {
>   
> javaScriptSupport.require("activate-selectables").invoke("setCurrentElement")
>   .with(SELECTABLES_KEY, 
> selectableName);
>   }
> 
>   };
> 
>   }
> 
> In this case I get away with SELECTABLES_KEY being a constant but, as I said 
> above, sometimes you have to derive its value from its container or event 
> context.
> 
> Geoff
> 
> On 14 Nov 2014, at 9:18 am, Paul Stanton  wrote:
> 
>> Oh,
>> 
>> so calling
>> require("modal").invoke("activate")
>> 
>> and then later
>> require("modal").invoke("deactivate")
>> 
>> .. both re-construct a seperate "modal" js object and then call one of the 
>> two published functions...
>> 
>> what if you have two different modals? what if they are init-ed differently:
>> 
>> java:afterRender() {
>>require("modal").invoke("init").with("message 1");
>>require("modal").invoke("init").with("message 2");
>> }
>> 
>> and then later
>> java:onSomeEvent() {
>>require("modal").invoke("activate");
>> }
>> 
>> this flow would essentially construct the modal module instance 3 times, and 
>> the "activate" wouldn't know about "message 1" or "message 2".
>> 
>> Therefore,

Re: [5.4] javascript - simplify the new paradigm please

2014-11-13 Thread Geoff Callender
Yep, that's a valid case, and it's one I have to put into JumpStart.

Here's the way I handle it. I'd like to see what others do.

Have the module keep an array of objects, identified by a key. The server-side 
can provide the key when initialising and later whenever invoking a function. 
The component can use any value for the key as long as it is unique on the page 
and as long as it is repeatable (eg. the component might need to derive the key 
from its container or context). 

Here's an example snippet from a module I called "activate-selectables". More 
than one component on my page uses this module. A typical case is when I have a 
list of items on the page, and a button that pops up a modal with another list 
of items. When an item is selected, the server-side has to set the 
currentElement on the correct list.

define([ "jquery", "t5/core/console" ], function($, console) {

var selectablesContainers = [];

SelectablesContainer = function() {

init = function(params) {
containerId = params.containerId;
selectableClass = params.selectableCssClass;
selectedClass = params.selectedCssClass;
// etc
var $container = $('#' + containerId);
$container.on('click', '.' + selectableClass, 
doSelected);
};

doSelected = function() {
var $clicked = $(this);
$clicked.addClass(selectedClass);
$clicked.trigger('selected');
};

setCurrentElement = function(selectableName) {
// etc.
};

return {
init : init,
setCurrentElement : setCurrentElement
};
};

init = function(key, params) {
var selectablesContainer = new SelectablesContainer();
selectablesContainer.init(params);
selectablesContainers[key] = selectablesContainer;
};

setCurrentElement = function(key, currentElementName) {
var selectablesContainer = selectablesContainers[key];
selectablesContainer.setCurrentElement(currentElementName);
};

return {
init : init,
setCurrentElement : setCurrentElement
};

});

And some corresponding java:

void afterRender() {
JSONObject params = new JSONObject();
params.put("containerId", thingsDiv.getClientId());
//etc

javaScriptSupport.require("activate-selectables").invoke("init").with(SELECTABLES_KEY,
 params);
}

Object onThingSelected(Integer thingId) {
this.thingId = thingId;
// etc

ajaxResponseRenderer.addCallback(makeScriptToSetCurrentElement(selectableName));
// etc
}

private JavaScriptCallback makeScriptToSetCurrentElement(final String 
selectableName) {

return new JavaScriptCallback() {

public void run(JavaScriptSupport javaScriptSupport) {

javaScriptSupport.require("activate-selectables").invoke("setCurrentElement")
.with(SELECTABLES_KEY, 
selectableName);
}

};

}

In this case I get away with SELECTABLES_KEY being a constant but, as I said 
above, sometimes you have to derive its value from its container or event 
context.

Geoff

On 14 Nov 2014, at 9:18 am, Paul Stanton  wrote:

> Oh,
> 
> so calling
> require("modal").invoke("activate")
> 
> and then later
> require("modal").invoke("deactivate")
> 
> .. both re-construct a seperate "modal" js object and then call one of the 
> two published functions...
> 
> what if you have two different modals? what if they are init-ed differently:
> 
> java:afterRender() {
>require("modal").invoke("init").with("message 1");
>require("modal").invoke("init").with("message 2");
> }
> 
> and then later
> java:onSomeEvent() {
>require("modal").invoke("activate");
> }
> 
> this flow would essentially construct the modal module instance 3 times, and 
> the "activate" wouldn't know about "message 1" or "message 2".
> 
> Therefore, how would I re-aquire a handle to a specific module instance later 
> on? for eg:
> 
> java:onSomeEvent(){
>// activate modal with "message 1"
>require("modal").invoke("activate");
> }
> 
> I know this example doesn't make much practical sense, but the concept of 
> communicating with something stateful is pretty key!
> 
> p.
> 
> On 13/11/2014 4:34 PM, Geoff Callender wrote:
>> Have you had a look at these two:
>> 
>>  
>> http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/modal/1
>>  
>

Re: Tapestry-Hibernate unable to convert to client value

2014-11-13 Thread George Christman
Nah it was on my local machine. Strangly the page loads without issue too.

On Thursday, November 13, 2014, Lance Java 
wrote:

> Is 115185 an id that used to exist in the database? Perhaps it's a bot
> that's hitting an old id that was deleted?
>
> Or maybe a bot trying to just hit a random id?
>  On 13 Nov 2014 20:44, "George Christman"  > wrote:
>
> > Hi guys, I'm seeing this error in my logs, but everything appears to be
> > working fine. Does anybody know what the cause might be?
> >
> > (HibernateEntityValueEncoder.java:99) - Unable to convert client value
> > '115185' into an entity instance.
> >
> > I seen something here where they talk about the result being null, but
> from
> > what I can tell it's not.
> >
> >
> >
> http://1maven.com/sources/org.apache.tapestry:tapestry-hibernate:5.4-beta-6/hibernateentityvalueencoder
> >
> > btw, I'm using beta-22
> >
>


-- 
George Christman
CEO
www.CarDaddy.com
P.O. Box 735
Johnstown, New York


Re: [5.4] javascript - simplify the new paradigm please

2014-11-13 Thread Paul Stanton

Oh,

so calling
require("modal").invoke("activate")

and then later
require("modal").invoke("deactivate")

.. both re-construct a seperate "modal" js object and then call one of 
the two published functions...


what if you have two different modals? what if they are init-ed differently:

java:afterRender() {
require("modal").invoke("init").with("message 1");
require("modal").invoke("init").with("message 2");
}

and then later
java:onSomeEvent() {
require("modal").invoke("activate");
}

this flow would essentially construct the modal module instance 3 times, 
and the "activate" wouldn't know about "message 1" or "message 2".


Therefore, how would I re-aquire a handle to a specific module instance 
later on? for eg:


java:onSomeEvent(){
// activate modal with "message 1"
require("modal").invoke("activate");
}

I know this example doesn't make much practical sense, but the concept 
of communicating with something stateful is pretty key!


p.

On 13/11/2014 4:34 PM, Geoff Callender wrote:

Have you had a look at these two:


http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/modal/1

http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/reusablemodal/1

Do they fit your scenario?

On 13 Nov 2014, at 3:40 pm, Paul Stanton  wrote:


Hi Geoff,

I have found your examples invaluable in learning some of the basics of this 
(and other) concepts. I can't thank you enough

.. the only thing I can see is missing currently is the example I asked about 
in the previous mail:

Basically, how do I interact with a js module instance after it is created?

pretend some server-side state changes between afterRender and onSomeEvent, and 
the client needs to react accordingly.

jss.addScript is deprecated, so I "shouldn't" be telling the client to execute 
script apparently...

cheers, p.

On 13/11/2014 2:36 PM, Geoff Callender wrote:

do these examples cover the situations you are describing?


-
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: [5.4] JavascriptStack with module and css.

2014-11-13 Thread Paul Stanton

great, and it works. thanks.

is this documented?

On 13/11/2014 10:31 PM, Thiago H de Paula Figueiredo wrote:
On Thu, 13 Nov 2014 04:05:11 -0200, Paul Stanton 
 wrote:


oh ok, so hard code the meta-inf/assets part -- but this won't use 
the checksum cache key - which i suppose is ok since it isn't updated 
often.


If you're using AssetSource, and Geoff's suggest code does, all the 
caching and checksumming will be done automatically.





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



Re: Minify JS / CSS in production

2014-11-13 Thread Thiago H de Paula Figueiredo
On Thu, 13 Nov 2014 17:28:10 -0200, Kalle Korhonen  
 wrote:



It's tapestry-webresources (
http://repo1.maven.org/maven2/org/apache/tapestry/tapestry-webresources/).


Ouch, I copied that from http://tapestry.apache.org/assets.html. Gotta fix  
that. Good catch, Kalle!


--
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: Tapestry-Hibernate unable to convert to client value

2014-11-13 Thread Lance Java
Is 115185 an id that used to exist in the database? Perhaps it's a bot
that's hitting an old id that was deleted?

Or maybe a bot trying to just hit a random id?
 On 13 Nov 2014 20:44, "George Christman"  wrote:

> Hi guys, I'm seeing this error in my logs, but everything appears to be
> working fine. Does anybody know what the cause might be?
>
> (HibernateEntityValueEncoder.java:99) - Unable to convert client value
> '115185' into an entity instance.
>
> I seen something here where they talk about the result being null, but from
> what I can tell it's not.
>
>
> http://1maven.com/sources/org.apache.tapestry:tapestry-hibernate:5.4-beta-6/hibernateentityvalueencoder
>
> btw, I'm using beta-22
>


Tapestry-Hibernate unable to convert to client value

2014-11-13 Thread George Christman
Hi guys, I'm seeing this error in my logs, but everything appears to be
working fine. Does anybody know what the cause might be?

(HibernateEntityValueEncoder.java:99) - Unable to convert client value
'115185' into an entity instance.

I seen something here where they talk about the result being null, but from
what I can tell it's not.

http://1maven.com/sources/org.apache.tapestry:tapestry-hibernate:5.4-beta-6/hibernateentityvalueencoder

btw, I'm using beta-22


Re: Minify JS / CSS in production

2014-11-13 Thread Kalle Korhonen
It's tapestry-webresources (
http://repo1.maven.org/maven2/org/apache/tapestry/tapestry-webresources/).

Kalle

On Thu, Nov 13, 2014 at 10:42 AM, George Christman 
wrote:

> Thanks Thiago.
>
> On Thu, Nov 13, 2014 at 1:37 PM, Thiago H de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > On Thu, 13 Nov 2014 16:28:01 -0200, George Christman <
> > gchrist...@cardaddy.com> wrote:
> >
> >  How do I minify tapestry's JS and CSS? Google is complaining saying that
> >> 62.3kib 50% could be saved with the core js alone. It also says
> something
> >> about optimizing css delivery and points to all the tapestry's css.
> >>
> >
> > Check the Minimizing Assets section at the bottom of
> > http://tapestry.apache.org/assets.html. Basically, add the
> > tapestry-web-resources dependency (Maven snippet below) and set the
> > SymbolConstants.MINIFICATION_ENABLED symbol to true.
> >
> > 
> > org.apache.tapestry
> > tapestry-web-resources
> > 5.4
> > 
> >
> > @Contribute(SymbolProvider.class)
> > @ApplicationDefaults
> > public static void
> contributeApplicationDefaults(MappedConfiguration > String> configuration) {
> > configuration.add(SymbolConstants.MINIFICATION_ENABLED, "true");
> > }
> >
> > --
> > 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
> >
> >
>
>
> --
> George Christman
> CEO
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York
>


Re: Minify JS / CSS in production

2014-11-13 Thread George Christman
Thanks Thiago.

On Thu, Nov 13, 2014 at 1:37 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Thu, 13 Nov 2014 16:28:01 -0200, George Christman <
> gchrist...@cardaddy.com> wrote:
>
>  How do I minify tapestry's JS and CSS? Google is complaining saying that
>> 62.3kib 50% could be saved with the core js alone. It also says something
>> about optimizing css delivery and points to all the tapestry's css.
>>
>
> Check the Minimizing Assets section at the bottom of
> http://tapestry.apache.org/assets.html. Basically, add the
> tapestry-web-resources dependency (Maven snippet below) and set the
> SymbolConstants.MINIFICATION_ENABLED symbol to true.
>
> 
> org.apache.tapestry
> tapestry-web-resources
> 5.4
> 
>
> @Contribute(SymbolProvider.class)
> @ApplicationDefaults
> public static void contributeApplicationDefaults(MappedConfiguration String> configuration) {
> configuration.add(SymbolConstants.MINIFICATION_ENABLED, "true");
> }
>
> --
> 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
>
>


-- 
George Christman
CEO
www.CarDaddy.com
P.O. Box 735
Johnstown, New York


Re: Minify JS / CSS in production

2014-11-13 Thread Thiago H de Paula Figueiredo
On Thu, 13 Nov 2014 16:28:01 -0200, George Christman  
 wrote:



How do I minify tapestry's JS and CSS? Google is complaining saying that
62.3kib 50% could be saved with the core js alone. It also says something
about optimizing css delivery and points to all the tapestry's css.


Check the Minimizing Assets section at the bottom of  
http://tapestry.apache.org/assets.html. Basically, add the  
tapestry-web-resources dependency (Maven snippet below) and set the  
SymbolConstants.MINIFICATION_ENABLED symbol to true.



org.apache.tapestry
tapestry-web-resources
5.4


@Contribute(SymbolProvider.class)
@ApplicationDefaults
public static void  
contributeApplicationDefaults(MappedConfiguration  
configuration) {

configuration.add(SymbolConstants.MINIFICATION_ENABLED, "true");
}

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



Minify JS / CSS in production

2014-11-13 Thread George Christman
How do I minify tapestry's JS and CSS? Google is complaining saying that
62.3kib 50% could be saved with the core js alone. It also says something
about optimizing css delivery and points to all the tapestry's css.

Thanks,
George

-- 
George Christman
CEO
www.CarDaddy.com
P.O. Box 735
Johnstown, New York


Re: [5.4] javascript - simplify the new paradigm please

2014-11-13 Thread Howard Lewis Ship
The change in JavaScript is to support several goals:
- A good transition from Prototype.js to jQuery (or perhaps something else
in the future)
- Reduce the total amount of JavaScript sent to the client
- Allow more of the JavaScript to transfer in parallel
- Make it easier to override Tapestry's built-in behaviors
- Improve page loading speed

Having a single JavaScript event handler added to document.body, rather
than having N handlers attached to N DOM elements, is a big win
performance-wise. It also allows any particular DOM element to change the
behavior by adding a specific event handler at that DOM level and not
allowing the event to propagate up.

The Tapestry docs have been updated with more information, such as:

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




On Wed, Nov 12, 2014 at 3:13 AM, Paul Stanton  wrote:

> Hi,
>
> so like many developers (i'm guessing) I'm not quite up to speed with all
> these new javascript frameworks: requirejs, closure, etc etc and to be
> honest I really didn't see a problem with the namespace model of the past.
> I'm not open to learning but it seems like a paradigm far removed from what
> i'm used to. it doesn't seem object oriented at all for example.
>
> that aside, can someone please point me (and other readers) to some basic
> examples to get us started in this brave new world. the first thing I would
> like to achieve is to be able to call some page or component specific
> marshalling code with page/component context parameters.
>
> your helpful attitudes will be appreciated!
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com
@hlship


Re: Remove Tapestry Meta Tag

2014-11-13 Thread George Christman
I'm only using that as an example. Yes he fixed it, but unfortunately I
don't know how to use the fix with ajax. Another topic though.

On Thu, Nov 13, 2014 at 9:15 AM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Thu, 13 Nov 2014 12:11:09 -0200, George Christman <
> gchrist...@cardaddy.com> wrote:
>
>  I know your probably right, but I don't want to do all the work for them
>> lol, I just worry about things that may come up like the select menu
>> vulnerability Howard discovered. Anyhow Thanks guys :)
>>
>
> Isn't that fixed already?
>
>
> --
> 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
>
>


-- 
George Christman
CEO
www.CarDaddy.com
P.O. Box 735
Johnstown, New York


Re: session invalidate in tapestry

2014-11-13 Thread Thiago H de Paula Figueiredo
On Thu, 13 Nov 2014 12:16:03 -0200, Ivano Luberti   
wrote:



Hi all, I have a question about session handling in Tapestry5.
I have a

@SessionState
protected User user;


Shouldn't it be @SessionState(create = false) so user isn't instantiated  
automatically and is null until you set the field?




that works as expected

I wanted to perform some cleanup when calling a logout link: the action
link listener is made as this:

public Object onActionFromLink() {
   requestGlobals.getHTTPServletRequest().getSession().invalidate();
   return Index.class;
   }


You can (and should) @Inject Request. There's absolutely no reason in the  
last 5 years to use RequestGlobals to get the request object. You can also  
@Inject HttpServletRequest and HttpServletResponse directly if needed.


@Inject
private Request request;

...

Session session = request.getSession(false);
if (session != null) {
session.invalidate();
}


I don't know if this is important (I guess not) but the method is in a
component and not direclty in a page (so that I can render the link only
in protected pages )


No difference. Please change the @SessionState usage as I suggested and  
try again.


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



session invalidate in tapestry

2014-11-13 Thread Ivano Luberti
Hi all, I have a question about session handling in Tapestry5.
I have a

@SessionState
protected User user;

that works as expected

I wanted to perform some cleanup when calling a logout link: the action
link listener is made as this:

public Object onActionFromLink() {
   
 
requestGlobals.getHTTPServletRequest().getSession().invalidate();
   
   
return Index.class;
 
}

I don't know if this is important (I guess not) but the method is in a
component and not direclty in a page (so that I can render the link only
in protected pages )

To centralize the cleanup that could happen both on logout action and on
session timeout I have implemented the User with the  HttpSessionListener.

The problem is that after the invalidate() call the method

public void sessionDestroyed(HttpSessionEvent se) {

is called as intended but the User object is empty as it was just
instantiated and in fact debugging I can see that is a different
instance from the one created when the session was started.

I can certainly find other ways (a RequestFilter?) but I would like to
understand what is going on.

TIA


-- 
==
dott. Ivano Mario Luberti
Archimede Informatica societa' cooperativa a r. l.
Sede Operativa
Via Gereschi 36 - 56126- Pisa
tel.: +39-050- 580959
tel/fax: +39-050-9711344
web: www.archicoop.it
==



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



Re: Remove Tapestry Meta Tag

2014-11-13 Thread Thiago H de Paula Figueiredo
On Thu, 13 Nov 2014 12:11:09 -0200, George Christman  
 wrote:



I know your probably right, but I don't want to do all the work for them
lol, I just worry about things that may come up like the select menu
vulnerability Howard discovered. Anyhow Thanks guys :)


Isn't that fixed already?

--
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: Remove Tapestry Meta Tag

2014-11-13 Thread George Christman
On Thu, Nov 13, 2014 at 9:04 AM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Thu, 13 Nov 2014 11:55:11 -0200, George Christman <
> gchrist...@cardaddy.com> wrote:
>
>  Hi guys, is there away to remove the "Apache Tapestry Framework (version
>> 5.4-beta-22)" meta tag from my src?
>>
>
> SymbolConstants.OMIT_GENERATOR_META, "tapestry.omit-generator-meta".
>
>  As you all know I love this framework, however I'd like to try and limit
>> my exposure to hackers looking for
>> a vulnerability
>>
>
> Hackers would figure out you're using Tapestry, even specifically 5.4,
> very easily. Even non-hackers. Anyway, that's not the kind of thing they'd
> use for an attack. It would be probably SQL injection or badly secured
> pages or attacks based on the operating system and its services.


I know your probably right, but I don't want to do all the work for them
lol, I just worry about things that may come up like the select menu
vulnerability Howard discovered. Anyhow Thanks guys :)

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


-- 
George Christman
CEO
www.CarDaddy.com
P.O. Box 735
Johnstown, New York


Re: Remove Tapestry Meta Tag

2014-11-13 Thread Thilo Tanner
Hi George,

Of course, you can do that. Contribute the following to the application
defaults (in your main module class):

public static void 
contributeApplicationDefaults(MappedConfiguration
configuration)
{
  configuration.add(SymbolConstants.OMIT_GENERATOR_META, true);
}


Best,
Thilo



Am 13.11.14 14:55 schrieb "George Christman" unter
:

>Hi guys, is there away to remove the "Apache Tapestry Framework (version
>5.4-beta-22)" meta tag from my src? As you all know I love this framework,
>however I'd like to try and limit my exposure to hackers looking for
>a vulnerability
>
>-- 
>George Christman
>CEO
>www.CarDaddy.com
>P.O. Box 735
>Johnstown, New York


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


Re: Remove Tapestry Meta Tag

2014-11-13 Thread Dusko Jovanovski
Sure, you just need to override this
symbol: SymbolConstants.OMIT_GENERATOR_META.
Here's a sample of overriding it in a module:

@Contribute(SymbolProvider.class)
@ApplicationDefaults
public static void provideSymbols(MappedConfiguration
configuration)
{
// ...
   configuration.add(SymbolConstants.OMIT_GENERATOR_META, true);
}

On Thu, Nov 13, 2014 at 2:55 PM, George Christman 
wrote:

> Hi guys, is there away to remove the "Apache Tapestry Framework (version
> 5.4-beta-22)" meta tag from my src? As you all know I love this framework,
> however I'd like to try and limit my exposure to hackers looking for
> a vulnerability
>
> --
> George Christman
> CEO
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York
>


Re: Remove Tapestry Meta Tag

2014-11-13 Thread Thiago H de Paula Figueiredo
On Thu, 13 Nov 2014 11:55:11 -0200, George Christman  
 wrote:



Hi guys, is there away to remove the "Apache Tapestry Framework (version
5.4-beta-22)" meta tag from my src?


SymbolConstants.OMIT_GENERATOR_META, "tapestry.omit-generator-meta".

As you all know I love this framework, however I'd like to try and limit  
my exposure to hackers looking for

a vulnerability


Hackers would figure out you're using Tapestry, even specifically 5.4,  
very easily. Even non-hackers. Anyway, that's not the kind of thing they'd  
use for an attack. It would be probably SQL injection or badly secured  
pages or attacks based on the operating system and its services.


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



Remove Tapestry Meta Tag

2014-11-13 Thread George Christman
Hi guys, is there away to remove the "Apache Tapestry Framework (version
5.4-beta-22)" meta tag from my src? As you all know I love this framework,
however I'd like to try and limit my exposure to hackers looking for
a vulnerability

-- 
George Christman
CEO
www.CarDaddy.com
P.O. Box 735
Johnstown, New York


Re: [ANNOUNCEMENT] Project Arras

2014-11-13 Thread Nathan Quirynen
Looks nice (looking at the code)!

Are there online demos running to show everything?

Congratz on the work ;)

Nathan

On 13/11/14 14:43, George Christman wrote:
> Excellent, congrats!
>
> On Wed, Nov 12, 2014 at 1:44 PM, Kalle Korhonen 
> wrote:
>
>> Looks nice, congrats!
>>
>> Kalle
>>
>> On Wed, Nov 12, 2014 at 9:27 AM, Felix Scheffer 
>> wrote:
>>
>>> Hi all,
>>>
>>> I'm pleased to announce the release of arras-components and arras-cms.
>>>
>>> https://github.com/fscheffer/arras/
>>>
>>> *Arras-components* is set of components for Tapestry 5.4 (based on beta
>>> 22).
>>> Currently the following components are part of the project:
>>> TabGroup, Dropdown, Lightbox, DataTable, Icon (fontawesome),
>> RemoteSubmit,
>>> MediumEditor and Player (video and audio).
>>>
>>> Hopefully this list will grow further in the future.
>>>
>>> *Arras-cms* provides simple functionality to change the content of your
>>> site without actually having to redeploy it. It's using a WYSIWYG
>> approach
>>> to change the content and is using tapestry-jpa to read and write content
>>> from and to a database.
>>>
>>> The jar files for both, arras-components and arras-cms, are available on
>>> Maven Central.
>>>
>>> If there are any questions or suggestions or feedback, feel free to
>> contact
>>> me.
>>>
>>> Felix Scheffer
>>>
>
>


-- 


Een klare kijk op aanvullende pensioenen

*Nathan Quirynen*
03 340 04 60 | 0494 28 45 15
nat...@pensionarchitects.be 

Follow us on Web  | Twitter
 | LinkedIn
 | RSS
 | YouTube




Re: [ANNOUNCEMENT] Project Arras

2014-11-13 Thread George Christman
Excellent, congrats!

On Wed, Nov 12, 2014 at 1:44 PM, Kalle Korhonen 
wrote:

> Looks nice, congrats!
>
> Kalle
>
> On Wed, Nov 12, 2014 at 9:27 AM, Felix Scheffer 
> wrote:
>
> > Hi all,
> >
> > I'm pleased to announce the release of arras-components and arras-cms.
> >
> > https://github.com/fscheffer/arras/
> >
> > *Arras-components* is set of components for Tapestry 5.4 (based on beta
> > 22).
> > Currently the following components are part of the project:
> > TabGroup, Dropdown, Lightbox, DataTable, Icon (fontawesome),
> RemoteSubmit,
> > MediumEditor and Player (video and audio).
> >
> > Hopefully this list will grow further in the future.
> >
> > *Arras-cms* provides simple functionality to change the content of your
> > site without actually having to redeploy it. It's using a WYSIWYG
> approach
> > to change the content and is using tapestry-jpa to read and write content
> > from and to a database.
> >
> > The jar files for both, arras-components and arras-cms, are available on
> > Maven Central.
> >
> > If there are any questions or suggestions or feedback, feel free to
> contact
> > me.
> >
> > Felix Scheffer
> >
>



-- 
George Christman
CEO
www.CarDaddy.com
P.O. Box 735
Johnstown, New York


Re: tynamo-federatedaccounts 0.5.0 released!

2014-11-13 Thread George Christman
I can't think of any one who would have been pestering you about this ;)
lol

Thanks Kalle for all the hard work, I look forward to finally setting this
up.

On Thu, Nov 13, 2014 at 3:50 AM, Charlouze  wrote:

> Thanks Kalle. I'm not using this one yet but I will very soon :D
>
> 2014-11-12 20:13 GMT+01:00 Kalle Korhonen :
>
> > Thanks to the enthusiastic, borderline pestering community :), yet
> another
> > tynamo module, this time tynamo-federatedaccounts 0.5.0, gets an upgrade
> to
> > T5.4! Use it before the code expires, see
> > http://tynamo.org/tynamo-federatedaccounts+guide and code at
> > https://github.com/tynamo/tynamo-federatedaccounts.
> >
> > Release notes at
> >
> >
> https://github.com/tynamo/tynamo-federatedaccounts/releases/tag/tynamo-federatedaccounts-parent-0.5.0
> >
> >- Upgrade to T5.4 #1
> >
> >- Rewrite the CollapsiblePanel component as a requirejs module #2
> >
> >
> > Enjoy,
> > The Tynamo Team
> >
>



-- 
George Christman
CEO
www.CarDaddy.com
P.O. Box 735
Johnstown, New York


Re: [5.4] JavascriptStack with module and css.

2014-11-13 Thread Thiago H de Paula Figueiredo
On Thu, 13 Nov 2014 04:05:11 -0200, Paul Stanton   
wrote:


oh ok, so hard code the meta-inf/assets part -- but this won't use the  
checksum cache key - which i suppose is ok since it isn't updated often.


If you're using AssetSource, and Geoff's suggest code does, all the  
caching and checksumming will be done automatically.


--
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: tynamo-federatedaccounts 0.5.0 released!

2014-11-13 Thread Charlouze
Thanks Kalle. I'm not using this one yet but I will very soon :D

2014-11-12 20:13 GMT+01:00 Kalle Korhonen :

> Thanks to the enthusiastic, borderline pestering community :), yet another
> tynamo module, this time tynamo-federatedaccounts 0.5.0, gets an upgrade to
> T5.4! Use it before the code expires, see
> http://tynamo.org/tynamo-federatedaccounts+guide and code at
> https://github.com/tynamo/tynamo-federatedaccounts.
>
> Release notes at
>
> https://github.com/tynamo/tynamo-federatedaccounts/releases/tag/tynamo-federatedaccounts-parent-0.5.0
>
>- Upgrade to T5.4 #1
>
>- Rewrite the CollapsiblePanel component as a requirejs module #2
>
>
> Enjoy,
> The Tynamo Team
>