Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member230921
Active Contributor
This blog describes:-

  • About Recycle Bin feature,

  • Recycle Bin management in CMC,

  • Enable Recycle Bin using JAVA SDK,

  • Recycle Bin management using REST APIs,

  • Recycle Bin management using JAVA SDK


Recycle Bin feature:


Recycle Bin is a new application in the CMC. When the user deletes an item from the BOE system, it is moved to the Recycle Bin, where it is temporarily stored until the Recycle Bin is emptied. This gives the user the opportunity to recover accidentally deleted reports/folders and restore them to their original locations.





With the Recycle Bin application, the administrator can:

  • Initiate restoration of any deleted item (such as reports and folders)

  • Permanently delete items from the Recycle Bin

  • Perform auto-cleanup of the Recycle Bin





If Recycle Bin is enabled, you can recycle the following infoobject types:

  • Personal folder content

  • Events

  • Calendars

  • Public folder content

  • Universes

  • Connections

  • Public categories

  • Personal categories

  • Inboxes

  • Profiles

  • Custom roles



Learn More:  https://help.sap.com/viewer/2e167338c1b24da9b2a94e68efd79c42/4.2.5/en-US/a1da486be3ab43f794201b2c4f4...

 

Recycle Bin management in CMC:


Enable Recycle Bin to users:

Administrator can Enable/Disable Recycle Bin application in CMC (http://boeserver/BOE/CMC).

In CMC novigate to CMC -> Applications -> Recycle Bin



Restore and delete from Recycle Bin:

To perform Restore or delete permanently from Recycle Bin.

Login to CMC (http://boeserver/BOE/CMC).

In CMC novigate to CMC -> Recycle Bin (listed in Manage column in Home page of CMC).



 

 

Enable Recycle Bin using JAVA SDK:


Code to check Recycle Bin enabled or disabled.
import com.crystaldecisions.sdk.framework.IEnterpriseSession;
import com.crystaldecisions.sdk.exception.SDKException;
import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
import com.crystaldecisions.sdk.occa.infostore.IInfoObjects;
import com.crystaldecisions.sdk.occa.infostore.IInfoObject;
import com.businessobjects.sdk.plugin.desktop.recyclebinapplication.IRecycleBinApplicationBase;
import java.util.Iterator;
...

boolean isRecycleBinEnabled(IEnterpriseSession enterpriseSession) throws SDKException
{
IInfoStore infoStore = (IInfoStore) enterpriseSession.getService("InfoStore");
String queryString = "SELECT * FROM CI_APPOBJECTS, CI_INFOOBJECTS, CI_SYSTEMOBJECTS WHERE SI_CUID='AfHzkEDjGvZBughFhdtIIdg'";
boolean isRBEnabled = false;
try
{
IInfoObjects recycleBinAppObjects = infoStore.query(queryString);
if(!recycleBinAppObjects.isEmpty())
{
final IRecycleBinApplicationBase recycleBinAppObject = (IRecycleBinApplicationBase) recycleBinAppObjects.get(0);
isRBEnabled =recycleBinAppObject.getEnableRecycleBinProperty();
}

return isRBEnabled;
}
catch(SDKException e){
return isRBEnabled;
}
}

Code to enable/disable Recycle Bin:
import com.crystaldecisions.sdk.framework.IEnterpriseSession;
import com.crystaldecisions.sdk.exception.SDKException;
import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
import com.crystaldecisions.sdk.occa.infostore.IInfoObjects;
import com.crystaldecisions.sdk.occa.infostore.IInfoObject;
import com.businessobjects.sdk.plugin.desktop.recyclebinapplication.IRecycleBinApplicationBase;

...

void setRecycleBin(IEnterpriseSession enterpriseSession, boolean setRB) throws SDKException
{
IInfoStore infoStore = (IInfoStore) enterpriseSession.getService("InfoStore");
String queryString = "SELECT * FROM CI_APPOBJECTS, CI_INFOOBJECTS, CI_SYSTEMOBJECTS WHERE SI_CUID='AfHzkEDjGvZBughFhdtIIdg'";
IInfoObjects recycleBinAppObjects = infoStore.query(queryString);
if (!recycleBinAppObjects.isEmpty()) {
IRecycleBinApplicationBase recycleBinAppObject = (IRecycleBinApplicationBase) recycleBinAppObjects.get(0);
recycleBinAppObject.setEnableRecycleBinProperty(setRB);
}

}

More Info: https://help.sap.com/http.svc/rc/7adfc93c56564bb0bade737ea8a3a61f/4.2.4/en-US/com/businessobjects/sd...

 

Recycle Bin management using REST APIs:


APIs available from SAP BOE 4.2 SP04 +:

To know how to create session using BI REST: https://blogs.sap.com/2017/04/21/session-management-in-bi-platform-rest-sdk-rws/










































Description

URL

Http Methods

Query Parameters
1.
List all items in Recycle Bin

http://host:<port>/biprws/v1/recyclebin GET

page, pagesize,

sort, type,

deleteddate
2.
Retrieve properties of a recycle bin item

http://host:<port>/biprws/v1/recyclebin/<id> GET N.A
3.
Permanently delete single/multiple items from recycle bin.

http://host:<port>/biprws/v1/recyclebin DELETE N.A
4.
Restore single/multiple items from recycle bin.

http://host:<port>/biprws/v1/recyclebin PUT N.A


More Info:   https://help.sap.com/viewer/db6a17c0d1214fd6971de66ea0122378/4.2.5/en-US/40974cd20dfa407fb30e383b587...


 

Recycle Bin management using JAVA SDK:


Create Enterprise Session using Java SDK:
import com.crystaldecisions.sdk.framework.CrystalEnterprise;
import com.crystaldecisions.sdk.exception.SDKException;
import com.crystaldecisions.sdk.framework.IEnterpriseSession;
...

IEnterpriseSession basicLogon() throws SDKException
{
ISessionMgr sessionManager = CrystalEnterprise.getSessionMgr();
IEnterpriseSession enterpriseSession = sessionManager.logon("username", "password", "<cms>:<port>", "secEnterprise");
return enterpriseSession;
}

More Info:  https://blogs.sap.com/2017/06/04/client-type-for-session-using-sdk-in-boe/

https://help.sap.com/viewer/0225aa3e7b4b4b17b2d4a882e6f2de96/4.2.5/en-US/45a1e4bf6e041014910aba7db0e...

List all objects in Recycle Bin:
import com.crystaldecisions.sdk.framework.IEnterpriseSession;
import com.crystaldecisions.sdk.exception.SDKException;
import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
import com.crystaldecisions.sdk.occa.infostore.IInfoObjects;
import com.crystaldecisions.sdk.occa.infostore.IInfoObject;
import com.businessobjects.sdk.plugin.desktop.recyclebin.IRecycleBinObject;
import java.util.Iterator;
...

IInfoObjects getRecycleBinObjects(IEnterpriseSession enterpriseSession) throws SDKException
{
IInfoStore infoStore = (IInfoStore) enterpriseSession.getService("InfoStore");
String queryString = "SELECT * FROM CI_INFOOBJECTS WHERE SI_KIND = '" +IRecycleBinObject.KIND+"'";

IInfoObjects infoObjects = infoStore.query(queryString);

Iterator infoObjectsIter = infoObjects.iterator();
while(infoObjectsIter.hasNext()) {
IRecycleBinObject rbObject = (IRecycleBinObject) infoObjectsIter.next();
System.out.println(rbObject.getTitle());
}
return infoObjects;
}

Retrieve properties of a recycle bin object:



import com.crystaldecisions.sdk.framework.IEnterpriseSession;
import com.crystaldecisions.sdk.exception.SDKException;
import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
import com.crystaldecisions.sdk.occa.infostore.IInfoObjects;
import com.crystaldecisions.sdk.occa.infostore.IInfoObject;
import com.businessobjects.sdk.plugin.desktop.recyclebin.IRecycleBinObject;
...

void getRecycleBinObjectDeails(IEnterpriseSession enterpriseSession) throws SDKException
{
IInfoStore infoStore = (IInfoStore) enterpriseSession.getService("InfoStore");
String queryString = "SELECT * FROM CI_INFOOBJECTS WHERE SI_KIND = '" +IRecycleBinObject.KIND+"'";

IInfoObjects infoObjects = infoStore.query(queryString);
IRecycleBinObject rbObject = (IRecycleBinObject) infoObjects.get(0);
System.out.println(rbObject.getTitle());
System.out.println(rbObject.getMainRecycledObjectType());
System.out.println(rbObject.getOwner());
System.out.println(rbObject.getKind());
//........
}

Permanently delete objects from recycle bin:



import com.crystaldecisions.sdk.framework.IEnterpriseSession;
import com.crystaldecisions.sdk.exception.SDKException;
import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
import com.crystaldecisions.sdk.occa.infostore.IInfoObjects;
import com.crystaldecisions.sdk.occa.infostore.IInfoObject;
import com.businessobjects.sdk.plugin.desktop.recyclebin.IRecycleBinObject;
...

void deleteRecycleBinObject(IEnterpriseSession enterpriseSession) throws SDKException
{
IInfoStore infoStore = (IInfoStore) enterpriseSession.getService("InfoStore");
String queryString = "SELECT * FROM CI_INFOOBJECTS WHERE SI_KIND = '" +IRecycleBinObject.KIND+"'";

IInfoObjects infoObjects = infoStore.query(queryString);
IRecycleBinObject rbObject = (IRecycleBinObject) infoObjects.get(0);
System.out.println(rbObject.getTitle());
rbObject.deleteNow();
}

Restore objects from recycle bin:



import com.crystaldecisions.sdk.framework.IEnterpriseSession;
import com.crystaldecisions.sdk.exception.SDKException;
import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
import com.crystaldecisions.sdk.occa.infostore.IInfoObjects;
import com.crystaldecisions.sdk.occa.infostore.IInfoObject;
import com.businessobjects.sdk.plugin.desktop.recyclebin.IRecycleBinObject;
...

void restoreRecycleBinObject(IEnterpriseSession enterpriseSession) throws SDKException
{
IInfoStore infoStore = (IInfoStore) enterpriseSession.getService("InfoStore");
String queryString = "SELECT * FROM CI_INFOOBJECTS WHERE SI_KIND = '" +IRecycleBinObject.KIND+"'";

IInfoObjects infoObjects = infoStore.query(queryString);
IRecycleBinObject rbObject = (IRecycleBinObject) infoObjects.get(0);
System.out.println(rbObject.getTitle());
rbObject.restore();
}

More Info: https://help.sap.com/http.svc/rc/7adfc93c56564bb0bade737ea8a3a61f/4.2.4/en-US/com/businessobjects/sdk/plugin/desktop/recyclebin/IRecycleBinObjectBase.html

 

Learn More:


https://help.sap.com/viewer/0225aa3e7b4b4b17b2d4a882e6f2de96/4.2.5/en-US/45a6bf8f6e041014910aba7db0e...

https://blogs.sap.com/2017/12/15/bi-platform-rest-sdk-rws-in-boe-4.2/

https://blogs.sap.com/2017/05/10/query-the-businessobjects-repository-using-bi-platform-rest-sdk-rws...

https://blogs.sap.com/2017/04/21/session-management-in-bi-platform-rest-sdk-rws/

https://help.sap.com/viewer/product/SAP_BUSINESSOBJECTS_BUSINESS_INTELLIGENCE_PLATFORM/
3 Comments