|
|
|
@ -67,6 +67,7 @@ import com.liferay.portal.model.Layout;
|
|
|
|
|
import com.liferay.portal.model.LayoutPrototype; |
|
|
|
|
import com.liferay.portal.model.LayoutSetPrototype; |
|
|
|
|
import com.liferay.portal.model.Organization; |
|
|
|
|
import com.liferay.portal.model.ResourceConstants; |
|
|
|
|
import com.liferay.portal.model.ResourcePermission; |
|
|
|
|
import com.liferay.portal.model.Role; |
|
|
|
|
import com.liferay.portal.model.SystemEvent; |
|
|
|
@ -132,6 +133,10 @@ public class SvuotaDatabase {
|
|
|
|
|
|
|
|
|
|
public static List<String> pulisci(ServiceContext serviceContext) throws SystemException, PortalException { |
|
|
|
|
List<String> esito = new ArrayList<>(); |
|
|
|
|
if (Validator.isNotNull(esito)) { |
|
|
|
|
esito.add("Operazione non consentita"); |
|
|
|
|
return esito; |
|
|
|
|
} |
|
|
|
|
esito.addAll(puliziaDocumentLibrary()); |
|
|
|
|
esito.addAll(svuotaDatabase(serviceContext)); |
|
|
|
|
ConfigurazioneLocalServiceUtil.storeConfig(Constants.NUMERO_PROGETTO_KEY_DB, "1", serviceContext); |
|
|
|
@ -594,11 +599,17 @@ public class SvuotaDatabase {
|
|
|
|
|
} |
|
|
|
|
} catch (NumberFormatException e) { |
|
|
|
|
} |
|
|
|
|
if (Validator.isNotNull(classPK) && !esiste(resourcePermission.getName(), classPK)) { |
|
|
|
|
if (Validator.isNotNull(classPK)) { |
|
|
|
|
switch (resourcePermission.getScope()) { |
|
|
|
|
case ResourceConstants.SCOPE_INDIVIDUAL: |
|
|
|
|
if (!esiste(resourcePermission.getName(), classPK)) { |
|
|
|
|
ResourcePermissionLocalServiceUtil.deleteResourcePermission(resourcePermission); |
|
|
|
|
cancellati++; |
|
|
|
|
rimossi++; |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
start += SLICE - rimossi; |
|
|
|
|
} while (resourcePermissions.size() > 0); |
|
|
|
|