import org.argeo.eclipse.ui.dialogs.ErrorFeedback;
import org.argeo.jcr.JcrUtils;
import org.argeo.slc.SlcException;
+import org.argeo.slc.SlcNames;
+import org.argeo.slc.SlcTypes;
import org.argeo.slc.client.ui.ClientUiPlugin;
import org.argeo.slc.client.ui.controllers.ProcessController;
import org.argeo.slc.execution.ExecutionModulesManager;
import org.argeo.slc.execution.ExecutionProcess;
import org.argeo.slc.jcr.SlcJcrUtils;
-import org.argeo.slc.jcr.SlcNames;
-import org.argeo.slc.jcr.SlcTypes;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.rap.rwt.service.ServerPushSession;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.IWorkbenchPage;
/** Editor for an execution process. */
public class ProcessEditor extends FormEditor implements SlcTypes, SlcNames {
+ private static final long serialVersionUID = 509589737739132467L;
+
public final static String ID = ClientUiPlugin.ID + ".processEditor";
+ private Repository repository;
private Session session;
private Node processNode;
private ProcessController processController;
+ private ServerPushSession pushSession;
private ProcessBuilderPage builderPage;
public void init(IEditorSite site, IEditorInput input)
throws PartInitException {
super.init(site, input);
+ pushSession = new ServerPushSession();
+ pushSession.start();
+ try {
+ session = repository.login();
+ } catch (RepositoryException e1) {
+ throw new SlcException("Cannot log in to repository");
+ }
+
ProcessEditorInput pei = (ProcessEditorInput) input;
String processPath = pei.getProcessPath();
try {
@Override
public void dispose() {
JcrUtils.logoutQuietly(session);
+ if (pushSession != null)
+ pushSession.stop();
super.dispose();
}
return false;
}
- // 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);
- }
+ this.repository = repository;
}
public void setProcessController(ProcessController processController) {