I think the issue is because mOrder is not connected to the hibernate
session.
It looks like you are only saving the entity when the user clicks "accept".
I'm guessing that at some stage before you are submitting a form and
storing mOrder on the HttpSession?
If I were you, I'd try to remove HttpS
It depends on how you want to use it. If you just simply want external
services to push JSON to the client and then write a whole lot of
javascript to update the DOM then that's fine.
With tapestry-cometd I wanted to the option to write ZERO javascript by
leveraging tapestry component events and t
@Persist("entity") will store the id in the HttpSession and then lookup the
entity from the db any time it's required. In 99% of cases, you can avoid
HttpSession usage all together. By using @PageActivationContext or
onActivate() / onPassivate() you can pass the id in the URL and avoid
HttpSession
Not sure exactly what you're doing but you might find the map: binding
prefix useful from tapestry-stitch
http://tapestry-stitch.uklance.cloudbees.net/mapbindingdemo
The default binding prefix for the translate parameter is "translate:", not
"prop:".
Also, a prop binding of "field.type" will call yourPage.getField().getType()
Tapestry provides translators for Byte, Short, Integer, Long, Float,
Double, BigInteger and BigDecimal which can all be referenced by t
Unfortunately this is a bit tricky but it can be done
TML
---
Java
---
@InjectComponent Block myBlock;
@Property myBlockBodyAsString;
Block beginRender(MarkupWriter writer) {
writer.element("container");
return myBlock;
}
void beforeRenderTempl
Actually, that should be
void beforeRenderTemplate(MarkupWriter writer) {
Element container = writer.getElement();
writer.end();
myBlockBodyAsString = container.getChildMarkup();
container.remove();
}
Whilst that might work, it will likely produce invalid dom. If the element
has an id, there's a good chance you will have 2 elements on your page with
the same id which us illegal.
Well... In this case, if the cardLightbox generates an id you will start
with one hidden element with the id when you render the page.
Then, when the colorbox pops up the HTML will be used to create another
with exactly the same id.
On 19 Sep 2013 11:55, "Dmitry Gusev" wrote:
>
> You will get 2
I don't think you can guarantee that id based css selectors will work on
all browsers. And document.getElementById() would also not be guaranteed.
It would be simple to develop a component which converts it's body to a
string and updates a parameter binding.
This component can then be included in
> Also if I remember correctly doesnt Tapestry always create unique ids for
> elements
by adding $number to the components name?
Whilst it's true that most tapestry components will avoid an id conflict
when rendering, in this case it's not tapestry rendering the second
instance. A javascript is us
Igor has written a blog about scheduling jobs with tapestry here
http://blog.tapestry5.de/index.php/2011/09/18/scheduling-jobs-with-tapestry/
The hibernate session provided by tapestry is a singleton and can be
injected as any other service. The singleton is a proxy to a per-thread
instance which
I do this
http://stackoverflow.com/questions/15664815/how-to-test-dao-layer-in-tapestry-dependent-projects/15671034#15671034
On 22 September 2013 19:16, Boris Horvat wrote:
> Hi all,
>
> How does one make a proper testing of the business layer in tapestry that I
> inject into the page as a serv
g-ridden <
> > http://en.wikipedia.org/wiki/Computer_bug>,
> > slow implementation of half of Hudson.
> >
> >
> > On Sun, Sep 22, 2013 at 4:53 AM, Martin Kersten <
> > martin.kersten...@gmail.com
> > > wrote:
> >
> > > Thanks Lance.
Since colorbox supports 'inline' option you can solve this problem without
ever needing the HTML of the element you want to display.
Just render the colorbox content in a hidden div and use
$("#link").colorbox({inline:true, href:$("#showMe")}
Your ClassCastException is caused by using configuration.add(…, …) instead
of configuration.addInstance(…, …)
If you find that contribution to ServiceOverride fails causes circular
dependency you can decorate instead of override:
static BaseURLSource decorateBaseURLSource(BaseUrlSource default,
@
Assuming MyTask implements Runnable and takes a Session in it's
constructor:
Either
@Startup
public static void scheduleMyJob(PeriodicExecutor executor, Session
hibernateSession) {
Runnable mytask = new MyTask(hibernateSession);
executor.addJob(new IntervalSchedule(100L), "
Methods marked with @PostInjection will be called after your constructor.
The method params will be injected.
http://tapestry.apache.org/tapestry5/apidocs//org/apache/tapestry5/ioc/annotations/PostInjection.html
Eg
public class MyServiceImpl implements MyService {
public MyServiceImpl(Dependen
I'm not sure I see the point. ALL services in the tapestry registry are
singletons (including the hibernate session). So all services can be
constructor injected.
I get the feeling you don't understand how the hibernate session works in
tapestry. Please re-read my comment from the other thread des
> I know exactly how it works. So please correct your opinion about the
session source.
Ok, noted ;)
I'm guessing that want to create some form of dynamic proxy using plastic
(or java.lang.reflect.Proxy) to invoke a method. The proxy will inject in
the method arguments based on type / annotation
There's not an inbuilt component, I'm not sure exactly what you're doing
but it might be worth looking at infinite scroll.
This library allows you to render a page with a "next page" link which is
then hidden after applying the plugin.
It's been on my TODO list for a while now to integrate this w
It's in tapestry-hibernate-core
https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;a=blob;f=tapestry-hibernate-core/src/main/java/org/apache/tapestry5/internal/hibernate/PackageNameHibernateConfigurer.java
> Is it possible somehow to automate this?
Have you read Howard's answer on the Stack Overflow question? He suggests
splitting your AppModules in such a way that you can load a DAOModule
together with HibernateCoreModule for testing.
HibernateEntityPackageManager only has one method which gets the list of
hibernate entity package names. You might find it more lightweight to
create mock this rather than including HibernateModule.
On 26 Sep 2013 01:30, "Thiago H de Paula Figueiredo"
wrote:
> On Wed, 25 Sep 2013 20:01:14 -0300,
Taha blogged about integrating Valums file-uploader with tapestry (pre 5.4)
here
http://tawus.wordpress.com/2011/06/25/ajax-upload-for-tapestry/
I see that file-uploader has changed to fine-uploader and now has a
commercial license so perhaps it's not suitable but the blog post still
might be help
This is a pure javascript question, not really related to tapestry. jQuery
toggle() and show() will do it (and also support animations).
http://api.jquery.com/toggle/
http://api.jquery.com/show/
Possibly a web crawler sending an invalid request?
You can often use the user agent header to detect a bot.
If you are using m2e maven eclipse plugin then it should do the "right"
thing
1. If it can resolve the dependency from your eclipse workspace, it will
use the local class files
2. If not (lets say you close / delete the project) then it will use the
jar files from your maven repository
The RunJe
BTW tapestry-stitch has two modules (component library + webapp) and I
develop in eclipse using m2e + RunJettyRun.
As you can see, StitchModule is added to the manifest here:
https://github.com/uklance/tapestry-stitch/blob/master/pom.xml#L67
But also declared as a SubModule here for easy testing:
Take a look at the built in pages PageCatalog and ServiceStatus in the
tapestry sources which display a list of your app's pages and services.
Notice the @WhiteListOnly annotation which hides the pages from public
view.
You are trying to import stuff.js twice. Once via require.js and once via
@Import. I get the feeling it's the @Import that's failing.
On 2 Oct 2013 14:13, "Geoff Callender"
wrote:
> I'm desperately seeking an up-to-date example of custom javascript,
> because nothing I've tried works. Here's on
Tapestry does not provide a default coercion from String to Date. You can
contribute a CoercionTuple to the TypeCoercer service.
Docs here http://tapestry.apache.org/typecoercer-service.html
base, components, pages and mixins are special packages and anything in
these packages is transformed and loaded by a different classloader. These
packages are not suitable for utilities etc.
On second thought, you are better to contribute a ValueEncoder to the
ValueEncoderSource.
The loop / ValueEncoder are used to serialize the values that were used to
render the form. This is used to re-hydrate the initial form state when the
POST is received. If you are happy to re-lookup the values (or the values
are static) then it is fine to use formState="none". If you don't want to
Here's some discussion which has a couple of answers
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Encoding-a-template-as-a-valid-JSON-String-td5723504.html
It's probably overkill but depending on what you are doing, you might find
tapestry-offline useful
https://github.com/uklance/tapestry-offline
You can only get the rendered HTML after the point at which your block is
rendered to tapestry's MarkupWriter.
So, you only have an opportunity to get the HTML in a full page render
request or an AJAX event request which causes a partial page render
Getting the HTML in a non-ajax action (ie your
As Thiago said, can you specify the value somewhere (message catalogue,
database etc) and reference the same value in both the template and the
action?
Nice!
I noticed your blog has links to URL's on port 8080. Is this on purpose? My
proxy at work blocks these URL's.
> because if at that point I inspect the block instance (Eclipse debug) I
see the instance already contains that text.
I've never really looked into the inner workings of a block. The only thing
you should ever need to know about a block is that it can be coerced to a
RenderCommand. I'm sure it ho
Seems like it's caused by your jvm's security and accessing a private class.
This should work (less verbose too):
public static FullTextSession buildFullTextSession(
final HibernateSessionManager sessionManager,
PropertyShadowBuilder propertyShadowBuilder)
{
This would also work (and would only happen at most once per request:
@Scope(ScopeConstants.PERTHREAD)
public static FullTextSession buildFullTextSession(HibernateSessionManager
sessionManager) {
return Search.getFullTextSession(sessionManager.getSession());
}
http://lmgtfy.com/?q=tapestry+jpa&l=1
:)
And how is this related to tapestry?
Take a look at the built in ServiceStatus page. You can @Inject
ServiceActivityScoreboard and check ServiceActivity.getStatus()
I've never used it myself but I assume it'd be something like:
Java
-
public class MyDynamicPage {
@Inject
private DynamicTemplateParser parser;
@Property
private DynamicTemplate template;
public void onActivate(EventContext context) {
// TODO: implement this
Resour
The Scoreboard is a ServiceActivityTracker. I've never needed to do it
myself but I'm sure you can register your own custom tracker.
On 14 Oct 2013 13:17, "Martin Kersten" wrote:
> Sometimes it is very important. I for myself need this in some tests to
> recognize some specials in tear down and s
Perhaps the unit tests will help?
https://github.com/apache/tapestry-5/tree/master/tapestry-func/src/test/java/org/apache/tapestry5/func
Why not add the following to your database services:
@PostInjection
public void addShutdownListener(RegistryShutdownHub shutdownHub) {
shutdownHub.addRegistryShutdownListener(new Runnable() { … });
}
The shutdown listener will only fire if the service has been realized
(constructed)
As Barry has said, this might be easier to do inside a real request fired
by Hudson. If you want to go down the 'fake' request route then I'll give
my tapestry-offline project a plug
:)
https://github.com/uklance/tapestry-offline
Gelbana*
> http://www.linkedin.com/in/mgelbana
>
>
> On Mon, Oct 14, 2013 at 5:23 PM, Lance Java >wrote:
>
> > Why not add the following to your database services:
> >
> > @PostInjection
> > public void addShutdownListener(RegistryShutdownHub shutdownHub
I'm interested to see if it works. It's worth noting that your Resource
implementation should have a proper hashCode() and equals() to take
advantage of template caching.
Reloadable services are a development only feature that are aimed at
improving developer productivity by reducing down time.
As Thiago has said, casting to the concrete type is not good OO practice.
If you need to access methods on the concrete class it's probably a sign
that you need to add metho
If you really really really want to do this thing that we are both
suggesting is a bad idea, you can do one of the following in AppModule
public static MyServiceImpl buildMyServiceImpl(…) {
return new MyServiceImpl(…);
}
OR
public static void bind(ServiceBinder binder) {
binder.bind(MyServ
Here's a workaround
public interface LegacyService {
void method1();
}
public class LegacyServiceImpl implements LegacyService {
public void method1() { ... }
public void method2() { ... }
}
public interface ExtendedService {
void m
Are you using GAE? You might be hitting this:
http://code.google.com/p/googleappengine/issues/detail?id=8201
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/T5-and-AppEngine-1-7-3-dev-server-IllegalStateException-td5717683.html
Fix here:
https://bitbucket.org/akochnev/tap5-gae-u
I notice there's a whole lotta spring security stuff in your stack trace
before it gets to the TapestryFilter. Can you try removing spring security
from the mix to try to isolate the problem?
Can you post a stack trace?
Sorry, I missed your post where you'd isolated the problem to spring
security. I get the feeling that spring security is somehow introducing the
exact same bug as GAE.
Can you try adding the filter from the GAE fix to your module? I have a
hunch that it will fix this your issue too.
http://tinyur
It seems like a new 'secure' parameter has been added to select which
defaults to true (value must exist in the model).
Try setting secure="false"
I think this should be the default to maintain backwards compatibility.
Can you @Inject RequestGlobals and log
RequestGlobals.getHttpServletRequest().getClass()?
I'm thinking that one of the spring filters is wrapping the request in an
faulty implementation. I'm starting to point the finger at
RequestCacheAwareFilter.
Oops, I meant to print out the HttpServletResponse class.
Once you know the response class, you'll need to put in some breakpoints to
find out why isComitted() is not true. A response should be committed as
soon as it's outputstream / writer is first written to or it is redirected.
I think the secure parameter should default to a symbol. And the default
for the symbol should be false
Slightly off topic but this is where groovy excels.
List ldapProfiles =
ldapCache.findAllLDAPUsers(keyword)
List names = ldapProfiles*.name
It sounds like an interesting way to test. I'm guessing you can define your
template directly in your test case rather than needing a separate file. If
you were using groovy for testing this would be even nicer since you could
use multi-line strings (via """). Or maybe you've come up with some cool
Hey Martin, you're lucky because I have a fair idea of what you're up to
:). I think you want to write a custom binding so that your dynamic
template can reference values from a map. I'm thinking you'll contribute a
test: binding which can read and / or write to a map defined in your test
case. Try
Invariant() { return false; }
public void set(Object value) { map.put(key, value); }
public Object get() { return map.get(key); }
public T getAnnotation(Class
annotationClass) { return null; }
}
On 18 October 2013 08:49, Martin Kersten wrote:
> That's exactly what I w
Strange to hear you talk that way of the tapestry implementation. I
personally think it's some of the best code I've seen and I genuinely think
that familiarising myself with the tapestry source code has made me a
better developer. Everything is overridable and there are many seams where
you can in
Hi Jarda, I'm not familiar with tynamo security but I'm the author of
tapestry-cometd. I think your analysis of the problem is spot on.
Just because SecurityComponentRequestFilter is ordered before:* doesn't
mean your filter can't be ordered before it. Just find out the name/id of
the SecurityComp
tapestry-cometd has always used ParallelExecutor to render content so that
the current thread is not polluted with PerThreadValues. tapestry-offline
was only created to extract the offline rendering into a reusable module.
I suspect that Jarda has security on his push event and maybe Boris only
ha
Note that @Import can also be placed on render methods (eg setupRender)
instead of annotating at the class level. If used on a render method, the
import will only happen when the component is actually rendered. This might
be cleaner in this case.
Can't you just check the user has permissions before serving the file?
Throwing exception if they're not authorised.
BTW using local files is usually a bad idea (portability, scalability,
transactions etc). Have you considered storing in the db or a blobstore?
Martin, again you are saying @CommitAfter is broken when it's not. It's
your understanding of @CommitAfter that is broken :)
CommitAfter does exactly what is says on the tin, it commits the current
transaction after it executes the method.
I'm assuming a fork is broken too because it's no good for eating soup?
Sounds like you need a spoon, it's easy to write your own annotation...
Perhaps you want a @MaybeCommitAfter ;)
Just a stab in the dark here but are you using maven and using a version
number NOT suffixed with "-SNAPSHOT" if you are this will cause problems as
maven assumes that non snapshot versions (releases) are static.
You could add an implicit mixin to every textfield using a
ClassTransformWorker2. See Taha's blog post here
http://tawus.wordpress.com/2011/08/01/tapestry-mixins-classtransformations/
This sounds like an IE bug I encountered years ago. Are you using an old
version of IE (5 perhaps). From memory, IE sends two requests for the PDF
and then Acrobat sends one itself.
My solution at the time (I don't have access to the code) involved ignoring
two of the requests and only returning c
Igor's template skinning blog entry might help too:
http://blog.tapestry5.de/index.php/2011/06/24/template-skinning/
On Monday, 28 November 2011, Peter Stavrinides
wrote:
> Those are fantastic resources, thank you François!
>
>
>
> - Original Message -
> From: "François Facon"
> To: "Tap
1. You would want to use tapestry's URL rewriting support to remove
"whitelabelpartnerX" from the URL before passing it down the request
processing pipeline.
2. As your URLRewriterRule removes the whitelabelpartner from the url, it
should push it onto the Environment so that it can be accessed lat
Hi, I'd like to create a component which does the following
1. Displays an "address" text field and a "find" button and two hidden
fields for "latitude" and "longitude"
2. Clicking on the "find" button invokes the googlemaps geocoding API
clientside (
http://code.google.com/apis/maps/documentation/
There are a couple of approaches to do this, since tapestry does not
support ajax push (aka reverse ajax) out-of-the box, a simple solution
would be to have the client poll the server for the current percentage
complete.
In order to display a progress bar to the client, you must do the actual
work
else {
jsSupport.addScript("setTimeout(\"Tapestry.activateZone('%s', '%s');\",
%s);", zoneId, url, pollDelayMillis);
}
}
});
}
}
On 3 January 2012 10:34, Lance Java wrote:
> There are a couple of approaches to do this, since tapestry does not
> suppor
Correct me if I'm wrong but currently, if you want an eventlink to use
ajax, you must provide a "zone" parameter. This may have been fine in early
versions of tapestry 5 but there are now circumstances where we want an
eventlink to be done via XHR but shouldn't need to specify a zone in the
tml. Th
@Inject ComponentResources and call getInformalParameter(String name,
Class type)
Cheers,
Lance.
On Wednesday, 11 January 2012, ffred wrote:
> Hello,
> I'm trying to develop a mixin for t:label component in which i need to get
> the value of the 'for' attribute.
> I currently find no way of doin
Hmm... perhaps you have the Mixin's ComponentResources instead of the
label's ComponentResources.
How about
@Inject ComponentResources resources;
String for = resources.getContainerResources().getInformalParameter("for",
String.class);
On Wednesday, 11 January 201
apestry5.Field field;
Perhaps that weill help
On Wednesday, 11 January 2012, Lance Java wrote:
> Hmm... perhaps you have the Mixin's ComponentResources instead of the
label's ComponentResources.
>
> How about
>
> @Inject ComponentResources resources;
>
, Jan 5, 2012 at 5:35 PM, Igor Drobiazko
> wrote:
> Maybe we should reuse zone paramater by passing a special zone id like
> zone="*". There is already a special id ^, which means the first
>
> container
>
> zone.
>
> I like this idea.
> I''m using
This could be done via a mixin like this (untested)
public class DontSort {
@InjectComponent
private Grid grid;
@Parameter(required="true")
private String unsorted;
@SetupRender
void setupRender() {
BeanModel model = grid.getDataMod
For me, it's mainly about maintainability
Consider the following
public class ViewPersonPage {
@Property
@Persist
private int dobDay, dobMonth, dobYear;
...
}
public class EditPersonPage {
@Property
@Persist
private int dobDay, dobMonth, dobYear;
...
}
public interface P
Since you are generating plain text, not HTML, I would probably not use
tapestry templating to generate the text.
Depending on how simple your email is, you may find that using the message
catalog and a find-and-replace is easy enough.
Otherwise, I would use freemarker, a tempting engine with loc
One killer argument is SEO (search engine optimisation). Is your webapp
publicly available and do you want to appear high in google results?
Whilst google's algorithms are hidden, it is known that if searching for a
ferarri, a site like
www.mysite.com/cars/ferarri
will appear higher in the searc
. It saves much time, and time is money. Explain your
> managers every deployment costs 4 minutes, you need to do 15 a day.
>
> Cheers
>
>
> On Thu, Jan 26, 2012 at 11:44 AM, Lance Java
wrote:
>> One killer argument is SEO (search engine optimisation). Is your webapp
>>
If you use a layout component for all of your pages you could simply add
the to the layout
http://tapestry.apache.org/layout-component.html
-- Forwarded message --
From: Yohan Yudanara
Date: Friday, 3 February 2012
Subject: How to add component to all pages
To: Tapestry users
I'm prettty sure that @SupportsInformalParameters is just a marker so that
informal parameters are available serverside.
In order to write the informal parameters to the html you must @Inject
ComponentResources and call renderInformalParameters(MarkupWriter)
On Friday, 3 February 2012, Barry Book
I have done similar things in the past using a flat database structure to
build a nested structure.
public class Node {
private Integer nodeId; // stored in database
private String description; // stored in database
private Integer parentId; // stored in database
private List childNode
Since tapestry's tree is ajax enabled... you will need to modify the code
slightly (db structure can remain the same). Instead of getting the entire
tree, you will get a single node and it's first level children for each
ajax request.
On Tuesday, 7 February 2012, Lance Java wrote:
>
When I said "flat database" I was simply referring to the fact that I was
using a single table to represent nested data. I'm talking about a
relational database too.
> Anyhow, I'm using a single table with a parent node in each row. If
parent is null, it becomes the root, other wise it would beco
The query to get the tree from the db depends on how you are accessing it.
If you were to get the entire tree from the db in a single request then the
best approach is to do a single query for all the tree nodes and then join
them in java (see my earlier code example). The biggest no-no here would
1101 - 1200 of 1604 matches
Mail list logo