|
View unanswered posts | View active topics
It is currently Sun May 26, 2013 1:42 am
Due to enormous amounts of spam, the forum has been set to read-only mode.
GeneratHTML Filter Questions
| Author |
Message |
|
JSonnabend1
Joined: Thu Jul 31, 2003 8:21 pm Posts: 1433
|
 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 |
|
 |
|
FredrikN
Site Admin
Joined: Fri Nov 22, 2002 3:52 pm Posts: 13748
|
 Re: GeneratHTML Filter Questions
No, not necessarily. No, without a filter you get an error.
_________________ Fredrik Nordbakke www.fnprg.com
|
| Mon Aug 17, 2009 11:08 am |
|
 |
|
JSonnabend1
Joined: Thu Jul 31, 2003 8:21 pm Posts: 1433
|
 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 |
|
 |
|
hamsen
Joined: Sat Nov 22, 2003 7:47 pm Posts: 2547 Location: Denmark
|
 Re: GeneratHTML Filter Questions
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 |
|
 |
|
JSonnabend1
Joined: Thu Jul 31, 2003 8:21 pm Posts: 1433
|
 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 |
|
 |
|
hamsen
Joined: Sat Nov 22, 2003 7:47 pm Posts: 2547 Location: Denmark
|
 Re: GeneratHTML Filter Questions
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 |
|
 |
|
JSonnabend1
Joined: Thu Jul 31, 2003 8:21 pm Posts: 1433
|
 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: 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 |
|
 |
|
FredrikN
Site Admin
Joined: Fri Nov 22, 2002 3:52 pm Posts: 13748
|
 Re: GeneratHTML Filter Questions
That is not difficult. Is something not working correctly? 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"). 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 |
|
 |
|
JSonnabend1
Joined: Thu Jul 31, 2003 8:21 pm Posts: 1433
|
 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 |
|
 |
|
FredrikN
Site Admin
Joined: Fri Nov 22, 2002 3:52 pm Posts: 13748
|
 Re: GeneratHTML Filter Questions
Only for record pages, though. 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 |
|
|
|
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
|
|