Tuesday Jun 14, 2011

Updating metadata in a custom element in Site Studio

I was recently asked if it was possible to edit metadata on a Site Studio data file from an element instead of having to go to the Metadata tab specifically.  Users were finding it disorienting to move back and forth between the Elements and Metadata tabs when updating both content and metadata.

So I put together an example that places a metadata update form within a custom element. It uses a couple of AJAX calls to the server to get the current metadata values (DOC_INFO) and to update them (UPDATE_DOCINFO). The sample includes 3 fields; Title, Type, and Comments. 

It can be easily changed to add additional fields.  Or you could make the entire custom element to be one particular metadata field.  Much of the code in the sample has comments, so I won't go into detail here.  

One function I did find particularly useful was the ability to pull in the dID and dDocName of the data file into the custom element form.  The functions ElementAPI.GetFormProperty('dID') and ElementAPI.GetFormProperty('dDocName') were used in order to run the services against the content to pull and push the metadata information.

The sample can be downloaded here (right-click and save). Simply submit the file with the Web Site Object Type of 'Custom Element Form'.  Then create a new Custom Element that points to the form. I've tried it in both 10gR4 and 11g.   

Hopefully some other folks will find this helpful.

Wednesday Jun 08, 2011

Importing and exporting archives as zip files in UCM

Archive ZipOne of the features of Site Studio is the ability to backup and restore websites.  It takes all of the assets associated with the website and combines them into a backup directory that is stored on the server and can be downloaded as a zip if needed.  When it comes time to restore, you simply choose that backup from the server or upload the zip file saved earlier.  The mechanism that Site Studio is using in the background is simply a specialized Archiver process.  An archive is defined dynamically with the proper export criteria to grab the site assets and they are exported to that backup directory.  Then when you request a download of that backup, UCM zips that standard archive directory and delivers the zip file to the client browser.

Well, it turns out that this ability to download and upload zipped archives does not have to be for just Site Studio sites.  You can do this for regular content archives as well. 

First, when you go to the Archiver applet, you're taken to the default collection of archives.  In the menu, go to Options -> Open Archive Collection.  There you should see another one with the name "<instance name>_sitestudiobackupcollection".  Select that collection and click Open. 

Archive Collection

This collection got created when Site Studio was installed and is where site backups are archived. And even if you aren't using Site Studio at all, as long as you have it enabled, this feature will be available. If you've done backups or restores already, you'll see those listed. Now that you have the collection open, you can add your new archives here.  You can create those just as you normally would.  

archive list

Now perform the archive Export process.  The content/table data will then get exported to the collection location on the server.

To download the archive, go to Administration ->; Site Studio Administration -> Backup and Restore.   Click the Managed Archives button.  You should now see your archive in the list.  

Manage Backups

With the Actions icon, select 'Download backup archive as ZIP'.  This will zip up the archive and allow you to download it locally.  Note, large archives may take a while to zip up and may time out if too large.  For those types of archives, I'd recommend setting up the traditional ways of migrating the archive.

Now that you have your archive, you can just as easily import it into your target instance.  On that instance, go to  Administration -> Site Studio Administration -> Backup and Restore.  In the Upload Archive section, browse to your saved archive and click Upload Archive.  You'll then be taken to the archive information screen.   

Archive Information

On the Actions menu, select 'Restore backup archive contents'.  This will now import the archived documents.  If you wish to include some import mappings, you can simply go to the Archiver applet and set up the mappings there and do the import right from the applet.


Kyle Hatlestad is a Solution Architect in the WebCenter Architecture group (A-Team) who works with WebCenter Content and other products in the WebCenter & Fusion Middleware portfolios. The WebCenter A-Team blog can be found at: https://blogs.oracle.com/ ateam_webcenter/


« August 2016