Package de.hybris.yfaces

Examples of de.hybris.yfaces.YFacesException


    // standard lookup
    if (this.value == null && this.id != null) {
      YComponentInfo cmpd = YComponentRegistry.getInstance().getComponent(this.id);

      if (cmpd == null) {
        throw new YFacesException("There is no component with id '" + this.id
            + "' registered.");
      }

      this.value = (T) cmpd.createDefaultComponent();
      ((AbstractYComponent) value).setFrame(this.frameBinding);
View Full Code Here


  public void propertyChange(PropertyChangeEvent evt) {
    Method method = this.descriptor.getMethod();
    try {
      method.invoke(listener, evt.getOldValue(), evt.getNewValue());
    } catch (Exception e) {
      throw new YFacesException("Can't reach eventlistener " + listener.getClass().getName()
          + " (" + method.getName() + ")", e);
    }
  }
View Full Code Here

    private Method getMethod() {
      if (this.method == null) {
        Method[] methods = this.delegateToDefinition.getMethods();
        if (methods.length > 1) {
          throw new YFacesException("Ambigious number of methods");
        }
        this.method = methods[0];
      }
      return this.method;
    }
View Full Code Here

   * @param url
   *            url of page
   */
  public YPageContext(YConversationContext ctx, String pageId, String url) {
    if (ctx == null) {
      throw new YFacesException("No NavigationContext specified", new NullPointerException());
    }

    this.pageId = pageId;
    this.conversationCtx = ctx;
    this.url = url;
View Full Code Here

   */
  void backward(YPageContext page) {

    // availability check
    if (!this.contextPages.containsKey(page.getId())) {
      throw new YFacesException("Can't navigate to page " + page.getId() + " (not found)");
    }

    if (log.isDebugEnabled()) {
      log.debug("Navigating to already existing page (" + page.getId() + ")");
    }
View Full Code Here

    // as current page
    if (previousPage != null && !previousPage.equals(currentPage)) {
      String msg = "Can't add page (" + page.getId() + ") as previous page ("
          + previousPage.getId() + ") is not compatible with current page ("
          + currentPage.getId() + ")";
      throw new YFacesException(msg);
    }

    // set current page as previous page of added page
    page.setPreviousPage(currentPage);
View Full Code Here

    Class<T> clazz = (Class) template.getClass();
    try {
      Constructor<T> c = clazz.getConstructor(YComponent.class);
      result = c.newInstance(template);
    } catch (final Exception e) {
      throw new YFacesException(clazz
          + " can't be created; missing Constructor which accepts " + YComponent.class);
    }
    return result;
  }
View Full Code Here

    T result = null;
    try {
      result = (T) this.getImplementationClass().newInstance();
      ((AbstractYComponent) result).setId(this.id);
    } catch (Exception e) {
      throw new YFacesException("Can't create " + YComponent.class.getName() + " instance ("
          + implClass + ")", e);
    }
    return result;
  }
View Full Code Here

      this.errors.remove(catchError);
    } catch (final Exception e) {
      if (catchError != null) {
        this.errors.add(catchError);
      } else {
        throw new YFacesException("Can't load class " + classname, e);
      }
    }
    return result;
  }
View Full Code Here

   * @param isFlash
   *            true when flash shall be enabled
   */
  public void redirect(String url, boolean enableFlashback) {
    if (url == null) {
      throw new YFacesException("No URL specified", new NullPointerException());
    }

    final FacesContext fctx = FacesContext.getCurrentInstance();
    final ExternalContext ectx = fctx.getExternalContext();

    // when url is not absolute...
    if (!url.startsWith("http")) {
      // spec. accepts absolute as well as relative url
      // relative path without leading slash is interpreted relatively to
      // current request URI
      // relative path with leading slash is interpreted relatively to
      // context root

      // but here a leading slash is interpreted relatively to
      // webapplication root
      if (url.startsWith("/")) {
        url = ectx.getRequestContextPath() + url;
      }
    }
    log.info("Redirecting to " + url);

    try {
      ectx.redirect(ectx.encodeResourceURL(url));
      fctx.responseComplete();

    } catch (IOException e) {
      throw new YFacesException("Can't redirect to " + url, e);
    }
    //this.setFlash(isFlash);
    if (enableFlashback) {
      FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put(
          IS_FLASHBACK, Boolean.TRUE);
View Full Code Here

TOP

Related Classes of de.hybris.yfaces.YFacesException

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.