/*
- * Copyright (C) 2007-2012 Mathieu Baudier
+ * Copyright (C) 2007-2012 Argeo GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.argeo.slc.client.ui.editors;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.Property;
+import javax.jcr.Repository;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import org.argeo.slc.client.ui.controllers.ProcessController;
import org.argeo.slc.execution.ExecutionModulesManager;
import org.argeo.slc.execution.ExecutionProcess;
-import org.argeo.slc.execution.ExecutionProcessNotifier;
-import org.argeo.slc.execution.ExecutionStep;
import org.argeo.slc.jcr.SlcJcrUtils;
import org.argeo.slc.jcr.SlcNames;
import org.argeo.slc.jcr.SlcTypes;
import org.eclipse.ui.forms.editor.FormEditor;
/** Editor for an execution process. */
-public class ProcessEditor extends FormEditor implements
- ExecutionProcessNotifier, SlcTypes, SlcNames {
+public class ProcessEditor extends FormEditor implements SlcTypes, SlcNames {
public final static String ID = ClientUiPlugin.ID + ".processEditor";
private Session session;
@Override
public void dispose() {
JcrUtils.logoutQuietly(session);
+ super.dispose();
}
/** Actually runs the process. */
Map<String, String> properties = new HashMap<String, String>();
properties.put(ExecutionModulesManager.SLC_PROCESS_ID,
process.getUuid());
- modulesManager.registerProcessNotifier(this, properties);
+ // modulesManager.registerProcessNotifier(this, properties);
} catch (Exception e) {
ErrorFeedback.show("Execution of " + processNode + " failed", e);
}
@Override
protected void addPages() {
try {
- builderPage = new ProcessBuilderPage(this, processNode,
- modulesManager);
+ builderPage = new ProcessBuilderPage(this, processNode);
addPage(builderPage);
firePropertyChange(PROP_DIRTY);
} catch (PartInitException e) {
editorDirtyStateChanged();
} catch (RepositoryException e) {
throw new SlcException("Cannot save " + processNode, e);
- } finally {
- JcrUtils.discardQuietly(session);
+ // } finally {
+ // JcrUtils.discardQuietly(session);
}
}
+ public void setEditorTitle(String title) {
+ setPartName(title);
+ }
+
@Override
public void doSaveAs() {
}
return false;
}
- public void updateStatus(ExecutionProcess process, String oldStatus,
- String newStatus) {
- }
-
- public void addSteps(ExecutionProcess process, List<ExecutionStep> steps) {
- }
+ // public void updateStatus(ExecutionProcess process, String oldStatus,
+ // String newStatus) {
+ // }
+ //
+ // public void addSteps(ExecutionProcess process, List<ExecutionStep> steps)
+ // {
+ // }
/** Expects one session per editor. */
+ @Deprecated
public void setSession(Session session) {
this.session = session;
}
+ public void setRepository(Repository repository) {
+ try {
+ session = repository.login();
+ } catch (RepositoryException re) {
+ throw new SlcException("Unable to log in Repository " + repository,
+ re);
+ }
+ }
+
public void setProcessController(ProcessController processController) {
this.processController = processController;
}
public void setModulesManager(ExecutionModulesManager modulesManager) {
this.modulesManager = modulesManager;
}
-
}