This post provides a small extension to OER 11g that allows users without full Registrar
permissions to delete their own unsubmitted assets.

When the extension is installed in OER, a delete button conditionally appears
on the Asset Details page of the OER Web App.
The button is only visible if the selected Asset is in the 'Unsubmitted' state and the asset was
created by the current user.

Note: The extension qualifies as a custom OER modification and is therefore not supported.


Usage


Users can quickly locate their unsubmitted assets by navigating to the MyStuff tab
in OER and selecting the 'Produced Assets' link.

Produced_Asset_menu


When the extension is installed in OER, an additional delete button conditionally appears
on the Asset Details page of the OER Webapp. The button is only visible if the selected
Asset is in the 'Unsubmitted' state and the asset was created by the current user.

new_delete_button


The user that created the Asset can select the delete button and confirm the asset deletion.

confirm_delete_dialog



Installation

The extension consists of three new jsp files and a property file that
must be copied into the OER deployed application.

  1. Download the extension files

    Right click on each of the links below and choose Save As to save the jsp and jsp files.
    Use the same names when saving the files.
    deleteButton.jspf
    deleteUnsubmitted.jsp
    deleteUnsubmittedAsset.jsp
    OERSelfService.properties

  2. Deploy The new Files:

    The deleteUnsubmitted.jsp, deleteUnsubmittedAsset.jsp and deleteButton.jspf files are new files
    that provide the extended delete functionality.
    Copy all three files to the deployed OER application.
    All three jsp files must be copied to the enterprisetab folder in the OER exploded application
    in the OER domain.

    For example, copy the files to the following directory
    /u02/domains/soa/servers/gov_server1/stage/oer_11/oer_11.1.1.5.0/oer-app/cmee/enterprisetab/

  3. Add the new delete button:

    In the same enterprisetab directory where the files were copied in the previous step.
    make a backup copy of the existing view.jsp file
    For example 'cp view.jsp view.jsp_orig'

    Next, edit the view.jsp file and search for the following text:

         ALT="Send an Email Notification to Subscribers of this Item"

    Place the following include directive above the scriptlet lines containing the located text.
      <%@include file="/deleteButton.jspf" %>     
                
    For example <!-- next line added for UnsubmittedAsset Extension -->
    <%@include file="/deleteButton.jspf" %>
      <% if (mRenderAllButtons && asset.getActiveStatus()==Asset.ACTIVE &&
    hasPermission(userpermissionmap, IPermissionType.PERM_NOTIFY)) {
    %>
    <td align="right"><a href="<%=formatter.formatForHTML(lMailTo)%>">
    <img src="<skin:image element='/images/buttons/notify_subscribers.gif'/>"
    border="0" title="Send an Email Notification to Subscribers of this Item"
    ALT="Send an Email Notification to Subscribers of this Item"></a>
    </td>
    <% } %> Save the view.jsp file and exit.
  4. Configure the Admin credentials:

    Edit the provided OERSelfService.properties file and set values for the username
    and password of a existing user with registrar permissions.
    (See the details below relating to optionally encyprting the password)

    Copy the file to the /WEB-INF/classes/ directory of the exploded OER App
    For example
    /u02/domains/soa/servers/gov_server1/stage/oer_11/oer_11.1.1.5.0/oer-app/WEB-INF/classes/

    Optional Password Encryption

    The password specified in the properties file can be optionally encrypted.
    To encrypt the password, use one of the methods described in
    http://docs.oracle.com/cd/E14571_01/doc.1111/e15754/eminteg.htm#CHDCIDDC

    If an OER domain is currently running then using the diag page approach is the simpliest
    of the two methods.

    For example, enter the unencrypted password in the form presented at
    http://soabpm-server:7102/oer/diag/encryptstrings.jsp?

    Cut and paste the encrypted string into the OERSelfService.properties file
    being sure to place the value in double quotes.

    NOTE: if you choose to enrypt the password, You must surround the encrypted
    password value in the file with double quotes,
    for example
       adminPassword="v2_1.G+NTr3az8thaGGJBn0vwPg=="

    If you choose not to encrypt the password, then do NOT surround it with double quotes,
    for example
       adminPassword=welcome1



Testing

  1. Add a new Test user if required.

    Login as the OER Adminstrator and add a new user
             username: developer
             firstname: David
             lastname: Codes
             password: welcome1
    Set the user Role permissions to: Advanced Submitter
             Note: The Advanced Submitter role is the minimum permission requried.
             Using the lowest level 'User' role is not sufficient because a user in this role
             can only submit assets throught the Assets->submit Asset menu item in the
             OER webapp and Assets submitted from this menu item are submitted
             automatically and are no longer in the unsubmitted state required for deletion.
    Logout Admin

  2. Add a new Unsubmitted Asset:

    Login again as the new user developer/welcome1
    From the OER Web page main menu select Edit / Manage Assets
    (the menu item is only present for users in Advanced Submitter Role)
    When the Asset Editor Loads:
    Select File->New Select a Type of 'Application' (or any other type)
    Set name to Agent99
    Ensure the initial state is: Unsubmitted.
    Press OK to create the new Asset.


  3. Delete the new unsubmitted Asset:
    Return to the OER Web app and select the 'MyStuff' main menu item.
    Select the 'Produced Assets' menu item in left Navigation menu.
    The Agent99 asset should appear in the List of Assets.
    Select the Agent99 asset.
    On the lower part of the page the details related to the Agent99 should appear.
    There should be a 'Delete' button between the Green Excel spreadsheet Icon
    and the Nofity Subscribers icon as shown below.
    (See the red arrow in the following screen snapshot)

    asset_detail_pane

    Click the Delete button.

    A new browser window should appear with the title 'Delete Unsubmitted Asset'  as shown below.

    New delete
              window

    The window contains the Asset Name of the Unsubmitted Asset to be deleted.
  4. Press the Delete button to delete the asset or the Cancel button to cancel the request.