+ Start a Discussion
CloudConversionCloudConversion 

VisualForce/Apex Code for Content Syndication?

We're in the process of moving our corporate site over to a Force.com Site, but the Salesforce Content Syndication logic is written in JSP.  

Has anyone written this in VisualForce/Apex yet?
 
Thanks,
Jon 
 
Here is the JSP code for the Content Syndication: 
 

<% // Do not edit below this line // --------------------------------------- try { String strSVHost = ""; String strSVContentLine = ""; String strSVPullURL = "http://salesforce.sharedvue.net/sharedvue/pull/"; if (request.getServerName() != null) { strSVHost += request.getServerName(); } if (request.getRequestURI() != null) { strSVHost += request.getRequestURI(); } if (request.getQueryString() != null) { strSVHost += "?" + request.getQueryString(); } strSVPullURL += "?svhost=" + java.net.URLEncoder.encode(strSVHost); java.net.URL urlSVContent = new java.net.URL(strSVPullURL); java.io.BufferedReader brSVContent = new java.io.BufferedReader ( new java.io.InputStreamReader(urlSVContent.openStream() ) ); while ( (strSVContentLine=brSVContent.readLine()) != null ) { out.println(strSVContentLine); } brSVContent.close(); } catch(Exception eSVPull) { out.println("<!-- SharedVue Output: " + eSVPull + " -->"); }%>

 

 
Best Answer chosen by Admin (Salesforce Developers) 
BulentBulent

you need to set the escape attribute to false

 

<apex:outputText escape="false" value="{!content}"/>

 

 

 

All Answers

CloudConversionCloudConversion

So, I've created a simple controller to do an HTTP GET to the http://salesforce.sharedvue.net/sharedvue/pull syndicated content endpoint.


However, the HTML that is returned from the callout is being encoded in the VisualForce page and is therefore not being displayed correctly.

 

Any ideas or suggestions?

 

Thanks,

Jon 

 

p.s. -- once I have it working, I'll post the controller code for others to use.

Message Edited by CloudConversion on 02-09-2010 07:10 AM
BulentBulent

you need to set the escape attribute to false

 

<apex:outputText escape="false" value="{!content}"/>

 

 

 

This was selected as the best answer
Bruno StuelpBruno Stuelp
Hi.

I need this solution. Can you post it?

Tks a lot!