New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JBPM-7916 - Stunner BPMN Process Documentation Feature #2363
Changes from all commits
990cab1
0e35861
7f65ef7
a87469a
50f0b40
be13e6b
e6f1a28
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright 2018 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.kie.workbench.common.stunner.core.documentation.model; | ||
|
||
import jsinterop.annotations.JsPackage; | ||
import jsinterop.annotations.JsType; | ||
import org.kie.workbench.common.stunner.core.diagram.Diagram; | ||
|
||
/** | ||
* Represents a process documentation of {@link Diagram}, containing all the processed data. | ||
*/ | ||
@JsType(isNative = true, namespace = JsPackage.GLOBAL) | ||
public interface DiagramDocumentation { | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright 2019 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.kie.workbench.common.stunner.core.documentation.model; | ||
|
||
public class DocumentationOutput { | ||
|
||
public static final DocumentationOutput EMPTY = new DocumentationOutput(""); | ||
|
||
private String value; | ||
|
||
public DocumentationOutput(String value) { | ||
this.value = value; | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright 2019 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.kie.workbench.common.stunner.core.documentation.model; | ||
|
||
public class HTMLDocumentationTemplate { | ||
|
||
private String template; | ||
|
||
public HTMLDocumentationTemplate(String template) { | ||
this.template = template; | ||
} | ||
|
||
public String getTemplate() { | ||
return template; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright 2018 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.kie.workbench.common.stunner.core.documentation.service; | ||
|
||
import org.kie.workbench.common.stunner.core.diagram.Diagram; | ||
import org.kie.workbench.common.stunner.core.documentation.model.DiagramDocumentation; | ||
import org.kie.workbench.common.stunner.core.documentation.model.DocumentationOutput; | ||
import org.kie.workbench.common.stunner.core.documentation.model.HTMLDocumentationTemplate; | ||
|
||
public interface DiagramDocumentationService<D extends Diagram, R extends DiagramDocumentation, | ||
T extends HTMLDocumentationTemplate, P extends DocumentationOutput> { | ||
|
||
/** | ||
* Process the diagram generating the documentation output bean. | ||
* @param diagram | ||
* @return | ||
*/ | ||
R processDocumentation(D diagram); | ||
|
||
/** | ||
* Returns the template to be used to build the serialized documentation. | ||
* @return | ||
*/ | ||
T getDocumentationTemplate(); | ||
|
||
/** | ||
* Generates the documentation serialized output based on the given template. | ||
* @param template | ||
* @param diagramDocumentation | ||
* @return | ||
*/ | ||
DocumentationOutput buildDocumentation(T template, R diagramDocumentation); | ||
|
||
/** | ||
* This is the method that executed the full documentations process. | ||
* @param diagram | ||
* @return the processed documentation output | ||
*/ | ||
DocumentationOutput generate(D diagram); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,11 +82,6 @@ protected void onSaveDiagram(@Observes SaveDiagramSessionCommandExecutedEvent ev | |
|
||
final Metadata diagramMetadata = getCanvasHandler().getDiagram().getMetadata(); | ||
if (Objects.equals(diagramMetadata.getCanvasRootUUID(), event.getDiagramUUID())) { | ||
|
||
//prevents to render selection on canvas | ||
getSession().getSelectionControl().clearSelection(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no need clear selection anymore? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, every time we are generating SVG or any other images, before that we are clearing the selection on canvas, to avoid showing up the Toolbox, but now I centralized it on the CanvasExport, it is better to keep only on one place IMO, see https://github.com/kiegroup/kie-wb-common/pull/2363/files#diff-0121e8ab393e44ea36b71825a5f6b861 |
||
|
||
//This is a workaround to overcome the animations executed on canvas when clear selection | ||
final String rawSvg = canvasExport.exportToSvg(getCanvasHandler()); | ||
diagramService.saveOrUpdateSvg(diagramMetadata.getPath(), rawSvg, new ServiceCallback<Path>() { | ||
@Override | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- | ||
~ Copyright 2018 Red Hat, Inc. and/or its affiliates. | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
<div data-field="documentationPanel" style="width: 100%;"> | ||
<div style="padding-top: 10px"> | ||
<h1>Documentation not available.</h1> | ||
</div> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need clear selection anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, every time we are generating SVG or any other images, before that we are clearing the selection on canvas, to avoid showing up the Toolbox, but now I centralized it on the CanvasExport, it is better to keep only on one place IMO, see https://github.com/kiegroup/kie-wb-common/pull/2363/files#diff-0121e8ab393e44ea36b71825a5f6b861