extending auto indexes

Hi

I have an auto index which requires matching metadata on a number of items using a checkboxtree control. The only way I can sort of get this to work is by using the LegacyAutoSlotContentFinder and creating a XML resouces which has a manual query.

I cannot seem to be able to pass the slot parameters to the query by using the syntax :slot_param. Is there another way of doing this?

Cheers
James

James,

What version is this is? There were some issues with the Legacy Slot Content Finder passing parameters in 6.0 and some 6.1 systems, but I believe them to be resolved in 6.5.

I don’t know if this relates to your specific issue or not without doing some digging.

Dave

Hi Dave

Yes we’re using 6.5. I did a trace on the application just to see what was being passed to the xml application. As you can see I tried it a couple of ways changing the parameter names but no joy:

09/02 04:57:04.708 App Handler Processing
Using App Handler for sp_Support_cas

09/02 04:57:04.708 App Handler Processing
Finding resource get_all_content in sp_Support_cas

09/02 04:57:04.708 App Handler Processing
Examining resource: get_all_content (id = Dataset10812) - Selection succeeded

09/02 04:57:04.724 Basic Request Info
GET /Rhythmyx/sp_Support_cas/get_all_content.xml

09/02 04:57:04.724 Initial HTML/CGI
HTML Parameters:
sys_contentid = :sys_contentid
sys_variantid = :sys_variantid

CGI Variables:

09/02 04:57:04.724 File Info
No files found:

09/02 04:57:04.724 Session Info
Sessions are enabled but existing user session not found.

09/02 04:57:04.724 App Security
User has the access level required: Query

09/02 04:57:04.740 Resource Handler
SQL statement submitted: SELECT DISTINCT
CONTENTSTATUS.,
PSX_CONTENTTYPE_TEMPLATE.
,
STATES.*
FROM CONTENTSTATUS
LEFT JOIN SP_META_BUSINESSUNIT_SP_META_BUSINESSUNIT BU ON
CONTENTSTATUS.CONTENTID = BU.CONTENTID
AND CONTENTSTATUS.CURRENTREVISION = BU.REVISIONID
LEFT JOIN SP_META_BUSINESSUNIT_SP_META_BUSINESSUNIT BU2 ON
BU2.BUSINESS_UNIT = BU.BUSINESS_UNIT
LEFT JOIN SP_META_DEPARTMENT_SP_META_DEPARTMENT DP ON CONTENTSTATUS.CONTENTI
D = DP.CONTENTID
AND CONTENTSTATUS.CURRENTREVISION = DP.REVISIONID
LEFT JOIN SP_META_DEPARTMENT_SP_META_DEPARTMENT DP2 ON DP2.DEPARTMENT =
DP.DEPARTMENT
LEFT JOIN SP_META_LOCATION_SP_META_LOCATION LOC ON CONTENTSTATUS.CONTENTID
= LOC.CONTENTID
AND CONTENTSTATUS.CURRENTREVISION = LOC.REVISIONID
LEFT JOIN SP_META_LOCATION_SP_META_LOCATION LOC2 ON LOC2.LOCATION =
LOC.LOCATION
LEFT JOIN CONTENTSTATUS CON2 ON DP2.CONTENTID = CON2.CONTENTID
AND LOC2.CONTENTID = CON2.CONTENTID
LEFT JOIN STATES ON CONTENTSTATUS.CONTENTSTATEID = STATES.STATEID
AND CONTENTSTATUS.WORKFLOWAPPID = STATES.WORKFLOWAPPID
LEFT JOIN PSX_CONTENTTYPE_TEMPLATE ON CONTENTSTATUS.CONTENTTYPEID =
PSX_CONTENTTYPE_TEMPLATE.CONTENTTYPEID
WHERE CON2.CONTENTID = :sys_contentid
AND CONTENTSTATUS.CONTENTID <> :sys_contentid
AND PSX_CONTENTTYPE_TEMPLATE.TEMPLATE_ID = :sys_variantid

09/02 04:59:39.040 App Handler Processing
Using App Handler for sp_Support_cas

09/02 04:59:39.040 App Handler Processing
Finding resource get_all_content in sp_Support_cas

09/02 04:59:39.040 App Handler Processing
Examining resource: get_all_content (id = Dataset10812) - Selection succeeded

09/02 04:59:39.040 Basic Request Info
GET /Rhythmyx/sp_Support_cas/get_all_content.xml

09/02 04:59:39.040 Initial HTML/CGI
HTML Parameters:
sys_contentid = :sys_contentid
sys_variantid = :sys_variantid

CGI Variables:

09/02 04:59:39.040 File Info
No files found:

09/02 04:59:39.040 Session Info
Sessions are enabled but existing user session not found.

09/02 04:59:39.040 App Security
User has the access level required: Query

09/02 04:59:39.040 Resource Handler
SQL statement submitted: SELECT DISTINCT
CONTENTSTATUS.,
PSX_CONTENTTYPE_TEMPLATE.
,
STATES.*
FROM CONTENTSTATUS
LEFT JOIN SP_META_BUSINESSUNIT_SP_META_BUSINESSUNIT BU ON
CONTENTSTATUS.CONTENTID = BU.CONTENTID
AND CONTENTSTATUS.CURRENTREVISION = BU.REVISIONID
LEFT JOIN SP_META_BUSINESSUNIT_SP_META_BUSINESSUNIT BU2 ON
BU2.BUSINESS_UNIT = BU.BUSINESS_UNIT
LEFT JOIN SP_META_DEPARTMENT_SP_META_DEPARTMENT DP ON CONTENTSTATUS.CONTENTI
D = DP.CONTENTID
AND CONTENTSTATUS.CURRENTREVISION = DP.REVISIONID
LEFT JOIN SP_META_DEPARTMENT_SP_META_DEPARTMENT DP2 ON DP2.DEPARTMENT =
DP.DEPARTMENT
LEFT JOIN SP_META_LOCATION_SP_META_LOCATION LOC ON CONTENTSTATUS.CONTENTID
= LOC.CONTENTID
AND CONTENTSTATUS.CURRENTREVISION = LOC.REVISIONID
LEFT JOIN SP_META_LOCATION_SP_META_LOCATION LOC2 ON LOC2.LOCATION =
LOC.LOCATION
LEFT JOIN CONTENTSTATUS CON2 ON DP2.CONTENTID = CON2.CONTENTID
AND LOC2.CONTENTID = CON2.CONTENTID
LEFT JOIN STATES ON CONTENTSTATUS.CONTENTSTATEID = STATES.STATEID
AND CONTENTSTATUS.WORKFLOWAPPID = STATES.WORKFLOWAPPID
LEFT JOIN PSX_CONTENTTYPE_TEMPLATE ON CONTENTSTATUS.CONTENTTYPEID =
PSX_CONTENTTYPE_TEMPLATE.CONTENTTYPEID
WHERE CON2.CONTENTID = :sys_contentid
AND CONTENTSTATUS.CONTENTID <> :sys_contentid
AND PSX_CONTENTTYPE_TEMPLATE.TEMPLATE_ID = :sys_variantid

09/02 05:01:26.465 App Handler Processing
Using App Handler for sp_Support_cas

09/02 05:01:26.465 App Handler Processing
Finding resource get_all_content in sp_Support_cas

09/02 05:01:26.465 App Handler Processing
Examining resource: get_all_content (id = Dataset10812) - Selection succeeded

09/02 05:01:26.465 Basic Request Info
GET /Rhythmyx/sp_Support_cas/get_all_content.xml

09/02 05:01:26.465 Initial HTML/CGI
HTML Parameters:
sys_contentid = :PSXParam/sys_contentid
sys_variantid = :PSXParam/sys_variantid

CGI Variables:

09/02 05:01:26.465 File Info
No files found:

09/02 05:01:26.465 Session Info
Sessions are enabled but existing user session not found.

09/02 05:01:26.465 App Security
User has the access level required: Query

09/02 05:01:26.465 Resource Handler
SQL statement submitted: SELECT DISTINCT
CONTENTSTATUS.,
PSX_CONTENTTYPE_TEMPLATE.
,
STATES.*
FROM CONTENTSTATUS
LEFT JOIN SP_META_BUSINESSUNIT_SP_META_BUSINESSUNIT BU ON
CONTENTSTATUS.CONTENTID = BU.CONTENTID
AND CONTENTSTATUS.CURRENTREVISION = BU.REVISIONID
LEFT JOIN SP_META_BUSINESSUNIT_SP_META_BUSINESSUNIT BU2 ON
BU2.BUSINESS_UNIT = BU.BUSINESS_UNIT
LEFT JOIN SP_META_DEPARTMENT_SP_META_DEPARTMENT DP ON CONTENTSTATUS.CONTENTI
D = DP.CONTENTID
AND CONTENTSTATUS.CURRENTREVISION = DP.REVISIONID
LEFT JOIN SP_META_DEPARTMENT_SP_META_DEPARTMENT DP2 ON DP2.DEPARTMENT =
DP.DEPARTMENT
LEFT JOIN SP_META_LOCATION_SP_META_LOCATION LOC ON CONTENTSTATUS.CONTENTID
= LOC.CONTENTID
AND CONTENTSTATUS.CURRENTREVISION = LOC.REVISIONID
LEFT JOIN SP_META_LOCATION_SP_META_LOCATION LOC2 ON LOC2.LOCATION =
LOC.LOCATION
LEFT JOIN CONTENTSTATUS CON2 ON DP2.CONTENTID = CON2.CONTENTID
AND LOC2.CONTENTID = CON2.CONTENTID
LEFT JOIN STATES ON CONTENTSTATUS.CONTENTSTATEID = STATES.STATEID
AND CONTENTSTATUS.WORKFLOWAPPID = STATES.WORKFLOWAPPID
LEFT JOIN PSX_CONTENTTYPE_TEMPLATE ON CONTENTSTATUS.CONTENTTYPEID =
PSX_CONTENTTYPE_TEMPLATE.CONTENTTYPEID
WHERE CON2.CONTENTID = :PSXParam/sys_contentid
AND CONTENTSTATUS.CONTENTID <> :PSXParam/sys_contentid
AND PSX_CONTENTTYPE_TEMPLATE.TEMPLATE_ID = :PSXParam/sys_variantid

James,

I looks like the parameters are getting passed, just that you’re not specifying them correctly. What happens when you pass hardcoded values instead of “:sys_variantid” and “:sys_contentid”? Does it work then?

If so, try extracting them from the Assembly Item: $sys.item.getTemplate().getGUID().getUUID() (or $sys.item.template.GUID.UUID) and
$sys.item.getId().getUUID().

Dave

Hi David

yes if I hard code the values it works fine.

Here’s a review of what I’ve done

I have a slot on an autoindex template

#slot(“spAutoIndex” “<ul>” “<li>” “</li>” “</ul>” $slot_params)

of which my bindings are:

$slot_params.sys_contentid = $sys.item.getProperty(‘rx:sys_contentid’)
$slot_params.sys_variantid = 592

within my spAutoIndex slot definition I use the LegacyAutoSlotContentFinder

With the following link:

…/sp_Support_cas/get_all_content.xml?sys_contentid=:sys_contentid&sys_variantid=:sys_variantid

I’m not too my approach is correct as i’m using the LegacyAutoSlotContentFinder.

Cheers
James

Try this with $sys.item.GUID.UUID instead of :sys_contentid. You’ll have to use the “formal” reference for the content id variable:


./sp_Support_cas/get_all_content.xml?sys_contentid=${sys.item.GUID.UUID}&sys_variant...

See the VTL Users guide for more details on this syntax.

Hi Dave

It seems that whatever I pass in it just treats it as text

AND CONTENTSTATUS.CONTENTID <> ${sys.item.GUID.UUID}

AND CONTENTSTATUS.CONTENTID <> ${:cid}
AND PSX_CONTENTTYPE_TEMPLATE.TEMPLATE_ID = ${:vid}

AND CONTENTSTATUS.CONTENTID <> $cid
AND PSX_CONTENTTYPE_TEMPLATE.TEMPLATE_ID = $vid

Cheers
James

Hi Dave

Also tried this

AND CONTENTSTATUS.CONTENTID <> $cid
AND PSX_CONTENTTYPE_TEMPLATE.TEMPLATE_ID = $vid

AND CONTENTSTATUS.CONTENTID <> $slot_params.cid
AND PSX_CONTENTTYPE_TEMPLATE.TEMPLATE_ID = $slot_params.vid

Cheers
James

Hi James,

I think if you pass the whole URL as one parameter it should work.

I.e. your bindings are:

$sys_contentid = $sys.item.getProperty(‘rx:sys_contentid’)
$sys_variantid = 592
$slot_params.url =
‘…/sp_Support_cas/get_all_content.xml?sys_contentid=’ + $sys_contentid + ‘&sys_variantid=’ + $sys_variantid

Within the slot definition use:
:URL
For the URL parameter.

Cheers,

Tim

Hi

Tried this and still not working. There seems to be a problem with the variables in the LegacyAutoSlot control. It doesn’t convert the variable name to the actual value of the variable. I know that index works because if I hard code the values the correct results are displayed.

Cheers
James

James,

Yes, I know there are some issues with the LegacyAutoSlot finder, but I’ve not had time to go back and find them all. You should report (via Tech Support) any specific bugs.

The Proper Solution to this problem is to make a new content finder that takes a SQL statement directly (call it something like “SQLQueryContentFinder”). This would cut out the middle man and solve the problem more directly.

In 6.5, the PSBaseSlotContentFinder is documented, and creating a new slot content finder merely requires you to override the getSlotItems() method. All of the standard things (like parameter parsing, sorting and limiting the size of the result set) are done in the Base class.

(Note: in the first builds of 6.5 the SlotItem class was obfuscated by mistake, this is fixed in the patch builds)

Dave