Package org.jasig.portal

Examples of org.jasig.portal.ResourceMissingException


        xslt.setTarget(out);
        xslt.setStylesheetParameters(params);
        xslt.transform();
      }
      else {
          throw  new ResourceMissingException("", "stylesheet", "Unable to find stylesheet to display content for this media");
      }
    }
View Full Code Here


        xslt.setXSL(this.getClass().getResource(xslURI).toString());
        xslt.setTarget(out);
        xslt.setStylesheetParameter("baseActionURL", runtimeData.getBaseActionURL());
        xslt.transform();
      } else {
          throw  new ResourceMissingException("", "stylesheet", "Unable to find stylesheet to display content for this media");
      }
    }
View Full Code Here

          tsList = context.getUserLayoutStore().getThemeStylesheetList(profile.getStructureStylesheetId());
        } catch (Exception e) {
          throw new PortalException(e);
        }
        if (tsList == null) {
            throw  new ResourceMissingException("", "List of theme stylesheets for the structure stylesheet \"" + profile.getStructureStylesheetId()+ "\"", "Unable to obtain a list of theme stylesheets for the specified structure stylesheet");
        }

        // see if the current Theme stylesheet is still in the list, otherwise assign a first one in the hastable
        if (tsList.get(new Integer(profile.getThemeStylesheetId())) == null) {
          if (!tsList.isEmpty()) {
            Enumeration e = tsList.keys();
            profile.setThemeStylesheetId(((Integer)e.nextElement()).intValue());
          }
          else {
          //                        profile.setThemeStylesheetId(-1);
          }
        }

        for (Enumeration me = tsList.keys(); me.hasMoreElements();) {
          Integer ssId = (Integer)me.nextElement();
          // check if the stylesheet is current
          boolean current = (ssId.intValue() == profile.getThemeStylesheetId());
          Element altEl;
          if (current) {
              altEl = doc.createElement("current");
          } else {
              altEl = doc.createElement("alternate");
          }

          ThemeStylesheetDescription tsd = (ThemeStylesheetDescription)tsList.get(ssId);
          Element altnEl = doc.createElement("name");
          altnEl.appendChild(doc.createTextNode(tsd.getStylesheetName()));
          Element altidEl = doc.createElement("id");
          altidEl.appendChild(doc.createTextNode(Integer.toString(tsd.getId())));
          Element altdEl = doc.createElement("description");
          altdEl.appendChild(doc.createTextNode(tsd.getStylesheetWordDescription()));
          Element altmEl = doc.createElement("mimetype");
          altmEl.appendChild(doc.createTextNode(tsd.getMimeType()));
          // determine device icon
          String deviceIconURI;
          if ((deviceIconURI = mimeImagesProps.getProperty(tsd.getDeviceType())) == null) {
              deviceIconURI = mimeImagesProps.getProperty("unknown");
          }
          Element altdiuEl = doc.createElement("deviceiconuri");
          altdiuEl.appendChild(doc.createTextNode(deviceIconURI));
          Element altsuEl = doc.createElement("sampleuri");
          if (tsd.getSamplePictureURI() == null || tsd.getSamplePictureURI().equals("")) {
              altsuEl.appendChild(doc.createTextNode(""));
          } else {
              altsuEl.appendChild(doc.createTextNode(tsd.getSamplePictureURI()));
          }

          Element altsiuEl = doc.createElement("sampleiconuri");
          if (tsd.getSampleIconURI() == null || tsd.getSampleIconURI().equals("")) {
              altsiuEl.appendChild(doc.createTextNode(""));
          } else {
              altsiuEl.appendChild(doc.createTextNode(tsd.getSampleIconURI()));
          }

          altEl.appendChild(altnEl);
          altEl.appendChild(altidEl);
          altEl.appendChild(altdEl);
          altEl.appendChild(altmEl);
          altEl.appendChild(altdiuEl);
          altEl.appendChild(altsuEl);
          altEl.appendChild(altsiuEl);
          themeEl.appendChild(altEl);
        }
        profileEl.appendChild(themeEl);
      }
      doc.appendChild(profileEl);
      // debug printout of the prepared xml
      if (log.isDebugEnabled()) {
      try {
          StringWriter outString = new StringWriter();
                    /*
                     * This should be reviewed at some point to see if we can
                     * use the DOM3 LS capability and hence a standard way of
                     * doing this rather than using an internal implementation
                     * class.
           */
          OutputFormat format = new OutputFormat();
          format.setOmitXMLDeclaration(true);
          format.setIndenting(true);
                    XMLSerializer serializer = new XMLSerializer(outString,
                            format);
                    serializer.serialize(doc);
                    log.debug(outString.toString());
      } catch (Exception e) {
                    log.debug(e, e);
      }
      }
      // end debug block
     
      StylesheetSet set = context.getStylesheetSet();
      if (set == null)
        throw  new GeneralRenderingException("Unable to determine the stylesheet list");
      String xslURI = set.getStylesheetURI("editProfile", runtimeData.getBrowserInfo());
      if (xslURI != null) {

        ResourceBundle l18n = ResourceBundle.getBundle(bundleLocation,runtimeData.getLocales()[0]);
       
        //Now perform the transformation
        XSLT xslt = XSLT.getTransformer(this, runtimeData.getLocales());
        xslt.setResourceBundle(l18n);

        xslt.setXML(doc);
        xslt.setXSL(this.getClass().getResource(xslURI).toString());
        xslt.setTarget(out);
        xslt.setStylesheetParameter("baseActionURL", runtimeData.getBaseActionURL());
        xslt.transform();
      } else {
          throw  new ResourceMissingException("", "stylesheet", "Unable to find stylesheet to display content for this media");
      }
    }
View Full Code Here

        xslt.setXSL(this.getClass().getResource(xslURI).toString());
        xslt.setTarget(out);
        xslt.setStylesheetParameter("baseActionURL", runtimeData.getBaseActionURL());
        xslt.transform();
      } else {
          throw  new ResourceMissingException("", "stylesheet", "Unable to find stylesheet to display content for this media");
      }
    }
View Full Code Here

       if (! (t instanceof ResourceMissingException))
           throw new IllegalArgumentException("Can only translate ResourceMissingExceptions.");
       if (parentDoc == null)
           throw new IllegalArgumentException("Must have non-null parent doc.");
      
       ResourceMissingException rme = (ResourceMissingException) t;
      
       // use basic ThrowableToElement to boostrap a basic Element.
       Element element = this.throwableToElement.throwableToElement(t, parentDoc);
       element.setAttribute("renderedAs", ResourceMissingException.class.getName());
      
       Element resourceEl = parentDoc.createElement("resource");
       Element uriEl = parentDoc.createElement("uri");
       uriEl.appendChild(parentDoc.createTextNode(rme.getResourceURI()));
       resourceEl.appendChild(uriEl);
       Element descriptionEl = parentDoc.createElement("description");
       descriptionEl.appendChild(parentDoc.createTextNode(rme.getResourceDescription()));
       resourceEl.appendChild(descriptionEl);
       element.appendChild(resourceEl);
      
       return element;
    }
View Full Code Here

        xslt.setTarget(out);
        xslt.setStylesheetParameters(params);
        xslt.transform();
      }
      else {
          throw  new ResourceMissingException("", "stylesheet", "Unable to find stylesheet to display content for this media");
      }
    }
View Full Code Here

        xslt.setTarget(out);
        xslt.setStylesheetParameter("baseActionURL", runtimeData.getBaseActionURL());
        xslt.transform();
      }
      else
        throw  new ResourceMissingException("", "stylesheet", "Unable to find stylesheet to display content for this media");
    }
View Full Code Here

    // Should obtain implementation in a different way!!
    if (ulsdb == null) {
      ulsdb = UserLayoutStoreFactory.getUserLayoutStoreImpl();
    }
    if (ulsdb == null) {
      throw  new ResourceMissingException("", "User Layout database", "Unable to obtain the list of user profiles, since the user preference database is currently down");
    }
    return  ulsdb;
  }
View Full Code Here

        xslt.setXSL(this.getClass().getResource(xslURI).toString());
        xslt.setTarget(out);
        xslt.setStylesheetParameters(params);
        xslt.transform();
      } else {
          throw  new ResourceMissingException("", "stylesheet", "Unable to find stylesheet to display content for this media");
      }
    }
  }
View Full Code Here

          tsList = context.getUserLayoutStore().getThemeStylesheetList(profile.getStructureStylesheetId());
        } catch (Exception e) {
          throw new PortalException(e);
        }
        if (tsList == null) {
            throw  new ResourceMissingException("", "List of theme stylesheets for the structure stylesheet \"" + profile.getStructureStylesheetId()+ "\"", "Unable to obtain a list of theme stylesheets for the specified structure stylesheet");
        }

        // see if the current Theme stylesheet is still in the list, otherwise assign a first one in the hastable
        if (tsList.get(new Integer(profile.getThemeStylesheetId())) == null) {
          if (!tsList.isEmpty()) {
            Enumeration e = tsList.keys();
            profile.setThemeStylesheetId(((Integer)e.nextElement()).intValue());
          }
          else {
          //                        profile.setThemeStylesheetId(-1);
          }
        }

        for (Enumeration me = tsList.keys(); me.hasMoreElements();) {
          Integer ssId = (Integer)me.nextElement();
          // check if the stylesheet is current
          boolean current = (ssId.intValue() == profile.getThemeStylesheetId());
          Element altEl;
          if (current) {
              altEl = doc.createElement("current");
          } else {
              altEl = doc.createElement("alternate");
          }

          ThemeStylesheetDescription tsd = (ThemeStylesheetDescription)tsList.get(ssId);
          Element altnEl = doc.createElement("name");
          altnEl.appendChild(doc.createTextNode(tsd.getStylesheetName()));
          Element altidEl = doc.createElement("id");
          altidEl.appendChild(doc.createTextNode(Integer.toString(tsd.getId())));
          Element altdEl = doc.createElement("description");
          altdEl.appendChild(doc.createTextNode(tsd.getStylesheetWordDescription()));
          Element altmEl = doc.createElement("mimetype");
          altmEl.appendChild(doc.createTextNode(tsd.getMimeType()));
          // determine device icon
          String deviceIconURI;
          if ((deviceIconURI = mimeImagesProps.getProperty(tsd.getDeviceType())) == null) {
              deviceIconURI = mimeImagesProps.getProperty("unknown");
          }
          Element altdiuEl = doc.createElement("deviceiconuri");
          altdiuEl.appendChild(doc.createTextNode(deviceIconURI));
          Element altsuEl = doc.createElement("sampleuri");
          if (tsd.getSamplePictureURI() == null || tsd.getSamplePictureURI().equals("")) {
              altsuEl.appendChild(doc.createTextNode(""));
          } else {
              altsuEl.appendChild(doc.createTextNode(tsd.getSamplePictureURI()));
          }

          Element altsiuEl = doc.createElement("sampleiconuri");
          if (tsd.getSampleIconURI() == null || tsd.getSampleIconURI().equals("")) {
              altsiuEl.appendChild(doc.createTextNode(""));
          } else {
              altsiuEl.appendChild(doc.createTextNode(tsd.getSampleIconURI()));
          }

          altEl.appendChild(altnEl);
          altEl.appendChild(altidEl);
          altEl.appendChild(altdEl);
          altEl.appendChild(altmEl);
          altEl.appendChild(altdiuEl);
          altEl.appendChild(altsuEl);
          altEl.appendChild(altsiuEl);
          themeEl.appendChild(altEl);
        }
        profileEl.appendChild(themeEl);
      }
      doc.appendChild(profileEl);
     
      // debug printout of the prepared xml
      if (log.isDebugEnabled()) {
                try {
                    StringWriter outString = new StringWriter();
                    /*
                     * This should be reviewed at some point to see if we can
                     * use the DOM3 LS capability and hence a standard way of
                     * doing this rather than using an internal implementation
                     * class.
                     */
                    OutputFormat format = new OutputFormat();
                    format.setOmitXMLDeclaration(true);
                    format.setIndenting(true);
                    XMLSerializer serializer = new XMLSerializer(outString,
                            format);
                    serializer.serialize(doc);
                    log.debug(outString.toString());
                } catch (Exception e) {
                    log.debug(e, e);
                }
      }
      // end debug block
     
      StylesheetSet set = context.getStylesheetSet();
      if (set == null)
        throw  new GeneralRenderingException("Unable to determine the stylesheet list");
      String xslURI = set.getStylesheetURI("editProfile", runtimeData.getBrowserInfo());
      if (xslURI != null) {
        XSLT xslt = XSLT.getTransformer(this, runtimeData.getLocales());
        xslt.setXML(doc);
        xslt.setXSL(this.getClass().getResource(xslURI).toString());
        xslt.setTarget(out);
        xslt.setStylesheetParameter("baseActionURL", runtimeData.getBaseActionURL());
        xslt.transform();
      } else {
          throw  new ResourceMissingException("", "stylesheet", "Unable to find stylesheet to display content for this media");
      }
    }
View Full Code Here

TOP

Related Classes of org.jasig.portal.ResourceMissingException

Copyright © 2018 www.massapicom. 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.