Sometimes when you are performing some web programming in iDocScript it is necessary to get at the HTTP Headers of the request. The headers are there, and they are available, but they may be named something different from what you are expecting. For example, "Accept-Language" will be available as "HTTP_ACCEPT_LANGUAGE".
When I make a normal request and I spy on the request using a tool like Fiddler the headers I am sending are listed out as:
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en-us
UA-CPU: x86
User-Agent: Mozilla/4.0...
Connection: Keep-Alive
Host: localhost
Cookie: IntradocAuth=Internet; IdcLocale=English-US
Then, here are the request variables printed out by Content Server (matching from above are bolded):
HTTP_ACCEPT=*/*
HTTP_ACCEPT_ENCODING=gzip, deflate
HTTP_ACCEPT_LANGUAGE=en-us
HTTP_USER_AGENT=Mozilla/4.0...
HTTP_CONNECTION=Keep-Alive
HTTP_HOST=localhost
HTTP_COOKIE=IntradocAuth=Internet; IdcLocale=English-US
REQUEST_METHOD=GET
IdcAuthChallengeType=http
IsSocketConnection=1
SERVER_NAME=localhost
ThreadCount=1
SERVER_SOFTWARE=Microsoft-IIS/6.0
HTTP_CGIPATHROOT=/wcm/idcplg
RemoteClientHostAddress=127.0.0.1
ssoriginalurl=/web/index.htm
GATEWAY_INTERFACE=CGI/1.1
REMOTE_ADDR=x.x.x.x
SERVER_PROTOCOL=HTTP/1.1
IDC_REQUEST_AGENT=webserver
SERVER_PROTOCOL_TYPE=NONE
QUERY_STRING=IdcService=SS_GET_PAGE&siteId=web&siteRelativeUrl=%2Findex.htm&ssUrlType=2
REMOTE_HOST=x.x.x.x
REQUESTURI=/wcm/groups/system/documents/web_assets/wpl_www_jsp.jsp
RemoteClientPort=4444
SERVER_PORT=80
RemoteClientRemotePort=1231
CONTENT_LENGTH=0
IDC_REQUEST_CTIME=1224069779
PATH_TRANSLATED=c:\inetpub\wwwroot
So, to use these in iDocScript I can call them by the names from this last list, with something like <$HTTP_HOST$> or <$HTTP_ACCEPT_LANGUGAE$>
Side Note, to get these variables printed out I put this code in my Site Studio page (JSP). This caused my binder to print out to my page so I could see all the information available to me.
<%=serverbean.evalIdcScp("trace(\"#all\", \"MyTest\")")%><%=serverbean.evalIdcScp("trace(\"#all\", \"MyTest\")")%>
<%=serverbean.evalIdcScp("MyTest")%>
<%=serverbean.evalIdcScp("MyTest")%>
And finally, if you are passing in custom headers you are in for a treat because then you may need a component to serialize your custom header.
When oracle released the 10.1.3.3.3+ site studio product they delivered a new contributor application along with new data file formats. Inside these data files the structure has changed from previous versions. Here’s an example of the new format:
<?xml version="1.0" encoding="UTF-8" ?>
<wcm:root xmlns:wcm="http://www.stellent.com/wcm-data/ns/8.0.0" version="8.0.0.0">
<wcm:element name="HeaderImage"><img border="0" alt="Wide Image" src="[!--$ssWeblayoutUrl('groups/public/documents/web_assets/wideimage.gif')--]" /></wcm:element>
</wcm:root>
As you can see a near full path is embedded in the xml file. In this case if I were to change the security group of this image from public to secure the page using this data file would render with a missing image. The same is also true of the doc type and/or account. What can we do about this?
The documentation mentions that the function ssWeblayoutUrl() is able to work with the dDocName: This script extension is used to determine the full web address of a file from either the path or dDocName. This is most typically used for paths to images in data files.
Great. It turns out that through the use of a configuration variable added to config.cfg or through the admin server under general configuration week in control what gets embedded in data files. Note: this is available in build 251 or higher.
SSWeblayoutUrlUsesDocNames=true
On a related note, check out another blog post starring ssWeblayoutUrl over at Web Monkey Magic.
http://webmonkeymagic.blogspot.com/2008/09/surprise-ssweblayouturl.html
Oracle announced an update for the Blogs and Wikis sample components on the quarterly call today. It was also covered along with some additional thoughts on Bex Huff's blog here. Bex has some nice advice that may help when trying to pick between the blog/wiki paradigms supplied by Oracle UCM versus Oracle WebCenter. Unfortunately, many of us will not have the luxury of being able to select from both options which makes this recent update a fantastic announcement. If WebCenter has the better UI and I can store my content in UCM that’s great if I can afford those products.
For those of us that cannot and only have UCM at our disposal the update to these components not only in functionality and UI but also from a support perspective is wonderful.
With the culmination of several new releases and some updates the planets are finally aligning for a good experience for web developers with Site Studio. Fire Fox 3 has been available for some time. As noted on John Sim's Blog, the full release of Fire Bug 1.2.0 has also been announced. And to top it all off there has been an August Roll-up Release for Site Studio. (currently available only via MetaLink as far as I know and you can find it by searching for patches for 10.1.3.3.2 servers. You will have to log in.)
Now, when running in contributor mode in Fire Fox 3 things look pretty good. Prior to this release some of the images were off and some things did not work so hot.
Perhaps the context is Site Studio. Perhaps the context is a JSP (Java Server Page) checked into Content Server. Regardless, you will eventually begin to wonder "What is this ServerBean thing?" and "What can I do with it?" I often get asked about the existence of documentation on ServerBean, and it has recently been pointed out to me that this is covered in Bex Huff's book The Definitive Guide to Stellent Content Server Development (which is pretty darn good, so get it if you don't have it).
That said, there is some information I can present here about the ServerBean class starting with the signatures of the public methods. I've sprinkled sparse notes among the methods that may or may not be of use. The simplest description of ServerBean is a shortcut class for performing actions like manipulating the local data, executing services, reading enviornment variables and executing IdocScript.
class ServerBean
{
// Constructor
// NOTE: A single, no argument constructor is supplied and you must use the init method to initialize
ServerBean()
// After the constructor you must initialize with this method
void init(ServletRequest servletrequest)
// Remaining Methods ///////////////////////////////////////////////////////////////////////
void addOptionList(String s, Vector v)
void addResultSet(String s, ServerResultSet serverresultset)
// Remaining methods in alphabetical order
String evalIdcScp(String s) throws ContentServerException
// If the flag is true it means you have already wrapped the String in <$$> offsets
String evalIdcScp(String s, boolean flag)throws ContentServerException
String evalResInc(String s) throws ContentServerException
// This is the long hand version of evalIdcScp, just use evalIdcScp to save some processing
String evaluateIdocScript(String s)throws ContentServerException
String evaluateResourceInclude(String s) throws ContentServerException
void executeService()throws ContentServerException
Object getCachedObject(String s)
ServerResultSet getCurrentActiveResultSet()
Properties getEnvironment()
String getEnvironmentValue(String s)
String getLocal(String s)
Properties getLocalData()
Vector getOptionList(String s)
Enumeration getOptionLists()
ServerResultSet getResultSet(String s)
Enumeration getResultSetList()
void parseExecuteService(String s) throws ContentServerException
void parseExecuteService(String s, char c, char c1)throws ContentServerException
void putLocal(String s, String s1)
void removeLocal(String s)
ServerResultSet removeResultSet(String s)
void setCachedObject(String s, Object obj)
void setEnvironment(Properties p)
void setEnvironmentValue(String s, String s1)
void setLocalData(Properties p)
}
If you have not had a chance to check out the latest iteration of the Web Content Management offering from Oracle you are missing out. From a development point of view this is the most flexible version yet, and from the developer perspective it is certainly the most full of promise. There are at least three features of this release that can via for a compelling reason to upgrade.
Online Documentation (Version 10.1.3.3.0)
- Release Notes
- Install Guide
- Administration
Online Blogs & References
- Understanding SSPU by John Sims
- Fixing FTP with SSPU by John Sims
- Useful SSPU Logging from Web Monkey Magic
Now that have all these tools hanging on our belt and you have went to these various places and learned all about SSPU (you did right?) what exactly do I have to add? During some recent publishing we ran into a problem where Cascading Style Sheets and parts of HTML pages were getting replaced when they should not have. An example of the improper transformation might look like:
background: url(/original/path/coolpic.gif)
into
background url(/sspu/translated/path/coolpic.gif)
The difference is fairly subtle, the colon is getting dropped. Bad, bad. Several other issues exist but are all similar in nature. Luckily, patch p51051816 exists. I have been unable to find the patch on METALINK at this point but one Service Request later and they shipped it right out. The patch itself is very simple to apply, and the readme.txt details out the six step process:
Oh, and yes the patch did fix the problem!