Earlier this year, Redstone's very own Jason Stortz gave a powerful and thought-provoking presentation at Collaborate15 in Las Vegas titled "Know Your DAM Options". The presentation created quite a buzz across various Oracle WebCenter social media channels.

Please fill out the registration form on the right to view the webcast.

What You'll Learn:

WebCenter Sites can be integrated with a variety of Digital Asset Management solutions. Did you realize that you can also create a simplified solution right within WebCenter Sites? Now is the time to understand all your DAM Options! Learn about Oracle offerings, offerings from other vendors and options you can develop on your own!

Recently we received an email from an avid reader of Core Content Only, Brian. He was inquiring about an error message he received while attempting to develop a service within WebCenter Content 11g and how to go about fixing it. The error message giving him trouble was “Content Server Request Failed” and will appear as such.

Typically this error message is thrown during the integration of a custom component developed for an older version of Content Server onto 11g. In this scenario the authorization token (“idcToken”) is not being passed from the component to a subsequent service request resulting in the error message being thrown.

We've encountered this error in the past and we were able to uncover a few solutions. To help other developers encountering the issue save time and correct the issue, we have provided our solutions below. Before we are able to correct the error, first we must understand the error.

What is this authorization token, and why do we need it?

The authorization token is a security feature with in WebCenter. The authorization token is automatically generated and assigned to the user during each session. The token’s purpose is to maintain the ‘State’ of the user in the new state-full architecture of WebCenter Content 11g when passed along.

Service parameters allow users access to content based upon authorization levels identified by the token. The authorization token communicates the level of access based on context and user information to WebCenter.

What does it mean when the Content Server Request Fails?

The Content Server Request Failed error message happens when the authorization token is not passed along. The Authorization Token may not be passed along because it is either missing or expired.

When working through a solution it is important to note that the actual error being encountered is !csInvalidAuthorizationToken

The solutions to the missing Authorization Token are covered below.

Solutions for the Content Server Request Failed Error

The Content Server Request Failed error message offers little information on how to solve the issue. The only solution suggested by the default error message is to “Try reloading the page”.

Rarely will reloading the page solve the issue and the same error message will be thrown. Reloading the page will only solve the issue if the issue was with the page load. A missing authorization token cannot be fixed by reloading the page.

There is no need to panic if this is the case; there are other solutions that we will walk you through. Below are three alternate solutions not mentioned by the default error message that will correct the issue with the missing token.

The solutions below will show a small component using 2 services (MyCustomService and MyTokenService) and 1 template to help visualize the concepts.

Solution 1- Setting the service to scriptable

This can be carried out during the addition of a new service or editing of an old service. In Content Server services are added and edited using the component wizard. This is where we must set the service to scriptable.

Although this solution is effective it may not always be the best route. When the service is set to scriptable Content Server will recognize any user accessing the service as an administrator, thus creating a security risk.

Click to enlarge solution images for better viewing.

Setting the service to scriptable (access code of 32 or higher) will resolve this issue, but this might not always be the best route.

Solution 2- Include Token in Service Calls

First place the idcToken into the parameter list of the service. This is done by editing the HTML page being rendered on the page, like so.

(MyCustomService) with the current idcToken.

This will place a button or link to the service in question, MyCustomService, with the current idcToken. The end result will be displayed as such.

Solution 3- The Authorization Token can be disabled

The authorization token is a security feature and disabling it is not a recommended option, but if you are on a development instance it might be useful.

This can be done by adding the variable DisableAuthorizationTokenCheck=true into the \ucm\cs\config \config.cfgfile. By default the option is set to false.

For Consideration

Services calls are not the only instance where this error can occur. This error may happen to the hypertext content server forms (HCSF). Although HCSFs differ from services the error can be resolved using solution two from above.

The only difference from solution two is the syntax of the template. In an HCSF an IdocScript snippet must open with <!--$ and close with --> so the entire snippet of code will look like <input name="idcToken" value="<!--$idcToken-->">

Add: <input name="idcToken" value="<!--$idcToken-->"/>.

Wrap-Up

We hope you have found our solutions to the Content Server has Failed error message useful and time saving. If you have any feedback, comments or concerns please let us know, and comment below.If you are having other issues, please identify them in the comments below or through our contact form and we will make sure to address them in an upcoming blog posts.

Oracle WebCenter Content (abbreviated WCC and formerly referred to as UCM or Stellent) exposes nearly everything it can do as a service. WCC is very SOA friendly. We can take advantage of this fact and use something like curl or wget to execute services in WCC from the command line. While curl and wget are often thought of as Linux/UNIX/OSX commands we should point out that there are versions that can be installed for Windows as well. The official description of curl:

Oracle WebCenter Content has a simple service named PING_SERVER that you can execute to see if the Content Server is actually alive, listening and processing. You can find out more about PING_SERVER by looking in at the Oracle WebCenter Content Services Reference Guide.

To execute the service with curl from the command line there are three basic parts to be typed in:

curl – this is the executable to run

url – username, password, dav cgi url

quoted parameters

With this in mind we will pretend we have a Patch Set 5 instance of Oracle WebCenter Content running on a machine named PS5. The command to execute PING_SERVER against that machine would look like:

Creating a Workflow in WebCenter Content has a few interesting caveats and testing the Workflow you've developed is very important. Manually testing the workflow can be a cumbersome process. A small script that executes a series of curl calls to Content Server can make the testing process a lot smoother.

You can create scripts that test the various paths a piece of content might take through the workflow. Here is an example of a curl call that will approve a document currently in workflow and advance that document to the next step. If the document is at the end of the workflow this would cause it to exit workflow and be released for consumption.

Out of the box, Site Studio nodeIds are unique across all websites on a WebCenter Content instance. However, there is a configuration flag to change this. If the WebCenter Content configuration flag SSGenerateUniqueNodeIdsis set to 0 (false), nodeIds will only be unique within each website.Be careful changing the default value for SSGenerateUniqueNodeIds to be false. It is usually assumed that nodeIds are unique across all websites on a server and many times this is the way the code has been written.

WebCenter Content Server will deny a check-in when the primary file and the alternate file both have the same file extension. This default behavior is to discourage users from checking the same file in for both the primary and the secondary. Why might they do that? Perhaps they don’t know what the fields really mean?The primary file should be the original asset. The secondary or alternate file is also called the web viewable file. Examples of proper pairings might include:

Microsoft Word as a primary with an Adobe Acrobat PDF as the alternate

It looks like the latest version (version 13) of the popular Firefox browser breaks Site Studio contribution mode. In my tests, region markers stopped displaying on the page and the contribution banner at the top of the page turned completely white (on a 10gR3 WebCenter Content instance with the latest build of Site Studio 11g). On 11gR1 PS5 and SSXA, the region markers and the contribution banner stopped displaying on the page.Geoffrey Hughes has posted on this WebCenter Content Users Group forum thread the following CSS fix which appears to solve the issue:.wcm-region-marker { opacity: 1 !important; }I have an SR open with Oracle and will update this post when I have more information.Update (06/19/12 11:38 am CST): “Development has found the fix for this Firefox issue. We are currently waiting on the fix [to be] implemented in all the Site Studio build versions (10gR3, 10gR4 and 11g) and release the patches for those builds. We don’t have the date yet, but it should be soon.”Update 2 (07/09/12 3:59 pm CST): Oracle has partially fixed the issue in internal Site Studio build 11.1.1.6.0_11.0.0.787. I tested this build and it fixed the issue on WebCenter Content 10gR3. However, it did not fix the issue on WebCenter Content 11gR1 PS5 with SSXA. Oracle is not yet specifying a public release date for the patch.

beforeJaxwsServiceRequest* – “Called just before JAX-WS call is made to loginPort.contentServerRequest () in performServiceRequest ()”

* Only available in RIDC version 11.1.1.5.0+.The Oracle Javadoc for the above filters can be found here. Before a RIDC filter is available, it needs to be registeredwith the IdcFilterManager. The documentation for RIDC filters provides a fairly good starting point.RIDC filters can be very helpful in SSXA websites. They provide a way to hook into the core functionality of service calls that could otherwise get quite messy.

The most common piece of web content is a datafile. Datafiles store various types of information and (usually) are displayed by Region Templates (typically of type jspx).When we code our Region Templates, one of the most frequent questions that arises is this:How can I get a particular metadata field associated with the datafile I am trying to display?The answer is straight forward:Make an IdcService call to DOC_INFO and then iterate over the metadata.This could be easily achieved by using the Site Studio <wcm:metadata> Tag. The only problem here is that if you follow the example from the documentation, then you would have to use a for-each construct to get to your metadata:

Executing a service from a custom ServiceHandler is very easy.ServiceHandlers always extend the ServiceHandler class. So within a custom ServiceHandler Java class, you have access to the Service object using the variable m_service. From this Service object, you can get a ServiceRequestImplementor object: m_service.getRequestImplementor(). With the ServiceRequestImplementor object, you can execute services with a few different methods (executeSubServiceCode, executeSafeServiceInNewContext, executeServiceEx, executeServiceDirect, executeServiceTopLevelSimple). I typically tend to use the executeServiceTopLevelSimple method.The executeServiceTopLevelSimple method signature looks like the following:

Quite often we need to customize our Content Servers using some specific Java code. Usually we accomplish this by creating a custom component and utilizing Service Handlers or Java Filters (or both). Unfortunately, sometimes it might be hard to decide when you should use one over the other. So, let’s dig deeper into both and understand how they work.Service HandlersService Handlers are a mechanism that allows us to add new services or modify existing services by using Java.Multiple Service Handlers could contain the same Java method, but the Content Server would only execute the one that is contained within the Service Handler that has the lowest Search Order. The Search Order is defined during the creation of the configuration table. The configuration table is a table that exposes your custom code to the Content Server.Service Handlers could be chained/put-in-place to be executed:

Instead of new service actions:

Create a Service Handler with a lower Search Order.

Before existing service actions:

Create a Service Handler with a lower Search Order,

Make a call to the same method after your custom java code:

… custom java code …m_service.doCodeEx("<sameMethodName>", this);

After existing service actions:

Create a Service Handler with a lower Search Order,

Make a call to the same method before your custom java code:

m_service.doCodeEx("<sameMethodName>", this);… custom java code …

Java FiltersJava Filters is an event subscription mechanism through which developers can subscribe to the various events that occur within the Content Server and execute custom Java code.During the operation of Content Server, there are various events that constantly being fired up. The developer can subscribe to these events and alter the behavior of Content Server. When the desired event would occur the control would be passed to the subscribers of the event and the custom java code could be executed. The Content Server then expects a result of the custom code execution. The results are pretty straight forward:

CONTINUE – informs Content Server that everything went accordingly;

FINISHED – informs Content Server to stop running any other filters with the similar name;

ABORT – informs Content Server to halt execution of the current process.

When to Use Service Handlers versus Java FiltersJava Filters is the least-intrusive and easiest way to customize the behavior of Content Server with Java, whereas Service Handlers require more thorough understanding of the actions that need to be customized.Java Filters is the preferred and most commonly used way of customization, but it is limited to the existing set of filters within the Content Server. So, if there is no defined filter to which you can subscribe, then you can create your own custom component that uses Service Handlers to customize the behavior.