Exemple #1
0
 public int doEndTag() throws JspException {
   ViewBean vb = getParentViewBean();
   NonSyncStringBuffer buffer = new NonSyncStringBuffer();
   buffer.append("<input type=\"hidden\" name=\"");
   buffer
       .append(AuthViewBeanBase.PAGE_ENCODING)
       .append("\" value=\"")
       .append(vb.getDisplayFieldValue("gx_charset"))
       .append("\">")
       .append("</form>");
   writeOutput(buffer);
   return EVAL_PAGE;
 }
Exemple #2
0
  /**
   * performs start tag
   *
   * @return EVAL_BODY_INCLUDE always
   * @throws JspException if request context is null
   */
  public int doStartTag() throws JspException {
    reset();

    Map m = getValueMap();

    NonSyncStringBuffer buffer = new NonSyncStringBuffer("<form ");
    for (Iterator it = m.keySet().iterator(); it.hasNext(); ) {
      String key = (String) it.next();
      String val = (String) m.get(key);
      buffer.append("  " + key + "=\"" + val + "\"");
    }
    buffer.append(">");

    writeOutput(buffer);

    return EVAL_BODY_INCLUDE;
  }
  /** To construct the copy information string in the summary page */
  private void constructCopyInfoString(SamWizardModel wizardModel) {
    int totalCopies = ((Integer) wizardModel.getValue(ISPolicyWizardImpl.TOTAL_COPIES)).intValue();
    if (totalCopies == 0) {
      return;
    }
    // Grab the HashMap that contains copy information from wizardModel
    HashMap copyNumberHashMap = (HashMap) wizardModel.getValue(ISPolicyWizardImpl.COPY_HASHMAP);

    NonSyncStringBuffer buf = new NonSyncStringBuffer();

    for (int i = 0; i < totalCopies; i++) {
      // Retrieve the CopyInfo data structure from the HashMap
      CopyInfo info = (CopyInfo) copyNumberHashMap.get(new Integer(i + 1));
      if (info == null) {
        // won't happen
        continue;
      }
      ArchiveCopyGUIWrapper myWrapper = info.getCopyWrapper();
      if (myWrapper == null) {
        // won't happen
        continue;
      }
      ArchivePolCriteriaCopy copy = myWrapper.getArchivePolCriteriaCopy();
      ArchiveCopy archiveCopy = myWrapper.getArchiveCopy();
      ArchiveVSNMap vsnMap = archiveCopy.getArchiveVSNMap();

      buf.append("<b>")
          .append(SamUtil.getResourceString("archiving.copynumber", Integer.toString(i + 1)))
          .append(": </b>")
          .append(copy.getArchiveAge())
          .append(" ")
          .append(SamUtil.getTimeUnitL10NString(copy.getArchiveAgeUnit()));

      // Comma and Media Type
      buf.append(", ");

      int mediaType = vsnMap != null ? vsnMap.getArchiveMediaType() : -1;
      String mediaTypeString;
      if (mediaType < 0) {
        mediaTypeString = SamUtil.getResourceString("common.mediatype.unknown");
      } else if (mediaType == BaseDevice.MTYPE_DISK) {
        mediaTypeString = SamUtil.getResourceString("common.mediatype.disk");
      } else {
        mediaTypeString = SamUtil.getMediaTypeString(mediaType);
      }

      buf.append(mediaTypeString);
      if (i % 2 == 1) {
        buf.append("<br>");
      } else {
        buf.append("&nbsp;&nbsp;&nbsp;");
      }
    }
    ((CCStaticTextField) getChild(COPY_INFO)).setValue(buf.toString());
  }