Re: mount images

2013-11-05 Thread Ladislav DANKO

Sorry, it's just macro in my text editor which replace one uccurence with two 
when I copy-paste
from log. One is correct and in log is just one.



On 5.11.2013 12:13, Martin Grigorov wrote:

On Tue, Nov 5, 2013 at 1:09 PM, Ladislav DANKO  wrote:


One more info - in tomact log there is:
Calculating context relative path from: context path '', filterPrefix '',
uri '/images/images/headerbackground.png'
One compatible mapper found for URL '/images/images/headerbackground.png?53'
-> 'Mapper: org.apache.wicket.request.mapper.BufferedResponseMapper;
Score: 2147483647'



I think the problem is that there are two times 'images' in the uri.







 Original Message 
Subject: Re: mount images
Date: Tue, 05 Nov 2013 11:17:11 +0100
From: Ladislav DANKO 
To: users@wicket.apache.org

With size isn't problem, it's around 20 images with total size max 1,5MB.

For me this is point that somethink is going wrong with mounting:
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET 
/images/images/headerbackground.png
HTTP/1.1" 302 -
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET 
/images/images/headerbackground.png?52
HTTP/1.1" 200 9077

Same image, some time but first path return HTTP response code 302 and
second 200 with wrong size (image
has 417 bytes).


On 5.11.2013 10:52, Martin Grigorov wrote:


On Tue, Nov 5, 2013 at 11:42 AM, Ladislav DANKO  wrote:

  I don't need to mount images "dynamicaly" (at the moment of the user

click). For example
I have image logo.png and it's loaded just once when app start and
mounted
at some url path. This path
is still same, not needed to be loaded dynamicaly "when user click". For
this
purpose this 'mountResource("/images/logo.png", new
PackageResourceReference(Images.class, "logo.png"))'
works perfect. Now this image is in DB and I need to do same think. I
have
data (from DB), I have mount
point (from DB), but can't mount on url: AppStart.get().
getSharedResources().add(imagePath, imageData);
Looks that wicket "somethink do" because this events about images in log:
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/
headerbackground.png
HTTP/1.1" 302 -
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/
headerbackground.png?52
HTTP/1.1" 200 9077
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/cz-ico.gif
HTTP/1.1" 302 -
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET
/images/images/icon-fb.png
HTTP/1.1" 302 -
but don't know what's wrong with 'WebApplication.get().
getSharedResources().add(imagePath, imageData)'




I also don't have idea what is wrong with this approach.

But I believe this approach is sub-optimal. Your read from DB at
application start time, then you put the images (byte[]) in instances of
IResource in a Map. I.e. you put some data (how much i cannot say. it
depends on how much images you have) in the heap memory for no good
reason,
IMO.
The article describes how to mount a single resource that dynamically
loads
the byte[] per request.
You should decide which one is better for you.

If you still prefer the shared resources approach then you can put a
breakpoint in SharedResource to see that your  ComponentDynamicImage are
properly resolved and their #getImageData() is called and what gets wrong.







On 5.11.2013 10:24, Martin Grigorov wrote:

  On Tue, Nov 5, 2013 at 11:19 AM, Ladislav DANKO  wrote:


   Martin, thank, I have read it (have the book), but don't find any info


why
this:


  I am not sure we talk about the same thing.

The blog article is not related to any book. And additionally it shows
how
to load images from DB dynamically. It doesn't use shared resources
though.
All you have to do is to mount a resource reference that listens at
"/images/${imageName}" and then put  in
your
.html.


   AppStart.get().getSharedResources().add(imagePath, imageData);


from my code below not working.

Guess that example is for dynamicly loaded images but my example is for
static
images in database (website logo etc) not for dynamic loaded images.
Originaly I have done it in this way:
mountResource("/images/logo.png", new PackageResourceReference(
Images.class,
"logo.png"));
and it works smoothly. Now I moved images into database and looking for
way how to serve them.
In fact, I have image data but not know hot to mount this data into
defined path:
AppStart.get().getSharedResources().add(imagePath, imageData)




On 5.11.2013 9:59, Martin Grigorov wrote:

   Hi,



Check http://wicketinaction.com/2011/07/wicket-1-5-mounting-
resources/


On Tue, Nov 5, 2013 at 10:49 AM, Ladislav DANKO 
wrote:

Hi folks!



I'm using wicket 1.5.10, tomcat 7 and Java 6. In my code i do:
public final class Images{
  public static void mountGl

Re: mount images

2013-11-05 Thread Ladislav DANKO

One more info - in tomact log there is:
Calculating context relative path from: context path '', filterPrefix '', uri 
'/images/images/headerbackground.png'
One compatible mapper found for URL '/images/images/headerbackground.png?53' -> 
'Mapper: org.apache.wicket.request.mapper.BufferedResponseMapper; Score: 
2147483647'



 Original Message 
Subject: Re: mount images
Date: Tue, 05 Nov 2013 11:17:11 +0100
From: Ladislav DANKO 
To: users@wicket.apache.org

With size isn't problem, it's around 20 images with total size max 1,5MB.

For me this is point that somethink is going wrong with mounting:
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/headerbackground.png 
HTTP/1.1" 302 -
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET 
/images/images/headerbackground.png?52 HTTP/1.1" 200 9077

Same image, some time but first path return HTTP response code 302 and second 
200 with wrong size (image
has 417 bytes).


On 5.11.2013 10:52, Martin Grigorov wrote:

On Tue, Nov 5, 2013 at 11:42 AM, Ladislav DANKO  wrote:


I don't need to mount images "dynamicaly" (at the moment of the user
click). For example
I have image logo.png and it's loaded just once when app start and mounted
at some url path. This path
is still same, not needed to be loaded dynamicaly "when user click". For
this
purpose this 'mountResource("/images/logo.png", new
PackageResourceReference(Images.class, "logo.png"))'
works perfect. Now this image is in DB and I need to do same think. I have
data (from DB), I have mount
point (from DB), but can't mount on url: AppStart.get().
getSharedResources().add(imagePath, imageData);
Looks that wicket "somethink do" because this events about images in log:
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET 
/images/images/headerbackground.png
HTTP/1.1" 302 -
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET 
/images/images/headerbackground.png?52
HTTP/1.1" 200 9077
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/cz-ico.gif
HTTP/1.1" 302 -
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/icon-fb.png
HTTP/1.1" 302 -
but don't know what's wrong with 'WebApplication.get().
getSharedResources().add(imagePath, imageData)'



I also don't have idea what is wrong with this approach.

But I believe this approach is sub-optimal. Your read from DB at
application start time, then you put the images (byte[]) in instances of
IResource in a Map. I.e. you put some data (how much i cannot say. it
depends on how much images you have) in the heap memory for no good reason,
IMO.
The article describes how to mount a single resource that dynamically loads
the byte[] per request.
You should decide which one is better for you.

If you still prefer the shared resources approach then you can put a
breakpoint in SharedResource to see that your  ComponentDynamicImage are
properly resolved and their #getImageData() is called and what gets wrong.







On 5.11.2013 10:24, Martin Grigorov wrote:


On Tue, Nov 5, 2013 at 11:19 AM, Ladislav DANKO  wrote:

  Martin, thank, I have read it (have the book), but don't find any info

why
this:



I am not sure we talk about the same thing.
The blog article is not related to any book. And additionally it shows how
to load images from DB dynamically. It doesn't use shared resources
though.
All you have to do is to mount a resource reference that listens at
"/images/${imageName}" and then put  in your
.html.


  AppStart.get().getSharedResources().add(imagePath, imageData);

from my code below not working.

Guess that example is for dynamicly loaded images but my example is for
static
images in database (website logo etc) not for dynamic loaded images.
Originaly I have done it in this way:
mountResource("/images/logo.png", new PackageResourceReference(
Images.class,
"logo.png"));
and it works smoothly. Now I moved images into database and looking for
way how to serve them.
In fact, I have image data but not know hot to mount this data into
defined path:
AppStart.get().getSharedResources().add(imagePath, imageData)




On 5.11.2013 9:59, Martin Grigorov wrote:

  Hi,


Check http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/


On Tue, Nov 5, 2013 at 10:49 AM, Ladislav DANKO  wrote:

   Hi folks!



I'm using wicket 1.5.10, tomcat 7 and Java 6. In my code i do:
public final class Images{
 public static void mountGlobalStaticImages(){
   //loading images from database works perfect
   List imagesParams = GlobalTemplatesDAO.
getGlobalImages();
   for(Object record : imagesParams){
 Map image = (Map) record;
 //it's path like '/images/mylogo.png'
 String imagePath = (String) image.get("file_mount_point");

Re: mount images

2013-11-05 Thread Ladislav DANKO

With size isn't problem, it's around 20 images with total size max 1,5MB.

For me this is point that somethink is going wrong with mounting:
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/headerbackground.png 
HTTP/1.1" 302 -
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET 
/images/images/headerbackground.png?52 HTTP/1.1" 200 9077

Same image, some time but first path return HTTP response code 302 and second 
200 with wrong size (image
has 417 bytes).


On 5.11.2013 10:52, Martin Grigorov wrote:

On Tue, Nov 5, 2013 at 11:42 AM, Ladislav DANKO  wrote:


I don't need to mount images "dynamicaly" (at the moment of the user
click). For example
I have image logo.png and it's loaded just once when app start and mounted
at some url path. This path
is still same, not needed to be loaded dynamicaly "when user click". For
this
purpose this 'mountResource("/images/logo.png", new
PackageResourceReference(Images.class, "logo.png"))'
works perfect. Now this image is in DB and I need to do same think. I have
data (from DB), I have mount
point (from DB), but can't mount on url: AppStart.get().
getSharedResources().add(imagePath, imageData);
Looks that wicket "somethink do" because this events about images in log:
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET 
/images/images/headerbackground.png
HTTP/1.1" 302 -
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET 
/images/images/headerbackground.png?52
HTTP/1.1" 200 9077
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/cz-ico.gif
HTTP/1.1" 302 -
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/icon-fb.png
HTTP/1.1" 302 -
but don't know what's wrong with 'WebApplication.get().
getSharedResources().add(imagePath, imageData)'



I also don't have idea what is wrong with this approach.

But I believe this approach is sub-optimal. Your read from DB at
application start time, then you put the images (byte[]) in instances of
IResource in a Map. I.e. you put some data (how much i cannot say. it
depends on how much images you have) in the heap memory for no good reason,
IMO.
The article describes how to mount a single resource that dynamically loads
the byte[] per request.
You should decide which one is better for you.

If you still prefer the shared resources approach then you can put a
breakpoint in SharedResource to see that your  ComponentDynamicImage are
properly resolved and their #getImageData() is called and what gets wrong.







On 5.11.2013 10:24, Martin Grigorov wrote:


On Tue, Nov 5, 2013 at 11:19 AM, Ladislav DANKO  wrote:

  Martin, thank, I have read it (have the book), but don't find any info

why
this:



I am not sure we talk about the same thing.
The blog article is not related to any book. And additionally it shows how
to load images from DB dynamically. It doesn't use shared resources
though.
All you have to do is to mount a resource reference that listens at
"/images/${imageName}" and then put  in your
.html.


  AppStart.get().getSharedResources().add(imagePath, imageData);

from my code below not working.

Guess that example is for dynamicly loaded images but my example is for
static
images in database (website logo etc) not for dynamic loaded images.
Originaly I have done it in this way:
mountResource("/images/logo.png", new PackageResourceReference(
Images.class,
"logo.png"));
and it works smoothly. Now I moved images into database and looking for
way how to serve them.
In fact, I have image data but not know hot to mount this data into
defined path:
AppStart.get().getSharedResources().add(imagePath, imageData)




On 5.11.2013 9:59, Martin Grigorov wrote:

  Hi,


Check http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/


On Tue, Nov 5, 2013 at 10:49 AM, Ladislav DANKO  wrote:

   Hi folks!



I'm using wicket 1.5.10, tomcat 7 and Java 6. In my code i do:
public final class Images{
 public static void mountGlobalStaticImages(){
   //loading images from database works perfect
   List imagesParams = GlobalTemplatesDAO.
getGlobalImages();
   for(Object record : imagesParams){
 Map image = (Map) record;
 //it's path like '/images/mylogo.png'
 String imagePath = (String) image.get("file_mount_point");
 //ComponentDynamicImage is extended DynamicImageResource,
looks it
works (it provides required byte[] data)
 ComponentDynamicImage imageData = new
ComponentDynamicImage((byte[])
image.get("file_data"));
 //problem is here: looks that it mount image isn't in app and
in
log
is http status code '302'
 //AppStart is extended WebApplication class
 AppStart.get().getSharedResources().add(imagePath, imageData);
   }
 }
}

Problem is that images isn't here, 

Re: mount images

2013-11-05 Thread Ladislav DANKO

I don't need to mount images "dynamicaly" (at the moment of the user click). 
For example
I have image logo.png and it's loaded just once when app start and mounted at 
some url path. This path
is still same, not needed to be loaded dynamicaly "when user click". For this
purpose this 'mountResource("/images/logo.png", new 
PackageResourceReference(Images.class, "logo.png"))'
works perfect. Now this image is in DB and I need to do same think. I have data 
(from DB), I have mount
point (from DB), but can't mount on url: 
AppStart.get().getSharedResources().add(imagePath, imageData);
Looks that wicket "somethink do" because this events about images in log:
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/headerbackground.png 
HTTP/1.1" 302 -
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET 
/images/images/headerbackground.png?52 HTTP/1.1" 200 9077
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/cz-ico.gif 
HTTP/1.1" 302 -
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/icon-fb.png 
HTTP/1.1" 302 -
but don't know what's wrong with 
'WebApplication.get().getSharedResources().add(imagePath, imageData)'



On 5.11.2013 10:24, Martin Grigorov wrote:

On Tue, Nov 5, 2013 at 11:19 AM, Ladislav DANKO  wrote:


Martin, thank, I have read it (have the book), but don't find any info why
this:



I am not sure we talk about the same thing.
The blog article is not related to any book. And additionally it shows how
to load images from DB dynamically. It doesn't use shared resources though.
All you have to do is to mount a resource reference that listens at
"/images/${imageName}" and then put  in your
.html.



AppStart.get().getSharedResources().add(imagePath, imageData);
from my code below not working.

Guess that example is for dynamicly loaded images but my example is for
static
images in database (website logo etc) not for dynamic loaded images.
Originaly I have done it in this way:
mountResource("/images/logo.png", new PackageResourceReference(Images.class,
"logo.png"));
and it works smoothly. Now I moved images into database and looking for
way how to serve them.
In fact, I have image data but not know hot to mount this data into
defined path:
AppStart.get().getSharedResources().add(imagePath, imageData)




On 5.11.2013 9:59, Martin Grigorov wrote:


Hi,

Check http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/


On Tue, Nov 5, 2013 at 10:49 AM, Ladislav DANKO  wrote:

  Hi folks!


I'm using wicket 1.5.10, tomcat 7 and Java 6. In my code i do:
public final class Images{
public static void mountGlobalStaticImages(){
  //loading images from database works perfect
  List imagesParams = GlobalTemplatesDAO.getGlobalImages();
  for(Object record : imagesParams){
Map image = (Map) record;
//it's path like '/images/mylogo.png'
String imagePath = (String) image.get("file_mount_point");
//ComponentDynamicImage is extended DynamicImageResource, looks it
works (it provides required byte[] data)
ComponentDynamicImage imageData = new
ComponentDynamicImage((byte[])
image.get("file_data"));
//problem is here: looks that it mount image isn't in app and in
log
is http status code '302'
//AppStart is extended WebApplication class
AppStart.get().getSharedResources().add(imagePath, imageData);
  }
}
}

Problem is that images isn't here, in localhost_access_log.2013-11-
04.txt
are lines:
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET
/images/images/icon-fb.png
HTTP/1.1" 302 -
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET
/images/images/cz-ico.gif?53 HTTP/1.1" 200 9067
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET
/images/images/icon-fb.png?54 HTTP/1.1" 200 9068
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/en-ico.gif
HTTP/1.1" 302 -
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET
/images/images/en-ico.gif?55 HTTP/1.1" 200 9067

How to mount them properly? As far as i know problem is in
'AppStart.get().
getSharedResources().add(imagePath, imageData)'
but not know how to do it properly.

--
Ladislav DANKO

-
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: mount images

2013-11-05 Thread Ladislav DANKO

Martin, thank, I have read it (have the book), but don't find any info why this:
AppStart.get().getSharedResources().add(imagePath, imageData);
from my code below not working.

Guess that example is for dynamicly loaded images but my example is for static
images in database (website logo etc) not for dynamic loaded images.
Originaly I have done it in this way:
mountResource("/images/logo.png", new PackageResourceReference(Images.class, 
"logo.png"));
and it works smoothly. Now I moved images into database and looking for way how 
to serve them.
In fact, I have image data but not know hot to mount this data into defined 
path:
AppStart.get().getSharedResources().add(imagePath, imageData)



On 5.11.2013 9:59, Martin Grigorov wrote:

Hi,

Check http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/


On Tue, Nov 5, 2013 at 10:49 AM, Ladislav DANKO  wrote:


Hi folks!

I'm using wicket 1.5.10, tomcat 7 and Java 6. In my code i do:
public final class Images{
   public static void mountGlobalStaticImages(){
 //loading images from database works perfect
 List imagesParams = GlobalTemplatesDAO.getGlobalImages();
 for(Object record : imagesParams){
   Map image = (Map) record;
   //it's path like '/images/mylogo.png'
   String imagePath = (String) image.get("file_mount_point");
   //ComponentDynamicImage is extended DynamicImageResource, looks it
works (it provides required byte[] data)
   ComponentDynamicImage imageData = new ComponentDynamicImage((byte[])
image.get("file_data"));
   //problem is here: looks that it mount image isn't in app and in log
is http status code '302'
   //AppStart is extended WebApplication class
   AppStart.get().getSharedResources().add(imagePath, imageData);
 }
   }
}

Problem is that images isn't here, in localhost_access_log.2013-11-04.txt
are lines:
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/icon-fb.png
HTTP/1.1" 302 -
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET
/images/images/cz-ico.gif?53 HTTP/1.1" 200 9067
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET
/images/images/icon-fb.png?54 HTTP/1.1" 200 9068
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/en-ico.gif
HTTP/1.1" 302 -
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET
/images/images/en-ico.gif?55 HTTP/1.1" 200 9067

How to mount them properly? As far as i know problem is in 'AppStart.get().
getSharedResources().add(imagePath, imageData)'
but not know how to do it properly.

--
Ladislav DANKO

-
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



mount images

2013-11-05 Thread Ladislav DANKO

Hi folks!

I'm using wicket 1.5.10, tomcat 7 and Java 6. In my code i do:
public final class Images{
  public static void mountGlobalStaticImages(){
//loading images from database works perfect
List imagesParams = GlobalTemplatesDAO.getGlobalImages();
for(Object record : imagesParams){
  Map image = (Map) record;
  //it's path like '/images/mylogo.png'
  String imagePath = (String) image.get("file_mount_point");
  //ComponentDynamicImage is extended DynamicImageResource, looks it works 
(it provides required byte[] data)
  ComponentDynamicImage imageData = new ComponentDynamicImage((byte[]) 
image.get("file_data"));
  //problem is here: looks that it mount image isn't in app and in log is 
http status code '302'
  //AppStart is extended WebApplication class
  AppStart.get().getSharedResources().add(imagePath, imageData);
}
  }
}

Problem is that images isn't here, in localhost_access_log.2013-11-04.txt are 
lines:
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/icon-fb.png 
HTTP/1.1" 302 -
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/cz-ico.gif?53 
HTTP/1.1" 200 9067
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/icon-fb.png?54 
HTTP/1.1" 200 9068
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/en-ico.gif 
HTTP/1.1" 302 -
127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/en-ico.gif?55 
HTTP/1.1" 200 9067

How to mount them properly? As far as i know problem is in 
'AppStart.get().getSharedResources().add(imagePath, imageData)'
but not know how to do it properly.

--
Ladislav DANKO

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



RE: mountSharedResource() on huge amount of images

2011-03-17 Thread Ladislav DANKO
 

> -Original Message-
> From: mzem...@osc.state.ny.us [mailto:mzem...@osc.state.ny.us] 
> Sent: Tuesday, March 15, 2011 7:28 PM
> To: users@wicket.apache.org
> Subject: Re: mountSharedResource() on huge amount of images
> 
> No offense Bas but that seems like a major hassle, especially 
> considering with an ORM its a simple update/delete/find.  
> When it comes time to build out new servers now you have to 
> shuffle around 300k photos instead of simply replicating a 
> database.  Also sounds like it would make debugging more 
> difficult when your images are three or more folders deep.  
> And what if you want to store attributes along with the 
> photos?  Like say user comments, or flag them for 
> inappropriate content, copyright infringement, etc.  What if 
> there is an open file handle when you try to delete the 
> image?  Just seems to me a much smoother solution to put in a 
> db.  But with that I'm bowing out because as you said it's a 
> heated debate and comes down to personal preference.

Next version will have images in db. Arguments you serve I know,
from point of another atributes database is better.

> 
> 
> 
> 
> From:   Bas Gooren 
> To: users@wicket.apache.org
> Date:   03/15/2011 02:10 PM
> Subject:Re: mountSharedResource() on huge amount of images
> 
> 
> 
> Now you're talking about rendering them, which is a different 
> topic than mounting a resource which serves said images.
> 
> You'll only need to mount a single shared resource which 
> serves all the images. However, given the amount of images 
> you can consider allowing your front-end (e.g. apache httd) 
> or a dedicated webserver serve the images.
> 
> Since you mention that the amount of images can be 
> potentially large (>250), I'd suggest removing the "show all" 
> option, or using an ajax viewport (max 20-50 images on-screen 
> at a time, when the user scrolls you load new images over ajax).
> 
> Someone else just suggested storing images in the database. 
> While there is usually heated debate about this topic (files 
> on disk vs in the database), let me just say that simply 
> having lots of images is no reason to move images into the 
> database. For starters, you can always store your files in a 
> hashed folder structure, e.g. when the ID is 1234, store the 
> image in a file/folder called /1/2/3/4.jpg
> 
> Bas
> 
> Op 15-3-2011 18:00, Ladislav DANKO schreef:
> > Imagine this situation: users have accounts on photo album 
> where they
> upload
> > images. System from uploaded images create thumbnails. Users can 
> > browse their photo - there is combo "show 25", "show 50"... 
> "show all" images.
> On
> > page
> > I render thumbnails on a page which are shadowbox clickable images.
> > All images ("show all") I do in way described below.
> > Works fine but in extreme situation there is user with more 
> than 3.000 
> > images in one photoalbum.
> >
> > Or -how to do it better way?
> >
> > Thanks,
> >
> > Laco
> >
> >
> >
> >> -Original Message-
> >> From: Bas Gooren [mailto:b...@iswd.nl]
> >> Sent: Thursday, March 10, 2011 11:32 PM
> >> To: users@wicket.apache.org
> >> Subject: Re: mountSharedResource() on huge amount of images
> >>
> >> The general idea is to mount a single handler, which takes the 
> >> filename from the url.
> >> There is no reason to mount all images by such a handler 
> one-by-one.
> >>
> >> Bas
> >>
> >> Op 10-3-2011 23:01, Ladislav DANKO schreef:
> >>> Hi all,
> >>>
> >>> what is the recommended way to mount huge amount of an images
> >>> (thousands) in app? Does mountSharedResource() has any bottleneck?
> >>> Simplified code look
> >>> like:
> >>>
> >>> Folder folder = ((Start) Application.get()).getUploadFolder();
> >>> File[] files = folder.getFiles();
> >>> List   lList = Arrays.asList(files);
> >> Collections.sort(lList); int
> >>> i = 0; Iterator   iterator = lList.iterator();
> >>> while(iterator.hasNext())
> >>> {
> >>>  iterator.next();
> >>>  String fileName = lList.get(i).getName();
> >>>  mountSharedResource("/images/" + fileName, new 
> >>> ResourceReference(Images.class, fileName).getSharedResourceKey());
> >>>  i++;
> >>> }
> >>>
> >>> But what if in fol

RE: mountSharedResource() on huge amount of images

2011-03-17 Thread Ladislav DANKO
 

> -Original Message-
> From: Bas Gooren [mailto:b...@iswd.nl] 
> Sent: Tuesday, March 15, 2011 7:10 PM
> To: users@wicket.apache.org
> Subject: Re: mountSharedResource() on huge amount of images
> 
> Now you're talking about rendering them, which is a different 
> topic than mounting a resource which serves said images.
> 
> You'll only need to mount a single shared resource which 
> serves all the images. However, given the amount of images 
> you can consider allowing your front-end (e.g. apache httd) 
> or a dedicated webserver serve the images.

Is there example, please?



> 
> Since you mention that the amount of images can be 
> potentially large (>250), I'd suggest removing the "show all" 
> option, or using an ajax viewport (max 20-50 images on-screen 
> at a time, when the user scrolls you load new images over ajax).
> 
> Someone else just suggested storing images in the database. 
> While there is usually heated debate about this topic (files 
> on disk vs in the database), let me just say that simply 
> having lots of images is no reason to move images into the 
> database. For starters, you can always store your files in a 
> hashed folder structure, e.g. when the ID is 1234, store the 
> image in a file/folder called /1/2/3/4.jpg
> 
> Bas
> 
> Op 15-3-2011 18:00, Ladislav DANKO schreef:
> > Imagine this situation: users have accounts on photo album 
> where they 
> > upload images. System from uploaded images create thumbnails. Users 
> > can browse their photo - there is combo "show 25", "show 
> 50"... "show 
> > all" images. On page I render thumbnails on a page which 
> are shadowbox 
> > clickable images.
> > All images ("show all") I do in way described below.
> > Works fine but in extreme situation there is user with more 
> than 3.000 
> > images in one photoalbum.
> >
> > Or -how to do it better way?
> >
> > Thanks,
> >
> > Laco
> >
> >
> >
> >> -Original Message-
> >> From: Bas Gooren [mailto:b...@iswd.nl]
> >> Sent: Thursday, March 10, 2011 11:32 PM
> >> To: users@wicket.apache.org
> >> Subject: Re: mountSharedResource() on huge amount of images
> >>
> >> The general idea is to mount a single handler, which takes the 
> >> filename from the url.
> >> There is no reason to mount all images by such a handler 
> one-by-one.
> >>
> >> Bas
> >>
> >> Op 10-3-2011 23:01, Ladislav DANKO schreef:
> >>> Hi all,
> >>>
> >>> what is the recommended way to mount huge amount of an images
> >>> (thousands) in app? Does mountSharedResource() has any bottleneck?
> >>> Simplified code look
> >>> like:
> >>>
> >>> Folder folder = ((Start) Application.get()).getUploadFolder();
> >>> File[] files = folder.getFiles();
> >>> List   lList = Arrays.asList(files);
> >> Collections.sort(lList); int
> >>> i = 0; Iterator   iterator = lList.iterator();
> >>> while(iterator.hasNext())
> >>> {
> >>>   iterator.next();
> >>>   String fileName = lList.get(i).getName();
> >>>   mountSharedResource("/images/" + fileName, new 
> >>> ResourceReference(Images.class, fileName).getSharedResourceKey());
> >>>   i++;
> >>> }
> >>>
> >>> But what if in folder is for example 100.000 photos?
> >>>
> >>> Thanks for pointing,
> >>>
> >>> --
> >>> Ladislav DANKO
> >>>
> >>>
> >>>
> >> 
> -
> >>> 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: mountSharedResource() on huge amount of images

2011-03-15 Thread Ladislav DANKO
Imagine this situation: users have accounts on photo album where they upload
images. System from uploaded images create thumbnails. Users can browse
their photo - there is combo "show 25", "show 50"... "show all" images. On
page
I render thumbnails on a page which are shadowbox clickable images.
All images ("show all") I do in way described below.
Works fine but in extreme situation there is user with more than 3.000
images
in one photoalbum.

Or -how to do it better way?

Thanks,

Laco



> -Original Message-
> From: Bas Gooren [mailto:b...@iswd.nl] 
> Sent: Thursday, March 10, 2011 11:32 PM
> To: users@wicket.apache.org
> Subject: Re: mountSharedResource() on huge amount of images
> 
> The general idea is to mount a single handler, which takes 
> the filename from the url.
> There is no reason to mount all images by such a handler one-by-one.
> 
> Bas
> 
> Op 10-3-2011 23:01, Ladislav DANKO schreef:
> > Hi all,
> >
> > what is the recommended way to mount huge amount of an images 
> > (thousands) in app? Does mountSharedResource() has any bottleneck? 
> > Simplified code look
> > like:
> >
> > Folder folder = ((Start) Application.get()).getUploadFolder();
> > File[] files = folder.getFiles();
> > List  lList = Arrays.asList(files); 
> Collections.sort(lList); int 
> > i = 0; Iterator  iterator = lList.iterator();
> > while(iterator.hasNext())
> > {
> > iterator.next();
> > String fileName = lList.get(i).getName();
> > mountSharedResource("/images/" + fileName, new 
> > ResourceReference(Images.class, fileName).getSharedResourceKey());
> > i++;
> > }
> >
> > But what if in folder is for example 100.000 photos?
> >
> > Thanks for pointing,
> >
> > --
> > Ladislav DANKO
> >
> >
> > 
> -
> > 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



mountSharedResource() on huge amount of images

2011-03-10 Thread Ladislav DANKO
Hi all,

what is the recommended way to mount huge amount of an images (thousands)
in app? Does mountSharedResource() has any bottleneck? Simplified code look
like:

Folder folder = ((Start) Application.get()).getUploadFolder();
File[] files = folder.getFiles();
List lList = Arrays.asList(files);
Collections.sort(lList);
int i = 0;
Iterator iterator = lList.iterator();
while(iterator.hasNext())
{
iterator.next();
String fileName = lList.get(i).getName();
mountSharedResource("/images/" + fileName, new
ResourceReference(Images.class, fileName).getSharedResourceKey());
i++;
}

But what if in folder is for example 100.000 photos?

Thanks for pointing,

--
Ladislav DANKO


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



RE: memory leak (solved)

2011-03-04 Thread Ladislav DANKO
 

> -Original Message-
> From: Martin Grigorov [mailto:mgrigo...@apache.org] 
> Sent: Friday, March 04, 2011 10:31 AM
> To: users@wicket.apache.org
> Cc: Ladislav DANKO
> Subject: Re: memory leak (solved)
> 
> On Fri, Mar 4, 2011 at 11:27 AM, Ladislav DANKO 
>  wrote:
> 
> > Solved: in log I have found this (was blind...):
> > SEVERE: Exception starting filter WicketFilter
> > java.lang.IllegalArgumentException: Mount path cannot be 
> under '/resources'
> >
> > but I don't know why this restriction...
> >
> > This path is special for resources managed by Wicket 
> (ResourceReferences).
> This is configurable in Wicket 1.5.

no, this path is special for resources in my app :-)

yes, now i know, i'm looking into
AbstractRequestTargetUrlCodingStrategy.class
and others. where to look into wicket 1.5 to see how it is configurable,
please?



> 
> 
> > Laco
> >
> >
> >
> > > -Original Message-
> > > From: Ladislav DANKO [mailto:em...@1ac0.net]
> > > Sent: Friday, March 04, 2011 8:13 AM
> > > To: users@wicket.apache.org
> > > Subject: RE: memory leak
> > >
> > > and wicket is 1.4.16  :-)
> > >
> > >
> > > > -Original Message-
> > > > From: Ladislav DANKO [mailto:em...@1ac0.net]
> > > > Sent: Friday, March 04, 2011 7:27 AM
> > > > To: users@wicket.apache.org
> > > > Subject: memory leak
> > > >
> > > > Hi folks,
> > > >
> > > > I have JDK 1.6_20, Tomcat 6.0.29 and code:
> > > >
> > > > public class Start extends WebApplication {
> > > > public Start()
> > > > {
> > > > }
> > > >
> > > > protected void init()
> > > > {
> > > > super.init();
> > > >
> > > > mountBookmarkablePage("/index.html", Index.class);
> > > >
> > > > mountSharedResource("/resources/img/cover.jpg",
> > > > new ResourceReference(Images.class, 
> > > > "cover.jpg").getSharedResourceKey());
> > > >
> > > > 
> getMarkupSettings().setDefaultMarkupEncoding("UTF-8");
> > > >
> > > > getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
> > > > }
> > > >
> > > > public Class getHomePage()
> > > > {
> > > > return Index.class;
> > > > }
> > > >
> > > > }
> > > >
> > > > When I deploy it then I get:
> > > > INFO: Deploying web application archive ROOT.war
> > > > 4.3.2011 7:22:14 org.apache.catalina.core.StandardContext start
> > > > SEVERE: Error filterStart
> > > > 4.3.2011 7:22:14 org.apache.catalina.core.StandardContext start
> > > > SEVERE: Context [] startup failed due to previous errors
> > > > 4.3.2011 7:22:14 org.apache.catalina.loader.WebappClassLoader
> > > > clearReferencesThreads
> > > > SEVERE: The web application [] appears to have started a
> > > thread named
> > > > [PageSavingThread-WicketFilter] but has failed to stop 
> it. This is 
> > > > very likely to create a memory leak.
> > > > 329 [main] INFO org.apache.wicket.RequestListenerInterface - 
> > > > registered listener interface [RequestListenerInterface 
> > > > name=INewBrowserWindowListener, method=public abstract void 
> > > > org.apache.wicket.markup.html.INewBrowserWindowListener.onNewB
> > > > rowserWindow()
> > > > ]
> > > > 329 [main] INFO org.apache.wicket.RequestListenerInterface - 
> > > > registered listener interface [RequestListenerInterface 
> > > > name=IResourceListener, method=public abstract void 
> > > > org.apache.wicket.IResourceListener.onResourceRequested()]
> > > > 360 [main] INFO org.apache.wicket.RequestListenerInterface - 
> > > > registered listener interface [RequestListenerInterface 
> > > > name=ILinkListener, method=public abstract void 
> > > > 
> org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()]
> > > > 360 [main] INFO org.apache.wicket.RequestListenerInterface - 
> > > > registered listener interface [RequestListenerInterface 
> > > > name=IRedirectListener, method=public abstract void 
> > > > org.apache.wicket.IRedirectListene

RE: memory leak (solved)

2011-03-04 Thread Ladislav DANKO
Solved: in log I have found this (was blind...):
SEVERE: Exception starting filter WicketFilter
java.lang.IllegalArgumentException: Mount path cannot be under '/resources' 

but I don't know why this restriction...

Laco



> -Original Message-
> From: Ladislav DANKO [mailto:em...@1ac0.net] 
> Sent: Friday, March 04, 2011 8:13 AM
> To: users@wicket.apache.org
> Subject: RE: memory leak
> 
> and wicket is 1.4.16  :-)
>  
> 
> > -----Original Message-
> > From: Ladislav DANKO [mailto:em...@1ac0.net]
> > Sent: Friday, March 04, 2011 7:27 AM
> > To: users@wicket.apache.org
> > Subject: memory leak
> > 
> > Hi folks,
> > 
> > I have JDK 1.6_20, Tomcat 6.0.29 and code:
> > 
> > public class Start extends WebApplication {
> > public Start()
> > {
> > }
> > 
> > protected void init()
> > {
> > super.init();
> > 
> > mountBookmarkablePage("/index.html", Index.class);
> > 
> > mountSharedResource("/resources/img/cover.jpg",
> > new ResourceReference(Images.class,
> > "cover.jpg").getSharedResourceKey());
> > 
> > getMarkupSettings().setDefaultMarkupEncoding("UTF-8");
> > 
> > getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
> > }
> > 
> > public Class getHomePage()
> > {
> > return Index.class;
> > }
> > 
> > }
> > 
> > When I deploy it then I get:
> > INFO: Deploying web application archive ROOT.war
> > 4.3.2011 7:22:14 org.apache.catalina.core.StandardContext start
> > SEVERE: Error filterStart
> > 4.3.2011 7:22:14 org.apache.catalina.core.StandardContext start
> > SEVERE: Context [] startup failed due to previous errors
> > 4.3.2011 7:22:14 org.apache.catalina.loader.WebappClassLoader
> > clearReferencesThreads
> > SEVERE: The web application [] appears to have started a 
> thread named 
> > [PageSavingThread-WicketFilter] but has failed to stop it. This is 
> > very likely to create a memory leak.
> > 329 [main] INFO org.apache.wicket.RequestListenerInterface - 
> > registered listener interface [RequestListenerInterface 
> > name=INewBrowserWindowListener, method=public abstract void 
> > org.apache.wicket.markup.html.INewBrowserWindowListener.onNewB
> > rowserWindow()
> > ]
> > 329 [main] INFO org.apache.wicket.RequestListenerInterface - 
> > registered listener interface [RequestListenerInterface 
> > name=IResourceListener, method=public abstract void 
> > org.apache.wicket.IResourceListener.onResourceRequested()]
> > 360 [main] INFO org.apache.wicket.RequestListenerInterface - 
> > registered listener interface [RequestListenerInterface 
> > name=ILinkListener, method=public abstract void 
> > org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()]
> > 360 [main] INFO org.apache.wicket.RequestListenerInterface - 
> > registered listener interface [RequestListenerInterface 
> > name=IRedirectListener, method=public abstract void 
> > org.apache.wicket.IRedirectListener.onRedirect()]
> > 
> > But when I remove:
> > mountSharedResource("/resources/img/cover.jpg", new 
> > ResourceReference(Images.class, 
> "cover.jpg").getSharedResourceKey());
> > 
> > everythinkg works fine.
> > 
> > Does someone know where is the problem? Googling throught 
> web and list 
> > not helps.
> > 
> > Thanks, Laco
> > 
> > 
> > 
> -
> > 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: memory leak

2011-03-03 Thread Ladislav DANKO
and wicket is 1.4.16  :-)
 

> -Original Message-
> From: Ladislav DANKO [mailto:em...@1ac0.net] 
> Sent: Friday, March 04, 2011 7:27 AM
> To: users@wicket.apache.org
> Subject: memory leak
> 
> Hi folks,
> 
> I have JDK 1.6_20, Tomcat 6.0.29 and code:
> 
> public class Start extends WebApplication {
>   public Start()
>   {
>   }
> 
>   protected void init()
>   {
>   super.init();
> 
>   mountBookmarkablePage("/index.html", Index.class);
> 
>   mountSharedResource("/resources/img/cover.jpg", 
> new ResourceReference(Images.class, 
> "cover.jpg").getSharedResourceKey());
> 
>   getMarkupSettings().setDefaultMarkupEncoding("UTF-8");
>   
> getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
>   }
> 
>   public Class getHomePage()
>   {
>   return Index.class;
>   }
> 
> }
> 
> When I deploy it then I get:
> INFO: Deploying web application archive ROOT.war
> 4.3.2011 7:22:14 org.apache.catalina.core.StandardContext start
> SEVERE: Error filterStart
> 4.3.2011 7:22:14 org.apache.catalina.core.StandardContext start
> SEVERE: Context [] startup failed due to previous errors
> 4.3.2011 7:22:14 org.apache.catalina.loader.WebappClassLoader
> clearReferencesThreads
> SEVERE: The web application [] appears to have started a 
> thread named [PageSavingThread-WicketFilter] but has failed 
> to stop it. This is very likely to create a memory leak.
> 329 [main] INFO org.apache.wicket.RequestListenerInterface - 
> registered listener interface [RequestListenerInterface 
> name=INewBrowserWindowListener, method=public abstract void
> org.apache.wicket.markup.html.INewBrowserWindowListener.onNewB
> rowserWindow()
> ]
> 329 [main] INFO org.apache.wicket.RequestListenerInterface - 
> registered listener interface [RequestListenerInterface 
> name=IResourceListener, method=public abstract void 
> org.apache.wicket.IResourceListener.onResourceRequested()]
> 360 [main] INFO org.apache.wicket.RequestListenerInterface - 
> registered listener interface [RequestListenerInterface 
> name=ILinkListener, method=public abstract void 
> org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()]
> 360 [main] INFO org.apache.wicket.RequestListenerInterface - 
> registered listener interface [RequestListenerInterface 
> name=IRedirectListener, method=public abstract void 
> org.apache.wicket.IRedirectListener.onRedirect()]
> 
> But when I remove:
> mountSharedResource("/resources/img/cover.jpg", new 
> ResourceReference(Images.class, "cover.jpg").getSharedResourceKey());
> 
> everythinkg works fine.
> 
> Does someone know where is the problem? Googling throught web 
> and list not helps.
> 
> Thanks, Laco
> 
> 
> -
> 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



memory leak

2011-03-03 Thread Ladislav DANKO
Hi folks,

I have JDK 1.6_20, Tomcat 6.0.29 and code:

public class Start extends WebApplication
{
public Start()
{
}

protected void init()
{
super.init();

mountBookmarkablePage("/index.html", Index.class);

mountSharedResource("/resources/img/cover.jpg", new
ResourceReference(Images.class, "cover.jpg").getSharedResourceKey());

getMarkupSettings().setDefaultMarkupEncoding("UTF-8");

getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
}

public Class getHomePage()
{
return Index.class;
}

}

When I deploy it then I get:
INFO: Deploying web application archive ROOT.war
4.3.2011 7:22:14 org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
4.3.2011 7:22:14 org.apache.catalina.core.StandardContext start
SEVERE: Context [] startup failed due to previous errors
4.3.2011 7:22:14 org.apache.catalina.loader.WebappClassLoader
clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named
[PageSavingThread-WicketFilter] but has failed to stop it. This is very
likely to create a memory leak.
329 [main] INFO org.apache.wicket.RequestListenerInterface - registered
listener interface [RequestListenerInterface name=INewBrowserWindowListener,
method=public abstract void
org.apache.wicket.markup.html.INewBrowserWindowListener.onNewBrowserWindow()
]
329 [main] INFO org.apache.wicket.RequestListenerInterface - registered
listener interface [RequestListenerInterface name=IResourceListener,
method=public abstract void
org.apache.wicket.IResourceListener.onResourceRequested()]
360 [main] INFO org.apache.wicket.RequestListenerInterface - registered
listener interface [RequestListenerInterface name=ILinkListener,
method=public abstract void
org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()]
360 [main] INFO org.apache.wicket.RequestListenerInterface - registered
listener interface [RequestListenerInterface name=IRedirectListener,
method=public abstract void
org.apache.wicket.IRedirectListener.onRedirect()]

But when I remove:
mountSharedResource("/resources/img/cover.jpg", new
ResourceReference(Images.class, "cover.jpg").getSharedResourceKey());

everythinkg works fine.

Does someone know where is the problem? Googling throught web and list not
helps.

Thanks, Laco


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



RE: [OT] Wicketeers from Czech rep.

2011-02-22 Thread Ladislav DANKO
yes, a lot of ;-)

 

> -Original Message-
> From: danisevsky [mailto:danisev...@gmail.com] 
> Sent: Tuesday, February 22, 2011 4:52 PM
> To: users@wicket.apache.org
> Subject: [OT] Wicketeers from Czech rep.
> 
> Hi fans of Wicket!
> 
> Is there somebody from Czech rep? I'm thinking about 
> organizing an event.
> 
> -
> 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: resource for href="...

2010-12-14 Thread Ladislav DANKO
The question is how to convert file path (photos/img01.jpg) into
wicket url (resources/eu.test.PhotoRepeater/photos/img01.jpg)?

Constructor for Image do this when I call Image("image", path)
but not so for Link.

I check link you provide for me but not found the answer :-(



> -Original Message-
> From: Zilvinas Vilutis [mailto:cika...@gmail.com] 
> Sent: Tuesday, December 14, 2010 1:42 AM
> To: users@wicket.apache.org
> Subject: Re: resource for href="...
> 
> Why don't you just check-out the source code of wicket lightbox:
> http://wicketstuff.org/confluence/display/STUFFWIKI/wicketstuf
> f-lightbox
> to check how it's done there once you decided to write your own one...
> 
> Regards
> 
> Žilvinas Vilutis
> 
> Mobile:   (+370) 652 38353
> E-mail:   cika...@gmail.com
> 
> 
> 
> 2010/12/13 Ladislav DANKO :
> > It is link for lightbox so it will know where the image for 
> display is.
> >
> > Laco
> >
> >
> >> -Original Message-
> >> From: jcar...@carmanconsulting.com
> >> [mailto:jcar...@carmanconsulting.com] On Behalf Of James Carman
> >> Sent: Monday, December 13, 2010 2:24 PM
> >> To: users@wicket.apache.org
> >> Subject: Re: resource for href="...
> >>
> >> What do you want it to do when you click it?
> >>
> >> 2010/12/13 Ladislav DANKO :
> >> > No, I don't need to download it, what I need is right 
> path in href 
> >> > attribute in anchor html tag as is in img html tag (created
> >> as new Image).
> >> >
> >> >
> >> >> -Original Message-
> >> >> From: jcar...@carmanconsulting.com 
> >> >> [mailto:jcar...@carmanconsulting.com] On Behalf Of James Carman
> >> >> Sent: Monday, December 13, 2010 12:13 AM
> >> >> To: users@wicket.apache.org
> >> >> Subject: Re: resource for href="...
> >> >>
> >> >> You want it to download the image?  Try DownloadLink.
> >> >>
> >> >> On Sun, Dec 12, 2010 at 6:02 PM, Ladislav DANKO 
> >> >> wrote:
> >> >> > Hi guys,
> >> >> >
> >> >> > another question -have code (PhotoRepeater extends 
> Panel, view 
> >> >> > is
> >> >> > RepeatingView):
> >> >> > ...
> >> >> > String compID = view.newChildId(); PhotoRepeater 
> clickableImg = 
> >> >> > new PhotoRepeater(compID); clickableImg.add(new 
> >> >> > ExternalLink("fotoPath", path).add(new Image("image", 
> path))); 
> >> >> > view.add(clickableImg);
> >> this.add(view); ..
> >> >> >
> >> >> > and markup:
> >> >> > 
> >> >> >         rel="lightbox[svatebni]"
> >> >> > href="#">
> >> >> >                 >> border="2px" />
> >> >> >        
> >> >> > 
> >> >> >
> >> >> > It works, but in final markup there is:
> >> >> > 
> >> >> >         >> >> >
> >> src="resources/eu.testApp.MyPagePhotoRepeater/phfoto/01_sv_76.jpg"/
> >> >> > >
> >> >> > 
> >> >> >
> >> >> > so image is shown (right path to image resource) but not
> >> clickable
> >> >> > (wrong path). I'm using ExternalLink in wrong way but I
> >> >> don't know the
> >> >> > right way. Can you help me gyus, please?
> >> >> >
> >> >> > Laco
> >> >> >
> >> >> >
> >> >> >
> >> >>
> >> 
> -
> >> >> > 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
> 
> 


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



RE: resource for href="...

2010-12-13 Thread Ladislav DANKO
It is link for lightbox so it will know where the image for display is.

Laco


> -Original Message-
> From: jcar...@carmanconsulting.com 
> [mailto:jcar...@carmanconsulting.com] On Behalf Of James Carman
> Sent: Monday, December 13, 2010 2:24 PM
> To: users@wicket.apache.org
> Subject: Re: resource for href="...
> 
> What do you want it to do when you click it?
> 
> 2010/12/13 Ladislav DANKO :
> > No, I don't need to download it, what I need is right path in href 
> > attribute in anchor html tag as is in img html tag (created 
> as new Image).
> >
> >
> >> -Original Message-
> >> From: jcar...@carmanconsulting.com
> >> [mailto:jcar...@carmanconsulting.com] On Behalf Of James Carman
> >> Sent: Monday, December 13, 2010 12:13 AM
> >> To: users@wicket.apache.org
> >> Subject: Re: resource for href="...
> >>
> >> You want it to download the image?  Try DownloadLink.
> >>
> >> On Sun, Dec 12, 2010 at 6:02 PM, Ladislav DANKO  
> >> wrote:
> >> > Hi guys,
> >> >
> >> > another question -have code (PhotoRepeater extends Panel, view is
> >> > RepeatingView):
> >> > ...
> >> > String compID = view.newChildId();
> >> > PhotoRepeater clickableImg = new PhotoRepeater(compID); 
> >> > clickableImg.add(new ExternalLink("fotoPath", path).add(new 
> >> > Image("image", path))); view.add(clickableImg); 
> this.add(view); ..
> >> >
> >> > and markup:
> >> > 
> >> >         >> > href="#">
> >> >                 border="2px" />
> >> >        
> >> > 
> >> >
> >> > It works, but in final markup there is:
> >> > 
> >> >         >> > 
> src="resources/eu.testApp.MyPagePhotoRepeater/phfoto/01_sv_76.jpg"/
> >> > >
> >> > 
> >> >
> >> > so image is shown (right path to image resource) but not 
> clickable 
> >> > (wrong path). I'm using ExternalLink in wrong way but I
> >> don't know the
> >> > right way. Can you help me gyus, please?
> >> >
> >> > Laco
> >> >
> >> >
> >> >
> >> 
> -
> >> > 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: resource for href="...

2010-12-13 Thread Ladislav DANKO
Hmm, is it possible from Image object get url for image which is
generated in Image("id", file_path)? If yes, than it should be possible
with AttributeModifier change href in Link object..
 

> -Original Message-
> From: Zilvinas Vilutis [mailto:cika...@gmail.com] 
> Sent: Monday, December 13, 2010 9:11 AM
> To: users@wicket.apache.org
> Subject: Re: resource for href="...
> 
> Image class creates a "LocalizedImageResource" which creates 
> a resource reference from a file.
> 
> What you can do ( probably not recommended ) is extend the 
> Image class to retrieve the URL dynamically e.g.
> 
> http://pastebin.com/XCpcgLzC
> 
> Regards
> 
> Žilvinas Vilutis
> 
> Mobile:   (+370) 652 38353
> E-mail:   cika...@gmail.com
> 
> 
> 
> 2010/12/13 Ladislav DANKO :
> > In img src I can use just path, the constructor for Image will 
> > translate it to right path for use in view. Not so ExternalLink.
> >
> > I know doc you pointing me, not suitable for me (I think) because I 
> > have images on the same server as app (under Tomcat). Maybe 
> > ExternalLink I'm using isn't right class?
> > Is it possible to use path in onClick method in Link class?
> >
> >
> >> -Original Message-
> >> From: Zilvinas Vilutis [mailto:cika...@gmail.com]
> >> Sent: Monday, December 13, 2010 8:27 AM
> >> To: Ladislav DANKO
> >> Cc: users@wicket.apache.org
> >> Subject: Re: resource for href="...
> >>
> >> I don't think you can just use the file path ( and that is not 
> >> secure... )
> >>
> >> Please read the following to understand how to use 
> resource reference 
> >> on external images:
> >> https://cwiki.apache.org/WICKET/how-to-load-an-external-image.html
> >>
> >>
> >> Žilvinas Vilutis
> >>
> >> Mobile:   (+370) 652 38353
> >> E-mail:   cika...@gmail.com
> >>
> >>
> >>
> >> 2010/12/13 Ladislav DANKO :
> >> > Snippet of code (note relevant removed):
> >> > //file list in folder, sorted
> >> > Folder folder = ((Start)Application.get()).getUploadFolder();
> >> > File[] files = folder.getFiles();
> >> > List lList = Arrays.asList(files); 
> Collections.sort(lList); 
> >> > //for every image create clickable link with image as link 
> >> > RepeatingView view = new RepeatingView("repeater"); 
> Iterator 
> >> > iterator = lList.iterator();
> >> > while(iterator.hasNext())
> >> > {
> >> >        iterator.next();
> >> >        String fileName = lList.get(i).getName();
> >> >        String path = "photo/" + fileName;
> >> >        String compID = view.newChildId();
> >> >        PhotoRepeater clickableImg = new PhotoRepeater(compID);
> >> >        clickableImg.add(new ExternalLink("photoPath", 
> path).add(new 
> >> > Image("image", path)));
> >> >        view.add(clickableImg);
> >> > }
> >> > this.add(view);
> >> >
> >> > In the final I have right path for "img src" and wrong path
> >> in "a href"
> >> >
> >> > Laco
> >> >
> >> >> -Original Message-
> >> >> From: Zilvinas Vilutis [mailto:cika...@gmail.com]
> >> >> Sent: Monday, December 13, 2010 8:11 AM
> >> >> To: users@wicket.apache.org
> >> >> Subject: Re: resource for href="...
> >> >>
> >> >> I don't see where your "path" is constructed. Did you want to 
> >> >> construct an url for an Image ResourceReference ?
> >> >>
> >> >>
> >> >> Žilvinas Vilutis
> >> >>
> >> >> Mobile:   (+370) 652 38353
> >> >> E-mail:   cika...@gmail.com
> >> >>
> >> >>
> >> >>
> >> >> 2010/12/13 Ladislav DANKO :
> >> >> > No, I don't need to download it, what I need is right
> >> path in href
> >> >> > attribute in anchor html tag as is in img html tag (created
> >> >> as new Image).
> >> >> >
> >> >> >
> >> >> >> -Original Message-
> >> >> >> From: jcar...@carmanconsulting.com 
> >> >> >> [mailto:jcar...@carmanconsulting.c

RE: resource for href="...

2010-12-12 Thread Ladislav DANKO
In img src I can use just path, the constructor for Image
will translate it to right path for use in view. Not so ExternalLink.

I know doc you pointing me, not suitable for me (I think)
because I have images on the same server as app (under
Tomcat). Maybe ExternalLink I'm using isn't right class?
Is it possible to use path in onClick method in Link class?


> -Original Message-
> From: Zilvinas Vilutis [mailto:cika...@gmail.com] 
> Sent: Monday, December 13, 2010 8:27 AM
> To: Ladislav DANKO
> Cc: users@wicket.apache.org
> Subject: Re: resource for href="...
> 
> I don't think you can just use the file path ( and that is 
> not secure... )
> 
> Please read the following to understand how to use resource 
> reference on external images:
> https://cwiki.apache.org/WICKET/how-to-load-an-external-image.html
> 
> 
> Žilvinas Vilutis
> 
> Mobile:   (+370) 652 38353
> E-mail:   cika...@gmail.com
> 
> 
> 
> 2010/12/13 Ladislav DANKO :
> > Snippet of code (note relevant removed):
> > //file list in folder, sorted
> > Folder folder = ((Start)Application.get()).getUploadFolder();
> > File[] files = folder.getFiles();
> > List lList = Arrays.asList(files); Collections.sort(lList); 
> > //for every image create clickable link with image as link 
> > RepeatingView view = new RepeatingView("repeater"); Iterator 
> > iterator = lList.iterator();
> > while(iterator.hasNext())
> > {
> >        iterator.next();
> >        String fileName = lList.get(i).getName();
> >        String path = "photo/" + fileName;
> >        String compID = view.newChildId();
> >        PhotoRepeater clickableImg = new PhotoRepeater(compID);
> >        clickableImg.add(new ExternalLink("photoPath", path).add(new 
> > Image("image", path)));
> >        view.add(clickableImg);
> > }
> > this.add(view);
> >
> > In the final I have right path for "img src" and wrong path 
> in "a href"
> >
> > Laco
> >
> >> -Original Message-
> >> From: Zilvinas Vilutis [mailto:cika...@gmail.com]
> >> Sent: Monday, December 13, 2010 8:11 AM
> >> To: users@wicket.apache.org
> >> Subject: Re: resource for href="...
> >>
> >> I don't see where your "path" is constructed. Did you want to 
> >> construct an url for an Image ResourceReference ?
> >>
> >>
> >> Žilvinas Vilutis
> >>
> >> Mobile:   (+370) 652 38353
> >> E-mail:   cika...@gmail.com
> >>
> >>
> >>
> >> 2010/12/13 Ladislav DANKO :
> >> > No, I don't need to download it, what I need is right 
> path in href 
> >> > attribute in anchor html tag as is in img html tag (created
> >> as new Image).
> >> >
> >> >
> >> >> -Original Message-
> >> >> From: jcar...@carmanconsulting.com 
> >> >> [mailto:jcar...@carmanconsulting.com] On Behalf Of James Carman
> >> >> Sent: Monday, December 13, 2010 12:13 AM
> >> >> To: users@wicket.apache.org
> >> >> Subject: Re: resource for href="...
> >> >>
> >> >> You want it to download the image?  Try DownloadLink.
> >> >>
> >> >> On Sun, Dec 12, 2010 at 6:02 PM, Ladislav DANKO 
> >> >> wrote:
> >> >> > Hi guys,
> >> >> >
> >> >> > another question -have code (PhotoRepeater extends 
> Panel, view 
> >> >> > is
> >> >> > RepeatingView):
> >> >> > ...
> >> >> > String compID = view.newChildId(); PhotoRepeater 
> clickableImg = 
> >> >> > new PhotoRepeater(compID); clickableImg.add(new 
> >> >> > ExternalLink("fotoPath", path).add(new Image("image", 
> path))); 
> >> >> > view.add(clickableImg);
> >> this.add(view); ..
> >> >> >
> >> >> > and markup:
> >> >> > 
> >> >> >         rel="lightbox[svatebni]"
> >> >> > href="#">
> >> >> >                 >> border="2px" />
> >> >> >        
> >> >> > 
> >> >> >
> >> >> > It works, but in final markup there is:
> >> >> > 
> >> >> >         >> >> >
> >> src="resources/eu.testApp.MyPagePhotoRepeater/phfoto/01_sv_76.jpg&

RE: resource for href="...

2010-12-12 Thread Ladislav DANKO
Snippet of code (note relevant removed):
//file list in folder, sorted
Folder folder = ((Start)Application.get()).getUploadFolder();
File[] files = folder.getFiles();
List lList = Arrays.asList(files);
Collections.sort(lList);
//for every image create clickable link with image as link
RepeatingView view = new RepeatingView("repeater");
Iterator iterator = lList.iterator();
while(iterator.hasNext())
{
iterator.next();
String fileName = lList.get(i).getName();
String path = "photo/" + fileName;
String compID = view.newChildId();
PhotoRepeater clickableImg = new PhotoRepeater(compID);
clickableImg.add(new ExternalLink("photoPath", path).add(new
Image("image", path)));
view.add(clickableImg);
}
this.add(view);

In the final I have right path for "img src" and wrong path in "a href"

Laco

> -Original Message-
> From: Zilvinas Vilutis [mailto:cika...@gmail.com] 
> Sent: Monday, December 13, 2010 8:11 AM
> To: users@wicket.apache.org
> Subject: Re: resource for href="...
> 
> I don't see where your "path" is constructed. Did you want to 
> construct an url for an Image ResourceReference ?
> 
> 
> Žilvinas Vilutis
> 
> Mobile:   (+370) 652 38353
> E-mail:   cika...@gmail.com
> 
> 
> 
> 2010/12/13 Ladislav DANKO :
> > No, I don't need to download it, what I need is right path in href 
> > attribute in anchor html tag as is in img html tag (created 
> as new Image).
> >
> >
> >> -Original Message-
> >> From: jcar...@carmanconsulting.com
> >> [mailto:jcar...@carmanconsulting.com] On Behalf Of James Carman
> >> Sent: Monday, December 13, 2010 12:13 AM
> >> To: users@wicket.apache.org
> >> Subject: Re: resource for href="...
> >>
> >> You want it to download the image?  Try DownloadLink.
> >>
> >> On Sun, Dec 12, 2010 at 6:02 PM, Ladislav DANKO  
> >> wrote:
> >> > Hi guys,
> >> >
> >> > another question -have code (PhotoRepeater extends Panel, view is
> >> > RepeatingView):
> >> > ...
> >> > String compID = view.newChildId();
> >> > PhotoRepeater clickableImg = new PhotoRepeater(compID); 
> >> > clickableImg.add(new ExternalLink("fotoPath", path).add(new 
> >> > Image("image", path))); view.add(clickableImg); 
> this.add(view); ..
> >> >
> >> > and markup:
> >> > 
> >> >         >> > href="#">
> >> >                 border="2px" />
> >> >        
> >> > 
> >> >
> >> > It works, but in final markup there is:
> >> > 
> >> >         >> > 
> src="resources/eu.testApp.MyPagePhotoRepeater/phfoto/01_sv_76.jpg"/
> >> > >
> >> > 
> >> >
> >> > so image is shown (right path to image resource) but not 
> clickable 
> >> > (wrong path). I'm using ExternalLink in wrong way but I
> >> don't know the
> >> > right way. Can you help me gyus, please?
> >> >
> >> > Laco
> >> >
> >> >
> >> >
> >> 
> -
> >> > 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: resource for href="...

2010-12-12 Thread Ladislav DANKO
No, I don't need to download it, what I need is right path in href attribute
in anchor html tag as is in img html tag (created as new Image).
 

> -Original Message-
> From: jcar...@carmanconsulting.com 
> [mailto:jcar...@carmanconsulting.com] On Behalf Of James Carman
> Sent: Monday, December 13, 2010 12:13 AM
> To: users@wicket.apache.org
> Subject: Re: resource for href="...
> 
> You want it to download the image?  Try DownloadLink.
> 
> On Sun, Dec 12, 2010 at 6:02 PM, Ladislav DANKO 
>  wrote:
> > Hi guys,
> >
> > another question -have code (PhotoRepeater extends Panel, view is
> > RepeatingView):
> > ...
> > String compID = view.newChildId();
> > PhotoRepeater clickableImg = new PhotoRepeater(compID); 
> > clickableImg.add(new ExternalLink("fotoPath", path).add(new 
> > Image("image", path))); view.add(clickableImg); this.add(view); ..
> >
> > and markup:
> > 
> >         > href="#">
> >                
> >        
> > 
> >
> > It works, but in final markup there is:
> > 
> >         > src="resources/eu.testApp.MyPagePhotoRepeater/phfoto/01_sv_76.jpg"/>
> > 
> >
> > so image is shown (right path to image resource) but not clickable 
> > (wrong path). I'm using ExternalLink in wrong way but I 
> don't know the 
> > right way. Can you help me gyus, please?
> >
> > Laco
> >
> >
> > 
> -
> > 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



resource for href="...

2010-12-12 Thread Ladislav DANKO
Hi guys,

another question -have code (PhotoRepeater extends Panel, view is
RepeatingView):
...
String compID = view.newChildId();
PhotoRepeater clickableImg = new PhotoRepeater(compID);
clickableImg.add(new ExternalLink("fotoPath", path).add(new Image("image",
path)));
view.add(clickableImg);
this.add(view);
..

and markup:






It works, but in final markup there is:




so image is shown (right path to image resource) but not clickable (wrong
path). I'm using
ExternalLink in wrong way but I don't know the right way. Can you help me
gyus, please?

Laco


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



RE: repeters with

2010-12-12 Thread Ladislav DANKO
used, works ;-) -see my previous post. thanks for pointing me to this :)


> -Original Message-
> From: d.bartl.comsy...@googlemail.com 
> [mailto:d.bartl.comsy...@googlemail.com] On Behalf Of Daniel Bartl
> Sent: Sunday, December 12, 2010 10:12 PM
> To: users@wicket.apache.org
> Subject: Re: repeters with
> 
> Use RepeatingView#newChildId() in order to generate unique id 
> for each of your LinkAndImagePanels while iterating through 
> these like this:
> 
> for (LinkAndImagePanel panel : allPanels) {
> String id = repeater.newChildId();
> repeater.add(new LinkAndImagePanel(id, entry));
> }
> 
> 
> On Sun, Dec 12, 2010 at 10:02 PM, Ladislav DANKO 
>  wrote:
> 
> > Panel added
> > ...
> > view.add(new LinkAndImagePanel("linkandimagepanel"));
> > ...
> >
> > with apropriate panel markup and java code.
> >
> > Looks works when there is just one image but for two or more images 
> > there is error:
> > Caused by: java.lang.IllegalArgumentException: A child with id 
> > 'linkandimagepanel' already exists:
> >
> > How to add multiple panels in repeater? For Image there is param in 
> > constructor, but for Panel?
> >
> >
> >
> >
> > > -Original Message-
> > > From: Martin Grigorov [mailto:mgrigo...@apache.org]
> > > Sent: Sunday, December 12, 2010 11:10 AM
> > > To: users@wicket.apache.org
> > > Subject: Re: repeters with
> > >
> > > the repeater should add a Panel (or a Fragment) instead 
> of Image The 
> > > Panel itself will contain something like:
> > >
> > > ExternalLink link = new ExternalLink("id", href); add(link); 
> > > link.add(new Image("image", ...);
> > >
> > > On Sun, Dec 12, 2010 at 11:07 AM, Ladislav DANKO  
> > > wrote:
> > >
> > > > How is possible to make a nested html tag with 
> AttributeModifier?
> > > >
> > > > Laco
> > > >
> > > > > -----Original Message-
> > > > > From: Per Newgro [mailto:per.new...@gmx.ch]
> > > > > Sent: Sunday, December 12, 2010 10:23 AM
> > > > > To: users@wicket.apache.org
> > > > > Subject: Re: repeters with
> > > > >
> > > > > You could add Links (instead of the image) and use an 
> > > > > AttributeModifier for the href.
> > > > >
> > > > > CHeers
> > > > > Per
> > > > >
> > > > > Am 12.12.2010 09:19, schrieb Ladislav DANKO:
> > > > > > Hi,
> > > > > >
> > > > > > from files in dir I do a list of photos. I do it this way:
> > > > > > public class InsertPhotos extends WebPage {
> > > > > > public InsertPhotos() throws IOException
> > > > > > {
> > > > > >
> > > > > > Folder folder =
> > > > > > ((Start)Application.get()).getPhotosFolder();
> > > > > > File[] files = folder.getFiles();
> > > > > > List  lList = Arrays.asList(files);
> > > > > > Collections.sort(lList);
> > > > > >
> > > > > > RepeatingView view = new 
> RepeatingView("repeater");
> > > > > > while(iterator.hasNext())
> > > > > > {
> > > > > > iterator.next();
> > > > > > String fileName = 
> lList.get(i).getName();
> > > > > > String path = "../../photos/" + 
> fileName;
> > > > > > i++;
> > > > > > view.add(new
> > > Image(view.newChildId(), path));
> > > > > > }
> > > > > > this.add(view);
> > > > > > }
> > > > > > }
> > > > > >
> > > > > > and markup:
> > > > > >  > > > > > />
> > > > > >
> > > > > > so resulting markup is:
> > > > > >  > > style="padding: 2px; width:
> > > > > > 90px;"/>
> > > > > >  > > style="padding: 2px; width:
> > > > > > 90px;"/>
> > > > > > ...
> > > > > >
> > > > >

RE: repeters with

2010-12-12 Thread Ladislav DANKO
Yes, I  know this doc. Not suitable for me (not shown case in
which html tags are nested -see my original post)



> -Original Message-
> From: jcgarciam [mailto:jcgarc...@gmail.com] 
> Sent: Sunday, December 12, 2010 10:10 PM
> To: users@wicket.apache.org
> Subject: Re: repeters with
> 
> 
> Taken from the Javadoc:
> http://wicket.apache.org/apidocs/1.4/org/apache/wicket/markup/
> repeater/RepeatingView.html
> <http://wicket.apache.org/apidocs/1.4/org/apache/wicket/markup
> /repeater/RepeatingView.html>
> The usual use of a RepeatingView is:
> 
> Example:
> 
> *Java:*
> 
>  RepeatingView view = new RepeatingView("repeater");  
> view.add(new Label(view.newChildId(), "hello"));  
> view.add(new Label(view.newChildId(), "goodbye"));  
> view.add(new Label(view.newChildId(), "good morning"));  add(view);
> 
> 
> *Markup:*
> 
> 
>   
> 
> 
> *Yields:*
> 
> 
>   hellogoodbyegood morning
> 
> 
> 
> On Sun, Dec 12, 2010 at 6:02 PM, Ladislav DANKO [via Apache Wicket] <
> ml-node+3084657-482134668-65...@n4.nabble.com 7-48213466
> ml-node+8-65...@n4.nabble.com>
> > wrote:
> 
> > Panel added
> > ...
> > view.add(new LinkAndImagePanel("linkandimagepanel"));
> > ...
> >
> > with apropriate panel markup and java code.
> >
> > Looks works when there is just one image but for two or more images 
> > there is error:
> > Caused by: java.lang.IllegalArgumentException: A child with id 
> > 'linkandimagepanel' already exists:
> >
> > How to add multiple panels in repeater? For Image there is param in 
> > constructor, but for Panel?
> >
> >
> >
> >
> > > -Original Message-
> > > From: Martin Grigorov [mailto:[hidden 
> > > email]<http://user/SendEmail.jtp?type=node&node=3084657&i=0>]
> >
> > > Sent: Sunday, December 12, 2010 11:10 AM
> > > To: [hidden 
> > > email]<http://user/SendEmail.jtp?type=node&node=3084657&i=1>
> > > Subject: Re: repeters with
> > >
> > > the repeater should add a Panel (or a Fragment) instead 
> of Image The 
> > > Panel itself will contain something like:
> > >
> > > ExternalLink link = new ExternalLink("id", href); add(link); 
> > > link.add(new Image("image", ...);
> > >
> > > On Sun, Dec 12, 2010 at 11:07 AM, Ladislav DANKO <[hidden email] 
> > > <http://user/SendEmail.jtp?type=node&node=3084657&i=2>>
> > wrote:
> > >
> > > > How is possible to make a nested html tag with 
> AttributeModifier?
> > > >
> > > > Laco
> > > >
> > > > > -Original Message-
> > > > > From: Per Newgro [mailto:[hidden 
> > > > > email]<http://user/SendEmail.jtp?type=node&node=3084657&i=3>]
> >
> > > > > Sent: Sunday, December 12, 2010 10:23 AM
> > > > > To: [hidden 
> > > > > email]<http://user/SendEmail.jtp?type=node&node=3084657&i=4>
> > > > > Subject: Re: repeters with
> > > > >
> > > > > You could add Links (instead of the image) and use an 
> > > > > AttributeModifier for the href.
> > > > >
> > > > > CHeers
> > > > > Per
> > > > >
> > > > > Am 12.12.2010 09:19, schrieb Ladislav DANKO:
> > > > > > Hi,
> > > > > >
> > > > > > from files in dir I do a list of photos. I do it this way:
> > > > > > public class InsertPhotos extends WebPage {
> > > > > > public InsertPhotos() throws IOException
> > > > > > {
> > > > > >
> > > > > > Folder folder =
> > > > > > ((Start)Application.get()).getPhotosFolder();
> > > > > > File[] files = folder.getFiles();
> > > > > > List  lList = Arrays.asList(files);
> > > > > > Collections.sort(lList);
> > > > > >
> > > > > > RepeatingView view = new 
> RepeatingView("repeater");
> > > > > > while(iterator.hasNext())
> > > > > > {
> > > > > > iterator.next();
> > > > > > String fileName = 
> lL

RE: repeters with

2010-12-12 Thread Ladislav DANKO
will answer myself :-)
view.add(new LinkAndImagePanel(view.newChildId()));

Laco


> -Original Message-
> From: Ladislav DANKO [mailto:em...@1ac0.net] 
> Sent: Sunday, December 12, 2010 10:03 PM
> To: users@wicket.apache.org
> Subject: RE: repeters with
> 
> Panel added
> ...
> view.add(new LinkAndImagePanel("linkandimagepanel"));
> ...
> 
> with apropriate panel markup and java code.
> 
> Looks works when there is just one image but for two or more 
> images there is error:
> Caused by: java.lang.IllegalArgumentException: A child with 
> id 'linkandimagepanel' already exists:
> 
> How to add multiple panels in repeater? For Image there is 
> param in constructor, but for Panel?
> 
> 
> 
> 
> > -Original Message-
> > From: Martin Grigorov [mailto:mgrigo...@apache.org]
> > Sent: Sunday, December 12, 2010 11:10 AM
> > To: users@wicket.apache.org
> > Subject: Re: repeters with
> > 
> > the repeater should add a Panel (or a Fragment) instead of 
> Image The 
> > Panel itself will contain something like:
> > 
> > ExternalLink link = new ExternalLink("id", href); add(link); 
> > link.add(new Image("image", ...);
> > 
> > On Sun, Dec 12, 2010 at 11:07 AM, Ladislav DANKO  
> > wrote:
> > 
> > > How is possible to make a nested html tag with AttributeModifier?
> > >
> > > Laco
> > >
> > > > -Original Message-
> > > > From: Per Newgro [mailto:per.new...@gmx.ch]
> > > > Sent: Sunday, December 12, 2010 10:23 AM
> > > > To: users@wicket.apache.org
> > > > Subject: Re: repeters with
> > > >
> > > > You could add Links (instead of the image) and use an 
> > > > AttributeModifier for the href.
> > > >
> > > > CHeers
> > > > Per
> > > >
> > > > Am 12.12.2010 09:19, schrieb Ladislav DANKO:
> > > > > Hi,
> > > > >
> > > > > from files in dir I do a list of photos. I do it this way:
> > > > > public class InsertPhotos extends WebPage {
> > > > > public InsertPhotos() throws IOException
> > > > > {
> > > > >
> > > > > Folder folder =
> > > > > ((Start)Application.get()).getPhotosFolder();
> > > > > File[] files = folder.getFiles();
> > > > > List  lList = Arrays.asList(files);
> > > > > Collections.sort(lList);
> > > > >
> > > > > RepeatingView view = new 
> RepeatingView("repeater");
> > > > > while(iterator.hasNext())
> > > > > {
> > > > > iterator.next();
> > > > > String fileName = lList.get(i).getName();
> > > > > String path = "../../photos/" + fileName;
> > > > > i++;
> > > > > view.add(new
> > Image(view.newChildId(), path));
> > > > > }
> > > > > this.add(view);
> > > > > }
> > > > > }
> > > > >
> > > > > and markup:
> > > > > 
> > > > >
> > > > > so resulting markup is:
> > > > >  > style="padding: 2px; width:
> > > > > 90px;"/>
> > > > >  > style="padding: 2px; width:
> > > > > 90px;"/>
> > > > > ...
> > > > >
> > > > > This works but now I need to make a clickable list of
> > photos, so
> > > > > resulting markup should be:
> > > > >  > > > href="resources/../../photos/1.jpg">
> > > > >  > > > > src="resources/../../photos/01.jpg" />   > > > > rel="lightbox[svatebni]" href="resources/../../photos/1.jpg">
> > > > >  > > > > src="resources/../../photos/02.jpg" />  ...
> > > > >
> > > > > I don't know how to add anchor around img tag, can
> > someone help me
> > > > > please? I was searching through doc and list but 
> found nothing.
> > > > >
> > > > > Thanks, Laco
> > > > >
> > > > >
> > > > >
> > > > 
> > 
> > > > -
> > > > > 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: repeters with

2010-12-12 Thread Ladislav DANKO
Panel added
...
view.add(new LinkAndImagePanel("linkandimagepanel"));
...

with apropriate panel markup and java code.

Looks works when there is just one image but for two or more images
there is error:
Caused by: java.lang.IllegalArgumentException: A child with id
'linkandimagepanel' already exists:

How to add multiple panels in repeater? For Image there is param in
constructor, but for Panel?




> -Original Message-
> From: Martin Grigorov [mailto:mgrigo...@apache.org] 
> Sent: Sunday, December 12, 2010 11:10 AM
> To: users@wicket.apache.org
> Subject: Re: repeters with
> 
> the repeater should add a Panel (or a Fragment) instead of 
> Image The Panel itself will contain something like:
> 
> ExternalLink link = new ExternalLink("id", href); add(link); 
> link.add(new Image("image", ...);
> 
> On Sun, Dec 12, 2010 at 11:07 AM, Ladislav DANKO 
>  wrote:
> 
> > How is possible to make a nested html tag with AttributeModifier?
> >
> > Laco
> >
> > > -Original Message-
> > > From: Per Newgro [mailto:per.new...@gmx.ch]
> > > Sent: Sunday, December 12, 2010 10:23 AM
> > > To: users@wicket.apache.org
> > > Subject: Re: repeters with
> > >
> > > You could add Links (instead of the image) and use an 
> > > AttributeModifier for the href.
> > >
> > > CHeers
> > > Per
> > >
> > > Am 12.12.2010 09:19, schrieb Ladislav DANKO:
> > > > Hi,
> > > >
> > > > from files in dir I do a list of photos. I do it this way:
> > > > public class InsertPhotos extends WebPage {
> > > > public InsertPhotos() throws IOException
> > > > {
> > > >
> > > > Folder folder =
> > > > ((Start)Application.get()).getPhotosFolder();
> > > > File[] files = folder.getFiles();
> > > > List  lList = Arrays.asList(files);
> > > > Collections.sort(lList);
> > > >
> > > > RepeatingView view = new RepeatingView("repeater");
> > > > while(iterator.hasNext())
> > > > {
> > > > iterator.next();
> > > > String fileName = lList.get(i).getName();
> > > > String path = "../../photos/" + fileName;
> > > > i++;
> > > > view.add(new 
> Image(view.newChildId(), path));
> > > > }
> > > > this.add(view);
> > > > }
> > > > }
> > > >
> > > > and markup:
> > > > 
> > > >
> > > > so resulting markup is:
> > > >  style="padding: 2px; width:
> > > > 90px;"/>
> > > >  style="padding: 2px; width:
> > > > 90px;"/>
> > > > ...
> > > >
> > > > This works but now I need to make a clickable list of 
> photos, so 
> > > > resulting markup should be:
> > > >  > > href="resources/../../photos/1.jpg">
> > > >  > > > src="resources/../../photos/01.jpg" />   > > > rel="lightbox[svatebni]" href="resources/../../photos/1.jpg">
> > > >  > > > src="resources/../../photos/02.jpg" />  ...
> > > >
> > > > I don't know how to add anchor around img tag, can 
> someone help me 
> > > > please? I was searching through doc and list but found nothing.
> > > >
> > > > Thanks, Laco
> > > >
> > > >
> > > >
> > > 
> 
> > > -
> > > > 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: repeters with

2010-12-12 Thread Ladislav DANKO
How is possible to make a nested html tag with AttributeModifier? 

Laco

> -Original Message-
> From: Per Newgro [mailto:per.new...@gmx.ch] 
> Sent: Sunday, December 12, 2010 10:23 AM
> To: users@wicket.apache.org
> Subject: Re: repeters with
> 
> You could add Links (instead of the image) and use an 
> AttributeModifier for the href.
> 
> CHeers
> Per
> 
> Am 12.12.2010 09:19, schrieb Ladislav DANKO:
> > Hi,
> >
> > from files in dir I do a list of photos. I do it this way:
> > public class InsertPhotos extends WebPage {
> > public InsertPhotos() throws IOException
> > {
> >
> > Folder folder =
> > ((Start)Application.get()).getPhotosFolder();
> > File[] files = folder.getFiles();
> > List  lList = Arrays.asList(files);
> > Collections.sort(lList);
> >
> > RepeatingView view = new RepeatingView("repeater");
> > while(iterator.hasNext())
> > {
> > iterator.next();
> > String fileName = lList.get(i).getName();
> > String path = "../../photos/" + fileName;
> > i++;
> > view.add(new Image(view.newChildId(), path));
> > }
> > this.add(view);
> > }
> > }
> >
> > and markup:
> > 
> >
> > so resulting markup is:
> > 
> > 
> > ...
> >
> > This works but now I need to make a clickable list of photos, so 
> > resulting markup should be:
> >  href="resources/../../photos/1.jpg">
> >  > src="resources/../../photos/01.jpg" />   > rel="lightbox[svatebni]" href="resources/../../photos/1.jpg">
> >  > src="resources/../../photos/02.jpg" />  ...
> >
> > I don't know how to add anchor around img tag, can someone help me 
> > please? I was searching through doc and list but found nothing.
> >
> > Thanks, Laco
> >
> >
> > 
> -
> > 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



repeters with

2010-12-12 Thread Ladislav DANKO
Hi,

from files in dir I do a list of photos. I do it this way:
public class InsertPhotos extends WebPage
{
public InsertPhotos() throws IOException
{

Folder folder =
((Start)Application.get()).getPhotosFolder();
File[] files = folder.getFiles();
List lList = Arrays.asList(files);
Collections.sort(lList);

RepeatingView view = new RepeatingView("repeater");
while(iterator.hasNext())
{
iterator.next();
String fileName = lList.get(i).getName();
String path = "../../photos/" + fileName;
i++;
view.add(new Image(view.newChildId(), path));
}
this.add(view);
}
}

and markup:


so resulting markup is:


...

This works but now I need to make a clickable list of photos, so resulting
markup
should be:






...

I don't know how to add anchor around img tag, can someone help me
please? I was searching through doc and list but found nothing.

Thanks, Laco


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