Ejemplo n.º 1
0
  public Target(SourceBean sb) {
    documentLabel = (String) sb.getAttribute(WhatIfXMLTemplateParser.TAG_TG_DOCUMENT_LABEL);
    customizedView = (String) sb.getAttribute(WhatIfXMLTemplateParser.TAG_TG_CUSTOMIZED_VIEW);
    List list = sb.getAttributeAsList(WhatIfXMLTemplateParser.TAG_TG_TITLE);
    targetCross = (String) sb.getAttribute(WhatIfXMLTemplateParser.TAG_TG_TARGET);
    Object titleObject = list.get(0);
    if (titleObject instanceof String) {
      titleCross = (String) list.get(0);
    } else {
      titleCross = ((SourceBean) list.get(0)).getCharacters();
    }

    if (customizedView != null && customizedView.trim().equals("")) {
      customizedView = null;
    }
    SourceBean descrSB = (SourceBean) sb.getAttribute(WhatIfXMLTemplateParser.TAG_CN_DESCRIPTION);
    description = descrSB.getCharacters();
    SourceBean titleSB = (SourceBean) list.get(1);
    title = titleSB.getCharacters();
    List parametersSB = sb.getAttributeAsList(WhatIfXMLTemplateParser.TAG_TN_PARAMETERS);
    List parameterSB =
        ((SourceBean) parametersSB.get(0))
            .getAttributeAsList(WhatIfXMLTemplateParser.TAG_TN_PARAMETER);
    boolean hasParameters = parameterSB != null && !parameterSB.isEmpty();
    parameters = new ArrayList<TargetParameter>();
    if (hasParameters) {
      for (int i = 0; i < parameterSB.size(); i++) {
        SourceBean temp = (SourceBean) parameterSB.get(i);
        TargetParameter aParameter = new TargetParameter(temp);
        if (aParameter != null) {
          parameters.add(aParameter);
        }
      }
    }
  }
 public void getFooter() throws Exception {
   String footer = (String) template.getCharacters(MobileConstants.FOOTER);
   if (footer != null) {
     //			Map<String, String> params = getNotNullPrameters();
     //			if(params!=null){
     //				footer= StringUtilities.substituteParametersInString(footer,params , null, false);
     //			}
   }
   documentProperties.put("footer", footer);
 }
Ejemplo n.º 3
0
  /**
   * Get a new ticket.
   *
   * @param session HttpSession
   * @return String
   * @throws IOException Signals that an I/O exception has occurred.
   */
  public String readTicket(HttpSession session) throws IOException {
    logger.debug("IN");
    String ticket = null;
    String spagoBiServerURL = EnginConf.getInstance().getSpagoBiServerUrl();
    logger.debug("Read spagoBiServerURL=" + spagoBiServerURL);
    SourceBean engineConfig = EnginConf.getInstance().getConfig();
    SourceBean sourceBeanConf = (SourceBean) engineConfig.getAttribute("FILTER_RECEIPT");
    String filterReceipt = (String) sourceBeanConf.getCharacters();
    logger.debug("Read filterReceipt=" + filterReceipt);
    filterReceipt = spagoBiServerURL + filterReceipt;

    Assertion assertion = (Assertion) session.getAttribute(AbstractCasFilter.CONST_CAS_ASSERTION);
    ticket = assertion.getPrincipal().getProxyTicketFor(filterReceipt);

    logger.debug("OUT.ticket=" + ticket);
    return ticket;
  }