Re: Wicket And GAE

2010-04-10 Thread Juha Palomäki
I think the main issue is that for the development mode you need to
disable resource polling, since that is using threads (which are not
supported in GAE). This is described here:
http://stronglytypedblog.blogspot.com/2009/04/wicket-on-google-app-engine.html

One "problem" with this is that this obviously disables the resource
reloading, which might be slightly annoying when developing. There
might be more elegant solutions to this, but in order to overcome this
I wrote my own ModificationWatcher implementation (see code below). My
own modificationwatcher does not use threads, instead you must
manually call it every now and then so that it will see if the
resources have been changed.

In order to use my StaticModificationWatcher, you need to include the
following stuff in your Wicket Application class.

@Override
protected void init() {
super.init();
// your standard init stuff goes here
if("development".equalsIgnoreCase(getConfigurationType())) {
staticModificationWatcher = new 
StaticModificationWatcher();

getResourceSettings().setResourceWatcher(staticModificationWatcher);

getResourceSettings().setResourcePollFrequency(Duration.ONE_SECOND);

getResourceSettings().setAddLastModifiedTimeToResourceReferenceUrl(true);
} else {

getResourceSettings().setAddLastModifiedTimeToResourceReferenceUrl(false);
getResourceSettings().setResourcePollFrequency(null);
}

@Override
public RequestCycle newRequestCycle(Request request, Response response) {
// In deploymentmode we are not using the 
staticModificationWatcher
if(staticModificationWatcher != null) {
staticModificationWatcher.RunCheck();
}
return super.newRequestCycle(request, response);
}   


And the  StaticModicationWatcher.java


import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import org.apache.wicket.util.listener.ChangeListenerSet;
import org.apache.wicket.util.listener.IChangeListener;
import org.apache.wicket.util.time.Duration;
import org.apache.wicket.util.time.Time;
import org.apache.wicket.util.watch.IModifiable;
import org.apache.wicket.util.watch.IModificationWatcher;

public class StaticModificationWatcher implements IModificationWatcher {

private static StaticModificationWatcher instance;

private static final class Entry {
// The most recent lastModificationTime polled on the object
Time lastModifiedTime;

// The set of listeners to call when the modifiable changes
final ChangeListenerSet listeners = new ChangeListenerSet();

// The modifiable thing
IModifiable modifiable;
}

private Map listeners;

/**
 * Call this method regularly
 */
public void RunCheck() {
// Use a separate list to avoid concurrent modification 
exceptions (notifying
// the listener might cause a call to the add -method of this 
class)
Collection toBeNotified = new
ArrayList();
for(Entry entry : listeners.values()) {

if(entry.modifiable.lastModifiedTime().equals(entry.lastModifiedTime)
== false) {
toBeNotified.add(entry.listeners);
//  entry.listeners.notifyListeners();  

}
entry.lastModifiedTime = 
entry.modifiable.lastModifiedTime();
}
for(ChangeListenerSet changeListenerSet : toBeNotified) {
changeListenerSet.notifyListeners();
}
}

public StaticModificationWatcher() {
listeners = Collections.synchronizedMap(
new HashMap());
}

@Override
public boolean add(IModifiable modifiable, IChangeListener listener) {
boolean contains = listeners.containsKey(modifiable);
if(contains == false) {
Entry entry = new Entry();
entry.modifiable = modifiable;
entry.lastModifiedTime = modifiable.lastModifiedTime();
listeners.put(modifiable, entry);
}
listeners.get(modifiable).listeners.add(listener);

return contains;
}

@Override
public void destroy() {
// nothing to do

}

@Override
public Set getEntries() {
return listeners.keySet()

Re: LDM, Forms, and Ajax

2010-03-14 Thread Juha Palomäki
Could you post the source code for the page that is having the problems?

On Fri, Mar 12, 2010 at 4:47 AM, Matthew Welch  wrote:
> I'm experimenting with a domain model that extremely interconnected. It's
> being persisted using a graph database which handles this high degree of
> interconnectivity with aplomb, however because my each of my domain objects
> is so tighly tied to the others, I have to be very careful to always use
> LoadableDetachableModels or I can easily end up serializing quite a bit of
> unintended data with the page.
>
> So far, this hasn't been too bad. In the past, I never used LDMs for forms,
> and I ran into a few initial issues at first, but they were mostly just me
> relearning some of my former habits. However, I have no run into an a corner
> case that I'm hoping someone with more knowledge of Wicket or a good
> creative stream might be able to help me figure out.
>
> I have a form backed by a LDM. Three of the fields (select fields) are
> cascading in the sense that I need to fill out one before the second is
> enabled and the options for the second are determined by the first. The
> cascade continues from the second to the third. I attached a
> AjaxFormComponentUpdatingBehavior tied to the "onblur" event for the first
> and second fields. I used this update the second and third fields when
> appropriate. This seemed to work fine, but then suddenly I ran into problems
> with the fields reverting back to the values they held before I modified
> them. I'm embarrassed to admin that I was stumped by this for a good thirty
> minutes until I remembered that this was all backed by a LDM. Obviously,
> when the ajax request would hit the server, the model would be reloaded from
> the back end with it's original values.
>
> I'm a bit stuck. I can make the form a little less fancy and not limit the
> items in the second and third fields from the value in the first and second
> respectively, but I'd prefer not to have to do that. Any ideas?
>
> Matt
>

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



Re: UI Layout

2010-03-08 Thread Juha Palomäki
One thing in the page vs panels discussion is also inheritance vs
composition. So do you construct the layout of the UI by inhering it
or do you take the mashup style -approach.

I've started thinking that it might be better to use panels for
functionality (for example CustomerEdit, CustomerAdd) and then use
some kind of page structure around those to control the navigation.
Something where you could have for example two completely different
navigation systems on the application at the same time.

br, Juha

On Mon, Mar 8, 2010 at 10:44 AM, Juha Palomäki  wrote:
> Here's what we have been using for CRUD stuff:
>
> Domain:
> Customer
> - name : String
> - industry : String
> - primaryContact : Contact
>
> Contact
> - name : String
> - Address : String
> - Email: String
>
> Pages:
> CustomerBasePage (abstact)
> CustomerAddPage
> CustomerEditPage
> CustomerViewPage
>
> Panels:
> CustomerBasePanel
> CustomerEditPanel
> CustomerViewPanel
>
> ContactBasePanel
> ContactEditPanel
> ContactViewPanel
>
> Most of the service layer -references are on the page-level. For
> example pages take care of retrieving customer from DB and persisting
> changes. The panels just receive IModel.
>
> There are separate pages for add and edit, because those operations
> need to be handled differently. On the other hand the same edit
> -panels are used for both add and edit.
>
> One page can then host multiple panels. For example the
> CustomerViewPage could also host OrderViewPanel.
>
> The base -level does not contain that much functionality in many
> cases, but we have localization stuff there. For example the
> CustomerEditPanel and CustomerAddPanel share most of field labels, so
> there are stored in CustomerBasePanel.xml
>
> This leads to quite many classes, but on the other hand the classes
> are simple and straightforward in most cases. I find it more easier to
> deal with many simple classes than with few complex. To manage all the
> classes, I prefer to use package structure like this:
>
> org.example.app.customer.web.page
> org.example.app.customer.web.panel
> org.example.app.customer.web.support (custom models and other
> "support" stuff goes here)
> org.example.app.order.web.page
> org.example.app.order.web.panel
> org.example.app.order.web.support
>
> However I must say that I'm not completely satisfied with this
> approach. For example with the pages we can't simply create a nice
> ajax tabpanel that would contain CustomerViewPage, OrdersViewPage and
> ContactsViewPage.
>
>
> br, Juha
>
>
> On Fri, Mar 5, 2010 at 1:41 PM, nino martinez wael
>  wrote:
>> +1 for multiple page + abstract base page..
>>
>> 2010/2/26 Frank Silbermann 
>>
>>> Single page versus multi-page application?
>>>
>>>
>>>
>>> Some people build a single-page application in which panels are replaced
>>> dynamically.  With this approach, the single page is analogous to a
>>> Swing JFrame, to whom components are added and removed (or made visible
>>> or invisible as needed).
>>>
>>>
>>>
>>> Many people prefer to have separate pages for different functionality --
>>> and this is necessary if the user is to be able to bookmark several
>>> different pages.  To do this, many people use markup inheritance, in
>>> which sub-pages inherit from the base page, and the sub-page mark-up is
>>> combined with the base-page mark-up.  (Though it is to be generalized in
>>> the future, I believe currently there can be only a single place in the
>>> base page where the sub-page's components can go.)
>>>
>>>
>>>
>>>
>>>
>>> I prefer to use a base page which contains one or more panels to be
>>> defined by the sub-pages, via abstract panel-creation methods called by
>>> the base page.  However, Wicket convention is to add components in the
>>> page constructor, and calling an overridden method from a constructor is
>>> bad.  (The overridden method will not be able to use anything set up in
>>> the sub-page's constructor, due to the order in which constructors are
>>> called.)  I solve this problem by making my base pages inherit from the
>>> following:
>>>
>>>
>>>
>>> public class DelayedAssemblyWebPage extends WebPage {
>>>
>>>    protected boolean componentsAssembled = false;
>>>
>>>
>>>
>>>   �...@override
>>>
>>>    protected void onBeforeRender() {
>>>
>>>        if ( !componentsAssembled 

Re: UI Layout

2010-03-08 Thread Juha Palomäki
Here's what we have been using for CRUD stuff:

Domain:
Customer
- name : String
- industry : String
- primaryContact : Contact

Contact
- name : String
- Address : String
- Email: String

Pages:
CustomerBasePage (abstact)
CustomerAddPage
CustomerEditPage
CustomerViewPage

Panels:
CustomerBasePanel
CustomerEditPanel
CustomerViewPanel

ContactBasePanel
ContactEditPanel
ContactViewPanel

Most of the service layer -references are on the page-level. For
example pages take care of retrieving customer from DB and persisting
changes. The panels just receive IModel.

There are separate pages for add and edit, because those operations
need to be handled differently. On the other hand the same edit
-panels are used for both add and edit.

One page can then host multiple panels. For example the
CustomerViewPage could also host OrderViewPanel.

The base -level does not contain that much functionality in many
cases, but we have localization stuff there. For example the
CustomerEditPanel and CustomerAddPanel share most of field labels, so
there are stored in CustomerBasePanel.xml

This leads to quite many classes, but on the other hand the classes
are simple and straightforward in most cases. I find it more easier to
deal with many simple classes than with few complex. To manage all the
classes, I prefer to use package structure like this:

org.example.app.customer.web.page
org.example.app.customer.web.panel
org.example.app.customer.web.support (custom models and other
"support" stuff goes here)
org.example.app.order.web.page
org.example.app.order.web.panel
org.example.app.order.web.support

However I must say that I'm not completely satisfied with this
approach. For example with the pages we can't simply create a nice
ajax tabpanel that would contain CustomerViewPage, OrdersViewPage and
ContactsViewPage.


br, Juha


On Fri, Mar 5, 2010 at 1:41 PM, nino martinez wael
 wrote:
> +1 for multiple page + abstract base page..
>
> 2010/2/26 Frank Silbermann 
>
>> Single page versus multi-page application?
>>
>>
>>
>> Some people build a single-page application in which panels are replaced
>> dynamically.  With this approach, the single page is analogous to a
>> Swing JFrame, to whom components are added and removed (or made visible
>> or invisible as needed).
>>
>>
>>
>> Many people prefer to have separate pages for different functionality --
>> and this is necessary if the user is to be able to bookmark several
>> different pages.  To do this, many people use markup inheritance, in
>> which sub-pages inherit from the base page, and the sub-page mark-up is
>> combined with the base-page mark-up.  (Though it is to be generalized in
>> the future, I believe currently there can be only a single place in the
>> base page where the sub-page's components can go.)
>>
>>
>>
>>
>>
>> I prefer to use a base page which contains one or more panels to be
>> defined by the sub-pages, via abstract panel-creation methods called by
>> the base page.  However, Wicket convention is to add components in the
>> page constructor, and calling an overridden method from a constructor is
>> bad.  (The overridden method will not be able to use anything set up in
>> the sub-page's constructor, due to the order in which constructors are
>> called.)  I solve this problem by making my base pages inherit from the
>> following:
>>
>>
>>
>> public class DelayedAssemblyWebPage extends WebPage {
>>
>>    protected boolean componentsAssembled = false;
>>
>>
>>
>>   �...@override
>>
>>    protected void onBeforeRender() {
>>
>>        if ( !componentsAssembled ) {
>>
>>            try {
>>
>>                assembleComponents();
>>
>>                componentsAssembled = true;
>>
>>            } catch (Exception e) {
>>
>>                throw new RuntimeException(e);
>>
>>            }
>>
>>        }
>>
>>        super.onBeforeRender();
>>
>>    }
>>
>>
>>
>>    abstract protected void assembleComponents() throws Exception {}
>>
>> }
>>
>>
>>
>> So my application base page would look something like this:
>>
>>
>>
>> public class MyApplicationBasePage extends DelayedAssemblyWebPage {
>>
>>
>>    protected void assembleComponents() throws Exception {
>>
>>        // Add some components.
>>
>>        // Panels to be defined in subclasses are added
>>
>>        // by calling:
>>
>>        //
>>
>>        //     add( createPanel_A("a_wicket_id") );
>>
>>        //
>>
>>        // and
>>
>>        //
>>
>>        //     add( createPanel_B("some_other_wicket_id") );
>>
>>    }
>>
>>
>>
>>    abstract protected Panel createPanel_A( String panelWicketID );
>>
>>    abstract protected Panel createPanel_B( String panelWicketID );
>>
>> }
>>
>>
>>
>> Concrete child pages would look something like this:
>>
>>
>>
>> public class OneConcreteChildPage extends MyApplicationBasePage {
>>
>>
>>
>>    protected Panel createPanel_A( String panelWicketID ) {
>>
>>             return new WhateverPanel(panelWicketID,...);
>>
>>    }
>>
>>    protected Panel createPanel_B( String panelW

Re: Large number components and redering time

2010-02-19 Thread Juha Palomäki
If you want to avoid mixing HTML and Java, you could write your
component with using a templating engine, such as Velocity or
Freemarker.

I believe there is wicket-velocity project somewhere that provides for
example Panels that can render Velocity templates files.

br, Juha

On Thu, Feb 18, 2010 at 9:22 AM,   wrote:
> Hi,
>
> Igor Vaynberg wrote:
>>
>> i would imagine you would have the same problem even in a local
>> environment such as swing...
>
> absolutely, I was just wondering what would be the best way to do it in
> Wicket...
>
>> the solution is quiet simple, instead of using wicket components to
>> model the table and the cell simply use a single component that writes
>> out html for the entire table.
>
> That's the solution a friend of mine suggested as well since he had similar
> problems in ZK. I was reluctant since writing out HTML felt somewhat
> un-wicket-ish. But I think that's the way to go for this kind of
> situation...
>
> Thanks everybody for your suggestions and comments.
>
> J.
>
>
>
> __
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> __
>
> -
> 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 YUI integration

2009-08-31 Thread Juha Palomäki
At least there used to be some YUI related things in WicketStuff project.

br, Juha

On Mon, Aug 31, 2009 at 6:59 PM, Frank van
Lankvelt wrote:
> een building some of them by hand, including browser version
> checks, and have some code to enable YUI widgets.
> This is a costly business where we are severely hampered by
> compatibility requirements. (IE6!)
>
> Are there widget libraries out there, in particular that integrate
> with YUI, that I've been missing?
>
> Related to this, about a year ago there was a discussion about Wicket
> Ajax Next Generation.

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



Re: IndexOutOfBoundsException on ListView model add()

2009-08-13 Thread Juha Palomäki
Here's some stuff that might be relevant if you want to use a ListView
inside a form:
http://wicketinaction.com/2008/10/building-a-listeditor-form-component/

A quote from the page "A common question on Wicket mailing lists is
“Why doesn’t my ListView work as expected in a Form?”. There can be
many possible answers, but the core issue is that ListView was never
designed to work as a form component"

br, Juha

On Fri, Aug 14, 2009 at 2:14 AM, Dane Laverty wrote:
> In case anyone else ends up with a similar error, here's the solution I
> ended up using. (Yes, I'm sure it's an awful hack, but right now it works
> for me.)
>
> First, I swapped the Set/List implementation I was using in Employer Info
> [1], since I realized that the items affected in my previously generated
> List weren't getting passed back to the Set. Then I passed my ListView the
> list directly, rather than wrapped in a model [2]. The AjaxSubmitLink adds
> to that list, by way of the ListView's model [3]. Then, when the user wanted
> to save the updated List, I had to explicitly re-set it in the Form model
> [4].
>
> That resolved my IndexOutOfBoundsException issue. However, when I tried to
> persist the list, I got an org.hibernate.NonUniqueObjectException. This is
> my first Hibernate/Wicket project, so I'm pretty clueless about that one.
> Searching the list, I found a post by Eelco [5] that mentioned using
> Hibernate's Session.evict(), so I implemented that in the persist function
> of the DAO [6]. Now it appears to be working!
>
> --
>
> [1] - public class EmployerInfo extends PersonInfoImpl {
>    ...
>    List contactPointsList;
>
>    public List getContactPoints() {
>        return contactPointsList;
>    }
>
>    public void setContactPoints(List contactPointsList) {
>        this.contactPointsList = contactPointsList;
>    }
>
>    public Set getContactPointsSet() {
>        return new HashSet(contactPointsList);
>    }
>
>    public void setContactPointsSet(Set contactPointsSet) {
>        List list = new
> ArrayList(contactPointsSet);
>        Collections.sort(list);
>        contactPointsList = list;
>    }
> }
>
>
>
> [2] - final ListView contactPointsListView = new
> ListView("contactPoints",
> employerInfoModel.getObject().getContactPoints()) {...};
>
>
> [3] - new AjaxSubmitLink("addContactLink", this) {
>               �...@override
>                public void onSubmit(AjaxRequestTarget target, Form form)
> {
>                    contactPointsListView.getModelObject().add(new
> ContactPointImpl());
>                    target.addComponent(contactPointsContainer);
>                }
>
>
> [4] - new SubmitLink("saveContactPoints") {
>               �...@override
>                public void onSubmit() {
>                    super.onSubmit();
>
> employerInfoModel.getObject().setContactPoints(contactPointsListView.getModelObject());
>
> personInfoDao.persistOrMerge(employerInfoModel.getObject());
>                    info("Your account has been updated.");
>                }
>
> [5] - http://www.nabble.com/delete-onSubmit-td22839614.html#a22839614
>
> [6] - public void persistOrMerge(PersonInfo personInfo) {
>        getHibernateTemplate().evict(personInfo);
>        try {
>            getHibernateTemplate().saveOrUpdate(personInfo);
>        } catch (Exception e) {
>            getHibernateTemplate().merge(personInfo);
>        }
>    }
>

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



Re: RequestCycle.setRequestTarget() behaviour

2009-08-09 Thread Juha Palomäki
This seems to be the expected behaviour for RedirectRequestTarget.

Wiki suggests ExternalLink as an alternative, if you want to go
outside the web app:
http://cwiki.apache.org/WICKET/how-to-redirect-to-an-external-non-wicket-page.html

br, Juha

On Mon, Aug 10, 2009 at 9:39 AM, Nils Weinander wrote:
> Hi all
>
> I am having a minor problem with RequestCycle.setRequestTarget()
> in Wicket 1.4. Before I do a workaround I have to check if I have
> simply missed out on something.
>
> Assume my application is found at http://mydomain.com/mywebapp
>
> I expected
>
> getRequestCycle().setRequestTarget(
>        new RedirectRequestTarget("/anotherwebapp/page"));
>
> to redirect to
>
> http://mydomain.com/anotherwebapp/page
>
> considering the initial / but it doesn't, redirecting instead
> to
>
> http://mydomain.com/mywebapp/anotherwebapp/page
>
> Am I doing anything wrong? Is this so by intention?
>
> getRequestCycle().setRequestTarget(
>        new RedirectRequestTarget(
>                "http://mydomain.com/anotherwebapp/page";));
>
>
> I assume I can find http://mydomain.com from the HttpServletRequest
> as a workaround.
>
> --
> mogul | nils.weinan...@mogul.com
> hudiksvallsgatan 4, 113 30 stockholm sweden
> +46 8 506 66 100 |  +46 709 78 28 37
> skype:nils.weinander
> www.mogul.com Part of the Addnode Group
>
> -
> 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: FW: Auto-response for your message to the "Wicket-stuff-user" mailing list

2009-05-12 Thread Juha Palomäki
Take a look at this,
http://forums-beta.sun.com/thread.jspa?messageID=3895301

It seems to describe the same problem you are having. Multiple
versions of the same class in your classpath.

Br,
Juha

On Mon, May 11, 2009 at 10:26 PM, Clermont, Teddy
 wrote:
>
> When running the contrib-wicketJasperReportsExample, I am getting the
> following error:
> 40439 [http-8080-1] ERROR
> org.apache.wicket.request.target.resource.ComponentRes
> ourceRequestTarget - error handling resource request for component
> [MarkupContai
> ner [Component id = linkToHtml]], on page [Page class =
> com.example.ReportLinksP
> age, id = 0, version = 0], listener IResourceListener - null
> java.lang.reflect.InvocationTargetException
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at
> org.apache.wicket.request.target.resource.ComponentResourceRequestTar
> get.respond(ComponentResourceRequestTarget.java:69)
>        at
> org.apache.wicket.request.AbstractRequestCycleProcessor.respond(Abstr
> actRequestCycleProcessor.java:105)
>        at
> org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.j
> ava:1200)
>        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1271)
>        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1370)
>        at org.apache.wicket.RequestCycle.request(RequestCycle.java:501)
>        at
> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:
> 455)
>        at
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.ja
> va:288)
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
> icationFilterChain.java:235)
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
> ilterChain.java:206)
>        at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
> alve.java:233)
>        at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
> alve.java:175)
>        at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
> ava:128)
>        at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
> ava:102)
>        at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
> ve.java:109)
>        at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
> a:286)
>        at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
> :844)
>        at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
> ss(Http11Protocol.java:583)
>        at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
> 7)
>        at java.lang.Thread.run(Thread.java:595)
> Caused by: org.apache.wicket.WicketRuntimeException:
> net.sf.jasperreports.engine
> .JRException: Error loading object from file :
> C:\WicketLibWkSpace\testJasperRep
> orts\src\webapp\reports\example.jasper
>        at
> wicket.contrib.jasperreports.JRResource.getJasperReport(JRResource.ja
> va:230)
>        at
> wicket.contrib.jasperreports.JRResource.getFileName(JRResource.java:3
> 33)
>        at
> wicket.contrib.jasperreports.JRResource.setHeaders(JRResource.java:48
> 2)
>        at
> org.apache.wicket.markup.html.WebResource.configureResponse(WebResour
> ce.java:53)
>        at
> org.apache.wicket.Resource.onResourceRequested(Resource.java:121)
>        at
> org.apache.wicket.markup.html.link.ResourceLink.onResourceRequested(R
> esourceLink.java:108)
>        ... 24 more
> Caused by: net.sf.jasperreports.engine.JRException: Error loading object
> from fi
> le :
> C:\WicketLibWkSpace\testJasperReports\src\webapp\reports\example.jasper
>        at
> net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:96
> )
>        at
> wicket.contrib.jasperreports.JRResource$3.newJasperReport(JRResource.
> java:191)
>        at
> wicket.contrib.jasperreports.JRResource.getJasperReport(JRResource.ja
> va:226)
>        ... 29 more
> Caused by: java.io.InvalidClassException:
> net.sf.jasperreports.engine.base.JRBas
> eReport; local class incompatible: stream classdesc serialVersionUID =
> 10001, lo
> cal class serialVersionUID = 10200
>        at
> java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:546)
>        at
> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:155
> 2)
>        at
> java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
>        at
> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:155
> 2)
>        at
> java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
>        at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
> 699)
>        at
> java.io.ObjectInputStream.readObject0(ObjectInputSt

Re: Google App Engine and Wicket

2009-05-11 Thread Juha Palomäki
File uploads seem to be causing some problems. On Wicket uploaded
files are first written to some temporary file and on AppEngine this
is obviously not possible. I haven't yet investigated if it is easy to
change this behavior in Wicket. Another option might be to write a
separate servlet for just handling the uploads,
http://code.google.com/appengine/kb/java.html#fileforms

Br,
Juha

On Sat, Apr 11, 2009 at 5:15 PM, Matthew Welch  wrote:
> I've been experimenting a bit with Google App Engine and Wicket and things
> seemed to work fairly well once I turned off the ModificationWatcher.
> However, I realized that my simple tests were all stateless and that once
> stateful, Wicket would use the DiskPageStore to write some files, which is
> not allowed in the App Engine sandbox. Sure enough, once I added some
> stateful pages, I started seeing exceptions related to the DiskPageStore.
>
> I'm a neophyte when it comes to the deep down Wicket internals so I'm not
> sure what my other options might be. In a post Matej  Knopp said, ""*
> DiskPageStore*'s purpose is to store serialized pages on disk in order to
> allow access to previous page versions and also to conserve session memory
> usage." This leads me to believe that using the sassion for storing this
> information isn't a preferred approach. What about the App Engine's
> datastore (an abstration on BigTable)? That seems like it might be too slow
> to adequately serve this need, but I'm not sure. A thread on
> Wicket/Terracotta integration ended up with an alternative
> "SecondLevelCacheSessionStore" but I'm not sure if that is only usable with
> Terracotta or if it might might sense in other situations. Any other
> options?
>
> Also, looking forward, with the knoledge that writing giles and spawning new
> threads are not allowed in the App Engine sandbox, are there any other items
> I should be onl the lookout for in Wicket that might make it a poor choice
> for this situation?
>
> Matt
>

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



Re: DropDownChoice with ChoiceRender problem

2009-05-05 Thread Juha Palomäki
I think the exception "org.apache.wicket.WicketRuntimeException: No
get method defined for class: class java.lang.String expression: id"
means that Wicket is looking for the getId() method from String, not
from your own SelectOption.

Br,
Juha

On Tue, May 5, 2009 at 4:48 AM, Phillip Rhodes  wrote:
> It's of type String
>
> Thanks
>
> On May 4, 2009, at 3:23 PM, James Carman wrote:
>
>> The "handicapAccess" property is of type?
>>
>> On Mon, May 4, 2009 at 2:29 PM, Phillip Rhodes
>>  wrote:
>>>
>>> Hi everyone,
>>> Sorry for posting this problem but I have been stuck for far too many
>>> hours on this.  Using wicket 1.4  Appreciate any help on this very very
>>> much.
>>>
>>> I have a pojo object called "address" that has a property of
>>> "handicapAccess"
>>> I am trying to bind this property to a dropdown list with 3 choices
>>> (formated as name/value)
>>> Yes/Y
>>> No/N
>>> Unknown/U
>>>
>>> If I use the constructor of ChoiceRenderer(String displayExpression), No
>>> error, but my property is bound as
>>> com.reffects.dmi.admin.wicket.address.detail.selectopt...@9aa8fd
>>> If I use the constructor of ChoiceRenderer(java.lang.String
>>> displayExpression, java.lang.String idExpression), I get an error
>>> "org.apache.wicket.WicketRuntimeException: No get method defined for class:
>>> class java.lang.String expression: id"
>>> Although my SelectOption class has getId/setId
>>>
>>>
>>> List options = new ArrayList();
>>> options.add(new SelectOption("Yes", "Y"));
>>> options.add(new SelectOption("No", "N"));
>>> options.add(new SelectOption("Unknown", "U"));
>>>
>>> //org.apache.wicket.WicketRuntimeException: No get method defined for
>>> class: class java.lang.String expression: id
>>> ChoiceRenderer choiceRenderer = new ChoiceRenderer("name","id");
>>>
>>> //this choice render gives it a
>>> //
>>> com.reffects.dmi.admin.wicket.address.detail.selectopt...@9aa8fd
>>> //ChoiceRenderer choiceRenderer = new ChoiceRenderer("name");
>>> PropertyModel model = new PropertyModel(address, "handicapAccess");
>>>
>>> DropDownChoice ddc = new DropDownChoice("dropDownChoice",
>>> model,options,choiceRenderer);
>>>
>>>
>>> //Here's my SelectOption
>>> public class SelectOption implements Serializable {
>>>       /**
>>>        *
>>>        */
>>>       private static final long serialVersionUID = 1L;
>>>       private String name;
>>>       private String id;
>>>
>>>       public SelectOption(String name, String id) {
>>>               this.name = name;
>>>               this.id = id;
>>>       }
>>>
>>>       public String getName() {
>>>               return name;
>>>       }
>>>
>>>       public void setName(String name) {
>>>               this.name = name;
>>>       }
>>>
>>>       public String getId() {
>>>               return id;
>>>       }
>>>
>>>       public void setId(String id) {
>>>               this.id = id;
>>>       }
>>>
>>> }
>>>
>>>
>>>
>>>
>>>
>>>
>>> -
>>> 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-jasper UI

2009-05-04 Thread Juha Palomäki
Here are some rough instructions. If you for example want to embed the
HTML report on a web page, you need:
- instance of JRResource (there are several implementations, depending
on what kind of output you want to have)
- a  report (either as File or as InputStream)
- datasource

1. Instantiate new JRHtmlResource, pass the File or InputStream to the
constructor, depending on where you compiled report-file is coming
from.

2. Use the setConnectionProvider to pass in an implementation of
IDatabaseConnectionProvider that will return a JDBC connection to the
database

3. Specify report parameters with setReportParameters method. At least
some older versions require you to do this even if you don't have
parameters to pass (you can use an empty map).

4. In order to render the report, you just use EmbeddedHtmlReport
component, which takes in the JRResource reference and otherwise acts
as a normal label.

If you want to provide links to the reports, you can use
JRResourceLink component which takes in JRResource.

Br,
Juha

On Mon, May 4, 2009 at 8:42 AM, raviJPYADAV  wrote:
>
> Hi , can you please share some sample code how to integrate this api with our
> code?
>
> --Ravi

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