@Override public Map<String, String> getEditorParameters( final Path path, final String editorID, String hostInfo, PlaceRequest place) { List<String> activeNodesList = new ArrayList<String>(); String activeNodesParam = place.getParameter("activeNodes", null); String readOnly = place.getParameter("readOnly", "false"); String encodedProcessSource = place.getParameter("encodedProcessSource", ""); if (activeNodesParam != null) { activeNodesList = Arrays.asList(activeNodesParam.split(",")); } List<String> completedNodesList = new ArrayList<String>(); String completedNodesParam = place.getParameter("completedNodes", null); if (completedNodesParam != null) { completedNodesList = Arrays.asList(completedNodesParam.split(",")); } JSONArray activeNodesArray = new JSONArray(activeNodesList); String encodedActiveNodesParam; try { encodedActiveNodesParam = Base64.encodeBase64URLSafeString(activeNodesArray.toString().getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { encodedActiveNodesParam = ""; } JSONArray completedNodesArray = new JSONArray(completedNodesList); String encodedCompletedNodesParam; try { encodedCompletedNodesParam = Base64.encodeBase64URLSafeString(completedNodesArray.toString().getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { encodedCompletedNodesParam = ""; } Map<String, String> editorParamsMap = new HashMap<String, String>(); editorParamsMap.put("hostinfo", hostInfo); editorParamsMap.put("uuid", path.toURI()); editorParamsMap.put("profile", "jbpm"); editorParamsMap.put("pp", ""); editorParamsMap.put("editorid", editorID); editorParamsMap.put("readonly", readOnly); editorParamsMap.put("activenodes", encodedActiveNodesParam); editorParamsMap.put("completednodes", encodedCompletedNodesParam); editorParamsMap.put("processsource", encodedProcessSource); return editorParamsMap; // String editorURL = hostInfo + "/editor/?uuid=" + path.toURI() + // "&profile=jbpm&pp=&editorid=" + editorID + "&readonly=" + readOnly + // "&activenodes=" + encodedActiveNodesParam + "&completednodes=" + // encodedCompletedNodesParam; // return getEditorResponse( editorURL, encodedProcessSource ); }
public void bulkSignal(List<ProcessInstanceVariableSummary> processInstances) { StringBuilder processIdsParam = new StringBuilder(); if (processInstances != null) { for (ProcessInstanceVariableSummary selected : processInstances) {} // remove last , if (processIdsParam.length() > 0) { processIdsParam.deleteCharAt(processIdsParam.length() - 1); } } else { processIdsParam.append("-1"); } PlaceRequest placeRequestImpl = new DefaultPlaceRequest("Signal Process Popup"); placeRequestImpl.addParameter("processInstanceId", processIdsParam.toString()); placeManager.goTo(placeRequestImpl); view.displayNotification(constants.Signaling_Process_Instance()); }
@Override public Boolean intercept(final PlaceRequest intercepted) { if (splashFilter == null) { return false; } for (final String interceptPoint : splashFilter.getInterceptionPoints()) { if (intercepted.getIdentifier().equals(interceptPoint)) { return true; } } return false; }
@OnStartup public void onStartup(final ObservablePath path, final PlaceRequest place) { init(path, place, resourceType, true, false, SAVE, COPY, RENAME, DELETE); // This is only used to define the "name" used by @WorkbenchPartTitle which is called by // Uberfire after @OnStartup // but before the async call in "loadContent()" has returned. When the *real* plugin is loaded // this is overwritten final String name = place.getParameter("name", ""); plugin = new Plugin(name, PluginType.PERSPECTIVE_LAYOUT, path); this.layoutEditorPlugin.init(name, lookupPerspectiveDragComponents()); this.perspectiveEditorView.setupLayoutEditor(layoutEditorPlugin.asWidget()); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof UberfireDock)) { return false; } UberfireDock that = (UberfireDock) o; if (placeRequest != null ? !placeRequest.equals(that.placeRequest) : that.placeRequest != null) { return false; } return !(associatedPerspective != null ? !associatedPerspective.equals(that.associatedPerspective) : that.associatedPerspective != null); }
@OnOpen public void onOpen() { this.currentProcessDefinition = place.getParameter("processName", ""); view.setCurrentFilter(currentProcessDefinition); refreshActiveProcessList(); }
private PlaceRequest clonePlaceAndMergeParameters(final PlaceRequest _place) { return _place.clone(); }
@OnStartup public void onStartup(final ObservablePath path, final PlaceRequest place) { this.path = path; this.place = place; this.isReadOnly = place.getParameter("readOnly", null) == null ? false : true; this.version = place.getParameter("version", null); this.path.onRename( new Command() { @Override public void execute() { changeTitleNotification.fire(new ChangeTitleWidgetEvent(place, getTitle(), null)); } }); this.path.onConcurrentUpdate( new ParameterizedCommand<ObservablePath.OnConcurrentUpdateEvent>() { @Override public void execute(final ObservablePath.OnConcurrentUpdateEvent eventInfo) { concurrentUpdateSessionInfo = eventInfo; } }); this.path.onConcurrentRename( new ParameterizedCommand<ObservablePath.OnConcurrentRenameEvent>() { @Override public void execute(final ObservablePath.OnConcurrentRenameEvent info) { newConcurrentRename( info.getSource(), info.getTarget(), info.getIdentity(), new Command() { @Override public void execute() { disableMenus(); } }, new Command() { @Override public void execute() { reload(); } }) .show(); } }); this.path.onConcurrentDelete( new ParameterizedCommand<ObservablePath.OnConcurrentDelete>() { @Override public void execute(final ObservablePath.OnConcurrentDelete info) { newConcurrentDelete( info.getPath(), info.getIdentity(), new Command() { @Override public void execute() { disableMenus(); } }, new Command() { @Override public void execute() { placeManager.closePlace(place); } }) .show(); } }); makeMenuBar(); view.showBusyIndicator(CommonConstants.INSTANCE.Loading()); multiPage.addWidget(view, DSLTextEditorConstants.INSTANCE.DSL()); multiPage.addPage( new Page(metadataWidget, CommonConstants.INSTANCE.MetadataTabTitle()) { @Override public void onFocus() { metadataWidget.showBusyIndicator(CommonConstants.INSTANCE.Loading()); metadataService .call( new MetadataSuccessCallback(metadataWidget, isReadOnly), new HasBusyIndicatorDefaultErrorCallback(metadataWidget)) .getMetadata(path); } @Override public void onLostFocus() { // Nothing to do } }); loadContent(); }
@Override public int hashCode() { int result = placeRequest != null ? placeRequest.hashCode() : 0; result = 31 * result + (associatedPerspective != null ? associatedPerspective.hashCode() : 0); return result; }
public String getIdentifier() { return placeRequest.getIdentifier(); }