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
I wanted a keyboard shortcut for an elevated command prompt but just could not seem to find a way to accomplish it with less than three different key combinations. Some suggestions came close by using the new Power User menu in Windows 8, but still required you to execute “Win+X”, then press “A” for Admin, then accept the UAC Prompt. I found a way to get rid of one of these steps.
So in Windows 8 I wanted to run an elevated command prompt. After looking around on the Internet I couldn't find any examples that really did what I wanted to, so I decided to try this. I'll press the "Start" key to bring up the start menu, and I'll start typing "cmd" for command. Right click the command prompt, and select "Open File Location." Copy the command prompt and rename it "Command Prompt Admin." Right click on this new shortcut and select "Properties." Click on "Advanced" and select "Run as administrator." Click "OK." Place your cursor in the shortcut key, and then press the C key. This sets Ctrl+Alt+C as the shortcut. Click "apply" and say "OK." Now press Ctrl+Alt+C. You'll be prompted and you can either click "Yes" or press Alt+y. Now we have a command prompt in administrator mode.