Re: SessionStore on database
Hi On Wed, Apr 29, 2020, 19:55 Andrea Del Bene wrote: > Hi, > > if you haven't done it yet you should have a look at WicketStuff data > store projects: > > https://github.com/wicketstuff/core/tree/master/datastores-parent > > > this should give you some good ideas. > The data stores distribute the pages. Something else should be used to distribute the http sessions. > On 29/04/20 17:30, Shengche Hsiao wrote: > > Thomas, thanks for your opinion, I'll try it > > > > On Wed, Apr 29, 2020 at 2:49 PM Thomas Heigl > wrote: > > > >> Hi, > >> > >> There are two options I'm aware of: > >> > >> - You can use a session manager in your application server that stores > your > >> session in the database. I.e. Tomcat's JDBC store. > >> - You can use Spring Session with a JDBC store > >> > >> I recently implemented Spring Session for Wicket with Redis as a backing > >> store. There are minor issues with page locking that require some custom > >> code, but otherwise it works fine. > >> > >> Best regards, > >> > >> Thomas > >> > >> On Wed, Apr 29, 2020 at 5:30 AM ShengChe Hsiao > wrote: > >> > >>> Dear all > >>> > >>> I want to implement cross datacenter session replication for my web > app, > >>> can I persist session on shared database? If it does, how can I do? > >>> > >>> I searched the web, and found org.apache.wicket.protocol.http. > >>> SecondLevelCacheSessionStore.IClusteredPageStore > >>> > >>> I have an idea for implement above interface and persist session on > >> target > >>> database, right? > >>> > >>> > >>> ---> > >>> To boldly go where no man has gone before. > >>> > >>> ---> > >>> We do this not because it is easy. We do this because it is hard. > >>> - > >>> --> > >>> If I have seen further it is by standing on the shoulders of giants. > >>> -- > >>> -> > >>> front...@gmail.com > >>> > >>> > >> > -> > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: SessionStore on database
Hi, if you haven't done it yet you should have a look at WicketStuff data store projects: https://github.com/wicketstuff/core/tree/master/datastores-parent this should give you some good ideas. On 29/04/20 17:30, Shengche Hsiao wrote: Thomas, thanks for your opinion, I'll try it On Wed, Apr 29, 2020 at 2:49 PM Thomas Heigl wrote: Hi, There are two options I'm aware of: - You can use a session manager in your application server that stores your session in the database. I.e. Tomcat's JDBC store. - You can use Spring Session with a JDBC store I recently implemented Spring Session for Wicket with Redis as a backing store. There are minor issues with page locking that require some custom code, but otherwise it works fine. Best regards, Thomas On Wed, Apr 29, 2020 at 5:30 AM ShengChe Hsiao wrote: Dear all I want to implement cross datacenter session replication for my web app, can I persist session on shared database? If it does, how can I do? I searched the web, and found org.apache.wicket.protocol.http. SecondLevelCacheSessionStore.IClusteredPageStore I have an idea for implement above interface and persist session on target database, right? ---> To boldly go where no man has gone before. ---> We do this not because it is easy. We do this because it is hard. - --> If I have seen further it is by standing on the shoulders of giants. -- -> front...@gmail.com -> - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: SessionStore on database
Thomas, thanks for your opinion, I'll try it On Wed, Apr 29, 2020 at 2:49 PM Thomas Heigl wrote: > Hi, > > There are two options I'm aware of: > > - You can use a session manager in your application server that stores your > session in the database. I.e. Tomcat's JDBC store. > - You can use Spring Session with a JDBC store > > I recently implemented Spring Session for Wicket with Redis as a backing > store. There are minor issues with page locking that require some custom > code, but otherwise it works fine. > > Best regards, > > Thomas > > On Wed, Apr 29, 2020 at 5:30 AM ShengChe Hsiao wrote: > > > Dear all > > > > I want to implement cross datacenter session replication for my web app, > > can I persist session on shared database? If it does, how can I do? > > > > I searched the web, and found org.apache.wicket.protocol.http. > > SecondLevelCacheSessionStore.IClusteredPageStore > > > > I have an idea for implement above interface and persist session on > target > > database, right? > > > > > > ---> > > To boldly go where no man has gone before. > > > > ---> > > We do this not because it is easy. We do this because it is hard. > > - > > --> > > If I have seen further it is by standing on the shoulders of giants. > > -- > > -> > > front...@gmail.com > > > > > -> > > > -- ---> We do this not because it is easy. We do this because it is hard. ---> ShengChe Hsiao ---> front...@gmail.com front...@tc.edu.tw ---> VoIP : 070-910-2450 --->
Re: SessionStore on database
Hi, There are two options I'm aware of: - You can use a session manager in your application server that stores your session in the database. I.e. Tomcat's JDBC store. - You can use Spring Session with a JDBC store I recently implemented Spring Session for Wicket with Redis as a backing store. There are minor issues with page locking that require some custom code, but otherwise it works fine. Best regards, Thomas On Wed, Apr 29, 2020 at 5:30 AM ShengChe Hsiao wrote: > Dear all > > I want to implement cross datacenter session replication for my web app, > can I persist session on shared database? If it does, how can I do? > > I searched the web, and found org.apache.wicket.protocol.http. > SecondLevelCacheSessionStore.IClusteredPageStore > > I have an idea for implement above interface and persist session on target > database, right? > > > ---> > To boldly go where no man has gone before. > > ---> > We do this not because it is easy. We do this because it is hard. > - > --> > If I have seen further it is by standing on the shoulders of giants. > -- > -> > front...@gmail.com > > -> >
SessionStore on database
Dear all I want to implement cross datacenter session replication for my web app, can I persist session on shared database? If it does, how can I do? I searched the web, and found org.apache.wicket.protocol.http. SecondLevelCacheSessionStore.IClusteredPageStore I have an idea for implement above interface and persist session on target database, right? ---> To boldly go where no man has gone before. ---> We do this not because it is easy. We do this because it is hard. - --> If I have seen further it is by standing on the shoulders of giants. -- -> front...@gmail.com ->
Re: Storing details into Database using Jquery
Hi, Your question is not related to Wicket. Better use stackoverflow.com On Jun 29, 2017 7:35 AM, "gasper" <kunlethomps...@gmail.com> wrote: > Hello, > > I am having issues updating an image and storing the location into a > database using Jquery > > Right now I can browse files and select an image an update the attribute > BT now saving it into a file and database is giving me an issue.. > > > Thanks > > -- > View this message in context: http://apache-wicket.1842946. > n4.nabble.com/Storing-details-into-Database-using-Jquery-tp4678163.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 > >
Storing details into Database using Jquery
Hello, I am having issues updating an image and storing the location into a database using Jquery Right now I can browse files and select an image an update the attribute BT now saving it into a file and database is giving me an issue.. Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Storing-details-into-Database-using-Jquery-tp4678163.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: Webpage does not refresh when ListView is based on a List supplied by a database
Hi Ulrich, If not already done, you should read the wicket free guide, in particular the model section: http://ci.apache.org/projects/wicket/guide/6.x/guide/single.html#modelsforms_1 The PropertyModel paragraph will answer your question... Happy reading best regards, Sebastien. On Sat, Jun 20, 2015 at 4:31 PM, Ulrich for...@gombers.de wrote: @Ernesto, I understand, that the idea of the LoadableDetachableModule is to get rid of the storage occupied by the list to avoid an overhead of serialization. To get sort of dynamics it mus be nested with a PropertyModel, isn't it? I will give it a try tomorrow. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Webpage-does-not-refresh-when-ListView-is-based-on-a-List-supplied-by-a-database-tp4671251p4671268.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: Webpage does not refresh when ListView is based on a List supplied by a database
@Sebastien, thanks - works. I had started this way, but didn't get the ListView becoming instantiated. Trying again now worked fine. Nevertheless I still can't tell why the both of the approaches react different; I had implemented it as far as I can see alike. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Webpage-does-not-refresh-when-ListView-is-based-on-a-List-supplied-by-a-database-tp4671251p4671267.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: Webpage does not refresh when ListView is based on a List supplied by a database
@Ernesto, I understand, that the idea of the LoadableDetachableModule is to get rid of the storage occupied by the list to avoid an overhead of serialization. To get sort of dynamics it mus be nested with a PropertyModel, isn't it? I will give it a try tomorrow. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Webpage-does-not-refresh-when-ListView-is-based-on-a-List-supplied-by-a-database-tp4671251p4671268.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: Webpage does not refresh when ListView is based on a List supplied by a database
Hi, PropertyModel pm = new PropertyModel(this, dataList); ListListData werte = (ListListData) pm.getObject(); final ListView listView = new ListView(listentries, werte ) You need to pass a model to the list view: final ListView listView = new ListView(listentries, new PropertyModelListListData(this, dataList)) Also please note that you should avoid unwraping a model (calling #getObject) in the constructor... Hope this helps, Sebastien. On Fri, Jun 19, 2015 at 9:03 PM, Ulrich for...@gombers.de wrote: Want to refresh page and show curently added entry to database. But does not work. To trap down the reason I've created two applications which are very similiar. Both show a java.util.List - on is filled from a database the other one immediately from the program (ListString[].add()). The second one is fine, the first one is in no way dynamic; even Browser refresh does not display the new entry; I have to call the whole URL again. What is wrong with my assumptions. Any hint is appreciated. brgds Ulrich *Database-Sample:* package com.mycompany; import java.io.IOException; import java.util.Date; import java.util.List; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.form.AjaxButton; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListView; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.model.Model; import org.apache.wicket.model.PropertyModel; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import de.gombers.accounts.dao.mybatis.ListData; import de.gombers.accounts.dao.mybatis.ListDataDAO; public class HomePage extends WebPage { private static final Logger LOGGER = LoggerFactory.getLogger(HomePage.class); private static final long serialVersionUID = 1L; private ListListData dataList; public HomePage(final PageParameters parameters) { super(parameters); Form form = new Form(form); PropertyModel pm = new PropertyModel(this, dataList); ListListData werte = (ListListData) pm.getObject(); final ListView listView = new ListView(listentries, werte ) { @Override protected void populateItem(ListItem item) { final ListData data= (ListData) item.getModelObject(); item.add(new Label(mydate, new Model() { @Override public String getObject() { return data.getMyDate().toString(); } })); item.add(new Label(mytext, new Model(){ @Override public String getObject() { return data.getMyText(); } })); } }; listView.setOutputMarkupId(true); form.add(listView); AjaxButton submit = new AjaxButton(addEntry){ @Override protected void onSubmit(AjaxRequestTarget target, Form? form) { ListData data = new ListData(); data.setMyData(new Date()); data.setMyText(myText);; try { new ListDataDAO().insertNewEntry(data); } catch (IOException e) { // TODO Auto-generated catch block // e.printStackTrace(); } try { dataList=new ListDataDAO().getAllData(); } catch (IOException e) { LOGGER.error(, e); } target.add(form); } }; form.add(submit); add(form); } public ListListData getDataList() { try { dataList=new ListDataDAO().getAllData(); LOGGER.info(ListDataSize2={}, dataList.size()); } catch (IOException e) { LOGGER.error(, e
Re: Webpage does not refresh when ListView is based on a List supplied by a database
Listview might be chancing your List? Use instead an LDM that always fetch fresh copy of the List... On Fri, Jun 19, 2015 at 9:03 PM, Ulrich for...@gombers.de wrote: Want to refresh page and show curently added entry to database. But does not work. To trap down the reason I've created two applications which are very similiar. Both show a java.util.List - on is filled from a database the other one immediately from the program (ListString[].add()). The second one is fine, the first one is in no way dynamic; even Browser refresh does not display the new entry; I have to call the whole URL again. What is wrong with my assumptions. Any hint is appreciated. brgds Ulrich *Database-Sample:* package com.mycompany; import java.io.IOException; import java.util.Date; import java.util.List; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.form.AjaxButton; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListView; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.model.Model; import org.apache.wicket.model.PropertyModel; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import de.gombers.accounts.dao.mybatis.ListData; import de.gombers.accounts.dao.mybatis.ListDataDAO; public class HomePage extends WebPage { private static final Logger LOGGER = LoggerFactory.getLogger(HomePage.class); private static final long serialVersionUID = 1L; private ListListData dataList; public HomePage(final PageParameters parameters) { super(parameters); Form form = new Form(form); PropertyModel pm = new PropertyModel(this, dataList); ListListData werte = (ListListData) pm.getObject(); final ListView listView = new ListView(listentries, werte ) { @Override protected void populateItem(ListItem item) { final ListData data= (ListData) item.getModelObject(); item.add(new Label(mydate, new Model() { @Override public String getObject() { return data.getMyDate().toString(); } })); item.add(new Label(mytext, new Model(){ @Override public String getObject() { return data.getMyText(); } })); } }; listView.setOutputMarkupId(true); form.add(listView); AjaxButton submit = new AjaxButton(addEntry){ @Override protected void onSubmit(AjaxRequestTarget target, Form? form) { ListData data = new ListData(); data.setMyData(new Date()); data.setMyText(myText);; try { new ListDataDAO().insertNewEntry(data); } catch (IOException e) { // TODO Auto-generated catch block // e.printStackTrace(); } try { dataList=new ListDataDAO().getAllData(); } catch (IOException e) { LOGGER.error(, e); } target.add(form); } }; form.add(submit); add(form); } public ListListData getDataList() { try { dataList=new ListDataDAO().getAllData(); LOGGER.info(ListDataSize2={}, dataList.size()); } catch (IOException e) { LOGGER.error(, e); } return dataList; } } *ListArray-Sample:* package com.mycompany; import java.io.IOException; import java.util.ArrayList; import java.util.Date; import java.util.List; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.ajax.AjaxRequestTarget; import
Webpage does not refresh when ListView is based on a List supplied by a database
Want to refresh page and show curently added entry to database. But does not work. To trap down the reason I've created two applications which are very similiar. Both show a java.util.List - on is filled from a database the other one immediately from the program (ListString[].add()). The second one is fine, the first one is in no way dynamic; even Browser refresh does not display the new entry; I have to call the whole URL again. What is wrong with my assumptions. Any hint is appreciated. brgds Ulrich *Database-Sample:* package com.mycompany; import java.io.IOException; import java.util.Date; import java.util.List; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.form.AjaxButton; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListView; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.model.Model; import org.apache.wicket.model.PropertyModel; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import de.gombers.accounts.dao.mybatis.ListData; import de.gombers.accounts.dao.mybatis.ListDataDAO; public class HomePage extends WebPage { private static final Logger LOGGER = LoggerFactory.getLogger(HomePage.class); private static final long serialVersionUID = 1L; private ListListData dataList; public HomePage(final PageParameters parameters) { super(parameters); Form form = new Form(form); PropertyModel pm = new PropertyModel(this, dataList); ListListData werte = (ListListData) pm.getObject(); final ListView listView = new ListView(listentries, werte ) { @Override protected void populateItem(ListItem item) { final ListData data= (ListData) item.getModelObject(); item.add(new Label(mydate, new Model() { @Override public String getObject() { return data.getMyDate().toString(); } })); item.add(new Label(mytext, new Model(){ @Override public String getObject() { return data.getMyText(); } })); } }; listView.setOutputMarkupId(true); form.add(listView); AjaxButton submit = new AjaxButton(addEntry){ @Override protected void onSubmit(AjaxRequestTarget target, Form? form) { ListData data = new ListData(); data.setMyData(new Date()); data.setMyText(myText);; try { new ListDataDAO().insertNewEntry(data); } catch (IOException e) { // TODO Auto-generated catch block // e.printStackTrace(); } try { dataList=new ListDataDAO().getAllData(); } catch (IOException e) { LOGGER.error(, e); } target.add(form); } }; form.add(submit); add(form); } public ListListData getDataList() { try { dataList=new ListDataDAO().getAllData(); LOGGER.info(ListDataSize2={}, dataList.size()); } catch (IOException e) { LOGGER.error(, e); } return dataList; } } *ListArray-Sample:* package com.mycompany; import java.io.IOException; import java.util.ArrayList; import java.util.Date; import java.util.List; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.form.AjaxButton; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.list.ListItem; import
Re: show image retrieved from database
Hi Guys You may find this discussion useful about reading from databases as well. http://apache-wicket.1842946.n4.nabble.com/Displaying-Images-Stored-in-DB-on-Openshift-td4666463.html#a4666595 Thanks David On 26 March 2015 at 02:26, sabmoonie sabmoo...@gmail.com wrote: I've been searching for solutions on how to show an image using its location(absolute path) and your code helped me a lot. Been under stress the past days due to this problem. Thanks Mr. ORACLEADF! Btw, for those who wants to know how to convert a File() to byte[] use this: try { File file = new File(imagefilePath); byte[] byteArray = new byte[file.length()](); byteArray = FileUtils.readFileToByteArray(file); }catch(Exception e){ e.printStackTrace(); } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/show-image-retrieved-from-database-tp4658009p4670098.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: how to use PropertyModel for saving image to database
Hi Andrea, i have tried your saying again and solved the problem :) thank you so much... the solution is, final FileUploadField fileUploadField = new FileUploadField(fileUpload, new IModelListlt;FileUpload() { public ListFileUpload getObject() { return null; } public void setObject(ListFileUpload object) { } public void detach() { } }); form.add(fileUploadField); ... . AjaxButton submit = new AjaxButton(submit) { @Override protected void onError(AjaxRequestTarget target1, Form? form) { feedbackPanel.setVisible(true); super.onError(target1, form); target1.add(wrapper); } @Override protected void onSubmit(AjaxRequestTarget ajaxRequestTarget, Form? form) { user1.setPhoto(fileUploadField.getFileUpload().getBytes()); -important user1Dao.save(user1); ajaxRequestTarget.add(wrapper); } }; form.add(submit); wrapper.add(form); -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-use-PropertyModel-for-saving-image-to-database-tp4667580p4667612.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: how to use PropertyModel for saving image to database
Hi, FileUploadField works with IModelFileUpload only. Usually you keep the fileUpload in your component and explicitly do something with its bytes in your #onSubmit(). Hope this helps Sven On 09/21/2014 01:58 AM, Hasan Çelik wrote: hi, i have a file upload process for image. fileupload.java https://gist.github.com/cortix/9079660 User1.java https://gist.github.com/cortix/f5fbc0a137d6acfa9b40 fileupload.html https://gist.github.com/cortix/9082148 i got this error https://gist.github.com/cortix/9079743 ... final FileUploadField fileUpload = new FileUploadField(fileUpload,new PropertyModel(user1, photo)); form.add(fileUpload); ... i think i should change my ProperyModel or the method for images to save database because in my pojo class my object type is byte[]... When i use this way, i get error... i am thinking if this PropertyModel change, i can fix this problem but i don't know how can i use this PropertyModel for byte type.. Web Site : www.berkadem.com E-mail: hasance...@berkadem.com Phone: +90 312 473 38 86 Mobile Phone: +90 544 640 96 25 Address : Öveçler 4. Cadde 1325.sokak No:5/1 Çankaya ANKARA - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: how to use PropertyModel for saving image to database
Can you show an example using with (user1, photo)because i want to wrap my pojo class(User1.java) information with FileUploadField Thank you again your answer :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-use-PropertyModel-for-saving-image-to-database-tp4667580p4667583.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: how to use PropertyModel for saving image to database
You can try something like this: FileUploadField fileUpload = new FileUploadField(fileUpload,new ModelFileUpload()); form.add(fileUpload); ... AjaxButton submit = new AjaxButton(submit) { //onError @Override protected void onSubmit(AjaxRequestTarget ajaxRequestTarget, Form? form) { user1.setConsultantApproval(); user1.setPhoto(fileUpload.getFileUpload().getBytes()); user1Dao.save(user1); ajaxRequestTarget.add(wrapper); } }; Can you show an example using with (user1, photo)because i want to wrap my pojo class(User1.java) information with FileUploadField Thank you again your answer :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-use-PropertyModel-for-saving-image-to-database-tp4667580p4667583.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: how to use PropertyModel for saving image to database
only i can use your saying this way, final FileUploadField fileUploadField = new FileUploadField(fileUpload, new IModelListlt;FileUpload() { public ListFileUpload getObject() { return null; } public void setObject(ListFileUpload object) { } public void detach() { } }); because i am getting error java.lang.NullPointerException when i use ModelFileUpload(), anyway, i didnt understand :( only i want to hold my pojo class information into FileUploadField... the solution works when i use diffrent object type like these final TextField email = new TextField(email, new PropertyModelString(user1, email)); email.setRequired(true); email.add(EmailAddressValidator.getInstance()); form.add(email); final PasswordTextField password = new PasswordTextField(password, new PropertyModelString(user1, password)); password.setRequired(true); form.add(password); -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-use-PropertyModel-for-saving-image-to-database-tp4667580p4667586.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
how to use PropertyModel for saving image to database
hi, i have a file upload process for image. fileupload.java https://gist.github.com/cortix/9079660 User1.java https://gist.github.com/cortix/f5fbc0a137d6acfa9b40 fileupload.html https://gist.github.com/cortix/9082148 i got this error https://gist.github.com/cortix/9079743 ... final FileUploadField fileUpload = new FileUploadField(fileUpload,new PropertyModel(user1, photo)); form.add(fileUpload); ... i think i should change my ProperyModel or the method for images to save database because in my pojo class my object type is byte[]... When i use this way, i get error... i am thinking if this PropertyModel change, i can fix this problem but i don't know how can i use this PropertyModel for byte type.. Web Site : www.berkadem.com E-mail: hasance...@berkadem.com Phone: +90 312 473 38 86 Mobile Phone: +90 544 640 96 25 Address : Öveçler 4. Cadde 1325.sokak No:5/1 Çankaya ANKARA
Paging and excessive database access (repeaters)
Hi, I'm following the example in the repeaters section for paging through large amounts of data: http://www.wicket-library.com/wicket-examples-6.0.x/repeater/wicket/bookmarkable/org.apache.wicket.examples.repeater.PagingPage Based on the example and how I've had to implement this there is a lot of data access. First is in the ContactDataProvider. The function iterator queries for the set of data that will be displayed. Next, all the objects that are returned need to be wrapped in a DetachableContactModel. The load mechanism here then loads each individual object from the datastore. In the example, the data is in memory. In a real world scenario the data is likely to be remote and this setup could have a significant performance impact. Is there some way to cut out some of the data access? For example, can I get rid of DetachableContactModel and just use the data retrieved through the ContactDataProvider? Thanks, Daniel
RE: Paging and excessive database access (repeaters)
Take a look at the Apache Wicket Cookbook: http://www.packtpub.com/article/apache-wicket-displaying-data-using-datatabl e It caches the data for the request. Also others have implemented such caching mechanism: http://opensource.55minutes.com/apidocs/fiftyfive-wicket-all/4.0/fiftyfive/w icket/data/DtoDataProvider.html I usually only cache the count() since it depends on what's in the cell after all (especially for the foreign keys when you want to display a name and not an ID). ~ Thank you, Paul Bors -Original Message- From: Daniel Watrous [mailto:dwmaill...@gmail.com] Sent: Tuesday, June 11, 2013 11:56 AM To: users@wicket.apache.org Subject: Paging and excessive database access (repeaters) Hi, I'm following the example in the repeaters section for paging through large amounts of data: http://www.wicket-library.com/wicket-examples-6.0.x/repeater/wicket/bookmark able/org.apache.wicket.examples.repeater.PagingPage Based on the example and how I've had to implement this there is a lot of data access. First is in the ContactDataProvider. The function iterator queries for the set of data that will be displayed. Next, all the objects that are returned need to be wrapped in a DetachableContactModel. The load mechanism here then loads each individual object from the datastore. In the example, the data is in memory. In a real world scenario the data is likely to be remote and this setup could have a significant performance impact. Is there some way to cut out some of the data access? For example, can I get rid of DetachableContactModel and just use the data retrieved through the ContactDataProvider? Thanks, Daniel - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Paging and excessive database access (repeaters)
This example is not quite optimized. The DetachableContactModel's constructor is public DetachableContactModel(Contact c) { this(c.getId()); } but it should be: public DetachableContactModel(Contact c) { this(c.getId()); setObject(c); } The way it's done in the example although the model is given the contact, it stores only its id and needs to load it from the database in order to access it, even while rendering the table. The way I suggest the model is given the contact and does not need to load it. So, the way it's done in the example database access is as follows: - a list query to get the contacts for a given page - n queries by id, one for each row The way I'm suggesting database access is as follows: - a list query to get the contacts for a give page - no other queties If the row contains say a link column that accesses the row model in the ajax click, then you will see an additional database access by id when the DetachableContactModel is attached. Cheers Marios On Tue, Jun 11, 2013 at 6:56 PM, Daniel Watrous dwmaill...@gmail.comwrote: Hi, I'm following the example in the repeaters section for paging through large amounts of data: http://www.wicket-library.com/wicket-examples-6.0.x/repeater/wicket/bookmarkable/org.apache.wicket.examples.repeater.PagingPage Based on the example and how I've had to implement this there is a lot of data access. First is in the ContactDataProvider. The function iterator queries for the set of data that will be displayed. Next, all the objects that are returned need to be wrapped in a DetachableContactModel. The load mechanism here then loads each individual object from the datastore. In the example, the data is in memory. In a real world scenario the data is likely to be remote and this setup could have a significant performance impact. Is there some way to cut out some of the data access? For example, can I get rid of DetachableContactModel and just use the data retrieved through the ContactDataProvider? Thanks, Daniel
Re: Paging and excessive database access (repeaters)
So what I'm hearing is that I have to use the Detachable model, but that I can build in some caching to prevent unnecessary datastore access. Thanks. On Tue, Jun 11, 2013 at 1:11 PM, Marios Skounakis msc...@gmail.com wrote: This example is not quite optimized. The DetachableContactModel's constructor is public DetachableContactModel(Contact c) { this(c.getId()); } but it should be: public DetachableContactModel(Contact c) { this(c.getId()); setObject(c); } The way it's done in the example although the model is given the contact, it stores only its id and needs to load it from the database in order to access it, even while rendering the table. The way I suggest the model is given the contact and does not need to load it. So, the way it's done in the example database access is as follows: - a list query to get the contacts for a given page - n queries by id, one for each row The way I'm suggesting database access is as follows: - a list query to get the contacts for a give page - no other queties If the row contains say a link column that accesses the row model in the ajax click, then you will see an additional database access by id when the DetachableContactModel is attached. Cheers Marios On Tue, Jun 11, 2013 at 6:56 PM, Daniel Watrous dwmaill...@gmail.com wrote: Hi, I'm following the example in the repeaters section for paging through large amounts of data: http://www.wicket-library.com/wicket-examples-6.0.x/repeater/wicket/bookmarkable/org.apache.wicket.examples.repeater.PagingPage Based on the example and how I've had to implement this there is a lot of data access. First is in the ContactDataProvider. The function iterator queries for the set of data that will be displayed. Next, all the objects that are returned need to be wrapped in a DetachableContactModel. The load mechanism here then loads each individual object from the datastore. In the example, the data is in memory. In a real world scenario the data is likely to be remote and this setup could have a significant performance impact. Is there some way to cut out some of the data access? For example, can I get rid of DetachableContactModel and just use the data retrieved through the ContactDataProvider? Thanks, Daniel
Re: show image retrieved from database
Hi, Load the image as byte[] and use : new Image(someId, new ByteArrayResource(byte[])) On Thu, Apr 18, 2013 at 8:58 AM, ORACLEADF ora@gmail.com wrote: I found a solution for my problem but I think it causes to lose performance: Images loaded from database in byte[] format. I converted them to images and then save them to system file. You can see the code in this link : byteToImage.png http://apache-wicket.1842946.n4.nabble.com/file/n4658067/byteToImage.png Is it a good idea? - Regards -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/show-image-retrieved-from-database-tp4658009p4658067.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: show image retrieved from database
Hi It was simpler than I think. Also, The following link helped me so much: http://apache-wicket.1842946.n4.nabble.com/url-for-images-from-database-td3657615.html#a3700046 I uploaded the source code and the picture of code.this may be helpful for other users: SimpleDataView.html.png http://apache-wicket.1842946.n4.nabble.com/file/n4658078/SimpleDataView.html.png SimpleDataView.java.png http://apache-wicket.1842946.n4.nabble.com/file/n4658078/SimpleDataView.java.png SimpleDataView.runtime.png http://apache-wicket.1842946.n4.nabble.com/file/n4658078/SimpleDataView.runtime.png SimpleDataView.runtime.png http://apache-wicket.1842946.n4.nabble.com/file/n4658078/SimpleDataView.runtime.png Thank you Martin. - Regards -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/show-image-retrieved-from-database-tp4658009p4658078.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: show image retrieved from database
This article is good for showing only one image but I want to execute a SQL statement and binding the result with a grid. The grid contains two pictures in each rows .One picture for dealer and another for its supervisor. You can see a sample written with PHP in the following link: PersonnelListFromDBusingPHP.png http://apache-wicket.1842946.n4.nabble.com/file/n4658066/PersonnelListFromDBusingPHP.png I don’t want to execute a SQL statement for every images located in the grid and loaded from database. How we can do it with only one database call. - Regards -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/show-image-retrieved-from-database-tp4658009p4658066.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: show image retrieved from database
I found a solution for my problem but I think it causes to lose performance: Images loaded from database in byte[] format. I converted them to images and then save them to system file. You can see the code in this link : byteToImage.png http://apache-wicket.1842946.n4.nabble.com/file/n4658067/byteToImage.png Is it a good idea? - Regards -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/show-image-retrieved-from-database-tp4658009p4658067.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
show image retrieved from database
How to show images retrieved from database on a wicket page. - Regards -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/show-image-retrieved-from-database-tp4658009.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: show image retrieved from database
Hi, Check http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/ On Tue, Apr 16, 2013 at 10:53 AM, ORACLEADF ora@gmail.com wrote: How to show images retrieved from database on a wicket page. - Regards -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/show-image-retrieved-from-database-tp4658009.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: show image retrieved from database
Hi Martin , I am surprised with your fast response. Thank You. - Regards -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/show-image-retrieved-from-database-tp4658009p4658014.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
Using AutocompleteTextField with database entries (without a converter)
Hello, I don't know what is the best way of impleting that in Wicket That's my use case: - the user has to select a customer in a field of a form, - he starts to type some characters, - the list shows some possibilities based on a database request using the first and last names, the email, ... - then he selects one item in the list, - the field just shows few informations (Last Name for exemple). I don't want to use a converter because the data in the field could eventually match more than one entry in the database. I can give more context in the list to make the user be sure of his selection. When the selection is made, I can put a title so that on a mouse over event the user visualize the full information on the customer selection. The best solution would be to use the database id of the customer as a key during the selection phase. I don't know what is the best way of implementing this behaviour. Thanks a lot for any ideas, Gaetan,
RE: Using AutocompleteTextField with database entries (without a converter)
Take a look at Select2 developed by Ivan Vaynberg one of Wicket's contributors: http://ivaynberg.github.com/select2/ You should try out the Loading Remote Data and Infinite Scroll with Remote Data examples. Thanks Ivan for a great job! ~ Thank you, Paul Bors -Original Message- From: Gaetan Zoritchak [mailto:g.zoritc...@moncoachfinance.com] Sent: Wednesday, October 24, 2012 9:39 AM To: users@wicket.apache.org Subject: Using AutocompleteTextField with database entries (without a converter) Hello, I don't know what is the best way of impleting that in Wicket That's my use case: - the user has to select a customer in a field of a form, - he starts to type some characters, - the list shows some possibilities based on a database request using the first and last names, the email, ... - then he selects one item in the list, - the field just shows few informations (Last Name for exemple). I don't want to use a converter because the data in the field could eventually match more than one entry in the database. I can give more context in the list to make the user be sure of his selection. When the selection is made, I can put a title so that on a mouse over event the user visualize the full information on the customer selection. The best solution would be to use the database id of the customer as a key during the selection phase. I don't know what is the best way of implementing this behaviour. Thanks a lot for any ideas, Gaetan, - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Using AutocompleteTextField with database entries (without a converter)
Thanks for the input. I'm going to have a look. Gaetan 2012/10/24 Paul Bors p...@bors.ws Take a look at Select2 developed by Ivan Vaynberg one of Wicket's contributors: http://ivaynberg.github.com/select2/ You should try out the Loading Remote Data and Infinite Scroll with Remote Data examples. Thanks Ivan for a great job! ~ Thank you, Paul Bors -Original Message- From: Gaetan Zoritchak [mailto:g.zoritc...@moncoachfinance.com] Sent: Wednesday, October 24, 2012 9:39 AM To: users@wicket.apache.org Subject: Using AutocompleteTextField with database entries (without a converter) Hello, I don't know what is the best way of impleting that in Wicket That's my use case: - the user has to select a customer in a field of a form, - he starts to type some characters, - the list shows some possibilities based on a database request using the first and last names, the email, ... - then he selects one item in the list, - the field just shows few informations (Last Name for exemple). I don't want to use a converter because the data in the field could eventually match more than one entry in the database. I can give more context in the list to make the user be sure of his selection. When the selection is made, I can put a title so that on a mouse over event the user visualize the full information on the customer selection. The best solution would be to use the database id of the customer as a key during the selection phase. I don't know what is the best way of implementing this behaviour. Thanks a lot for any ideas, Gaetan, - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Using AutocompleteTextField with database entries (without a converter)
As for your search by multiple columns in the db... do something silly like using an OR in your SQL and filter by both columns :) Another idea is to include a drop down to filter by what column you want to search. ~ Thank you, Paul Bors -Original Message- From: Gaetan Zoritchak [mailto:g.zoritc...@moncoachfinance.com] Sent: Wednesday, October 24, 2012 5:46 PM To: users@wicket.apache.org Subject: Re: Using AutocompleteTextField with database entries (without a converter) Thanks for the input. I'm going to have a look. Gaetan 2012/10/24 Paul Bors p...@bors.ws Take a look at Select2 developed by Ivan Vaynberg one of Wicket's contributors: http://ivaynberg.github.com/select2/ You should try out the Loading Remote Data and Infinite Scroll with Remote Data examples. Thanks Ivan for a great job! ~ Thank you, Paul Bors -Original Message- From: Gaetan Zoritchak [mailto:g.zoritc...@moncoachfinance.com] Sent: Wednesday, October 24, 2012 9:39 AM To: users@wicket.apache.org Subject: Using AutocompleteTextField with database entries (without a converter) Hello, I don't know what is the best way of impleting that in Wicket That's my use case: - the user has to select a customer in a field of a form, - he starts to type some characters, - the list shows some possibilities based on a database request using the first and last names, the email, ... - then he selects one item in the list, - the field just shows few informations (Last Name for exemple). I don't want to use a converter because the data in the field could eventually match more than one entry in the database. I can give more context in the list to make the user be sure of his selection. When the selection is made, I can put a title so that on a mouse over event the user visualize the full information on the customer selection. The best solution would be to use the database id of the customer as a key during the selection phase. I don't know what is the best way of implementing this behaviour. Thanks a lot for any ideas, Gaetan, - 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
Need some help creating dynamic resources from database-inputstream please!
Hi, in my project I use a CouchDB with files as attachments. Currently I have a page that makes those attachments available via a ResourceLink. What I do when creating that page is: - I read all attachments (I get them as an InputStream), - create a byte[] out of it, - create a static Wicket ByteArrayResource - and put the link to that resource on the page. That works for smaller files, but a huge problem is of course: it's static, and I get memory problems if the attachments get too big. Also, currently obviously each session does this. What I would like to do instead is: - create Resources that will load my attachments dynamically if the link is clicked, - and add ResourceLinks to those resources on my page instead. - If possible, maybe deliver the attachments directly from the InputStream my CouchDB delivers, so I don't have to have any static byte-arrays on my server. That way I could make the page load immediately and deliver attachments only if required. I've wrapped my head around IResourceStreams, but I just can't see clear anymore and am confused about how to create those dynamic resources (also because some old examples don't work anymore with Wicket 1.5 or 6beta3). I'd be very thankful for a short example, or a hint about how to design this. Thank you!
Re: Need some help creating dynamic resources from database-inputstream please!
Take a look at DownloadLink and FileResourceStream, and replace all File related API to your CouchDB access. Sven Michael M generi...@gmail.com schrieb: Hi, in my project I use a CouchDB with files as attachments. Currently I have a page that makes those attachments available via a ResourceLink. What I do when creating that page is: - I read all attachments (I get them as an InputStream), - create a byte[] out of it, - create a static Wicket ByteArrayResource - and put the link to that resource on the page. That works for smaller files, but a huge problem is of course: it's static, and I get memory problems if the attachments get too big. Also, currently obviously each session does this. What I would like to do instead is: - create Resources that will load my attachments dynamically if the link is clicked, - and add ResourceLinks to those resources on my page instead. - If possible, maybe deliver the attachments directly from the InputStream my CouchDB delivers, so I don't have to have any static byte-arrays on my server. That way I could make the page load immediately and deliver attachments only if required. I've wrapped my head around IResourceStreams, but I just can't see clear anymore and am confused about how to create those dynamic resources (also because some old examples don't work anymore with Wicket 1.5 or 6beta3). I'd be very thankful for a short example, or a hint about how to design this. Thank you!
Re: Need some help creating dynamic resources from database-inputstream please!
Hi, thanks for for quick answer! I already played around with ResourceStreams, but my problem was that I couldn't do the bridge from a Stream to a Resource with a URL. I should add, I'm not offering my ByteArrayResources as a download. I pass the content-type and filename, and (with the help I got from a user here) return it as INLINE. So, when the user clicks, the browser opens the filetype if it can (e.g. a picture, or a PDF with a built-in viewer). Also (and that's important) I then have a real URL which I can pass to Javascript functions. E.g. if the attachment is an mp3 or a video, I additionally use the URL of the ResourceLink to open a custom flash-player (JW Player).. I need a solid URL for that, for that session. When I played around I just couldn't manage to get that kind of URL when I worked with Streams. But I will give it another try. PS: I found this example a while ago, and wanted to implement my own IResourceStream to fetch the attachments from the DB, but the example is outdated and I couldn't figure out how to do it with a newer version of Wicket: http://goo.gl/imGrl 2012/8/16 Sven Meier s...@meiers.net Take a look at DownloadLink and FileResourceStream, and replace all File related API to your CouchDB access. Sven Michael M generi...@gmail.com schrieb: Hi, in my project I use a CouchDB with files as attachments. Currently I have a page that makes those attachments available via a ResourceLink. What I do when creating that page is: - I read all attachments (I get them as an InputStream), - create a byte[] out of it, - create a static Wicket ByteArrayResource - and put the link to that resource on the page. That works for smaller files, but a huge problem is of course: it's static, and I get memory problems if the attachments get too big. Also, currently obviously each session does this. What I would like to do instead is: - create Resources that will load my attachments dynamically if the link is clicked, - and add ResourceLinks to those resources on my page instead. - If possible, maybe deliver the attachments directly from the InputStream my CouchDB delivers, so I don't have to have any static byte-arrays on my server. That way I could make the page load immediately and deliver attachments only if required. I've wrapped my head around IResourceStreams, but I just can't see clear anymore and am confused about how to create those dynamic resources (also because some old examples don't work anymore with Wicket 1.5 or 6beta3). I'd be very thankful for a short example, or a hint about how to design this. Thank you!
Re: Need some help creating dynamic resources from database-inputstream please!
I think I just made a huge step forward by overriding getData() of ByteArrayResource. I've read that in the documentation before, but at that time was too deep into the concept of resources that I didn't get it (I'm completely new to Wicket). So, right now it works that I read my attachment, convert it into a byte-array and deliver it, only when the link is clicked. I still get a URL I can use for other functions (pass a .mp4-ByteArrayResource to a JW Player instance e.g.) No creating of static resources at page-load anymore. Next step would be to skip the byte-array completely. How could I do my own Resource that delivers the data as a stream, but has the same functionality otherwise (usable in some kind of Link so that I can get the URL)? Something like Resource attachmentResource = new WebResource() { @Override public IResourceStream getResourceStream() { // return my stream somehow } } doesn't work anymore if I'm not mistaken. Appreciate your help so far! 2012/8/16 Michael M generi...@gmail.com Hi, thanks for for quick answer! I already played around with ResourceStreams, but my problem was that I couldn't do the bridge from a Stream to a Resource with a URL. I should add, I'm not offering my ByteArrayResources as a download. I pass the content-type and filename, and (with the help I got from a user here) return it as INLINE. So, when the user clicks, the browser opens the filetype if it can (e.g. a picture, or a PDF with a built-in viewer). Also (and that's important) I then have a real URL which I can pass to Javascript functions. E.g. if the attachment is an mp3 or a video, I additionally use the URL of the ResourceLink to open a custom flash-player (JW Player).. I need a solid URL for that, for that session. When I played around I just couldn't manage to get that kind of URL when I worked with Streams. But I will give it another try. PS: I found this example a while ago, and wanted to implement my own IResourceStream to fetch the attachments from the DB, but the example is outdated and I couldn't figure out how to do it with a newer version of Wicket: http://goo.gl/imGrl 2012/8/16 Sven Meier s...@meiers.net Take a look at DownloadLink and FileResourceStream, and replace all File related API to your CouchDB access. Sven Michael M generi...@gmail.com schrieb: Hi, in my project I use a CouchDB with files as attachments. Currently I have a page that makes those attachments available via a ResourceLink. What I do when creating that page is: - I read all attachments (I get them as an InputStream), - create a byte[] out of it, - create a static Wicket ByteArrayResource - and put the link to that resource on the page. That works for smaller files, but a huge problem is of course: it's static, and I get memory problems if the attachments get too big. Also, currently obviously each session does this. What I would like to do instead is: - create Resources that will load my attachments dynamically if the link is clicked, - and add ResourceLinks to those resources on my page instead. - If possible, maybe deliver the attachments directly from the InputStream my CouchDB delivers, so I don't have to have any static byte-arrays on my server. That way I could make the page load immediately and deliver attachments only if required. I've wrapped my head around IResourceStreams, but I just can't see clear anymore and am confused about how to create those dynamic resources (also because some old examples don't work anymore with Wicket 1.5 or 6beta3). I'd be very thankful for a short example, or a hint about how to design this. Thank you!
Re: Need some help creating dynamic resources from database-inputstream please!
Ok I think I got it now! Simply using a ResourceStreamResource instead of a ByteArrayResource, duh... I think the reason why I just couldn't see clear before is all the different obsolete examples and tutorials for older versions. The problem is, when you are new to Wicket, you are still figuring out how stuff works, and when trying to implement certain things you hit road-blocks because those code-examples don't work anymore, and you don't know why. Here is my solution: http://pastebin.com/yQFh5gk8 This is how I'm doing it for now, returning the stream on-the-fly from the database when the ResourceLink is clicked. However, I get huge stacks of exceptions now: *java.lang.IllegalStateException: Header was already written to the resonse!* * * Here is an example, I get lots of those: http://pastebin.com/5LuDqp5a Thanks! I'm almost there I think :) 2012/8/16 Michael M generi...@gmail.com I think I just made a huge step forward by overriding getData() of ByteArrayResource. I've read that in the documentation before, but at that time was too deep into the concept of resources that I didn't get it (I'm completely new to Wicket). So, right now it works that I read my attachment, convert it into a byte-array and deliver it, only when the link is clicked. I still get a URL I can use for other functions (pass a .mp4-ByteArrayResource to a JW Player instance e.g.) No creating of static resources at page-load anymore. Next step would be to skip the byte-array completely. How could I do my own Resource that delivers the data as a stream, but has the same functionality otherwise (usable in some kind of Link so that I can get the URL)? Something like Resource attachmentResource = new WebResource() { @Override public IResourceStream getResourceStream() { // return my stream somehow } } doesn't work anymore if I'm not mistaken. Appreciate your help so far! 2012/8/16 Michael M generi...@gmail.com Hi, thanks for for quick answer! I already played around with ResourceStreams, but my problem was that I couldn't do the bridge from a Stream to a Resource with a URL. I should add, I'm not offering my ByteArrayResources as a download. I pass the content-type and filename, and (with the help I got from a user here) return it as INLINE. So, when the user clicks, the browser opens the filetype if it can (e.g. a picture, or a PDF with a built-in viewer). Also (and that's important) I then have a real URL which I can pass to Javascript functions. E.g. if the attachment is an mp3 or a video, I additionally use the URL of the ResourceLink to open a custom flash-player (JW Player).. I need a solid URL for that, for that session. When I played around I just couldn't manage to get that kind of URL when I worked with Streams. But I will give it another try. PS: I found this example a while ago, and wanted to implement my own IResourceStream to fetch the attachments from the DB, but the example is outdated and I couldn't figure out how to do it with a newer version of Wicket: http://goo.gl/imGrl 2012/8/16 Sven Meier s...@meiers.net Take a look at DownloadLink and FileResourceStream, and replace all File related API to your CouchDB access. Sven Michael M generi...@gmail.com schrieb: Hi, in my project I use a CouchDB with files as attachments. Currently I have a page that makes those attachments available via a ResourceLink. What I do when creating that page is: - I read all attachments (I get them as an InputStream), - create a byte[] out of it, - create a static Wicket ByteArrayResource - and put the link to that resource on the page. That works for smaller files, but a huge problem is of course: it's static, and I get memory problems if the attachments get too big. Also, currently obviously each session does this. What I would like to do instead is: - create Resources that will load my attachments dynamically if the link is clicked, - and add ResourceLinks to those resources on my page instead. - If possible, maybe deliver the attachments directly from the InputStream my CouchDB delivers, so I don't have to have any static byte-arrays on my server. That way I could make the page load immediately and deliver attachments only if required. I've wrapped my head around IResourceStreams, but I just can't see clear anymore and am confused about how to create those dynamic resources (also because some old examples don't work anymore with Wicket 1.5 or 6beta3). I'd be very thankful for a short example, or a hint about how to design this. Thank you!
Next database key pre-filled in form and associated with PropertyModel returns null
G'day Short form: how do I pre-fill a form field with the dynamic value of the next free database key Long form: I'd like to pre-fill a form field with the value of the next free database key. I can do this by associating the form input field with a static model of a string value and replacing the field in the form each time the next key value changes. Works, but hardly elegant. So I've associated the input field with a (dynamic) property model. Because the next key value isn't a database field I've created a new class (called State) with a field for the next free database key. The property model I've associated with the form field points to that attribute of State. As each new database row is created I manually update the value of the next free key in State. This value then finds its way into the form when it is next displayed. So far so good. Each time the form is displayed I can see the correct next free key value pre-filled into the form as expected. But when the form is submitted and I do a getModelObject() on the form the gotten object has null in the field that should contain the next free database key. All the other fields are correctly received from the form. (This is true more generally - in more complex forms all the form fields that are not associated with State are correctly received from the form. All those that are associated with State are null.) What is weird is that if I do: Account account = getModelObject(); // returns null in field accountNumber which is associated with State account.setAccountnumber(Integer.parseInt(accountNumber.getInput())); // Gets and sets the pre-filled value then I get the desired result i.e. field accountNumber of account is set to the pre-filled value. So there is no doubt that form field has the desired value - I can see it, and getInput() gets it. But getModelObject() (which I would be expecting to call getInput() under the covers) doesn't get the pre-filled value. I suspect this is a question of understanding about models in general. (I've looked at whether I should add my PropertyModel in some way to the LoadableDetachableModel that is associated with the form but the water got rather deep rather quickly.) Any enlightenment appreciated. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Next-database-key-pre-filled-in-form-and-associated-with-PropertyModel-returns-null-tp4650518.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: Next database key pre-filled in form and associated with PropertyModel returns null
How do you determine which next key is available? If two users open the form at the same time will they see the same key? If so, then you need to handle errors from concurrent form submissions with the same key. Which means for one of these concurrent requests you will have to issue a different key and show it to the user after the form was submitted. So, why not show the key after form submission all the time? On Sat, Jul 14, 2012 at 1:03 AM, Ian blav...@dodo.com.au wrote: G'day Short form: how do I pre-fill a form field with the dynamic value of the next free database key Long form: I'd like to pre-fill a form field with the value of the next free database key. I can do this by associating the form input field with a static model of a string value and replacing the field in the form each time the next key value changes. Works, but hardly elegant. So I've associated the input field with a (dynamic) property model. Because the next key value isn't a database field I've created a new class (called State) with a field for the next free database key. The property model I've associated with the form field points to that attribute of State. As each new database row is created I manually update the value of the next free key in State. This value then finds its way into the form when it is next displayed. So far so good. Each time the form is displayed I can see the correct next free key value pre-filled into the form as expected. But when the form is submitted and I do a getModelObject() on the form the gotten object has null in the field that should contain the next free database key. All the other fields are correctly received from the form. (This is true more generally - in more complex forms all the form fields that are not associated with State are correctly received from the form. All those that are associated with State are null.) What is weird is that if I do: Account account = getModelObject(); // returns null in field accountNumber which is associated with State account.setAccountnumber(Integer.parseInt(accountNumber.getInput())); // Gets and sets the pre-filled value then I get the desired result i.e. field accountNumber of account is set to the pre-filled value. So there is no doubt that form field has the desired value - I can see it, and getInput() gets it. But getModelObject() (which I would be expecting to call getInput() under the covers) doesn't get the pre-filled value. I suspect this is a question of understanding about models in general. (I've looked at whether I should add my PropertyModel in some way to the LoadableDetachableModel that is associated with the form but the water got rather deep rather quickly.) Any enlightenment appreciated. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Next-database-key-pre-filled-in-form-and-associated-with-PropertyModel-returns-null-tp4650518.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: Next database key pre-filled in form and associated with PropertyModel returns null
On Sat, Jul 14, 2012 at 3:03 AM, Ian blav...@dodo.com.au wrote: G'day Short form: how do I pre-fill a form field with the dynamic value of the next free database key Is your customer demanding that the database ids end up without any gaps? If so, try to work hard to dissuade your customer. Database ids should have no other business meeting. They should be opaque. One good way to distinguish between a object that has not yet been persisted and one that has is whether its id variable is null or not. So, suppose you have a FormPerson. In your onSubmit method, you call personService.create(getModelObject()), where personService calls DAOs, or maybe is a DAO. It modifies the Person object in place, setting the id when it is done. It then redirects the user to the appropriate page. If there is a constraint violation or other database problem, the object should be unchanged and the system should remain on the form page. You can reuse the form page if you want to edit an existing person. You just don't give the user any way to edit the id, and you call an update method instead. Respectfully, Eric Jablow
Re: Next database key pre-filled in form and associated with PropertyModel returns null
G'day In part the question was based on a misunderstanding which I have now overcome. I thought that all the columns of the database table had to be present in the form as form fields. But that is not the case. So any column whose value I know ahead of time I don't present on the form - I just give them values in the code after the user submits the form. I also came to the same conclusion about the database keys. So that reduces the question to form fields that I want to pre-fill with a (context-dependent) default value but whose value I allow the user to change. I can pre-fill the fields using a Property model as described in the initial post, but such values are null after the GetModelObject(). Is this a misunderstanding about models - that the GetModelObject won't get the values of form fields that are linked with a model other than the model the form is linked with. Seems reasonable, except that if the pre-filled fields are linked with a static model instead of the (dynamic) PropertyModel the form values are retrieved correctly by GetModelObject(). Ian Blavins On 18/07/2012, at 4:22 AM, Eric Jablow [via Apache Wicket] wrote: On Sat, Jul 14, 2012 at 3:03 AM, Ian [hidden email] wrote: G'day Short form: how do I pre-fill a form field with the dynamic value of the next free database key Is your customer demanding that the database ids end up without any gaps? If so, try to work hard to dissuade your customer. Database ids should have no other business meeting. They should be opaque. One good way to distinguish between a object that has not yet been persisted and one that has is whether its id variable is null or not. So, suppose you have a FormPerson. In your onSubmit method, you call personService.create(getModelObject()), where personService calls DAOs, or maybe is a DAO. It modifies the Person object in place, setting the id when it is done. It then redirects the user to the appropriate page. If there is a constraint violation or other database problem, the object should be unchanged and the system should remain on the form page. You can reuse the form page if you want to edit an existing person. You just don't give the user any way to edit the id, and you call an update method instead. Respectfully, Eric Jablow If you reply to this email, your message will be added to the discussion below: http://apache-wicket.1842946.n4.nabble.com/Next-database-key-pre-filled-in-form-and-associated-with-PropertyModel-returns-null-tp4650518p4650576.html To unsubscribe from Next database key pre-filled in form and associated with PropertyModel returns null, click here. NAML -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Next-database-key-pre-filled-in-form-and-associated-with-PropertyModel-returns-null-tp4650518p4650581.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: Next database key pre-filled in form and associated with PropertyModel returns null
G'day In part the question was based on a misunderstanding which I have now overcome. I thought that all the columns of the database table had to be present in the form as form fields. This meant that I had to pre-fill values for the key fields. This indeed has the difficulties that you raise. But it is not the case that all the columns need to be in the form. So I no longer show the key fields but provide values for their columns after I retrieve the form with GetModelObject(). That side-steps the difficulties you mention. And, yes, I now need in some cases to show the user the key value that was generated. I've done that crudely with a form that becomes visible after the database row has been successfully created. But I will replace that with a reusable model window in due course. (Unless Wicket 5 has a simpler dialog box feature that I haven't yet discovered. I don't want to do the dialog box in Javascript). But that still leaves the question of why the pre-filled values weren't retrieved by the GetModelObject(). Their values are associated with a model other than the model that is associated with form - is that the reason ? Seems reasonable, except that if the pre-filled form fields are associated with a static model (rather than the (dynamic) PropertyModel that I currently use) then the pre-filled values are correctly retrieved by GetModelObject(). Ian Blavins On 18/07/2012, at 1:42 AM, Alec Swan [via Apache Wicket] wrote: How do you determine which next key is available? If two users open the form at the same time will they see the same key? If so, then you need to handle errors from concurrent form submissions with the same key. Which means for one of these concurrent requests you will have to issue a different key and show it to the user after the form was submitted. So, why not show the key after form submission all the time? On Sat, Jul 14, 2012 at 1:03 AM, Ian [hidden email] wrote: G'day Short form: how do I pre-fill a form field with the dynamic value of the next free database key Long form: I'd like to pre-fill a form field with the value of the next free database key. I can do this by associating the form input field with a static model of a string value and replacing the field in the form each time the next key value changes. Works, but hardly elegant. So I've associated the input field with a (dynamic) property model. Because the next key value isn't a database field I've created a new class (called State) with a field for the next free database key. The property model I've associated with the form field points to that attribute of State. As each new database row is created I manually update the value of the next free key in State. This value then finds its way into the form when it is next displayed. So far so good. Each time the form is displayed I can see the correct next free key value pre-filled into the form as expected. But when the form is submitted and I do a getModelObject() on the form the gotten object has null in the field that should contain the next free database key. All the other fields are correctly received from the form. (This is true more generally - in more complex forms all the form fields that are not associated with State are correctly received from the form. All those that are associated with State are null.) What is weird is that if I do: Account account = getModelObject(); // returns null in field accountNumber which is associated with State account.setAccountnumber(Integer.parseInt(accountNumber.getInput())); // Gets and sets the pre-filled value then I get the desired result i.e. field accountNumber of account is set to the pre-filled value. So there is no doubt that form field has the desired value - I can see it, and getInput() gets it. But getModelObject() (which I would be expecting to call getInput() under the covers) doesn't get the pre-filled value. I suspect this is a question of understanding about models in general. (I've looked at whether I should add my PropertyModel in some way to the LoadableDetachableModel that is associated with the form but the water got rather deep rather quickly.) Any enlightenment appreciated. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Next-database-key-pre-filled-in-form-and-associated-with-PropertyModel-returns-null-tp4650518.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] - To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] If you reply to this email, your message
Re: guestbook application with database update
Renaissance painters used the camera obscura which, in fact, gives the optical rendering in color that dominates Western Art. The camera obscura literally means dark chamber in Latin. It is a box with a hole in it which allows light to go through and create an image onto the piece of paper. Thanks. Regards, http:// http://www.sixsingles.com dating sites -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/guestbook-application-with-database-update-tp4316943p4650239.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: guestbook application with database update
For future reference in case somebody stumbles across this post: this guy was moderated through, which requires a different remove command. Martijn pointed out that the command for that is for a list moderator to email: users-allow-unsubscribe-jaffa.wify=gmail@wicket.apache.org Thanks Martijn! -- Jeremy Thomerson http://wickettraining.com *Need a CMS for Wicket? Use Brix! http://brixcms.org* On Mon, Jun 25, 2012 at 3:08 PM, Jeremy Thomerson jer...@wickettraining.com wrote: All list moderators do. I just emails to users-unsubscribe-jaffa.wify= gmail@wicket.apache.org and users-deny-subscribe-jaffa.wify= gmail@wicket.apache.org which I think will block this guy. More info: http://www.apache.org/dev/committers.html#problem_posts -- Jeremy Thomerson http://wickettraining.com *Need a CMS for Wicket? Use Brix! http://brixcms.org* On Thu, Jun 21, 2012 at 7:30 AM, Martin Grigorov mgrigo...@apache.orgwrote: This looks like a spam. Third mail in this thread with unrelated content. Who has the karma to block this user ? On Thu, Jun 21, 2012 at 3:23 PM, jaffa jaffa.w...@gmail.com wrote: Names and addresses provided in guestbooks, paper based or electronic, are frequently recorded and collated for use in providing statistics about visitors to the site, and to contact visitors to the site in the future. Thanks. Regards, http://www.webryze.com toronto online marketing -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/guestbook-application-with-database-update-tp4316943p4650155.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: guestbook application with database update
All list moderators do. I just emails to users-unsubscribe-jaffa.wify= gmail@wicket.apache.org and users-deny-subscribe-jaffa.wify= gmail@wicket.apache.org which I think will block this guy. More info: http://www.apache.org/dev/committers.html#problem_posts -- Jeremy Thomerson http://wickettraining.com *Need a CMS for Wicket? Use Brix! http://brixcms.org* On Thu, Jun 21, 2012 at 7:30 AM, Martin Grigorov mgrigo...@apache.orgwrote: This looks like a spam. Third mail in this thread with unrelated content. Who has the karma to block this user ? On Thu, Jun 21, 2012 at 3:23 PM, jaffa jaffa.w...@gmail.com wrote: Names and addresses provided in guestbooks, paper based or electronic, are frequently recorded and collated for use in providing statistics about visitors to the site, and to contact visitors to the site in the future. Thanks. Regards, http://www.webryze.com toronto online marketing -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/guestbook-application-with-database-update-tp4316943p4650155.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: guestbook application with database update
Names and addresses provided in guestbooks, paper based or electronic, are frequently recorded and collated for use in providing statistics about visitors to the site, and to contact visitors to the site in the future. Thanks. Regards, http://www.webryze.com toronto online marketing -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/guestbook-application-with-database-update-tp4316943p4650155.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: guestbook application with database update
This looks like a spam. Third mail in this thread with unrelated content. Who has the karma to block this user ? On Thu, Jun 21, 2012 at 3:23 PM, jaffa jaffa.w...@gmail.com wrote: Names and addresses provided in guestbooks, paper based or electronic, are frequently recorded and collated for use in providing statistics about visitors to the site, and to contact visitors to the site in the future. Thanks. Regards, http://www.webryze.com toronto online marketing -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/guestbook-application-with-database-update-tp4316943p4650155.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: guestbook application with database update
Graph databases are based on graph theory. Graph databases employ nodes, properties, and edges. Nodes are very similar in nature to the objects that object oriented programmers will be familiar with. Thanks. Regards, http://www.johnbeckwiki.com -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/guestbook-application-with-database-update-tp4316943p4650025.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: guestbook application with database update
The graph database is a kind of NoSQL database that uses graph structures with nodes, edges, and properties to represent and store information. General graph databases that can store any graph are distinct from specialized graph databases such as triplestores and network databases. Thanks. Regards, http://www.academicwritinghelp.biz/essay-writing-help/ essay writing help -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/guestbook-application-with-database-update-tp4316943p4649899.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: Java Maps and non-SQL database
Hi Marc, The closest implementation I'm aware of is : new PropertyModel(this, aJavaMap[someKey]) I.e. in *this* class there is a member field named aJavaMap. See the javadoc of org.apache.wicket.core.util.lang.PropertyResolver On Sat, Apr 21, 2012 at 1:13 PM, Marc Marc marc.m...@mail.be wrote: Hello, I want to develop an application-interpreter. The interpreter runs an application model consisting of entity-relationships and fairly easy business. My idea is to use Wicket using Java maps as underlying model and to use a non-SQL database to make the Java maps persistent. This way I try to omit to have to compile the application model towards Java POJO’s and towards SQL tables. So I would appreciate your insight on the following 2 questions: 1)Are there already existing implementations of the combination wicket – Java map – non-SQL database? 2) On wiki side, what is the best way to having Java maps as model (instead of POJOs). Should I develop my own subclasses of IModel (see also thread demand for maps) Thanks for your insights, Marc-Mail.be, WebMail and Virtual Officehttp://www.mail.be -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Java Maps and non-SQL database
Hello, I want to develop an application-interpreter. The interpreter runs an application model consisting of entity-relationships and fairly easy business. My idea is to use Wicket using Java maps as underlying model and to use a non-SQL database to make the Java maps persistent. This way I try to omit to have to compile the application model towards Java POJO’s and towards SQL tables. So I would appreciate your insight on the following 2 questions: 1)Are there already existing implementations of the combination wicket – Java map – non-SQL database? 2) On wiki side, what is the best way to having Java maps as model (instead of POJOs). Should I develop my own subclasses of IModel (see also thread demand for maps) Thanks for your insights, Marc-Mail.be, WebMail and Virtual Officehttp://www.mail.be
RE: Creating a submit form which takes date and a string as input and displays the data from database(mysql) using simple jdbc
I want to know how to input date into database using form. I am using Timestamp in mysql. The Wicket-related psrt of that question is that you use a TextFieldDate with a model, and you then get the model object value in onSubmit() and use normal SQL to insert or update. - Tor Iver - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to populate data from Database in combo box using DropDownChoice
Hi, DropDownChoice works with simple java.util.ListYourObject. See http://www.wicket-library.com/wicket-examples/compref/wicket/bookmarkable/org.apache.wicket.examples.compref.DropDownChoicePage for examples. It is up to you to read your data from the database (plain JDBC, Hibernate, ...) and create a List of your objects. On Tue, Mar 27, 2012 at 11:49 AM, lenin lening...@gmail.com wrote: Dear, I am trying to populate data from database in combo box using dropdownChoice,with key and value ... it is not working can anyone help to resolve the problem thanks in advance -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-populate-data-from-Database-in-combo-box-using-DropDownChoice-tp4508402p4508402.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Creating a submit form which takes date and a string as input and displays the data from database(mysql) using simple jdbc
Just parse the date string into a Timestamp. That's Java, not Wicket. RAM /abr./: Rarely Adequate Memory. From: SudeepShakya shakyasud...@live.com To: users@wicket.apache.org Date: 03/26/2012 11:03 PM Subject:Re: Creating a submit form which takes date and a string as input and displays the data from database(mysql) using simple jdbc I want to know how to input date into database using form. I am using Timestamp in mysql. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Creating-a-submit-form-which-takes-date-and-a-string-as-input-and-displays-the-data-from-database-myc-tp4505124p4507896.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 ** 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. **
Re: Creating a submit form which takes date and a string as input and displays the data from database(mysql) using simple jdbc
I have used Date.valueOf(String). But submitting the form Null Pointer Exception is thrown. While submitting i have created an object of Application.java and the class with getter and setters. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Creating-a-submit-form-which-takes-date-and-a-string-as-input-and-displays-the-data-from-database-myc-tp4505124p4508800.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
Creating a submit form which takes date and a string as input and displays the data from database(mysql) using simple jdbc
I am new to wicket and also to webframeworks. i am creating an app, which has a homepage and when a link is clicked, it should display a form which takes two dates and a string as input and retrieves data from database. Thanks in advance. I tried to learn from 'wicket in action' but the example codes do not work much wicket 1.4. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Creating-a-submit-form-which-takes-date-and-a-string-as-input-and-displays-the-data-from-database-myc-tp4505124p4505124.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: Creating a submit form which takes date and a string as input and displays the data from database(mysql) using simple jdbc
Hi, what exactly is your problem? What problems are you having so far? I am new to wicket and also to webframeworks. i am creating an app, which has a homepage and when a link is clicked, it should display a form which takes two dates and a string as input and retrieves data from database. Thanks in advance. I tried to learn from 'wicket in action' but the example codes do not work much wicket 1.4. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Creating-a-submit-form-which-takes-date-and-a-string-as-input-and-displays-the-data-from-database-myc-tp4505124p4505124.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: Creating a submit form which takes date and a string as input and displays the data from database(mysql) using simple jdbc
I have created a form which takes two dates/time and a textbox and created a class for get/set. And, it should work as : when i insert the data, it should check the data in the database and display the filtered data as specified by the inputs . Also i have created a jdbc connection and a method for retrieving data . I don't know how to create a textbox that takes date/time as input and it will be easy to the user to input. I have created following files which I have attached. And also created html files for form input and filtered display. Thanx for response. http://apache-wicket.1842946.n4.nabble.com/file/n4505444/VoteCollection.java VoteCollection.java http://apache-wicket.1842946.n4.nabble.com/file/n4505444/VoteCollectionJDBC.java VoteCollectionJDBC.java http://apache-wicket.1842946.n4.nabble.com/file/n4505444/VoteDisplayPage.java VoteDisplayPage.java http://apache-wicket.1842946.n4.nabble.com/file/n4505444/VoteEditForm.java VoteEditForm.java http://apache-wicket.1842946.n4.nabble.com/file/n4505444/VoteEditPage.java VoteEditPage.java http://apache-wicket.1842946.n4.nabble.com/file/n4505444/Votes.java Votes.java -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Creating-a-submit-form-which-takes-date-and-a-string-as-input-and-displays-the-data-from-database-myc-tp4505124p4505444.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: Creating a submit form which takes date and a string as input and displays the data from database(mysql) using simple jdbc
Have you looked at the examples from the website? On Mar 26, 2012 7:20 AM, SudeepShakya shakyasud...@live.com wrote: I have created a form which takes two dates/time and a textbox and created a class for get/set. And, it should work as : when i insert the data, it should check the data in the database and display the filtered data as specified by the inputs . Also i have created a jdbc connection and a method for retrieving data . I don't know how to create a textbox that takes date/time as input and it will be easy to the user to input. I have created following files which I have attached. And also created html files for form input and filtered display. Thanx for response. http://apache-wicket.1842946.n4.nabble.com/file/n4505444/VoteCollection.java VoteCollection.java http://apache-wicket.1842946.n4.nabble.com/file/n4505444/VoteCollectionJDBC.java VoteCollectionJDBC.java http://apache-wicket.1842946.n4.nabble.com/file/n4505444/VoteDisplayPage.java VoteDisplayPage.java http://apache-wicket.1842946.n4.nabble.com/file/n4505444/VoteEditForm.java VoteEditForm.java http://apache-wicket.1842946.n4.nabble.com/file/n4505444/VoteEditPage.java VoteEditPage.java http://apache-wicket.1842946.n4.nabble.com/file/n4505444/Votes.java Votes.java -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Creating-a-submit-form-which-takes-date-and-a-string-as-input-and-displays-the-data-from-database-myc-tp4505124p4505444.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: Creating a submit form which takes date and a string as input and displays the data from database(mysql) using simple jdbc
I have viewed some of the examples but not appropriate one. Can u give some hint -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Creating-a-submit-form-which-takes-date-and-a-string-as-input-and-displays-the-data-from-database-myc-tp4505124p4505882.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: Creating a submit form which takes date and a string as input and displays the data from database(mysql) using simple jdbc
http://www.wicket-library.com/wicket-examples/dates/ On Mon, Mar 26, 2012 at 9:55 AM, SudeepShakya shakyasud...@live.com wrote: I have viewed some of the examples but not appropriate one. Can u give some hint -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Creating-a-submit-form-which-takes-date-and-a-string-as-input-and-displays-the-data-from-database-myc-tp4505124p4505882.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: Creating a submit form which takes date and a string as input and displays the data from database(mysql) using simple jdbc
I want to know how to input date into database using form. I am using Timestamp in mysql. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Creating-a-submit-form-which-takes-date-and-a-string-as-input-and-displays-the-data-from-database-myc-tp4505124p4507896.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
LoadableDetachableModels for a ListView ( database with Cayenne)
Hi all , I'm using Cayenne as my database service... Now in a query return a ListPerson which I want to wrap a whole List in to ( so call) LoadableDetachableListModels to provide for a ListView, I'm also know that a DataProvider could do the same thing but did any one have write something like LoadableDetachableListModels to wrap a generic List and provide to a ListView... Please help!! I've read http://wicketinaction.com/2008/09/building-a-smart-entitymodel/ .. so one entity is fine but but didn't know very clear what can be use for a List -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/LoadableDetachableModels-for-a-ListView-database-with-Cayenne-tp4394185p4394185.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: LoadableDetachableModels for a ListView ( database with Cayenne)
see listmodel btw if you have a big list ,use dataview On Thu, Feb 16, 2012 at 8:14 PM, atomix say_i_love_you_4e...@yahoo.com wrote: Hi all , I'm using Cayenne as my database service... Now in a query return a ListPerson which I want to wrap a whole List in to ( so call) LoadableDetachableListModels to provide for a ListView, I'm also know that a DataProvider could do the same thing but did any one have write something like LoadableDetachableListModels to wrap a generic List and provide to a ListView... Please help!! I've read http://wicketinaction.com/2008/09/building-a-smart-entitymodel/ .. so one entity is fine but but didn't know very clear what can be use for a List -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/LoadableDetachableModels-for-a-ListView-database-with-Cayenne-tp4394185p4394185.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 -- thank you, regards, Vineet Semwal - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: LoadableDetachableModels for a ListView ( database with Cayenne)
sorry when i meant if you are going to retrieve a lot of data use dataview On Thu, Feb 16, 2012 at 8:17 PM, vineet semwal vineetsemwal1...@gmail.com wrote: see listmodel btw if you have a big list ,use dataview On Thu, Feb 16, 2012 at 8:14 PM, atomix say_i_love_you_4e...@yahoo.com wrote: Hi all , I'm using Cayenne as my database service... Now in a query return a ListPerson which I want to wrap a whole List in to ( so call) LoadableDetachableListModels to provide for a ListView, I'm also know that a DataProvider could do the same thing but did any one have write something like LoadableDetachableListModels to wrap a generic List and provide to a ListView... Please help!! I've read http://wicketinaction.com/2008/09/building-a-smart-entitymodel/ .. so one entity is fine but but didn't know very clear what can be use for a List -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/LoadableDetachableModels-for-a-ListView-database-with-Cayenne-tp4394185p4394185.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 -- thank you, regards, Vineet Semwal -- thank you, regards, Vineet Semwal - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: LoadableDetachableModels for a ListView ( database with Cayenne)
Hi Vineet, public LoadableDetachableModelYourClass load(final Long xxx) { LoadableDetachableModelListYourClass model = new LoadableDetachableModelListYourClass() { protected YourClass load() { try { ListYourClass list = get your liste here( xxx ) return list } catch (YourException e) { } } }; return model; } IModelListYourClass model = load( x ); new ListViewYourClass(id, model) ; That is ok for a small list. And if you have to handle large lists, you should use a Dataview with DataProvider. François Le 16 févr. 2012 à 15:53, vineet semwal a écrit : sorry when i meant if you are going to retrieve a lot of data use dataview On Thu, Feb 16, 2012 at 8:17 PM, vineet semwal vineetsemwal1...@gmail.com wrote: see listmodel btw if you have a big list ,use dataview On Thu, Feb 16, 2012 at 8:14 PM, atomix say_i_love_you_4e...@yahoo.com wrote: Hi all , I'm using Cayenne as my database service... Now in a query return a ListPerson which I want to wrap a whole List in to ( so call) LoadableDetachableListModels to provide for a ListView, I'm also know that a DataProvider could do the same thing but did any one have write something like LoadableDetachableListModels to wrap a generic List and provide to a ListView... Please help!! I've read http://wicketinaction.com/2008/09/building-a-smart-entitymodel/ .. so one entity is fine but but didn't know very clear what can be use for a List -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/LoadableDetachableModels-for-a-ListView-database-with-Cayenne-tp4394185p4394185.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 -- thank you, regards, Vineet Semwal -- thank you, regards, Vineet Semwal - 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: LoadableDetachableModels for a ListView ( database with Cayenne)
Hi Vineet, public LoadableDetachableModelYourClass load(final Long xxx) { LoadableDetachableModelListYourClass model = new LoadableDetachableModelListYourClass() { protected YourClass load() { try { ListYourClass list = get your liste here( xxx ) return list } catch (YourException e) { } } }; return model; } IModelListYourClass model = load( x ); new ListViewYourClass(id, model) ; That is ok for a small list. And if you have to handle large lists, you should use a Dataview with DataProvider. François Le 16 févr. 2012 à 15:53, vineet semwal a écrit : sorry when i meant if you are going to retrieve a lot of data use dataview On Thu, Feb 16, 2012 at 8:17 PM, vineet semwal vineetsemwal1...@gmail.com wrote: see listmodel btw if you have a big list ,use dataview On Thu, Feb 16, 2012 at 8:14 PM, atomix say_i_love_you_4e...@yahoo.com wrote: Hi all , I'm using Cayenne as my database service... Now in a query return a ListPerson which I want to wrap a whole List in to ( so call) LoadableDetachableListModels to provide for a ListView, I'm also know that a DataProvider could do the same thing but did any one have write something like LoadableDetachableListModels to wrap a generic List and provide to a ListView... Please help!! I've read http://wicketinaction.com/2008/09/building-a-smart-entitymodel/ .. so one entity is fine but but didn't know very clear what can be use for a List -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/LoadableDetachableModels-for-a-ListView-database-with-Cayenne-tp4394185p4394185.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 -- thank you, regards, Vineet Semwal -- thank you, regards, Vineet Semwal - 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
guestbook application with database update
I'm creating a small app based on the guestbook: http://www.wicket-library.com/wicket-examples/guestbook/?1 In the guestbook app, the page view is updated every time a new comment is added. The variable commentList is initialized at the top like this private static final ListComment commentList = new ArrayListComment(); // Add commentListView of existing comments add(new PropertyListViewComment(comments, commentList) { @Override public void populateItem(final ListItemComment listItem) { listItem.add(new Label(date)); listItem.add(new MultiLineLabel(text)); } }).setVersioned(false); I wanted to use a database instead, so I made the following changes private ListMovie movieList = new ArrayListMovie(); Session session = HibernateUtil.getSessionFactory().getCurrentSession(); session.beginTransaction(); movieList = session.createQuery(from Movie).list(); session.getTransaction().commit(); // Add commentListView of existing comments add(new PropertyListViewMovie(movies, movieList) { @Override public void populateItem(final ListItemMovie listItem) { listItem.add(new TextFieldString(name).setType(String.class)); listItem.add(new DropDownChoiceCategory(category, Arrays.asList(Category.values()), new EnumChoiceRendererCategory(this))); listItem.add(new Label(rating)); } }).setVersioned(false); With this change, all the items in the database come up when the page first loads, but not after each new item is added to the database. I have to clear out the URL and load the page fresh to see what has been added since the last fresh load. I did try resetting movieList in the onSubmit function to load the current database items into the variable movieList, but that still doesn't update the list. Any idea how to update movieList after each new item is submitted. Daniel - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: guestbook application with database update
Use a LoadableDetachableModel to load a fresh list of movies on each request. Sven On 01/21/2012 10:35 PM, Daniel Watrous wrote: I'm creating a small app based on the guestbook: http://www.wicket-library.com/wicket-examples/guestbook/?1 In the guestbook app, the page view is updated every time a new comment is added. The variable commentList is initialized at the top like this private static final ListComment commentList = new ArrayListComment(); // Add commentListView of existing comments add(new PropertyListViewComment(comments, commentList) { @Override public void populateItem(final ListItemComment listItem) { listItem.add(new Label(date)); listItem.add(new MultiLineLabel(text)); } }).setVersioned(false); I wanted to use a database instead, so I made the following changes private ListMovie movieList = new ArrayListMovie(); Session session = HibernateUtil.getSessionFactory().getCurrentSession(); session.beginTransaction(); movieList = session.createQuery(from Movie).list(); session.getTransaction().commit(); // Add commentListView of existing comments add(new PropertyListViewMovie(movies, movieList) { @Override public void populateItem(final ListItemMovie listItem) { listItem.add(new TextFieldString(name).setType(String.class)); listItem.add(new DropDownChoiceCategory(category, Arrays.asList(Category.values()), new EnumChoiceRendererCategory(this))); listItem.add(new Label(rating)); } }).setVersioned(false); With this change, all the items in the database come up when the page first loads, but not after each new item is added to the database. I have to clear out the URL and load the page fresh to see what has been added since the last fresh load. I did try resetting movieList in the onSubmit function to load the current database items into the variable movieList, but that still doesn't update the list. Any idea how to update movieList after each new item is submitted. Daniel - 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: guestbook application with database update
it really doesnt matter where you get your data - from ArrayList or db - wrap code to access db into some function that return List and use LoadableDetachableModel as sven advised pozdrawiam Paweł Kamiński kami...@gmail.com pkaminski@gmail.com __ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: guestbook application with database update
This worked GREAT! Thank you. On Sat, Jan 21, 2012 at 2:51 PM, Sven Meier s...@meiers.net wrote: Use a LoadableDetachableModel to load a fresh list of movies on each request. Sven On 01/21/2012 10:35 PM, Daniel Watrous wrote: I'm creating a small app based on the guestbook: http://www.wicket-library.com/wicket-examples/guestbook/?1 In the guestbook app, the page view is updated every time a new comment is added. The variable commentList is initialized at the top like this private static final ListComment commentList = new ArrayListComment(); // Add commentListView of existing comments add(new PropertyListViewComment(comments, commentList) { @Override public void populateItem(final ListItemComment listItem) { listItem.add(new Label(date)); listItem.add(new MultiLineLabel(text)); } }).setVersioned(false); I wanted to use a database instead, so I made the following changes private ListMovie movieList = new ArrayListMovie(); Session session = HibernateUtil.getSessionFactory().getCurrentSession(); session.beginTransaction(); movieList = session.createQuery(from Movie).list(); session.getTransaction().commit(); // Add commentListView of existing comments add(new PropertyListViewMovie(movies, movieList) { @Override public void populateItem(final ListItemMovie listItem) { listItem.add(new TextFieldString(name).setType(String.class)); listItem.add(new DropDownChoiceCategory(category, Arrays.asList(Category.values()), new EnumChoiceRendererCategory(this))); listItem.add(new Label(rating)); } }).setVersioned(false); With this change, all the items in the database come up when the page first loads, but not after each new item is added to the database. I have to clear out the URL and load the page fresh to see what has been added since the last fresh load. I did try resetting movieList in the onSubmit function to load the current database items into the variable movieList, but that still doesn't update the list. Any idea how to update movieList after each new item is submitted. Daniel - 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: url for images from database
Fresh new description how to do that in Wicket 1.5: http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/ On Tue, Jul 26, 2011 at 3:38 PM, eugenebalt eugeneb...@yahoo.com wrote: I have the exact same problem. I have Images coming from the DB, along with other stuff, and I need to display them, per row, as , similar to how Amazon.com lists their books next to book title, etc. Is there an easy way to do it? Very common problem. Can someone show what the HTML and Java should look like to support this dynamic image display? Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/url-for-images-from-database-tp3657615p3695546.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: url for images from database
I guess my question is a little simpler than Miroslav's because I don't need to modify the URLs. I don't need to mount anything. I just need a dynamic image display from a byte[], I don't care which URL Wicket uses. How can I construct a DynamicImageResource from a byte[], and give it to the Wicket Image component? Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/url-for-images-from-database-tp3657615p3699594.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: url for images from database
This works for me, in case anyone's interested in a simple solution. I have a ListView which outputs Books (their Title, Author, etc., and also a Book Image which is a JPG stored in a DB), all per row, based on a POJO called Book which stores all this info. Book also has a byte[] for the Image field. add(new ListView(books, books) { @Override protected void populateItem(ListItem li) { Book b = (Book) li.getModelObject(); li.add(new Label(bookId, b.getBookId().toString())); li.add(new Label(bookTitle, b.getBookTitle())); li.add(new Label(bookAuthors, b.getBookAuthors())); li.add(new Label(bookPrice, Integer.toString(b.getBookPrice(; // add book image ByteArrayResource resourceBookImg = new ByteArrayResource(image/jpeg, b.getBookImg()); TechBooksApplication.get().getSharedResources().add(img + li.getIndex(), resourceBookImg); Image imgBook = new Image(bookImg, resourceBookImg); li.add(imgBook); } }); Maybe this isn't quite what Miroslav wants, but for me I don't need to re-format URLs, so this is working fine for me. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/url-for-images-from-database-tp3657615p3700046.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: url for images from database
No one has experience with LightBox/Slimbox/Shadowbox/Other? How do you implement same src (in img) and href (in a) attributes to make it works? -Original Message- From: Miroslav F. [mailto:mir...@seznam.cz] Sent: Monday, 25. July 2011 21:55 To: users@wicket.apache.org Subject: RE: url for images from database Thanks, was looking on classes :-) Now I have code: HTML: div style= border: 1px solid #DCD4A7; float: left; position: relative; width: 207px; height: 340px; margin-top: 5px; margin-right: 20px; margin-bottom: 10px; a href=# wicket:id=anchor rel=zbox title= imgstyle=border: 3px solid #DCD4A7; padding: 1px 1px 1px 1px; width: 199px; height: 149px; alt= src= wicket:id=image /a Wicket: DBImage image = new DBImage(); image.setImageData((byte[]) dataFromDB.get(dataOffset)); //not to cache images in browser Double random = Math.random(); //put image into shared resources Start.get().getSharedResources().add(image+((String) dataFromDB.get(textOffset)) + random.toString() + .jpg, image); ResourceReference imageResource = new ResourceReference(image+((String) dataFromDB.get(textOffset))+ random.toString()+.jpg); String url=RequestCycle.get().urlFor(imageResource).toString(); //make href in a and src in img point to the same location for zbox to make work ExternalLink odkaz = new ExternalLink(anchor, url); WebMarkupContainer imageSrcAttribute = new WebMarkupContainer(image); imageSrcAttribute.add(new AttributeModifier(src, new ModelString(url))); odkaz.add(imageSrcAttribute); odkaz.add(new SimpleAttributeModifier(title, (String) nazvy.get(i))); this.add(odkaz); This works, not know if code is good from point of right way to do this in wicket.. Miro -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Thursday, 14. July 2011 18:11 To: users@wicket.apache.org Subject: Re: url for images from database look at the very bottom of that page -igor On Thu, Jul 14, 2011 at 6:50 AM, Miroslav F. mir...@seznam.cz wrote: Still be lost :-( This code I have in AppStart class: mountSharedResource(/images/image1.jpg, new ResourceReference(Images.class, image1.jpg).getSharedResourceKey()); Now after reading recomended example still not idea how to replace new ResourceReference(... in above code snippet in a way in which I get from byte[] shared resource key. Please be kindfull, I'm in low level in java and greenhorn in wicket :-D Miro -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Tuesday, 12. July 2011 17:09 To: users@wicket.apache.org Subject: Re: url for images from database https://cwiki.apache.org/WICKET/uploaddownload.html -igor On Tue, Jul 12, 2011 at 2:54 AM, Miroslav F. mir...@seznam.cz wrote: Is there example? How to get shared resource key from byte[] (image from DB)? In my App class i do for several shared resources: mountSharedResource(/styles/style.css, new ResourceReference(Styles.class, style.css).getSharedResourceKey()); Is is possible in this code getsharedResource() for byte[] (image from DB) in some way? -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Sunday, 10. July 2011 18:16 To: users@wicket.apache.org Subject: Re: url for images from database use a shared resource to output the images instead of an Image component -igor On Sun, Jul 10, 2011 at 6:44 AM, Miroslav F. mir...@seznam.cz wrote: Hi folks, please direct me to right docu with following problem: I have image as byte[] from database which I display on pages. Works fine, on image atribute src is somethink like this: img src=?wicket:interface=:0:repeater:1:obrazok::IResourceListener::/ For lightbox I need make this ugly src atribute transform to something like src=/images/xxx.jpg and mount it on-the-fly but don't know how to do it. Is somewhere related example please? Thanks in advance, Miro - 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: url for images from database
I have the exact same problem. I have Images coming from the DB, along with other stuff, and I need to display them, per row, as , similar to how Amazon.com lists their books next to book title, etc. Is there an easy way to do it? Very common problem. Can someone show what the HTML and Java should look like to support this dynamic image display? Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/url-for-images-from-database-tp3657615p3695546.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: url for images from database
Thanks, was looking on classes :-) Now I have code: HTML: div style=border: 1px solid #DCD4A7; float: left; position: relative; width: 207px; height: 340px; margin-top: 5px; margin-right: 20px; margin-bottom: 10px; a href=# wicket:id=anchor rel=zbox title= imgstyle=border: 3px solid #DCD4A7; padding: 1px 1px 1px 1px; width: 199px; height: 149px; alt= src= wicket:id=image /a Wicket: DBImage image = new DBImage(); image.setImageData((byte[]) dataFromDB.get(dataOffset)); //not to cache images in browser Double random = Math.random(); //put image into shared resources Start.get().getSharedResources().add(image+((String) dataFromDB.get(textOffset)) + random.toString() + .jpg, image); ResourceReference imageResource = new ResourceReference(image+((String) dataFromDB.get(textOffset))+ random.toString()+.jpg); String url=RequestCycle.get().urlFor(imageResource).toString(); //make href in a and src in img point to the same location for zbox to make work ExternalLink odkaz = new ExternalLink(anchor, url); WebMarkupContainer imageSrcAttribute = new WebMarkupContainer(image); imageSrcAttribute.add(new AttributeModifier(src, new ModelString(url))); odkaz.add(imageSrcAttribute); odkaz.add(new SimpleAttributeModifier(title, (String) nazvy.get(i))); this.add(odkaz); This works, not know if code is good from point of right way to do this in wicket.. Miro -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Thursday, 14. July 2011 18:11 To: users@wicket.apache.org Subject: Re: url for images from database look at the very bottom of that page -igor On Thu, Jul 14, 2011 at 6:50 AM, Miroslav F. mir...@seznam.cz wrote: Still be lost :-( This code I have in AppStart class: mountSharedResource(/images/image1.jpg, new ResourceReference(Images.class, image1.jpg).getSharedResourceKey()); Now after reading recomended example still not idea how to replace new ResourceReference(... in above code snippet in a way in which I get from byte[] shared resource key. Please be kindfull, I'm in low level in java and greenhorn in wicket :-D Miro -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Tuesday, 12. July 2011 17:09 To: users@wicket.apache.org Subject: Re: url for images from database https://cwiki.apache.org/WICKET/uploaddownload.html -igor On Tue, Jul 12, 2011 at 2:54 AM, Miroslav F. mir...@seznam.cz wrote: Is there example? How to get shared resource key from byte[] (image from DB)? In my App class i do for several shared resources: mountSharedResource(/styles/style.css, new ResourceReference(Styles.class, style.css).getSharedResourceKey()); Is is possible in this code getsharedResource() for byte[] (image from DB) in some way? -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Sunday, 10. July 2011 18:16 To: users@wicket.apache.org Subject: Re: url for images from database use a shared resource to output the images instead of an Image component -igor On Sun, Jul 10, 2011 at 6:44 AM, Miroslav F. mir...@seznam.cz wrote: Hi folks, please direct me to right docu with following problem: I have image as byte[] from database which I display on pages. Works fine, on image atribute src is somethink like this: img src=?wicket:interface=:0:repeater:1:obrazok::IResourceListener::/ For lightbox I need make this ugly src atribute transform to something like src=/images/xxx.jpg and mount it on-the-fly but don't know how to do it. Is somewhere related example please? Thanks in advance, Miro - 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
RE: url for images from database
Still be lost :-( This code I have in AppStart class: mountSharedResource(/images/image1.jpg, new ResourceReference(Images.class, image1.jpg).getSharedResourceKey()); Now after reading recomended example still not idea how to replace new ResourceReference(... in above code snippet in a way in which I get from byte[] shared resource key. Please be kindfull, I'm in low level in java and greenhorn in wicket :-D Miro -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Tuesday, 12. July 2011 17:09 To: users@wicket.apache.org Subject: Re: url for images from database https://cwiki.apache.org/WICKET/uploaddownload.html -igor On Tue, Jul 12, 2011 at 2:54 AM, Miroslav F. mir...@seznam.cz wrote: Is there example? How to get shared resource key from byte[] (image from DB)? In my App class i do for several shared resources: mountSharedResource(/styles/style.css, new ResourceReference(Styles.class, style.css).getSharedResourceKey()); Is is possible in this code getsharedResource() for byte[] (image from DB) in some way? -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Sunday, 10. July 2011 18:16 To: users@wicket.apache.org Subject: Re: url for images from database use a shared resource to output the images instead of an Image component -igor On Sun, Jul 10, 2011 at 6:44 AM, Miroslav F. mir...@seznam.cz wrote: Hi folks, please direct me to right docu with following problem: I have image as byte[] from database which I display on pages. Works fine, on image atribute src is somethink like this: img src=?wicket:interface=:0:repeater:1:obrazok::IResourceListener::/ For lightbox I need make this ugly src atribute transform to something like src=/images/xxx.jpg and mount it on-the-fly but don't know how to do it. Is somewhere related example please? Thanks in advance, Miro - 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: url for images from database
look at the very bottom of that page -igor On Thu, Jul 14, 2011 at 6:50 AM, Miroslav F. mir...@seznam.cz wrote: Still be lost :-( This code I have in AppStart class: mountSharedResource(/images/image1.jpg, new ResourceReference(Images.class, image1.jpg).getSharedResourceKey()); Now after reading recomended example still not idea how to replace new ResourceReference(... in above code snippet in a way in which I get from byte[] shared resource key. Please be kindfull, I'm in low level in java and greenhorn in wicket :-D Miro -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Tuesday, 12. July 2011 17:09 To: users@wicket.apache.org Subject: Re: url for images from database https://cwiki.apache.org/WICKET/uploaddownload.html -igor On Tue, Jul 12, 2011 at 2:54 AM, Miroslav F. mir...@seznam.cz wrote: Is there example? How to get shared resource key from byte[] (image from DB)? In my App class i do for several shared resources: mountSharedResource(/styles/style.css, new ResourceReference(Styles.class, style.css).getSharedResourceKey()); Is is possible in this code getsharedResource() for byte[] (image from DB) in some way? -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Sunday, 10. July 2011 18:16 To: users@wicket.apache.org Subject: Re: url for images from database use a shared resource to output the images instead of an Image component -igor On Sun, Jul 10, 2011 at 6:44 AM, Miroslav F. mir...@seznam.cz wrote: Hi folks, please direct me to right docu with following problem: I have image as byte[] from database which I display on pages. Works fine, on image atribute src is somethink like this: img src=?wicket:interface=:0:repeater:1:obrazok::IResourceListener::/ For lightbox I need make this ugly src atribute transform to something like src=/images/xxx.jpg and mount it on-the-fly but don't know how to do it. Is somewhere related example please? Thanks in advance, Miro - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: url for images from database
Is there example? How to get shared resource key from byte[] (image from DB)? In my App class i do for several shared resources: mountSharedResource(/styles/style.css, new ResourceReference(Styles.class, style.css).getSharedResourceKey()); Is is possible in this code getsharedResource() for byte[] (image from DB) in some way? -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Sunday, 10. July 2011 18:16 To: users@wicket.apache.org Subject: Re: url for images from database use a shared resource to output the images instead of an Image component -igor On Sun, Jul 10, 2011 at 6:44 AM, Miroslav F. mir...@seznam.cz wrote: Hi folks, please direct me to right docu with following problem: I have image as byte[] from database which I display on pages. Works fine, on image atribute src is somethink like this: img src=?wicket:interface=:0:repeater:1:obrazok::IResourceListener::/ For lightbox I need make this ugly src atribute transform to something like src=/images/xxx.jpg and mount it on-the-fly but don't know how to do it. Is somewhere related example please? Thanks in advance, Miro - 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: url for images from database
https://cwiki.apache.org/WICKET/uploaddownload.html -igor On Tue, Jul 12, 2011 at 2:54 AM, Miroslav F. mir...@seznam.cz wrote: Is there example? How to get shared resource key from byte[] (image from DB)? In my App class i do for several shared resources: mountSharedResource(/styles/style.css, new ResourceReference(Styles.class, style.css).getSharedResourceKey()); Is is possible in this code getsharedResource() for byte[] (image from DB) in some way? -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Sunday, 10. July 2011 18:16 To: users@wicket.apache.org Subject: Re: url for images from database use a shared resource to output the images instead of an Image component -igor On Sun, Jul 10, 2011 at 6:44 AM, Miroslav F. mir...@seznam.cz wrote: Hi folks, please direct me to right docu with following problem: I have image as byte[] from database which I display on pages. Works fine, on image atribute src is somethink like this: img src=?wicket:interface=:0:repeater:1:obrazok::IResourceListener::/ For lightbox I need make this ugly src atribute transform to something like src=/images/xxx.jpg and mount it on-the-fly but don't know how to do it. Is somewhere related example please? Thanks in advance, Miro - 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
url for images from database
Hi folks, please direct me to right docu with following problem: I have image as byte[] from database which I display on pages. Works fine, on image atribute src is somethink like this: img src=?wicket:interface=:0:repeater:1:obrazok::IResourceListener::/ For lightbox I need make this ugly src atribute transform to something like src=/images/xxx.jpg and mount it on-the-fly but don't know how to do it. Is somewhere related example please? Thanks in advance, Miro - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: url for images from database
use a shared resource to output the images instead of an Image component -igor On Sun, Jul 10, 2011 at 6:44 AM, Miroslav F. mir...@seznam.cz wrote: Hi folks, please direct me to right docu with following problem: I have image as byte[] from database which I display on pages. Works fine, on image atribute src is somethink like this: img src=?wicket:interface=:0:repeater:1:obrazok::IResourceListener::/ For lightbox I need make this ugly src atribute transform to something like src=/images/xxx.jpg and mount it on-the-fly but don't know how to do it. Is somewhere related example please? Thanks in advance, Miro - 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: database
Hielke, this is what I was looking for :-) Thanks, Miro -Original Message- From: Hielke Hoeve [mailto:hielke.ho...@topicus.nl] Sent: Wednesday, 08. June 2011 08:37 To: users@wicket.apache.org Subject: RE: database http://lmgtfy.com/?q=wicket+hibernate+spring+howto First hit: http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/ Hielke -Original Message- From: Miroslav F. [mailto:mir...@seznam.cz] Sent: dinsdag 7 juni 2011 11:42 To: users@wicket.apache.org Subject: RE: database The original question was I would like to make my wicket app to store images in database. No problem but I don't know how to configure tomcat + wicket for database. No is it good idea to store images in database? ;-) Still don't know how to work with database in wicket. Is anywhere examples? wicket phonebook example is not working: http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-phonebook/ I move to direction not use pure JDBC and using Hibernate. Does someone know where to find docs for using Hibernate in webapp project? Where to put config file or any other specific issues for using Hibernate in webapp? Thanks, Miro -Original Message- From: meduolis [mailto:meduol...@gmail.com] Sent: Sunday, 05. June 2011 12:19 To: users@wicket.apache.org Subject: Re: database Why do you want to store images in database? I think that is not a very good idea. You better store images in your file system, and persist into database only the paths to images. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/database-tp3573282p 3574812.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 - 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: database
http://lmgtfy.com/?q=wicket+hibernate+spring+howto First hit: http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/ Hielke -Original Message- From: Miroslav F. [mailto:mir...@seznam.cz] Sent: dinsdag 7 juni 2011 11:42 To: users@wicket.apache.org Subject: RE: database The original question was I would like to make my wicket app to store images in database. No problem but I don't know how to configure tomcat + wicket for database. No is it good idea to store images in database? ;-) Still don't know how to work with database in wicket. Is anywhere examples? wicket phonebook example is not working: http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-phonebook/ I move to direction not use pure JDBC and using Hibernate. Does someone know where to find docs for using Hibernate in webapp project? Where to put config file or any other specific issues for using Hibernate in webapp? Thanks, Miro -Original Message- From: meduolis [mailto:meduol...@gmail.com] Sent: Sunday, 05. June 2011 12:19 To: users@wicket.apache.org Subject: Re: database Why do you want to store images in database? I think that is not a very good idea. You better store images in your file system, and persist into database only the paths to images. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/database-tp3573282p 3574812.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: database
The original question was I would like to make my wicket app to store images in database. No problem but I don't know how to configure tomcat + wicket for database. No is it good idea to store images in database? ;-) Still don't know how to work with database in wicket. Is anywhere examples? wicket phonebook example is not working: http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-phonebook/ I move to direction not use pure JDBC and using Hibernate. Does someone know where to find docs for using Hibernate in webapp project? Where to put config file or any other specific issues for using Hibernate in webapp? Thanks, Miro -Original Message- From: meduolis [mailto:meduol...@gmail.com] Sent: Sunday, 05. June 2011 12:19 To: users@wicket.apache.org Subject: Re: database Why do you want to store images in database? I think that is not a very good idea. You better store images in your file system, and persist into database only the paths to images. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/database-tp3573282p 3574812.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: database
http://www.jweekend.com/dev/LegUp Here you can choose a Maven archetype that will create an application skeleton with the technologies you chose. https://github.com/wicketstuff/core/tree/master/jdk-1.5-parent/phonebook This is the latest source of phonebook On Tue, Jun 7, 2011 at 11:41 AM, Miroslav F. mir...@seznam.cz wrote: The original question was I would like to make my wicket app to store images in database. No problem but I don't know how to configure tomcat + wicket for database. No is it good idea to store images in database? ;-) Still don't know how to work with database in wicket. Is anywhere examples? wicket phonebook example is not working: http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-phonebook/ I move to direction not use pure JDBC and using Hibernate. Does someone know where to find docs for using Hibernate in webapp project? Where to put config file or any other specific issues for using Hibernate in webapp? Thanks, Miro -Original Message- From: meduolis [mailto:meduol...@gmail.com] Sent: Sunday, 05. June 2011 12:19 To: users@wicket.apache.org Subject: Re: database Why do you want to store images in database? I think that is not a very good idea. You better store images in your file system, and persist into database only the paths to images. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/database-tp3573282p 3574812.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: database
Why do you want to store images in database? I think that is not a very good idea. You better store images in your file system, and persist into database only the paths to images. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/database-tp3573282p3574812.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
database
Hi folks, I'm newbie in wicket. I would like to make my wicket app to store images in database. No problem but I don't know how to configure tomcat + wicket for database. I'm using database in other java apps (I'm Java SWING programmer). Should I use pure JDBC and manage my connections in wicket code? Or should I use Hibernate? Or tomcat database connection pool - I have never use it so I don't know how to make it and use with tomcat and wicket. Please be patient to me - wicket and tomcat is something new for me and I'm confused with doc I have found. In finish I don't know where is right docu for this problem. Examples are welcome. Thanks in advance, Miro - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: database
Hi! I'm newbie in wicket. I would like to make my wicket app to store images in database. No problem but I don't know how to configure tomcat + wicket for database. I'm using database in other java apps (I'm Java SWING programmer). Should I use pure JDBC and manage my connections in wicket code? Or should I use Hibernate? Or tomcat database connection pool - I have never use it so I don't know how to make it and use with tomcat and wicket. Don't mix database and wicket java code. Make a database service module (or use a ready one from spring etc.) and make invocations to it from wicket. Is just the same as using swing. ** Martin Please be patient to me - wicket and tomcat is something new for me and I'm confused with doc I have found. In finish I don't know where is right docu for this problem. Examples are welcome. Thanks in advance, Miro - 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: database
Hi Martin, ok, so can I use Hibernate as in my Swing apps? And Hibernate .jars just to incude in same place as wicket .jar? Where to store Hibernate config file? Miro -Original Message- From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com] Sent: Saturday, 04. June 2011 14:59 To: users@wicket.apache.org Subject: Re: database Hi! I'm newbie in wicket. I would like to make my wicket app to store images in database. No problem but I don't know how to configure tomcat + wicket for database. I'm using database in other java apps (I'm Java SWING programmer). Should I use pure JDBC and manage my connections in wicket code? Or should I use Hibernate? Or tomcat database connection pool - I have never use it so I don't know how to make it and use with tomcat and wicket. Don't mix database and wicket java code. Make a database service module (or use a ready one from spring etc.) and make invocations to it from wicket. Is just the same as using swing. ** Martin Please be patient to me - wicket and tomcat is something new for me and I'm confused with doc I have found. In finish I don't know where is right docu for this problem. Examples are welcome. Thanks in advance, Miro - 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: database
Hi! Make a separate project for wicket app and database module, so you don't need to worry about where to place what in what combination. This way you can share you db module with both your wicket project and swing project. Also you should keep swing project and wicket project sparate. ** Martin 2011/6/4 Miroslav F. mir...@seznam.cz: Hi Martin, ok, so can I use Hibernate as in my Swing apps? And Hibernate .jars just to incude in same place as wicket .jar? Where to store Hibernate config file? Miro -Original Message- From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com] Sent: Saturday, 04. June 2011 14:59 To: users@wicket.apache.org Subject: Re: database Hi! I'm newbie in wicket. I would like to make my wicket app to store images in database. No problem but I don't know how to configure tomcat + wicket for database. I'm using database in other java apps (I'm Java SWING programmer). Should I use pure JDBC and manage my connections in wicket code? Or should I use Hibernate? Or tomcat database connection pool - I have never use it so I don't know how to make it and use with tomcat and wicket. Don't mix database and wicket java code. Make a database service module (or use a ready one from spring etc.) and make invocations to it from wicket. Is just the same as using swing. ** Martin Please be patient to me - wicket and tomcat is something new for me and I'm confused with doc I have found. In finish I don't know where is right docu for this problem. Examples are welcome. Thanks in advance, Miro - 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: database
Separate project? I would to deploy just one .jar into tomcat for my wicket app. I think this wicket app .jar should contain database code for wicket app. I don't need to mix swing apps with wicket apps. -Original Message- From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com] Sent: Saturday, 04. June 2011 15:34 To: users@wicket.apache.org Subject: Re: database Hi! Make a separate project for wicket app and database module, so you don't need to worry about where to place what in what combination. This way you can share you db module with both your wicket project and swing project. Also you should keep swing project and wicket project sparate. ** Martin 2011/6/4 Miroslav F. mir...@seznam.cz: Hi Martin, ok, so can I use Hibernate as in my Swing apps? And Hibernate .jars just to incude in same place as wicket .jar? Where to store Hibernate config file? Miro -Original Message- From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com] Sent: Saturday, 04. June 2011 14:59 To: users@wicket.apache.org Subject: Re: database Hi! I'm newbie in wicket. I would like to make my wicket app to store images in database. No problem but I don't know how to configure tomcat + wicket for database. I'm using database in other java apps (I'm Java SWING programmer). Should I use pure JDBC and manage my connections in wicket code? Or should I use Hibernate? Or tomcat database connection pool - I have never use it so I don't know how to make it and use with tomcat and wicket. Don't mix database and wicket java code. Make a database service module (or use a ready one from spring etc.) and make invocations to it from wicket. Is just the same as using swing. ** Martin Please be patient to me - wicket and tomcat is something new for me and I'm confused with doc I have found. In finish I don't know where is right docu for this problem. Examples are welcome. Thanks in advance, Miro - 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: database
Hi! Separate project? I would to deploy just one .jar into tomcat for my wicket app. I think this wicket app .jar should contain database code for wicket app. Well you can deploy what you want using a deploy script, don't let that mess up your development or project structure. ** Martin -Original Message- From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com] Sent: Saturday, 04. June 2011 15:34 To: users@wicket.apache.org Subject: Re: database Hi! Make a separate project for wicket app and database module, so you don't need to worry about where to place what in what combination. This way you can share you db module with both your wicket project and swing project. Also you should keep swing project and wicket project sparate. ** Martin 2011/6/4 Miroslav F. mir...@seznam.cz: Hi Martin, ok, so can I use Hibernate as in my Swing apps? And Hibernate .jars just to incude in same place as wicket .jar? Where to store Hibernate config file? Miro -Original Message- From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com] Sent: Saturday, 04. June 2011 14:59 To: users@wicket.apache.org Subject: Re: database Hi! I'm newbie in wicket. I would like to make my wicket app to store images in database. No problem but I don't know how to configure tomcat + wicket for database. I'm using database in other java apps (I'm Java SWING programmer). Should I use pure JDBC and manage my connections in wicket code? Or should I use Hibernate? Or tomcat database connection pool - I have never use it so I don't know how to make it and use with tomcat and wicket. Don't mix database and wicket java code. Make a database service module (or use a ready one from spring etc.) and make invocations to it from wicket. Is just the same as using swing. ** Martin Please be patient to me - wicket and tomcat is something new for me and I'm confused with doc I have found. In finish I don't know where is right docu for this problem. Examples are welcome. Thanks in advance, Miro - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to initialize database with Spring in wicketTester/JUnit class?
Hi all, I have a Wicket application which works with Spring, JPA and Hibernate. I used this archetype to create the project (archetype found through Wicket More archetype page) : mvn archetype:generate -B -DarchetypeCatalog= http://legup.googlecode.com/svn/repo/archetype-catalog.xml-DarchetypeArtifactId=wicket-spring-jpa-archetype -DarchetypeGroupId=com.jweekend -DarchetypeVersion=0.8.4 -DgroupId=com.mycompany -DartifactId=mycompany -Dversion=1.0-SNAPSHOT -Dpackage=com.mycompany in the project generated, there is a class DataInitialiser which initialize database and which is called by applicationContext.xml : bean class=fr.statlife.protoE4N.DataInitialiser init-method=dataInit property name=serviceMembre ref=serviceMembre/property property name=serviceLienBaseE4N ref=serviceLienE4N/property /bean it's work well when I test my application manually, but database is not initialized when I used WicketTester. This is the setup method used with wicket tester : public class TestStory04 { protected WicketTester tester; @Before public void setup() { final ApplicationContextMock acm = new ApplicationContextMock(); ServiceIdentification serviceIdentif = Mockito.mock(ServiceIdentification.class); acm.putBean(serviceIdentif, serviceIdentif); ServiceInscription serviceInscription = Mockito.mock(ServiceInscription.class); acm.putBean(serviceInscription, serviceInscription); tester = new WicketTester(new WicketApplication(){ /* (non-Javadoc) * @see fr.statlife.protoE4N.WicketApplication#getGuiceInjector() */ @Override protected SpringComponentInjector getSpringInjector() { return new SpringComponentInjector(this, acm, true); } }); } [some tests] } In setup method, I tried to add DataInitialiser dataInitialiser = Mockito.mock(DataInitialiser.class); acm.putBean(initData, dataInitialiser); try { dataInitialiser.dataInit(); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } but it doesn't work : database is not initialized. So how can I initialize my database ? Thanks -- *Mathilde Pellerin* Ingénieur en développement de logiciel STATLIFE tel : 01.42.11.64.88 mail : mathilde.pelle...@statlife.fr
Re: How to initialize database with Spring in wicketTester/JUnit class?
My mistake : I tried to do integration test with mocks... I think I have to use @ContextConfiguration instead ApplicationContextMock... 2011/5/31 Mathilde Pellerin mathilde.pelle...@statlife.fr Hi all, I have a Wicket application which works with Spring, JPA and Hibernate. I used this archetype to create the project (archetype found through Wicket More archetype page) : mvn archetype:generate -B -DarchetypeCatalog= http://legup.googlecode.com/svn/repo/archetype-catalog.xml-DarchetypeArtifactId=wicket-spring-jpa-archetype -DarchetypeGroupId=com.jweekend -DarchetypeVersion=0.8.4 -DgroupId=com.mycompany -DartifactId=mycompany -Dversion=1.0-SNAPSHOT -Dpackage=com.mycompany in the project generated, there is a class DataInitialiser which initialize database and which is called by applicationContext.xml : bean class=fr.statlife.protoE4N.DataInitialiser init-method=dataInit property name=serviceMembre ref=serviceMembre/property property name=serviceLienBaseE4N ref=serviceLienE4N/property /bean it's work well when I test my application manually, but database is not initialized when I used WicketTester. This is the setup method used with wicket tester : public class TestStory04 { protected WicketTester tester; @Before public void setup() { final ApplicationContextMock acm = new ApplicationContextMock(); ServiceIdentification serviceIdentif = Mockito.mock(ServiceIdentification.class); acm.putBean(serviceIdentif, serviceIdentif); ServiceInscription serviceInscription = Mockito.mock(ServiceInscription.class); acm.putBean(serviceInscription, serviceInscription); tester = new WicketTester(new WicketApplication(){ /* (non-Javadoc) * @see fr.statlife.protoE4N.WicketApplication#getGuiceInjector() */ @Override protected SpringComponentInjector getSpringInjector() { return new SpringComponentInjector(this, acm, true); } }); } [some tests] } In setup method, I tried to add DataInitialiser dataInitialiser = Mockito.mock(DataInitialiser.class); acm.putBean(initData, dataInitialiser); try { dataInitialiser.dataInit(); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } but it doesn't work : database is not initialized. So how can I initialize my database ? Thanks -- *Mathilde Pellerin* Ingénieur en développement de logiciel STATLIFE tel : 01.42.11.64.88 mail : mathilde.pelle...@statlife.fr -- *Mathilde Pellerin* Ingénieur en développement de logiciel STATLIFE tel : 01.42.11.64.88 mail : mathilde.pelle...@statlife.fr
Re: IStringResourceLoader database implementation
Thanks, My concern is also name component collition. The org.apache.wicket.resource.loader.ComponentStringResourceLoader iterates over the component stack to check for the values but that could leed to 10 times per text string and it would be a heavy load even if I implemented some sort of cache. ( Or used wickets in Localizer ). How did you go about name collition without sinking the database? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/IStringResourceLoader-database-implementation-tp3533408p3534888.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