i want to validate multiple tasks in Alfresco share. I have added a checkbox per line in the task interface and a button to validate. As it can take a while to validate my tasks i would like to put a progress bar to inform how many tasks have been validated yet.
I made a web script to maintain a kind of counter, so that i can update my progress bar every x second. What would be the best solution to store that information to retrieve it in alfresco share ? I tried to store my variable in session but i didn't succeed.
Can someone tell me how to do ?
Thx in advance
EDIT here is what i've tried
public class HttpSessionHelper extends BaseScopableProcessorExtension {
public void setInSession(String paramName, String paramValue) {
HttpSession session = ServletUtil.getSession();
session.setAttribute(paramName, paramValue);
}
public String getFromSession(String paramName) {
HttpSession session = ServletUtil.getSession();
Object paramValue = session.getAttribute(paramName);
if (paramValue != null) {
return paramValue.toString();
} else {
return null;
}
}
}
Bean definition
<bean id="tasksProgression" parent="baseJavaScriptExtension" class="com.test.HttpSessionHelper">
<property name="extensionName">
<value>tasksProgression</value>
</property>
</bean>
Alfresco web script : validation-state.lib.js
function getValidationState(){
tasksProgression.setInSession("test",5);
return tasksProgression.getFromSession();
}
when i get into setInSession, ServletUtil.getSession() returns null