提交 849c40a5 编写于 作者: N nilspreusker

fixed issue in activiti-cycle that caused the browser to show a log-in dialog...

fixed issue in activiti-cycle that caused the browser to show a log-in dialog even if the user was logged in already
上级 77abe958
......@@ -22,7 +22,7 @@
// Create new service instances and set this component to receive the callbacks
this.services.repositoryService = new Activiti.service.RepositoryService(this);
// Listen for events that interest this component
this.onEvent(Activiti.event.updateArtifactView, this.onSelectTreeLabelEvent);
this.onEvent(Activiti.event.updateArtifactView, this.onUpdateArtifactView);
this._tabView = {};
this._repositoryNodeId = "";
......@@ -46,7 +46,7 @@
},
onSelectTreeLabelEvent: function Artifact_onSelectTreeLabelEvent(event, args) {
onUpdateArtifactView: function Artifact_onUpdateArtifactView(event, args) {
this._repositoryNodeId = args[1].value.repositoryNodeId;
this._isRepositoryArtifact = args[1].value.isRepositoryArtifact;
......@@ -200,7 +200,7 @@
loadTabDataURL: function Artifact_loadTabDataURL(artifactId, representationId)
{
return Activiti.service.REST_PROXY_URI_RELATIVE + "content-representation?artifactId=" + encodeURIComponent(artifactId) + "&representationId=" + encodeURIComponent(representationId);
return Activiti.service.REST_PROXY_URI_RELATIVE + "content-representation?artifactId=" + encodeURIComponent(artifactId) + "&representationId=" + encodeURIComponent(representationId) + "&restProxyUri=" + encodeURIComponent(Activiti.service.REST_PROXY_URI_RELATIVE);
},
onActiveTabChange: function Artifact_onActiveTabChange(event)
......
......@@ -32,6 +32,7 @@ public class ContentRepresentationGet extends ActivitiWebScript {
String artifactId = req.getString("artifactId");
String representationId = req.getString("representationId");
String restProxyUri = req.getString("restProxyUri");
RepositoryArtifact artifact = conn.getRepositoryArtifact(artifactId);
......@@ -40,7 +41,7 @@ public class ContentRepresentationGet extends ActivitiWebScript {
for (ContentRepresentation contentRepresentation : artifact.getArtifactType().getContentRepresentations()) {
if (contentRepresentation.getId().equals(representationId)) {
if (contentRepresentation.getMimeType().startsWith("image/")) {
String imageUrl = wsReq.getServerPath() + wsReq.getContextPath() + "/service/content?artifactId=" + URLEncoder.encode(artifactId, "UTF-8")
String imageUrl = restProxyUri + "/content?artifactId=" + URLEncoder.encode(artifactId, "UTF-8")
+ "&content-type=" + URLEncoder.encode(contentRepresentation.getMimeType(), "UTF-8");
model.put("imageUrl", imageUrl);
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册