restriction = getRestrictionPrivate(allocatableId);
+ if (restriction.size() == 1 && restriction.get(0).equals(appointmentId)) {
+ removeId(allocatableId);
+ }
+ }
+ clearRestrictions(appointment);
+ if (this.equals(appointment.getReservation()))
+ ((AppointmentImpl) appointment).setParent(null);
+ appointmentIndex = null;
+
+
+ }
+ }
+ else if(choice.equals("resources"))
+ {
+ Allocatable[] alloc = getAllocatables();
+ for(int j=0; j < alloc.length;j++)
+ {
+ removeAllocatable(alloc[j]);
+ }
+ }
}
private void clearRestrictions(Appointment appointment) {
@@ -555,7 +582,7 @@ public final class ReservationImpl extends SimpleEntity implements Reservation,
Allocatable alloc = getResolver().tryResolve( allocatableId, Allocatable.class);
if ( alloc == null)
{
- throw new UnresolvableReferenceExcpetion( allocatableId, toString());
+ //throw new UnresolvableReferenceExcpetion( allocatableId, toString());
}
set.add( alloc );
}
@@ -588,7 +615,7 @@ public final class ReservationImpl extends SimpleEntity implements Reservation,
Allocatable alloc = getResolver().tryResolve( allocatableId, Allocatable.class);
if ( alloc == null)
{
- throw new UnresolvableReferenceExcpetion( Allocatable.class.getName() + ":" + allocatableId, toString());
+ //throw new UnresolvableReferenceExcpetion( Allocatable.class.getName() + ":" + allocatableId, toString());
}
set.add( alloc);
}
diff --git a/CSE2102/src/org/rapla/entities/dynamictype/internal/ClassificationFilterImpl.java b/CSE2102/src/org/rapla/entities/dynamictype/internal/ClassificationFilterImpl.java
index 8a18a60..80d5a2a 100644
--- a/CSE2102/src/org/rapla/entities/dynamictype/internal/ClassificationFilterImpl.java
+++ b/CSE2102/src/org/rapla/entities/dynamictype/internal/ClassificationFilterImpl.java
@@ -31,7 +31,7 @@ import org.rapla.entities.storage.CannotExistWithoutTypeException;
import org.rapla.entities.storage.DynamicTypeDependant;
import org.rapla.entities.storage.EntityReferencer;
import org.rapla.entities.storage.EntityResolver;
-import org.rapla.entities.storage.UnresolvableReferenceExcpetion;
+//import org.rapla.entities.storage.UnresolvableReferenceExcpetion;
public final class ClassificationFilterImpl
implements
@@ -68,7 +68,7 @@ public final class ClassificationFilterImpl
DynamicType type = resolver.tryResolve(typeId, DynamicType.class);
if ( type == null)
{
- throw new UnresolvableReferenceExcpetion(typeId);
+ //throw new UnresolvableReferenceExcpetion(typeId);
}
//DynamicType dynamicType = (DynamicType) referenceHandler.getEntity("parent");
return type;
diff --git a/CSE2102/src/org/rapla/entities/dynamictype/internal/ClassificationImpl.java b/CSE2102/src/org/rapla/entities/dynamictype/internal/ClassificationImpl.java
index c871602..bac8638 100644
--- a/CSE2102/src/org/rapla/entities/dynamictype/internal/ClassificationImpl.java
+++ b/CSE2102/src/org/rapla/entities/dynamictype/internal/ClassificationImpl.java
@@ -35,7 +35,7 @@ import org.rapla.entities.storage.CannotExistWithoutTypeException;
import org.rapla.entities.storage.DynamicTypeDependant;
import org.rapla.entities.storage.EntityReferencer;
import org.rapla.entities.storage.EntityResolver;
-import org.rapla.entities.storage.UnresolvableReferenceExcpetion;
+//import org.rapla.entities.storage.UnresolvableReferenceExcpetion;
/** Use the method newClassification()
of class DynamicType
to
* create a classification. Once created it is not possible to change the
@@ -145,12 +145,12 @@ public class ClassificationImpl implements Classification,DynamicTypeDependant,
return typeId;
if (type == null)
{
- throw new UnresolvableReferenceExcpetion( "type and parentId are both not set");
+ //throw new UnresolvableReferenceExcpetion( "type and parentId are both not set");
}
DynamicType dynamicType = resolver.getDynamicType( type);
if ( dynamicType == null)
{
- throw new UnresolvableReferenceExcpetion( type);
+ //throw new UnresolvableReferenceExcpetion( type);
}
typeId = dynamicType.getId();
return typeId;
@@ -166,7 +166,7 @@ public class ClassificationImpl implements Classification,DynamicTypeDependant,
DynamicTypeImpl type = (DynamicTypeImpl) resolver.tryResolve( parentId, DynamicType.class);
if ( type == null)
{
- throw new UnresolvableReferenceExcpetion(DynamicType.class +":" + parentId + " " +data);
+ //throw new UnresolvableReferenceExcpetion(DynamicType.class +":" + parentId + " " +data);
}
return type;
}
diff --git a/CSE2102/src/org/rapla/entities/storage/UnresolvableReferenceExcpetion.java b/CSE2102/src/org/rapla/entities/storage/UnresolvableReferenceExcpetion.java
index 58fc25d..759db2b 100644
--- a/CSE2102/src/org/rapla/entities/storage/UnresolvableReferenceExcpetion.java
+++ b/CSE2102/src/org/rapla/entities/storage/UnresolvableReferenceExcpetion.java
@@ -1,15 +1,15 @@
-package org.rapla.entities.storage;
-
-public class UnresolvableReferenceExcpetion extends RuntimeException {
-
- private static final long serialVersionUID = 1L;
-
- public UnresolvableReferenceExcpetion(String id) {
- super("Can't resolve reference for id " + id );
- }
-
- public UnresolvableReferenceExcpetion(String id, String reference) {
- super("Can't resolve reference for id " + id + " from refererer " + reference);
- }
-
-}
+//package org.rapla.entities.storage;
+//
+//public class UnresolvableReferenceExcpetion extends RuntimeException {
+//
+// private static final long serialVersionUID = 1L;
+//
+// public UnresolvableReferenceExcpetion(String id) {
+// super("Can't resolve reference for id " + id );
+// }
+//
+// public UnresolvableReferenceExcpetion(String id, String reference) {
+// super("Can't resolve reference for id " + id + " from refererer " + reference);
+// }
+//
+//}
diff --git a/CSE2102/src/org/rapla/entities/storage/internal/ReferenceHandler.java b/CSE2102/src/org/rapla/entities/storage/internal/ReferenceHandler.java
index 47766d3..175e336 100644
--- a/CSE2102/src/org/rapla/entities/storage/internal/ReferenceHandler.java
+++ b/CSE2102/src/org/rapla/entities/storage/internal/ReferenceHandler.java
@@ -24,7 +24,7 @@ import java.util.Set;
import org.rapla.entities.Entity;
import org.rapla.entities.storage.EntityReferencer;
import org.rapla.entities.storage.EntityResolver;
-import org.rapla.entities.storage.UnresolvableReferenceExcpetion;
+//import org.rapla.entities.storage.UnresolvableReferenceExcpetion;
/** The ReferenceHandler takes care of serializing and deserializing references to Entity objects.
@@ -231,7 +231,7 @@ abstract public class ReferenceHandler /*extends HashMap>*/
}
else
{
- throw new UnresolvableReferenceExcpetion( entityClass.getName() + ":" + id, toString() );
+ //throw new UnresolvableReferenceExcpetion( entityClass.getName() + ":" + id, toString() );
}
}
return entries;
@@ -263,7 +263,7 @@ abstract public class ReferenceHandler /*extends HashMap>*/
T resolved = tryResolve(id, entityClass);
if ( resolved == null)
{
- throw new UnresolvableReferenceExcpetion(entityClass.getName() + ":" + id);
+ //throw new UnresolvableReferenceExcpetion(entityClass.getName() + ":" + id);
}
return resolved;
}
diff --git a/CSE2102/src/org/rapla/plugin/periodcopy/CopyPluginMenu.java b/CSE2102/src/org/rapla/plugin/periodcopy/CopyPluginMenu.java
index 2499c3f..96d6380 100644
--- a/CSE2102/src/org/rapla/plugin/periodcopy/CopyPluginMenu.java
+++ b/CSE2102/src/org/rapla/plugin/periodcopy/CopyPluginMenu.java
@@ -140,7 +140,7 @@ public class CopyPluginMenu extends RaplaGUIComponent implements IdentifiableMe
for ( Appointment app :appointments) {
Repeating repeating = app.getRepeating();
if (( repeating == null && !includeSingleAppointmentsAndExceptions) || (repeating != null && repeating.getEnd() == null)) {
- r.removeAppointment( app );
+ r.removeAppointment(app);
continue;
}
diff --git a/CSE2102/src/org/rapla/storage/impl/server/LocalAbstractCachableOperator.java b/CSE2102/src/org/rapla/storage/impl/server/LocalAbstractCachableOperator.java
index 4495d9e..f8ffe51 100644
--- a/CSE2102/src/org/rapla/storage/impl/server/LocalAbstractCachableOperator.java
+++ b/CSE2102/src/org/rapla/storage/impl/server/LocalAbstractCachableOperator.java
@@ -99,6 +99,7 @@ import org.rapla.entities.storage.RefEntity;
import org.rapla.entities.storage.internal.SimpleEntity;
import org.rapla.facade.CalendarModel;
import org.rapla.facade.Conflict;
+import org.rapla.facade.ModificationModule;
import org.rapla.facade.RaplaComponent;
import org.rapla.framework.Disposable;
import org.rapla.framework.RaplaContext;
@@ -138,6 +139,7 @@ public abstract class LocalAbstractCachableOperator extends AbstractCachableOper
private TimeZone systemTimeZone = TimeZone.getDefault();
private CommandScheduler scheduler;
private Cancelable cleanConflictsTask;
+ private ReservationImpl res;
MessageDigest md;
protected void addInternalTypes(LocalCache cache) throws RaplaException
@@ -2165,7 +2167,7 @@ public abstract class LocalAbstractCachableOperator extends AbstractCachableOper
}
}
- protected void checkNoDependencies(final UpdateEvent evt, final EntityStore store) throws RaplaException {
+ public void checkNoDependencies(final UpdateEvent evt, final EntityStore store) throws RaplaException {
Collection removedIds = evt.getRemoveIds();
Collection storeObjects = new HashSet(evt.getStoreObjects());
HashSet dep = new HashSet();
@@ -2238,21 +2240,36 @@ public abstract class LocalAbstractCachableOperator extends AbstractCachableOper
// }
// }
+
+
if (dep.size() > 0) {
- Collection names = new ArrayList();
- for (Entity obj: dep)
- {
- String string = getDependentName(obj);
- names.add(string);
- }
- throw new DependencyException(getString("error.dependencies"),names.toArray( new String[]{}));
- }
- // Count dynamic-types to ensure that there is least one dynamic type
- // for reservations and one for resources or persons
- checkDynamicType(removeEntities, Collections.singleton(DynamicTypeAnnotations.VALUE_CLASSIFICATION_TYPE_RESERVATION));
- checkDynamicType(removeEntities, new HashSet(Arrays.asList(new String[] {DynamicTypeAnnotations.VALUE_CLASSIFICATION_TYPE_RESOURCE,DynamicTypeAnnotations.VALUE_CLASSIFICATION_TYPE_PERSON})));
+// //new code here
+// for (Entity obj: dep)
+// {
+// Reservation res = (Reservation)obj;
+// Reservation editableRes = (Reservation)obj.edit(res);
+// }
+//
+// //recursive call
+// checkNoDependencies(evt, store);
+//// System.out.println("TEST");
+////
+//// System.out.println(res.getAppointments()[0]);
+//// Collection names = new ArrayList();
+//// for (Entity obj: dep)
+//// {
+//// Reservation res = (Reservation)obj;
+//// String string = getDependentName(obj);
+//// names.add(string);
+//// }
+//// throw new DependencyException(getString("error.dependencies"),names.toArray( new String[]{}));
+// }
+// // Count dynamic-types to ensure that there is least one dynamic type
+// // for reservations and one for resources or persons
+// checkDynamicType(removeEntities, Collections.singleton(DynamicTypeAnnotations.VALUE_CLASSIFICATION_TYPE_RESERVATION));
+// checkDynamicType(removeEntities, new HashSet(Arrays.asList(new String[] {DynamicTypeAnnotations.VALUE_CLASSIFICATION_TYPE_RESOURCE,DynamicTypeAnnotations.VALUE_CLASSIFICATION_TYPE_PERSON})));
+ }
}
-
private boolean isRefering(EntityReferencer referencer, Entity entity) {
for (ReferenceInfo info : referencer.getReferenceInfo())
{
@@ -2887,4 +2904,7 @@ public abstract class LocalAbstractCachableOperator extends AbstractCachableOper
cache.fillConflictDisableInformation(user, conflict);
}
+
+
+
}