Re: How to add our project into Tapestry Applications page
On Tue, 10 Jun 2014 04:08:08 -0300, Andrey wrote: Hello tapestry community, Hi! Our project went into public pre-production phase and we want it to be added on Tapestry Applications page ( http://tapestry.apache.org/applications.html). How can we do it? You can either ask for edition permission or just ask here, providing the title, description, URL and screenshot. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5.4] jQuery-File-Upload integration
I did an implementation of the jquery fileupload at work. AFAIR its modules are AMD compliant so it is pretty straight forward to integrate. Just require them as you normally would with modules. -- Chris On Tue, Jun 10, 2014 at 6:48 PM, Ilya Obshadko wrote: > Did anybody successfully implement > https://github.com/blueimp/jQuery-File-Upload on T5.4? > > I can't make dependencies work. > > - addModuleConfigurationCallback can't be used for component inside a Zone > - I have tried to contribute to ModuleManager, but it's getting too complex > and doesn't work either > - JavaScriptStack doesn't look like a solution here (is that correct by the > way?) > > Would appreciate any suggestions. Thanks! > > -- > Ilya Obshadko >
Re: Tree with different data types
Hi Lance, i will check it and give it a try. Thanks a lot. Eric Am 10.06.2014 20:34, schrieb Lance Java: Take a look here where two entity types are used to create a tree (Category and Item) http://tapestry-stitch.uklance.cloudbees.net/databasetreedemo Your nodes must be a common type but a single node can encapsulate multiple types. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Exception Handling
I am trying to have the Exception page shown in Tapestry when my GridDataSource throws an exception. How do i catch a ComponentEventException nad have Tapestry redirect to the Exception page. Your help is much appreciated! Here is the logs.. org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) Caused by: org.apache.tapestry5.runtime.ComponentEventException [at classpath:com/navicure/ui/admin/pages/incoming/IncomingFilesPage.tml, line 67] at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.processEventTriggering(ComponentPageElementImpl.java:1141) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$3100(ComponentPageElementImpl.java:61) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl$5.invoke(ComponentPageElementImpl.java:1062) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl$5.invoke(ComponentPageElementImpl.java:1059) at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74) ... 100 more Caused by: java.lang.NullPointerException at com.navicure.ui.admin.tables.FragmentDataSource.getAvailableRows(FragmentDataSource.java:91) at org.got5.tapestry5.jquery.internal.DefaultDataTableModel.getResponse(DefaultDataTableModel.java:243) at org.got5.tapestry5.jquery.internal.DefaultDataTableModel.sendResponse(DefaultDataTableModel.java:375) at org.got5.tapestry5.jquery.components.DataTable.onData(DataTable.java:128) at org.got5.tapestry5.jquery.components.DataTable.dispatchComponentEvent(DataTable.java) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:940) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.processEventTriggering(ComponentPageElementImpl.java:1117) ... 104 more Here is my object that implements ExceptionReporter package com.navicure.ui.admin.pages; import java.io.PrintWriter; import java.io.StringWriter; import java.util.Date; import org.apache.log4j.Logger; import org.apache.tapestry5.annotations.Log; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.ioc.annotations.Inject; import org.apache.tapestry5.services.ExceptionReporter; import org.apache.tapestry5.services.ajax.AjaxResponseRenderer; import org.apache.tapestry5.services.ajax.JavaScriptCallback; import org.apache.tapestry5.services.javascript.JavaScriptSupport; public class ExceptionReport implements ExceptionReporter { private static Logger log = Logger.getLogger(ExceptionReport.class); @Property private Date filterToDate; @Property private Throwable exception; @Inject private AjaxResponseRenderer ajaxResponseRenderer; @Property private String messageStackTrace; @Override public void reportException(Throwable exception) { this.exception = exception; log.error(exception); this.messageStackTrace = this.getStackMessageTrace(); } private String getStackMessageTrace() { StringWriter errors = new StringWriter(); exception.printStackTrace(new PrintWriter(errors)); return errors.toString(); } } - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tree with different data types
Take a look here where two entity types are used to create a tree (Category and Item) http://tapestry-stitch.uklance.cloudbees.net/databasetreedemo Your nodes must be a common type but a single node can encapsulate multiple types.
[T5.4] jQuery-File-Upload integration
Did anybody successfully implement https://github.com/blueimp/jQuery-File-Upload on T5.4? I can't make dependencies work. - addModuleConfigurationCallback can't be used for component inside a Zone - I have tried to contribute to ModuleManager, but it's getting too complex and doesn't work either - JavaScriptStack doesn't look like a solution here (is that correct by the way?) Would appreciate any suggestions. Thanks! -- Ilya Obshadko
Re: AjaxFormLoop losing field data with validation error while nested in form zone.
Sorry, forgot to mention my version, 5.4 beta-10 On Tue, Jun 10, 2014 at 11:52 AM, George Christman wrote: > Hi guys, I have an ajax from with a nested AjaxFormLoop. When ever there > is a validation error within the field, I lose the field data completely. > This does not happen when the form is not nested in a zone. Any idea what > might be causing this? > > Data to throw validation 12345678 > > Example code. > > > > source="person.phones" value="phone" encoder="encoder"> > validate="maxlength=7"/> > remove > > > > > > java > > void onValidateFromForm() { > > if(form.getHasErrors()) { > ajaxResponseRenderer.addRender("formZone", formZone); > } > } > > public ValueEncoder getEncoder() { > return new ValueEncoder() { > @Override > public String toClient(Phone v) { > Long id = v.getId(); > return id == null ? "-1" : id.toString(); > } > @Override > public Phone toValue(String toValue) { > Phone phone = null; > Long id = Long.parseLong(toValue); > > if (id > 0) { > phone = (Phone) session.get(Phone.class, id); > } > return phone == null ? new Phone() : phone; > } > }; > } > -- > George Christman > www.CarDaddy.com > P.O. Box 735 > Johnstown, New York > > -- George Christman www.CarDaddy.com P.O. Box 735 Johnstown, New York
AjaxFormLoop losing field data with validation error while nested in form zone.
Hi guys, I have an ajax from with a nested AjaxFormLoop. When ever there is a validation error within the field, I lose the field data completely. This does not happen when the form is not nested in a zone. Any idea what might be causing this? Data to throw validation 12345678 Example code. remove java void onValidateFromForm() { if(form.getHasErrors()) { ajaxResponseRenderer.addRender("formZone", formZone); } } public ValueEncoder getEncoder() { return new ValueEncoder() { @Override public String toClient(Phone v) { Long id = v.getId(); return id == null ? "-1" : id.toString(); } @Override public Phone toValue(String toValue) { Phone phone = null; Long id = Long.parseLong(toValue); if (id > 0) { phone = (Phone) session.get(Phone.class, id); } return phone == null ? new Phone() : phone; } }; } -- George Christman www.CarDaddy.com P.O. Box 735 Johnstown, New York
Re: [5.4.22] RequireJs custom path contribution - perhaps on Stacks or JavaScriptSupport
Could anyone suggest how to use addModuleConfigurationCallback method for partial page renders? Obvious use case is a component that acts as a wrapper around jQuery-Ajax-Upload library mentioned above. I need to use this component inside a Zone, but I can't use addModuleConfigurationCallback in rendering phase because it's not supported for partial renders. On Wed, Oct 9, 2013 at 6:29 AM, Lenny Primak wrote: > Voted > > On Oct 3, 2013, at 3:44 PM, Bård Magnus Kvalheim wrote: > > > Thanks Lenny, JIRA created > https://issues.apache.org/jira/browse/TAP5-2196 > > > > Please vote guys :) > > > > > > On Thu, Oct 3, 2013 at 8:02 PM, Lenny Primak > wrote: > > > >> +1. I can see lots of things needing this. JIRA please ill vote for it. > >> > >>> On Oct 3, 2013, at 1:33 AM, Bård Magnus Kvalheim > >> wrote: > >>> > >>> Hi folks. > >>> > >>> As part of 5.4 migration process we have some components that make use > of > >>> JQueryFileUpload, https://github.com/blueimp/jQuery-File-Upload . > >>> > >>> This library uses the factory approach for defining the modules to work > >> in > >>> both AMD and non AMD environments. > >>> Internally it handles loading of required modules, but work with paths. > >>> (And does not try to load from a fixed directory structure). > >>> > >>> So I think I need to specify things like > >>> requirejs.config({ > >>> paths: { > >>>'jquery.fileupload': > >>> '../library/jquery.fileupload/jquery.fileupload', //path to file > >>>'jquery.iframe-transport': > >>> '../library/jquery.fileupload/jquery.iframe-transport', //path to file > >>>'jquery.ui.widget': > >>> '../library/jquery.fileupload/vendor/jquery.ui.widget', //path to file > >>> } > >>> }); > >>> > >>> Is it possible to add path configuration with tapestry? > >>> > >>> One possibility could be to configure shims through tapestry's > >>> modulemanager, but that's for non-AMD scripts and is likely to cause > >>> problems. > >>> Also the shim config would be global (all pages) - which I'd like to > >> avoid > >>> as well. > >>> > >>> > >>> In 5.3 I've used a JQueryFileUpload to define all the deps like so.. > >>> public List getJavaScriptLibraries() { > >>> List ret = new ArrayList(); > >>> > >> > ret.add(assetSource.getContextAsset("jquery-file-upload/7.2.1/js/vendor/jquery.ui.widget.js", > >>> null)); > >>> > >> > ret.add(assetSource.getContextAsset("jquery-file-upload/extra/js/load-image.min.js", > >>> null)); > >>> > >> > ret.add(assetSource.getContextAsset("jquery-file-upload/extra/js/canvas-to-blob.min.js", > >>> null)); > >>> > >> > ret.add(assetSource.getContextAsset("jquery-file-upload/7.2.1/js/jquery.iframe-transport.js", > >>> null)); > >>> > >> > ret.add(assetSource.getContextAsset("jquery-file-upload/7.2.1/js/jquery.fileupload.js", > >>> null)); > >>> > >> > ret.add(assetSource.getContextAsset("jquery-file-upload/7.2.1/js/jquery.fileupload-fp.js", > >>> null)); > >>> > >>> I thought it would be nice if it was possible somehow to contribute to > >>> requirejs configuration through stacks. > >>> That way they could be added to the requirejs config if the stack was > >> used. > >>> > >>> If it was a service (perhaps exposed through JavaScriptSupport) one > could > >>> also contribute on a page/component level..? > >>> > >>> I have no idea about the implications of this and if it's possible to > >>> accomplish, but could potentially help solving some more advanced use > >> cases. > >>> > >>> In any case I do need to find a solution pretty soon, so let me know if > >> you > >>> have any ideas or suggestions. > >>> > >>> Thanks > >>> Magnus > >> > >> - > >> 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 > > -- Ilya Obshadko
Tree with different data types
Hi all, is it possible to use different data types for the top and sublevel nodes of a tree component? The adapters type parameter seems to lead to the restriction, that top and sub level nodes must by of same type. Best regards Eric - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
[T5.4] Does exanpe-t5-lib work with Tapestry 5.4 ?
I am using exanpe-t5-lib to include some google maps on a page in Tapestry 5.3 and want to upgrade my app to 5.4. exanpe-t5-lib version 1.3.0-SNAPSHOT from the master branch caused problems starting my app so I have checked out branch br_5.4 from github exanpe/exanpe-t5-lib (version 2.0.0-SNAPSHOT). Now when my app renders the page containing the google map it doesn't include all the javascript files. I have added yahoo-dom-event.js because it was missing some YAHOO features. Now I get a javascript error RequireJS error: require: google.maps.InfoWindow is not a constructor at console.js (line 104) Regards Tim signature.asc Description: Message signed with OpenPGP using GPGMail
[5.4-beta-10] providedChecksum is always different from the actualChecksum for a specific asset
I places an asset file in my *META-INF/assets/js* folder beneath my resources folder This file name is *jquey.min.map* (It doesn't end with a .js) I made sure multiple times that the asset is in place and that its even transferred to maven's target/classes folder, but I'm still facing an issue that its not found. I debugged tapestry's code and found that the following method always returns *false* org.apache.tapestry5.internal.services.ResourceStreamerImpl.streamResource(StreamableResource, > String, Set) Exactly out of this boolean check if (providedChecksum.length() > 0 && > !providedChecksum.equals(actualChecksum)){ > return false; > } The *providedChecksum* and *actualChecksum* are always different. I tried to debug more and found that the checksum in the asset's URL doesn't match the actualChecksum value. Here the URL's checksum was *z24c89e49* while it was expected to be *764b65d5* http://localhost:8080/adminlte/assets/meta/*z24c89e49*/js/jquery.min.map So manually I tried this URL http://localhost:8080/adminlte/assets/meta/*764b65d5*/js/jquery.min.map But then it didn't work either and the *actualChecksum* had another different checksum !...so I manually tried the new *actualChecksum* http://localhost:8080/adminlte/assets/meta/*1d517a92*/js/jquery.min.map And it worked !! I tried debugging again from the beginning and I had the same scenario going. A considerable change I've made is that I disabled the built-in bootstrap module configuration.override(SymbolConstants.BOOTSTRAP_ROOT, > "classpath:/META-INF/assets"); ...and found that tapestry was looking for some files that I didn't have like *transition.js* but I can't remember if it asked for more new files. But I know that I created an empty file called *transtion.js* empty, and I renamed bootstrap's JS and CSS file to be *bootstrap.css* and *bootstrap.js* instead of the template's original *bootstrap.min.css* and *bootstrap.min.js* (I had to fix their names in Layout.java too) I can't remember exactly the changed files because the template I'm trying to apply using tapestry has numerous files. How further can investigate this behavior ? Did I override disable Tapestry's bootstrap in a wrong way ? *-* *Muhammad Gelbana* http://www.linkedin.com/in/mgelbana
Re: [t5.4-beta-10] java.lang.NullPointerException: Unable to delegate method invocation to property 'response'
I've just read a link you sent before, this link: http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/META-INF-assets-in-5-4-td5714677.html I understood that Tapestry should throw an exception explaining that I should place my asset in "META-INF/assets" folder but this isn't the case. I also don't think that's clear enough though because META-INF folders are usually placed next to WEB-INF folder in the webapp directory, not in the classpath. *-* *Muhammad Gelbana* http://www.linkedin.com/in/mgelbana On Mon, Jun 9, 2014 at 10:59 PM, Muhammad Gelbana wrote: > I had these images references this way ** > while I should've had them referenced this way * src="${asset:img/avatar.png}" />* > > Thank you Geoff > > *-* > *Muhammad Gelbana* > http://www.linkedin.com/in/mgelbana > > > On Mon, Jun 9, 2014 at 9:33 PM, Muhammad Gelbana > wrote: > >> Sorry I couldn't reply earlier. This is the statement at line 116: >> (BTW, I created a new maven project using the quickstart archetype for >> 5.4-beta-10 and didn't modify anything in the code except that: >> >>1. I commented an event handler in the *Index.java* file >>2. Removed all the content in *Index.tml* except the basic tags (i.e. >>html) since all the static content is displayed in the *Layout.tml* >>file because I'm still testing. I tend to move forward bit by bit with >>tapestry so when I weird exception is thrown, I can at least guess what >>exactly did I do wrong. >> >> >> /** >>> * This is a service definition, the service will be named >>> "TimingFilter". The interface, >>> * RequestFilter, is used within the RequestHandler service >>> pipeline, which is built from the >>> * RequestHandler service configuration. Tapestry IoC is responsible >>> for passing in an >>> * appropriate Logger instance. Requests for static resources are >>> handled at a higher level, so >>> * this filter will only be invoked for Tapestry related requests. >>> * >>> * >>> * Service builder methods are useful when the implementation is >>> inline as an inner class >>> * (as here) or require some other kind of special initialization. >>> In most cases, >>> * use the static bind() method instead. >>> * >>> * >>> * If this method was named "build", then the service id would be >>> taken from the >>> * service interface and would be "RequestFilter". Since Tapestry >>> already defines >>> * a service named "RequestFilter" we use an explicit service id >>> that we can reference >>> * inside the contribution method. >>> */ >>> public RequestFilter buildTimingFilter(final Logger log) >>> { >>> return new RequestFilter() >>> { >>> public boolean service(Request request, Response response, >>> RequestHandler handler) >>> throws IOException >>> { >>> long startTime = System.currentTimeMillis(); >>> try >>> { >>> // The responsibility of a filter is to invoke the >>> corresponding method >>> // in the handler. When you chain multiple filters >>> together, each filter >>> // received a handler that is a bridge to the next >>> filter. >>> return handle >>> >>> r.service(request, response); >>> //Line 116 << >>> >>> } finally >>> { >>> long elapsed = System.currentTimeMillis() - >>> startTime; >>> log.info(String.format("Request time: %d ms", >>> elapsed)); >>> } >>> } >>> }; >>> } >> >> >> *-* >> *Muhammad Gelbana* >> http://www.linkedin.com/in/mgelbana >> >> >> On Mon, Jun 9, 2014 at 10:17 AM, Geoff Callender < >> geoff.callender.jumpst...@gmail.com> wrote: >> >>> What's it doing at AppModule.java:116? >>> >>> On 9 Jun 2014, at 5:09 pm, Muhammad Gelbana wrote: >>> >>> > I'm trying to use a complicated bootstrap template that has numerous >>> dependencies. So its possible that I'm missing one. I've put my asssets in >>> META-INF/assets folders under my resources directory (i.e. source folder >>> for TML files.) >>> > >>> > Now I'm facing this exception and many more (The full console output >>> is attached). For instance consider the following stacktrace. First I see a >>> warning with the message "/lte/img/avatar2.png" then a strange exception >>> that I can't make anything out of. I checked that the file >>> "/lte/img/avatar2.png" exists in the mentioned path and it is. So how can I >>> resolve/trace this ? >>> > >>> > 2014-06-09 08:58:21.913:WARN::/lte/img/avatar2.png >>> > java.lang.NullPointerException: Unable to delegate method invocation >>> to property 'response' of >> RequestGlobals(org.apache.tapestry5.services.RequestGlobals)>, because the >>> property
How to add our project into Tapestry Applications page
Hello tapestry community, Our project went into public pre-production phase and we want it to be added on Tapestry Applications page ( http://tapestry.apache.org/applications.html). How can we do it? Best regards, Andrey.