예제 #1
0
  /**
   * Call {@link ViewDeclarationLanguage#renderView(javax.faces.context.FacesContext,
   * javax.faces.component.UIViewRoot)} if the view can be rendered.
   *
   * @see ViewHandler#renderView(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot)
   */
  public void renderView(FacesContext context, UIViewRoot viewToRender)
      throws IOException, FacesException {

    Util.notNull("context", context);
    Util.notNull("viewToRender", viewToRender);

    vdlFactory
        .getViewDeclarationLanguage(viewToRender.getViewId())
        .renderView(context, viewToRender);
  }
예제 #2
0
  @Override
  public void applyNextHandler(FaceletContext ctx, UIComponent c)
      throws IOException, FacesException, ELException {

    // attributes need to be applied before any action is taken on
    // nested children handlers or the composite component handlers
    // as there may be an expression evaluated at tree creation time
    // that needs access to these attributes
    setAttributes(ctx, c);

    // Allow any nested elements that reside inside the markup element
    // for this tag to get applied
    super.applyNextHandler(ctx, c);

    // Apply the facelet for this composite component
    applyCompositeComponent(ctx, c);

    // Allow any PDL declared attached objects to be retargeted
    if (ComponentHandler.isNew(c)) {
      FacesContext context = ctx.getFacesContext();
      String viewId = context.getViewRoot().getViewId();
      // PENDING(rlubke): performance
      ViewDeclarationLanguageFactory factory =
          (ViewDeclarationLanguageFactory)
              FactoryFinder.getFactory(FactoryFinder.VIEW_DECLARATION_LANGUAGE_FACTORY);

      ViewDeclarationLanguage vdl = factory.getViewDeclarationLanguage(viewId);
      vdl.retargetAttachedObjects(context, c, getAttachedObjectHandlers(c, false));
      vdl.retargetMethodExpressions(context, c);

      // RELEASE_PENDING This is *ugly*.  See my comments in
      // ComponentTagHandlerDelegateImpl at the end of the apply()
      // method
      if (StateContext.getStateContext(context).partialStateSaving(context, viewId)) {
        markInitialState(c);
      }
    }
  }
예제 #3
0
  /** @see ViewHandler#getViewDeclarationLanguage(javax.faces.context.FacesContext, String) */
  @Override
  public ViewDeclarationLanguage getViewDeclarationLanguage(FacesContext context, String viewId) {

    String actualViewId = derivePhysicalViewId(context, viewId, false);
    return vdlFactory.getViewDeclarationLanguage(actualViewId);
  }
예제 #4
0
  /**
   * Derive the actual view ID (i.e. the physical resource) and call call {@link
   * ViewDeclarationLanguage#createView(javax.faces.context.FacesContext, String)}.
   *
   * @see ViewHandler#restoreView(javax.faces.context.FacesContext, String)
   */
  public UIViewRoot createView(FacesContext context, String viewId) {

    Util.notNull("context", context);
    String actualViewId = derivePhysicalViewId(context, viewId, false);
    return vdlFactory.getViewDeclarationLanguage(actualViewId).createView(context, actualViewId);
  }