summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2013-04-17 03:27:22 (EDT)
committer Stephan Born2013-04-17 03:27:22 (EDT)
commitd0866497ebc66230af5e4f8c6cf1cbfea2dbf022 (patch)
tree1749f19f6615548d4ecc72d51eda8c5bb2af1eeb
parent97e0ebb4c2e855c5801de76d4711acbc849f48a4 (diff)
downloadorg.eclipse.stardust.ui.web-d0866497ebc66230af5e4f8c6cf1cbfea2dbf022.zip
org.eclipse.stardust.ui.web-d0866497ebc66230af5e4f8c6cf1cbfea2dbf022.tar.gz
org.eclipse.stardust.ui.web-d0866497ebc66230af5e4f8c6cf1cbfea2dbf022.tar.bz2
Jira-ID: CRNT-28431
1)Moved getReportingBaseURL() from ReportViewer.java to DocumentMgmtUtility. 2)Used getReportingBaseURL() method to form saveReportUrl context-root 3)Moved CONTEXT_PARAM_REPORTING_URI to Constants.java git-svn-id: https://svn.csa.sungard.com/repos/ipp2/product/trunk/stardust/ui.web@64247 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b Signed-off-by: Sidharth Singh <sidharth.singh@sungard.com>
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/Constants.java2
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/docmgmt/DocumentMgmtUtility.java17
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/document/ReportViewer.java20
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/reports/ArchiveReportDialog.java3
4 files changed, 21 insertions, 21 deletions
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/Constants.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/Constants.java
index a466577..74c1701 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/Constants.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/Constants.java
@@ -68,6 +68,8 @@ public class Constants
public static final String SKIN_FOLDER = "/public/skins";
public static final String PLUGIN_ROOT_FOLDER_PATH = "/plugins/";
+ public static final String CONTEXT_PARAM_REPORTING_URI = "ag.carnot.processportal.integration.REPORTING_URL";
+
public ActivityInstanceStates getActivityInstanceState()
{
return activityInstanceStates;
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/docmgmt/DocumentMgmtUtility.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/docmgmt/DocumentMgmtUtility.java
index 415328f..5b636d5 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/docmgmt/DocumentMgmtUtility.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/docmgmt/DocumentMgmtUtility.java
@@ -30,6 +30,7 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;
+import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import org.eclipse.stardust.common.CollectionUtils;
@@ -62,6 +63,7 @@ import org.eclipse.stardust.ui.web.common.message.MessageDialog;
import org.eclipse.stardust.ui.web.common.util.DateUtils;
import org.eclipse.stardust.ui.web.common.util.FacesUtils;
import org.eclipse.stardust.ui.web.viewscommon.beans.SessionContext;
+import org.eclipse.stardust.ui.web.viewscommon.common.Constants;
import org.eclipse.stardust.ui.web.viewscommon.messages.MessagesViewsCommonBean;
import org.eclipse.stardust.ui.web.viewscommon.utils.DMSHelper;
import org.eclipse.stardust.ui.web.viewscommon.utils.DMSUtils;
@@ -1077,6 +1079,21 @@ public class DocumentMgmtUtility
}
/**
+ * @return reporting base url
+ */
+ public static String getReportingBaseURL()
+ {
+ String baseUrl = (String) FacesContext.getCurrentInstance().getExternalContext()
+ .getInitParameter(Constants.CONTEXT_PARAM_REPORTING_URI);
+
+ if (org.eclipse.stardust.common.StringUtils.isEmpty(baseUrl))
+ {
+ baseUrl = FacesUtils.getServerBaseURL();
+ }
+ return baseUrl;
+ }
+
+ /**
* Validates the file name for JCR
*
* @param parentFolderPath
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/document/ReportViewer.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/document/ReportViewer.java
index 8b44425..9a9e3cd 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/document/ReportViewer.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/document/ReportViewer.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.stardust.ui.web.viewscommon.views.document;
-import javax.faces.context.FacesContext;
import org.eclipse.stardust.common.CollectionUtils;
import org.eclipse.stardust.common.StringUtils;
@@ -38,8 +37,6 @@ public class ReportViewer implements IDocumentViewer
public static final String URL_PARAMETERS="URL_PARAMETERS";
private static final String FAVORITE_MARKED = "/plugins/views-common/images/icons/star.png";
private static final String MARK_FAVORITE = "/plugins/views-common/images/icons/star-empty.png";
- private static final String CONTEXT_PARAM_REPORTING_URI = "ag.carnot.processportal.integration.REPORTING_URL";
-
private final String contentUrl = "/plugins/views-common/views/report/reportViewer.xhtml";
private final String toolbarUrl = "/plugins/views-common/extension/toolbar/reportDocumentViewToolbar.xhtml";
private final MIMEType[] mimeTypes = {MimeTypesHelper.RPT_DESIGN};
@@ -79,7 +76,7 @@ public class ReportViewer implements IDocumentViewer
this.documentContentInfo = documentContentInfo;
setFavoriteStatus(documentContentInfo.getId());
String queryString = getQueryString();
- sourceURI = getReportingBaseURL() + "/" + getPartitionID() + "?__report=" + reportUri + queryString + "&realmId="
+ sourceURI = DocumentMgmtUtility.getReportingBaseURL() + "/" + getPartitionID() + "?__report=" + reportUri + queryString + "&realmId="
+ UserUtils.getRealmId() + "&workflowUserSessionId=" + ServiceFactoryUtils.getWorkflowUserSessionId();
}
@@ -231,21 +228,6 @@ public class ReportViewer implements IDocumentViewer
}
}
- /**
- * @return reporting base url
- */
- private static String getReportingBaseURL()
- {
- String baseUrl = (String) FacesContext.getCurrentInstance().getExternalContext()
- .getInitParameter(CONTEXT_PARAM_REPORTING_URI);
-
- if (org.eclipse.stardust.common.StringUtils.isEmpty(baseUrl))
- {
- baseUrl = FacesUtils.getServerBaseURL();
- }
- return baseUrl;
- }
-
public void closeDocument()
{}
} \ No newline at end of file
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/reports/ArchiveReportDialog.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/reports/ArchiveReportDialog.java
index f055d06..2531644 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/reports/ArchiveReportDialog.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/reports/ArchiveReportDialog.java
@@ -72,8 +72,7 @@ public class ArchiveReportDialog extends PopupUIComponentBean
HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext()
.getRequest();
- String saveReportUrl = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
- + request.getContextPath() + "/frameset";
+ String saveReportUrl = DocumentMgmtUtility.getReportingBaseURL() + "/frameset";
String userPartition = SessionContext.findSessionContext().getUser().getPartitionId();
if (!PredefinedConstants.DEFAULT_PARTITION_ID.equalsIgnoreCase(userPartition))