Output an assembled slot to database

Is it possible to include the assembled contents of a slot in database publishing?

We publish all our events out as individual pages and also to a database so they can be shown on a calendar and searched etc. Each event has an image slot, I would like to output the assembled snippet to display this image to a field in the database.

I am not sure how to do this or even if it is possible.

The normal way to include “Assembled Output” in database publishing is to create 2 templates.

The first template produces the “field” you want to publish. Often this is just HTML, but it could also be XML if that’s what is required.

The second template is the Database publishing template.

Use $rx.doc.getDocument($rx.url.relUrl(…)) to pull the value of the first template into the second template.

In your case, you’ll have to generate the assembled slot in the first template (as HTML or XML).

I can’t find any documentation on $rx.url.relUrl

What format does (…) take

Sorry, that should be $rx.link, not $rx.url.

See page 425 of the Rhythmyx Implementation Guide for 6.5.2

http://forum.percussion.com/showpost.php?p=608&postcount=14

(this hasn’t changed from 6.0).

Do I need to build a complete URL to return the rendered item?

Do you have an example I could follow?

Kevin,

I think I led you down the wrong path here. We used to do it this way in 5.x, where we would make a link to the assembler of the other variant and use the xsl:document() call. This approach will still work, but in 6.x, there’s a better way.

Basically what you have to do is clone the current AssemblyItem and replace it’s Template with the template that contains the slot output.

Since this is database publishing, you must do this in the Bindings tab, not in the Velocity.

I’ve attached a partial template that shows the bindings you need to do this. You may also need to base64 encode the results with $rx.codec.base64encode() which I have not shown here.

Remove the .xml before you import this template in the workbench. I used 6.5.2, but this should be exactly the same in any version from 6.1 onwards.

Dave

Ok I will try that. I assume $user.psoListTools.asList is part of the pso toolkit which we don’t have. I have contacted technical support to get a copy and will try again one I get it.

Thanks

Yes, the psoListTools is part of the PSO toolkit. I was looking for a way to do this without using the Toolkit, but it seems we don’t have a way to create a list without writing some Java code.

Obtain the latest PSOToolkit from tech support and you should be good to go.

Ok I have got hold of the 6.x PSO toolkit installed using Apache ANT

While installing I get a number of errors see attached text file but the final result says succesfull.

When trying to use the template I get the following error from rhythmyx


Unexpected exception while assembling one or more items: java.lang.RuntimeException: Could not find method asList for object [null] and arguments [com.percussion.services.assembly.data.PSAssemblyWorkItem@f18c7b[ m_id=1-101-30767 m_mimeType= m_isDebug=false m_isPublish=true m_resultData= m_status= m_path=//Sites/SOAS/About SOAS/Events/event - an event m_parameters={sys_revision=[Ljava.lang.String;@1f576b6, sys_siteid=[Ljava.lang.String;@44c788, sys_itemfilter=[Ljava.lang.String;@141c89c, sys_template=[Ljava.lang.String;@187b802, sys_contentid=[Ljava.lang.String;@1d9b2d4, sys_user=[Ljava.lang.String;@1856617, sys_folderid=[Ljava.lang.String;@16ba126, sys_context=[Ljava.lang.String;@120d8fb} m_variables= m_template=com.percussion.services.assembly.data.PSAssemblyTemplate@164c6c1[ id=776 version=2 name=soasSnEventList label=S - Event List locationPrefix= locationSuffix= assembler=Java/global/percussion/assembly/velocityAssembler assemblyUrl=../assembler/render styleSheet= aaType=0 outputFormat=2 publishWhen=n templateType=0 description=Event snippet for use in lists, like on OU Events and Event Series pages template= 

What happens when you type the following at the command line:

java -version

Are you using Java 1.5 ? or something else?

If you don’t have the proper version, you can set JAVA_HOME to /Rhythmyx/JRE and add /Rhythmyx/JRE/bin to the front of the PATH. You should then see something like this:

>java -version
java version “1.5.0_12”
Java™ 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
Java HotSpot™ Client VM (build 1.5.0_12-b04, mixed mode, sharing)

Hi Dave,

I just assumed because RX uses java the correct version was there. That will teach me for assuming.

I set the JAVA_HOME and modified the path and get the following when i run java -version

[km41@rhythmyx1 psotoolkit]$ java -version
java version “1.5.0_08”
Java™ 2 Runtime Environment, Standard Edition (build 1.5.0_08-b03)
Java HotSpot™ Server VM (build 1.5.0_08-b03, mixed mode)

I still get the same errors when I run ant -f deploy