Examples of XSLT


Examples of org.jasig.portal.utils.XSLT

        {
          /*  pw.println("<span class='uportal-crumbtrail'>Rendered at: "
                    + sdf.format(new Date(System.currentTimeMillis()))
                    + "</span>");
                    */
            XSLT xslt = new XSLT(this);
            xslt.setXSL(STYLESHEET_FILE);
           
            File contents = ResourceLoader.getResourceAsFile(
                    this.getClass(), CONTENT_FILE);
            xslt.setXML(contents);
            ByteArrayOutputStream results = new ByteArrayOutputStream();
            xslt.setTarget(results);
           
            xslt.setStylesheetParameter("baseActionUrl", this.runtimeData
                    .getBaseActionURL(true));
            xslt.setStylesheetParameter("baseMediaUrl", mediaBase);
            xslt.setStylesheetParameter("selectedSection", currentSection);
            xslt.transform();
            String html = results.toString();
            pw.print(html);
        } catch (Exception e)
        {
            throw new PortalException("Problem generating content.", e);
View Full Code Here

Examples of org.jasig.portal.utils.XSLT

    public void renderXML (ContentHandler out) throws PortalException
    {
        try
        {
      XSLT xslt = XSLT.getTransformer(this, runtimeData.getLocales());
      ResourceBundle bundle = ResourceBundle.getBundle(bundleBaseLocation+"parameters",
              runtimeData.getLocales()[0]);
      xslt.setResourceBundle(bundle);
      xslt.setXML(getParametersDoc());
      xslt.setXSL(sslLocation, "parameters", runtimeData.getBrowserInfo());
      xslt.setTarget(out);
      xslt.setStylesheetParameter("baseActionURL", runtimeData.getBaseActionURL());
      if (error)
        xslt.setStylesheetParameter("errorMessage", errorMessage);
      xslt.transform();
        }
        catch(Exception e)
        {
            log.error(e, e);
        }
View Full Code Here

Examples of org.jasig.portal.utils.XSLT

      }
    }

    doc.appendChild(appletE);

    XSLT xslt = XSLT.getTransformer(this, runtimeData.getLocales());
    xslt.setXML(doc);
    xslt.setXSL(sslLocation, "main", runtimeData.getBrowserInfo());
    xslt.setTarget(out);
    xslt.transform();
  }
View Full Code Here

Examples of org.jasig.portal.utils.XSLT

                log.error("Failed to write error document XML to logger.", e);
            }
        }

        try {
            XSLT xslt = XSLT.getTransformer(this, this.runtimeData.getLocales());
            xslt.setXML(doc);
            xslt.setXSL(sslLocation, this.ssTitle, this.runtimeData.getBrowserInfo());
            xslt.setTarget(out);
            xslt.setStylesheetParameter("baseActionURL", this.runtimeData.getBaseActionURL());
            xslt.setStylesheetParameter("showStackTrace", String.valueOf(this.showStackTrace));
            xslt.setStylesheetParameter("allowRefresh", Boolean.toString(policy.allowRefresh));
            xslt.setStylesheetParameter("allowReinstantiation", Boolean.toString(policy.allowReinstantiation));
            xslt.transform();
        }
        catch (Exception e) {
            log.error("Things are bad. Error channel threw Exception rendering its stylesheet.", e);
        }
    }
View Full Code Here

Examples of org.jasig.portal.utils.XSLT

     @param  out  stream that handles output
     */
    public void renderXML( ContentHandler out )
        throws PortalException
    {
        XSLT xslt = new XSLT(this);
        xslt.setXML(mDoc);
        xslt.setXSL(XSL_LOCATION);//optionsLabel
        xslt.setTarget(out);
        xslt.transform();
    }
View Full Code Here

Examples of org.jasig.portal.utils.XSLT

        }
        if (!session.view.equals("Select Principals")
                || !session.isAuthorized) {
            long time2 = Calendar.getInstance().getTime().getTime();
            XSLT xslt = XSLT.getTransformer(this, session.runtimeData.getLocales());
            xslt.setXML(PermissionsXML.getViewDoc(session));
            xslt.setTarget(out);
            xslt.setStylesheetParameter("baseActionURL", session.runtimeData.getBaseActionURL());
            xslt.setStylesheetParameter("prmView", session.view);
            if (session.runtimeData.get("commandResponse") != null) {
                xslt.setStylesheetParameter("commandResponse", session.runtimeData.getParameter("commandResponse"));
            }
            xslt.setXSL(sslLocation, "CPermissions", session.runtimeData.getBrowserInfo());
            transform(xslt);
            if (log.isDebugEnabled()) {
                long time3 = Calendar.getInstance().getTime().getTime();
                log.debug("CPermissionsManager timer: "
                        + String.valueOf((time3 - time1)) + " ms total, xsl took "
View Full Code Here

Examples of org.jasig.portal.utils.XSLT

      if (state.person != null)
        state.runtimeData.put("cw_person", state.person);
      if (state.personAllow != null)
        state.runtimeData.put("cw_personAllow", state.personAllow);

      XSLT xslt = XSLT.getTransformer(this, state.runtimeData.getLocales());
      if (tidiedXml != null)
        xslt.setXML(tidiedXml);
      else
        xslt.setXML(xml);
      if (state.xslUri != null && (!state.xslUri.trim().equals("")))
        xslt.setXSL(state.xslUri);
      else
        xslt.setXSL(state.sslUri, state.xslTitle, state.runtimeData.getBrowserInfo());

      // Determine mime type
      MediaManager mm = MEDIAMANAGER;
      String media = mm.getMedia(state.runtimeData.getBrowserInfo());
      String mimeType = mm.getReturnMimeType(media);
      if (MediaManager.UNKNOWN.equals(mimeType)) {
        String accept = state.runtimeData.getBrowserInfo().getHeader("accept");
        if (accept != null && accept.indexOf("text/html") != -1) {
          mimeType = "text/html";
        }
      }


      CWebProxyURLFilter filter2 = CWebProxyURLFilter.newCWebProxyURLFilter(mimeType, state.runtimeData, out);
      if (state.xmlUri != null && state.xmlUri.indexOf("://") != -1) {
        AbsoluteURLFilter filter1 = AbsoluteURLFilter.newAbsoluteURLFilter(mimeType, state.xmlUri, filter2);
        xslt.setTarget(filter1);
      } else {
        xslt.setTarget(filter2);       
      }
     
      xslt.setStylesheetParameters(state.runtimeData);
      xslt.transform();
    }
  }
View Full Code Here

Examples of org.jasig.portal.utils.XSLT

            log.trace("entering renderXML()");
        }
       
        try {
            // Perform the transformation
            XSLT xslt = XSLT.getTransformer(this, this.runtimeData.getLocales());
           
            Document xml = getXml();
           
            if (xml == null) {
                throw new IllegalStateException("The Document we would transform, as returned by getXml(), was illegally null.");
            }
           
            if (log.isTraceEnabled()) {
                log.trace("getXml() returned Document: [" + xml  + "]");
                String xmlAsString = XML.serializeNode(xml);
                log.trace("XML DOM was: [" + xmlAsString + "]");
            }
           
            xslt.setXML(xml);
           
            String xsltUri = getXsltUri();
           
            if (log.isTraceEnabled()) {
                log.trace("getXsltUri() returned: [" + xsltUri + "]");
            }
           
            if (xsltUri == null) {
               
                throw new IllegalStateException("The URI of our XSLT we would use to transform our Document, as returned by getXsltUri(), was illegally null.");
               
                /*
                 * It would probably be a neat feature to detect the case where
                 * getXsltUri() returns null and in that case dump the XML directly to
                 * the ContentHandler, but this is not yet implemented.
                 */
            }
           
            xslt.setXSL(xsltUri);
           
            xslt.setTarget(out);
           
            Map paramsMap = getStylesheetParams();
           
            if (log.isTraceEnabled()) {
                log.trace("getStylesheetParams() returned [" + paramsMap + "]");
            }
           
            if (paramsMap == null) {
                xslt.setStylesheetParameters(new HashMap());
            } else {
                // XSLT requires HashMap or HashTable rather than
                // accepting any Map.
                // We accomodate this by dumping our paramsMap into a
                // HashMap to ensure it is of an acceptable type.
                // Skipping this putAll() where it is unnecessary probably wouldn't
                // result in any worthwhile performance difference.
                HashMap tempHashMap = new HashMap();
                tempHashMap.putAll(paramsMap);
                xslt.setStylesheetParameters(tempHashMap);
            }

            if (log.isTraceEnabled()) {
                log.trace("Configured XSLT as [" + xslt + "]");
            }
               
            xslt.transform();
        } catch (PortalException pe) {
            // we just re-throw PortalExceptions, confident that the
            // channel rendering framework will log and handle them, as
            // defined by the IChannel API we are implementing.
            throw pe;
View Full Code Here

Examples of org.jasig.portal.utils.XSLT

      InputStream xmlStream = null;
    try {
      xmlStream = PortalSessionManager.getResourceAsStream(SKINS_PATH + "/skinList.xml");
      String currentSkin = userPrefs.getThemeStylesheetUserPreferences().getParameterValue("skin");

      XSLT xslt = XSLT.getTransformer(this, runtimeData.getLocales());
      xslt.setXML(xmlStream);
      xslt.setXSL(sslLocation, "skinList", runtimeData.getBrowserInfo());
      xslt.setTarget(out);
      xslt.setStylesheetParameter("skinsPath", SKINS_PATH);
      xslt.setStylesheetParameter("baseActionURL", runtimeData.getBaseActionURL());
      if(currentSkin!=null)
        xslt.setStylesheetParameter("currentSkin", currentSkin);
      xslt.transform();
      } finally {
        try {
          if (xmlStream != null)
            xmlStream.close();
        } catch (IOException exception) {
View Full Code Here

Examples of org.jasig.portal.utils.XSLT

        attributesE.appendChild(attributeE);
    }

    doc.appendChild(attributesE);

    XSLT xslt = XSLT.getTransformer(this, runtimeData.getLocales());
    xslt.setXML(doc);
    xslt.setStylesheetParameter("baseActionURL",runtimeData.getBaseActionURL());
    xslt.setStylesheetParameter("downloadWorkerURL",
                                 runtimeData.getBaseWorkerURL(UPFileSpec.FILE_DOWNLOAD_WORKER,true));
    xslt.setXSL(sslLocation, runtimeData.getBrowserInfo());
    xslt.setTarget(out);
    xslt.transform();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.