Re: Wicket mail and pdf
Am 13.06.2013 12:53, schrieb Martin Grigorov: Hi, On Thu, Jun 13, 2013 at 1:48 PM, Piratenvisier hansheinrichbr...@yahoo.dewrote: Martin thank you for your instantanious answers, I tried the mailtemplate example changed resource.text to resource.pdf and after some research concerning the error I got included IPackageResourceGuard packageResourceGuard = getResourceSettings().**getPackageResourceGuard(); if (packageResourceGuard instanceof SecurePackageResourceGuard) { SecurePackageResourceGuard guard = (SecurePackageResourceGuard) packageResourceGuard; guard.addPattern(+*.pdf); } in the init method of the Application. I get the Document : !DOCTYPE html html head titleA template based on a page/title /head body !-- The next is dynamically generated -- Hello,spanBraun/span You receive this email because you are subscribed for our products. We just released a new version of product X. !-- This link is also dynamically generated -- Please download ita href=http://localhost:8080/** mailtemplate/wicket/resource/**org.apache.wicket.examples.** asemail.MailTemplate/resource.**pdfhttp://localhost:8080/mailtemplate/wicket/resource/org.apache.wicket.examples.asemail.MailTemplate/resource.pdf here/a! br/br/ Sincerely, The Marketing team /body /html and when I use the link I get the error: Problem accessing /mailtemplate/wicket/resource/** org.apache.wicket.examples.**asemail.MailTemplate/resource.**pdf. Reason: Unable to find resource What is still wrong ? I guess resource.pdf is not copied in target/classes/ folder by Maven. Check that resource.pdf is next to MailTemplate.class Thanks Martin it was excluded by pom. Am 11.06.2013 08:45, schrieb Martin Grigorov: Hi, At http://www.wicket-library.com/**wicket-examples-6.0.x/** mailtemplate/?0http://www.wicket-library.com/wicket-examples-6.0.x/mailtemplate/?0you can see an example of rendering the markup for a page, a panel and a resource. At http://markmail.org/message/**em4wqtsxhetu4skjhttp://markmail.org/message/em4wqtsxhetu4skjyou can see how to create PDF out of the produced HTML. On Tue, Jun 11, 2013 at 9:39 AM, Piratenvisier hansheinrichbr...@yahoo.de**wrote: Does anybody know some example example code to start with concerning email and pdf Thanks in advance Heiner Braun Am 10.06.2013 10:34, schrieb Martin Grigorov: Hi, If you use Wicket 6.7.0+ then you can use ComponentRenderer class to get the markup of any Wicket Page/Panel/Component. Then you can use the generated markup for mails and PDF creation. For PDF creation you can check https://github.com/flyingsaucerproject/flyingsaucerhttps://github.com/**flyingsaucerproject/**flyingsaucer https://github.**com/flyingsaucerproject/**flyingsaucerhttps://github.com/flyingsaucerproject/flyingsaucer . There is a mail in the users@ mail archives from the last few days by another user showing how to use FlyingSaucer's ITextRenderer. On Sat, Jun 8, 2013 at 8:39 PM, Piratenvisier**hansheinrichbrau** n...@yahoo.dehansheinrichbraun@**yahoo.dehansheinrichbr...@yahoo.de wrote: I wanted to integrate mail and pdf creation in my wicket application. Till now I manage this by sending a request to a cocoon-2.2.0 application. This is a good solution but because I see no upgrade way using my cocoon application and integrating newer versions of spring I am looking for an alternative. Heiner --**--**--** --**- To unsubscribe, e-mail: users-unsubscribe@wicket.apa**che.org http://apache.org** users-unsubscribe@**wicket.**apache.orghttp://wicket.apache.org users-unsubscribe@**wicket.apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org --** --**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apa**che.orghttp://apache.org users-unsubscribe@**wicket.apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DatePicker and DateTextField
Set the model object (the date) behind the DateTextField to 00:00:00 JJ.MM.. François Meillet Formation Wicket - Développement Wicket Le 14 juin 2013 à 07:37, christoph.ma...@t-systems.com a écrit : Hello, how is the DatePicker binded tot he DateTextfield? How is the picked date written in the Textfield? Is there a possiblilty to change this? When the DatePicker have the pattern dd.MM. there is no problem. But I want the full timestamp with this pattern HH:mm:ss dd.MM. because the User should be able to change the time. I need one DateTextField because the Client and the server are in different timezones. This works fine. The only problem is when I pick a day the DatePicker writes HH:mm:ss 14.06.2013. But it should be 00:00:00 14.06.2013 for default. Is there anyone who could help? Mit freundlichen Grüßen Christoph Manig Systems Engineer T-Systems International GmbH Systems Integration - SC Travel, Transport Logistics Hoyerswerdaer Str. 18 01099 Dresden tel.: +49 (0) 351 / 8152 - 188 fax:+49 (0) 351 / 8152 - 209 email: christoph.ma...@t-systems.com
AW: DatePicker and DateTextField
Do you mean it like this: DateTextField txtDatumVon = new DateTextField(txtDatumVon, new PatternDateConverter(HH:mm:ss dd.MM.,true)); String date = HH:mm:ss dd.MM.; try { txtDatumVon.setModelObject(new SimpleDateFormat(00:00:00 dd.MM.).parse(date)); } catch (ParseException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } This didn't work :( Did I do something wrong? Can you give me an example? Mit freundlichen Grüßen Christoph Manig Systems Engineer T-Systems International GmbH Systems Integration - SC Travel, Transport Logistics Hoyerswerdaer Str. 18 01099 Dresden tel.: +49 (0) 351 / 8152 - 188 fax:+49 (0) 351 / 8152 - 209 email: christoph.ma...@t-systems.com -Ursprüngliche Nachricht- Von: Francois Meillet [mailto:francois.meil...@gmail.com] Gesendet: Freitag, 14. Juni 2013 08:41 An: users@wicket.apache.org Betreff: Re: DatePicker and DateTextField Set the model object (the date) behind the DateTextField to 00:00:00 JJ.MM.. François Meillet Formation Wicket - Développement Wicket Le 14 juin 2013 à 07:37, christoph.ma...@t-systems.com a écrit : Hello, how is the DatePicker binded tot he DateTextfield? How is the picked date written in the Textfield? Is there a possiblilty to change this? When the DatePicker have the pattern dd.MM. there is no problem. But I want the full timestamp with this pattern HH:mm:ss dd.MM. because the User should be able to change the time. I need one DateTextField because the Client and the server are in different timezones. This works fine. The only problem is when I pick a day the DatePicker writes HH:mm:ss 14.06.2013. But it should be 00:00:00 14.06.2013 for default. Is there anyone who could help? Mit freundlichen Grüßen Christoph Manig Systems Engineer T-Systems International GmbH Systems Integration - SC Travel, Transport Logistics Hoyerswerdaer Str. 18 01099 Dresden tel.: +49 (0) 351 / 8152 - 188 fax:+49 (0) 351 / 8152 - 209 email: christoph.ma...@t-systems.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DatePicker and DateTextField
I use it in tho following way: new DateTextField(ToDay, new PropertyModelDate(ti, dateTo), HH:mm:ss dd.MM.); best regards Britta Landgraf Am 14.06.2013 09:20, schrieb christoph.ma...@t-systems.com: Do you mean it like this: DateTextField txtDatumVon = new DateTextField(txtDatumVon, new PatternDateConverter(HH:mm:ss dd.MM.,true)); String date = HH:mm:ss dd.MM.; try { txtDatumVon.setModelObject(new SimpleDateFormat(00:00:00 dd.MM.).parse(date)); } catch (ParseException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } This didn't work :( Did I do something wrong? Can you give me an example? Mit freundlichen Grüßen Christoph Manig Systems Engineer T-Systems International GmbH Systems Integration - SC Travel, Transport Logistics Hoyerswerdaer Str. 18 01099 Dresden tel.: +49 (0) 351 / 8152 - 188 fax: +49 (0) 351 / 8152 - 209 email: christoph.ma...@t-systems.com -Ursprüngliche Nachricht- Von: Francois Meillet [mailto:francois.meil...@gmail.com] Gesendet: Freitag, 14. Juni 2013 08:41 An: users@wicket.apache.org Betreff: Re: DatePicker and DateTextField Set the model object (the date) behind the DateTextField to 00:00:00 JJ.MM.. François Meillet Formation Wicket - Développement Wicket Le 14 juin 2013 à 07:37, christoph.ma...@t-systems.com a écrit : Hello, how is the DatePicker binded tot he DateTextfield? How is the picked date written in the Textfield? Is there a possiblilty to change this? When the DatePicker have the pattern dd.MM. there is no problem. But I want the full timestamp with this pattern HH:mm:ss dd.MM. because the User should be able to change the time. I need one DateTextField because the Client and the server are in different timezones. This works fine. The only problem is when I pick a day the DatePicker writes HH:mm:ss 14.06.2013. But it should be 00:00:00 14.06.2013 for default. Is there anyone who could help? Mit freundlichen Grüßen Christoph Manig Systems Engineer T-Systems International GmbH Systems Integration - SC Travel, Transport Logistics Hoyerswerdaer Str. 18 01099 Dresden tel.: +49 (0) 351 / 8152 - 188 fax:+49 (0) 351 / 8152 - 209 email: christoph.ma...@t-systems.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Dr. Britta Landgraf phone: +49 2461 61 5647 IEK-4 fax: +49 2461 61 5452 email: b.landg...@fz-juelich.de WWW: www.fz-juelich.de/iek/iek-4/ Forschungszentrum Juelich GmbH 52425 Juelich Sitz der Gesellschaft: Juelich Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498 Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender), Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt, Prof. Dr. Sebastian M. Schmidt - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: DatePicker and DateTextField
What ist i and the String toDate in your code? Mit freundlichen Grüßen Christoph Manig Systems Engineer T-Systems International GmbH Systems Integration - SC Travel, Transport Logistics Hoyerswerdaer Str. 18 01099 Dresden tel.: +49 (0) 351 / 8152 - 188 fax:+49 (0) 351 / 8152 - 209 email: christoph.ma...@t-systems.com -Ursprüngliche Nachricht- Von: Dr. Britta Landgraf [mailto:b.landg...@fz-juelich.de] Gesendet: Freitag, 14. Juni 2013 09:39 An: users@wicket.apache.org Betreff: Re: DatePicker and DateTextField I use it in tho following way: new DateTextField(ToDay, new PropertyModelDate(ti, dateTo), HH:mm:ss dd.MM.); best regards Britta Landgraf Am 14.06.2013 09:20, schrieb christoph.ma...@t-systems.com: Do you mean it like this: DateTextField txtDatumVon = new DateTextField(txtDatumVon, new PatternDateConverter(HH:mm:ss dd.MM.,true)); String date = HH:mm:ss dd.MM.; try { txtDatumVon.setModelObject(new SimpleDateFormat(00:00:00 dd.MM.).parse(date)); } catch (ParseException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } This didn't work :( Did I do something wrong? Can you give me an example? Mit freundlichen Grüßen Christoph Manig Systems Engineer T-Systems International GmbH Systems Integration - SC Travel, Transport Logistics Hoyerswerdaer Str. 18 01099 Dresden tel.: +49 (0) 351 / 8152 - 188 fax: +49 (0) 351 / 8152 - 209 email: christoph.ma...@t-systems.com -Ursprüngliche Nachricht- Von: Francois Meillet [mailto:francois.meil...@gmail.com] Gesendet: Freitag, 14. Juni 2013 08:41 An: users@wicket.apache.org Betreff: Re: DatePicker and DateTextField Set the model object (the date) behind the DateTextField to 00:00:00 JJ.MM.. François Meillet Formation Wicket - Développement Wicket Le 14 juin 2013 à 07:37, christoph.ma...@t-systems.com a écrit : Hello, how is the DatePicker binded tot he DateTextfield? How is the picked date written in the Textfield? Is there a possiblilty to change this? When the DatePicker have the pattern dd.MM. there is no problem. But I want the full timestamp with this pattern HH:mm:ss dd.MM. because the User should be able to change the time. I need one DateTextField because the Client and the server are in different timezones. This works fine. The only problem is when I pick a day the DatePicker writes HH:mm:ss 14.06.2013. But it should be 00:00:00 14.06.2013 for default. Is there anyone who could help? Mit freundlichen Grüßen Christoph Manig Systems Engineer T-Systems International GmbH Systems Integration - SC Travel, Transport Logistics Hoyerswerdaer Str. 18 01099 Dresden tel.: +49 (0) 351 / 8152 - 188 fax:+49 (0) 351 / 8152 - 209 email: christoph.ma...@t-systems.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Dr. Britta Landgraf phone: +49 2461 61 5647 IEK-4 fax: +49 2461 61 5452 email: b.landg...@fz-juelich.de WWW: www.fz-juelich.de/iek/iek-4/ Forschungszentrum Juelich GmbH 52425 Juelich Sitz der Gesellschaft: Juelich Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498 Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender), Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt, Prof. Dr. Sebastian M. Schmidt - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket and JPA
It depends whether your working with detached or manages entities. Are you using OSIV? Sven On 06/14/2013 12:22 AM, Boris Brinza wrote: Hello, ok, i understand what my problem was, I've update my code to use detachable model, quite easy refactorting. But it only postponed my problem to model onDetach, if i understand it right. In pdf, If we don't want to loose these changes we must explicitly persist the entity before the detaching phase occurs. So same problem with update of JPA enbtity. Insert is ok, just call persist(), but update? On 06/13/2013 02:52 PM, Sven Meier wrote: Please read 9.6 Detachable models of the Wicket Free Guide and come back with your questions. Sven On 06/13/2013 01:20 PM, Boris Brinza wrote: Hello to all, I have some fundamental issues with integration of jpa into wicket. I develop web application using wicket 6 and JPA (eclipselink). Maybe next question is more JPA oriented, but nevertheless: Lets say i have class BaseDetailPageT extens BaseDO extends WebPage { protected T dbEntity; } where dbEntity is instance of jpa persisted object. BaseDetail page contains form for editing db entity using CompoundPropertyModel. After i open detail page, entity is read from DB and page is displayed (if edit button is pressed) or i create new instance of object (if add button is pressed). After submit, if i want to add new record, everything is clear, i call beginTX(), entityManager.persist(dbEntity), commitTX(). But what about updating existing record? Every example for JPA shows some basic code like this: beginTX() dbObject.setXXX(); dbObject.setYYY(); commitTX() But how to integrate this into wicket form using compound property model? There is no such code for setting properties of db object, and jpa does not have anything like entityManager.update(). Now i use hack (by my opinion it';s a hack) beginTX() entityManaget.detach(dbObject); entityManager.merge(dbObject) commitTX() but i am not sure, if it's right solution (or i'm almost sure it's not right attitude) Is there any tutorial how to integrate these frameworks, or some simple opensource project to check how it's solved? Thanks for any advice, Boris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Unit testing a repeater or data table by mocking its data
You can define a mock with the same bean id that will override the original bean (e.g. in a applicationContext-test.xml). This is a spring feature. Then load the applicationContext-test.xml after the applicationContext.xml: @ContextConfiguration(loader = SpringockitoContextLoader.class, locations = {classpath:applicationContext.xml, classpath:applicationContext-test.xml}) I think it should work even without the special loader in @ContextConfiguration and Remove the @ReplaceWithMock, at least it worked for me in the past. This is described at top of https://bitbucket.org/kubek2k/springockito/wiki/Home however the configuration with the 2 locations is omitted (which is bad for starters ...). @ContextConfiguration(locations = {classpath:applicationContext.xml, classpath:applicationContext-test.xml}) I think you can see that the bean is overriden if you lower the log level to debug for org.springframework (... out of my head, don't remember which package exactly ...). Hope this helps. 2013/6/13 Paul Bors p...@bors.ws: Okay, so what's the easiest way to replace a single bean with a mock? I tried Springockito's @ReplaceWithMock w/o any luck. My webapp in testing is configured as follows: public class BaseConsoleTest extends SpringTest { ... ConsoleApplication testConsoleApplication = new ConsoleApplication() { @Override public ServletContext getServletContext() { ServletContext servletContext = super.getServletContext(); XmlWebApplicationContext wctx = new XmlWebApplicationContext(); wctx.setParent(getSpringApplicationContext()); wctx.setConfigLocation(); wctx.setServletContext(servletContext); wctx.refresh(); servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTE XT_ATTRIBUTE, wctx); return servletContext; } @Override protected void onDestroy() { super.onDestroy(); if(tester != null) { tester.destroy(); tester = null; } } @Override public Class? extends Page getHomePage() { Class? extends Page testHomePage = super.getHomePage(); return (testHomePage == null) ? MyDummyPage.class : testHomePage; } }; ... } This class extended: @ContextConfiguration(loader = SpringockitoContextLoader.class, locations = {classpath:applicationContext.xml}) @TransactionConfiguration(defaultRollback = true) @Transactional public abstract class SpringTest extends AbstractTransactionalTestNGSpringContextTests { // Setup data sources } Simply enough I just want to mock and inject the new mock by replacing a single DAO defined in my applicationContext.xml. The test I've tried: @Test public class GroupingBaseTestPage extends BaseConsoleTest { ... @ReplaceWithMock @Autowired private DictionaryGroupingDao dictionaryGroupingDao; ... } Now each time I tried to define a mock for dictionaryGroupingDao the real bean is called instead: when(dictionaryGroupingDao.countAvaialbleItems(Mockito.DictionaryGroupingQu eryParamsany()) ).thenReturn( getCount() ); The above dictionaryGroupingDao.countAvaialbleItems() executes on the real bean as if @ReplaceWithMock never did its work. I've tried with regular Mockito via the @Mock and that mocks my bean but it doesn't inject it into my Wicket's app :( Right now I gave up on Springockito and resorted to simply using Mockito for the mocks I need with a ApplicationContextMock which is killing me as I have quite a lot of mocks to implement just to get the user logged in to the application and start a single page :( I don't yet want to use Spring's ProxyFactoryBean in conjunction with HotSwappableTargetSource as it would make a mess of my applicationContext.xml. ~ Thank you, Paul Bors -Original Message- From: Andreas Kuhtz [mailto:andreas.ku...@gmail.com] Sent: Wednesday, June 12, 2013 11:26 AM To: users@wicket.apache.org Subject: Re: Unit testing a repeater or data table by mocking its data Hi Paul, Not sure if I got you right but you might check out: https://bitbucket.org/kubek2k/springockito/wiki/Home Best regards Andi 2013/6/12 Paul Bors p...@bors.ws: I like the simplicity of Mockito and got it working in my unit tests, but now I find myself mocking more services than I wanted. Wicket Page Teste allows you to inject your mocks on top of the SpringBeans, is that possible with Mockito? http://WicketPageTest.sourceforge.net/ In other words I want to have my normal XML mapped beans context have some beans be overridden only for some tests (talk about being lazy). ~ Thank
Re: DatePicker and DateTextField
new PropertyModelDate(ti, dateTo) is my Modelobjekt. Replace it by your Date-Model-Object, for example Model.of(new Date(...)) Best regards Am 14.06.2013 10:02, schrieb christoph.ma...@t-systems.com: What ist i and the String toDate in your code? Mit freundlichen Grüßen Christoph Manig Systems Engineer T-Systems International GmbH Systems Integration - SC Travel, Transport Logistics Hoyerswerdaer Str. 18 01099 Dresden tel.: +49 (0) 351 / 8152 - 188 fax: +49 (0) 351 / 8152 - 209 email: christoph.ma...@t-systems.com -Ursprüngliche Nachricht- Von: Dr. Britta Landgraf [mailto:b.landg...@fz-juelich.de] Gesendet: Freitag, 14. Juni 2013 09:39 An: users@wicket.apache.org Betreff: Re: DatePicker and DateTextField I use it in tho following way: new DateTextField(ToDay, new PropertyModelDate(ti, dateTo), HH:mm:ss dd.MM.); best regards Britta Landgraf Am 14.06.2013 09:20, schrieb christoph.ma...@t-systems.com: Do you mean it like this: DateTextField txtDatumVon = new DateTextField(txtDatumVon, new PatternDateConverter(HH:mm:ss dd.MM.,true)); String date = HH:mm:ss dd.MM.; try { txtDatumVon.setModelObject(new SimpleDateFormat(00:00:00 dd.MM.).parse(date)); } catch (ParseException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } This didn't work :( Did I do something wrong? Can you give me an example? Mit freundlichen Grüßen Christoph Manig Systems Engineer T-Systems International GmbH Systems Integration - SC Travel, Transport Logistics Hoyerswerdaer Str. 18 01099 Dresden tel.: +49 (0) 351 / 8152 - 188 fax: +49 (0) 351 / 8152 - 209 email: christoph.ma...@t-systems.com -Ursprüngliche Nachricht- Von: Francois Meillet [mailto:francois.meil...@gmail.com] Gesendet: Freitag, 14. Juni 2013 08:41 An: users@wicket.apache.org Betreff: Re: DatePicker and DateTextField Set the model object (the date) behind the DateTextField to 00:00:00 JJ.MM.. François Meillet Formation Wicket - Développement Wicket Le 14 juin 2013 à 07:37, christoph.ma...@t-systems.com a écrit : Hello, how is the DatePicker binded tot he DateTextfield? How is the picked date written in the Textfield? Is there a possiblilty to change this? When the DatePicker have the pattern dd.MM. there is no problem. But I want the full timestamp with this pattern HH:mm:ss dd.MM. because the User should be able to change the time. I need one DateTextField because the Client and the server are in different timezones. This works fine. The only problem is when I pick a day the DatePicker writes HH:mm:ss 14.06.2013. But it should be 00:00:00 14.06.2013 for default. Is there anyone who could help? Mit freundlichen Grüßen Christoph Manig Systems Engineer T-Systems International GmbH Systems Integration - SC Travel, Transport Logistics Hoyerswerdaer Str. 18 01099 Dresden tel.: +49 (0) 351 / 8152 - 188 fax:+49 (0) 351 / 8152 - 209 email: christoph.ma...@t-systems.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Dr. Britta Landgraf phone: +49 2461 61 5647 IEK-4 fax: +49 2461 61 5452 email: b.landg...@fz-juelich.de WWW: www.fz-juelich.de/iek/iek-4/ Forschungszentrum Juelich GmbH 52425 Juelich Sitz der Gesellschaft: Juelich Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498 Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender), Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt, Prof. Dr. Sebastian M. Schmidt - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Dr. Britta Landgraf phone: +49 2461 61 5647 IEK-4 fax: +49 2461 61 5452 email: b.landg...@fz-juelich.de WWW: www.fz-juelich.de/iek/iek-4/ - To unsubscribe, e-mail:
Re: Wicket mail and pdf
Am 13.06.2013 14:21, schrieb Nick Pratt: Did you modify your pom.xml to include the PDF? Inbuildresources you should have something similar to: resource filteringfalse/filtering directorysrc/main/java/directory includes include**/include /includes excludes exclude**/*.java/exclude /excludes /resource Is the PDF checked in to your version control system? Thank for your hint. I included .pdf under resource and the error has gone N On Thu, Jun 13, 2013 at 6:48 AM, Piratenvisier hansheinrichbr...@yahoo.dewrote: Martin thank you for your instantanious answers, I tried the mailtemplate example changed resource.text to resource.pdf and after some research concerning the error I got included IPackageResourceGuard packageResourceGuard = getResourceSettings().**getPackageResourceGuard(); if (packageResourceGuard instanceof SecurePackageResourceGuard) { SecurePackageResourceGuard guard = (SecurePackageResourceGuard) packageResourceGuard; guard.addPattern(+*.pdf); } in the init method of the Application. I get the Document : !DOCTYPE html html head titleA template based on a page/title /head body !-- The next is dynamically generated -- Hello,spanBraun/span You receive this email because you are subscribed for our products. We just released a new version of product X. !-- This link is also dynamically generated -- Please download ita href=http://localhost:8080/** mailtemplate/wicket/resource/**org.apache.wicket.examples.** asemail.MailTemplate/resource.**pdfhttp://localhost:8080/mailtemplate/wicket/resource/org.apache.wicket.examples.asemail.MailTemplate/resource.pdf here/a! br/br/ Sincerely, The Marketing team /body /html and when I use the link I get the error: Problem accessing /mailtemplate/wicket/resource/** org.apache.wicket.examples.**asemail.MailTemplate/resource.**pdf. Reason: Unable to find resource What is still wrong ? Am 11.06.2013 08:45, schrieb Martin Grigorov: Hi, At http://www.wicket-library.com/**wicket-examples-6.0.x/** mailtemplate/?0http://www.wicket-library.com/wicket-examples-6.0.x/mailtemplate/?0you can see an example of rendering the markup for a page, a panel and a resource. At http://markmail.org/message/**em4wqtsxhetu4skjhttp://markmail.org/message/em4wqtsxhetu4skjyou can see how to create PDF out of the produced HTML. On Tue, Jun 11, 2013 at 9:39 AM, Piratenvisier hansheinrichbr...@yahoo.de**wrote: Does anybody know some example example code to start with concerning email and pdf Thanks in advance Heiner Braun Am 10.06.2013 10:34, schrieb Martin Grigorov: Hi, If you use Wicket 6.7.0+ then you can use ComponentRenderer class to get the markup of any Wicket Page/Panel/Component. Then you can use the generated markup for mails and PDF creation. For PDF creation you can check https://github.com/flyingsaucerproject/flyingsaucerhttps://github.com/**flyingsaucerproject/**flyingsaucer https://github.**com/flyingsaucerproject/**flyingsaucerhttps://github.com/flyingsaucerproject/flyingsaucer . There is a mail in the users@ mail archives from the last few days by another user showing how to use FlyingSaucer's ITextRenderer. On Sat, Jun 8, 2013 at 8:39 PM, Piratenvisier**hansheinrichbrau** n...@yahoo.dehansheinrichbraun@**yahoo.dehansheinrichbr...@yahoo.de wrote: I wanted to integrate mail and pdf creation in my wicket application. Till now I manage this by sending a request to a cocoon-2.2.0 application. This is a good solution but because I see no upgrade way using my cocoon application and integrating newer versions of spring I am looking for an alternative. Heiner --**--**--** --**- To unsubscribe, e-mail: users-unsubscribe@wicket.apa**che.org http://apache.org** users-unsubscribe@**wicket.**apache.orghttp://wicket.apache.org users-unsubscribe@**wicket.apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org --** --**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apa**che.orghttp://apache.org users-unsubscribe@**wicket.apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket and JPA
Try first to refresh your entity with entitymanagerObject.refresh(), and use the return object for an update and then merge() Am 14.06.2013 um 10:14 schrieb Sven Meier s...@meiers.net: It depends whether your working with detached or manages entities. Are you using OSIV? Sven On 06/14/2013 12:22 AM, Boris Brinza wrote: Hello, ok, i understand what my problem was, I've update my code to use detachable model, quite easy refactorting. But it only postponed my problem to model onDetach, if i understand it right. In pdf, If we don't want to loose these changes we must explicitly persist the entity before the detaching phase occurs. So same problem with update of JPA enbtity. Insert is ok, just call persist(), but update? On 06/13/2013 02:52 PM, Sven Meier wrote: Please read 9.6 Detachable models of the Wicket Free Guide and come back with your questions. Sven On 06/13/2013 01:20 PM, Boris Brinza wrote: Hello to all, I have some fundamental issues with integration of jpa into wicket. I develop web application using wicket 6 and JPA (eclipselink). Maybe next question is more JPA oriented, but nevertheless: Lets say i have class BaseDetailPageT extens BaseDO extends WebPage { protected T dbEntity; } where dbEntity is instance of jpa persisted object. BaseDetail page contains form for editing db entity using CompoundPropertyModel. After i open detail page, entity is read from DB and page is displayed (if edit button is pressed) or i create new instance of object (if add button is pressed). After submit, if i want to add new record, everything is clear, i call beginTX(), entityManager.persist(dbEntity), commitTX(). But what about updating existing record? Every example for JPA shows some basic code like this: beginTX() dbObject.setXXX(); dbObject.setYYY(); commitTX() But how to integrate this into wicket form using compound property model? There is no such code for setting properties of db object, and jpa does not have anything like entityManager.update(). Now i use hack (by my opinion it';s a hack) beginTX() entityManaget.detach(dbObject); entityManager.merge(dbObject) commitTX() but i am not sure, if it's right solution (or i'm almost sure it's not right attitude) Is there any tutorial how to integrate these frameworks, or some simple opensource project to check how it's solved? Thanks for any advice, Boris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket and JPA
Correct me if I'm wrong but I think as long as dbObject is still managed code like the following should persist the changes to dbObject, i.e. changes to dbObject will be saved once the transaction commits. beginTX() dbObject.setXXX(); dbObject.setYYY(); commitTX() If dbObject is detached you will have to call entityManager.merge(dbObject) before committing the transaction. 2013/6/14 Evgheni Emelianov e.emelia...@gmx.net Try first to refresh your entity with entitymanagerObject.refresh(), and use the return object for an update and then merge() Am 14.06.2013 um 10:14 schrieb Sven Meier s...@meiers.net: It depends whether your working with detached or manages entities. Are you using OSIV? Sven On 06/14/2013 12:22 AM, Boris Brinza wrote: Hello, ok, i understand what my problem was, I've update my code to use detachable model, quite easy refactorting. But it only postponed my problem to model onDetach, if i understand it right. In pdf, If we don't want to loose these changes we must explicitly persist the entity before the detaching phase occurs. So same problem with update of JPA enbtity. Insert is ok, just call persist(), but update? On 06/13/2013 02:52 PM, Sven Meier wrote: Please read 9.6 Detachable models of the Wicket Free Guide and come back with your questions. Sven On 06/13/2013 01:20 PM, Boris Brinza wrote: Hello to all, I have some fundamental issues with integration of jpa into wicket. I develop web application using wicket 6 and JPA (eclipselink). Maybe next question is more JPA oriented, but nevertheless: Lets say i have class BaseDetailPageT extens BaseDO extends WebPage { protected T dbEntity; } where dbEntity is instance of jpa persisted object. BaseDetail page contains form for editing db entity using CompoundPropertyModel. After i open detail page, entity is read from DB and page is displayed (if edit button is pressed) or i create new instance of object (if add button is pressed). After submit, if i want to add new record, everything is clear, i call beginTX(), entityManager.persist(dbEntity), commitTX(). But what about updating existing record? Every example for JPA shows some basic code like this: beginTX() dbObject.setXXX(); dbObject.setYYY(); commitTX() But how to integrate this into wicket form using compound property model? There is no such code for setting properties of db object, and jpa does not have anything like entityManager.update(). Now i use hack (by my opinion it';s a hack) beginTX() entityManaget.detach(dbObject); entityManager.merge(dbObject) commitTX() but i am not sure, if it's right solution (or i'm almost sure it's not right attitude) Is there any tutorial how to integrate these frameworks, or some simple opensource project to check how it's solved? Thanks for any advice, Boris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket and JPA
Hello, thanks for advices to all, still in war with jpa :-) On 06/14/2013 01:27 PM, Evgheni Emelianov wrote: Try first to refresh your entity with entitymanagerObject.refresh(), and use the return object for an update and then merge() Am 14.06.2013 um 10:14 schrieb Sven Meier s...@meiers.net: It depends whether your working with detached or manages entities. Are you using OSIV? Sven On 06/14/2013 12:22 AM, Boris Brinza wrote: Hello, ok, i understand what my problem was, I've update my code to use detachable model, quite easy refactorting. But it only postponed my problem to model onDetach, if i understand it right. In pdf, If we don't want to loose these changes we must explicitly persist the entity before the detaching phase occurs. So same problem with update of JPA enbtity. Insert is ok, just call persist(), but update? On 06/13/2013 02:52 PM, Sven Meier wrote: Please read 9.6 Detachable models of the Wicket Free Guide and come back with your questions. Sven On 06/13/2013 01:20 PM, Boris Brinza wrote: Hello to all, I have some fundamental issues with integration of jpa into wicket. I develop web application using wicket 6 and JPA (eclipselink). Maybe next question is more JPA oriented, but nevertheless: Lets say i have class BaseDetailPageT extens BaseDO extends WebPage { protected T dbEntity; } where dbEntity is instance of jpa persisted object. BaseDetail page contains form for editing db entity using CompoundPropertyModel. After i open detail page, entity is read from DB and page is displayed (if edit button is pressed) or i create new instance of object (if add button is pressed). After submit, if i want to add new record, everything is clear, i call beginTX(), entityManager.persist(dbEntity), commitTX(). But what about updating existing record? Every example for JPA shows some basic code like this: beginTX() dbObject.setXXX(); dbObject.setYYY(); commitTX() But how to integrate this into wicket form using compound property model? There is no such code for setting properties of db object, and jpa does not have anything like entityManager.update(). Now i use hack (by my opinion it';s a hack) beginTX() entityManaget.detach(dbObject); entityManager.merge(dbObject) commitTX() but i am not sure, if it's right solution (or i'm almost sure it's not right attitude) Is there any tutorial how to integrate these frameworks, or some simple opensource project to check how it's solved? Thanks for any advice, Boris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- S pozdravom Boris Brinza --- HT Solution s.r.o. Digital Park II Einsteinova 25 851 01 Bratislava Slovakia Phone: +421 2 3500 2512, Mobile: +421 903 602 126 E-mail: boris.bri...@htsolution.sk, Internet: www.htsolution.sk - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket and JPA
You're right, but if you use propertymodel with dbEntity as model object, there is no such code in your form like getModelObject().setXXX(), or another question: where and when to start tx and commit tx? On 06/14/2013 02:14 PM, heapifyman wrote: Correct me if I'm wrong but I think as long as dbObject is still managed code like the following should persist the changes to dbObject, i.e. changes to dbObject will be saved once the transaction commits. beginTX() dbObject.setXXX(); dbObject.setYYY(); commitTX() If dbObject is detached you will have to call entityManager.merge(dbObject) before committing the transaction. 2013/6/14 Evgheni Emelianov e.emelia...@gmx.net Try first to refresh your entity with entitymanagerObject.refresh(), and use the return object for an update and then merge() Am 14.06.2013 um 10:14 schrieb Sven Meier s...@meiers.net: It depends whether your working with detached or manages entities. Are you using OSIV? Sven On 06/14/2013 12:22 AM, Boris Brinza wrote: Hello, ok, i understand what my problem was, I've update my code to use detachable model, quite easy refactorting. But it only postponed my problem to model onDetach, if i understand it right. In pdf, If we don't want to loose these changes we must explicitly persist the entity before the detaching phase occurs. So same problem with update of JPA enbtity. Insert is ok, just call persist(), but update? On 06/13/2013 02:52 PM, Sven Meier wrote: Please read 9.6 Detachable models of the Wicket Free Guide and come back with your questions. Sven On 06/13/2013 01:20 PM, Boris Brinza wrote: Hello to all, I have some fundamental issues with integration of jpa into wicket. I develop web application using wicket 6 and JPA (eclipselink). Maybe next question is more JPA oriented, but nevertheless: Lets say i have class BaseDetailPageT extens BaseDO extends WebPage { protected T dbEntity; } where dbEntity is instance of jpa persisted object. BaseDetail page contains form for editing db entity using CompoundPropertyModel. After i open detail page, entity is read from DB and page is displayed (if edit button is pressed) or i create new instance of object (if add button is pressed). After submit, if i want to add new record, everything is clear, i call beginTX(), entityManager.persist(dbEntity), commitTX(). But what about updating existing record? Every example for JPA shows some basic code like this: beginTX() dbObject.setXXX(); dbObject.setYYY(); commitTX() But how to integrate this into wicket form using compound property model? There is no such code for setting properties of db object, and jpa does not have anything like entityManager.update(). Now i use hack (by my opinion it';s a hack) beginTX() entityManaget.detach(dbObject); entityManager.merge(dbObject) commitTX() but i am not sure, if it's right solution (or i'm almost sure it's not right attitude) Is there any tutorial how to integrate these frameworks, or some simple opensource project to check how it's solved? Thanks for any advice, Boris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- S pozdravom Boris Brinza --- HT Solution s.r.o. Digital Park II Einsteinova 25 851 01 Bratislava Slovakia Phone: +421 2 3500 2512, Mobile: +421 903 602 126 E-mail: boris.bri...@htsolution.sk, Internet: www.htsolution.sk - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket and JPA
getModelObject().setXXX() This is what each FormComponent will do for you. where and when to start tx and commit tx? Easiest is to use OSIV, using Spring's filter [1] or a custom request listener in Wicket. Sven [1]http://blog.smartkey.co.uk/2010/03/open-session-in-view-pattern-spring-jpa On 06/14/2013 02:24 PM, Boris Brinza wrote: You're right, but if you use propertymodel with dbEntity as model object, there is no such code in your form like getModelObject().setXXX(), or another question: where and when to start tx and commit tx? On 06/14/2013 02:14 PM, heapifyman wrote: Correct me if I'm wrong but I think as long as dbObject is still managed code like the following should persist the changes to dbObject, i.e. changes to dbObject will be saved once the transaction commits. beginTX() dbObject.setXXX(); dbObject.setYYY(); commitTX() If dbObject is detached you will have to call entityManager.merge(dbObject) before committing the transaction. 2013/6/14 Evgheni Emelianov e.emelia...@gmx.net Try first to refresh your entity with entitymanagerObject.refresh(), and use the return object for an update and then merge() Am 14.06.2013 um 10:14 schrieb Sven Meier s...@meiers.net: It depends whether your working with detached or manages entities. Are you using OSIV? Sven On 06/14/2013 12:22 AM, Boris Brinza wrote: Hello, ok, i understand what my problem was, I've update my code to use detachable model, quite easy refactorting. But it only postponed my problem to model onDetach, if i understand it right. In pdf, If we don't want to loose these changes we must explicitly persist the entity before the detaching phase occurs. So same problem with update of JPA enbtity. Insert is ok, just call persist(), but update? On 06/13/2013 02:52 PM, Sven Meier wrote: Please read 9.6 Detachable models of the Wicket Free Guide and come back with your questions. Sven On 06/13/2013 01:20 PM, Boris Brinza wrote: Hello to all, I have some fundamental issues with integration of jpa into wicket. I develop web application using wicket 6 and JPA (eclipselink). Maybe next question is more JPA oriented, but nevertheless: Lets say i have class BaseDetailPageT extens BaseDO extends WebPage { protected T dbEntity; } where dbEntity is instance of jpa persisted object. BaseDetail page contains form for editing db entity using CompoundPropertyModel. After i open detail page, entity is read from DB and page is displayed (if edit button is pressed) or i create new instance of object (if add button is pressed). After submit, if i want to add new record, everything is clear, i call beginTX(), entityManager.persist(dbEntity), commitTX(). But what about updating existing record? Every example for JPA shows some basic code like this: beginTX() dbObject.setXXX(); dbObject.setYYY(); commitTX() But how to integrate this into wicket form using compound property model? There is no such code for setting properties of db object, and jpa does not have anything like entityManager.update(). Now i use hack (by my opinion it';s a hack) beginTX() entityManaget.detach(dbObject); entityManager.merge(dbObject) commitTX() but i am not sure, if it's right solution (or i'm almost sure it's not right attitude) Is there any tutorial how to integrate these frameworks, or some simple opensource project to check how it's solved? Thanks for any advice, Boris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: reuse Form Panel code for WizardStep?
I will try. thank you -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/reuse-Form-Panel-code-for-WizardStep-tp4659295p4659493.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
user interface design: if any error, textbox channge to red ... ...
I am able to do it with AttributeModifier.append( class, error ). However, if I press F5, the feedback message disappears, the textbox remains red. It seems that error stays there forever. Did I missing something? How does the feedback message work? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/user-interface-design-if-any-error-textbox-channge-to-red-tp4659495.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Form submit without redirection
Hi, I migrated my application from wicket 1.4.21 to 6.8.0. In the onSubmit method of a SubmitLink, if errors are present in the submitted values, I want to display the same page with the specified errors. In wicket 1.4, I was doing this : public void handleErrors() { if (!this.errors.isEmpty()) { // Pass the errors to the resulting page final PageParameters params = new PageParameters(); params.put(errors, this.errors); // Do not redirect! getRequestCycle().setRedirect(false); // Same page is shown with validation errors setResponsePage(getClass(), params); } } The errors were passed to the response in post parameters. Now, with wicket 6.8.0 (think this appears since wicket 5...), the only difference in my code is that the method getRequestCycle().setRedirect(false) disappear. Now, all my errors are sent in the URL because of the redirect after the post. Is there a way that I can turn off the redirection only if errors are present ? I don't want to see all my errors in the URL. Thanks David -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Form-submit-without-redirection-tp4659496.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: user interface design: if any error, textbox channge to red ... ...
Hi! Feedback messages are cleanup up (removed) after each request. The attribute modified you added to the component, remains in place if the page is stateful. That's why the field still has the error class after a reload. You can do a number of things to make this work, but the essence is that the attribute should only be updated if the form component has errors. You can then add this behavior (e.g. the attribute modifier) to all formcomponents when constructing the form. This can also be automated with a component instantiation listener. To only update the attribute if the component has errors, override method isEnabled on the behavior, cast the component to a FormComponent and return !formComponent.isValid(). Met vriendelijke groet, Kind regards, Bas Gooren Op 14-6-2013 15:03, schreef always_rick: I am able to do it with AttributeModifier.append( class, error ). However, if I press F5, the feedback message disappears, the textbox remains red. It seems that error stays there forever. Did I missing something? How does the feedback message work? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/user-interface-design-if-any-error-textbox-channge-to-red-tp4659495.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Juniper Systems Network Filters Recently Updated Block Some Wicket URLs
Hi, I work in a user group at a large US university that uses Juniper Networks security software to filter traffic on the borders of their campus network. I administer a wicket web app that has been running just fine for the last 2 years. Last Saturday, certain wicket generated URLs were not being successfully passed through the aforementioned filter. Long story short and one week later, turns out that their was a recent update made to one of the filter signatures that causes this problem, and when the signatures were updated to the campus filter software our problems began. Fortunately the network admins recognized this as a false positive and agreed to disable this signature. I'm posting this message to let folks know that this is an issue. I have posted the info about the error below with an example of a URL that is blocked going from the browser to the web app. == Example url that was being blocked: http://xxx.http://130.126.114.121/cgdashboard/?wicket:interface=:1:pubpan:publishersform:datatable:body:rows:2:cells:1:cell:actionlink::ILinkListener xxx .xxx.xxx//?wicket:interface=:1:pubpan:publishersform:datatable:body:rows:2:cells:1:cell:actionlink::ILinkListenerhttp://130.126.114.121/cgdashboard/?wicket:interface=:1:pubpan:publishersform:datatable:body:rows:2:cells:1:cell:actionlink::ILinkListener :: == Error generated at the filter: The traffic to that host is triggering and IDP error HTTP:XSS:HTML-SCRIPT-IN-URL-VAR which the vendor describes as: Juniper Networks Solutions Products Services Company Partners Support Education Signature Detail Security Intelligence Center Signatures Print Share Short Name HTTP:XSS:HTML-SCRIPT-IN-URL-VAR Severity High Recommended Yes Recommended Action Drop Category HTTP Keywords CSS XSS Cross Site Scripting KB983438 39776 Release Date 2003/12/17 Update Number 1213 Supported Platforms di-5.3+, idp-4.0+, isg-3.0+, j-series-9.5+, mx-9.4+, srx-9.2+, srx-branch-9.4+ HTTP: HTML Script Tag Embedded in URL Variables This signature detects attempts at cross-site scripting attacks. Attackers can create a malicious Web site that includes HTML embedded in the hyperlinks, which can violate site security settings. A victim that accesses these hyperlinks can allow the attacker to view the victim's Web cookies. Web cookies typically contain sensitive information. This technique is also used by some advertisement company to gather information about people, since the extend of the information gathered cannot be controlled, this behavior is considered by default malicious. === Best, Duane
Opening page in new tab resets previous pages state
Hi All, I have used Wicket to develop a web app and I am having some difficulties understanding exactly what's happening. Basically there is a search page which have a number of search fields. When you click the search button the same page reloads with the results in a big table underneath the original search fields. Because of this all of the search fields retain there existing values when the results are displayed. You can then edit any field and click search again. This all works as expected. Some of the results have an icon which when clicked pops up an ajax dialogue. This is straight forward 3rd party ajax dialogue (not part of wicket). This simply displays another wicket page with a couple of links to more wicket pages. If you click any of these links (which open in a new tab) I get some odd behaviour on the original search form. No mater what you enter into a search field, if you now click search it resets the entire page. All of the fields are now cleared and the search doesn't occur. I can see via the debugger its just creating a new instance of my main search page. I am guessing somehow opening that extra link invalidates the session data. My guess is because the the URLs a numbered page?2 these are getting out of sync. Does any body have any suggestions on how to prevent this? Thanks, Charlie M
DataTable sort column descending
Is there an easy way to have a DataTable column sort descending the first time it is clicked on? The code in OrderByLink does the following: protected SortOrder nextSortOrder(final SortOrder order) { // init / flip order if (order == SortOrder.NONE) { return SortOrder.ASCENDING; } else { return order == SortOrder.ASCENDING ? SortOrder.DESCENDING : SortOrder.ASCENDING; } } The first time it is NONE, so it changes to ASCENDING. This is the desired outcome in most use cases, but not one I am working on. I think I can override this, but it's ugly since I'd have to go through OrderByLinkBorder, HeadersToolbar and to Datatable. Just wondering if there's a cleaner and/or easier way. -- IMPORTANT: This e-mail (including any attachments) is intended for the use of the individual or entity to which it is addressed and may contain information that is classified, private, or confidential. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is prohibited. If you have received this communication in error, please notify us immediately by replying to this e-mail. Thank you.
How to dynamically add a hyperlink (BookmarkablePageLink) to DefaultDataTable that is rendered as an anchor
I am using Wicket 6.8 and have a sortable DefaultDataTable that gets its columns programmatically. The markup to get this table and the dynamically generated columns simple (I've added spaces so it all shows): wicket:panel table wicket:id=dataTable border=0 cellpadding=1 cellspacing=1 width=90% / /wicket:panel All of the columns are generated from a passed in LinkedHashMap of labels and attributes: for (EntryString, String entry : entrySet) { final String label = entry.getKey(); final String attribute = entry.getValue(); columns.add(new PsPropertyColumn(label, attribute) { @Override public void populateItem(Item cellItem, String componentId, IModel model) { final Object modelObject = model.getObject(); final Object value = PropertyResolver.getValue(attribute, modelObject); // Add an edit link BookmarkablePageLink link = new ...; ... cellItem.add(link); } } } DefaultDataTable table = new DefaultDataTable(dataTable, columns, dataProvider, MAX_ROWS) { ... } add(table); So this properly displays as a sortable table with clickable columns that send the user to the required page. However, as many posts have mentioned, this is rendered as a cell with an onclick handler rather than an anchor ( a href=... /) tag. I want the anchor tag for a couple of reasons, one if which is that I want to add my own onclick handler without having an existing onclick handler in the way. I have seen a solution that says to put an anchor tag inside a panel in the HTML markup, and to add the link inside of a Panel subclass. Sadly for me the markup in the examples wasn't complete, and whatever I try (anchor tags, tr/td tags, panel tags, etc.), I get the same error: Last cause: Close tag not found for tag: . For Components only raw markup is allow in between the tags but not other Wicket Component. Component: [DefaultDataTable [Component id = dataTable]] Here is the simplest thing I've tried: wicket:panel table wicket:id=dataTable border=0 cellpadding=1 cellspacing=1 width=90% a href=# wicket:id=link /a /table /wicket:panel Again, no success. I would love to see markup that allows the BookmarkablePageLinks be rendered insided the DefaultDataTable as anchor tags. Thanks in advance for any help. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-dynamically-add-a-hyperlink-BookmarkablePageLink-to-DefaultDataTable-that-is-rendered-as-an-ar-tp4659502.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Validator Can't Find Form Submitting Component
Please upgrade to 1.4.22 first and recheck the problem. Sven On 06/13/2013 05:49 PM, Richard W. Adams wrote: [Re-sending, as I noticed my previous send was an accidental forward, so probably ended up in the wrong thread. Also adding some more info] I have a form inside a panel. The form is nested inside another form that includes the panel. The panel form has a validator which is supposed to validate only conditionally, depending on how the form was submitted. When I submit the panel form via an AjaxSubmitLink, the call to findSubmittingButton() inside the validator returns null, even though I called panelForm.add(theLiink). Is this expected behavior? I know the findSubmittingButton() method says button, but it returns an IFormSubmittingComponent, so I would expect it could return either a button or a submitting link. I need to distinguish between the various links/buttons that can submit the form. Is this not possible with an AjaxSubmitLink? I'm using Wicket 1.4.17. ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. ** - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to dynamically add a hyperlink (BookmarkablePageLink) to DefaultDataTable that is rendered as an anchor
Have you read the following? https://cwiki.apache.org/WICKET/adding-links-in-a-defaultdatatable.html Sven On 06/14/2013 06:22 PM, David Solum wrote: I am using Wicket 6.8 and have a sortable DefaultDataTable that gets its columns programmatically. The markup to get this table and the dynamically generated columns simple (I've added spaces so it all shows): wicket:panel table wicket:id=dataTable border=0 cellpadding=1 cellspacing=1 width=90% / /wicket:panel All of the columns are generated from a passed in LinkedHashMap of labels and attributes: for (EntryString, String entry : entrySet) { final String label = entry.getKey(); final String attribute = entry.getValue(); columns.add(new PsPropertyColumn(label, attribute) { @Override public void populateItem(Item cellItem, String componentId, IModel model) { final Object modelObject = model.getObject(); final Object value = PropertyResolver.getValue(attribute, modelObject); // Add an edit link BookmarkablePageLink link = new ...; ... cellItem.add(link); } } } DefaultDataTable table = new DefaultDataTable(dataTable, columns, dataProvider, MAX_ROWS) { ... } add(table); So this properly displays as a sortable table with clickable columns that send the user to the required page. However, as many posts have mentioned, this is rendered as a cell with an onclick handler rather than an anchor ( a href=... /) tag. I want the anchor tag for a couple of reasons, one if which is that I want to add my own onclick handler without having an existing onclick handler in the way. I have seen a solution that says to put an anchor tag inside a panel in the HTML markup, and to add the link inside of a Panel subclass. Sadly for me the markup in the examples wasn't complete, and whatever I try (anchor tags, tr/td tags, panel tags, etc.), I get the same error: Last cause: Close tag not found for tag: . For Components only raw markup is allow in between the tags but not other Wicket Component. Component: [DefaultDataTable [Component id = dataTable]] Here is the simplest thing I've tried: wicket:panel table wicket:id=dataTable border=0 cellpadding=1 cellspacing=1 width=90% a href=# wicket:id=link /a /table /wicket:panel Again, no success. I would love to see markup that allows the BookmarkablePageLinks be rendered insided the DefaultDataTable as anchor tags. Thanks in advance for any help. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-dynamically-add-a-hyperlink-BookmarkablePageLink-to-DefaultDataTable-that-is-rendered-as-an-ar-tp4659502.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Juniper Systems Network Filters Recently Updated Block Some Wicket URLs
Thanks for your information. I wonder what embedded HTML Script Tag Juniper sees in the given url: http://130.126.114.121/cgdashboard/?wicket:interface=:1:pubpan:publishersform:datatable:body:rows:2:cells:1:cell:actionlink::ILinkListener Sven On 06/14/2013 04:37 PM, Duane Searsmith wrote: Hi, I work in a user group at a large US university that uses Juniper Networks security software to filter traffic on the borders of their campus network. I administer a wicket web app that has been running just fine for the last 2 years. Last Saturday, certain wicket generated URLs were not being successfully passed through the aforementioned filter. Long story short and one week later, turns out that their was a recent update made to one of the filter signatures that causes this problem, and when the signatures were updated to the campus filter software our problems began. Fortunately the network admins recognized this as a false positive and agreed to disable this signature. I'm posting this message to let folks know that this is an issue. I have posted the info about the error below with an example of a URL that is blocked going from the browser to the web app. == Example url that was being blocked: http://xxx.http://130.126.114.121/cgdashboard/?wicket:interface=:1:pubpan:publishersform:datatable:body:rows:2:cells:1:cell:actionlink::ILinkListener xxx .xxx.xxx//?wicket:interface=:1:pubpan:publishersform:datatable:body:rows:2:cells:1:cell:actionlink::ILinkListenerhttp://130.126.114.121/cgdashboard/?wicket:interface=:1:pubpan:publishersform:datatable:body:rows:2:cells:1:cell:actionlink::ILinkListener :: == Error generated at the filter: The traffic to that host is triggering and IDP error HTTP:XSS:HTML-SCRIPT-IN-URL-VAR which the vendor describes as: Juniper Networks Solutions Products Services Company Partners Support Education Signature Detail Security Intelligence Center Signatures Print Share Short Name HTTP:XSS:HTML-SCRIPT-IN-URL-VAR Severity High Recommended Yes Recommended Action Drop Category HTTP Keywords CSS XSS Cross Site Scripting KB983438 39776 Release Date 2003/12/17 Update Number 1213 Supported Platforms di-5.3+, idp-4.0+, isg-3.0+, j-series-9.5+, mx-9.4+, srx-9.2+, srx-branch-9.4+ HTTP: HTML Script Tag Embedded in URL Variables This signature detects attempts at cross-site scripting attacks. Attackers can create a malicious Web site that includes HTML embedded in the hyperlinks, which can violate site security settings. A victim that accesses these hyperlinks can allow the attacker to view the victim's Web cookies. Web cookies typically contain sensitive information. This technique is also used by some advertisement company to gather information about people, since the extend of the information gathered cannot be controlled, this behavior is considered by default malicious. === Best, Duane - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Juniper Systems Network Filters Recently Updated Block Some Wicket URLs
Wild guess: link in query parameter is suspected of injecting malicious link into application's rendered page. On Fri, Jun 14, 2013 at 9:41 AM, Sven Meier s...@meiers.net wrote: Thanks for your information. I wonder what embedded HTML Script Tag Juniper sees in the given url: http://130.126.114.121/**cgdashboard/?wicket:interface=** :1:pubpan:publishersform:**datatable:body:rows:2:cells:1:** cell:actionlink::ILinkListenerhttp://130.126.114.121/cgdashboard/?wicket:interface=:1:pubpan:publishersform:datatable:body:rows:2:cells:1:cell:actionlink::ILinkListener Sven On 06/14/2013 04:37 PM, Duane Searsmith wrote: Hi, I work in a user group at a large US university that uses Juniper Networks security software to filter traffic on the borders of their campus network. I administer a wicket web app that has been running just fine for the last 2 years. Last Saturday, certain wicket generated URLs were not being successfully passed through the aforementioned filter. Long story short and one week later, turns out that their was a recent update made to one of the filter signatures that causes this problem, and when the signatures were updated to the campus filter software our problems began. Fortunately the network admins recognized this as a false positive and agreed to disable this signature. I'm posting this message to let folks know that this is an issue. I have posted the info about the error below with an example of a URL that is blocked going from the browser to the web app. == Example url that was being blocked: http://xxx.http://130.126.**114.121/cgdashboard/?wicket:** interface=:1:pubpan:**publishersform:datatable:body:** rows:2:cells:1:cell:**actionlink::ILinkListenerhttp://130.126.114.121/cgdashboard/?wicket:interface=:1:pubpan:publishersform:datatable:body:rows:2:cells:1:cell:actionlink::ILinkListener xxx .xxx.xxx//?wicket:**interface=:1:pubpan:** publishersform:datatable:body:**rows:2:cells:1:cell:** actionlink::ILinkListenerhttp**://130.126.114.121/** cgdashboard/?wicket:interface=**:1:pubpan:publishersform:** datatable:body:rows:2:cells:1:**cell:actionlink::ILinkListenerhttp://130.126.114.121/cgdashboard/?wicket:interface=:1:pubpan:publishersform:datatable:body:rows:2:cells:1:cell:actionlink::ILinkListener ** :: == Error generated at the filter: The traffic to that host is triggering and IDP error HTTP:XSS:HTML-SCRIPT-IN-URL-**VAR which the vendor describes as: Juniper Networks Solutions Products Services Company Partners Support Education Signature Detail Security Intelligence Center Signatures Print Share Short Name HTTP:XSS:HTML-SCRIPT-IN-URL-**VAR Severity High Recommended Yes Recommended Action Drop Category HTTP Keywords CSS XSS Cross Site Scripting KB983438 39776 Release Date 2003/12/17 Update Number 1213 Supported Platforms di-5.3+, idp-4.0+, isg-3.0+, j-series-9.5+, mx-9.4+, srx-9.2+, srx-branch-9.4+ HTTP: HTML Script Tag Embedded in URL Variables This signature detects attempts at cross-site scripting attacks. Attackers can create a malicious Web site that includes HTML embedded in the hyperlinks, which can violate site security settings. A victim that accesses these hyperlinks can allow the attacker to view the victim's Web cookies. Web cookies typically contain sensitive information. This technique is also used by some advertisement company to gather information about people, since the extend of the information gathered cannot be controlled, this behavior is considered by default malicious. === Best, Duane --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: LoadableDetachableModel and Attempt to set model object on null model of component
Ok I eventually made it work. I have to use a Model for *both* the provided values, AND the selected object (sorry, I'm a Wicket newbie). Thus, by adding a field to the page: public CompanyConfiguration selectedCompany; And then: ChoiceRendererCompanyConfiguration choiceRenderer = new ChoiceRendererCompanyConfiguration(name, id); DropDownChoiceCompanyConfiguration ddc = new DropDownChoiceCompanyConfiguration(companiesList, new PropertyModelCompanyConfiguration(this, selectedCompany), new LoadableDetachableModelListlt;CompanyConfiguration() { @Override protected ListCompanyConfiguration load() { final ListCompanyConfiguration configs = getCompaniesList(); Collections.sort((ListCompanyConfiguration) configs, new ComparatorCompanyConfiguration() { @Override public int compare(CompanyConfiguration o1, CompanyConfiguration o2) { return o1.getName().compareTo(o2.getName()); } }); return configs; } @Override public void detach() { } }, choiceRenderer); But in my case, this leads to a serialization issue, so again we have to use a LoadableDetachableModel: DropDownChoiceCompanyConfiguration ddc = new DropDownChoiceCompanyConfiguration(companiesList, new LoadableDetachableModelCompanyConfiguration() { @Override protected CompanyConfiguration load() { return null; } }, new LoadableDetachableModelListlt;CompanyConfiguration() { @Override protected ListCompanyConfiguration load() { final ListCompanyConfiguration configs = getCompaniesList(); Collections.sort((ListCompanyConfiguration) configs, new ComparatorCompanyConfiguration() { @Override public int compare(CompanyConfiguration o1, CompanyConfiguration o2) { return o1.getName().compareTo(o2.getName()); } }); return configs; } @Override public void detach() { } }, choiceRenderer); -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/LoadableDetachableModel-and-Attempt-to-set-model-object-on-null-model-of-component-tp4659453p4659500.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket and JPA
you are right but if you trying to get the entity after detach, you get the cashed version of this object, also you don't have the changes in the database, even if you merge, but if you refresh your entity you get a new updated object with all changes that were made, and the changes will be written in the database. sorry for the previous mail :) Evgheni - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket and JPA
you are right but if you trying to get the entity after detach, Am 14.06.2013 um 14:14 schrieb heapifyman heapify...@gmail.com: Correct me if I'm wrong but I think as long as dbObject is still managed code like the following should persist the changes to dbObject, i.e. changes to dbObject will be saved once the transaction commits. beginTX() dbObject.setXXX(); dbObject.setYYY(); commitTX() If dbObject is detached you will have to call entityManager.merge(dbObject) before committing the transaction. 2013/6/14 Evgheni Emelianov e.emelia...@gmx.net Try first to refresh your entity with entitymanagerObject.refresh(), and use the return object for an update and then merge() Am 14.06.2013 um 10:14 schrieb Sven Meier s...@meiers.net: It depends whether your working with detached or manages entities. Are you using OSIV? Sven On 06/14/2013 12:22 AM, Boris Brinza wrote: Hello, ok, i understand what my problem was, I've update my code to use detachable model, quite easy refactorting. But it only postponed my problem to model onDetach, if i understand it right. In pdf, If we don't want to loose these changes we must explicitly persist the entity before the detaching phase occurs. So same problem with update of JPA enbtity. Insert is ok, just call persist(), but update? On 06/13/2013 02:52 PM, Sven Meier wrote: Please read 9.6 Detachable models of the Wicket Free Guide and come back with your questions. Sven On 06/13/2013 01:20 PM, Boris Brinza wrote: Hello to all, I have some fundamental issues with integration of jpa into wicket. I develop web application using wicket 6 and JPA (eclipselink). Maybe next question is more JPA oriented, but nevertheless: Lets say i have class BaseDetailPageT extens BaseDO extends WebPage { protected T dbEntity; } where dbEntity is instance of jpa persisted object. BaseDetail page contains form for editing db entity using CompoundPropertyModel. After i open detail page, entity is read from DB and page is displayed (if edit button is pressed) or i create new instance of object (if add button is pressed). After submit, if i want to add new record, everything is clear, i call beginTX(), entityManager.persist(dbEntity), commitTX(). But what about updating existing record? Every example for JPA shows some basic code like this: beginTX() dbObject.setXXX(); dbObject.setYYY(); commitTX() But how to integrate this into wicket form using compound property model? There is no such code for setting properties of db object, and jpa does not have anything like entityManager.update(). Now i use hack (by my opinion it';s a hack) beginTX() entityManaget.detach(dbObject); entityManager.merge(dbObject) commitTX() but i am not sure, if it's right solution (or i'm almost sure it's not right attitude) Is there any tutorial how to integrate these frameworks, or some simple opensource project to check how it's solved? Thanks for any advice, Boris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
LoadableDetachableModel and Attempt to set model object on null model of component
I got a /Unexpected RuntimeException Last cause: Attempt to set model object on null model of component: form:companiesList/ whenever I select an item in my DropDownChoice. I read somewhere that it was because there is no Model set, but there *is* one (a LoadableDetachableModel) : ChoiceRendererCompanyConfiguration choiceRenderer = new ChoiceRendererCompanyConfiguration(name, id); DropDownChoiceCompanyConfiguration ddc = new DropDownChoiceCompanyConfiguration(companiesList, new LoadableDetachableModelListlt;CompanyConfiguration() { private static final long serialVersionUID = 8752933117323402630L; @Override protected ListCompanyConfiguration load() { final ListCompanyConfiguration configs = getCompaniesList(); Collections.sort((ListCompanyConfiguration) configs, new ComparatorCompanyConfiguration() { @Override public int compare(CompanyConfiguration o1, CompanyConfiguration o2) { return o1.getName().compareTo(o2.getName()); } }); return configs; } }, choiceRenderer) { protected boolean wantOnSelectionChangedNotifications() { return true; } protected void onSelectionChanged(final CompanyConfiguration newSelection) { logger.debug(Selected base: + newSelection.getId()); } }; Has anyone an idea about what I'm doing wrong? Note: I cannot serialize my CompanyConfiguration list. BTW, second question: there is a DataView with a ListDataProvider elsewhere in the page. How can I update its values from the method onSelectionChanged() above? Thanks a lot! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/LoadableDetachableModel-and-Attempt-to-set-model-object-on-null-model-of-component-tp4659453.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Form submit without redirection
Or is there a way I can add extra post parameters to my request ? I don't want to put my errors in my session (too much management). I would like to add my errors to my request only for the current request (request scope) Is there a way I can achieve this ? Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Form-submit-without-redirection-tp4659496p4659509.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Unit testing a repeater or data table by mocking its data
Thanks I'll try that the next time I need to override a single bean. For now I got my entire test suite working by mocking all the beans necessary to initialize the webapp and authenticate the user. Took longer but I like it since I am in full control :) ~ Thank you, Paul Bors -Original Message- From: Andreas Kuhtz [mailto:andreas.ku...@gmail.com] Sent: Friday, June 14, 2013 4:25 AM To: users@wicket.apache.org Subject: Re: Unit testing a repeater or data table by mocking its data You can define a mock with the same bean id that will override the original bean (e.g. in a applicationContext-test.xml). This is a spring feature. Then load the applicationContext-test.xml after the applicationContext.xml: @ContextConfiguration(loader = SpringockitoContextLoader.class, locations = {classpath:applicationContext.xml, classpath:applicationContext-test.xml}) I think it should work even without the special loader in @ContextConfiguration and Remove the @ReplaceWithMock, at least it worked for me in the past. This is described at top of https://bitbucket.org/kubek2k/springockito/wiki/Home however the configuration with the 2 locations is omitted (which is bad for starters ...). @ContextConfiguration(locations = {classpath:applicationContext.xml, classpath:applicationContext-test.xml}) I think you can see that the bean is overriden if you lower the log level to debug for org.springframework (... out of my head, don't remember which package exactly ...). Hope this helps. 2013/6/13 Paul Bors p...@bors.ws: Okay, so what's the easiest way to replace a single bean with a mock? I tried Springockito's @ReplaceWithMock w/o any luck. My webapp in testing is configured as follows: public class BaseConsoleTest extends SpringTest { ... ConsoleApplication testConsoleApplication = new ConsoleApplication() { @Override public ServletContext getServletContext() { ServletContext servletContext = super.getServletContext(); XmlWebApplicationContext wctx = new XmlWebApplicationContext(); wctx.setParent(getSpringApplicationContext()); wctx.setConfigLocation(); wctx.setServletContext(servletContext); wctx.refresh(); servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTE XT_ATTRIBUTE, wctx); return servletContext; } @Override protected void onDestroy() { super.onDestroy(); if(tester != null) { tester.destroy(); tester = null; } } @Override public Class? extends Page getHomePage() { Class? extends Page testHomePage = super.getHomePage(); return (testHomePage == null) ? MyDummyPage.class : testHomePage; } }; ... } This class extended: @ContextConfiguration(loader = SpringockitoContextLoader.class, locations = {classpath:applicationContext.xml}) @TransactionConfiguration(defaultRollback = true) @Transactional public abstract class SpringTest extends AbstractTransactionalTestNGSpringContextTests { // Setup data sources } Simply enough I just want to mock and inject the new mock by replacing a single DAO defined in my applicationContext.xml. The test I've tried: @Test public class GroupingBaseTestPage extends BaseConsoleTest { ... @ReplaceWithMock @Autowired private DictionaryGroupingDao dictionaryGroupingDao; ... } Now each time I tried to define a mock for dictionaryGroupingDao the real bean is called instead: when(dictionaryGroupingDao.countAvaialbleItems(Mockito.DictionaryGroupingQu eryParamsany()) ).thenReturn( getCount() ); The above dictionaryGroupingDao.countAvaialbleItems() executes on the real bean as if @ReplaceWithMock never did its work. I've tried with regular Mockito via the @Mock and that mocks my bean but it doesn't inject it into my Wicket's app :( Right now I gave up on Springockito and resorted to simply using Mockito for the mocks I need with a ApplicationContextMock which is killing me as I have quite a lot of mocks to implement just to get the user logged in to the application and start a single page :( I don't yet want to use Spring's ProxyFactoryBean in conjunction with HotSwappableTargetSource as it would make a mess of my applicationContext.xml. ~ Thank you, Paul Bors -Original Message- From: Andreas Kuhtz [mailto:andreas.ku...@gmail.com] Sent: Wednesday, June 12, 2013 11:26 AM To: users@wicket.apache.org Subject: Re: Unit testing a repeater or data table by mocking its data Hi Paul, Not sure if I got you right but you might check out:
Re: PageableListView with two rows
Thanks to both of you! I've managed to do what I liked. It's a little bit unusual for me, but it's clean and it works. Cheers men, Pierre On Tue, Jun 11, 2013 at 5:06 PM, Eric Jablow erjab...@gmail.com wrote: ListView and its subclasses do not require the use of tables. If another style of markup is useful, use that. You can have a div with nested divs, In fact, you could create a ProfilePanel and use a div for each. On Mon, Jun 10, 2013 at 6:06 PM, Dan Retzlaff dretzl...@gmail.com wrote: Maybe I just don't understand your requirements. I thought you want two rows for each Profile. So: add(new PageableListView(profile, profiles) { populateItem(item) { item.add(new Label(row1column1)); item.add(new Label(row2column1)); item.setRenderBodyOnly(true); } }); table div wicket:id=profile trtd wicket:id=row1column1/td/tr trtd wicket:id=row2column1/td/tr /div /table Obviously you can add as many columns as you'd like. -- Un truc bien avec la musique, c'est que quand elle te frappe, tu n'as pas mal. Alors frappez-moi de musique ! Frappez-moi de musique, maintenant ! (Bob Marley : Trenchtown Rock)
Re: How to dynamically add a hyperlink (BookmarkablePageLink) to DefaultDataTable that is rendered as an anchor
Yes Sven, that is where I got the HTML I posted that gives me the Close tag not found error. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-dynamically-add-a-hyperlink-BookmarkablePageLink-to-DefaultDataTable-that-is-rendered-as-an-ar-tp4659502p4659514.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
ModalWindow not visible in Safari
When I scroll down on large pages in Safari 5.1.7 (Windows) and click on a link to open a modal window, the modal window does not display, but the mask for the window does. I added WICKET-5224 to JIRA with a Quickstart. It looks like the fix for WICKET-4948 is what is causing the problem. It seems that WICKET-4948 was solving the same problem. Is this a problem between versions of Safari where the window.scrollTop is different between Windows and Mac? I don't have a Mac to test. -- Jered Myers
Re: user interface design: if any error, textbox channge to red ... ...
Bas Gooren wrote: To only update the attribute if the component has errors, override method isEnabled on the behavior, cast the component to a FormComponent and return !formComponent.isValid(). And remember that you must not use isValid() in onComponentTag() to change tag attributes. You must store the validness in a transient property in onConfigure() or onBeforeRender() and check that that property in onComponentTag(). In fact, at least one component in 6.5.x (which we use currently in our production system) got this wrong as well. Some day, I'll write a post asking why that change was done between 1.4 and 6.x. If it was intentional or by accident. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org