fixed getCkanUtilsObj() method
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@129874 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9f7162d05a
commit
d5bf7d71c0
|
@ -71,31 +71,16 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
||||||
*/
|
*/
|
||||||
private CKanUtils getCkanUtilsObj(){
|
private CKanUtils getCkanUtilsObj(){
|
||||||
|
|
||||||
// check into session
|
|
||||||
String currentScope = getASLSession().getScope();
|
String currentScope = getASLSession().getScope();
|
||||||
HttpSession httpSession = getThreadLocalRequest().getSession();
|
|
||||||
String keyForScope = concatenateSessionKeyScope(CKAN_OBJ_KEY, currentScope);
|
|
||||||
|
|
||||||
CKanUtils instance = null;
|
CKanUtils instance = null;
|
||||||
|
|
||||||
if(httpSession.getAttribute(keyForScope) == null){
|
try{
|
||||||
try{
|
logger.debug("The ckan util object was null");
|
||||||
logger.debug("The ckan util object was null");
|
instance = new CKanUtilsImpl(currentScope);
|
||||||
instance = new CKanUtilsImpl(currentScope);
|
}catch(Exception e){
|
||||||
|
logger.error("Unable to retrieve ckan utils", e);
|
||||||
// put it into session
|
|
||||||
logger.debug("Putting object into session ");
|
|
||||||
httpSession.setAttribute(keyForScope, instance);
|
|
||||||
}catch(Exception e){
|
|
||||||
logger.error("Unable to retrieve ckan utils", e);
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
instance = (CKanUtils)httpSession.getAttribute(keyForScope);
|
|
||||||
logger.debug("Ckan utils object was into session");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue