private void initializeSpawnProcessTypeList() {
   spawnProcessTypeList = new ArrayList<SelectItem>();
   spawnProcessTypeList.add(
       new SelectItem(
           SUB_PROCESS_TYPE, messageBean.getString("views.extractPages.spawnProcess.subprocess")));
   spawnProcessTypeList.add(
       new SelectItem(
           ROOT_PROCESS_TYPE,
           messageBean.getString("views.extractPages.spawnProcess.rootprocess")));
 }
 private void initializeDocPriorVerionAcionList() {
   docPriorVersionActionList = new ArrayList<SelectItem>();
   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")));
 }
 public void reset() {
   resetUsersPreferences();
   initialize();
   FacesUtils.clearFacesTreeValues();
   MessageDialog.addInfoMessage(
       MessagesViewsCommonBean.getInstance().getString("views.common.config.reset"));
 }
 public void initialize() {
   messageBean = MessagesViewsCommonBean.getInstance();
   intializeDisplayZoomLevelOptions();
   initializeHighlightColourList();
   initializeDocPriorVerionAcionList();
   initializeSpawnProcessTypeList();
   initializeDataHighlightOpacityList();
   initializeNoteFontSizeList();
   setUsersPreferences();
 }
 /** Confirmation Dialog before reseting Config data. */
 public void openConfirmationDialog() {
   imageViewerConfirmationDialog =
       new ConfirmationDialog(
           DialogContentType.WARNING,
           DialogActionType.YES_NO,
           DialogType.NORMAL,
           DialogStyle.COMPACT,
           this);
   MessagePropertiesBean propsBean = MessagePropertiesBean.getInstance();
   imageViewerConfirmationDialog.setTitle(
       propsBean.getString("common.configurationPanel.confirmResetTitle"));
   imageViewerConfirmationDialog.setMessage(
       propsBean.getParamString(
           "common.configurationPanel.confirmReset",
           MessagesViewsCommonBean.getInstance().getString("views.imageViewerConfig.labelTitle")));
   imageViewerConfirmationDialog.openPopup();
 }
  private void intializeDisplayZoomLevelOptions() {
    zoomLevelMap = new HashMap<String, String>();
    zoomLevelMap.put(messageBean.getString("views.imageViewerConfig.displayOptions.actual"), "0");
    zoomLevelMap.put(
        messageBean.getString("views.imageViewerConfig.displayOptions.fitToWindow"), "1");
    zoomLevelMap.put(
        messageBean.getString("views.imageViewerConfig.displayOptions.fitToHeight"), "2");
    zoomLevelMap.put(
        messageBean.getString("views.imageViewerConfig.displayOptions.fitToWidth"), "3");

    displayZoomLevelOptions = new ArrayList<SelectItem>();
    displayZoomLevelOptions.add(
        new SelectItem(messageBean.getString("views.imageViewerConfig.displayOptions.actual")));
    displayZoomLevelOptions.add(
        new SelectItem(
            messageBean.getString("views.imageViewerConfig.displayOptions.fitToWindow")));
    displayZoomLevelOptions.add(
        new SelectItem(
            messageBean.getString("views.imageViewerConfig.displayOptions.fitToHeight")));
    displayZoomLevelOptions.add(
        new SelectItem(messageBean.getString("views.imageViewerConfig.displayOptions.fitToWidth")));
  }
  public void save() {
    UserPreferencesHelper userPrefsHelper = getUserPrefenceHelper();
    userPrefsHelper.setString(
        V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SHOW_SIDE_PANEL, String.valueOf(showSidePanel));
    userPrefsHelper.setString(
        V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_INVERT_IMAGE, String.valueOf(invertImage));
    userPrefsHelper.setString(
        V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SHOW_ANNOTATIONS, String.valueOf(showAnnotations));
    userPrefsHelper.setString(
        V_IMAGE_VIEWER_CONFIG,
        F_IMAGE_VIEWER_HIGHLIGHT_DATA_FIELDS_ENABLED,
        String.valueOf(highlightDataFieldsEnabled));
    userPrefsHelper.setString(
        V_IMAGE_VIEWER_CONFIG,
        F_IMAGE_VIEWER_DATANAME_IN_TARGET_INCLUDED,
        String.valueOf(datanameInTargetIncluded));
    userPrefsHelper.setString(
        V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_MAGNIFY_FIELDS, String.valueOf(magnifyFields));
    userPrefsHelper.setString(
        V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_BOLD_SELECTED, String.valueOf(boldSelected));
    userPrefsHelper.setString(
        V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_ITALIC_SELECTED, String.valueOf(italicSelected));
    userPrefsHelper.setString(
        V_IMAGE_VIEWER_CONFIG,
        F_IMAGE_VIEWER_UNDERLINE_SELECTED,
        String.valueOf(underlineSelected));
    userPrefsHelper.setString(
        V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SELECTED_NOTE_FONT_SIZE, selectedNoteFontSize);
    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_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());

    // 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);
      userPrefsHelper.setString(
          V_IMAGE_VIEWER_CONFIG, F_IMAGE_VIEWER_SPAWN_PROCESS_TYPE, spawnProcessType);
    }
    MessageDialog.addInfoMessage(
        messageBean.getString("views.imageViewerConfig.save.successMessage"));
  }