import org.splat.kernel.InvalidPropertyException;
import org.splat.kernel.Name;
import org.splat.dal.bo.kernel.User;
-import org.splat.kernel.UserDirectory;
import org.splat.som.ApplicationRights;
import org.splat.dal.dao.som.Database;
import org.splat.service.SimulationContextService;
+import org.splat.service.UserService;
import org.splat.service.technical.ProjectSettingsService;
import org.splat.service.dto.Proxy;
import org.splat.dal.bo.som.SimulationContext;
*/
private SimulationContextService _simulationContextService;
+ /**
+ * Injected user service.
+ */
+ private UserService _userService;
+
enum UserAction {
refreshResult, selectContextType, selectContextValue, cancelSelect, removeContext
}
action = UserAction.cancelSelect;
}
// Execution of the user action
- Session connex = Database.getSession();
+ Session connex = Database.getCurSession();
Transaction transax = connex.beginTransaction();
String done;
try {
// ---------------------------------------
SimulationContext.Properties sprop = new SimulationContext.Properties();
- newtype = getSimulationContextService().selectType(Integer.valueOf(ctype));
+ newtype = getSimulationContextService().selectType(
+ Integer.valueOf(ctype));
newvalue = getSimulationContextService().selectSimulationContextsWhere(
sprop.setType(newtype));
if (cindex.length() > 0 && Integer.valueOf(cindex) == 0)
protected void setCandidates() {
// -------------------------------
manager = new Vector<Name>();
- List<User> users = UserDirectory.selectAllUsers();
+ List<User> users = getUserService().selectAllUsers();
User me = getConnectedUser(); // May be null
for (Iterator<User> i = users.iterator(); i.hasNext();) {
User next = i.next();
SimulationContextType[] types = critext
.toArray(new SimulationContextType[critext.size()]);
ContextTypeComparator compare = new ContextTypeComparator();
- ProjectSettingsService.Step step = types[0].getAttachedStep();
+ ProjectSettingsService.Step step = getSimulationContextService()
+ .getAttachedStep(types[0]);
int from = 0;
int to = 0;
while (to < types.length - 1) {
if (to > from + 1)
Arrays.sort(types, from, to, compare);
from = to;
- step = types[to].getAttachedStep();
+ step = getSimulationContextService().getAttachedStep(types[to]);
}
if (to > from)
Arrays.sort(types, from, to + 1, compare);
SimulationContextService simulationContextService) {
_simulationContextService = simulationContextService;
}
+
+ /**
+ * Get the userService.
+ * @return the userService
+ */
+ public UserService getUserService() {
+ return _userService;
+ }
+
+ /**
+ * Set the userService.
+ * @param userService the userService to set
+ */
+ public void setUserService(UserService userService) {
+ _userService = userService;
+ }
}
\ No newline at end of file