Deleting content objects is a fairly simple and intuitive process, but there’s still a few things to be aware of – especially when it comes to the Trash, and possibly restoring objects. In this article I look at the various deletion options available, where objects go when you delete them, and how to get them back if you need to.
Firstly, let’s assume we have a couple of content objects we no longer need, and have decided to delete them. In our example, these are Starting with Fiori and Maintaining your SAP User Profile, under the Basic Navigation Group. Here they are in our Producer Workarea:
Firstly, note the numbers shown between the object icon and the object name. These are Structure Reference Counters, and are a count of how many times the object appears in the Workarea structure. [For more information on Structure Reference Counters, see the video Objects and Object References.]They are useful to have displayed, especially when you are deleting content, as we shall see in a minute. (If you don’t see these in your Producer, select menu option View > Workarea Details > Show Structure Reference Counter.) In our example, the first object we want to delete, Starting with Fiori, has a Structure Reference Counter of 1, indicating that it exists in only one place – the Basic Navigation Group. The second, Maintaining your SAP User Profile, has a counter of 2, because it exists in two places – once in the Basic Navigation Group, and once in the General Information Group.
Now, let’s delete these objects. First, we’ll delete Starting with Fiori. If we click on this object, and press Delete on the keyboard (or right-click on the object, and select Delete from the shortcut menu), we get the following prompt:
At the bottom of the dialog box, there are two options. The first of these is Remove Locally. This will just remove this object from our (local) Producer Workarea and prevent it from being synchronized, but the object will still exist on the Server, and will still exist within our Basic Navigation Group. [For more information on how this works, refer to the video Accessing Producer for the first time, at around the 8 minute mark.] This is not deleting it at all (and shouldn’t really be an option in the ‘Delete’ dialog box). To actually delete the object, you need to select the other option – Delete on Server. If we do this, our Workarea now looks as follows:
Here, we can see that the object has indeed been deleted. The other thing to note is that our Basic Navigation group has been checked out for editing. This is an important concept to understand. Groups in SAP Enable Now are not the same a folders in Windows. They are independent objects, and if you change the contents of a Group, you are changing the actual Group itself.
Now, let’s delete the second one of our no-longer-required objects, Maintaining your SAP User Profile. We do this in exactly the same way, see exactly the same dialog box (as the one shown in Figure 2 above), and again select Delete on Server. However, after we do this, our Workarea now looks as follows:
Here, you can see that Maintaining your SAP User Profile still exists in our Workarea (and on the Server) – even though we selected Delete on Server. This is because it existed in two places, and all we have done is deleted it from one of those places (the Basic Navigation Group); it still exists in General Information – and you can see that the Structure Reference Counter for the object now shows 1, to reflect this. This is why it is important to check the Structure Reference Counter: if it is 1 then this is the only place the object exists and if you delete it, it will be deleted from the Server; if it is more than 1, then the object exists in multiple places, and only the current reference to it will be deleted. This leads to a common concern with new Authors who just want to remove a content object from a Group (but not delete it from the Workarea) – they see the button name of “Delete from Server” and panic, thinking they will completely delete the object from the Server. That’s not the case; as long as the Structure Reference Counter is more than 1, the object will still exist somewhere on the Server.
CAUTION: The Structure Reference Counter is a count of the number of places in which the object exists within your local synchronized copy of the Server Workarea. If the content object also exists within another Group that you do not have synchronized, the counter will still show as 1, and if you delete the object it will be deleted on the Server. This leads to a ‘zombie’ reference in the other (server) Group. (You will see this if you then synchronize the previously-unsynchronized Group containing the object.) This can only be resolved by restoring the object from the Server Trash (see below).
Now let’s move to looking at where things exist when we delete them – the Trash. There are actually two Trash buckets – one in your local Workarea, and another on the Server. We’ll start with the local Trash. If we look in the Local Trash for our example Workarea, we will see the first of the objects that we deleted, as shown below. We do not see the second object we deleted because, again, we didn’t actually delete it. (If you don’t see your Local Trash, select menu option View > Workarea Details > Show Trash.)
Note that this is now a local object – there is no ‘cloud’ symbol on the object icon. This is important. especially when we consider the Server Trash. But first, let’s look at how to restore an object that we have deleted. To do this, select the object in the Local trash, and click on the Restore button at the top of the Property Sheet. When we do this, the object is ‘un-deleted’ and – assuming you have it checked out for editing – will be placed back wherever you deleted it from, as shown below. (Important!: If you do not have the original Group checked out for editing, the restored object will be placed in Unsorted.)
Now let’s look at the Server Trash (assuming you have permissions to do this). This contains all objects that existed on the Server but have now been deleted. In our example, we see the following:
Again, there is a Restore option (on the right of the toolbar above the Property Sheet). If we click on this, the restored object will always be placed in Unsorted – even if we have the Group checked out for editing within Manager. We can drag-and-drop it back into the Basic Navigation Group within Manager, but in our example we already have the Group checked out (to us) in Producer. So instead, we’ll switch back to Producer, and check out the restored Server object from there.
Back in producer, we select menu option Server Workarea > Check Out Objects, and can find our newly-restored listed, but here it is shown back where it used to belong, and not under Unsorted). Why? Because the object we are checking out from the server is exactly the same object as the one we restored from our Local Trash, so it is not an ‘orphan’ (SAP Enable Now knows where it belongs.). (Note that if we hadn’t restored it in Producer, it would show up under Unsorted in the Checkout dialog box.)
This gives us a problem, as you can see from the above image. We already have a ‘local’ restored copy of the object Starting with Fiori in our Workarea (shown on the right), but we are now attempting to download a new copy from the Server (where it was restored from the Server Trash). Again, this is exactly the same object – it has the same UID. Luckily, SAP Enable Now identifies this, and asks us what we want to do:
Although the message refers to ‘resources’, it doesn’t mean ‘Resource’ objects – it just means “objects”. Here, SAP Enable Now is letting us know that we have a ‘local’ copy of the same object we are (re)downloading from the Server. Here, we need to click Overwrite, and our local copy will be overwritten by the newly-downloaded version. (If you click Keep, the check-out operation will simply be cancelled for this object.)
Here, you can see that we are now back to having the Server version in the Basic Navigation group – you can see the ‘cloud’ symbol on the object icon again (compare Figure 10 with Figure 6).
To complete the story, if we had not restored the object in Producer and had only restored it in Manager, as soon as we try to refresh the Group the object was originally in (Basic Navigation in this example) – either by refreshing the Workarea, or refreshing the Group object from the server – we would see a message of:
When we click on Update and Check Out, we will see the same message of “Checkout will overwrite local resources” (see Figure 9), and the restored object will be downloaded from the Server again and will appear in our structure as before (see Figure 10). The version in our Local Trash will also be deleted – this is the ‘overwrite’ that we were warned would happen.
Finally, a word of caution. There are times when SAP Enable Now will still ‘recognize’ objects that are in your Producer Local Trash (specifically, it will continue to count them in the Server Reference Counter). You should therefore periodically empty your Local Trash, by selecting the Local Trash Group and then clicking the Empty Trash button. Don’t worry, this will only delete the ‘local’ trash version – there will still be the version in the Server Trash (assuming they have been saved to the Server at least once), if you realize you need to keep it. Although, of course, the Administrator should also be performing housekeeping and emptying the Server Trash periodically, for much the same reasons.