Permlink Replies: 47 - Pages: 4 [ Previous | 1 2 3 4 | Next ] - Last Post: 20 Jul 15, 13:45 Last Post By: RobM Threads: [ Previous | Next ]
tyra

Posts: 12
Registered: 15-Mar-2008
Re: Q. for David
Posted: 7 Mar 09, 14:38   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
Brilliant! Thanks David.

I have implemented that with my database & DSN with this in the index.htt:

<%!
class Lot {
String photoPath;
String productDescription;
String buyItNowPrice;
String lotID;

public Lot(String photoPath, String productDescription, String buyItNowPrice, String lotID) {
this.photoPath = photoPath;
this.productDescription = productDescription;
this.buyItNowPrice = buyItNowPrice;
this.lotID = lotID;
}
}
%>
<%!
import java.sql.*;
Map lots = new HashMap();
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:wellsdb");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select PhotoPath, ProductDescription, BuyItNowPrice, LotID from Lot where BuyItNowPrice is not null and PhotoPath is not null");
while (rs.next()) {
String photoPath = rs.getString(1);
String productDescription = rs.getString(2);
String buyItNowPrice = rs.getString(3);
String lotID = rs.getString(4);
lots.put(photoPath, new Lot(photoPath, productDescription, buyItNowPrice, lotID));
System.out.println(photoPath + "\t" + productDescription + "\t" + buyItNowPrice + "\t" + lotID);
}
rs.close();
stmt.close();
con.close();
%>

This outputs the data correctly in the system console:

displayProductImage1.jpg Distressed Teak Coffee Table 456.0000 14
chinesebench.jpg Aqua sofa 87889.0000 1135
LINOCHBK.jpg 2 crystal vases (one chipped) 467.9000 1752

This is my slide.htt code:

<%!
Lot lot = (Lot)lots.get(photoPath);
%>
<ja:if exists="lot">
The filename is <%= lot.photoPath %>.
The description is <%= lot.productDescription %>.
The price is <%= lot.buyItNowPrice %>.
The HTML is <%= lot.payPalHTML %>.
</ja:if>

I get this error when I MAKE ALBUM:

Evaluation error on line 2:

Details:
Sourced file: inline evaluation of: `` Lot lot = (Lot)lots.get(photoPath); ;'' : Typed variable declaration : Undefined argument: photoPath

I can't work out why the slide.htt doesn't know about photoPath?

Thanks :-)

davidekholm

Posts: 3,442
Registered: 18-Oct-2002
Re: Q. for David
Posted: 7 Mar 09, 14:51   in response to: tyra in response to: tyra
  Click to reply to this thread Reply
Well, it knows about lot.photoPath, but photoPath is a different thing. I guess you meant fileName there, didn't you?
tyra

Posts: 12
Registered: 15-Mar-2008
Re: Q. for David
Posted: 13 Mar 09, 09:45   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
Ok, I've changed it to filename but it still doesn't know about lot in the slide.htt file. Do I need to re-declare Lot at the top of slide.htt - I tried that and it doesn't seem to work.

In slide.htt the map contents are not being output so I put an else statement in and it is dropping into the else and displaying the text "This is sample text". There are no errors in the system console.

<%!
Lot lot = (Lot)lots.get(fileName);
%>
<ja:if exists="lot">
The filename is <%= lot.photoPath %>.
The description is <%= lot.productDescription %>.
The price is <%= lot.buyItNowPrice %>.
The HTML is <%= lot.payPalHTML %>.
</ja:if>
<ja:else>
This is sample text.
</ja:else>
davidekholm

Posts: 3,442
Registered: 18-Oct-2002
Re: Q. for David
Posted: 13 Mar 09, 21:28   in response to: tyra in response to: tyra
  Click to reply to this thread Reply
Can you zip and attach the skin you've been entering this into?
tyra

Posts: 12
Registered: 15-Mar-2008
Re: Q. for David
Posted: 14 Mar 09, 01:30   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
Attachment Chameleon.zip (1.4 MB)
See attached.
Thanks so much.
davidekholm

Posts: 3,442
Registered: 18-Oct-2002
Re: Q. for David
Posted: 15 Mar 09, 01:28   in response to: tyra in response to: tyra
  Click to reply to this thread Reply
I've now found out that Jalbum's exists test isn't smart enough to handle variables declared within a scriptlet. Only variables declared by Jalbum itself are identified by an if exists test. I'll probaby change this for upcoming versions, but for now, here is a working code. Note also how I've dropped the ! character from your scriptlet. I did that so your scriptlet gets evaluated for every image and not just the first time.

Here is a modified slide.htt:
<%
	Lot lot = (Lot)lots.get(fileName);
%>
<ja:if test="<%=lot != null %>">
  The filename is <%= lot.photoPath %>.
  The description is <%= lot.productDescription %>.
  The price is <%= lot.buyItNowPrice %>.
</ja:if>
<ja:else>
  This is sample text.
</ja:else>
tyra

Posts: 12
Registered: 15-Mar-2008
Re: Q. for David
Posted: 18 Mar 09, 00:45   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
This has worked beautifully. Thanks for your patience and assistance in helping me get this working.
Very happy :-)
Regards!!
davidekholm

Posts: 3,442
Registered: 18-Oct-2002
Re: Q. for David
Posted: 18 Mar 09, 03:45   in response to: tyra in response to: tyra
  Click to reply to this thread Reply
Great! In the next Jalbum version, ja:if exists will work with variables you've declared in scriptlets too.
Exquisiteimage

Posts: 4
Registered: 4-Apr-2012
Re: Reading comments from an external database
Posted: 18 Jul 15, 15:18   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
Attachment index.htt (7.5 KB)
Attachment error message.txt (2.7 KB)
Attachment dsn.png (108.6 KB)
Attachment slide.htt (6.9 KB)
Hi David,

You very kindly helped with with this about 10 years ago, but can't get it working again,

Any ideas ?

Thanks,

Michael,,,,

Edited by: Exquisiteimage on 18-Jul-2015 15:18

Edited by: Exquisiteimage on 18-Jul-2015 16:43
RobM

Posts: 3,815
Registered: 4-Aug-2006
Re: Reading comments from an external database
Posted: 18 Jul 15, 17:22   in response to: Exquisiteimage in response to: Exquisiteimage
  Click to reply to this thread Reply
Exquisiteimage wrote:
Hi David,
You very kindly helped with with this about 10 years ago, but can't get it working again,
Any ideas ?
Thanks,
Michael,,,,
Hello Michael, I notice that you have a standard license for jAlbum, as you are a professional photographer and are using jAlbum on your website you need a Pro license. You can contact the jAlbum help desk to upgrade your license.
Exquisiteimage

Posts: 4
Registered: 4-Apr-2012
Re: Reading comments from an external database
Posted: 18 Jul 15, 17:58   in response to: RobM in response to: RobM
  Click to reply to this thread Reply
Hi Rob,

I upgraded in May of this year,

"SUPPORT AND UPGRADE PLAN EXPIRES: May 27, 2016"

I do not/did not, use Jalbum for my work (I used Wordpress for that http://www.exquisiteimage.co.uk/) and I retired last year as well,

Regards, Michael,,,,
RobM

Posts: 3,815
Registered: 4-Aug-2006
Re: Reading comments from an external database
Posted: 18 Jul 15, 18:08   in response to: Exquisiteimage in response to: Exquisiteimage
  Click to reply to this thread Reply
Hi, your license is a Standard one, not a Pro one. One cannot tell from your website that you are retired, it does not show that, but it does show jAlbum is being used, for example http://www.exquisiteimage.co.uk/8-hour-wedding-in-full/
That page shows you are using Chameleon skin with jAlbum 11.2.4
Exquisiteimage

Posts: 4
Registered: 4-Apr-2012
Re: Reading comments from an external database
Posted: 18 Jul 15, 21:36   in response to: RobM in response to: RobM
  Click to reply to this thread Reply
That page was generated 4 years ago ! I can delete if you would like !

The website I want some help with is http://www.moodyimage.co.uk/
RobM

Posts: 3,815
Registered: 4-Aug-2006
Re: Reading comments from an external database
Posted: 18 Jul 15, 21:56   in response to: Exquisiteimage in response to: Exquisiteimage
  Click to reply to this thread Reply
First, I think it would help David or others help if you could give more details of what is wrong. Are you using Turtle skin, is it a modified skin etc. Referring to help from ten years ago is a big ask of anyone ;) a new post in a suitable forum might get a better response than this old thread.

Your new site still looks like a pro license is needed, it is linking to your defunct(?) site, not just the old page I mentioned. It doesn't matter if the page is new or old, does it, it is still a professional use of jAlbum - just confirming that you have not had the correct license for several years.

A pro license is required if jAlbum is used commercially, not just directly selling images via a shopping cart, e.g. promoting a business.
Exquisiteimage

Posts: 4
Registered: 4-Apr-2012
Re: Reading comments from an external database
Posted: 20 Jul 15, 09:56   in response to: RobM in response to: RobM
  Click to reply to this thread Reply
Hi Rob,

I have now deleted that old page (generated 4 years) ago that used Jalbum (when I did have a pro licence),

As confirmed previous this is 100% for non commercial use

Here is the section I need to do the work with

http://www.moodyimage.co.uk/Personal/index.html

Please escalate this to David as this seems pretty anal !

Thanks,
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums