Due to enormous amounts of spam, the forum has been set to read-only mode.



Reply to topic  [ 11 posts ]  Go to page 1, 2  Next
GeneratHTML Filter Questions 
Author Message

Joined: Thu Jul 31, 2003 8:21 pm
Posts: 1433
Post GeneratHTML Filter Questions

1. Is the filter always the token between the "?" and the first "@" in a url?

2. If a url has no filter, the previous filter is always presumed?


Sun Aug 16, 2009 10:54 pm
Profile
Site Admin
User avatar

Joined: Fri Nov 22, 2002 3:52 pm
Posts: 13748
Post Re: GeneratHTML Filter Questions

JSonnabend1 wrote:
1. Is the filter always the token between the "?" and the first "@" in a url?

No, not necessarily.

Quote:
2. If a url has no filter, the previous filter is always presumed?

No, without a filter you get an error.

_________________
Fredrik Nordbakke
www.fnprg.com


Mon Aug 17, 2009 11:08 am
Profile WWW

Joined: Thu Jul 31, 2003 8:21 pm
Posts: 1433
Post Re: GeneratHTML Filter Questions

Ok, how do you determine what the filter is, then?

As for #2, your answer doesn't make sense. Valid URL's in the XSL files don't always have filters in them. Some are simply the name of the template. For example, the stock track.xsl template includes the link: "Track_Credits.xsl". There's no filter specified there.

- Jeff


Mon Aug 17, 2009 3:25 pm
Profile
User avatar

Joined: Sat Nov 22, 2003 7:47 pm
Posts: 2547
Location: Denmark
Post Re: GeneratHTML Filter Questions

JSonnabend1 wrote:
Ok, how do you determine what the filter is, then?

As for #2, your answer doesn't make sense. Valid URL's in the XSL files don't always have filters in them. Some are simply the name of the template. For example, the stock track.xsl template includes the link: "Track_Credits.xsl". There's no filter specified there.

- Jeff


Please look at the code I sent you (explorer.pas).
Look for the handling of SaveTemplate and SaveFilter.

_________________
Kind regards
Thomas Hamstrup

HAP Software (http://www.hamstrup.dk)

Using Windows 8 PRO 64-bit and CATraxx 9.44


Mon Aug 17, 2009 7:05 pm
Profile WWW

Joined: Thu Jul 31, 2003 8:21 pm
Posts: 1433
Post Re: GeneratHTML Filter Questions

Ok, how do you handle the situation I posted above for the link to "Track_Credits.xsl" in "Track.xsl"?

I have my code working for some time now, I'm just not sure I'm doing things the most efficient way.

- Jeff


Mon Aug 17, 2009 7:19 pm
Profile
User avatar

Joined: Sat Nov 22, 2003 7:47 pm
Posts: 2547
Location: Denmark
Post Re: GeneratHTML Filter Questions

JSonnabend1 wrote:
Ok, how do you handle the situation I posted above for the link to "Track_Credits.xsl" in "Track.xsl"?

I have my code working for some time now, I'm just not sure I'm doing things the most efficient way.

- Jeff


In function TFrmExplorer.GetCATraxxData the Filter is saved to SaveFilter (conditional).

if not NoSave then
begin
SaveTemplate:=Template;
SaveFilter:=Filter;
end;

In procedure TFrmExplorer.ViewerHotSpotClick the various possibilities is checked.
In this case (Track_Credits.xsl) it will be trapped here:

if ContainsStr(URL, '.xsl') then
begin
Template:=HAPgetToken(URL,'?',1);
Filter:=Copy(URL,Length(Template) + 2,
Length(URL) - Length(Template) - 1);
if Filter = '' then Filter:=SaveFilter;
end

Since there is no filter, SaveFilter is used.
SaveFilter will contain "ID=1"

Hope that helps.

_________________
Kind regards
Thomas Hamstrup

HAP Software (http://www.hamstrup.dk)

Using Windows 8 PRO 64-bit and CATraxx 9.44


Mon Aug 17, 2009 7:49 pm
Profile WWW

Joined: Thu Jul 31, 2003 8:21 pm
Posts: 1433
Post Re: GeneratHTML Filter Questions

Why would ID=1? What if that's not the id of the track being displayed in the track.xsl template?

Do this. Bring up track.xsl?id=2. Now click on the link linking to Track_Credits.xsl. The link is:
Code:
<A HREF="Track_Credits.xsl">Credits</A>

That's valid in the Catraxx explorer (it's even from a default template). How does your code handle that?

- Jeff

Oh, I see. You're using "ID=1" as an example. You save the last filter, and if there's no new filter, you use the last filter. That's what I'm doing, although it gets tough if you're tracking multiple connections (each with its own filter).


Mon Aug 17, 2009 8:18 pm
Profile
Site Admin
User avatar

Joined: Fri Nov 22, 2002 3:52 pm
Posts: 13748
Post Re: GeneratHTML Filter Questions

JSonnabend1 wrote:
Ok, how do you determine what the filter is, then?

That is not difficult. Is something not working correctly?

Quote:
As for #2, your answer doesn't make sense.

Not? Trying to generate either a record or list page without a filter will result in an error ("invalid record id" or "no filter criteria").

Quote:
Valid URL's in the XSL files don't always have filters in them. Some are simply the name of the template. For example, the stock track.xsl template includes the link: "Track_Credits.xsl". There's no filter specified there.

That is because the explorer module keeps track of the record id of the "active" record, and automatically uses this id as the filter when linking to a record page if a filter is not specificed. If you want to use the standard templates, you have to do this yourself.

_________________
Fredrik Nordbakke
www.fnprg.com


Tue Aug 18, 2009 11:32 am
Profile WWW

Joined: Thu Jul 31, 2003 8:21 pm
Posts: 1433
Post Re: GeneratHTML Filter Questions

Exactly. If the URL has not filter specified, the explorer module uses the last good filter. The URL has no filter, though, and no error is specified. That was my question.

- Jeff


Tue Aug 18, 2009 2:22 pm
Profile
Site Admin
User avatar

Joined: Fri Nov 22, 2002 3:52 pm
Posts: 13748
Post Re: GeneratHTML Filter Questions

JSonnabend1 wrote:
Exactly. If the URL has not filter specified, the explorer module uses the last good filter.

Only for record pages, though.

Quote:
The URL has no filter, though, and no error is specified. That was my question.

I thought you were talking about the data server, not the explorer module...

_________________
Fredrik Nordbakke
www.fnprg.com


Tue Aug 18, 2009 3:01 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 11 posts ]  Go to page 1, 2  Next

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.