Written by: Jason Stortz
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:
Curl is a command line tool for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet and TFTP. curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, Kerberos…), file transfer resume, proxy tunneling, etc.
Curl offers many useful features like proxy support, user authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer resume and more. We can use curl to script calling services in Oracle WebCenter Content.
First Example - PING_SERVER
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:
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:
curl http://weblogic:welcome1@ps5/_dav/cs/idcplg -d "IdcService=PING_SERVER&IsJava=1"
Second Example - Workflow Testing
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.
curl http://weblogic:welcome1@ps5/_dav/cs/idcplg -d "IdcService=WORKFLOW_APPROVE&dID=1268&IsJava=1"
Oracle WebCenter Content References