summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVikas Mishra2012-03-20 04:24:47 (EDT)
committer Manik Kishore2012-06-19 07:22:17 (EDT)
commite04fb1d57c4946e969e90cc39f7c806278c24d34 (patch)
treed02c4d8569251e1c8a4cb1b22e865a3a88cc0d2c
parent1ee4bac434f5fba5dcbcae2ff09bc4fc500f03ce (diff)
downloadorg.eclipse.stardust.ui.web-e04fb1d57c4946e969e90cc39f7c806278c24d34.zip
org.eclipse.stardust.ui.web-e04fb1d57c4946e969e90cc39f7c806278c24d34.tar.gz
org.eclipse.stardust.ui.web-e04fb1d57c4946e969e90cc39f7c806278c24d34.tar.bz2
Jira-ID: CRNT-24256
restored code for Configuration Panel: Image Viewer configuration option related to "Handling of Prior Versions" for Extract. git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@54667 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/document/ImageViewerConfigurationBean.java56
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/document/tiff/extract/ExtractPageDialog.java23
-rw-r--r--views-common/src/main/resources/META-INF/xhtml/views/document/imageViewerConfiguration.xhtml13
-rw-r--r--views-common/src/main/resources/views-common-messages.properties3
-rw-r--r--views-common/src/main/resources/views-common-messages_de.properties3
-rw-r--r--views-common/src/main/resources/views-common-messages_ja.properties3
-rw-r--r--views-common/src/main/resources/views-common-messages_zh_CN.properties1
7 files changed, 55 insertions, 47 deletions
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/document/ImageViewerConfigurationBean.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/document/ImageViewerConfigurationBean.java
index 56eb3ab..c3ed23a 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/document/ImageViewerConfigurationBean.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/document/ImageViewerConfigurationBean.java
@@ -44,6 +44,8 @@ import org.eclipse.stardust.ui.web.viewscommon.messages.MessagesViewsCommonBean;
public class ImageViewerConfigurationBean implements PortalConfigurationListener, UserPreferencesEntries, ConfirmationDialogHandler
{
private static final String BEAN_NAME = "imageViewerConfigurationBean";
+ private static final String RETAIN_PRIOR_DOCUMENT_VERSIONS="0";
+ private static final String DELETE_PRIOR_DOCUMENT_VERSIONS="1";
private static final String DEFAULT_NOTE_FONT_SIZE = "24";
@@ -254,13 +256,19 @@ public class ImageViewerConfigurationBean implements PortalConfigurationListener
userPrefsHelper.setString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_STICKY_NOTE_COLOUR, stickyNoteColour);
userPrefsHelper.setString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_HIGHLIGHTER_COLOUR, highlighterColour);
userPrefsHelper.setString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_DATA_FIELD_HIGHLIGHTER_COLOUR, dataFieldHighlightColour);
- userPrefsHelper.setString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_DOC_PRIOR_VERSION_ACTION, docPriorVersionAction);
+
userPrefsHelper.setString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_DATA_FIELD_HIGHLIGHTER_OPACITY, dataFieldHighlightOpacity);
userPrefsHelper.setString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_DISPLAY_ZOOM_LIVEL, selectedDisplayZoomLevel);
userPrefsHelper.setString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_STAMP, ImageViewerStampsBean.getCurrent().getSelectedStampId());
- userPrefsHelper.setString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_ENABLE_EXTRACT_PAGES, String.valueOf(enableExtractPage));
- allowDeleteFromOriginal = enableExtractPage && allowDeleteFromOriginal;
- userPrefsHelper.setString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_ALLOW_DELETE_FROM_ORIGINAL, String.valueOf(allowDeleteFromOriginal));
+
+ //non-admin user can't change values
+ if (SessionContext.findSessionContext().getUser().isAdministrator())
+ {
+ userPrefsHelper.setString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_ENABLE_EXTRACT_PAGES, String.valueOf(enableExtractPage));
+ allowDeleteFromOriginal = enableExtractPage && allowDeleteFromOriginal;
+ userPrefsHelper.setString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_ENABLE_PAGE_DELETE, String.valueOf(allowDeleteFromOriginal));
+ userPrefsHelper.setString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_DOC_PRIOR_VERSION_ACTION, docPriorVersionAction);
+ }
MessageDialog.addInfoMessage(messageBean.getString("views.imageViewerConfig.save.successMessage"));
}
@@ -582,8 +590,8 @@ public class ImageViewerConfigurationBean implements PortalConfigurationListener
*/
private void initializeDocPriorVerionAcionList(){
docPriorVersionActionList=new ArrayList<SelectItem>();
- docPriorVersionActionList.add(new SelectItem("0",messageBean.getString("views.imageViewerConfig.extractPages.DocPriorVerionAction.Retain")));
- docPriorVersionActionList.add(new SelectItem("1",messageBean.getString("views.imageViewerConfig.extractPages.DocPriorVerionAction.Delete")));
+ docPriorVersionActionList.add(new SelectItem(RETAIN_PRIOR_DOCUMENT_VERSIONS,messageBean.getString("views.imageViewerConfig.extractPages.DocPriorVerionAction.Retain")));
+ docPriorVersionActionList.add(new SelectItem(DELETE_PRIOR_DOCUMENT_VERSIONS,messageBean.getString("views.imageViewerConfig.extractPages.DocPriorVerionAction.Delete")));
}
/**
*
@@ -638,15 +646,12 @@ public class ImageViewerConfigurationBean implements PortalConfigurationListener
selectedNoteFontSize = userPrefsHelper.getSingleString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_NOTE_FONT_SIZE, DEFAULT_NOTE_FONT_SIZE);
stickyNoteColour = userPrefsHelper.getSingleString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_STICKY_NOTE_COLOUR, "yellow");
highlighterColour = userPrefsHelper.getSingleString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_HIGHLIGHTER_COLOUR, "#FF0000");
- dataFieldHighlightColour = userPrefsHelper.getSingleString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_DATA_FIELD_HIGHLIGHTER_COLOUR, "#FF0000");
- docPriorVersionAction = userPrefsHelper.getSingleString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_DOC_PRIOR_VERSION_ACTION, "RETAIN_PRIOR_DOCUMENT");
+ dataFieldHighlightColour = userPrefsHelper.getSingleString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_DATA_FIELD_HIGHLIGHTER_COLOUR, "#FF0000");
dataFieldHighlightOpacity = userPrefsHelper.getSingleString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_DATA_FIELD_HIGHLIGHTER_OPACITY, "0.5");
selectedDisplayZoomLevel = userPrefsHelper.getSingleString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_DISPLAY_ZOOM_LIVEL, "FIT_TO_WINDOW");
- if (SessionContext.findSessionContext().getUser().isAdministrator())
- {
- enableExtractPage = userPrefsHelper.getBoolean(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_ENABLE_EXTRACT_PAGES, true);
- allowDeleteFromOriginal = userPrefsHelper.getBoolean(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_ALLOW_DELETE_FROM_ORIGINAL, true);
- }
+ enableExtractPage = userPrefsHelper.getBoolean(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_ENABLE_EXTRACT_PAGES, true);
+ allowDeleteFromOriginal = userPrefsHelper.getBoolean(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_ENABLE_PAGE_DELETE, true);
+ docPriorVersionAction = userPrefsHelper.getSingleString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_DOC_PRIOR_VERSION_ACTION, RETAIN_PRIOR_DOCUMENT_VERSIONS);
ImageViewerStampsBean.getCurrent().setSelectedStampId(userPrefsHelper.getSingleString(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_STAMP, ""));
}
@@ -670,13 +675,13 @@ public class ImageViewerConfigurationBean implements PortalConfigurationListener
userPrefsHelper.resetValue(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_HIGHLIGHTER_COLOUR);
userPrefsHelper.resetValue(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_DATA_FIELD_HIGHLIGHTER_COLOUR);
userPrefsHelper.resetValue(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_DATA_FIELD_HIGHLIGHTER_OPACITY);
- userPrefsHelper.resetValue(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_DISPLAY_ZOOM_LIVEL);
- userPrefsHelper.resetValue(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_DOC_PRIOR_VERSION_ACTION);
+ userPrefsHelper.resetValue(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_DISPLAY_ZOOM_LIVEL);
userPrefsHelper.resetValue(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_STAMP);
if (SessionContext.findSessionContext().getUser().isAdministrator())
{
userPrefsHelper.resetValue(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_ENABLE_EXTRACT_PAGES);
- userPrefsHelper.resetValue(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_ALLOW_DELETE_FROM_ORIGINAL);
+ userPrefsHelper.resetValue(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_ENABLE_PAGE_DELETE);
+ userPrefsHelper.resetValue(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_DOC_PRIOR_VERSION_ACTION);
}
}
@@ -701,14 +706,29 @@ public class ImageViewerConfigurationBean implements PortalConfigurationListener
/**
* @return
*/
- public static boolean isAllowDeleteFromOriginalEnable()
+ public static boolean isEnablePageDelete()
{
if (isExtractPagesEnable())
{
UserPreferencesHelper userPrefsHelper = getUserPrefenceHelper();
- return userPrefsHelper.getBoolean(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_ALLOW_DELETE_FROM_ORIGINAL, true);
+ return userPrefsHelper.getBoolean(V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_ENABLE_PAGE_DELETE, true);
}
return false;
}
+
+ /**
+ * check user preference for document version retain configuration
+ *
+ * @return
+ */
+
+ public static boolean isRetainPriorVersion()
+ {
+ UserPreferencesHelper userPrefsHelper = getUserPrefenceHelper();
+ String docPriorVersionAction = userPrefsHelper.getSingleString(V_IMAGE_VIEWER_CONFIG,
+ F_IMAGE_VIEWER_SELECTED_DOC_PRIOR_VERSION_ACTION, RETAIN_PRIOR_DOCUMENT_VERSIONS);
+
+ return DELETE_PRIOR_DOCUMENT_VERSIONS.equals(docPriorVersionAction) ? false : true;
+ }
}
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/document/tiff/extract/ExtractPageDialog.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/document/tiff/extract/ExtractPageDialog.java
index fe86eaa..8fdc36b 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/document/tiff/extract/ExtractPageDialog.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/document/tiff/extract/ExtractPageDialog.java
@@ -191,7 +191,7 @@ public class ExtractPageDialog extends PopupUIComponentBean implements Confirmat
spawnProcessHelper = new SpawnProcessHelper();
userPrefsHelper = getUserPrefenceHelper();
validationMessageBean = new ValidationMessageBean();
- deletePageEnable = ImageViewerConfigurationBean.isAllowDeleteFromOriginalEnable();
+ deletePageEnable = ImageViewerConfigurationBean.isEnablePageDelete();
List<ProcessDefinition> startableProcesses = null;
@@ -620,7 +620,7 @@ public class ExtractPageDialog extends PopupUIComponentBean implements Confirmat
deleteExtractedPages(updatePageList);
// delete old versions if not to retain version
- if (deletePageEnable && !isRetainPriorVersion())
+ if (deletePageEnable && !ImageViewerConfigurationBean.isRetainPriorVersion())
{
DocumentMgmtUtility.deleteOldVersions(imageInfo.getDocument());
}
@@ -686,24 +686,7 @@ public class ExtractPageDialog extends PopupUIComponentBean implements Confirmat
{
DMSHelper.deleteProcessAttachment(pi, document);
}
- }
-
- /**
- * check user preference for document version retain configuration
- *
- * @return
- */
- private boolean isRetainPriorVersion()
- {
- String docPriorVersionAction = userPrefsHelper.getSingleString(UserPreferencesEntries.V_IMAGE_VIEWER_CONFIG,
- UserPreferencesEntries.F_IMAGE_VIEWER_SELECTED_DOC_PRIOR_VERSION_ACTION, "RETAIN_PRIOR_DOCUMENT");
-
- return "1".equals(docPriorVersionAction) ? false : true; // 1= not retain prior
- // version,0=retain prior
- // version
- }
-
-
+ }
/**
*
diff --git a/views-common/src/main/resources/META-INF/xhtml/views/document/imageViewerConfiguration.xhtml b/views-common/src/main/resources/META-INF/xhtml/views/document/imageViewerConfiguration.xhtml
index 32be616..30fcbb6 100644
--- a/views-common/src/main/resources/META-INF/xhtml/views/document/imageViewerConfiguration.xhtml
+++ b/views-common/src/main/resources/META-INF/xhtml/views/document/imageViewerConfiguration.xhtml
@@ -209,7 +209,7 @@
<!-- Extract Page configuration -->
<ice:panelGroup styleClass="heading" style="width: 100%">
<ice:outputText
- value="#{views_common_msgPropsBean['views.imageViewerConfig.extractPageOptions.title']}" />
+ value="#{views_common_msgPropsBean['views.imageViewerConfig.extractPages.title']}" />
</ice:panelGroup>
<ice:panelGroup style="clearing" />
<ice:panelGroup>
@@ -232,7 +232,16 @@
</ice:panelGroup>
</ice:panelGrid>
</ice:panelGroup>
-
+ <ice:panelGroup style="clearing" />
+ <ice:panelGrid columns="2" rendered="#{imageViewerConfigurationBean.allowDeleteFromOriginal}">
+ <ice:outputLabel value="#{views_common_msgPropsBean['views.imageViewerConfig.extractPages.DocPriorVersionAction.Label']}" styleClass="label-form"/>
+ <ice:selectOneMenu partialSubmit="true"
+ value="#{imageViewerConfigurationBean.docPriorVersionAction}"
+ disabled="#{!ippPortalApp.loggedInUser.administrator or !imageViewerConfigurationBean.enableExtractPage}">
+ <f:selectItems
+ value="#{imageViewerConfigurationBean.docPriorVersionActionList}" />
+ </ice:selectOneMenu>
+ </ice:panelGrid>
<ice:panelGroup style="clearing" />
<!-- Temporary Commented following code as part of JIRA CRNT-21779
diff --git a/views-common/src/main/resources/views-common-messages.properties b/views-common/src/main/resources/views-common-messages.properties
index 5620568..74a711e 100644
--- a/views-common/src/main/resources/views-common-messages.properties
+++ b/views-common/src/main/resources/views-common-messages.properties
@@ -1170,10 +1170,9 @@ views.imageViewerConfig.stamps.standardStamps.heading=Standard Stamps
views.imageViewerConfig.stamps.myStamps.heading=My Stamps
views.imageViewerConfig.extractPages.title=Extract Pages
views.imageViewerConfig.extractPages.enablePageDeletion=Enable Page Deletion
-views.imageViewerConfig.extractPages.DocPriorVersionAction.Label=What should we do with prior versions of the source document when extracting and deleting pages?
+views.imageViewerConfig.extractPages.DocPriorVersionAction.Label=What should we do with prior versions of the <br/> source document when extracting and deleting pages?
views.imageViewerConfig.extractPages.DocPriorVerionAction.Retain=Retain Prior Versions
views.imageViewerConfig.extractPages.DocPriorVerionAction.Delete=Delete Prior Versions
-views.imageViewerConfig.extractPageOptions.title=Enable Extract
views.imageViewerConfig.extractPageOptions.enableExtractPages=Enable Extract Pages
views.imageViewerConfig.extractPageOptions.allowDeleteFromOriginal=Allow Extracted Pages to be Deleted from the Original
diff --git a/views-common/src/main/resources/views-common-messages_de.properties b/views-common/src/main/resources/views-common-messages_de.properties
index 010b7cb..2c560c3 100644
--- a/views-common/src/main/resources/views-common-messages_de.properties
+++ b/views-common/src/main/resources/views-common-messages_de.properties
@@ -1167,10 +1167,9 @@ views.imageViewerConfig.stamps.standardStamps.heading = Standard Stempel
views.imageViewerConfig.stamps.myStamps.heading = Meine Stempel
views.imageViewerConfig.extractPages.title=+Extract Pages
views.imageViewerConfig.extractPages.enablePageDeletion=+Enable Page Deletion
-views.imageViewerConfig.extractPages.DocPriorVersionAction.Label=+What should we do with prior versions of the source document when extracting and deleting pages?
+views.imageViewerConfig.extractPages.DocPriorVersionAction.Label=+What should we do with prior versions of the <br/> source document when extracting and deleting pages?
views.imageViewerConfig.extractPages.DocPriorVerionAction.Retain=+Retain Prior Versions
views.imageViewerConfig.extractPages.DocPriorVerionAction.Delete=+Delete Prior Versions
-views.imageViewerConfig.extractPageOptions.title=+Enable Extract
views.imageViewerConfig.extractPageOptions.enableExtractPages=+Enable Extract Pages
views.imageViewerConfig.extractPageOptions.allowDeleteFromOriginal=+Allow Extracted Pages to be Deleted from the Original
diff --git a/views-common/src/main/resources/views-common-messages_ja.properties b/views-common/src/main/resources/views-common-messages_ja.properties
index 20e3dc6..b0e82a0 100644
--- a/views-common/src/main/resources/views-common-messages_ja.properties
+++ b/views-common/src/main/resources/views-common-messages_ja.properties
@@ -1168,10 +1168,9 @@ views.imageViewerConfig.stamps.standardStamps.heading = \u6A19\u6E96\u7684\u306A
views.imageViewerConfig.stamps.myStamps.heading = \u30DE\u30A4\u30B9\u30BF\u30F3\u30D7
views.imageViewerConfig.extractPages.title = +Extract Pages
views.imageViewerConfig.extractPages.enablePageDeletion = +Enable Page Deletion
-views.imageViewerConfig.extractPages.DocPriorVersionAction.Label = +What should we do with prior versions of the source document when extracting and deleting pages?
+views.imageViewerConfig.extractPages.DocPriorVersionAction.Label = +What should we do with prior versions of the <br/> source document when extracting and deleting pages?
views.imageViewerConfig.extractPages.DocPriorVerionAction.Retain = +Retain Prior Versions
views.imageViewerConfig.extractPages.DocPriorVerionAction.Delete = +Delete Prior Versions
-views.imageViewerConfig.extractPageOptions.title=+Enable Extract
views.imageViewerConfig.extractPageOptions.enableExtractPages=+Enable Extract Pages
views.imageViewerConfig.extractPageOptions.allowDeleteFromOriginal=+Allow Extracted Pages to be Deleted from the Original
diff --git a/views-common/src/main/resources/views-common-messages_zh_CN.properties b/views-common/src/main/resources/views-common-messages_zh_CN.properties
index 00513cf..8c7bb76 100644
--- a/views-common/src/main/resources/views-common-messages_zh_CN.properties
+++ b/views-common/src/main/resources/views-common-messages_zh_CN.properties
@@ -1172,7 +1172,6 @@ views.imageViewerConfig.extractPages.enablePageDeletion = \u542F\u7528\u9875\u97
views.imageViewerConfig.extractPages.DocPriorVersionAction.Label = \u6709\u5173\u4E4B\u524D\u7248\u672C\u7684\u6E90\u6587\u4EF6\uFF0C\u5F53\u89E3\u538B\u548C\u5220\u9664\u9875\u9762\u65F6\u6211\u4EEC\u5E94\u8BE5\u505A\u4EC0\u4E48\uFF1F
views.imageViewerConfig.extractPages.DocPriorVerionAction.Retain = \u4FDD\u7559\u4EE5\u524D\u7684\u7248\u672C
views.imageViewerConfig.extractPages.DocPriorVerionAction.Delete = \u5220\u9664\u4EE5\u524D\u7684\u7248\u672C
-views.imageViewerConfig.extractPageOptions.title=+Enable Extract
views.imageViewerConfig.extractPageOptions.enableExtractPages=+Enable Extract Pages
views.imageViewerConfig.extractPageOptions.allowDeleteFromOriginal=+Allow Extracted Pages to be Deleted from the Original