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