* */
@Override
public void doDelete(GadgletRequestWrapper request, GadgletResponse response)
throws RequestException {
PersistenceManager pm;
PersonalNotesAppsData item;
List<SharedItemReff> sharing ;
pm = PMF.get().getPersistenceManager();
pm.currentTransaction().begin();
try {
item = (PersonalNotesAppsData) helper.getSingleItemByKeyForAction(pm, request, PersonalNotesAppsData.class);
if (item == null)
throw new RequestException(ReqErrorTypes.ITEM_NOT_FOUND);
sharing = item.getSharedItemReff();
for(SharedItemReff share: sharing)
{
// in case not the owner (shared item)
if(share.getSharedWithId().equals(request.getCurrentUserId()) && !share.getSharingType().equals(SharingType.OWNER))