The Convert Files to Media Objects feature

Back in the 1902 cloud release of SAP Enable Now, SAP introduced a new Content Object type of Media Object. This could be used as a ‘container’ for any type of external (not native to SAP Enable Now, such as a PDF document, video, image file, and so on. You could already import these types of objects, but they were always stored as Files below the object they were imported into (such as a Group, or a Book Page), and although they could be uniquely referenced, they were done so on the basis of their container object (to which they always belonged).

Beginning with 1902, you could import external files as Media Objects, which meant that they were treated as individual content objects, having their own UID and other properties. This was a huge improvement, as the objects could be uniquely referenced, moved, renamed, and more easily re-used (especially if you stored them all in your Toolbox or Media Group, instead of leaving them under the object they were imported into.

That was all well and good for new files you wanted to import, but the chances were you had already imported some files into your Workarea. So in the 2005 release, SAP added a new feature that can magically convert such ‘legacy-imported’ Files into Media Objects – and replace the references. In this article we look at how to use this feature, and its limitations.

Let’s consider the case where we have a Book Page, and have inserted an image onto this. For this new feature to work, it is necessary for the image to have been inserted via the Insert Object > Image option in the Book Page Editor, and using the Insert File… selector button. If the image was copied/pasted or dragged/dropped from outside of SAP Enable Now, this feature will not work (this is an important limitation to be aware of). Luckily, it is easy to see if this is the case, as imported Files will be shown as dependent objects below the content object you inserted it into, as shown in the screenshot below:

Here, the highlighted object is an Image object only exists within the The Fiori Interface Book Page.

Now let’s assume we want to convert this to a Media Object. To do this, we first select the Group that contains the objects that have the linked external files (in this example, we’ll take the Content Group), and then select menu option Tools > Workarea Structure > Convert Files to Media Objects. This displays the following dialog box:

The options in this dialog box are:

  • Start From: The highest-level Group that contains all the Files you want to convert (it defaults to the currently-selected group). SAP Enable Now will look in all Groups and Content Objects below this, so make sure this is correct. (Tip: If you only want to process certain objects in the group, copy them, and paste them to a new Group as References and process that Group.)
  • Include Images/Audio/Video/Other Files: Select the types of File that you want to convert. (In this example, we know we only want to convert our Image files to Media Objects).
  • Update References: If you want the reference to the original File (in the Content Object) to be replaced with a reference to the new Media Object version of the File, then select this option. (You would normally want to do this.)
  • Remove Converted Files: If you want the original Files to be deleted once they have been converted, then select this option. If you do not select this option then you will need to manually delete the (now obsolete) Files later. But beware that if you do select this option, the Files are permanently deleted – they will not be saved to your Local Trash.
  • Collect All Media Objects Into: If you want all of the converted objects to be stored in a single Group (for example, a Media group in your Toolbox, from where they can easily be re-used) then select this target Group in the input field provided. If you do not select a Group, the new Media Objects will be left below their linking objects.

Once you have set the options as required, click OK. In our example, we use the settings shown above. This gives us the following result:

You can see that now our image (selected) is a Media object type, and has all the usual content object properties (including a UID – this is the key point!). You can also see that the The Fiori Interface Book Page no longer has a sub-object (because we selected the Remove Converted Files option). Instead, the image has been stored under the Group we selected (via the Collect All Media Objects Into option) – in a new Group called Converted Images. Our new Media Object has a Reference Counter of 1, which is our Book Page (because we selected the Update References option).

And that’s it! Success! Kind of. There’s one more limitation to be aware of. SAP Enable Now will treat each external File as a unique object, and convert them independently. So if you had previously imported the same, single image File into two separate Book Pages, this utility will create two identical Media Objects – even if the Original File Name and Original Path properties for the imported Files were identical. But that shouldn’t really be a limitation because if you wanted to use a single image in multiple places you would have imported one image into your Workarea and inserted that single object into two places (as references), right??

Anyway, on the whole, a nice new feature for performing some housekeeping/clean-up on pre-1902 File imports.

What's on your mind?

This site uses Akismet to reduce spam. Learn how your comment data is processed.