- public static String createAndConfigureEntity(Shell shell, Session referenceSession, String mainMixin,
- String... additionnalProps) {
-
- Session tmpSession = null;
- Session mainSession = null;
- try {
- // FIXME would not work if home is another physical workspace
- tmpSession = referenceSession.getRepository().login(NodeConstants.HOME_WORKSPACE);
- Node draftNode = null;
- for (int i = 0; i < additionnalProps.length - 1; i += 2) {
- draftNode.setProperty(additionnalProps[i], additionnalProps[i + 1]);
- }
- Wizard wizard = null;
- CmsWizardDialog dialog = new CmsWizardDialog(shell, wizard);
- // WizardDialog dialog = new WizardDialog(shell, wizard);
- if (dialog.open() == Window.OK) {
- String parentPath = null;// "/" + appService.getBaseRelPath(mainMixin);
- // FIXME it should be possible to specify the workspace
- mainSession = referenceSession.getRepository().login();
- Node parent = mainSession.getNode(parentPath);
- Node task = null;// appService.publishEntity(parent, mainMixin, draftNode);
-// task = appService.saveEntity(task, false);
- referenceSession.refresh(true);
- return task.getPath();
- }
- return null;
- } catch (RepositoryException e1) {
- throw new JcrException(
- "Unable to create " + mainMixin + " entity with session " + referenceSession.toString(), e1);
- } finally {
- JcrUtils.logoutQuietly(tmpSession);
- JcrUtils.logoutQuietly(mainSession);
- }
- }
+// public static String createAndConfigureEntity(Shell shell, Session referenceSession, String mainMixin,
+// String... additionnalProps) {
+//
+// Session tmpSession = null;
+// Session mainSession = null;
+// try {
+// // FIXME would not work if home is another physical workspace
+// tmpSession = referenceSession.getRepository().login(NodeConstants.HOME_WORKSPACE);
+// Node draftNode = null;
+// for (int i = 0; i < additionnalProps.length - 1; i += 2) {
+// draftNode.setProperty(additionnalProps[i], additionnalProps[i + 1]);
+// }
+// Wizard wizard = null;
+// CmsWizardDialog dialog = new CmsWizardDialog(shell, wizard);
+// // WizardDialog dialog = new WizardDialog(shell, wizard);
+// if (dialog.open() == Window.OK) {
+// String parentPath = null;// "/" + appService.getBaseRelPath(mainMixin);
+// // FIXME it should be possible to specify the workspace
+// mainSession = referenceSession.getRepository().login();
+// Node parent = mainSession.getNode(parentPath);
+// Node task = null;// appService.publishEntity(parent, mainMixin, draftNode);
+//// task = appService.saveEntity(task, false);
+// referenceSession.refresh(true);
+// return task.getPath();
+// }
+// return null;
+// } catch (RepositoryException e1) {
+// throw new JcrException(
+// "Unable to create " + mainMixin + " entity with session " + referenceSession.toString(), e1);
+// } finally {
+// JcrUtils.logoutQuietly(tmpSession);
+// JcrUtils.logoutQuietly(mainSession);
+// }
+// }