* @return
*/
@SuppressWarnings("serial")
public KeelResponse executeModel(Properties properties, long userUniqueId)
{
ModelRequest req = null;
try
{
Model model = null;
req = ModelTools.createModelRequest();
Context context = (Context) keelIritgoAuthMap.get(new Long(userUniqueId));
if (context != null)
{
model = (Model) req.getService(Model.ROLE, properties.getProperty("model"), 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);
model = (Model) req.getService(Model.ROLE, properties.getProperty("model"), context);
}
((KeelContextualizable) req).setKeelContext(context);
String attributeName = null;
for (Iterator i = properties.keySet().iterator(); i.hasNext();)
{
attributeName = (String) i.next();
req.setParameter(attributeName, properties.get(attributeName));
}
KeelResponse res = model.execute(req);
return res;