req = ModelTools.createModelRequest();
Context context = (Context) keelIritgoAuthMap.get(new Long(userUniqueId));
PersistentFactory persistentManager = null;
if (context != null)
{
persistentManager = (PersistentFactory) req.getService(PersistentFactory.ROLE, "", context);
}
else
{
UserEnvironment userEnvironment = new DefaultUserEnvironment()
{
private LinkedList<String> fakeList;
public List<String> getGroups()
{
if (fakeList == null)
{
fakeList = new LinkedList<String>();
fakeList.add(new String("root"));
}
return fakeList;
}
};
context = new DefaultContext();
((DefaultContext) context).put(UserEnvironment.CONTEXT_KEY, userEnvironment);
persistentManager = (PersistentFactory) req.getService(PersistentFactory.ROLE, "", context);
}
((KeelContextualizable) req).setKeelContext(context);
Persistent persistent = persistentManager.create(properties.getProperty("persistent"));
if (properties.getProperty("persistentFilter").equals("true"))
{
persistent.setField(properties.getProperty("persistentFilterAttributeName"), properties
.get("persistentFilterAttribute"));