RE: CSS Templating

2010-05-08 Thread Chris Colman
That method of css generation you propose would be generating CSS (even
if it were into a separate .css file) with each page render. If you're
dealing with a lot of CSS that probably isn't the most efficient method.

Generating CSS at render time would mean the browser could not take
advantage of CSS caching - which would be bad in these days of quite
large CSS files.

You might be better off considering a separate CSS generator that
doesn't generate CSS at 'page render time'.


-Original Message-
From: Eric Hamel [mailto:dantehick...@gmail.com]
Sent: Saturday, 8 May 2010 5:52 AM
To: users@wicket.apache.org
Subject: CSS Templating

All,

I've been exploring the use of TextTemplateHeaderContributor.forCss
method
to build a CSS template for multiple application.

Take for example:

IModelMapString, Object model = new
AbstractReadOnlyModelMapString,Object(){

private static final long serialVersionUID = 1L;

@Override
public MapString, Object getObject() {
 HashMapString,Object map = new HashMapString, Object();
map.put(body-bgcolor, red);
 return map;
}

};
 add(TextTemplateHeaderContributor.forCss(WelcomePage.class,
Template.css,
model));

with CSS template:

body{

background-color: ${body-bgcolor};

}



The output works. However, the template is contributing to the header
in
the
form of:

style type=text/css!-- body{ background-color: red; }--/style

which is unacceptable. Is there a way to generate a .css file to be
used by
the application ?

Thank you

--
Sent by Eric Hamel

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



org.hibernate.HibernateException: createCriteria is not valid without active transaction

2010-05-08 Thread Richard Slide
Hello all,
i try to do a simple web application with the classic layout
Wicket-Spring-Hibernate

When i try to make a simple request i receive the following error.

WicketMessage: Error attaching this container for rendering: [Page class =
ch.myexample.ListContacts, id = 0, version = 0]
Root cause:
org.hibernate.HibernateException: createCriteria is not valid without active
transaction

In IMHO all file conf seams to be correct correct... bat i don't undestand
hibenate dosen't find the correct session.

At UI level i load the data with LoadableDetachableModel

IModel contactsModel = new LoadableDetachableModel() {
protected Object load() {
return
WicketApplication.get().getContactService().findAllContacts();
}
};

--applicationContext from here --

bean id=dataSource class=org.apache.commons.dbcp.BasicDataSource
property name=driverClassName
value${jdbc.driver}/value
/property
property name=url
value${jdbc.url}/value
/property
property name=username
value${jdbc.username}/value
/property
property name=password
value${jdbc.password}/value
/property
/bean

 !-- hibernate session factory --
bean id=sessionFactory

class=org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
property name=dataSource ref=dataSource /
property name=hibernateProperties
props
prop key=hibernate.dialect${hibernate.dialect}/prop
prop key=hibernate.connection.pool_size5/prop
prop
key=hibernate.current_session_context_classthread/prop
prop key=hibernate.show_sqltrue/prop
prop
key=hibernate.cglib.use_reflection_optimizertrue/prop
prop
key=hibernate.cache.provider_classorg.hibernate.cache.EhCacheProvider/prop
prop
key=hibernate.hibernate.cache.use_query_cachetrue/prop
/props
/property
property name=annotatedClasses
list
value
ch.myexample.domain.Contact
/value
/list
/property
/bean

!-- setup transaction manager--
bean id=transactionManager

class=org.springframework.orm.hibernate3.HibernateTransactionManager
property name=sessionFactory
ref bean=sessionFactory /
/property
/bean
tx:annotation-driven /
bean id=ContactDao class=ch.myexample.dao.impl.ContactDaoImpl
property name=sessionFactory ref=sessionFactory /
/bean
bean id=LocalServiceService
class=ch.myexample.services.LocalServiceImpl
property name=contactDao ref=ContactDao /
/bean
bean id=wicketApplication class=ch.myexample.WicketApplication
/bean
/beans


--
--applicationContext to here --

and web.xml

context-param
param-namecontextConfigLocation/param-name
param-value classpath:applicationContext.xml/param-value
/context-param
filter
filter-namewicket.WebProject/filter-name
filter-classorg.apache.wicket.protocol.http.WicketFilter
/filter-class
init-param
param-nameapplicationFactoryClassName
/param-name
param-value
org.apache.wicket.spring.SpringWebApplicationFactory
/param-value
/init-param
init-param
param-nameapplicationBean/param-name
param-value wicketApplication/param-value
/init-param
/filter
filter
filter-nameopensessioninview/filter-name
filter-class

org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
/filter-class
/filter
filter-mapping
filter-nameopensessioninview/filter-name
url-pattern/*/url-pattern
/filter-mapping
filter-mapping
filter-namewicket.WebProject/filter-name
url-pattern/*/url-pattern
/filter-mapping
listener

listener-classorg.springframework.web.context.ContextLoaderListener
/listener-class
/listener
/web-app


Could you tell me where is my mistake please

Cheers

--Richard


Re: org.hibernate.HibernateException: createCriteria is not valid without active transaction

2010-05-08 Thread Karolina Rusin
Hello Richard,

Maybe you need to use @Transactional above your dao method?
Hope this helps.

Best regards,
Karolina Rusin


2010/5/8 Richard Slide richard.sl...@gmail.com

 Hello all,
 i try to do a simple web application with the classic layout
 Wicket-Spring-Hibernate

 When i try to make a simple request i receive the following error.

 WicketMessage: Error attaching this container for rendering: [Page class =
 ch.myexample.ListContacts, id = 0, version = 0]
 Root cause:
 org.hibernate.HibernateException: createCriteria is not valid without
 active
 transaction

 In IMHO all file conf seams to be correct correct... bat i don't undestand
 hibenate dosen't find the correct session.

 At UI level i load the data with LoadableDetachableModel

 IModel contactsModel = new LoadableDetachableModel() {
protected Object load() {
return
 WicketApplication.get().getContactService().findAllContacts();
}
};

 --applicationContext from here --

 bean id=dataSource class=org.apache.commons.dbcp.BasicDataSource
property name=driverClassName
value${jdbc.driver}/value
/property
property name=url
value${jdbc.url}/value
/property
property name=username
value${jdbc.username}/value
/property
property name=password
value${jdbc.password}/value
/property
/bean

 !-- hibernate session factory --
bean id=sessionFactory


 class=org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
property name=dataSource ref=dataSource /
property name=hibernateProperties
props
prop key=hibernate.dialect${hibernate.dialect}/prop
prop key=hibernate.connection.pool_size5/prop
prop
 key=hibernate.current_session_context_classthread/prop
prop key=hibernate.show_sqltrue/prop
prop
 key=hibernate.cglib.use_reflection_optimizertrue/prop
prop

 key=hibernate.cache.provider_classorg.hibernate.cache.EhCacheProvider/prop
prop
 key=hibernate.hibernate.cache.use_query_cachetrue/prop
/props
/property
property name=annotatedClasses
list
value
ch.myexample.domain.Contact
/value
/list
/property
/bean

!-- setup transaction manager--
bean id=transactionManager

 class=org.springframework.orm.hibernate3.HibernateTransactionManager
property name=sessionFactory
ref bean=sessionFactory /
/property
/bean
tx:annotation-driven /
bean id=ContactDao class=ch.myexample.dao.impl.ContactDaoImpl
property name=sessionFactory ref=sessionFactory /
/bean
bean id=LocalServiceService
 class=ch.myexample.services.LocalServiceImpl
property name=contactDao ref=ContactDao /
/bean
bean id=wicketApplication class=ch.myexample.WicketApplication
/bean
 /beans


 --
 --applicationContext to here --

 and web.xml

 context-param
param-namecontextConfigLocation/param-name
param-value classpath:applicationContext.xml/param-value
/context-param
filter
filter-namewicket.WebProject/filter-name
filter-classorg.apache.wicket.protocol.http.WicketFilter
/filter-class
init-param
param-nameapplicationFactoryClassName
/param-name
param-value
 org.apache.wicket.spring.SpringWebApplicationFactory
/param-value
/init-param
init-param
param-nameapplicationBean/param-name
param-value wicketApplication/param-value
/init-param
/filter
filter
filter-nameopensessioninview/filter-name
filter-class

 org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
/filter-class
/filter
filter-mapping
filter-nameopensessioninview/filter-name
url-pattern/*/url-pattern
/filter-mapping
filter-mapping
filter-namewicket.WebProject/filter-name
url-pattern/*/url-pattern
/filter-mapping
listener

 listener-classorg.springframework.web.context.ContextLoaderListener
/listener-class
/listener
 /web-app


 Could you tell me where is my mistake please

 Cheers

 --Richard



about serialVersionUID in all components

2010-05-08 Thread Joe Fawzy
Hi all

what are the side effects of setting serialVersionUID  on all page classes
and components
private static final long serialVersionUID = 1L;

i am developing an application which will be deployed on appengine
appengine handle sessions by storing them in the memcache and data store as
there is no local filesystem
for its memcache everything must be Serializable, and as the session is
stored in the datastore , your session may last for several weeks even if
the web container expires it
Ok, when i develop my classes may change a lot hence the
auto serialVersionUID changes, making appengine complain as its session does
not expires

anyway , i think setting private static final long serialVersionUID = 1L; on
every component will resolve it on appengine side,
but ,what about wicket side? does it have any implications or side effects?

thanks
Joe


Re: org.hibernate.HibernateException: createCriteria is not valid without active transaction

2010-05-08 Thread Richard Slide
Yes i did it...
this is DAO and impl




public interface DaoT extends DomainObject {

@Transactional
void delete(T o);

T load(long id);

@Transactional
void save(T o);

@Transactional
ListT findAll();

int countAll();
}

and the implemetation  is

public abstract class AbstractHibernateDaoImplT extends DomainObject
implements DaoT {

  private ClassT domainClass;

  private SessionFactory sf;

  public AbstractHibernateDaoImpl(ClassT domainClass) {
this.domainClass = domainClass;
  }

  public SessionFactory getSessionFactory() {
return sf;
  }

  public void setSessionFactory(SessionFactory sf) {
this.sf = sf;
  }

  public void delete(T object) {
getSession().delete(object);
  }

  @SuppressWarnings(unchecked)
  public T load(long id) {
return (T) getSession().get(domainClass, id);
  }

  public void save(T object) {
getSession().saveOrUpdate(object);
  }

  @SuppressWarnings(unchecked)
  public ListT findAll() {
Criteria criteria = getSession().createCriteria(domainClass);
return (ListT) criteria.list();
  }

  public int countAll() {
Criteria criteria = getSession().createCriteria(domainClass);
criteria.setProjection(Projections.rowCount());
return (Integer) criteria.uniqueResult();
  }

  public Session getSession() {
// presumes a current session, which we have through the
// OpenSessionInViewFilter; doesn't work without that
return sf.getCurrentSession();
  }
}




On Sat, May 8, 2010 at 12:05 PM, Karolina Rusin iluu.li...@gmail.comwrote:

 Hello Richard,

 Maybe you need to use @Transactional above your dao method?
 Hope this helps.

 Best regards,
 Karolina Rusin


 2010/5/8 Richard Slide richard.sl...@gmail.com

  Hello all,
  i try to do a simple web application with the classic layout
  Wicket-Spring-Hibernate
 
  When i try to make a simple request i receive the following error.
 
  WicketMessage: Error attaching this container for rendering: [Page class
 =
  ch.myexample.ListContacts, id = 0, version = 0]
  Root cause:
  org.hibernate.HibernateException: createCriteria is not valid without
  active
  transaction
 
  In IMHO all file conf seams to be correct correct... bat i don't
 undestand
  hibenate dosen't find the correct session.
 
  At UI level i load the data with LoadableDetachableModel
 
  IModel contactsModel = new LoadableDetachableModel() {
 protected Object load() {
 return
  WicketApplication.get().getContactService().findAllContacts();
 }
 };
 
  --applicationContext from here --
 
  bean id=dataSource class=org.apache.commons.dbcp.BasicDataSource
 property name=driverClassName
 value${jdbc.driver}/value
 /property
 property name=url
 value${jdbc.url}/value
 /property
 property name=username
 value${jdbc.username}/value
 /property
 property name=password
 value${jdbc.password}/value
 /property
 /bean
 
  !-- hibernate session factory --
 bean id=sessionFactory
 
 
 
 class=org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
 property name=dataSource ref=dataSource /
 property name=hibernateProperties
 props
 prop key=hibernate.dialect${hibernate.dialect}/prop
 prop key=hibernate.connection.pool_size5/prop
 prop
  key=hibernate.current_session_context_classthread/prop
 prop key=hibernate.show_sqltrue/prop
 prop
  key=hibernate.cglib.use_reflection_optimizertrue/prop
 prop
 
 
 key=hibernate.cache.provider_classorg.hibernate.cache.EhCacheProvider/prop
 prop
  key=hibernate.hibernate.cache.use_query_cachetrue/prop
 /props
 /property
 property name=annotatedClasses
 list
 value
 ch.myexample.domain.Contact
 /value
 /list
 /property
 /bean
 
 !-- setup transaction manager--
 bean id=transactionManager
 
  class=org.springframework.orm.hibernate3.HibernateTransactionManager
 property name=sessionFactory
 ref bean=sessionFactory /
 /property
 /bean
 tx:annotation-driven /
 bean id=ContactDao class=ch.myexample.dao.impl.ContactDaoImpl
 property name=sessionFactory ref=sessionFactory /
 /bean
 bean id=LocalServiceService
  class=ch.myexample.services.LocalServiceImpl
 property name=contactDao ref=ContactDao /
 /bean
 bean id=wicketApplication class=ch.myexample.WicketApplication
 /bean
  /beans
 
 
  --
  --applicationContext to here --
 
  and web.xml
 
  context-param
 param-namecontextConfigLocation/param-name
 param-value classpath:applicationContext.xml/param-value
 /context-param
 filter
 

Re: org.hibernate.HibernateException: createCriteria is not valid without active transaction

2010-05-08 Thread James Carman
Put it on the impl class.

On Sat, May 8, 2010 at 7:43 AM, Richard Slide richard.sl...@gmail.com wrote:
 Yes i did it...
 this is DAO and impl




 public interface DaoT extends DomainObject {

   �...@transactional
    void delete(T o);

    T load(long id);

   �...@transactional
    void save(T o);

   �...@transactional
    ListT findAll();

    int countAll();
 }

 and the implemetation  is

 public abstract class AbstractHibernateDaoImplT extends DomainObject
    implements DaoT {

  private ClassT domainClass;

  private SessionFactory sf;

  public AbstractHibernateDaoImpl(ClassT domainClass) {
    this.domainClass = domainClass;
  }

  public SessionFactory getSessionFactory() {
    return sf;
  }

  public void setSessionFactory(SessionFactory sf) {
    this.sf = sf;
  }

  public void delete(T object) {
    getSession().delete(object);
  }

 �...@suppresswarnings(unchecked)
  public T load(long id) {
    return (T) getSession().get(domainClass, id);
  }

  public void save(T object) {
    getSession().saveOrUpdate(object);
  }

 �...@suppresswarnings(unchecked)
  public ListT findAll() {
    Criteria criteria = getSession().createCriteria(domainClass);
    return (ListT) criteria.list();
  }

  public int countAll() {
    Criteria criteria = getSession().createCriteria(domainClass);
    criteria.setProjection(Projections.rowCount());
    return (Integer) criteria.uniqueResult();
  }

  public Session getSession() {
    // presumes a current session, which we have through the
    // OpenSessionInViewFilter; doesn't work without that
    return sf.getCurrentSession();
  }
 }




 On Sat, May 8, 2010 at 12:05 PM, Karolina Rusin iluu.li...@gmail.comwrote:

 Hello Richard,

 Maybe you need to use @Transactional above your dao method?
 Hope this helps.

 Best regards,
 Karolina Rusin


 2010/5/8 Richard Slide richard.sl...@gmail.com

  Hello all,
  i try to do a simple web application with the classic layout
  Wicket-Spring-Hibernate
 
  When i try to make a simple request i receive the following error.
 
  WicketMessage: Error attaching this container for rendering: [Page class
 =
  ch.myexample.ListContacts, id = 0, version = 0]
  Root cause:
  org.hibernate.HibernateException: createCriteria is not valid without
  active
  transaction
 
  In IMHO all file conf seams to be correct correct... bat i don't
 undestand
  hibenate dosen't find the correct session.
 
  At UI level i load the data with LoadableDetachableModel
 
  IModel contactsModel = new LoadableDetachableModel() {
             protected Object load() {
                 return
  WicketApplication.get().getContactService().findAllContacts();
             }
         };
 
  --applicationContext from here --
 
  bean id=dataSource class=org.apache.commons.dbcp.BasicDataSource
         property name=driverClassName
             value${jdbc.driver}/value
         /property
         property name=url
             value${jdbc.url}/value
         /property
         property name=username
             value${jdbc.username}/value
         /property
         property name=password
             value${jdbc.password}/value
         /property
     /bean
 
      !-- hibernate session factory --
     bean id=sessionFactory
 
 
 
 class=org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
         property name=dataSource ref=dataSource /
         property name=hibernateProperties
             props
                 prop key=hibernate.dialect${hibernate.dialect}/prop
                 prop key=hibernate.connection.pool_size5/prop
                 prop
  key=hibernate.current_session_context_classthread/prop
                 prop key=hibernate.show_sqltrue/prop
                 prop
  key=hibernate.cglib.use_reflection_optimizertrue/prop
                 prop
 
 
 key=hibernate.cache.provider_classorg.hibernate.cache.EhCacheProvider/prop
                 prop
  key=hibernate.hibernate.cache.use_query_cachetrue/prop
             /props
         /property
         property name=annotatedClasses
             list
                 value
                     ch.myexample.domain.Contact
                 /value
             /list
         /property
     /bean
 
     !-- setup transaction manager    --
     bean id=transactionManager
 
  class=org.springframework.orm.hibernate3.HibernateTransactionManager
         property name=sessionFactory
             ref bean=sessionFactory /
         /property
     /bean
     tx:annotation-driven /
     bean id=ContactDao class=ch.myexample.dao.impl.ContactDaoImpl
         property name=sessionFactory ref=sessionFactory /
     /bean
     bean id=LocalServiceService
  class=ch.myexample.services.LocalServiceImpl
         property name=contactDao ref=ContactDao /
     /bean
     bean id=wicketApplication class=ch.myexample.WicketApplication
     /bean
  /beans
 
 
  --
  --applicationContext to here --
 
  and web.xml
 
  context-param
         param-namecontextConfigLocation/param-name
         

Re: about serialVersionUID in all components

2010-05-08 Thread Martin Voigt
We're doing exactly that all the time on our wicket/GAE apps and
haven't run into problems. Only thing we had to change was: static
references to components and ajax don't mix well, but one shouldn't do
this anyway.

regards

On 8 May 2010 13:12, Joe Fawzy joewic...@gmail.com wrote:
 Hi all

 what are the side effects of setting serialVersionUID  on all page classes
 and components
 private static final long serialVersionUID = 1L;

 i am developing an application which will be deployed on appengine
 appengine handle sessions by storing them in the memcache and data store as
 there is no local filesystem
 for its memcache everything must be Serializable, and as the session is
 stored in the datastore , your session may last for several weeks even if
 the web container expires it
 Ok, when i develop my classes may change a lot hence the
 auto serialVersionUID changes, making appengine complain as its session does
 not expires

 anyway , i think setting private static final long serialVersionUID = 1L; on
 every component will resolve it on appengine side,
 but ,what about wicket side? does it have any implications or side effects?

 thanks
 Joe


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



Re: org.hibernate.HibernateException: createCriteria is not valid without active transaction

2010-05-08 Thread Richard Slide
I did it.

On Sat, May 8, 2010 at 2:00 PM, James Carman
jcar...@carmanconsulting.comwrote:

 Put it on the impl class.

 On Sat, May 8, 2010 at 7:43 AM, Richard Slide richard.sl...@gmail.com
 wrote:
  Yes i did it...
  this is DAO and impl
 
 
 
 
  public interface DaoT extends DomainObject {
 
 @Transactional
 void delete(T o);
 
 T load(long id);
 
 @Transactional
 void save(T o);
 
 @Transactional
 ListT findAll();
 
 int countAll();
  }
 
  and the implemetation  is
 
  public abstract class AbstractHibernateDaoImplT extends DomainObject
 implements DaoT {
 
   private ClassT domainClass;
 
   private SessionFactory sf;
 
   public AbstractHibernateDaoImpl(ClassT domainClass) {
 this.domainClass = domainClass;
   }
 
   public SessionFactory getSessionFactory() {
 return sf;
   }
 
   public void setSessionFactory(SessionFactory sf) {
 this.sf = sf;
   }
 
   public void delete(T object) {
 getSession().delete(object);
   }
 
   @SuppressWarnings(unchecked)
   public T load(long id) {
 return (T) getSession().get(domainClass, id);
   }
 
   public void save(T object) {
 getSession().saveOrUpdate(object);
   }
 
   @SuppressWarnings(unchecked)
   public ListT findAll() {
 Criteria criteria = getSession().createCriteria(domainClass);
 return (ListT) criteria.list();
   }
 
   public int countAll() {
 Criteria criteria = getSession().createCriteria(domainClass);
 criteria.setProjection(Projections.rowCount());
 return (Integer) criteria.uniqueResult();
   }
 
   public Session getSession() {
 // presumes a current session, which we have through the
 // OpenSessionInViewFilter; doesn't work without that
 return sf.getCurrentSession();
   }
  }
 
 
 
 
  On Sat, May 8, 2010 at 12:05 PM, Karolina Rusin iluu.li...@gmail.com
 wrote:
 
  Hello Richard,
 
  Maybe you need to use @Transactional above your dao method?
  Hope this helps.
 
  Best regards,
  Karolina Rusin
 
 
  2010/5/8 Richard Slide richard.sl...@gmail.com
 
   Hello all,
   i try to do a simple web application with the classic layout
   Wicket-Spring-Hibernate
  
   When i try to make a simple request i receive the following error.
  
   WicketMessage: Error attaching this container for rendering: [Page
 class
  =
   ch.myexample.ListContacts, id = 0, version = 0]
   Root cause:
   org.hibernate.HibernateException: createCriteria is not valid without
   active
   transaction
  
   In IMHO all file conf seams to be correct correct... bat i don't
  undestand
   hibenate dosen't find the correct session.
  
   At UI level i load the data with LoadableDetachableModel
  
   IModel contactsModel = new LoadableDetachableModel() {
  protected Object load() {
  return
   WicketApplication.get().getContactService().findAllContacts();
  }
  };
  
   --applicationContext from here --
  
   bean id=dataSource class=org.apache.commons.dbcp.BasicDataSource
  property name=driverClassName
  value${jdbc.driver}/value
  /property
  property name=url
  value${jdbc.url}/value
  /property
  property name=username
  value${jdbc.username}/value
  /property
  property name=password
  value${jdbc.password}/value
  /property
  /bean
  
   !-- hibernate session factory --
  bean id=sessionFactory
  
  
  
 
 class=org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean
  property name=dataSource ref=dataSource /
  property name=hibernateProperties
  props
  prop
 key=hibernate.dialect${hibernate.dialect}/prop
  prop key=hibernate.connection.pool_size5/prop
  prop
   key=hibernate.current_session_context_classthread/prop
  prop key=hibernate.show_sqltrue/prop
  prop
   key=hibernate.cglib.use_reflection_optimizertrue/prop
  prop
  
  
 
 key=hibernate.cache.provider_classorg.hibernate.cache.EhCacheProvider/prop
  prop
   key=hibernate.hibernate.cache.use_query_cachetrue/prop
  /props
  /property
  property name=annotatedClasses
  list
  value
  ch.myexample.domain.Contact
  /value
  /list
  /property
  /bean
  
  !-- setup transaction manager--
  bean id=transactionManager
  
  
 class=org.springframework.orm.hibernate3.HibernateTransactionManager
  property name=sessionFactory
  ref bean=sessionFactory /
  /property
  /bean
  tx:annotation-driven /
  bean id=ContactDao class=ch.myexample.dao.impl.ContactDaoImpl
  property name=sessionFactory ref=sessionFactory /
  /bean
  bean id=LocalServiceService
   class=ch.myexample.services.LocalServiceImpl
  property 

Re: CSS Templating

2010-05-08 Thread Alex Objelean

If you are trying to achieve css variables, you may want to consider using
wro4j: (http://code.google.com/p/wro4j/wiki/GettingStarted). It does support
css variables, besides other dozen features (like less css meta framework
integration, merge, minification, cache, build time  runtime solution,
etc). It integrates very easy in any j2ee application and is compatible with
jdk-1.5  servlet-api-2.3.

Alex Objelean
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CSS-Templating-tp2135587p2136149.html
Sent from the Wicket - User 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: org.hibernate.HibernateException: createCriteria is not valid without active transaction

2010-05-08 Thread James Carman
By the way, you might want to check out domdrides.  It has all this
implemented and tested for you

On May 8, 2010 8:41 AM, Richard Slide richard.sl...@gmail.com wrote:

I did it.

On Sat, May 8, 2010 at 2:00 PM, James Carman
jcar...@carmanconsulting.comwrote:


 Put it on the impl class.

 On Sat, May 8, 2010 at 7:43 AM, Richard Slide richard.sl...@gmail
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Javascript templating? Removing java code mixed with js

2010-05-08 Thread nino martinez wael
take a look at inputevents in wicketstuff, it uses the javascript
template james mention..

2010/5/7 Anthony DePalma fatef...@gmail.com:
 I recently developed a component that can be added to any form to put
 a character countdown div next to any textarea. Just for some
 background, the component constructor is:
 CharacterCountdownPanel(String id, TextArea textArea, int charLimit).

 The textarea is necessary because the countdown panel needs to know
 the id of the generated markup (Although while typing this, I realize
 it might be useful for textfields as well, so that may change). But
 one issue I often encounter with components like these is the need to
 generate highly dynamic javascript, and I really dislike mixing up
 java string concatenation with multiline js functions.

 Does anyone do anything to reduce this language mismatch? One idea I
 had was to pull the entire javascript function into its own file, and
 use something similar to Wicket's property file handling, and have a
 model pull all the dynamic values into the script. I could use a
 regular property file, but I don't know if it makes sense to put the
 entire js function as a single property in one giant line. Any
 suggestions?

 -
 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: Inline Javascript comments

2010-05-08 Thread Igor Vaynberg
strange that its a problem for nothing else but liferay...

-igor

On Fri, May 7, 2010 at 2:43 AM, Jérôme Schell jerome.sch...@cpe.fr wrote:
 Hello,

 Working on integration of a wicket portlet in the upcoming Liferay 6, I
 am currently facing a problem with the way Wicket encapsulates inline
 javascript.
 Looking at my page header I see that type of thing (the id have been
 shortened to avoid line breaks):
 script type=text/javascript id=**!--/*--![CDATA[/*!--*/
 wicketAjaxDebugEnable=true;
 /*--]]*//script

 The thing is that Liferay now strips out the carriage returns on
 embedded javascript, so the sequence became (shortened):
 !--/*--![CDATA[/*!--*/Code here/*--]]*/

 The javascript is then not executed.
 Seeing this, I am wondering if the comment added by Wicket is correct.
 It seems there is not a good match between /* and */ so that would
 explain that the code is considered as beeing commented out and so not
 executed...

 Any thought on this?

 Regards,
 --
 Jérôme

 -
 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



Multiple apps on single server

2010-05-08 Thread Ján Raska
Hello,

I'm thinking about making small business by selling/renting e-shop and CMS 
applications written in Wicket. Now I'm trying to figure out, how many such 
applications can be hosted on a single server (let's assume 2x Dual Core Xeon 
2.66 GHz, 4GB RAM). Except wicket, I'll use Spring and Hibernate or 
EclipseLink, libs in total shouldn't have more then 20-30MB, an average 
application can be assumed to have maximum of 200 active users at one time.

Is there any way to figure it out? I'm basically trying to minimize a running 
cost per application and I love Java and Wicket too much to go back and do PHP 
stuff, though I guess it's impossible to beat PHP in terms of running cost. Can 
anybody help with this?

Thanks

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



Re: how to get some data from servlet

2010-05-08 Thread Zilvinas Vilutis

The problem is not in wicket, but in SwfUpload or more specific would be the
Adobe Flash itself - which uses IE cookies in any case, even when you're
using FF or Chrome or Safari on Windows (
http://swfupload.org/forum/generaldiscussion/869 )

Not sure how secure is it - but I've solved this in the following way:
- I've created a SecureSessionHolder static class which holds a list of
secure session ids
- Adding the secure session id to the list in SecureSessionHolder on
authentification
- an impl of HttpSessionListener to remove the session ids from the static
list in SecureSessionHolder when session is destroyed
- in the SwfUpload servler just check if the session id ( passed as a submit
parameter ) is in the secure session list in SecureSessionHolder before
parsing the response data

If anybody has got any security concerns on this impl - please notify me,
I'll appreciate any opinions

-

nothing is impossible
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-get-some-data-from-servlet-tp1885531p2136546.html
Sent from the Wicket - User 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: WicketSessionFilter and empty HttpSession

2010-05-08 Thread Zilvinas Vilutis

Didn't work for me :(

-

nothing is impossible
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/WicketSessionFilter-and-empty-HttpSession-tp1888171p2136548.html
Sent from the Wicket - User 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: Any solution for the context problem with the relative links of BookmarkablePageLink?

2010-05-08 Thread Jeremy Thomerson
Is your servlet container listening directly to port 80?  If not, do the
forwarding via a proxy on whatever you are using as a frontend.  In that
frontend, have it rewrite the URLs (i.e. mod_proxy and mod_rewrite).

Otherwise, can you have your app mounted on /?

--
Jeremy Thomerson
http://www.wickettraining.com



On Sat, May 8, 2010 at 12:40 AM, Chris Colman
chr...@stepaheadsoftware.comwrote:

 I'll explain the problem in detail. I think it's similar to the link I
 provided but maybe not:

 I have a site whose home page that is rendered via:

 www.mysite.com/content/home/pName/pValue

 but obviously the users will get their via:

 www.mysite.com

 I want the home page to be serviced via a forward to
 www.mysite.com/content/home/pName/pValue

 so that the search engines don't have to experience a 301 redirect.
 (where pName/pValue are required parameters that can be passed to any
 page)

 I forward via:

 RequestDispatcher rd = servletContext.

 getRequestDispatcher(www.mysite.com/content/home/pName/pValue);
 rd.forward(req, res);

 I don't mind if all subsequent pages a user visits use the full form of
 the URL and these full URLs appear in the browser address bar. Eg.,

 www.mysite.com/content/contactUs/pName/pValue

 www.mysite.com/content/products/pName/pValue

 www.mysite.com/content/home/pName/pValue

 The forward works fine but any links on that page don't work because the
 context of the wicket web app is 'content' - a separate servlet is used
 to 'catch' URL's of the form www.mysite.com and redirects to the wicket
 app.

 All my BookmarkablePageLinks are constructed assuming the 'content'
 context. I can change that so they work from www.mysite.com but then
 when the pages with www.mysite.com/content/blah... are visited those
 same links do not work.

 -Original Message-
 From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
 Sent: Saturday, 8 May 2010 10:53 AM
 To: users@wicket.apache.org
 Subject: Re: Any solution for the context problem with the relative
 links
 of BookmarkablePageLink?
 
 That wasn't a problem - it was someone configuring the proxy
 incorrectly.
  What (specifically) are you encountering?
 
 --
 Jeremy Thomerson
 http://www.wickettraining.com
 
 
 
 On Fri, May 7, 2010 at 7:44 PM, Chris Colman
 chr...@stepaheadsoftware.comwrote:
 
  I was just wondering if there has been any developments on the
 problem
  outlined in this post because I'm having the same problem but wanted
 to
  avoid the Index link solution:
 
 
 http://apache-wicket.1842946.n4.nabble.com/BookmarkablePageLink-relative
  -path-Dilemma-td1933044.html
 
  -
  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: Multiple apps on single server

2010-05-08 Thread Jeremy Thomerson
Two things:

1 - Use Brix.  You can write your ecommerce components as tiles that can be
rearranged however you want in any site.  You can create plugins for the
admin console for management of said ecommerce shops.

2 - There's absolutely no way anybody on this list can answer your question.
 I've been to enough different businesses to know that those numbers are
entirely dependent on how you use the said frameworks.  You can use them
efficiently, or not.  You can have large object graphs, or not.  Etc.
 You'll just have to see.  But I can tell you this: there are a lot of
high-traffic Wicket applications out there running on a single server of the
capacity you mention.  Assuming you hit a load barrier, it's likely going to
be the database first - so offload the DB to its own server.  That just
increased your capacity.  Etc, etc,

--
Jeremy Thomerson
http://www.wickettraining.com



On Sat, May 8, 2010 at 4:37 PM, Ján Raska ras...@gmail.com wrote:

 Hello,

 I'm thinking about making small business by selling/renting e-shop and CMS
 applications written in Wicket. Now I'm trying to figure out, how many such
 applications can be hosted on a single server (let's assume 2x Dual Core
 Xeon 2.66 GHz, 4GB RAM). Except wicket, I'll use Spring and Hibernate or
 EclipseLink, libs in total shouldn't have more then 20-30MB, an average
 application can be assumed to have maximum of 200 active users at one time.

 Is there any way to figure it out? I'm basically trying to minimize a
 running cost per application and I love Java and Wicket too much to go back
 and do PHP stuff, though I guess it's impossible to beat PHP in terms of
 running cost. Can anybody help with this?

 Thanks

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