Package org.openhab.ui.webapp.render

Examples of org.openhab.ui.webapp.render.RenderException


          snippetCache.put(elementType, snippet);
        } catch (IOException e) {
          logger.warn("Cannot load snippet for element type '{}'", elementType, e);
        }
      } else {
        throw new RenderException("Cannot find a snippet for element type '" + elementType + "'");
      }
    }
    return snippet;
  }
View Full Code Here


    StringBuilder result = new StringBuilder();
   
    Sitemap sitemap = sitemapProvider.getSitemap(sitemapName);
    try {
      if(sitemap==null) {
        throw new RenderException("Sitemap '" + sitemapName + "' could not be found");
      }
      logger.debug("reading sitemap {}", sitemap.getName());
      if(widgetId==null || widgetId.isEmpty() || widgetId.equals("Home")) {
        // we are at the homepage, so we render the children of the sitemap root node
        String label = sitemap.getLabel()!=null ? sitemap.getLabel() : sitemapName;
        EList<Widget> children = sitemap.getChildren();
        if(poll && waitForChanges(children)==false) {
          // we have reached the timeout, so we do not return any content as nothing has changed
          res.getWriter().append(getTimeoutResponse()).close();
          return;
        }
        result.append(renderer.processPage("Home", sitemapName, label, sitemap.getChildren(), async));
      } else if(!widgetId.equals("Colorpicker")) {
        // we are on some subpage, so we have to render the children of the widget that has been selected
        Widget w = renderer.getItemUIRegistry().getWidget(sitemap, widgetId);
        if(w!=null) {
          if(!(w instanceof LinkableWidget)) {
            throw new RenderException("Widget '" + w + "' can not have any content");
          }
          EList<Widget> children = renderer.getItemUIRegistry().getChildren((LinkableWidget) w);
          if(poll && waitForChanges(children)==false) {
            // we have reached the timeout, so we do not return any content as nothing has changed
            res.getWriter().append(getTimeoutResponse()).close();
View Full Code Here

TOP

Related Classes of org.openhab.ui.webapp.render.RenderException

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.