Search in sources :

Example 86 with ResponseWriter

use of javax.faces.context.ResponseWriter in project muikku by otavanopisto.

the class WidgetSpaceComponent method encodeEnd.

@Override
public void encodeEnd(FacesContext context) throws IOException {
    if (getKeepEmpty() || (!isEmpty())) {
        ResponseWriter writer = context.getResponseWriter();
        writer.write("</div>");
    }
}
Also used : ResponseWriter(javax.faces.context.ResponseWriter)

Example 87 with ResponseWriter

use of javax.faces.context.ResponseWriter in project muikku by otavanopisto.

the class WidgetSpaceSetComponent method encodeEnd.

@Override
public void encodeEnd(FacesContext context) throws IOException {
    ResponseWriter writer = context.getResponseWriter();
    writer.endElement("div");
    super.encodeEnd(context);
}
Also used : ResponseWriter(javax.faces.context.ResponseWriter)

Example 88 with ResponseWriter

use of javax.faces.context.ResponseWriter in project deltaspike by apache.

the class WindowIdHtmlRenderer method encodeBegin.

/**
 * 'deltaspikeJsWindowId' will be used to:
 * Write a simple hidden field into the form.
 * This might change in the future...
 * @param context
 * @param component
 * @throws IOException
 */
@Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
    super.encodeBegin(context, component);
    lazyInit();
    ClientWindowConfig.ClientWindowRenderMode clientWindowRenderMode = clientWindowConfig.getClientWindowRenderMode(context);
    // see DELTASPIKE-1113
    boolean delegatedWindowMode = ClientWindowConfig.ClientWindowRenderMode.DELEGATED.equals(clientWindowRenderMode);
    if (delegatedWindowMode) {
        return;
    }
    String windowId = clientWindow.getWindowId(context);
    // just to get sure if a user provides a own client window
    windowId = secureWindowId(windowId);
    ResponseWriter writer = context.getResponseWriter();
    writer.write("<script type=\"text/javascript\">");
    writer.write("(function(){");
    writer.write("dswh.init('");
    writer.writeText(windowId, null);
    writer.write("','" + clientWindowRenderMode.name() + "'," + maxWindowIdLength + ",{");
    writer.write("'tokenizedRedirect':" + clientWindowConfig.isClientWindowTokenizedRedirectEnabled());
    writer.write(",'storeWindowTreeOnLinkClick':" + clientWindowConfig.isClientWindowStoreWindowTreeEnabledOnLinkClick());
    writer.write(",'storeWindowTreeOnButtonClick':" + clientWindowConfig.isClientWindowStoreWindowTreeEnabledOnButtonClick());
    // see #729
    if (clientWindow.isInitialRedirectSupported(context)) {
        Object cookie = ClientWindowHelper.getRequestWindowIdCookie(context, windowId);
        if (cookie != null && cookie instanceof Cookie) {
            Cookie servletCookie = (Cookie) cookie;
            writer.write(",'initialRedirectWindowId':'" + secureWindowId(servletCookie.getValue()) + "'");
            // expire/remove cookie
            servletCookie.setMaxAge(0);
            ((HttpServletResponse) context.getExternalContext().getResponse()).addCookie(servletCookie);
        }
    }
    writer.write("});");
    writer.write("})();");
    writer.write("</script>");
}
Also used : Cookie(javax.servlet.http.Cookie) ResponseWriter(javax.faces.context.ResponseWriter) ClientWindowConfig(org.apache.deltaspike.jsf.spi.scope.window.ClientWindowConfig) HttpServletResponse(javax.servlet.http.HttpServletResponse)

Aggregations

ResponseWriter (javax.faces.context.ResponseWriter)88 Map (java.util.Map)16 UIComponent (javax.faces.component.UIComponent)14 FacesContext (javax.faces.context.FacesContext)14 NodeRef (org.alfresco.service.cmr.repository.NodeRef)13 ResourceBundle (java.util.ResourceBundle)10 NodeService (org.alfresco.service.cmr.repository.NodeService)10 Iterator (java.util.Iterator)9 IOException (java.io.IOException)7 HashMap (java.util.HashMap)7 List (java.util.List)7 TreeNode (org.alfresco.web.ui.repo.component.UITree.TreeNode)7 ArrayList (java.util.ArrayList)6 Collection (java.util.Collection)5 UserTransaction (javax.transaction.UserTransaction)5 UIModeList (org.alfresco.web.ui.common.component.UIModeList)5 Serializable (java.io.Serializable)4 Node (org.alfresco.web.bean.repository.Node)4 QuickSort (org.alfresco.web.data.QuickSort)3 UIListItem (org.alfresco.web.ui.common.component.UIListItem)3