This is an improved version of the “hack” posted in the previous post (Customizing/Extending REST services)
- Decompile com.emc.documentum.rest.controller.QueryController
- Look for method executeQuery and modify the following line as you wish:
Preconditions.checkArgument(DQLChecker.isSafeQuery(dql), MessageBundle.INSTANCE.get(“E_UNSAFE_QUERY_DQL”, new Object[] { dql }));
You can use something like:
Preconditions.checkArgument(true, MessageBundle.INSTANCE.get(“E_UNSAFE_QUERY_DQL”, new Object[] { dql }));
if you want everyone to be able to run write queries or you can allow these queries to be executed only by some user(s) with something like:
if (RepositoryContextHolder.getLoginName().equalsIgnoreCase(“dmadmin”)){
//skip DQLChecker check for select statements
}
- Finally place the new class in dctm-rest/WEB-INF/classes/com/emc/documentum/rest/controller.