Issue with using tooltip and popovers, missing initialization script?
Hello, We are using tapestry5.4 beta-3 and was attempting to add bootstrap tooltip and popover scripts. When using just the attributes as described on http://getbootstrap.com/javascript/#popovers, it appeared that the attributes were not being recognized. We were able to get the tooltip popover to work by including the following scripts, which suggests that the initializer scripts are missing? Below sample is working: test.java: package org.company.demo; import org.apache.tapestry5.annotations.Import; @Import(module = {bootstrap/modal, bootstrap/popover, tooltip-popover}) public class Test { } test.tml: !DOCTYPE html html xmlns=http://www.w3.org/1999/xhtml; xmlns:t=http://tapestry.apache.org/schema/tapestry_5_3.xsd; xmlns:p=tapestry:parameter head meta http-equiv=content-type content=text/html; charset=utf-8/ /head body p id=tool class=muted style=margin-bottom: 0;Tight pants next level keffiyeh a href=# data-toggle=tooltip data-placement=right title=Default tooltipyou probably/a haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel a href=# data-toggle=tooltip title=Another tooltiphave a/a terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan a href=# data-toggle=tooltip title=Another one here toowhatever keytar/a, scenester farm-to-table banksy Austin a href=# data-toggle=tooltip title=The last tip!twitter handle/a freegan cred raw denim single-origin coffee viral./p div id=myDiv a id=pop href=# class=btn btn-lg btn-danger data-toggle=popover-hover data-title=Title goes here data-content=And here's some amazing content. It's very engaging. right? Hover to toggle popover/a a href=# data-toggle=tooltip title=Some tooltip text title!Hover over me/a button type=button id=pop class=btn btn-default data-container=body data-title=Title goes here data-toggle=popover-click data-placement=left data-content=Vivamus sagittis lacus vel augue laoreet rutrum faucibus. Popover on Click /button /div /body /html the above will work with the following file added tooltip-popover: define([jquery, bootstrap/tooltip, bootstrap/popover], function($) { init = function() { $('[data-toggle=tooltip]').tooltip({'placement': 'auto right'}); $('[data-toggle=popover-click]').popover({ trigger: 'click', 'placement': 'auto right' }); $('[data-toggle=popover-hover]').popover({ trigger: 'hover', 'placement': 'auto right' }); }; return init; }); Is there supposed to be an initializer added to existing code for the tootlip and popover libriaries? Thanks, Jim - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Custom field, fckEditor, rendering order
I'm having some trouble with the rendering of a custom field - I'm hoping someone can give me a steer on the order of interpretation / execution during rendering. When I use the T5EasyFCKEditor in a .tml as follows: textarea t:type=easyfck/fckeditor width=800px height=400px value=xyz configuration=customConf/ ... it works as expected and the textarea is decorated / enhanced. When I try to use the easyFCK in a custom field however, it renders as a standard textarea, albeit with the attribute t:type=easyfck/fckeditor. In the custom field beginRender method I have: boolean beginRender(MarkupWriter writer) { . . . } else if (useFCKEditor){ writer.element(textarea, t:type, easyfck/fckeditor, name, getControlName(), id, getClientId(), width, 800px, height, 400px, configuration, customConf); writer.write(value == null ? null : value.getText()); . . . } Any ideas on why the second approach doesn't work? Thanks, Jim. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Custom field, fckEditor, rendering order
Thanks Thiago - working now - simple when you know how! Regards, Jim. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Possible error in Tapestry.js
Thanks for the link Taha. Not sure if the fix for this is external, or if there should be some kind of try/catch in Tapestry JS that uses $(this.form) as a fallback. Regards, Jim. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Possible error in Tapestry.js
Can any of the Tapestry committers vet this before I add a JIRA - thanks. Regards, Jim. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Possible error in Tapestry.js
Thanks Richard – it doesn’t appear to be a million miles off – in my case the POST does get made also, but as you say, it’s not ideal. Any other suggestions for a fix / workaround welcome. The JS in tapestry.js looks pretty gritty. Regards, Jim. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Debugging variables
Can anyone in the know advise on the JREs that best suit Tap 5.2.4 for debugging? Im using jdk1.6.0_21_x64 and finding a lot of things I try to put watches on or inspect using Eclipse (3.4.1) resolve to null, and I have to log them to get the true value thanks. Regards, Jim. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Debugging variables
Thiago, Josh, Thanks for the replies. I’ll push through on 5.3-SNAPSHOT when I have time for maven shenanigans(!) Regards, Jim. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Possible error in Tapestry.js
I'm getting an error using IE8 upon form submission - the error appears to be Tapestry.js (from T5.2.4) line 1545 - Error: Object doesn't support this property or method if (this.form.getInputs(hidden, t:formdata).size() == 0) The only methods listed as available for this.form within the IE8 debugger are onsubmit() - anyone else seeing this issue? It seems fine under FF / Chrome. This appears to happen whether I start with: form t:id=uWEventForm name=uWEventForm Or t:form t:id=uWEventForm name=uWEventForm Regards, Jim. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Popup PDF
I have a requirement to generate a PDF based on some submitted form data in a 'detail' page, and then pop up the PDF in a new tab/window while at the same time returning from the 'detail' page to a 'summary' page. I don't want to pollute the summary page with any code related to opening the PDF in a new tab/window. The actual PDF is being generated and I can return that as a stream successfully but I'm trying to find out how to return the summary page in the existing tab/window, and also trigger the PDF opening in another tab/window, as effectively I'm trying to generate two server responses for one server request. Can anyone suggest a good way of going about this? Should I put something in the detail page that triggers an actionLink with target=_blank before redirecting to the summary page? Thanks. Regards, Jim. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Popup PDF
Thanks for the suggestion Richard. One thing I am having difficulty with (I couldn’t see this in your reply) is how to submit the form data required to generate the PDF to the server before launching the PDF using target=blank. Perhaps I am going about this in a wrong-headed way and need to rethink the requirement. I’d welcome any other suggestions if anyone has one. I suppose one approach could be to have a submit button that POSTs the form data, and then redisplay the same page with the submit button hidden and a new actionLink ‘View PDF’ now present but it seems a bit clunky. Regards, Jim. From: Richard Hill [mailto:r...@su3analytics.com] Sent: 08 April 2011 12:26 To: Tapestry users Subject: Re: Popup PDF The simplest way I'm guessing is to have your link that generates/returns the pdf to be a target=_blank as you say. Then in javascript change the window url from the detail url to the summary url. If adding your own js to an actionlink is tricky you could not use an action (or page) link, but do the whole thing in javascript - open a new window with the appropriate url for the pdf, and then load the summary page in the current window. Or maybe a mixin would work if you want to add your own js to an action or page link? Richard. On Fri, 2011-04-08 at 11:56 +0100, Jim O'Callaghan wrote: I have a requirement to generate a PDF based on some submitted form data in a 'detail' page, and then pop up the PDF in a new tab/window while at the same time returning from the 'detail' page to a 'summary' page. I don't want to pollute the summary page with any code related to opening the PDF in a new tab/window. The actual PDF is being generated and I can return that as a stream successfully but I'm trying to find out how to return the summary page in the existing tab/window, and also trigger the PDF opening in another tab/window, as effectively I'm trying to generate two server responses for one server request. Can anyone suggest a good way of going about this? Should I put something in the detail page that triggers an actionLink with target=_blank before redirecting to the summary page? Thanks. Regards, Jim. - 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 No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3558 - Release Date: 04/07/11 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Logon notification
Jonathan, Sample HTTPSessionListener and SessionMonitor classes below if you are using a clustered environment you would want to adjust this to leverage a db oriented solution youll probably find some holes in it but for my purposes it works as required. I use it to display a grid of SessionMonitors that auto refreshes every x seconds. It displays some useful user info and allows a kill of the users session. I call the updateLastSeen method each time a user hits a new page. You can get most of this information from the http log anyway, but you might find it a useful base to perform other operations with. package com.a.b.util.beans; import java.io.Serializable; import java.util.Date; /** * Utility class to store details about session creation * @author Jim * */ public class SessionMonitor implements Serializable, Comparable { /** * */ private static final long serialVersionUID = -7043353042185132418L; private Date createTime; private String sessionId; private String iPAddress; private String UserName; private String lastSeen; private boolean active; private transient String createTimeStr; // A convenience placeholder to replace with an actionlink in a grid to allow kill of a session private transient String killSession; public String getCreateTimeStr(){ return createTime.toString(); } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public String getSessionId() { return sessionId; } public void setSessionId(String sessionId) { this.sessionId = sessionId; } public String getIPAddress() { return iPAddress; } public void setIPAddress(String address) { iPAddress = address; } public SessionMonitor(Date createTime, String sessionId) { this.createTime = createTime; this.sessionId = sessionId; this.active = true; } public String getUserName() { return UserName; } public void setUserName(String userName) { UserName = userName; } public String getLastSeen() { return lastSeen; } public void setLastSeen(String lastSeen) { this.lastSeen = lastSeen; } public boolean isActive() { return active; } public void setActive(boolean active) { this.active = active; } public String getKillSession() { return killSession; } public void setKillSession(String killSession) { this.killSession = killSession; } public int compareTo(Object o) { return (this.createTime.compareTo(((SessionMonitor)o).createTime) 0) ? 0 : -1; } } package com.a.b.listeners; import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import org.apache.tapestry5.TapestryFilter; import org.apache.tapestry5.ioc.Registry; import org.apache.tapestry5.services.ApplicationGlobals; import org.apache.tapestry5.services.RequestGlobals; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.a.b.entities.core.SessionContext; import com.a.b.entities.core.user.UserAccessLog; import com.a.b.services.UserAccessLogEntityManager; import com.a.b.util.DateUtils; import com.a.b.util.beans.SessionMonitor; /** * jc1 - 2010.02.04 Used to count the number of sessions * * @author jc1 * */ public class MySessionListener implements HttpSessionListener { private static final String HASHMAP_NAME = sessionMap; // The number of days after which to purge old sessions from the session map public static final int PURGE_DAYS = 1; private final static Logger log = LoggerFactory.getLogger(MySessionListener.class
RE: Logon notification
Hi David, Is there something specific in the ApplicationListener approach you require? I use TSS and have a login page that in its onSuccess method sends a redirect like so: @Inject private HttpServletResponse response; . . . Object onSuccess() throws IOException { response.sendRedirect(request.getContextPath() + checkUrl + ?j_username= + login.getUserName() + j_password= + login.getPassword() + _spring_security_remember_me= + (login.isRememberMe() ? checked : )); and then in its onActivate method: void onActivate(String extra) { if (extra.equals(failed)) { failed = true; form.recordError(messages.get(login.invalidUsernameOrPassword)); } else { // do your thing . . . } I use a registered listener that implements HTTPSessionListener to update a hashtable of where a user has last been etc. for a kind of dashboard page, and some db calls to update a persisted logged on flag on a user table would this approach be of any use to you? Regards, Jim. From: David Uttley [mailto:dutt...@democracysystems.com] Sent: 30 March 2011 16:29 To: Tapestry users Subject: Re: Logon notification Hi Peter, If it was as easy as what you suggest I wouldn't have bothered with the mailing list, this is a last resort I don't use these mailing lists lightly only when I start banging my head against a wall, I had already done the registering of the ApplicationListener. As for lack of detail I am not really sure what to post that would be of help. I would also argue that it is a Tapestry question as I am using Tapestry Spring Security which is configured directly by T5. Spring is reporting events to the ApplicationListener its the events that occur in Tapestry Spring Security that are not appearing. If I use the first example then I get other events from the container but not from TSS. I have been in contact with the guy from TSS and he told me his Spring knowledge was limited and directed me to the Tapestry mailing board. From looking through the debugger it appears that TSS has no application listeners to notify when it wishes to send an event. However, Spring has an application listener as I am getting other events from it. Therefore, I am confused how the ApplicationListener is set on TSS, I wonder if I have to specifically add the ApplicationListener for Tapestry in the AppModule. It seems like the TSS is initialised before the Spring context files and annotations. It looks like TSS has little support and I probably should cut my losses now and remove it and just go for a pure Spring based implementation. Thanks David On 30 Mar 2011, at 16:00, p.stavrini...@albourne.com wrote: Hi David, Apart from the lack of details in your question, this is also hardly a Tapestry question. You should direct it to the Spring forums instead, but if this reply helps so be it: You will need in your applicationContext.xml to define a bean that will automatically start receiving events (I assume you know how)... I am not familiar with Spring security, but the API docs are quite clear: http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframe work/context/ApplicationListener.html So code that might have looked something like this in the past: public void onApplicationEvent(ApplicationEvent applicationEvent) { if (applicationEvent instanceof AuthenticationSuccessEvent) { AuthenticationSuccessEvent event = (AuthenticationSuccessEvent) applicationEvent; UserDetails userDetails = (UserDetails) event.getAuthentication().getPrincipal(); //notify here now, etc. } } 'In theory' (untested of course) can now be replaced by: public void onApplicationEvent(AuthenticationSuccessEvent successEvent) { UserDetails userDetails = (UserDetails) successEvent.getAuthentication().getPrincipal(); //notify here etc. } And thats all?! Cheers, Peter - Original Message - From: David Uttley dutt...@democracysystems.com To: Tapestry users users@tapestry.apache.org Sent: Wednesday, 30 March, 2011 16:50:26 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Logon notification So do I have any takers for this problem? Somebody must be recording logins somewhere, I don't have to use Spring to do it. --Original message I am trying to get spring security to notify me of a successful logon using the Spring ApplicationListener. However, the ApplicationListener doesn't seem to be notified of the events. Any help or pointers will be appreciated. I am using t5.2 Spring 3.0 and the 3.0.0-snapshot of t5 Spring Security. --- Thanks David - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
SPAM filter for mailing list
Is anyone else having issues with the spam filter in use for the list - I'm finding I have to send emails two or three times before they stop bouncing back, and usually I end up just alternating between html, rich text, and finally plain text before it gets through, without changing the content or source email address - is becoming very tedious. Regards, Jim.
Dateformat
Can anyone advise on whether there is a global format setting that can be applied for date fields throughout a tap application - I don't want to have to specify the format for every field - thanks. Regards, Jim.
RE: Dateformat
Please ignore - I changed this to use the tapx datepicker instead and found the problem wasn’t the locale setup – I have a locale switcher in place and when the locale is changes to ex. ‘es’ the date format is correct for both the standard date field / date picker return value. The locales I am specifying in AppModule are en,de,es – I guess en is interpreted as US English rather than UK. Regards, Jim. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: [OT] encoding of properties files
2nd try to get through spam filter... Perhaps the text editor you are using for editing your property files and templates is not character code aware, for instance old versions of Notepad. If you are using Eclipse for editing these files it may be set to auto-detect the character encoding, and if one of the previous developers is using a clashing editor / character encoding, the meta tag in your property files and templates will be directing the browser to decode the characters using a character set that is different to the one actually used to save the content. You can check if the browser rendered content is actually ISO-8859-1 by changing the Firefox setting to the required encoding (View → Character Encoding → Western (ISO-8859-1)) instead of Auto-detect, to see if the relevant characters come out ok, if not, then I would check the editor you are using to edit the files (including history of check-ins by other developers) and make sure it is setting the encoding correctly. Another area that may be relevant is if you have contributed a Servlet Filter, and in its service method you have used setCharacterEncoding(UTF-8) or some other invalid encoding. I use UTF-8 project-wide, ensure my editors are character code aware, and have no problem with special characters. I have previously encountered similar errors where non-developers were given access to files to maintain error messages / properties using older versions of Notepad. Regards, Jim. From: Ivano Luberti [mailto:lube...@archicoop.it] Sent: 04 March 2011 14:53 To: Tapestry users Subject: [OT] encoding of properties files Hello I have a question I believe is not strictly Tapestry related. I'm developing a web site using T 4.1.6 My dev environment is Eclipse 3.5 + Tomcat 5.5 on Windows Vista where everything works fine (I know I know...). Instead when I deploy the website on another machine, characters loaded from properties files that have accents are not showed correctly. I see question marks in place of the characters when I use Firefox and squares in IE 8. I have used ISO-8859-1 for properties files and for html templates: meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 Can someone point me in the correct direction to solve this problem? -- == 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 No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1204 / Virus Database: 1435/3480 - Release Date: 03/03/11 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: T.5.2.x Possible page pooling removal impact query
Thanks Josh. I think some of the fields I was concerned about ex. private final Pattern validatorPattern = Pattern.compile(VALIDATOR_PATTERN); would just be final, and not static - probably wasn't giving solid enough examples, but I have enough to go on now, and have identified a small number of areas I'm going to update. Worth highlighting anyway I think, as the kind of errors that can creep in a hard to pin down (at least for me!). Thanks. Regards, Jim. -Original Message- From: Josh Canfield [mailto:joshcanfi...@gmail.com] Sent: 22 January 2011 14:27 To: Tapestry users Subject: Re: T.5.2.x Possible page pooling removal impact query As far as I can remember, the removal of the page pool only affects *non*-static fields. Static variables wouldn't be affected only because they already needed to be thread safe. On Jan 21, 2011 6:48 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Anyone care to have a quick glance at the attachment for coding red flags they could highlight, or even just advise on whether it is a question of tracking down third party source to check if there are thread safety issues in any of their called methods? Thanks a million. As far as I can remember, the removal of the page pool only affects *non*-static fields. Anyway, as a general rule, you should never initialize a non-static field in its declaration (unless the value is immutable). Your code only has static fields, so using or not the page pool won't make any difference at all. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - 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: T.5.2.x Possible page pooling removal impact query
Thanks for the feedback Donny. The code excerpts are a few taken from various support classes (not page classes, though they are used throughout the app including within page classes) with static members / methods grouped under various contexts (date / number / string utils etc.) The logger is slf4j (with log4j). The Money / Scalar classes are wrappers for BigDecimal, to allow money / arithmetic ops with predictable precision. I found a few instances of Matcher that I think I will bundle into a service. Thanks for your help. Regards, Jim. -Original Message- From: Donny Nadolny [mailto:donny.nado...@gmail.com] Sent: 21 January 2011 22:23 To: Tapestry users Subject: Re: T.5.2.x Possible page pooling removal impact query I glanced over it, it looks okay. A few notes: You didn't give the package name for Logger, Money, or Scalar, so I can't comment on them, although Log4j's Logger is thread safe, and I would guess most loggers are. Pattern is thread safe, but note that Matcher is not. Yes, it is just a matter of looking through any objects that you initialize in the Page class, outside of a method. An alternative is to create any variables you need in setupRender() rather than when you declare them in the class, only moving them out if they cause poor performance (and checking that they're thread safe beforehand). My coding style normally is not to have many objects like that in the page class, instead having them in services. Attachment text for the archives: In the release notes for T.5.2.0 (http://tapestry.apache.org/release-notes-52.html#ReleaseNotes5.2-Tap5.2.0) there is a section on references to non thread-safe objects and the impact upon them of the removal of Page Pooling, using: private final DateFormat format = DateFormat.getDateInstance(DateFormat.MEDIUM, locale); ... as a problem example. I have a few examples below of some code I am using and am concerned about introducing subtle bugs that are difficult to track down. private final static Logger log = LoggerFactory.getLogger(VitasBasePage.class); public static final Money MAX_VALUE = new Money(.99); public static final Currency DEFAULT_CURRENCY = Currency.getInstance(EUR); public static final boolean USE_PRODUCTION_PORTS = !(false.equals(System.getProperty(PRODUCTION_PORTS_PARAM))); private static final int ROUNDING_MODE = BigDecimal.ROUND_HALF_EVEN; public static final Scalar HALF = new Scalar(0.5); static final String VALIDATOR_PATTERN=(?!)\\s*,\\s*(?!([0-9]*\\})); private final Pattern validatorPattern = Pattern.compile(VALIDATOR_PATTERN); public static final String DATE_FORMAT_NOW = -MM-dd HH:mm:ss; public static final int MILLISECS_PER_DAY = 8640; public static String now() { Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW); return sdf.format(cal.getTime()); } public static String now(String dateFormat) { Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); return sdf.format(cal.getTime()); } On Fri, Jan 21, 2011 at 5:07 PM, Jim O'Callaghan jc1000...@yahoo.co.ukwrote: The spam filter has blocked this email up to the 4th attempt so I've put most of it into the attached text file. The query relates to thread safety, specifically the example in the T.5.2.0 release notes (http://tapestry.apache.org/release-notes-52.html#ReleaseNotes5.2-Tap5.2.0 ) Anyone care to have a quick glance at the attachment for coding red flags they could highlight, or even just advise on whether it is a question of tracking down third party source to check if there are thread safety issues in any of their called methods? Thanks a million. Regards, Jim. - 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: T.5.2.x Possible page pooling removal impact query
Thanks for the feedback Thiago. Regards, Jim. -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: 22 January 2011 02:47 To: Tapestry users Subject: Re: T.5.2.x Possible page pooling removal impact query Anyone care to have a quick glance at the attachment for coding red flags they could highlight, or even just advise on whether it is a question of tracking down third party source to check if there are thread safety issues in any of their called methods? Thanks a million. As far as I can remember, the removal of the page pool only affects *non*-static fields. Anyway, as a general rule, you should never initialize a non-static field in its declaration (unless the value is immutable). Your code only has static fields, so using or not the page pool won't make any difference at all. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informa��o Ltda. http://www.arsmachina.com.br - 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
T.5.2.x Removal of page pooling impact
The spam filter keeps blocking this email (4th attempt) so it is mostly in the attached txt file.
T.5.2.x Possible page pooling removal impact query
The spam filter has blocked this email up to the 4th attempt so I've put most of it into the attached text file. The query relates to thread safety, specifically the example in the T.5.2.0 release notes (http://tapestry.apache.org/release-notes-52.html#ReleaseNotes5.2-Tap5.2.0) Anyone care to have a quick glance at the attachment for coding red flags they could highlight, or even just advise on whether it is a question of tracking down third party source to check if there are thread safety issues in any of their called methods? Thanks a million. Regards, Jim. In the release notes for T.5.2.0 (http://tapestry.apache.org/release-notes-52.html#ReleaseNotes5.2-Tap5.2.0) there is a section on references to non thread-safe objects and the impact upon them of the removal of Page Pooling, using: private final DateFormat format = DateFormat.getDateInstance(DateFormat.MEDIUM, locale); ... as a problem example. I have a few examples below of some code I am using and am concerned about introducing subtle bugs that are difficult to track down. private final static Logger log = LoggerFactory.getLogger(VitasBasePage.class); public static final Money MAX_VALUE = new Money(.99); public static final Currency DEFAULT_CURRENCY = Currency.getInstance(EUR); public static final boolean USE_PRODUCTION_PORTS = !(false.equals(System.getProperty(PRODUCTION_PORTS_PARAM))); private static final int ROUNDING_MODE = BigDecimal.ROUND_HALF_EVEN; public static final Scalar HALF = new Scalar(0.5); static final String VALIDATOR_PATTERN=(?!)\\s*,\\s*(?!([0-9]*\\})); private final Pattern validatorPattern = Pattern.compile(VALIDATOR_PATTERN); public static final String DATE_FORMAT_NOW = -MM-dd HH:mm:ss; public static final int MILLISECS_PER_DAY = 8640; public static String now() { Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW); return sdf.format(cal.getTime()); } public static String now(String dateFormat) { Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); return sdf.format(cal.getTime()); } - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Grid with Scroll synchronization + Customization
Also, if your grid is displaying many entities and those entities contains many eager-loaded relations, you are retrieving a lot of data that may not be necessary. Perhaps you should consider a view-only entity that is restricted to the actual displayed columns, and retrieve those entities with some manual SQL. Other options include setting the result set size (setMaxResults) and displaying an information message where the result set is larger than the limit to prompt the user to be more specific in their search criteria, or using a grid where the pages of results are loaded on demand, rather than the entire list loaded upon initial display. Regards, Jim. -Original Message- From: Matheus Eduardo Machado Moreira [mailto:matheus@gmail.com] Sent: 28 December 2010 10:50 To: Tapestry users Subject: Re: Grid with Scroll synchronization + Customization You could probably remove the TimingFilter that is present in your AppModule. This service is part of the app that is generated by the quickstart archetype and serve as an example of how to build and contribute services. Just comment out the methods buildTimingFilter() and contributeRequestHandler() (if the timing filter is the only contribution) and you have 2624 ms gain in you app. :-) Atenciosamente, Matheus Eduardo Machado Moreira matheus@gmail.com *Good cooking takes time. If you are made to wait, it is to serve you better, and to please you.* Menu do Restaurant Antoine, New Orleans 2010/12/28 Duruk_Kab durgesh.ka...@nuware.com Thanks Thiago for pointing out logger issue. It was really very helpful. Now, the application takes around 5-6 seconds instead of 12-13 seconds it was taking before. But still have to figure out why it is taking 5-6 seconds in Tapestry. The log says: [2010-12-28 03:53:51.247] server-tomcat-thread-13 System.out I ScrollableDataGrid - step 4 -:Tue Dec 28 03:53:51 EST 2010 [2010-12-28 03:53:51.257] server-tomcat-thread-13 System.out I ScrollableDataGrid - step 3 -:Tue Dec 28 03:53:51 EST 2010 [2010-12-28 03:53:51.257] server-tomcat-thread-13 System.out I ScrollableDataGrid - step 4 -:Tue Dec 28 03:53:51 EST 2010 [2010-12-28 03:53:51.377] server-tomcat-thread-13 .cfs.raa.web.services.AppModule.TimingFilter.unknown I Request time: 2624 ms [2010-12-28 03:53:57.436] server-tomcat-thread-14 .cfs.raa.web.services.AppModule.TimingFilter.unknown I Request time: 0 ms [2010-12-28 03:53:57.456] server-tomcat-thread-13 .cfs.raa.web.services.AppModule.TimingFilter.unknown I Request time: 0 ms [2010-12-28 03:54:02.894] server-tomcat-thread-13 .cfs.raa.web.services.AppModule.TimingFilter.unknown I Request time: 0 ms It says TimingFilter took 2624ms. Any idea??? I have below method in my AppModule which uses TiminigFilter: public void contributeRequestHandler(OrderedConfigurationRequestFilter configuration, @InjectService(TimingFilter) RequestFilter filter) { // Each contribution to an ordered configuration has a name, When necessary, you may // set constraints to precisely control the invocation order of the contributed filter // within the pipeline. configuration.add(Timing, filter); } Please help me to find out the root cause so that I can resolve this performance issue. @ DK -- View this message in context: http://tapestry-users.832.n2.nabble.com/Grid-with-Scroll-synchronization-Cus tomization-tp5863225p5871361.html Sent from the Tapestry Users mailing list archive at Nabble.com. - 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: Grid with Scroll synchronization + Customization
Can you wrap the grid in a div with fixed height / width and set its overflow css property to both? Specify a pager for both the top and bottom of the grid and use some custom css to make their positions absolute? I'm not sure there is a need to be altering the GridDataSource for this requirement unless I'm missing something. Regards, Jim. -Original Message- From: Duruk_Kab [mailto:durgesh.ka...@nuware.com] Sent: 24 December 2010 09:09 To: users@tapestry.apache.org Subject: Grid with Scroll synchronization + Customization Hi, I have below requirements for Tapestry grid, I am using Tapestry 5.1.0.5: - Reduce the grid size (Say to display in half of the page) with 50 records per page - I can handle showing records per page but to reduce the grid size, I could not get any example. - I have around 50 columns to display in the grid with different widht based on the source type (Date, String, Amount etc.) - I have to manage Vertical + Horizontal synchronization for the grid, like if i move to right side of the grid both columns as well as Content should scroll. - I have to manage pagination. - This shold be managed automatically, i guess. I have got the source of Tapestry GridDataSource, based on that I can handle pagination with number of records. Can you please guide me to handle all these requrements efficiently without compromizing on perfomance issues? That will be really helpful. I did have a look at JumpStart but it did not help me to fulfull all my requirements. (http://202.177.217.122:8080/jumpstart/) Thanks, DK -- View this message in context: http://tapestry-users.832.n2.nabble.com/Grid-with-Scroll-synchronization-Cus tomization-tp5863225p5863225.html Sent from the Tapestry Users mailing list archive at Nabble.com. - 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: Strange behaviour of jetty
There are also some previous posts related to file-locking under Jetty that may be relevant to this problem. There are config workarounds suggested in some previous posts if you search for file locking. Regards, Jim. -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: 22 December 2010 16:10 To: Tapestry users Subject: Re: Strange behaviour of jetty On Wed, 22 Dec 2010 13:59:44 -0200, Jens Reufsteck jens.reufst...@staufenbiel.de wrote: Hi, Hi! from time to time, I get the following exception: Unable to resolve 'Login' to a known page name. Available page names: ExceptionReport, PropertyDisplayBlocks, PropertyEditBlocks, ServiceStatus This looks like a failed context undeploy. With Tapestry's live class reloading, you can disable the Jetty's automatic context redeploy on class change. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informa��o Ltda. http://www.arsmachina.com.br - 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: Image file upload with Easy FCKEditor
Thanks for the response Ville. I'll try to get a test case / project up over the next few days. Out of interest, are you saying the php used within the core fckeditor to populate the dialog in Image Properties -- Browse Server is completely replaced by your tapestry integration layer? I've found my SimpleFckEditorUserRightServiceImpl (bound with FckEditorUserRightService) and SimpleFckEditorPathServiceImpl (bound with FckEditorPathService) copied from your examples are never realized, though they are bound in AppModule and I can step through the bind with a debugger. The various software versions in use are Tapestry - 5.2.1, fckEditor - 1.0.5, maven-jetty-plugin - 6.1.15 Regards, Jim. -Original Message- From: 9902468 [mailto:ville.virta...@greenstreet.fi] Sent: 12 December 2010 17:09 To: users@tapestry.apache.org Subject: RE: Image file upload with Easy FCKEditor Thi is really strange... Easy FCK Editor does not use or run php at all - it is java library. FCK Editor can be configured to use whatever backend. Easy FCK just delivers a bridge between Tapestry 5 and http://java.fckeditor.net/ There must be a configuration error if the editor asks php files. Please open a ticket to http://kenai.com/jira/browse/T5_EASY_FCKEDITOR and attach instructions how to reproduce this. (If possible attach a maven project that can be used to reproduce this.) - Ville -- View this message in context: http://tapestry.1045711.n5.nabble.com/Image-file-upload-with-Easy-FCKEditor- tp3277128p3302270.html Sent from the Tapestry - User mailing list archive at Nabble.com. - 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: Image file upload with Easy FCKEditor
Looking through this further it appears to be an issue with FCKEditor core code running php on Jetty. I know this is a Tap specific list but have any Tap 5 users got ex. QuercusServlet working using resin in their pom and including the quercus jar in their app? Would be grateful if you could share your settings - I can 't seem to get anything but the connector.php served as source from Jetty, rather than quercus compiling / interpreting it. Regards, Jim. -Original Message- From: Jim O'Callaghan [mailto:jc1000...@yahoo.co.uk] Sent: 10 December 2010 22:51 To: 'Tapestry users' Subject: RE: Image file upload with Easy FCKEditor Hi, did you ever get a workaround for this? From looking around I can see there are various fixes involving .htacess files / mods to php config but was hoping there was something obvious within Easy FCKEditor itself ... Regards, Jim. -Original Message- From: Alex W. Croton [mailto:acro...@linkfinancial.eu] Sent: 23 November 2010 17:03 To: users@tapestry.apache.org Subject: Image file upload with Easy FCKEditor Hi All, I cannot work out how to get images to upload using the Easy FCKEditor component in Tapestry. I have created a fresh project, just to test this, using Tapestry 5.2.4,Easy FCK Editor 1.0.5 and the server is Tomcat 6.0.26 [currently being run from Eclipse Helios]. To set this up, I have [almost] followed the instructions on http://t5-easy-fckeditor.kenai.com/Installing.html with the exception of setting the version number to 1.0.4 Following through the above site's very clear tutorials, in the section on 'Supporting File Uploads', as soon as I try and do anything like upload a file or browse the server, I get error messages (The server didn't reply with a proper XML data) or my browser asking me what to do with this PHP file that it's been given. I have never been treated to the error message that is illustrated on the page. Apologies if this has been answered before - on searching, I can find a few questions, but no answers that make any sense to me. Regards, Alex C - 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: Image file upload with Easy FCKEditor
Hi, did you ever get a workaround for this? From looking around I can see there are various fixes involving .htacess files / mods to php config but was hoping there was something obvious within Easy FCKEditor itself ... Regards, Jim. -Original Message- From: Alex W. Croton [mailto:acro...@linkfinancial.eu] Sent: 23 November 2010 17:03 To: users@tapestry.apache.org Subject: Image file upload with Easy FCKEditor Hi All, I cannot work out how to get images to upload using the Easy FCKEditor component in Tapestry. I have created a fresh project, just to test this, using Tapestry 5.2.4,Easy FCK Editor 1.0.5 and the server is Tomcat 6.0.26 [currently being run from Eclipse Helios]. To set this up, I have [almost] followed the instructions on http://t5-easy-fckeditor.kenai.com/Installing.html with the exception of setting the version number to 1.0.4 Following through the above site's very clear tutorials, in the section on 'Supporting File Uploads', as soon as I try and do anything like upload a file or browse the server, I get error messages (The server didn't reply with a proper XML data) or my browser asking me what to do with this PHP file that it's been given. I have never been treated to the error message that is illustrated on the page. Apologies if this has been answered before - on searching, I can find a few questions, but no answers that make any sense to me. Regards, Alex C - 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: Memory creep
Thanks for the suggestions guys. Josh was right in that what I was seeing was not a problem, just what I thought was a problem. I reduced my heap from about 1.5GB down to 512MB and saw GC happening as expected and no OOMEs with a moderate consistent load on the app. I think I got the idea that it needed a lot of headroom from the dev environment, where production mode was disabled, and live class reloading uses up a lot of space (I think), otherwise the process was crashing with heap issues. Thiago, your suggestion of using VisualVM was very helpful - a very good tool. It looks like Tapestry (at least 5.2.1) is very good at releasing resources - my heap size vs. used heap is consistently bouncing between predictable levels even after running tests 24 hours over a few days. Very happy with the result. Summary, the creep was me misinterpreting the heap growing because I gave it so much headroom it never really needed to GC. Regards, Jim. -Original Message- From: Ivano Luberti [mailto:lube...@archicoop.it] Sent: 03 November 2010 13:11 To: users@tapestry.apache.org Subject: Re: Memory creep and make sure you trap the exception that can be thrown Il 03/11/2010 14.02, p.stavrini...@albourne.com ha scritto: can you give me some detail on how to go about that? Just invoke System.gc(); regards, Peter - Original Message - From: Thiago H. de Paula Figueiredo thiag...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Friday, 29 October, 2010 20:55:03 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: Memory creep On Fri, 29 Oct 2010 15:30:23 -0200, Josh Canfield joshcanfi...@gmail.com wrote: but your suggestion of forcing garbage collection - can you give me some detail on how to go about that? http://download.oracle.com/javase/6/docs/technotes/guides/management/jconsole.html VisualVM (https://visualvm.dev.java.net/) has a very nice GUI for it. -- == 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 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Memory creep
Thanks for the info Howard. It's working out very well so far - very happy with 5.2.1. Regards, Jim. -Original Message- From: Howard Lewis Ship [mailto:hls...@gmail.com] Sent: 03 November 2010 16:40 To: Tapestry users Subject: Re: Memory creep FYI: Using either jconsole of VisualVM you can force a GC remotely. In general, Tapestry is very good about memory management (though it likes to use a lot of it). There are a few user coding errors that can trap objects that should be reclaimed, but you have to work a bit hard to hit those. The biggest memory issue is the heavy use of PermGen space, especially under development. Java is very reticent about GC'ing PermGen, even when you request a GC explicitly. On Wed, Nov 3, 2010 at 6:29 AM, Jim O'Callaghan jc1000...@yahoo.co.ukwrote: Thanks for the suggestions guys. Josh was right in that what I was seeing was not a problem, just what I thought was a problem. I reduced my heap from about 1.5GB down to 512MB and saw GC happening as expected and no OOMEs with a moderate consistent load on the app. I think I got the idea that it needed a lot of headroom from the dev environment, where production mode was disabled, and live class reloading uses up a lot of space (I think), otherwise the process was crashing with heap issues. Thiago, your suggestion of using VisualVM was very helpful - a very good tool. It looks like Tapestry (at least 5.2.1) is very good at releasing resources - my heap size vs. used heap is consistently bouncing between predictable levels even after running tests 24 hours over a few days. Very happy with the result. Summary, the creep was me misinterpreting the heap growing because I gave it so much headroom it never really needed to GC. Regards, Jim. -Original Message- From: Ivano Luberti [mailto:lube...@archicoop.it] Sent: 03 November 2010 13:11 To: users@tapestry.apache.org Subject: Re: Memory creep and make sure you trap the exception that can be thrown Il 03/11/2010 14.02, p.stavrini...@albourne.com ha scritto: can you give me some detail on how to go about that? Just invoke System.gc(); regards, Peter - Original Message - From: Thiago H. de Paula Figueiredo thiag...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Friday, 29 October, 2010 20:55:03 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: Memory creep On Fri, 29 Oct 2010 15:30:23 -0200, Josh Canfield joshcanfi...@gmail.com wrote: but your suggestion of forcing garbage collection - can you give me some detail on how to go about that? http://download.oracle.com/javase/6/docs/technotes/guides/management/jconsol e.html VisualVM (https://visualvm.dev.java.net/) has a very nice GUI for it. -- == 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Memory creep
I'm testing a Tapestry app running under Jetty on Windows using multiple Selenium IDE sessions and have noticed a creep of about 130MB RAM per hour on my java exe when running through a test loop that logs in to the app, runs through some expected user behaviour (some search screens, detail screens, minor amounts of data entry / persistence) and then logs out. Each test loop iteration takes about 40 seconds. Upon log out, the http session is destroyed and I am running six concurrent sessions at the moment. The test script does not vary the entities retrieved from the database so beyond the initial entity caching I would not expect the memory usage to keep increasing, i.e. it should bottom out at some stage. I've found this with T.5.2.0 and also T.5.2.1, and the current JVM I'm using is from jdk1.6.0_21_x64 on Jetty 6.1.18. I'm working my way through different JVMs at the moment to see if there is much of a difference. Given that the entities loaded are the same during the test loops, the HTTP session is destroyed during each loop cycle, and the memory footprint appears to stay at the same level after the tests are stopped, could anyone give any pointers to Tapestry areas to look at to try to identify the cause of the memory creep? Or perhaps this is a JVM / Jetty issue? Having trawled through the list before on related GC issues, I'm using the following JVM settings: -server -Xms1408m -Xmx1536m -XX:MaxPermSize=256m -XX:NewSize=384m -XX:SurvivorRatio=2 With such a noticeable creep (initially approx 650MB with 6 sessions rising to 780MB after 1 hour) reproducible on a dev machine I'm concerned that this app won't make it out of dev unless I can get to the bottom of the problem. Regards, Jim.
RE: Memory creep
Thanks for the suggestions Josh - I'm just starting to work through the app with the Eclipse Memory Profiler to see if I can spot what's going on. I think I'm would be getting OOM if I left the tests running for long enough but your suggestion of forcing garbage collection - can you give me some detail on how to go about that? I thought the JVM just took the GC related settings at startup and managed things on its own from then on in? Regards, Jim. -Original Message- From: Josh Canfield [mailto:joshcanfi...@gmail.com] Sent: 29 October 2010 17:00 To: Tapestry users Subject: Re: Memory creep Can you run it with a profiler? Something like Yourkit will tell you what is being used. Also, have you forced garbage collection? It doesn't sound like you're getting OOM so maybe you've got garbage laying around? On 29 Oct 2010 08:36, Jim Oapos;Callaghan j...@peritussolutions.com wrote: I'm testing a Tapestry app running under Jetty on Windows using multiple Selenium IDE sessions and have noticed a creep of about 130MB RAM per hour on my java exe when running through a test loop that logs in to the app, runs through some expected user behaviour (some search screens, detail screens, minor amounts of data entry / persistence) and then logs out. Each test loop iteration takes about 40 seconds. Upon log out, the http session is destroyed and I am running six concurrent sessions at the moment. The test script does not vary the entities retrieved from the database so beyond the initial entity caching I would not expect the memory usage to keep increasing, i.e. it should bottom out at some stage. I've found this with T.5.2.0 and also T.5.2.1, and the current JVM I'm using is from jdk1.6.0_21_x64 on Jetty 6.1.18. I'm working my way through different JVMs at the moment to see if there is much of a difference. Given that the entities loaded are the same during the test loops, the HTTP session is destroyed during each loop cycle, and the memory footprint appears to stay at the same level after the tests are stopped, could anyone give any pointers to Tapestry areas to look at to try to identify the cause of the memory creep? Or perhaps this is a JVM / Jetty issue? Having trawled through the list before on related GC issues, I'm using the following JVM settings: -server -Xms1408m -Xmx1536m -XX:MaxPermSize=256m -XX:NewSize=384m -XX:SurvivorRatio=2 With such a noticeable creep (initially approx 650MB with 6 sessions rising to 780MB after 1 hour) reproducible on a dev machine I'm concerned that this app won't make it out of dev unless I can get to the bottom of the problem. Regards, Jim. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Objects session persistance and validation
I'm not sure if this is relevant to your current problem, but to tell Tapestry which constructor to use for the bean editor, you should annotate the default (no args) constructor with @Inject - this will allow the BEF to create the relevant entity if none if present. Hope this helps. Regards, Jim. -Original Message- From: Anton Mezerny [mailto:anton.meze...@gmail.com] Sent: 23 October 2010 17:02 To: Tapestry users Subject: Objects session persistance and validation Hi all, I'm trying to write simple registration form using beaneditor component. If I fullfill all reqired fields in the form and submit it - everything works fine, but if server validation occurs (for example passwords don't match), then all data is lost and Registration page renders with validation errors, but without user data (input values). I think the reason for this behaviour is the initializeNewUser() method, wich rewrites all data if user field is null. But if I delete this method from code, tapestry throws exception - User can't be instantiated (tapestry tries to use constructor with most parameters, which has custom objects, not only String, Integer, etc). So how can resolve this problem? Thanks in advance. My code (some code is token from Tapestry5 Hotel Booking example): -Registration.java:- --- public class Registration { @Property @Persist(PersistenceConstants.FLASH) private User user; @OnEvent(value = EventConstants.PREPARE, component = registerForm) private void initializeNewUser() { if (this.user == null) { this.user = new User(); this.user.setCustomer(new Customer()); } else { if (this.user.getCustomer() == null) { this.user.setCustomer(new Customer()); } } } @Property private String verifyPassword; @Inject private UserService userService; @Component private Form registerForm; @Inject private Messages messages; public Object onSubmitFromRegisterForm() { if (!verifyPassword.equals(user.getPassword())) { registerForm.recordError(messages.get(error.verify.password)); return null; } if (userService.getUserByLogin(user.getLogin()) != null) { registerForm.recordError(messages.get(error.user.already.exists)); return null; } userService.save(user); return Index.class; } } --Registration.tml html t:type=layout title=Customer registration t:sidebarTitle=Current Time t:pageTitle=Register xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd; xmlns:p=tapestry:parameter fieldset id=register form class=full-form t:id=registerForm t:errors/ fieldset legendCustomer registration(company or private person)/legend t:beaneditor object=user.customer exclude=literal:id,users p:businessName t:label for=businessName/ t:textfield t:id=businessName value=user.customer.businessName validate=required/ /p:businessName p:contactPhone t:label for=customer_contactPhone/ t:textfield t:id=customer_contactPhone value=user.customer.contactPhone validate=required/ /p:contactPhone p:contactPerson t:label for=contactPerson/ t:textfield t:id=contactPerson value=user.customer.contactPerson validate=required/ /p:contactPerson p:businessAddress t:label for=businessAddress/ t:textfield t:id=businessAddress value=user.customer.businessAddress validate=required/ /p:businessAddress p:email t:label for=customer_email/ t:textfield t:id=customer_email value=user.customer.email validate=required,email/ /p:email /t:beaneditor /fieldset fieldset legendPersonal registration/legend t:beaneditor object=user exclude=literal:id,roles add=verifyPassword p:firstName t:label for=firstName/ t:textfield t:id=firstName value=user.firstName validate=required/ /p:firstName p:middleName t:label for=middleName/ t:textfield t:id=middleName value=user.middleName validate=required/ /p:middleName p:lastName t:label for=lastName/ t:textfield t:id
RE: T5 Customize Returned List.
I'm surprised Tapestry didn't complain when you have an annotation @Property on the item and also a matching explicit getter. In the .tml I think you should use distinct naming for the source and value arguments as the behavior might not be what you expect otherwise (T5 is case insensitive in this area?). Why don't you try: .java @Property private TableSource source; @Property private ListTableSource sources; **no explicit get methods** .tml t:loop source=Sources value=source {source.attribute} /t:loop ...where attribute is a property with a public getter on the TableSource class. Regards, Jim. -Original Message- From: ael [mailto:alan-lua...@dash.com.ph] Sent: 19 October 2010 10:02 To: users@tapestry.apache.org Subject: Re: T5 Customize Returned List. Hello Hmm it is returned as a ListTableClass. @Property private TableSource source; public ListTableClass getSource(){ return ListTableClass; } t:loop source=Source value=source {$source.value} /t:loop That is my problem... -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-Customize-Returned-List-tp3218486p3 218709.html Sent from the Tapestry - User mailing list archive at Nabble.com. - 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: write raw attributes
Is something like: t:OutputRaw value=entity.property/ ... of any use? Do you mean in .tml? Regards, Jim. -Original Message- From: Arming, Sebastian [mailto:sebastian.arm...@oeaw.ac.at] Sent: 19 October 2010 16:12 To: us...@tapestry Subject: write raw attributes Hi, is there a convenient way to output unescaped attributes - i.e. other than writer.writeRaw('e a=quot;/')? Specifically I need entities in a href. Thanks in Advance, Sebastian Arming - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: [T5] Complexity for simple things, where is the documentation?
For your specific use case, displaying the server time on the page, would you not be better off to initialize a value to the current server time upon initial page display, and then use a JS widget to increment/refresh the time field on the client side? This would save a lot of unnecessary network traffic, unless there is a compelling reason to have absolute synchronization between what is displayed and the actual time on the server. The variance would be sub one second with this approach, and you would not require zone updating etc. Regards, Jim. -Original Message- From: iberck [mailto:ibe...@gmail.com] Sent: 16 October 2010 22:30 To: users@tapestry.apache.org Subject: Re: [T5] Complexity for simple things, where is the documentation? Thank you very much for your time and your responses In this example, what happend if I want to learn mixins for create my own, where is the official documentation? Must I necessarily download and understand the source code of Autocompletemixin for learn? I think not all users are used to download the source code of the frameworks for learning -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-Complexity-for-simple-things-where- is-the-documentation-tp3214893p3215542.html Sent from the Tapestry - User mailing list archive at Nabble.com. - 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: Component to format null values
I think you can use the format: t:formatnull value=${contract?.manager?.address?.city?.name} / ... where if any of the hierarchy is null is will stop trying to evaluate methods / properties on subordinates, avoiding your NPE. Regards, Jim. -Original Message- From: Dmitriy Vsekhvalnov [mailto:dvsekhval...@gmail.com] Sent: 14 October 2010 09:01 To: users@tapestry.apache.org Subject: Component to format null values Hello all, i'm looking to some approach to render property value or some default string if value is null. Something like: t:formatnull value=contract.name / I have no problem to implement such component,but i want this to work with property chains as well: t:formatnull value=contract.manager.address.city.name / where i want default string to be rendered, if any of intermediate values evaluated to null. Now i'm getting NPE. Is there are any service in tapestry which i can use for property expressions evaluation or any other ideas? Thanks. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Component to format null values
You're welcome Dmitriy. One thing I should have said was that my example ${...} forced coercion to a String, which may / may not be required in your case. Regards, Jim. -Original Message- From: Dmitriy Vsekhvalnov [mailto:dvsekhval...@gmail.com] Sent: 14 October 2010 11:27 To: Tapestry users Subject: Re: Component to format null values you opened my eyes. Thanks. On Thu, Oct 14, 2010 at 12:21 PM, Jim O'Callaghan jc1000...@yahoo.co.ukwrote: I think you can use the format: t:formatnull value=${contract?.manager?.address?.city?.name} / ... where if any of the hierarchy is null is will stop trying to evaluate methods / properties on subordinates, avoiding your NPE. Regards, Jim. -Original Message- From: Dmitriy Vsekhvalnov [mailto:dvsekhval...@gmail.com] Sent: 14 October 2010 09:01 To: users@tapestry.apache.org Subject: Component to format null values Hello all, i'm looking to some approach to render property value or some default string if value is null. Something like: t:formatnull value=contract.name / I have no problem to implement such component,but i want this to work with property chains as well: t:formatnull value=contract.manager.address.city.name / where i want default string to be rendered, if any of intermediate values evaluated to null. Now i'm getting NPE. Is there are any service in tapestry which i can use for property expressions evaluation or any other ideas? Thanks. - 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: [T5.2] Constructor issue
I thought you should annotate the constructor you want the BEF to use with: @Inject ... to let Tap know which constructor to use. Regards, Jim. -Original Message- From: Michal Gruca [mailto:michalgr...@gmail.com] Sent: 05 October 2010 14:09 To: users@tapestry.apache.org Subject: [T5.2] Constructor issue Hi all. While preparing small showcase app, odd problem came out. When I created domain object with two constructors (first was default NOOP, second one had two parameters string and enum, it was meant for manual initialization only) and tried to use it with beaneditform I received exception that tapestry cannot handle my object creation. After removing parametrized constructor, error disappeared. It's bit odd IMHO. Tapestry should be capable to instantiate objects that have more than one constructor. Also @SessionState behaved weirdly. I was annotating java.util.Date. Error came up if I haven't instantiate object manually. Date has default constructor so Tapestry should be fine with constructing new Date on it's own. Maybe there are some reasons for that kind of behavior, but as I see it those are bugs. Should I create jira ticket for that? Tested on tapestry 5.2.1-snapshot. Link to application sources: https://bitbucket.org/mgruca/tjug_tapestry_30.09.10/downloads (last revision or two were stripped out from additional constructors. Content may be in Polish, but code should be all in En) -- View this message in context: http://tapestry-users.832.n2.nabble.com/T5-2-Constructor-issue-tp5603058p560 3058.html Sent from the Tapestry Users mailing list archive at Nabble.com. - 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: Creating Grid component at runtime
Can you use a helper class that contains getters for all the possible fields you require, and them dynamically build a comman delimited include (or exclude) string, that you pass to your grid using include/exclude via a page property? Regards, Jim. -Original Message- From: kamath_svk [mailto:kamath...@yahoo.co.in] Sent: 26 September 2010 15:40 To: users@tapestry.apache.org Subject: Re: Creating Grid component at runtime As advised in the previous reply, i can create a class which contains all the column display only those column names which are present in the query. But i think that will be waste of memory since, I have 50 column names from col1,col2,.. col50. Consider the situation where only one column is select by query, the object created will use the storage for all 50 columns where as only 1 is actually useful. so i wanted to know, if i can use beanmodel to add the columns dynamically at runtime. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Creating-Grid-component-at-runtime-tp2 847820p2854386.html Sent from the Tapestry - User mailing list archive at Nabble.com. - 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: Creating Grid component at runtime
Re-reading your email Kamath I can see you have already been advised on this approach. Perhaps if the non-primitive properties used for the display class were only initialised to a value by their setters the memory issue would be not relevant, and you would already have the names of the properties for the include/exclude parameter of the grid by taking them from the query. Regards, Jim. -Original Message- From: Jim O'Callaghan [mailto:jc1000...@yahoo.co.uk] Sent: 26 September 2010 15:55 To: 'Tapestry users' Subject: RE: Creating Grid component at runtime Can you use a helper class that contains getters for all the possible fields you require, and them dynamically build a comman delimited include (or exclude) string, that you pass to your grid using include/exclude via a page property? Regards, Jim. -Original Message- From: kamath_svk [mailto:kamath...@yahoo.co.in] Sent: 26 September 2010 15:40 To: users@tapestry.apache.org Subject: Re: Creating Grid component at runtime As advised in the previous reply, i can create a class which contains all the column display only those column names which are present in the query. But i think that will be waste of memory since, I have 50 column names from col1,col2,.. col50. Consider the situation where only one column is select by query, the object created will use the storage for all 50 columns where as only 1 is actually useful. so i wanted to know, if i can use beanmodel to add the columns dynamically at runtime. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Creating-Grid-component-at-runtime-tp2 847820p2854386.html Sent from the Tapestry - User mailing list archive at Nabble.com. - 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: PropertyEditContext not available from Environment
Thanks Thiago. Can you clarify one last thing for me. I had a look at the sources you mentioned and am wondering if I have to create a PropertyEditContext from scratch before pushing it to the environment, or is there somewhere (factory / util class) I can source it from? It seems like a good bit of code to have to duplicate per custom component? Regards, Jim. -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: 23 September 2010 01:44 To: Tapestry users Subject: Re: PropertyEditContext not available from Environment On Wed, 22 Sep 2010 19:48:08 -0300, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: Thanks for the reply Thiago. Could you give me a pointer on where / how in the cycle to push and then pop the PropertyEditContext into / out of the Environment, or point to any resource I could work through as an example? A bit lost on this. The documentation for the Environment is here: http://tapestry.apache.org/tapestry5.1/guide/env.html. I suggest you to take a look at the BeanEditor and Grid sources. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informa��o Ltda. http://www.arsmachina.com.br - 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: PropertyEditContext not available from Environment
Thanks Thiago. I'll file a JIRA after I come up with a workaround. I would have thought this was a common enough use case, an editable custom field in a grid. It'll probably jump out at me when I get more familiar with the core code. Regards, Jim. -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: 23 September 2010 13:03 To: Tapestry users Subject: Re: PropertyEditContext not available from Environment On Thu, 23 Sep 2010 07:22:43 -0300, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: Thanks Thiago. Can you clarify one last thing for me. I had a look at the sources you mentioned and am wondering if I have to create a PropertyEditContext from scratch before pushing it to the environment, or is there somewhere (factory / util class) I can source it from? As far as I know, no. I haven't tried to do anything like you're doing, tough. It seems like a good bit of code to have to duplicate per custom component? Few components needs that. You can file a JIRA for this enhancement. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informa��o Ltda. http://www.arsmachina.com.br - 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: PropertyEditContext not available from Environment
Thiago, Are you saying the I can use t:grid ... overrides=prop:xyz to get around the problem? Do I just build a list of PropertyOverrides in the page class for that, and does it override all other overrides that the grid normally provides by itself - I'm guessing this behavior is not what I want as I just want to affect rendering for this specific field, t:myCustomComponent value=bom.property/? I had started creating my own PropertyEditContext in the component used for my custom type just in the scenario where it's used in a grid, but was running into issues with an internal null pointer when I got to validate.render() in my component's beginRender method. What I was trying to do was something along the lines of: boolean pECForGridRequired = (environment.peek(PropertyEditContext.class) == null); PropertyEditContext pECForGrid = null; if (pECForGridRequired){ pECForGrid = createPECForGrid(); environment.push(PropertyEditContext.class, pECForGrid); } ... and mimicking the way the PEC is created when the component is used in a beanEditForm. Is this approach wrong-headed? Regards, Jim. -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: 23 September 2010 14:11 To: Tapestry users Subject: Re: PropertyEditContext not available from Environment On Thu, 23 Sep 2010 09:25:14 -0300, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: Thanks Thiago. I'll file a JIRA after I come up with a workaround. I would have thought this was a common enough use case, an editable custom field in a grid. I was talking about creating a component that does that, not using this functionality. :) By the way, I just remembered about the overrides parameter in Grid. You'll probably don't need to create another component, just make sure the overrides provide the edition block instead of the viewing one. Maybe we could even add a PropertyOverrides implementation that implements that to Tapestry . . . -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informa��o Ltda. http://www.arsmachina.com.br - 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: PropertyEditContext not available from Environment
Thanks for all your help Thiago. I'm not trying to render all fields in the grid as form fields, just the one from my custom component X that's a property of bom Y, and a selection of other properties of bom Y that are plain Strings, Integers etc., which the grid handles perfectly just using t:param and input fields. I have what I need working by creating a PropertyEditContext in the beginRender method of the custom component whenever it is being rendered as part of a grid, pushing it to the environment, and popping it in the afterRender method. Hopefully this doesn't set off any alarm bells. I like the idea of being able to use the overrides to achieve something similar, though it does put the onus on the developer to make the override available as a property in every page where a relevant grid occurs I think. I'll have a look into it when I'm not so stretched for time. Thanks again. Regards, Jim. -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: 23 September 2010 17:27 To: Tapestry users Subject: Re: PropertyEditContext not available from Environment On Thu, 23 Sep 2010 12:50:47 -0300, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: Thiago, Hi! Are you saying the I can use t:grid ... overrides=prop:xyz to get around the problem? Yes. Do I just build a list of PropertyOverrides in the page class for that, and does it override all other overrides that the grid normally provides by itself Yes. You don't need a list of PropertyOverrides, just one. Grid (more specifically, GridCell) asks to the override if it provides a block for rendering the property (overrides.getOverrideBlock(blockId). If it returns null, it uses the BeanBlockSource service to get one. - I'm guessing this behavior is not what I want as I just want to affect rendering for this specific field, t:myCustomComponent value=bom.property/? Use a p:xxxCell or t:parameter name=xxxCell tag. I thought you were trying to render all grid cells as form fields. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informa��o Ltda. http://www.arsmachina.com.br - 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
PropertyEditContext not available from Environment
I have a custom data type that I am displaying / updating successfully in beanDisplays and beanEditForms, after making BeanBlockContributions for edit and display, and also using a CustomPropertyEditor that defers environment.pop(PropertyEditContext.class) until after rendering is complete. Recently I started using grids with parameters specified, to allow editable fields for simple updates on multiple pojos. When I try to use my custom data type in a grid, I am running into the error: No object of type org.apache.tapestry5.services.PropertyEditContext is available from the Environment . in BeginRender. This doesn't happen if I just use the display only version of the custom data type in the grid. Can anyone suggest some directions I could look in to work around this? Bit of a showstopper at the moment unfortunately. I'm using T.5.2.0. Regards, Jim.
RE: PropertyEditContext not available from Environment
Thanks for the reply Thiago. Could you give me a pointer on where / how in the cycle to push and then pop the PropertyEditContext into / out of the Environment, or point to any resource I could work through as an example? A bit lost on this. Regards, Jim. -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: 22 September 2010 23:44 To: Tapestry users Subject: Re: PropertyEditContext not available from Environment On Wed, 22 Sep 2010 19:20:30 -0300, Jim O'Callaghan j...@peritussolutions.com wrote: No object of type org.apache.tapestry5.services.PropertyEditContext is available from the Environment When you're using BeanEditor/BeanEditForm, they push the appopriate PropertyEditContext into the Environment. Grid pushes a PropertyOutputContext. You'll need to push a PropertyEditContext yourself. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informa��o Ltda. http://www.arsmachina.com.br - 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
@Translate annotation
I'm have a NumberFormatBinding service as outlined on this list previously ,to mask numeric fields for display with a format mask ex. t:textField t:id=amount value=amount translate=numberFormat:#,##0.00 / I noticed in T5.2.0 there is an @Translate annotation - rather than using specifying the translator repeatedly in various tml files, is there some way I can name the translator on a bean property, and also pass in the mask to be used? The @Translate annotation appears to just take a 'value' parameter that is the name of the translator. Thanks, Jim.
Enum mask
Tapestry provides a very handy facility for presenting enums as drop down lists for display - is there anything built-in that allows certain values for the enum to be hidden from the generated drop down list? Ex. where a status transition follows a strict order where A can be progressed to B and then to C, but B cannot got back to A, so in the case where an entity is already at status B, I only want to display B and C as options for selection. Similarly if A needs to go to B before C, when an entity has status A, I only want to display A, B rather than A, B, C. Regards, Jim.
RE: Enum mask
Thanks Howard. Is there an easier way, just using a mixin that takes another parameter (ex. a comma separated list of include / exclude list index entries) from the template and in the mixin beginRender etc. performs an op on the model created from the Enum? I was hoping to not have to duplicate the creation of the model from the enum, camel casing it etc. that the existing SelectModel does. I'm working with 5.2 - perhaps there are some new features I can take advantage of. Regards, Jim. -Original Message- From: Howard Lewis Ship [mailto:hls...@gmail.com] Sent: 13 September 2010 17:43 To: Tapestry users Subject: Re: Enum mask No, in that case, you'd want to create your own SelectModel and populate it. You may inject and use the SelectModelFactory service to help with this. On Mon, Sep 13, 2010 at 9:15 AM, Jim O'Callaghan j...@peritussolutions.com wrote: Tapestry provides a very handy facility for presenting enums as drop down lists for display - is there anything built-in that allows certain values for the enum to be hidden from the generated drop down list? Ex. where a status transition follows a strict order where A can be progressed to B and then to C, but B cannot got back to A, so in the case where an entity is already at status B, I only want to display B and C as options for selection. Similarly if A needs to go to B before C, when an entity has status A, I only want to display A, B rather than A, B, C. Regards, Jim. -- 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 - 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: [T5.2] Classloader problem with a service
Andy, I haven't tried this but apparently: public static void bind(ServiceBinder binder) { binder.bind(MyInterface.class, MyImplementation.class).preventReloading(); } ... should work - referenced here: http://tapestry.markmail.org/message/honjlvrqljdjparp?q=service+reload+disab le Regards, Jim. -Original Message- From: Blower, Andy [mailto:andy.blo...@proquest.co.uk] Sent: 10 September 2010 13:00 To: 'Tapestry users' Subject: [T5.2] Classloader problem with a service Unfortunately we've got another T5.2 migration issue that I can't figure out. I wonder if this is to do with the service class reloading added in 5.2 - is there a way of disabling it to check? I've posted the error trace below, basically a service (ScholarUniverseSearchEngine) is trying to create a class (ScholarUniverseResultsList) and failing because there seems to be 2 different versions of the service in different classloaders. It's really puzzling because this service and class is copied from another that does the exact same thing and still works okay. I tried running it by deploying a war to a standalone tomcat, and it's fine. It just seems to be a problem when running from within Eclipse using runjettyrun. We'll try some more combinations out, but if anyone can help with this it would be great. ERROR [11:53:15,737] btpool0-6 (services.TapestryModule.RequestExceptionHandler:62) - Processing of request failed with uncaught exception: loader constraint violation: when resolving method com.proquest.apps.corelib.search.impl.scholaruniverse.ScholarUniverseResult sList.init(Lcom/proquest/apps/corelib/search/QueryData;Ljava/lang/String;L java/lang/String;Lcom/proquest/apps/corelib/search/impl/scholaruniverse/Scho larUniverseSearchEngine;Lcom/proquest/apps/corelib/config/ProductConfig;)V the class loader (instance of org/apache/tapestry5/ioc/internal/AbstractReloadableObjectCreator$ReloadingC lassLoader) of the current class, com/proquest/apps/corelib/search/impl/scholaruniverse/ScholarUniverseSearchE ngine, and the class loader (instance of runjettyrun/ProjectClassLoader) for resolved class, com/proquest/apps/corelib/search/impl/scholaruniverse/ScholarUniverseResults List, have different Class objects for the type com/proquest/apps/corelib/search/impl/scholaruniverse/ScholarUniverseSearchE ngine used in the signature java.lang.LinkageError: loader constraint violation: when resolving method com.proquest.apps.corelib.search.impl.scholaruniverse.ScholarUniverseResult sList.init(Lcom/proquest/apps/corelib/search/QueryData;Ljava/lang/String;L java/lang/String;Lcom/proquest/apps/corelib/search/impl/scholaruniverse/Scho larUniverseSearchEngine;Lcom/proquest/apps/corelib/config/ProductConfig;)V the class loader (instance of org/apache/tapestry5/ioc/internal/AbstractReloadableObjectCreator$ReloadingC lassLoader) of the current class, com/proquest/apps/corelib/search/impl/scholaruniverse/ScholarUniverseSearchE ngine, and the class loader (instance of runjettyrun/ProjectClassLoader) for resolved class, com/proquest/apps/corelib/search/impl/scholaruniverse/ScholarUniverseResults List, have different Class objects for the type com/proquest/apps/corelib/search/impl/scholaruniverse/ScholarUniverseSearchE ngine used in the signature at com.proquest.apps.corelib.search.impl.scholaruniverse.ScholarUniverseSearchE ngine.executeSearch(ScholarUniverseSearchEngine.java:146) at $SearchEngine_12afb45d215.executeSearch($SearchEngine_12afb45d215.java) at Invocation$SearchEngine$executeSearch$12afb462907.invokeDelegateMethod(Invoc ation$SearchEngine$executeSearch$12afb462907.java) at org.apache.tapestry5.ioc.internal.services.AbstractInvocation.proceed(Abstra ctInvocation.java:124) at com.proquest.apps.onesearch.stats.ProfileAdvice.advise(ProfileAdvice.java:33 ) at org.apache.tapestry5.ioc.internal.services.AbstractInvocation.proceed(Abstra ctInvocation.java:128) at $SearchEngine_12afb45d216.executeSearch($SearchEngine_12afb45d216.java) at $SearchEngine_12afb45cd44.executeSearch($SearchEngine_12afb45cd44.java) at com.proquest.apps.onesearch.components.scholaruniverse.ScholarUniverseBasic. handleSearchFormSubmission(ScholarUniverseBasic.java:132) at com.proquest.apps.onesearch.components.scholaruniverse.ScholarUniverseBasic$ MethodAccess_handleSearchFormSubmission_12afb45cd45.invoke(ScholarUniverseBa sic$MethodAccess_handleSearchFormSubmission_12afb45cd45.java) at org.apache.tapestry5.internal.transform.BaseEventHandlerMethodInvoker.invoke EventHandlerMethod(BaseEventHandlerMethodInvoker.java:52) at org.apache.tapestry5.internal.transform.OnEventWorker$4.invokeEventHandlers( OnEventWorker.java:157) at org.apache.tapestry5.internal.transform.OnEventWorker$4.advise(OnEventWorker .java:136) at org.apache.tapestry5
RE: Invoke Web Service from T5
Nevermind this query - I got something sufficient working using JS and XMLHttpRequest/Microsoft.XMLHTTP/Msxml2.XMLHTTP - no WS client needed. Regards, Jim. -Original Message- From: Jim O'Callaghan [mailto:j...@peritussolutions.com] Sent: 04 September 2010 22:15 To: 'Tapestry users' Subject: Invoke Web Service from T5 Has anyone an example of the following they could share? I have a need to take some xml (a WS message) from a textarea submitted from within a Tapestry page, forward the xml to an external public webservice, the url of which is known, take the response from the webservice invocation and return it within the tapestry page (possibly within new browser window/tab using javascript). The goal is for a convenient demo situation, to avoid using another desktop app to send the xml to the webservice - at the moment I'm jumping through hoops generating WS clients etc. but I think this is probably unnecessary as I can obviously invoke the service and get the anticipated response using SOAPUI etc. - any pointers very much appreciated. Regards, Jim. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Invoke Web Service from T5
Has anyone an example of the following they could share? I have a need to take some xml (a WS message) from a textarea submitted from within a Tapestry page, forward the xml to an external public webservice, the url of which is known, take the response from the webservice invocation and return it within the tapestry page (possibly within new browser window/tab using javascript). The goal is for a convenient demo situation, to avoid using another desktop app to send the xml to the webservice - at the moment I'm jumping through hoops generating WS clients etc. but I think this is probably unnecessary as I can obviously invoke the service and get the anticipated response using SOAPUI etc. - any pointers very much appreciated. Regards, Jim.
RE: [T5.2] No object of type ClientBehaviorSupport is available from the Environment
I'm afraid that's a little above my pay grade in terms of T5 knowledge Andy - hopefully some of the committers here can chip in with some help. Regards, Jim. -Original Message- From: Blower, Andy [mailto:andy.blo...@proquest.co.uk] Sent: 03 September 2010 15:14 To: 'Tapestry users' Subject: RE: [T5.2] No object of type ClientBehaviorSupport is available from the Environment I was already on that Jim, good suggestion though - and it works (or breaks I suppose) so I've been able to debug this issue a little. ClientBehavourSupport is pushed into the env and used 110-ish times before it's popped by line 2041 of TapestryModule which is the clientBehaviorSupport MarkupRendererFilter at the end of rendering the page markup. The error is then thrown by a heartbeat MarkupRendererFilter which peekRequired() for ClientBehavourSupport and fails. Is this a problem with the ordering of the MarkupRendererFilter's do you think? 5.1.0.5: configuration.add(DocumentLinker, documentLinker, before:RenderSupport); configuration.add(RenderSupport, renderSupport); configuration.add(InjectDefaultStyleheet, injectDefaultStylesheet, after:RenderSupport); configuration.add(ClientBehaviorSupport, clientBehaviorSupport, after:RenderSupport); configuration.add(Heartbeat, heartbeat, after:RenderSupport); configuration.add(DefaultValidationDecorator, defaultValidationDecorator, after:Heartbeat); 5.2.0: configuration.add(DocumentLinker, documentLinker); configuration.add(JavaScriptSupport, javaScriptSupport, after:DocumentLinker); configuration.add(RenderSupport, renderSupport, after:JavaScriptSupport); configuration.add(InjectDefaultStyleheet, injectDefaultStylesheet, after:RenderSupport); configuration.add(ClientBehaviorSupport, clientBehaviorSupport, after:JavaScriptSupport); configuration.add(Heartbeat, heartbeat, after:RenderSupport); configuration.add(DefaultValidationDecorator, defaultValidationDecorator, after:Heartbeat); Why did this change? What should I change it to so this works? Thanks, Andy -Original Message- From: Jim O'Callaghan [mailto:jc1000...@yahoo.co.uk] Sent: 02 September 2010 15:58 To: 'Tapestry users' Subject: RE: [T5.2] No object of type ClientBehaviorSupport is available from the Environment Can't reproduce Andy and not a solution I'm afraid, but can you try to run the app through your non-Eclipse environment with debug mode set on the JVM and remote debug it using Eclipse on a socket / shared mem? Perhaps this would give you some more info. Regards, Jim. -Original Message- From: Blower, Andy [mailto:andy.blo...@proquest.co.uk] Sent: 02 September 2010 15:28 To: 'Tapestry users' Subject: RE: [T5.2] No object of type ClientBehaviorSupport is available from the Environment Sorry for no update - was on a short holiday over the (UK) bank holiday weekend. Anyway, I thought this had just 'gone-away' yesterday but it hasn't. It happens unless I run it using Eclipse to debug the app, now that really is strange! That's right, a bug that doesn't appear when debugging. Kinda cripples my ability to debug this issue. I'm running it using Jetty 6.1.6 kicked off using run-jetty-run in Eclipse. Are you (or anyone else on the list for that matter) able to reproduce this problem? It only seems to happen with one of our pages -Original Message- From: Howard Lewis Ship [mailto:hls...@gmail.com] Sent: 27 August 2010 21:24 To: Tapestry users Subject: Re: [T5.2] No object of type ClientBehaviorSupport is available from the Environment Wow, that does seem odd, since all the other environmentals, set up before the render, seem to be available. On Wed, Aug 25, 2010 at 8:29 AM, Blower, Andy andy.blo...@proquest.co.uk wrote: Can anyone make sense of this one: ERROR [16:22:34,848] btpool0-1 (services.TapestryModule.RequestExceptionHandler:62) - Processing of request failed with uncaught exception: No object of type org.apache.tapestry5.services.ClientBehaviorSupport is available from the Environment. Available types are org.apache.tapestry5.RenderSupport, org.apache.tapestry5.internal.services.DocumentLinker, org.apache.tapestry5.services.javascript.JavaScriptSupport. java.lang.RuntimeException: No object of type org.apache.tapestry5.services.ClientBehaviorSupport is available from the Environment. Available types are org.apache.tapestry5.RenderSupport, org.apache.tapestry5.internal.services.DocumentLinker, org.apache.tapestry5.services.javascript.JavaScriptSupport. at org.apache.tapestry5.internal.services.EnvironmentImpl.peekRequired(Env ironmentImpl.java:79) at $Environment_12aa9d2d5fd.peekRequired($Environment_12aa9d2d5fd.java) at $Environment_12aa9d2d3d5.peekRequired($Environment_12aa9d2d3d5.java
RE: Submitting XML via a T5 form
Alex, You're quite right Tap is working as required and posting / redisplaying the xml intact - the problem was another exception buried deep in the app that being caught in error rather than thrown - thanks. Regards, Jim. -Original Message- From: Alex Kotchnev [mailto:akoch...@gmail.com] Sent: 01 September 2010 13:35 To: Tapestry users Subject: Re: Submitting XML via a T5 form The redisplay correctly part should be handled by the default output encoding in T5 - thus, if the XML that is submitted in a form field and it's bound to a String property in your page or model, if you display/redisplay the form, it should render properly. I don't think you need anything special w/ CDATA in your case. Regards, Alex K On Wed, Sep 1, 2010 at 8:28 AM, Jim O'Callaghan jc1000...@yahoo.co.ukwrote: Can anyone advise on the best approach to submitting XML via a T5 form? I have a requirement to allow the user to submit XML via a form field - this XML is then persisted in the database. What approach to CDATA etc. can I use to ensure the form is posted / redisplayed correctly? Is there any built-in support in T5 (5.2.0) for this scenario? Thanks. Regards, Jim. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
General debugging query
I'm using Eclipse 3.4.1 and debugging with a variety of JVMs from late 1.4s to 1.6+ -I'm finding that the mouseover popups or watch variables frequently evaluate variables as null in, say, some page method, but then if I follow the debugger through to the service / DAO layer I can get a correct value for the variable in a popup / watch - this is ex. a parameter that may be assigned in a page method and then passed to the service layer, and so has not been reassigned between the page and the service method. This is becoming a real PITA - I wasted about 2 hours yesterday scratching my head about why some entity wasn't being set in a page by a BEF as the debugger displayed it as null, when in fact the real problem was down to a database issue, and BEF was setting the value as expected. Does this debugging issue ring a bell with anyone? Any workarounds? Is it down to using T5 annotations on methods and them being instrumented? Regards, Jim.
RE: [T5.2] No object of type ClientBehaviorSupport is available from the Environment
Can't reproduce Andy and not a solution I'm afraid, but can you try to run the app through your non-Eclipse environment with debug mode set on the JVM and remote debug it using Eclipse on a socket / shared mem? Perhaps this would give you some more info. Regards, Jim. -Original Message- From: Blower, Andy [mailto:andy.blo...@proquest.co.uk] Sent: 02 September 2010 15:28 To: 'Tapestry users' Subject: RE: [T5.2] No object of type ClientBehaviorSupport is available from the Environment Sorry for no update - was on a short holiday over the (UK) bank holiday weekend. Anyway, I thought this had just 'gone-away' yesterday but it hasn't. It happens unless I run it using Eclipse to debug the app, now that really is strange! That's right, a bug that doesn't appear when debugging. Kinda cripples my ability to debug this issue. I'm running it using Jetty 6.1.6 kicked off using run-jetty-run in Eclipse. Are you (or anyone else on the list for that matter) able to reproduce this problem? It only seems to happen with one of our pages -Original Message- From: Howard Lewis Ship [mailto:hls...@gmail.com] Sent: 27 August 2010 21:24 To: Tapestry users Subject: Re: [T5.2] No object of type ClientBehaviorSupport is available from the Environment Wow, that does seem odd, since all the other environmentals, set up before the render, seem to be available. On Wed, Aug 25, 2010 at 8:29 AM, Blower, Andy andy.blo...@proquest.co.uk wrote: Can anyone make sense of this one: ERROR [16:22:34,848] btpool0-1 (services.TapestryModule.RequestExceptionHandler:62) - Processing of request failed with uncaught exception: No object of type org.apache.tapestry5.services.ClientBehaviorSupport is available from the Environment. Available types are org.apache.tapestry5.RenderSupport, org.apache.tapestry5.internal.services.DocumentLinker, org.apache.tapestry5.services.javascript.JavaScriptSupport. java.lang.RuntimeException: No object of type org.apache.tapestry5.services.ClientBehaviorSupport is available from the Environment. Available types are org.apache.tapestry5.RenderSupport, org.apache.tapestry5.internal.services.DocumentLinker, org.apache.tapestry5.services.javascript.JavaScriptSupport. at org.apache.tapestry5.internal.services.EnvironmentImpl.peekRequired(Env ironmentImpl.java:79) at $Environment_12aa9d2d5fd.peekRequired($Environment_12aa9d2d5fd.java) at $Environment_12aa9d2d3d5.peekRequired($Environment_12aa9d2d3d5.java) at org.apache.tapestry5.internal.transform.EnvironmentalWorker$Environment alConduit.get(EnvironmentalWorker.java:57) at org.apache.tapestry5.corelib.components.Form._$get_clientBehaviorSuppor t(Form.java) at org.apache.tapestry5.corelib.components.Form._$advised$linkFormToZone(F orm.java:422) at org.apache.tapestry5.corelib.components.Form$linkFormToZone$invocation_ 12aa9d2e99d.invokeAdvisedMethod(Form$linkFormToZone$invocation_12aa9d2e 99d.java) at org.apache.tapestry5.internal.services.AbstractComponentMethodInvocatio n.proceed(AbstractComponentMethodInvocation.java:77) at org.apache.tapestry5.internal.transform.HeartbeatDeferredWorker$1$1.run (HeartbeatDeferredWorker.java:39) at org.apache.tapestry5.internal.services.HeartbeatImpl.end(HeartbeatImpl. java:49) at org.apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryMo dule.java:2061) at $MarkupRenderer_12aa9d2d600.renderMarkup($MarkupRenderer_12aa9d2d600.ja va) at org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryMo dule.java:2008) at $MarkupRenderer_12aa9d2d600.renderMarkup($MarkupRenderer_12aa9d2d600.ja va) at org.apache.tapestry5.services.TapestryModule$24.renderMarkup(TapestryMo dule.java:1990) at $MarkupRenderer_12aa9d2d600.renderMarkup($MarkupRenderer_12aa9d2d600.ja va) at org.apache.tapestry5.services.TapestryModule$23.renderMarkup(TapestryMo dule.java:1971) at $MarkupRenderer_12aa9d2d600.renderMarkup($MarkupRenderer_12aa9d2d600.ja va) at $MarkupRenderer_12aa9d2d5fc.renderMarkup($MarkupRenderer_12aa9d2d5fc.ja va) at org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPag eMarkup(PageMarkupRendererImpl.java:64) at $PageMarkupRenderer_12aa9d2d5f9.renderPageMarkup($PageMarkupRenderer_12 aa9d2d5f9.java) at org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderP ageResponse(PageResponseRendererImpl.java:69) at $PageResponseRenderer_12aa9d2d5f8.renderPageResponse($PageResponseRende rer_12aa9d2d5f8.java) at $PageResponseRenderer_12aa9d2d454.renderPageResponse($PageResponseRende rer_12aa9d2d454.java
RE: General debugging query
Thanks Thiago. This may be the cause of it - will have to keep an eye on whether this just happens to annotated fields or not. Regards, Jim. -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: 02 September 2010 16:29 To: Tapestry users Subject: Re: General debugging query On Thu, 02 Sep 2010 11:53:53 -0300, Jim O'Callaghan j...@peritussolutions.com wrote: Does this debugging issue ring a bell with anyone? Any workarounds? Is it down to using T5 annotations on methods and them being instrumented? Access to annotated fields in Tapestry 5 are silently replaced by method calls. In Tapestry 5.2+, the fields don't even exist, as they're removed from the transformed classes completely. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informa��o Ltda. http://www.arsmachina.com.br - 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
Submitting XML via a T5 form
Can anyone advise on the best approach to submitting XML via a T5 form? I have a requirement to allow the user to submit XML via a form field - this XML is then persisted in the database. What approach to CDATA etc. can I use to ensure the form is posted / redisplayed correctly? Is there any built-in support in T5 (5.2.0) for this scenario? Thanks. Regards, Jim.
RE: OT: Web Services
Martin, Thanks for all the details. I hadn't considered the client generation at this stage, and was planning on just relying on the published wsdl for business consumers to use whatever package they wanted to generate a client from the public wsdl - perhaps this is not a realistic expectation. None the less thanks for the pom excludes / targets. They should prove useful if I go down that route. I'm leaning toward CXF at the moment as I think it won't be a huge step from XFire Regards, Jim. -Original Message- From: Martin Strand [mailto:do.not.eat.yellow.s...@gmail.com] Sent: 29 August 2010 19:07 To: Tapestry users Subject: Re: OT: Web Services On Sun, 29 Aug 2010 19:35:11 +0200, Jim O'Callaghan j...@peritussolutions.com wrote: I'm aware this is off topic, but since there are so many people on the list with a broad skill set am hoping I can learn from their experiences / heartbreak. I am evaluating various WS stacks for interfacing with a system - currently I am using XFire as it requires very little configuration and performs quite efficiently. XFire appears to qualify every xml element with a namespace, bloating the payload considerably, or, if using the patch from http://jira.codehaus.org/browse/XFIRE-687 appears to have unreliable / inconsistent namespace qualifiers. Can anyone recommend a good WS stack they have positive experience of? My constraints are quite liberal - java 1.5 up, currently jetty as an AS, spring 3.0.2.RELEASE. Is CXF any good? I want to find something with good performance obviously, minimal config, and hopefully something that consistently defines package level namespaces at an envelope level and reuses them. Many thanks, Jim. I've been using axis2 for several years to generate clients for a few 3rd party web services (I presume you're talking about client code) Can't really say I would *recommend* it because it was a pain to get it working with Maven and I haven't even bothered to go through that again with 1.4.x or 1.5.x so I'm still using 1.3. But, it's very simple once you set up the build - Maven will generate POJOs in target/generated-sources/... and when you invoke methods on those POJOs everything just works. The axis2 1.3 POMs are a mess though so there are lots of excludes here to get rid of unnecessary dependencies: plugin groupIdorg.apache.axis2/groupId artifactIdaxis2-wsdl2code-maven-plugin/artifactId executions execution idsome-service/id goals goalwsdl2code/goal /goals configuration wsdlFile${basedir}/src/main/wsdl/some-service.wsdl/wsdlFile packageNamecom.example.service/packageName namespaceToPackagescom.example.service=com.example.service/namespaceToPackages syncModesync/syncMode /configuration /execution execution idsome-other-service/id goals goalwsdl2code/goal /goals configuration wsdlFile${basedir}/src/main/wsdl/some-other-service.wsdl/wsdlFile packageNamecom.example.other/packageName namespaceToPackagescom.example.other=com.example.other/namespaceToPackages syncModesync/syncMode /configuration /execution /executions /plugin ... dependency groupIdorg.apache.axis2/groupId artifactIdaxis2-kernel/artifactId version1.3/version exclusions exclusion groupIdavalon-framework/groupId artifactIdavalon-framework/artifactId /exclusion exclusion groupIdbackport-util-concurrent/groupId artifactIdbackport-util-concurrent/artifactId /exclusion exclusion groupIdjavax.mail/groupId artifactIdmail/artifactId /exclusion exclusion groupIdjavax.activation/groupId artifactIdactivation/artifactId /exclusion exclusion groupIdjavax.servlet/groupId artifactIdservlet-api/artifactId /exclusion exclusion groupIdcommons-fileupload/groupId artifactIdcommons-fileupload/artifactId /exclusion exclusion
RE: OT: Web Services
Kalle, Daniel, Thanks for the responses. Good to know that there are positive experiences with CXF. It's probably the front-runner for me at the moment, but will keep an ear open for any other feedback. Looking at my original query I can see that it looks like I am focusing on generating WS clients - I should have said providing interfaces for a system rather than interfacing with a system. Regards, Jim. -Original Message- From: Kalle Korhonen [mailto:kalle.o.korho...@gmail.com] Sent: 30 August 2010 03:43 To: Tapestry users Subject: Re: OT: Web Services Second that. CXF is the successor to XFire and its solid. Kalle On Sun, Aug 29, 2010 at 3:56 PM, Daniel Honig daniel.ho...@gmail.com wrote: I know of many projects using CXF without complaints. I'd say that CXF is probably a good way to go. On Sun, Aug 29, 2010 at 1:35 PM, Jim O'Callaghan j...@peritussolutions.comwrote: I'm aware this is off topic, but since there are so many people on the list with a broad skill set am hoping I can learn from their experiences / heartbreak. I am evaluating various WS stacks for interfacing with a system - currently I am using XFire as it requires very little configuration and performs quite efficiently. XFire appears to qualify every xml element with a namespace, bloating the payload considerably, or, if using the patch from http://jira.codehaus.org/browse/XFIRE-687 appears to have unreliable / inconsistent namespace qualifiers. Can anyone recommend a good WS stack they have positive experience of? My constraints are quite liberal - java 1.5 up, currently jetty as an AS, spring 3.0.2.RELEASE. Is CXF any good? I want to find something with good performance obviously, minimal config, and hopefully something that consistently defines package level namespaces at an envelope level and reuses them. Many thanks, Jim. - 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: OT: Web Services
Thanks Davor - am leaning towards CXF. Regards, Jim. -Original Message- From: Davor Hrg [mailto:hrgda...@gmail.com] Sent: 30 August 2010 08:47 To: Tapestry users Subject: Re: OT: Web Services I used CXF to generate java code from XSD-s, CXF is easily used with maven, but in the end most newer WS engines use JAXB for data binding. JAXB is not perfect, and it took me a whole week to make rules for jaxb to get desired output. To be fair, he problem was not jaxb here but a very bad XSD, so I had to try all JAXB tricks and plugins to get it done well. .. bla .. bla .. what I mean is: CXF is just fine. I've only used old axis before and it was a pain... On Mon, Aug 30, 2010 at 4:43 AM, Kalle Korhonen kalle.o.korho...@gmail.comwrote: Second that. CXF is the successor to XFire and its solid. Kalle On Sun, Aug 29, 2010 at 3:56 PM, Daniel Honig daniel.ho...@gmail.com wrote: I know of many projects using CXF without complaints. I'd say that CXF is probably a good way to go. On Sun, Aug 29, 2010 at 1:35 PM, Jim O'Callaghan j...@peritussolutions.comwrote: I'm aware this is off topic, but since there are so many people on the list with a broad skill set am hoping I can learn from their experiences / heartbreak. I am evaluating various WS stacks for interfacing with a system - currently I am using XFire as it requires very little configuration and performs quite efficiently. XFire appears to qualify every xml element with a namespace, bloating the payload considerably, or, if using the patch from http://jira.codehaus.org/browse/XFIRE-687 appears to have unreliable / inconsistent namespace qualifiers. Can anyone recommend a good WS stack they have positive experience of? My constraints are quite liberal - java 1.5 up, currently jetty as an AS, spring 3.0.2.RELEASE. Is CXF any good? I want to find something with good performance obviously, minimal config, and hopefully something that consistently defines package level namespaces at an envelope level and reuses them. Many thanks, Jim. - 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: OT: Web Services
This is stellar stuff guys - you're saving me a lot of headaches. Thanks. Regards, Jim. -Original Message- From: Peter Stavrinides [mailto:p.stavrini...@albourne.com] Sent: 30 August 2010 14:36 To: Tapestry users Subject: Re: OT: Web Services ... sorry to leach on this thread, but perhaps a short blog on integrating Metro or CXF with Tapestry would be useful. cheers, Peter - Original Message - From: Kristian Marinkovic kristian.marinko...@porsche.co.at To: Tapestry users users@tapestry.apache.org Sent: Monday, 30 August, 2010 16:22:40 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: OT: Web Services hi, i use a (JaxWS)HttpServletRequestFilter service to intercept WS calls to my application. it will only intercept calls that have the url pattern of the provided WS that can be configured. and i'm using metro too. we switched from cxf to metro because it was easier to work with jaxb-binding overrides... g, kris Von:Peter Stavrinides p.stavrini...@albourne.com An: Tapestry users users@tapestry.apache.org Datum: 30.08.2010 14:59 Betreff:Re: OT: Web Services Hi Jim I evaluated quite a few Java WS stacks and was between CXF and Metro, but in the end I chose metro, but to be honest there was very little to choose btw the two... so I would suggest those two as the leading Java WS stacks. Both support maven and are very complete in terms of how much of the web service set of standards they support. Metro implements JAXWS 2.1 and JAXB2.2, so if the marketing babble is to be trusted its 'meant' to be higher performing and more extensible, but I haven't tested that claim yet. In any event it has an impressive array of security features. It also ships with the standard glassfish installation, which means no server configuration is needed if you go that route, I installed it though with Tomcat, it was as easy as executing a script... not too hard at all. Depending how you wish to approach you applications, you can use annotations for the meta programming, and avoid a lot of the messy xml. I found it to be really clean and the closest to Microsofts .Net platform implementation which is IMHO a very good implementation of Web Services ...at least more impressive than anything I have seen in the Java community, but I feel the gap is closing slowly. To integrate with Tapestry I simply overrode Tapestry filter... I am not aware of any more elegant approach, although I made a few inquiries on this list in the past. Cheers, Peter - Original Message - From: Jim O'Callaghan jc1000...@yahoo.co.uk To: Tapestry users users@tapestry.apache.org Sent: Monday, 30 August, 2010 10:52:44 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: RE: OT: Web Services Kalle, Daniel, Thanks for the responses. Good to know that there are positive experiences with CXF. It's probably the front-runner for me at the moment, but will keep an ear open for any other feedback. Looking at my original query I can see that it looks like I am focusing on generating WS clients - I should have said providing interfaces for a system rather than interfacing with a system. Regards, Jim. -Original Message- From: Kalle Korhonen [mailto:kalle.o.korho...@gmail.com] Sent: 30 August 2010 03:43 To: Tapestry users Subject: Re: OT: Web Services Second that. CXF is the successor to XFire and its solid. Kalle On Sun, Aug 29, 2010 at 3:56 PM, Daniel Honig daniel.ho...@gmail.com wrote: I know of many projects using CXF without complaints. I'd say that CXF is probably a good way to go. On Sun, Aug 29, 2010 at 1:35 PM, Jim O'Callaghan j...@peritussolutions.comwrote: I'm aware this is off topic, but since there are so many people on the list with a broad skill set am hoping I can learn from their experiences / heartbreak. I am evaluating various WS stacks for interfacing with a system - currently I am using XFire as it requires very little configuration and performs quite efficiently. XFire appears to qualify every xml element with a namespace, bloating the payload considerably, or, if using the patch from http://jira.codehaus.org/browse/XFIRE-687 appears to have unreliable / inconsistent namespace qualifiers. Can anyone recommend a good WS stack they have positive experience of? My constraints are quite liberal - java 1.5 up, currently jetty as an AS, spring 3.0.2.RELEASE. Is CXF any good? I want to find something with good performance obviously, minimal config, and hopefully something that consistently defines package level namespaces at an envelope level and reuses them. Many thanks, Jim. - 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
RE: OT: Web Services
Good point Peter. I'll see if I can fit this in, though my work will be more migration from XFire to CXF, and using another filter to intercept ws calls, rather than the Tapestry filter, so not sure if it really counts as integrating with Tap. The code I've inherited is using a lot of Spring beans, though I've injected some T5 services into those ... Regards, Jim. -Original Message- From: Peter Stavrinides [mailto:p.stavrini...@albourne.com] Sent: 30 August 2010 14:36 To: Tapestry users Subject: Re: OT: Web Services ... sorry to leach on this thread, but perhaps a short blog on integrating Metro or CXF with Tapestry would be useful. cheers, Peter - Original Message - From: Kristian Marinkovic kristian.marinko...@porsche.co.at To: Tapestry users users@tapestry.apache.org Sent: Monday, 30 August, 2010 16:22:40 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: OT: Web Services hi, i use a (JaxWS)HttpServletRequestFilter service to intercept WS calls to my application. it will only intercept calls that have the url pattern of the provided WS that can be configured. and i'm using metro too. we switched from cxf to metro because it was easier to work with jaxb-binding overrides... g, kris Von:Peter Stavrinides p.stavrini...@albourne.com An: Tapestry users users@tapestry.apache.org Datum: 30.08.2010 14:59 Betreff:Re: OT: Web Services Hi Jim I evaluated quite a few Java WS stacks and was between CXF and Metro, but in the end I chose metro, but to be honest there was very little to choose btw the two... so I would suggest those two as the leading Java WS stacks. Both support maven and are very complete in terms of how much of the web service set of standards they support. Metro implements JAXWS 2.1 and JAXB2.2, so if the marketing babble is to be trusted its 'meant' to be higher performing and more extensible, but I haven't tested that claim yet. In any event it has an impressive array of security features. It also ships with the standard glassfish installation, which means no server configuration is needed if you go that route, I installed it though with Tomcat, it was as easy as executing a script... not too hard at all. Depending how you wish to approach you applications, you can use annotations for the meta programming, and avoid a lot of the messy xml. I found it to be really clean and the closest to Microsofts .Net platform implementation which is IMHO a very good implementation of Web Services ...at least more impressive than anything I have seen in the Java community, but I feel the gap is closing slowly. To integrate with Tapestry I simply overrode Tapestry filter... I am not aware of any more elegant approach, although I made a few inquiries on this list in the past. Cheers, Peter - Original Message - From: Jim O'Callaghan jc1000...@yahoo.co.uk To: Tapestry users users@tapestry.apache.org Sent: Monday, 30 August, 2010 10:52:44 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: RE: OT: Web Services Kalle, Daniel, Thanks for the responses. Good to know that there are positive experiences with CXF. It's probably the front-runner for me at the moment, but will keep an ear open for any other feedback. Looking at my original query I can see that it looks like I am focusing on generating WS clients - I should have said providing interfaces for a system rather than interfacing with a system. Regards, Jim. -Original Message- From: Kalle Korhonen [mailto:kalle.o.korho...@gmail.com] Sent: 30 August 2010 03:43 To: Tapestry users Subject: Re: OT: Web Services Second that. CXF is the successor to XFire and its solid. Kalle On Sun, Aug 29, 2010 at 3:56 PM, Daniel Honig daniel.ho...@gmail.com wrote: I know of many projects using CXF without complaints. I'd say that CXF is probably a good way to go. On Sun, Aug 29, 2010 at 1:35 PM, Jim O'Callaghan j...@peritussolutions.comwrote: I'm aware this is off topic, but since there are so many people on the list with a broad skill set am hoping I can learn from their experiences / heartbreak. I am evaluating various WS stacks for interfacing with a system - currently I am using XFire as it requires very little configuration and performs quite efficiently. XFire appears to qualify every xml element with a namespace, bloating the payload considerably, or, if using the patch from http://jira.codehaus.org/browse/XFIRE-687 appears to have unreliable / inconsistent namespace qualifiers. Can anyone recommend a good WS stack they have positive experience of? My constraints are quite liberal - java 1.5 up, currently jetty as an AS, spring 3.0.2.RELEASE. Is CXF any good? I want to find something with good performance obviously, minimal config, and hopefully something that consistently defines package level namespaces at an envelope level and reuses them. Many thanks, Jim
OT: Web Services
I'm aware this is off topic, but since there are so many people on the list with a broad skill set am hoping I can learn from their experiences / heartbreak. I am evaluating various WS stacks for interfacing with a system - currently I am using XFire as it requires very little configuration and performs quite efficiently. XFire appears to qualify every xml element with a namespace, bloating the payload considerably, or, if using the patch from http://jira.codehaus.org/browse/XFIRE-687 appears to have unreliable / inconsistent namespace qualifiers. Can anyone recommend a good WS stack they have positive experience of? My constraints are quite liberal - java 1.5 up, currently jetty as an AS, spring 3.0.2.RELEASE. Is CXF any good? I want to find something with good performance obviously, minimal config, and hopefully something that consistently defines package level namespaces at an envelope level and reuses them. Many thanks, Jim.
RE: [5.2.0] all our apps completly broken in IE8 (numerous javascript errors)
Andy, Not posting a fix unfortunately but we too are using the X-UA-Compatible meta tag for IE 8 - the problems we were having were related to the pager on inplace grids not working without a manual refresh, though we don't have too much custom JS so no other show stoppers so far. We also have some jQuery use in noconflict mode but I haven't tested whether that required X-UA-Compatible - once we hit the pager bug that was enough to necessitate setting compatibility mode. I will be following this thread with interest. I think a kind of interface layer to allow pluggable third party js libs is in the pipeline ... Regards, Jim. -Original Message- From: Andy Pahne [mailto:andy.pa...@googlemail.com] Sent: 27 August 2010 23:59 To: Tapestry users Subject: Re: [5.2.0] all our apps completly broken in IE8 (numerous javascript errors) Yeah, you hit it. We are using jQuery, as you suggested. So, as I understand: - jQuery.noConflict() not working in IE8 (wo compatible mode) - the workaround is to enable compatible mode - IE8 and Javascript is to be considered broken I think that, by adding the last four links, you suggest that I replace scriptaculouos and prototype? Like Onno did and described in his blog? If so: I would not role my own tapestry.js (and keep it upd to date with Tapestrys evolution) and replae both js-libraries in order to solve this problem. That seems just like a bit too much for me. And, I would replace them with jquery, just like Onno. And if I did so, jQuery.noConflict() then would stil not work in IE8 without compatible mode... Thanks, Andy Am 28.08.2010 00:19, schrieb based2: http://www.prototypejs.org/2009/3/27/prototype-1-6-1-rc2-ie8-compatibility-e lement-storage-and-bug-fixes I think that this does not apply here, because the prototype version used by tapestry is more recent than the one mentioned. And I also tried the most recent prototype release. http://ajaxian.com/archives/x-ua-compatible-ieemulateie7 boils down to: IE8 sucks even more than IE7 http://www.evotech.net/blog/2009/03/ie8-css-support/ boils down to: IE8 sucks even more than IE7 http://tapestry.1045711.n5.nabble.com/template/TplServlet.jtp?tpl=search-pag enode=2375125query=IE+8 Yeah, I have seen this thread before, but did not realize that it is related. http://stackoverflow.com/questions/2830510/jquery-noconflict-not-working-in- ie8-only boils down to: IE8 sucks even more than IE7 http://www.webdeveloper.com/forum/showthread.php?t=204998 boils down to: IE8 sucks even more than IE7 http://piraya-blog.blogspot.com/2009/06/removing-prototype-from-tapestry-par t-3.html == http://wiki.apache.org/tapestry/Tapestry5ModuleRegistry == http://wiki.apache.org/tapestry/Tapestry5OpensourceApps == http://wiki.apache.org/tapestry/Tapestry5HowTos - 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: Blog post about T5 exception handling on GAE
Dmitry, From an example in an earlier post on this list, I use the approach of having: configuration.add(SymbolConstants.PRODUCTION_MODE, true); in my AppModule, so that by default production mode is always set to true for deployments, and then for any run/debug configurations in the developer's IDE, just override that setting with the VM argument: -Dtapestry.production-mode=false This means you will never need to set it for a release as the default is true. Hope this helps. Regards, Jim. -Original Message- From: Dmitry Gusev [mailto:dmitry.gu...@gmail.com] Sent: 27 August 2010 08:54 To: Tapestry users Subject: Blog post about T5 exception handling on GAE FYI http://dmitrygusev.blogspot.com/2010/08/gae-and-tapestry5-exception-handling .html One thing I'd like T5 have though is something like in RemoteOnly mode in ASP.NET. http://msdn.microsoft.com/en-us/library/h0hfz6fc.aspx RemoteOnly Specifies that custom errors are shown only to the remote clients, and that ASP.NET errors are shown to the local host. This is the default value. So that even if I debug application in production mode I could get detailed exception report and not production one. Now I have to use development mode to debug (or consult with logs), but then I often forgetting to switch back to production mode prior to deploy. Can anybody share his practice of switching production mode on/off during development cycle? -- Dmitry Gusev AnjLab Team http://anjlab.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Selct object which depends on other select object
http://tapestry.formos.com/nightly/tapestry5/tapestry-core/ref/org/apache/ta pestry5/corelib/components/Select.html might help - see SelectZoneDemo - this may be T.5.2.0 and up. Regards, Jim. -Original Message- From: tas85 [mailto:tassada...@gmail.com] Sent: 23 August 2010 17:20 To: users@tapestry.apache.org Subject: Selct object which depends on other select object Hi Tapestry, Is it possible to create 2 Select Box of Objects, as: List1: Car, Motor, Bicyle List2: depend on List1, if on choose car, List2 will be Mercedes, Audi, ... Thank a bunch, a bunch. Tas -- View this message in context: http://tapestry.1045711.n5.nabble.com/Selct-object-which-depends-on-other-se lect-object-tp2644982p2644982.html Sent from the Tapestry - User mailing list archive at Nabble.com. - 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
OT: Debugging Tapestry Apps using Eclipse
I'm facing an issue with my Eclipse IDE (3.4.1) and thought I would check if anyone has faced the same issue / has a possible solution. I'm not sure when this started (last few weeks) but I'm seeing a difference in performance of over 10x between 'Run' and 'Debug' targets under Eclipse - getting to the stage that dev is unworkable. I've used a variety of JDKs from 1.5 up to 1.6u19, and have cycled the initial mem and max mem from 512m up to 2048m, with a permgen between 256 - 512m. I'm using the eclipse jetty plugin and running on a fast pc with plenty of RAM / disk space etc. When I run this app as a 'Run' target under Eclipse, or from the command line the response time is almost instant. Ring any bells with anyone? I'm trying using one of the T 5.2.0 snapshot from a few months back (5.2.0-20100603.111954-89) and also the current alpha. Startup / avg page reponse is 50s / 30s with 'Debug' targets vs. 8s / almost instant with 'Run' targets. Would be grateful for any advice. Regards, Jim.
RE: OT: Debugging Tapestry Apps using Eclipse
Thanks for the response Josh. No breakpoints set. Any other thoughts welcome. Regards, Jim. -Original Message- From: Josh Canfield [mailto:joshcanfi...@gmail.com] Sent: 24 August 2010 18:54 To: Tapestry users Subject: Re: OT: Debugging Tapestry Apps using Eclipse Off the top of my head it sounds like you might have a method breakpoint set.. Have you tried clearing all of your breakpoints? -- Josh On Aug 24, 2010, at 10:19 AM, Jim O'Callaghan j...@peritussolutions.com wrote: I'm facing an issue with my Eclipse IDE (3.4.1) and thought I would check if anyone has faced the same issue / has a possible solution. I'm not sure when this started (last few weeks) but I'm seeing a difference in performance of over 10x between 'Run' and 'Debug' targets under Eclipse - getting to the stage that dev is unworkable. I've used a variety of JDKs from 1.5 up to 1.6u19, and have cycled the initial mem and max mem from 512m up to 2048m, with a permgen between 256 - 512m. I'm using the eclipse jetty plugin and running on a fast pc with plenty of RAM / disk space etc. When I run this app as a 'Run' target under Eclipse, or from the command line the response time is almost instant. Ring any bells with anyone? I'm trying using one of the T 5.2.0 snapshot from a few months back (5.2.0-20100603.111954-89) and also the current alpha. Startup / avg page reponse is 50s / 30s with 'Debug' targets vs. 8s / almost instant with 'Run' targets. Would be grateful for any advice. Regards, Jim. - 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: button for IE
Thanks Michael. I've decided against using it also, and am sticking with submits and styled anchors. Regards, Jim. -Original Message- From: Michael Gentry [mailto:mgen...@masslight.net] Sent: 05 August 2010 14:54 To: Tapestry users Subject: Re: button for IE I'm jumping into this quite late ... About a year ago I tried using the BUTTON tag, but IE made it pretty impossible for us. We had multiple buttons in a form and with IE (at least IE 6) we couldn't identify which button was clicked on. We had to go back to a normal submit button. I'm not sure if this restriction will impact you, but thought I'd mention it. mrg - 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
button for IE
Can anyone advise on a good approach for IE's handling of the button tag? I was using: a href=${returnPage}button${message:generic.continue-label}/button/a . in my tml with: Public Link getReturnPage(){.} . in my associated java class until I found IE doesn't behave the same way as Chrome / FF. I am trying to avoid having to provide an onActionFromXYZ in my page class as I already have the href I want to navigate to - just that I want to style it as a button without too much hacking. I don't want to put PageLinks in my tml as in this specific case the context is variable. Regards, Jim.
RE: button for IE
Thanks Dragan but I need to make sure it works without JS - no choice. Regards, Jim. -Original Message- From: Dragan Sahpaski [mailto:dragan.sahpas...@gmail.com] Sent: 04 August 2010 15:35 To: Tapestry users Subject: Re: button for IE I use, input type=submit onclick=window.location='${url}'; return false; value=${value} / Cheers On Wed, Aug 4, 2010 at 4:09 PM, Jim O'Callaghan j...@peritussolutions.comwrote: Can anyone advise on a good approach for IE's handling of the button tag? I was using: a href=${returnPage}button${message:generic.continue-label}/button/a . in my tml with: Public Link getReturnPage(){.} . in my associated java class until I found IE doesn't behave the same way as Chrome / FF. I am trying to avoid having to provide an onActionFromXYZ in my page class as I already have the href I want to navigate to - just that I want to style it as a button without too much hacking. I don't want to put PageLinks in my tml as in this specific case the context is variable. Regards, Jim. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: button for IE
Thanks Ville. I will use the pageLink method where the context is created within the java file - the page linked to may also be dynamic, so will also need to be passed. A shame IE treats button differently. Regards, Jim. -Original Message- From: Ville Virtanen [mailto:ville.virta...@cerion.fi] Sent: 04 August 2010 16:40 To: users@tapestry.apache.org Subject: Re: button for IE On a side note: you can use the onAction(possible_context) to catch any action made by any link. Also, you can construct the context for the pagelink (or actionlink) in the java file, just return new Object[]{value1, value2...} from the java method. (t:pagelink page=somePage context=prop:myContextMethod) - Ville Jim O'Callaghan wrote: Can anyone advise on a good approach for IE's handling of the button tag? I was using: ${returnPage} button${message:generic.continue-label}/button . in my tml with: Public Link getReturnPage(){.} . in my associated java class until I found IE doesn't behave the same way as Chrome / FF. I am trying to avoid having to provide an onActionFromXYZ in my page class as I already have the href I want to navigate to - just that I want to style it as a button without too much hacking. I don't want to put PageLinks in my tml as in this specific case the context is variable. Regards, Jim. -- View this message in context: http://old.nabble.com/%3Cbutton%3E-for-IE-tp29346696p29347798.html Sent from the Tapestry - User mailing list archive at Nabble.com. - 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: button for IE
Thanks for the response Andreas. I want to use an anchor in a scenario where I may have multiple buttons in a form, and want those buttons to submit to form A, but want the anchor to navigate to another page completely. I think I have what I need with using anchors and some CSS. Regards, Jim. -Original Message- From: andre...@gmail.com [mailto:andre...@gmail.com] On Behalf Of Andreas Andreou Sent: 04 August 2010 18:50 To: Tapestry users Subject: Re: button for IE i dont think i've ever seen button used inside an a what's wrong with doing something like: form method=get action=${returnPage}button type=submit .../button/form On Wed, Aug 4, 2010 at 19:49, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: Thanks Ville. I will use the pageLink method where the context is created within the java file - the page linked to may also be dynamic, so will also need to be passed. A shame IE treats button differently. Regards, Jim. -Original Message- From: Ville Virtanen [mailto:ville.virta...@cerion.fi] Sent: 04 August 2010 16:40 To: users@tapestry.apache.org Subject: Re: button for IE On a side note: you can use the onAction(possible_context) to catch any action made by any link. Also, you can construct the context for the pagelink (or actionlink) in the java file, just return new Object[]{value1, value2...} from the java method. (t:pagelink page=somePage context=prop:myContextMethod) - Ville Jim O'Callaghan wrote: Can anyone advise on a good approach for IE's handling of the button tag? I was using: ${returnPage} button${message:generic.continue-label}/button . in my tml with: Public Link getReturnPage(){.} . in my associated java class until I found IE doesn't behave the same way as Chrome / FF. I am trying to avoid having to provide an onActionFromXYZ in my page class as I already have the href I want to navigate to - just that I want to style it as a button without too much hacking. I don't want to put PageLinks in my tml as in this specific case the context is variable. Regards, Jim. -- View this message in context: http://old.nabble.com/%3Cbutton%3E-for-IE-tp29346696p29347798.html Sent from the Tapestry - User mailing list archive at Nabble.com. - 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 -- Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr Tapestry PMC / Tacos developer Open Source / JEE Consulting - 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: button for IE
Andreas, The behavior I was finding was as follows: - in FF and Chrome a href=http://asd;buttonlabelText/button/a would render the anchor as a button (my desired outcome), and when the button was clicked the form was NOT submitted, and the browser navigated to http://asd - in IE a href=http://asd;buttonlabelText/button/a would render the anchor as a button, and when the button was clicked the form was submitted - I think but haven't checked the value labelText was submitted. Perhaps FF and Chrome are not behaving as the W3C spec mandates though it would have suited my purpose. I was basing the approach on a post on the list that I can't find at the moment. I think other posts came up with the same conclusion I have - leave the anchor as is and use CSS to style it. Regards, Jim. -Original Message- From: andre...@gmail.com [mailto:andre...@gmail.com] On Behalf Of Andreas Andreou Sent: 04 August 2010 19:59 To: Tapestry users Subject: Re: button for IE ok, but i have to ask cause that's another new on for me... You're saying that if you have a ...button .../a and you click on the button that both the form is submitted AND the browser is navigated to the href ?? On Wed, Aug 4, 2010 at 21:26, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: Thanks for the response Andreas. I want to use an anchor in a scenario where I may have multiple buttons in a form, and want those buttons to submit to form A, but want the anchor to navigate to another page completely. I think I have what I need with using anchors and some CSS. Regards, Jim. -Original Message- From: andre...@gmail.com [mailto:andre...@gmail.com] On Behalf Of Andreas Andreou Sent: 04 August 2010 18:50 To: Tapestry users Subject: Re: button for IE i dont think i've ever seen button used inside an a what's wrong with doing something like: form method=get action=${returnPage}button type=submit .../button/form On Wed, Aug 4, 2010 at 19:49, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: Thanks Ville. I will use the pageLink method where the context is created within the java file - the page linked to may also be dynamic, so will also need to be passed. A shame IE treats button differently. Regards, Jim. -Original Message- From: Ville Virtanen [mailto:ville.virta...@cerion.fi] Sent: 04 August 2010 16:40 To: users@tapestry.apache.org Subject: Re: button for IE On a side note: you can use the onAction(possible_context) to catch any action made by any link. Also, you can construct the context for the pagelink (or actionlink) in the java file, just return new Object[]{value1, value2...} from the java method. (t:pagelink page=somePage context=prop:myContextMethod) - Ville Jim O'Callaghan wrote: Can anyone advise on a good approach for IE's handling of the button tag? I was using: ${returnPage} button${message:generic.continue-label}/button . in my tml with: Public Link getReturnPage(){.} . in my associated java class until I found IE doesn't behave the same way as Chrome / FF. I am trying to avoid having to provide an onActionFromXYZ in my page class as I already have the href I want to navigate to - just that I want to style it as a button without too much hacking. I don't want to put PageLinks in my tml as in this specific case the context is variable. Regards, Jim. -- View this message in context: http://old.nabble.com/%3Cbutton%3E-for-IE-tp29346696p29347798.html Sent from the Tapestry - User mailing list archive at Nabble.com. - 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 -- Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr Tapestry PMC / Tacos developer Open Source / JEE Consulting - 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 -- Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr Tapestry PMC / Tacos developer Open Source / JEE Consulting - 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
RE: button for IE
Kalle, Roland et al., Thanks for all the suggestions. I don't want to pollute the list much more with this query as I have a cross-browser solution that I'm happy with (CSS applied to the anchor), but during my testing, even if I stopped the event using: onclick=return false; IE wouldn't navigate to the href indicated by the anchor. Regards, Jim. -Original Message- From: Kalle Korhonen [mailto:kalle.o.korho...@gmail.com] Sent: 04 August 2010 23:30 To: Tapestry users Subject: Re: button for IE On Wed, Aug 4, 2010 at 2:32 PM, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: The behavior I was finding was as follows: Perhaps FF and Chrome are not behaving as the W3C spec mandates though it would have suited my purpose. I was basing the approach on a post on the list that I can't find at the moment. Nine times out of ten IE is the offender and that's true in this case as well. If the button is on a form IE submits the form which is incorrect according to the spec. IE8 may have this right. Need to do what Roland says and stop the event. Kalle -Original Message- From: andre...@gmail.com [mailto:andre...@gmail.com] On Behalf Of Andreas Andreou Sent: 04 August 2010 19:59 To: Tapestry users Subject: Re: button for IE ok, but i have to ask cause that's another new on for me... You're saying that if you have a ...button .../a and you click on the button that both the form is submitted AND the browser is navigated to the href ?? On Wed, Aug 4, 2010 at 21:26, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: Thanks for the response Andreas. I want to use an anchor in a scenario where I may have multiple buttons in a form, and want those buttons to submit to form A, but want the anchor to navigate to another page completely. I think I have what I need with using anchors and some CSS. Regards, Jim. -Original Message- From: andre...@gmail.com [mailto:andre...@gmail.com] On Behalf Of Andreas Andreou Sent: 04 August 2010 18:50 To: Tapestry users Subject: Re: button for IE i dont think i've ever seen button used inside an a what's wrong with doing something like: form method=get action=${returnPage}button type=submit .../button/form On Wed, Aug 4, 2010 at 19:49, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: Thanks Ville. I will use the pageLink method where the context is created within the java file - the page linked to may also be dynamic, so will also need to be passed. A shame IE treats button differently. Regards, Jim. -Original Message- From: Ville Virtanen [mailto:ville.virta...@cerion.fi] Sent: 04 August 2010 16:40 To: users@tapestry.apache.org Subject: Re: button for IE On a side note: you can use the onAction(possible_context) to catch any action made by any link. Also, you can construct the context for the pagelink (or actionlink) in the java file, just return new Object[]{value1, value2...} from the java method. (t:pagelink page=somePage context=prop:myContextMethod) - Ville Jim O'Callaghan wrote: Can anyone advise on a good approach for IE's handling of the button tag? I was using: ${returnPage} button${message:generic.continue-label}/button . in my tml with: Public Link getReturnPage(){.} . in my associated java class until I found IE doesn't behave the same way as Chrome / FF. I am trying to avoid having to provide an onActionFromXYZ in my page class as I already have the href I want to navigate to - just that I want to style it as a button without too much hacking. I don't want to put PageLinks in my tml as in this specific case the context is variable. Regards, Jim. -- View this message in context: http://old.nabble.com/%3Cbutton%3E-for-IE-tp29346696p29347798.html Sent from the Tapestry - User mailing list archive at Nabble.com. - 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 -- Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr Tapestry PMC / Tacos developer Open Source / JEE Consulting - 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 -- Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr Tapestry PMC / Tacos developer Open Source / JEE Consulting
RE: final version of Tapestry 5.2
Kalle, This is more a maven question than Tapestry, but you mentioned a 'frozen' snapshot below - in my pom the only snapshot version I have is T5.2.0 - the other dependencies are all release versions - I'm currently running with maven offline as I don't like surprises - how do you 'freeze' at a certain snapshot? Thanks. Regards, Jim. -Original Message- From: Kalle Korhonen [mailto:kalle.o.korho...@gmail.com] Sent: 29 July 2010 20:42 To: Tapestry users Subject: Re: final version of Tapestry 5.2 I'm not so sure that GAE on Java is production ready, but that aside, ultimately it's up to you to decide what's production ready for you and what isn't. A snapshot is a snapshot of that version in development. T5.2 isn't going to change drastically anymore. If I wanted to deploy to T5.2 to production, I'd use a frozen snapshot or wait for the T5.2 alpha release that will be cut shortly. Kalle On Thu, Jul 29, 2010 at 12:34 PM, Muhammad Mohsen m.gelb...@gmail.com wrote: Thanks Dmitry, Please let me make sure that I got this right. T5.2 fully compatible with GAE since sept. 2009 ? But still T5.2 is a snapshot...doesn't that mean that it's not ready for production usage..right ? On Thu, Jul 29, 2010 at 8:57 PM, Dmitry Gusev dmitry.gu...@gmail.comwrote: GAE supported by T5.2 since September 2009. No problems at all, except GAE's Java lags for 4-6 seconds to boot up. On Thu, Jul 29, 2010 at 19:53, Muhammad Mohsen m.gelb...@gmail.com wrote: Am extremely excited for that :) I read that v5.2 should support google application engine more than before by abandoning an xml class that is not supported by google application engine. Also we can force tapestry to work without the thread pool. Is there any further support for google application engine ? On Thu, Jul 29, 2010 at 5:02 PM, Ulrich Stärk u...@spielviel.de wrote: We will probably release an alpha version within the next week followed by additional alphas and betas as needed. The plan is to have a stable 5.2 release before JavaOne which begins on September 19th. Uli On 29.07.2010 15:31, Pablo Borges wrote: Hello staff, will be released when the final version of Tapestry 5.2? thanks - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Muhammad Mohsen Hussien Jr. Java Software Engineer -- Dmitry Gusev AnjLab Team http://anjlab.com -- Muhammad Mohsen Hussien Jr. Java Software Engineer - 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: JasperReports / Chenillekit-reports documentation
You've probably already checked, but in case not - have you had a look at the JasperReports pom? Perhaps there are dependencies it references that need to be explicitly excluded in your pom to stop interfering with your other project dependencies? Regards, Jim. -Original Message- From: Rich [mailto:rich...@moremagic.com] Sent: 30 July 2010 15:01 To: Tapestry users Subject: Re: JasperReports / Chenillekit-reports documentation Thiago H. de Paula Figueiredo wrote: On Wed, 28 Jul 2010 18:13:17 -0300, Rich rich...@moremagic.com wrote: Hi, Hi! java.lang.ClassNotFoundException org.apache.poi.hssf.usermodel.HSSFCellStyle java.lang.NoClassDefFoundError: org/apache/commons/collections/map/LRUMap These are dependency problems, not Tapestry ones. The first one looks like POI and the second one Apache Commons-Collections. Sort of. The POI one is clearly a dependency problem and I stated as much, since it uses outdated versions of JasperReports. However, the second one regarding Apache Commons and LRUMap is something that is breaking in the Tapestry-Hibernate Module when all that's changed is the JasperReports dependency. I didn't fully explain this because it was fully detailed with the exception in an earlier e-mail in this thread I wrote. Caused by: java.lang.RuntimeException: Error invoking service builder method org.apache.tapestry5.hibernate.HibernateCoreModule.buildHibernateSessionSource(Logger, List, RegistryShutdownHub) (at HibernateCoreModule.java:123) (for service 'HibernateSessionSource'): org/apache/commons/collections/map/LRUMap at org.apache.tapestry5.ioc.internal.ServiceBuilderMethodInvoker.createObject(ServiceBuilderMethodInvoker.java:76) at org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator$1.invoke(OperationTrackingObjectCreator.java:45) at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:68) ... 134 more Caused by: java.lang.NoClassDefFoundError: org/apache/commons/collections/map/LRUMap So there seems to be some transitive breaking there, which I would say puts it beyond just a dependency problem. Anyway, after much trial and error it turns out that Apache POI 3.2 and JasperReports 3.5.0 will get XLS working. Older JasperReport versions call deprecated POI methods, newer JasperReport versions break the Hibernate module, older POI versions have bugs that break runtime execution, and newer POI versions also break! Regards, Rich - 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: final version of Tapestry 5.2
A - thanks Kalle. Regards, Jim. -Original Message- From: Kalle Korhonen [mailto:kalle.o.korho...@gmail.com] Sent: 30 July 2010 17:40 To: Tapestry users Subject: Re: final version of Tapestry 5.2 Purely a Maven question, but you can use the unique version: artifactIdtapestry-core/artifactId version5.2.0-20100703.003619-102/version Or, deploy a snapshot of a library as a released version, for example: version5.2.0-mycompany-1/version (I do that with more dependencies that are not built with Maven I care to count for) Or, if your repository manager supports it, explicitly disable new snapshot updates for specific libs. Kalle On Fri, Jul 30, 2010 at 1:57 AM, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: Kalle, This is more a maven question than Tapestry, but you mentioned a 'frozen' snapshot below - in my pom the only snapshot version I have is T5.2.0 - the other dependencies are all release versions - I'm currently running with maven offline as I don't like surprises - how do you 'freeze' at a certain snapshot? Thanks. Regards, Jim. -Original Message- From: Kalle Korhonen [mailto:kalle.o.korho...@gmail.com] Sent: 29 July 2010 20:42 To: Tapestry users Subject: Re: final version of Tapestry 5.2 I'm not so sure that GAE on Java is production ready, but that aside, ultimately it's up to you to decide what's production ready for you and what isn't. A snapshot is a snapshot of that version in development. T5.2 isn't going to change drastically anymore. If I wanted to deploy to T5.2 to production, I'd use a frozen snapshot or wait for the T5.2 alpha release that will be cut shortly. Kalle On Thu, Jul 29, 2010 at 12:34 PM, Muhammad Mohsen m.gelb...@gmail.com wrote: Thanks Dmitry, Please let me make sure that I got this right. T5.2 fully compatible with GAE since sept. 2009 ? But still T5.2 is a snapshot...doesn't that mean that it's not ready for production usage..right ? On Thu, Jul 29, 2010 at 8:57 PM, Dmitry Gusev dmitry.gu...@gmail.comwrote: GAE supported by T5.2 since September 2009. No problems at all, except GAE's Java lags for 4-6 seconds to boot up. On Thu, Jul 29, 2010 at 19:53, Muhammad Mohsen m.gelb...@gmail.com wrote: Am extremely excited for that :) I read that v5.2 should support google application engine more than before by abandoning an xml class that is not supported by google application engine. Also we can force tapestry to work without the thread pool. Is there any further support for google application engine ? On Thu, Jul 29, 2010 at 5:02 PM, Ulrich Stärk u...@spielviel.de wrote: We will probably release an alpha version within the next week followed by additional alphas and betas as needed. The plan is to have a stable 5.2 release before JavaOne which begins on September 19th. Uli On 29.07.2010 15:31, Pablo Borges wrote: Hello staff, will be released when the final version of Tapestry 5.2? thanks - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Muhammad Mohsen Hussien Jr. Java Software Engineer -- Dmitry Gusev AnjLab Team http://anjlab.com -- Muhammad Mohsen Hussien Jr. Java Software Engineer - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: non thread safe access to session
Jonathon, Howard, Thanks for the responses. I'm leaning towards Howard's explanation. The processes are accessing newly created / persisted objects so I don't think sharing attached objects across more than one session should arise. I do however have some buried code where I force a transaction to commit to allow me to assign some non-customer facing entity keys in batches, to reduce db hits - this is probably causing the problem - I'll synchronize that as it's not called too often and hopefully that will do it. Thanks for the tips guys. Regards, Jim. -Original Message- From: Jonathan Barker [mailto:jonathan.theit...@gmail.com] Sent: 22 July 2010 02:31 To: Tapestry users Subject: Re: non thread safe access to session Jim, I have vague recollections of hitting this before. IIRC, each hibernate object knows the Session that it is associated with. So, if an object is associated with Session A on Thread A, and you modify that object from Thread B, then Session A now has to manage changes made from a different thread, which presents lots of challenges. So, I think it's not so much about your handling of the Sessions, as it is about handling session-managed objects that get accessed from different threads. Can you detach your objects before allowing other threads to access them? Regards, Jonathan On Wed, Jul 21, 2010 at 1:29 PM, Jim O'Callaghan jc1000...@yahoo.co.ukwrote: Yep Thiago, it's Tapestry-Hibernate creating the sessions. My situation might be a little contrived, but I'm concerned it might happen to end-users, as I don't fully understand why it's happening. Regards, Jim. -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: 21 July 2010 18:22 To: Tapestry users Subject: Re: non thread safe access to session On Wed, 21 Jul 2010 13:58:15 -0300, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: Hi Thiago, Hi, Jim! I'm talking about the hibernate session - I'm injecting it into the constructor of Service B at bind time. I thought Tapestry would treat the service as a thread safe singleton and control access to method calls on it accordingly? Tapestry-IoC doesn't synchronize method calls. How are you building the sessions? Tapestry-Hibernate? -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informa??o Ltda. http://www.arsmachina.com.br - 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 -- Jonathan Barker ITStrategic - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: non thread safe access to session
I do get direct access to the session from the under a very specific circumstance to allow me to commit a separate transaction unconditionally, to facilitate keeping a pre-allocated batch of keys in memory - I can't have this transaction rolled back due to a problem somewhere else, or I am left with keys that the application thinks are available, but in reality the sequence hasn't been updated in the database due to a rollback. The new session is created using session.getSessionFactory().openSession() within a single method invocation, which I'm guessing leaves me open to thread safety issues. I'm going to rearrange it to make it more service based. I think this is just down to bad coding practice. Regards, Jim. -Original Message- From: Josh Canfield [mailto:joshcanfi...@gmail.com] Sent: 22 July 2010 16:25 To: Tapestry users Subject: Re: non thread safe access to session I do however have some buried code where I force a transaction to commit to allow me to assign some non-customer facing entity keys in batches, to reduce db hits - this is probably causing the problem - I'll synchronize that as it's not called too often and hopefully that will do it. Thanks for the tips guys. I'm curious why you'd need to synchronize anything to do what you've described. You shouldn't be getting any cross-thread access to a single session. -- Josh On Jul 22, 2010, at 1:16 AM, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: Jonathon, Howard, Thanks for the responses. I'm leaning towards Howard's explanation. The processes are accessing newly created / persisted objects so I don't think sharing attached objects across more than one session should arise. I do however have some buried code where I force a transaction to commit to allow me to assign some non-customer facing entity keys in batches, to reduce db hits - this is probably causing the problem - I'll synchronize that as it's not called too often and hopefully that will do it. Thanks for the tips guys. Regards, Jim. -Original Message- From: Jonathan Barker [mailto:jonathan.theit...@gmail.com] Sent: 22 July 2010 02:31 To: Tapestry users Subject: Re: non thread safe access to session Jim, I have vague recollections of hitting this before. IIRC, each hibernate object knows the Session that it is associated with. So, if an object is associated with Session A on Thread A, and you modify that object from Thread B, then Session A now has to manage changes made from a different thread, which presents lots of challenges. So, I think it's not so much about your handling of the Sessions, as it is about handling session-managed objects that get accessed from different threads. Can you detach your objects before allowing other threads to access them? Regards, Jonathan On Wed, Jul 21, 2010 at 1:29 PM, Jim O'Callaghan jc1000...@yahoo.co.ukwrote: Yep Thiago, it's Tapestry-Hibernate creating the sessions. My situation might be a little contrived, but I'm concerned it might happen to end-users, as I don't fully understand why it's happening. Regards, Jim. -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: 21 July 2010 18:22 To: Tapestry users Subject: Re: non thread safe access to session On Wed, 21 Jul 2010 13:58:15 -0300, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: Hi Thiago, Hi, Jim! I'm talking about the hibernate session - I'm injecting it into the constructor of Service B at bind time. I thought Tapestry would treat the service as a thread safe singleton and control access to method calls on it accordingly? Tapestry-IoC doesn't synchronize method calls. How are you building the sessions? Tapestry-Hibernate? -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informa??o Ltda. http://www.arsmachina.com.br - 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 -- Jonathan Barker ITStrategic - 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
RE: blackbird.js and IE breaking fixed CSS background image
Rich, I'm on T5.2.0 so the code has been updated accordingly - looking through my file history, I have: public static MyClientInfrastructure buildMyClientInfrastructure(@InjectService(ClientInfrastructure) ClientInfrastructure original, @InjectService(AssetSource) AssetSource assetSource) { return new MyClientInfrastructure(original, assetSource); } public static void contributeAlias( @InjectService(MyClientInfrastructure) ClientInfrastructure cInfraService, org.apache.tapestry5.ioc.ConfigurationAliasContribution configuration) { configuration.add(AliasContribution.create(ClientInfrastructure.class, cInfraService)); } ... in my AppModule. It's been a while since I looked at it so can't say for sure but perhaps this is more in line with what is required for T5.1.0.x. I think ClientInfrastructure is deprecated in T5.2.0. Hope this is of use. Regards, Jim. -Original Message- From: Rich [mailto:rich...@moremagic.com] Sent: 22 July 2010 16:32 To: Tapestry users Subject: Re: blackbird.js and IE breaking fixed CSS background image Hi, attempt 6 at getting through spam blocker. I used the code mentioned but the original object from the decorate method is always null. I'm not sure what to do about that? -Rich Jim O'Callaghan wrote: Hi Rich, Yep same guy, guilty as charged. This may not be the best solution, you may get some better advice from some of the more experienced Tapestry people on the forum, but it's the approach I used. The post I included earlier was indeed about just ensuring a specific order was enforced in the js includes for the ClientInfrastructure, but I have used a variation on it to include my local version of blackbird.js, rather than the one that comes with T5.1.0.5. The code is as follows: AppModule.java: public ClientInfrastructure decorateClientInfrastructure(ClientInfrastructure original, @InjectService(AssetSource) AssetSource assetSource) { return new MyClientInfrastructure(original, assetSource); } MyClientInfrastructure.java: public class MyClientInfrastructure implements ClientInfrastructure { @Inject AssetSource assetSource; ClientInfrastructure clientInfrastructure; List javascriptStack = new ArrayList(); @SuppressWarnings(unchecked) public MyClientInfrastructure(ClientInfrastructure clientInfrastructure, AssetSource assetSource) { this.assetSource = assetSource; this.clientInfrastructure = clientInfrastructure; // Add jQuery assets in ahead of Prototype - IE8 was burping otherwise, despite jQuery.noConflict being set javascriptStack.add(assetSource.getAsset(null, context:/scripts/jquery-1.4.2.min.js, null)); javascriptStack.add(assetSource.getAsset(null, context:/scripts/jquery-ui-1.8.1.custom.min.js, null)); List assets = this.clientInfrastructure.getJavascriptStack(); for (Iterator i = assets.iterator(); i.hasNext();) { Asset asset = (Asset) i.next(); if (!asset.toString().contains(blackbird.js)) { javascriptStack.add(asset); } else { javascriptStack.add(assetSource.getAsset(null, context:/scripts/blackbird_1_0/blackbird.js, null)); } } } public ListAsset getJavascriptStack() { //return clientInfrastructure.getJavascriptStack(); return javascriptStack; } public ListAsset getStylesheetStack() { return clientInfrastructure.getStylesheetStack(); } } I have my local blackbird.js physically located in the project under src\main\webapp\scripts\blackbird_1_0\blackbird.js. Obviously the jQuery ordering is not relevant to your specific problem, just the replacement of blackbird.js is. Probably could be more elegant/efficient, but it's just called once at startup so I wasn't too concerned about it. Hope this get things working for you and I don't get chewed by the more enlightened forum members!. Regards, Jim. -Original Message- From: Rich [mailto:rich...@moremagic.com] Sent: 20 July 2010 17:25 To: users@tapestry.apache.org Subject: blackbird.js and IE breaking fixed CSS background image Hi, I'm aware blackbird.js is not directly Tapestry code, but I'm looking for advice on how to handle an issue with the blackbird.js file. I had been having problems with getting the fixed background image in my tapestry webapp to stay fixed in Internet Explorer. I'd given up searching for a solution (it appeared to be beyond the CSS I was using) until someone recently pointed out that a line of code in blackbird.js breaks the fixed background for IE. I went and re-jared the tapestry-core with the line
RE: non thread safe access to session
Thanks Kalle - this will be very useful for me - I'll make it more service oriented and inject the new session. Regards, Jim. -Original Message- From: Kalle Korhonen [mailto:kalle.o.korho...@gmail.com] Sent: 22 July 2010 17:48 To: Tapestry users Subject: Re: non thread safe access to session To create an absolutely *new* session (even if another thread-bound session already exists), inject HibernateSessionSource and call hibernateSessionSource.getSessionFactory().create(), then manage transactions and all objects in that session yourself. Kalle On Thu, Jul 22, 2010 at 9:38 AM, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: I do get direct access to the session from the under a very specific circumstance to allow me to commit a separate transaction unconditionally, to facilitate keeping a pre-allocated batch of keys in memory - I can't have this transaction rolled back due to a problem somewhere else, or I am left with keys that the application thinks are available, but in reality the sequence hasn't been updated in the database due to a rollback. The new session is created using session.getSessionFactory().openSession() within a single method invocation, which I'm guessing leaves me open to thread safety issues. I'm going to rearrange it to make it more service based. I think this is just down to bad coding practice. Regards, Jim. -Original Message- From: Josh Canfield [mailto:joshcanfi...@gmail.com] Sent: 22 July 2010 16:25 To: Tapestry users Subject: Re: non thread safe access to session I do however have some buried code where I force a transaction to commit to allow me to assign some non-customer facing entity keys in batches, to reduce db hits - this is probably causing the problem - I'll synchronize that as it's not called too often and hopefully that will do it. Thanks for the tips guys. I'm curious why you'd need to synchronize anything to do what you've described. You shouldn't be getting any cross-thread access to a single session. -- Josh On Jul 22, 2010, at 1:16 AM, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: Jonathon, Howard, Thanks for the responses. I'm leaning towards Howard's explanation. The processes are accessing newly created / persisted objects so I don't think sharing attached objects across more than one session should arise. I do however have some buried code where I force a transaction to commit to allow me to assign some non-customer facing entity keys in batches, to reduce db hits - this is probably causing the problem - I'll synchronize that as it's not called too often and hopefully that will do it. Thanks for the tips guys. Regards, Jim. -Original Message- From: Jonathan Barker [mailto:jonathan.theit...@gmail.com] Sent: 22 July 2010 02:31 To: Tapestry users Subject: Re: non thread safe access to session Jim, I have vague recollections of hitting this before. IIRC, each hibernate object knows the Session that it is associated with. So, if an object is associated with Session A on Thread A, and you modify that object from Thread B, then Session A now has to manage changes made from a different thread, which presents lots of challenges. So, I think it's not so much about your handling of the Sessions, as it is about handling session-managed objects that get accessed from different threads. Can you detach your objects before allowing other threads to access them? Regards, Jonathan On Wed, Jul 21, 2010 at 1:29 PM, Jim O'Callaghan jc1000...@yahoo.co.ukwrote: Yep Thiago, it's Tapestry-Hibernate creating the sessions. My situation might be a little contrived, but I'm concerned it might happen to end-users, as I don't fully understand why it's happening. Regards, Jim. -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: 21 July 2010 18:22 To: Tapestry users Subject: Re: non thread safe access to session On Wed, 21 Jul 2010 13:58:15 -0300, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: Hi Thiago, Hi, Jim! I'm talking about the hibernate session - I'm injecting it into the constructor of Service B at bind time. I thought Tapestry would treat the service as a thread safe singleton and control access to method calls on it accordingly? Tapestry-IoC doesn't synchronize method calls. How are you building the sessions? Tapestry-Hibernate? -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informa??o Ltda. http://www.arsmachina.com.br - 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
RE: blackbird.js and IE breaking fixed CSS background image
Sorry I can't be of more help Rich - we've migrated over to T5.2.0 so I don't have a pre T5.2.0 environment I can test this under at the moment. You're right though it shouldn't be difficult at all - I've found a lot of these minor things have me banging my head on the desk until someone chips in with the solution, before having the 'ahhh' moment. Hopefully someone here can steer you straight - what exact version of Tapestry are you using? Regards, Jim. -Original Message- From: Rich [mailto:rich...@moremagic.com] Sent: 22 July 2010 20:51 To: Tapestry users Subject: Re: blackbird.js and IE breaking fixed CSS background image No luck still =/ I tried it many ways: decorateClientInfrastructure with contributeAliasOverride with bind: java.lang.IllegalStateException: Construction of service 'AliasOverrides' has failed due to recursion: the service depends on itself in some way. Please check org.apache.tapestry5.internal.services.AliasManagerImpl(Logger, Collection) (at AliasManagerImpl.java:32) via org.apache.tapestry5.services.TapestryModule.bind(ServiceBinder) (at TapestryModule.java:251) for references to another service that is itself dependent on service 'AliasOverrides'. decorateClientInfrastructure without contributeAliasOverride without bind: java.lang.IllegalStateException: Construction of service 'ClientInfrastructure' has failed due to recursion: the service depends on itself in some way. Please check org.apache.tapestry5.internal.services.ClientInfrastructureImpl(SymbolSource , AssetSource, ThreadLocale) (at ClientInfrastructureImpl.java:64) via org.apache.tapestry5.services.TapestryModule.bind(ServiceBinder) (at TapestryModule.java:251) for references to another service that is itself dependent on service 'ClientInfrastructure'. decorateClientInfrastructure without contributeAliasOverride with bind: java.lang.RuntimeException: Service interface org.apache.tapestry5.services.ClientInfrastructure is matched by 2 services: ClientInfrastructure, MyClientInfrastructure. Automatic dependency resolution requires that exactly one service implement the interface. buildMyClientInfrastructure with contributeAlias: java.lang.IllegalStateException: Construction of service 'Alias' has failed due to recursion: the service depends on itself in some way. Please check org.apache.tapestry5.services.TapestryModule.buildAlias(Logger, String, AliasManager, Collection) (at TapestryModule.java:325) for references to another service that is itself dependent on service 'Alias'. buildMyClientInfrastructure without contributeAlias: java.lang.RuntimeException: Service interface org.apache.tapestry5.services.ClientInfrastructure is matched by 2 services: ClientInfrastructure, MyClientInfrastructure. Automatic dependency resolution requires that exactly one service implement the interface. buildMyClientInfrastructure with contributeAliasOverrides: java.lang.IllegalStateException: Construction of service 'AliasOverrides' has failed due to recursion: the service depends on itself in some way. Please check org.apache.tapestry5.internal.services.AliasManagerImpl(Logger, Collection) (at AliasManagerImpl.java:32) via org.apache.tapestry5.services.TapestryModule.bind(ServiceBinder) (at TapestryModule.java:251) for references to another service that is itself dependent on service 'AliasOverrides'. Errors were pretty similar, and this was about as many permutations as I could imagine. Can anyone shed some light towards a reasonable way to decorate the ClientInfrastructure so I can swap the blackbird.js? I find it hard to believe decoration is this complicated. Thanks, Rich Jim O'Callaghan wrote: Rich, I'm on T5.2.0 so the code has been updated accordingly - looking through my file history, I have: public static MyClientInfrastructure buildMyClientInfrastructure(@InjectService(ClientInfrastructure) ClientInfrastructure original, @InjectService(AssetSource) AssetSource assetSource) { return new MyClientInfrastructure(original, assetSource); } public static void contributeAlias( @InjectService(MyClientInfrastructure) ClientInfrastructure cInfraService, org.apache.tapestry5.ioc.ConfigurationAliasContribution configuration) { configuration.add(AliasContribution.create(ClientInfrastructure.class, cInfraService)); } ... in my AppModule. It's been a while since I looked at it so can't say for sure but perhaps this is more in line with what is required for T5.1.0.x. I think ClientInfrastructure is deprecated in T5.2.0. Hope this is of use. Regards, Jim. -Original Message- From: Rich [mailto:rich...@moremagic.com] Sent: 22 July 2010 16:32 To: Tapestry users Subject: Re: blackbird.js and IE breaking fixed CSS background image Hi, attempt 6 at getting
RE: redirecting from an ajax event listener
As an alternative I think you contribute your own access control dispatcher: AppModule.java . . . public void contributeMasterDispatcher( OrderedConfigurationDispatcher configuration, @InjectService(AccessControlDispatcher) Dispatcher accessController) { configuration.add(AccessControlDispatcher, accessController, before:ComponentEvent); } ... and just have: . . . if (request.isXHR()) { boolean noSession = (request.getSession(false)) == null ? true : false; if (noSession){ OutputStream os = response.getOutputStream(application/json;charset=UTF-8); os.write({\script\:\window.location.reload();\}.getBytes()); os.flush(); return true; } ... in its dispatch method, so the timeout scenario is checked when AJAX methods trigger a request, and redirect to your standard timeout page? This was a solution suggested previously on this list. Regards, Jim. -Original Message- From: Paul Stanton [mailto:p...@mapshed.com.au] Sent: 21 July 2010 08:12 To: Tapestry users Subject: Re: redirecting from an ajax event listener Thanks Kalle, The tynamo plugin does exactly what i need. regards, paul. Kalle Korhonen wrote: You can implement onException() to catch exceptions thrown from page event handlers (see http://tapestry.apache.org/tapestry5.1/guide/event.html), or, though I know you don't like this, for handling known exceptions in a more generic manner you could use Tynamo's tapestry-exceptionpage module (http://tynamo.org/tapestry-exceptionpage+guide) - the module handles ajax requests as well. Kalle On Tue, Jul 20, 2010 at 8:32 PM, Paul Stanton p...@mapshed.com.au wrote: We have an ajax intensive project for which we need to better handle problems such as session timeouts. Most of our ajax event handlers will return a MultizoneUpdate, and currently will run into a NullPointerException if the session has timed out. Instead what I'd like these listeners to do is either forward to an error page (ie session timed out page) or attempt to reload the current page. I'd also prefer to not have to implement this for every listener, but utilise 'onActivate' so that I don't need to copy and paste code into every event listener. Does anyone have any tips for achieving this? p. - 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
non thread safe access to session
I have a service (service A) that creates some sample data, consisting of a reasonably detailed object graph where all the relations are cascaded. This service makes use of another service (service B) which manages the save of the parent entity. Service B has the hibernate session injected at bind time. I have service A called in a finite loop in the setup (@SetupRender) method of a scratch page I use for some dev testing. To cut a long story short, when playing around with the sample data creation, I found I was getting some non thread safe access to session type messages when I launched a second user session and hit the same scratch page. This doesn't happen if I mark the relevant method in service A as synchronized, but this brings with it a significant performance penalty. I'm a little concerned I may have a situation where in a high traffic scenario multiple users hitting the same service methods may get the same error. Can anyone reiterate the best practise approach for marking member fields / injected parameters as final or point me to a relevant posting on it around here - I'm sure something about marking things as final was brought up on the list not so long ago but for the life of me I can't find it. I'm not sure if it's relevant but I'm using T5.2.0-SNAPSHOT. Perhaps this isn't Tapestry relevant at all and is down to my use of Hibernate. Thanks. Regards, Jim.
RE: non thread safe access to session
Hi Thiago, I'm talking about the hibernate session - I'm injecting it into the constructor of Service B at bind time. I thought Tapestry would treat the service as a thread safe singleton and control access to method calls on it accordingly? Am I getting confused on that? Regards, Jim. -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: 21 July 2010 17:38 To: Tapestry users Subject: Re: non thread safe access to session Are you talking about Tapestry sessions or Hibernate sessions? Hibernate sessions should never be used at the same time by more than one thread. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informa��o Ltda. http://www.arsmachina.com.br - 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: non thread safe access to session
Yep Thiago, it's Tapestry-Hibernate creating the sessions. My situation might be a little contrived, but I'm concerned it might happen to end-users, as I don't fully understand why it's happening. Regards, Jim. -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: 21 July 2010 18:22 To: Tapestry users Subject: Re: non thread safe access to session On Wed, 21 Jul 2010 13:58:15 -0300, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: Hi Thiago, Hi, Jim! I'm talking about the hibernate session - I'm injecting it into the constructor of Service B at bind time. I thought Tapestry would treat the service as a thread safe singleton and control access to method calls on it accordingly? Tapestry-IoC doesn't synchronize method calls. How are you building the sessions? Tapestry-Hibernate? -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informa��o Ltda. http://www.arsmachina.com.br - 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: blackbird.js and IE breaking fixed CSS background image
See this post for a possible workaround: http://markmail.org/message/fsu22hjz4bxvpczb?q=list:org%2Eapache%2Etapestry% 2Eusers+MyClientInfrastructure I don't know why this hasn't been raised more often as an issue with blackbird and IE. I think blackbird has been removed from T5.2.0 in favour of an internal solution to logging client side messages. Regards, Jim. -Original Message- From: Rich [mailto:rich...@moremagic.com] Sent: 20 July 2010 17:25 To: users@tapestry.apache.org Subject: blackbird.js and IE breaking fixed CSS background image Hi, I'm aware blackbird.js is not directly Tapestry code, but I'm looking for advice on how to handle an issue with the blackbird.js file. I had been having problems with getting the fixed background image in my tapestry webapp to stay fixed in Internet Explorer. I'd given up searching for a solution (it appeared to be beyond the CSS I was using) until someone recently pointed out that a line of code in blackbird.js breaks the fixed background for IE. I went and re-jared the tapestry-core with the line of code commented out and it now works in internet explorer. However, having to manage my own version of the tapestry-core jar to fix an IE bug does not seem like a good idea. Is there a way to exclude blackbird from my projects all together? Or maybe there is some other, better solution? Regards, Rich - 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: blackbird.js and IE breaking fixed CSS background image
Hi Rich, Yep same guy, guilty as charged. This may not be the best solution, you may get some better advice from some of the more experienced Tapestry people on the forum, but it's the approach I used. The post I included earlier was indeed about just ensuring a specific order was enforced in the js includes for the ClientInfrastructure, but I have used a variation on it to include my local version of blackbird.js, rather than the one that comes with T5.1.0.5. The code is as follows: AppModule.java: public ClientInfrastructure decorateClientInfrastructure(ClientInfrastructure original, @InjectService(AssetSource) AssetSource assetSource) { return new MyClientInfrastructure(original, assetSource); } MyClientInfrastructure.java: public class MyClientInfrastructure implements ClientInfrastructure { @Inject AssetSource assetSource; ClientInfrastructure clientInfrastructure; List javascriptStack = new ArrayList(); @SuppressWarnings(unchecked) public MyClientInfrastructure(ClientInfrastructure clientInfrastructure, AssetSource assetSource) { this.assetSource = assetSource; this.clientInfrastructure = clientInfrastructure; // Add jQuery assets in ahead of Prototype - IE8 was burping otherwise, despite jQuery.noConflict being set javascriptStack.add(assetSource.getAsset(null, context:/scripts/jquery-1.4.2.min.js, null)); javascriptStack.add(assetSource.getAsset(null, context:/scripts/jquery-ui-1.8.1.custom.min.js, null)); List assets = this.clientInfrastructure.getJavascriptStack(); for (Iterator i = assets.iterator(); i.hasNext();) { Asset asset = (Asset) i.next(); if (!asset.toString().contains(blackbird.js)) { javascriptStack.add(asset); } else { javascriptStack.add(assetSource.getAsset(null, context:/scripts/blackbird_1_0/blackbird.js, null)); } } } public ListAsset getJavascriptStack() { //return clientInfrastructure.getJavascriptStack(); return javascriptStack; } public ListAsset getStylesheetStack() { return clientInfrastructure.getStylesheetStack(); } } I have my local blackbird.js physically located in the project under src\main\webapp\scripts\blackbird_1_0\blackbird.js. Obviously the jQuery ordering is not relevant to your specific problem, just the replacement of blackbird.js is. Probably could be more elegant/efficient, but it's just called once at startup so I wasn't too concerned about it. Hope this get things working for you and I don't get chewed by the more enlightened forum members!. Regards, Jim. -Original Message- From: Rich [mailto:rich...@moremagic.com] Sent: 20 July 2010 19:41 To: Tapestry users Subject: Re: blackbird.js and IE breaking fixed CSS background image Ah, thanks that seems like a start, but I'm having some issues with it. The call to the constructor in the decorator method throws a NullPointerException, it seems because there is an issue with the ClientInfrastructure passed into the decorator method. Also, the logic in your example seems to be based around having one javascript library file supersede another in the stack order. How will this apply to getting my CSS to work? Should I pass in a second, fixed version of the blackbird.js to the javascriptStack after the original is contributed? Also, how exactly is an asset referenced when adding to the javascriptStack list, as a path like generic assets/package/name/asset.filetype ? I'm guessing you were the guy who mentioned the blackbird issue in the first place since your name is also Jim. Thanks for the help so far. Thanks, Rich Jim O'Callaghan wrote: See this post for a possible workaround: http://markmail.org/message/fsu22hjz4bxvpczb?q=list:org%2Eapache%2Etapestry% 2Eusers+MyClientInfrastructure I don't know why this hasn't been raised more often as an issue with blackbird and IE. I think blackbird has been removed from T5.2.0 in favour of an internal solution to logging client side messages. Regards, Jim. -Original Message- From: Rich [mailto:rich...@moremagic.com] Sent: 20 July 2010 17:25 To: users@tapestry.apache.org Subject: blackbird.js and IE breaking fixed CSS background image Hi, I'm aware blackbird.js is not directly Tapestry code, but I'm looking for advice on how to handle an issue with the blackbird.js file. I had been having problems with getting the fixed background image in my tapestry webapp to stay fixed in Internet Explorer. I'd given up searching for a solution (it appeared to be beyond the CSS I was using) until someone recently pointed out that a line of code in blackbird.js breaks the fixed background for IE. I went and re-jared the tapestry-core with the line of code commented out and it now works in internet explorer
RE: Best practise for bloated utility methods location
Pablo, Thiago, Thanks for the responses. Thiago, the idea of the utility methods also being available outside a page is a good enough reason for me to move them into a service. Thanks for the pointer. Regards, Jim. -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: 19 July 2010 15:59 To: Tapestry users Subject: Re: Best practise for bloated utility methods location On Mon, 19 Jul 2010 11:24:20 -0300, Jim O'Callaghan j...@peritussolutions.com wrote: I have a 'base' Page class that has behaviour used throughout a large section of application pages, and is extended by them. It's starting to get a bit bloated with utility methods. Is it better practise / more efficient to extract these utility methods from the base page class and put them in a helper service, that can be injected into pages, or is there any advantage / disadvantage to either approach? Any first-hand experience of pros / cons of each approach? Thanks. I think the approach of coding utility methods in services is the best one. Services are more flexible than pages, and methods in services can be used outside pages as well. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informa��o Ltda. http://www.arsmachina.com.br - 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: t:grid, inPlace and rowIndex
Thanks Ville, that's very helpful. I think I'll just stick with my known object ref as the key and do a match on the list through iteration - saves some messing about. Ideally what I wanted from the grid is an index / ref that survives sorting (though has predictable behavior for additions / deletions) so it can be used for a get(index) on the source list - something like an originalIndex as opposed to a currentDisplayContextIndex - I'm would guess augmenting the model with that would be trivial but I'm aware these are general purpose components and can't really be expected to fit every specific requirement. In my case the object refs are a compound key, and when passed through an activation context require coercion, and then a check using key.equals(otherKey) per list entry until matched, which is just a few extra cpu cycles I could ideally get rid of. As you say the cost shouldn't be too much. The map backed grid seems too much square peg round hole for me. Thanks for the suggestions all the same. Regards, Jim. -Original Message- From: Ville Virtanen [mailto:ville.virta...@cerion.fi] Sent: 18 July 2010 17:56 To: users@tapestry.apache.org Subject: RE: t:grid, inPlace and rowIndex Hi, you can calculate the exact index of the row by injecting the grid to the page and calculating it by using methods (getRowsPerPage() x getCurrentPage()) + index. (http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/corelib/components/Grid.html) The index of course changes when you reorder the list. Also, this index should be updated when doing inPlace update as the index changes depending in which place you insert the new row. Should the list that contains the entities be a map instead? (MapKey, Entity) You may have to implement your own GridDataSource that uses the map, as there is no automatic wrapping for that datatype. (See: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/grid/CollectionGridDataSource.java?revision=964086view=markup for reference implementation for collections.) The cost to iterate the list when doing deletes shouldn't be that much performance wise - and if you have so many entities that the cost is too much you should consider implementing special GridDataSource anyway. - Ville jc1001 wrote: Hi Thiago, I've tried that - but the index is the position within the current 'page' of entries in the grid, i.e. zero is the first entry on page one, and also on page 2 etc., but also, the inPlace method won't work as the index can't be updated because some render phase is skipped. I guess what I'm looking for is some initial index position within the grid (list) entries that is not updated during sorting, and so has no need to be updated during an inPlace update. Regards, Jim. -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: 15 July 2010 22:49 To: Tapestry users Subject: Re: t:grid, inPlace and rowIndex On Thu, 15 Jul 2010 18:25:03 -0300, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: I'm using the grid to display a selection where one of the cells is an ActionLink that currently passes the entity key for use in a detail screen for via the context, Have yout tried passing the index as the context for your ActionLink? -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informa??o Ltda. http://www.arsmachina.com.br - 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 -- View this message in context: http://old.nabble.com/t%3Agrid%2C-inPlace-and-rowIndex-tp29177730p29198096.html Sent from the Tapestry - User mailing list archive at Nabble.com. - 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: t:grid, inPlace and rowIndex
Hi Thiago, I've tried that - but the index is the position within the current 'page' of entries in the grid, i.e. zero is the first entry on page one, and also on page 2 etc., but also, the inPlace method won't work as the index can't be updated because some render phase is skipped. I guess what I'm looking for is some initial index position within the grid (list) entries that is not updated during sorting, and so has no need to be updated during an inPlace update. Regards, Jim. -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: 15 July 2010 22:49 To: Tapestry users Subject: Re: t:grid, inPlace and rowIndex On Thu, 15 Jul 2010 18:25:03 -0300, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: I'm using the grid to display a selection where one of the cells is an ActionLink that currently passes the entity key for use in a detail screen for via the context, Have yout tried passing the index as the context for your ActionLink? -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informa��o Ltda. http://www.arsmachina.com.br - 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: [Tapestry Central] Everyone out of the Pool! Tapestry goes singleton!
This looks very interesting Howard. Is this something that is going into T5.2.0 sometime soon or is it already present? Regards, Jim. -Original Message- From: Howard [mailto:hls...@gmail.com] Sent: 15 July 2010 00:31 To: users@tapestry.apache.org Subject: [Tapestry Central] Everyone out of the Pool! Tapestry goes singleton! Tapestry applications are inherently stateful: during and between requests, information in Tapestry components, value stored in fields, stick around. This is a great thing: it lets you program a web application in a sensible way, using stateful objects full of mutable properties and methods to operate on those properties. It also has its downside: Tapestry has to maintain a pool of page instances. And in Tapestry, page instances are big: a tree of hundreds or perhaps thousands of interrelated objects: the tree of Tapestry structural objects that forms the basic page structure, the component and mixin objects hanging off that tree, the binding objects that connect parameters of components to properties of their containing component, the template objects that represents elements and content from component templates, and many, many more that most Tapestry developers are kept unawares of. This has proven to be a problem with biggest and busiest sites constructed using Tapestry. Keeping a pool of those objects, checking them in and out, and discarded them when no longer needed is draining needed resources, especially heap space. So that seems like an irreconcilable problem eh? Removing mutable state from pages and components would turn Tapestry into something else entirely. On the other hand, allowing mutable state means that applications, especially big complex applications with many pages, become memory hogs. I suppose one approach would be to simply create a page instance for the duration of a request, and discard it at the end. However, page construction in Tapestry is very complicated and although some effort was expended in Tapestry 5.1 to reduce the cost of page construction, it is still present. Additionally, Tapestry is full of small optimizations that improve performance ... assuming a page is reused over time. Throwing away pages is a non-starter. So we're back to square one ... we can't eliminate mutable state, but (for large applications) we can't live with it either. Tapestry has already been down this route: the way persistent fields are handled gives the illusion that the page is kept around between requests. You might think that Tapestry serializes the page and stores the whole thing in the session. In reality, Tapestry is shuffling just the individual persistent field values in to and out of the HttpSessio. To both the end user and the Tapestry developer, it feels like the entire page is live between requests, but it's a bit of a shell game, providing an equivalent page instance that has the same values in its fields. What's going on in trunk right now is extrapolating that concept from persistent fields to all mutable fields. Every access to every mutable field in a Tapestry page is converted, as part of the class transformation process, into an access against a per-thread Map of keys and values. The end result is that a single page instance can be used across threads without any synchronization issues and without any conflicts. Each thread has its own per-thread Map. This idea was suggested in years past, but the APIs to accomplish it (as well as the necessary meta-programming savvy) just wasn't available. However, as a side effect of rewriting and simplifying the class transformation APIs in 5.2, it became very reasonable to do this. Let's take an important example: handling typical, mutable fields. This is the responsibility of the UnclaimedFieldWorker class, part of Tapestry component class transformation pipeline. UnclaimedFieldWorker finds fields that have not be claimed by some other part of the pipeline and converts them to read and write their values to the per-thread Map. A claimed field may store an injected service, asset or component, or be a component parameter. public class UnclaimedFieldWorker implements ComponentClassTransformWorker { private final PerthreadManager perThreadManager; private final ComponentClassCache classCache; static class UnclaimedFieldConduit implements FieldValueConduit { private final InternalComponentResources resources; private final PerThreadValueObject fieldValue; // Set prior to the containingPageDidLoad lifecycle event private Object fieldDefaultValue; private UnclaimedFieldConduit(InternalComponentResources resources, PerThreadValueObject fieldValue, Object fieldDefaultValue) { this.resources = resources; this.fieldValue = fieldValue; this.fieldDefaultValue = fieldDefaultValue; } public Object get() { return fieldValue.exists() ? fieldValue.get() : fieldDefaultValue; } public void set(Object newValue) { fieldValue.set(newValue); // This catches the case where the instance initializer method sets a value
t:grid, inPlace and rowIndex
Is there an in-built solution for a row index in the t:grid that survives sorting and works with inPlace=true - I'm currently getting the error Component X/Y/Zs is not rendering, so render variable 'rowIndex' may not be updated upon sorting. I'm trying to get something that tells me the current index of the item in a list the grid is displaying, and need the index to *not* be updated during sorting. Is this only possible with a representation on the entity the grid is displaying? Thanks, Jim.
RE: t:grid, inPlace and rowIndex
I'm using the grid to display a selection where one of the cells is an ActionLink that currently passes the entity key for use in a detail screen for via the context, but I want to be able to pass the entry's list index instead of the key, to avoid a second iteration through the list (doing a match on the key equality), ex. To be able to do list.get(n) rather than for (Iterator iter = list.iterator(); iter.hasnext();){if x.key.equals(y.key) then ... I previously had an index on the persisted object the list contains, but this is messy for inserts / deletes ... I can work around it but if there was something built-in it would be handy. Regards, Jim. -Original Message- From: robert zeigler [mailto:robert.zeig...@gmail.com] On Behalf Of Robert Zeigler Sent: 15 July 2010 22:12 To: Tapestry users Subject: Re: t:grid, inPlace and rowIndex What is it you're trying to accomplish, specifically? Ie, why do you need the row index when you're not rendering? Robert On Jul 15, 2010, at 7/154:07 PM , Jim O'Callaghan wrote: Is there an in-built solution for a row index in the t:grid that survives sorting and works with inPlace=true - I'm currently getting the error Component X/Y/Zs is not rendering, so render variable 'rowIndex' may not be updated upon sorting. I'm trying to get something that tells me the current index of the item in a list the grid is displaying, and need the index to *not* be updated during sorting. Is this only possible with a representation on the entity the grid is displaying? Thanks, Jim. - 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: Conditional class for body
Thiago, Pablo, Thanks for the replies. I'll try one of those methods. Regards, Jim. -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: 13 July 2010 17:11 To: Tapestry users Subject: Re: Conditional class for body On Tue, 13 Jul 2010 13:01:35 -0300, Jim O'Callaghan jc1000...@yahoo.co.uk wrote: Thanks for the quick response Michael. The reason the CSS class name needs to be present in the tml is that I am not in control of the CSS / overall look of the app, and some of the CSS / front-end people may not necessarily know where to look within the java code. I guess if no other solutions are apparent I can use the property approach. Just make your Java method look for the class name in some appropriate place (properties file, etc). -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informa��o Ltda. http://www.arsmachina.com.br - 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
Conditional class for body
I've run in to a situation where the CSS class used for the body of my layout.tml varies depending on certain conditions. I've tried using variously: body t:class=t:if test=xyzTest negate=true'xyzClass'/t:if Or: t:if test= xyzTest body class='xyzClass' p:else body / p:else /t:if . and several other permutations without success - I am getting variations on parse errors with the general theme that class parameters cannot contain quotes, or that body tag must be accompanied by closing body tag etc. Can anyone suggest a working approach to this simple use case? It's important to be able to have the CSS class explicitly in the tml, and not buried in a java property. Thanks, Jim.
RE: Conditional class for body
Thanks for the quick response Michael. The reason the CSS class name needs to be present in the tml is that I am not in control of the CSS / overall look of the app, and some of the CSS / front-end people may not necessarily know where to look within the java code. I guess if no other solutions are apparent I can use the property approach. Regards, Jim. -Original Message- From: Michael Gentry [mailto:mgen...@masslight.net] Sent: 13 July 2010 16:48 To: Tapestry users Subject: Re: Conditional class for body Hi Jim, I've used class=${xyzClass} before in the past. Then implemented getXyzClass() in my .java. You said it was important to not be in the Java for you and had to be in the TML? Why is it that important when both would require a WAR redeploy in a real production environment? mrg On Tue, Jul 13, 2010 at 11:41 AM, Jim O'Callaghan j...@peritussolutions.com wrote: I've run in to a situation where the CSS class used for the body of my layout.tml varies depending on certain conditions. I've tried using variously: body t:class=t:if test=xyzTest negate=true'xyzClass'/t:if Or: t:if test= xyzTest body class='xyzClass' p:else body / p:else /t:if . and several other permutations without success - I am getting variations on parse errors with the general theme that class parameters cannot contain quotes, or that body tag must be accompanied by closing body tag etc. Can anyone suggest a working approach to this simple use case? It's important to be able to have the CSS class explicitly in the tml, and not buried in a java property. Thanks, Jim. - 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