* @see org.apache.lenya.cms.usecase.AbstractUsecase#initParameters()
*/
protected void initParameters() {
super.initParameters();
WorkflowManager resolver = null;
try {
Document doc = getSourceDocument();
if (doc != null) {
// read parameters from Dublin Core meta-data
MetaData dc = doc.getMetaData(DublinCore.DC_NAMESPACE);
setParameter(DublinCore.ELEMENT_TITLE, dc.getFirstValue(DublinCore.ELEMENT_TITLE));
setParameter(DublinCore.ELEMENT_DESCRIPTION, dc
.getFirstValue(DublinCore.ELEMENT_DESCRIPTION));
// read parameters from document attributes
setParameter(LANGUAGES, doc.getLanguages());
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");
String lastModified = format
.format(new Date(getSourceDocument().getLastModified()));
setParameter(LASTMODIFIED, lastModified);
boolean visible = doc.getLink().getNode().isVisible();
setParameter(VISIBLE_IN_NAVIGATION, Boolean.valueOf(visible));
Workflowable workflowable = WorkflowUtil.getWorkflowable(this.manager,
getSession(), getLogger(), doc);
resolver = (WorkflowManager) this.manager.lookup(WorkflowManager.ROLE);
if (resolver.hasWorkflow(workflowable)) {
Workflow workflow = resolver.getWorkflowSchema(workflowable);
String[] variableNames = workflow.getVariableNames();
Version latestVersion = workflowable.getLatestVersion();
Boolean isLive = null;
if (latestVersion != null) {
setParameter(STATE, latestVersion.getState());