Search in sources :

Example 1 with Element

use of org.apache.ecs.Element in project adempiere by adempiere.

the class MobileDoc method createPopup.

//  create
/**
	 *  Create styled popup Document with Title
	 *  @param title header title and h1 
	 *  @return Document
	 */
public static MobileDoc createPopup(String title) {
    MobileDoc doc = create(title);
    doc.getHead().addElement(new link("iui/iui.css", link.REL_STYLESHEET, link.TYPE_CSS));
    doc.getHead().addElement(new script((Element) null, MobileEnv.getBaseDirectory("iui/iui.js")));
    doc.getHead().addElement(new script((Element) null, "js/window.js"));
    doc.getHead().addElement(new link("images/AdempiereButton.png", "apple-touch-icon-precomposed", "image/png"));
    doc.getHead().addElement(new link("images/AdempiereButton.png", "shortcut icon", "image/png"));
    doc.getHead().addElement(new meta().setName("viewport").setContent("width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"));
    return doc;
}
Also used : org.apache.ecs.xhtml.meta(org.apache.ecs.xhtml.meta) Element(org.apache.ecs.Element) org.apache.ecs.xhtml.link(org.apache.ecs.xhtml.link) org.apache.ecs.xhtml.script(org.apache.ecs.xhtml.script)

Example 2 with Element

use of org.apache.ecs.Element in project adempiere by adempiere.

the class MobileDoc method createWindow.

//  createPopup
/**
	 *  Create styled window Document with Title
	 *  @param title header title and h1 
	 *  @return Document
	 */
public static MobileDoc createWindow(String title) {
    MobileDoc doc = create(true, title, false);
    doc.getHead().addElement(new link("iui/iui.css", link.REL_STYLESHEET, link.TYPE_CSS));
    doc.getHead().addElement(new script((Element) null, MobileEnv.getBaseDirectory("iui/iui.js")));
    doc.getHead().addElement(new script((Element) null, "js/window.js"));
    // doc.getHead().addElement(new script((Element)null, "js/calendar-setup.js"));
    doc.getHead().addElement(new script((Element) null, "js/calendar.js"));
    doc.getHead().addElement(new script((Element) null, "lang/calendar-en.js"));
    doc.getHead().addElement(new link("css/calendar-blue.css", link.REL_STYLESHEET, link.TYPE_CSS));
    doc.getHead().addElement(new link("images/AdempiereButton.png", "apple-touch-icon-precomposed", "image/png"));
    doc.getHead().addElement(new link("images/AdempiereButton.png", "shortcut icon", "image/png"));
    doc.getHead().addElement(new meta().setName("viewport").setContent("width=device-width; initial-scale=1.0; minimum-scale=1.0; maximum-scale=1.0; user-scalable=0;"));
    return doc;
}
Also used : org.apache.ecs.xhtml.meta(org.apache.ecs.xhtml.meta) Element(org.apache.ecs.Element) org.apache.ecs.xhtml.link(org.apache.ecs.xhtml.link) org.apache.ecs.xhtml.script(org.apache.ecs.xhtml.script)

Example 3 with Element

use of org.apache.ecs.Element in project adempiere by adempiere.

the class WMenu method createPage.

//  checkLogin
/**
	 * 	Create Menu Page
	 *	@param request request 
	 *	@param wsc context
	 *	@param AD_Role_ID role
	 *	@return document
	 */
private WebDoc createPage(HttpServletRequest request, WebSessionCtx wsc, int AD_Role_ID, int AD_User_ID, int AD_Client_ID, int AD_Org_ID) {
    //	Document
    //Modified by Rob Klein 4/29/07
    //String windowTitle = Msg.getMsg(wsc.ctx, "Menu");
    String windowTitle = "Menu";
    WebDoc doc = WebDoc.create(windowTitle);
    head head = doc.getHead();
    //  Target
    head.addElement(new base().setTarget(WebEnv.TARGET_WINDOW));
    //  Specific Menu Script/Stylesheet
    head.addElement(new link(WebEnv.getBaseDirectory("/css/menu.css"), link.REL_STYLESHEET, link.TYPE_CSS));
    head.addElement(new script((Element) null, WebEnv.getBaseDirectory("/js/menu.js")));
    head.addElement(new script((Element) null, WebEnv.getBaseDirectory("/js/window.js")));
    //Modified by Rob Klein 4/29/07
    //head.addElement(new script((Element)null, WebEnv.getBaseDirectory("/js/mktree.js")));
    //head.addElement(new link(WebEnv.getBaseDirectory("/css/mktree.css"), link.REL_STYLESHEET, link.TYPE_CSS));
    //	Scripts
    String statusMessage = Msg.getMsg(wsc.ctx, "SelectMenuItem");
    String scriptTxt = "top.document.title='" + windowTitle + " - " + wsc.loginInfo + "'; " + "var defaultStatus='" + statusMessage + "';";
    //Rob 12-16-2006 head.addElement(new script(scriptTxt));
    //	Body
    body body = doc.getBody();
    body.setTitle(statusMessage);
    //  Clear Window Frame
    //Rob 12-16-2006 body.addElement(WebUtil.getClearFrame(WebEnv.TARGET_WINDOW));
    //  Header
    table table = doc.getTable();
    doc.setClasses("menuTable", "menuHeader");
    //Rob 12-16-2006 doc.getTopLeft().addElement(new cite(wsc.loginInfo));
    input txtSearch = new input(input.TYPE_TEXT, "txtSearch", "");
    txtSearch.setOnKeyDown("searchMenu('main',this.value,event,'" + WebEnv.TARGET_WINDOW + "')");
    doc.getTopLeft().addElement("Find: ");
    doc.getTopLeft().addElement(txtSearch);
    //  Load Menu Structure     ----------------------
    int AD_Tree_ID = DB.getSQLValue(null, "SELECT COALESCE(r.AD_Tree_Menu_ID, ci.AD_Tree_Menu_ID)" + "FROM AD_ClientInfo ci" + " INNER JOIN AD_Role r ON (ci.AD_Client_ID=r.AD_Client_ID) " + "WHERE AD_Role_ID=?", AD_Role_ID);
    if (AD_Tree_ID <= 0)
        //	Menu
        AD_Tree_ID = 10;
    log.fine("doPost - AD_Tree_ID=" + AD_Tree_ID + " - " + Env.getAD_Language(wsc.ctx));
    // Language set in WLogin
    MTree tree = new MTree(wsc.ctx, AD_Tree_ID, false, false, null);
    //	Trim tree
    MTreeNode root = tree.getRoot();
    Enumeration en = root.preorderEnumeration();
    /*while (en.hasMoreElements())
		{
			MTreeNode nd = (MTreeNode)en.nextElement();
			if (nd.isTask() 
				|| nd.isWorkbench() 
				|| nd.isWorkFlow()
				|| nd.getNode_ID() == 383	//	Reset Cache - kills the server
			)
			{
				MTreeNode parent = (MTreeNode)nd.getParent();
				parent.remove(nd);
			}
		}*/
    tree.trimTree();
    //	Print tree
    StringBuffer buf = new StringBuffer();
    StringBuffer buffav = new StringBuffer();
    en = root.preorderEnumeration();
    int oldLevel = 0;
    while (en.hasMoreElements()) {
        MTreeNode nd = (MTreeNode) en.nextElement();
        //  Level
        //	0 == root
        int level = nd.getLevel();
        if (level == 0)
            continue;
        //
        while (oldLevel < level) {
            if (level == 1)
                //  start first level
                buf.append("<ul class=\"mktree\"  id=\"main\">\n");
            else
                //  start next level
                buf.append("<ul style=\"display:none\">\n");
            oldLevel++;
        }
        while (oldLevel > level) {
            oldLevel--;
            if (oldLevel == 1)
                //  finish last level
                buf.append("</ul>\n");
            else
                //  finish next level
                buf.append("</ul></li>\n");
        }
        //	Print Node
        buf.append(printNode(nd, wsc.ctx));
        //Modified by Rob Klein 4/29/07
        if (nd.isOnBar())
            buffav.append(printNode(nd, wsc.ctx));
    }
    //	Final
    while (oldLevel > 0) {
        oldLevel--;
        if (oldLevel == 1)
            //  finish last level
            buf.append("</ul>\n");
        else
            //  finish next level
            buf.append("</ul></li>\n");
    }
    //Modified by Rob Klein 4/29/07
    //  Set Favorites		
    buf.append("<ul><li class=\"menuSummary\" id=\"218\" onClick=\"changeMenu(event);\">Favorites<ul style=\"display:none\">\n");
    buf.append(buffav);
    buf.append("</ul></li></ul>\n");
    td td = new td().setColSpan(2).setNoWrap(true);
    td.setClass("menuCenter");
    td.addElement(buf.toString());
    table.addElement(new tr().addElement(td));
    //	  Expand/Collapse Info
    td = new td().setColSpan(2);
    td.setClass("menuFooter");
    //	Modified by Rob Klein 4/29/07
    /**td.addElement(new a("javascript:expandTree('main');", "Expand Menu"));
		td.addElement(" | ");		
		td.addElement( new a("javascript:collapseTree('main');", "Contract Menu"));
		table.addElement(new tr().addElement(td));
		**/
    //  Exit Info
    td = new td().setColSpan(2);
    td.setClass("menuFooter");
    String url = request.getRequestURI() + "?Exit=true";
    td.addElement(new a(url, Msg.getMsg(wsc.ctx, "Exit")));
    table.addElement(new tr().addElement(td));
    //	System.out.println(doc);
    return doc;
}
Also used : MTreeNode(org.compiere.model.MTreeNode) org.apache.ecs.xhtml.a(org.apache.ecs.xhtml.a) Enumeration(java.util.Enumeration) Element(org.apache.ecs.Element) org.apache.ecs.xhtml.link(org.apache.ecs.xhtml.link) org.apache.ecs.xhtml.body(org.apache.ecs.xhtml.body) org.apache.ecs.xhtml.script(org.apache.ecs.xhtml.script) MTree(org.compiere.model.MTree) org.apache.ecs.xhtml.head(org.apache.ecs.xhtml.head) org.apache.ecs.xhtml.td(org.apache.ecs.xhtml.td) org.apache.ecs.xhtml.input(org.apache.ecs.xhtml.input) WebDoc(org.compiere.util.WebDoc) org.apache.ecs.xhtml.table(org.apache.ecs.xhtml.table) org.apache.ecs.xhtml.tr(org.apache.ecs.xhtml.tr) org.apache.ecs.xhtml.base(org.apache.ecs.xhtml.base)

Example 4 with Element

use of org.apache.ecs.Element in project adempiere by adempiere.

the class WebDoc method setUp.

/**
	 *  Set up Document
	 *  @param plain if true adds stylesheet and standard js
	 *  @param javaClient true if Java Client - browser otherwise
	 *  @param title header title and h1
	 */
private void setUp(boolean plain, boolean javaClient, String title) {
    m_html.addElement(m_head);
    m_html.addElement(m_body);
    m_body.addElement(new a().setName("top"));
    if (title != null)
        m_head.addElement(new title(title));
    if (plain)
        return;
    //	css, js
    if (javaClient) {
        m_head.addElement(new StoredHtmlSrc("STYLE", "org/compiere/images/standard.css"));
    } else {
        m_head.addElement(new link(WebEnv.getStylesheetURL(), link.REL_STYLESHEET, link.TYPE_CSS));
        m_head.addElement(new script((Element) null, WebEnv.getBaseDirectory("/js/standard.js")));
    }
    m_head.addElement(new meta().setHttpEquiv("Content-Type", "text/html; charset=UTF-8"));
    m_head.addElement(new meta().setName("description", "ADempiere HTML UI"));
    //	spacing 2
    m_table = new table("0", "0", "0", "100%", null);
    m_topRow = new tr();
    //	Title
    //Start Modification Rob
    m_topLeft = new td();
    if (title == null)
        m_topLeft.addElement(NBSP);
    else
        m_topLeft.addElement(new h1(title));
    m_topRow.addElement(m_topLeft);
    //	Logo
    m_topRight = new td().setAlign("right");
    if (javaClient) {
        m_topRight.addElement(new img("res:org/compiere/images/AD10030.png").setAlign(AlignType.RIGHT).setAlt("ADempiere"));
    } else {
        if (title.equals("")) {
            m_topRight.addElement(WebEnv.getLogo());
        } else {
            m_topRight.addElement(new h1(title));
        }
    }
    m_topRow.addElement(m_topRight);
    m_table.addElement(m_topRow);
    //
    m_body.addElement(m_table);
}
Also used : org.apache.ecs.xhtml.td(org.apache.ecs.xhtml.td) org.apache.ecs.xhtml.meta(org.apache.ecs.xhtml.meta) org.apache.ecs.xhtml.a(org.apache.ecs.xhtml.a) org.apache.ecs.xhtml.img(org.apache.ecs.xhtml.img) org.apache.ecs.xhtml.meta(org.apache.ecs.xhtml.meta) Element(org.apache.ecs.Element) org.apache.ecs.xhtml.link(org.apache.ecs.xhtml.link) org.apache.ecs.xhtml.h1(org.apache.ecs.xhtml.h1) org.apache.ecs.xhtml.title(org.apache.ecs.xhtml.title) org.apache.ecs.xhtml.script(org.apache.ecs.xhtml.script) org.apache.ecs.xhtml.table(org.apache.ecs.xhtml.table) org.apache.ecs.xhtml.tr(org.apache.ecs.xhtml.tr)

Example 5 with Element

use of org.apache.ecs.Element in project adempiere by adempiere.

the class WebDoc method createWindow.

//  createPopup
/**
	 *  Create styled window Document with Title
	 *  @param title header title and h1 
	 *  @return Document
	 */
public static WebDoc createWindow(String title) {
    WebDoc doc = create(title);
    doc.getHead().addElement(new script((Element) null, "/adempiere/js/window.js"));
    //doc.getHead().addElement(new script((Element)null, "/adempiere/js/Calendar-setup.js"));
    doc.getHead().addElement(new script((Element) null, "/adempiere/js/calendar.js"));
    doc.getHead().addElement(new script((Element) null, "/adempiere/js/table.js"));
    doc.getHead().addElement(new script((Element) null, "/adempiere/lang/calendar-en.js"));
    doc.getHead().addElement(new link("/adempiere/css/window.css", link.REL_STYLESHEET, link.TYPE_CSS));
    doc.getHead().addElement(new link("/adempiere/css/calendar-blue.css", link.REL_STYLESHEET, link.TYPE_CSS));
    doc.getHead().addElement(new link("/adempiere/css/table.css", link.REL_STYLESHEET, link.TYPE_CSS));
    doc.setClasses("windowTable", "windowHeader");
    doc.getTable().setCellSpacing(0);
    return doc;
}
Also used : Element(org.apache.ecs.Element) org.apache.ecs.xhtml.link(org.apache.ecs.xhtml.link) org.apache.ecs.xhtml.script(org.apache.ecs.xhtml.script)

Aggregations

Element (org.apache.ecs.Element)8 org.apache.ecs.xhtml.script (org.apache.ecs.xhtml.script)7 org.apache.ecs.xhtml.link (org.apache.ecs.xhtml.link)6 org.apache.ecs.xhtml.a (org.apache.ecs.xhtml.a)4 org.apache.ecs.xhtml.meta (org.apache.ecs.xhtml.meta)4 org.apache.ecs.xhtml.input (org.apache.ecs.xhtml.input)3 org.apache.ecs.xhtml.table (org.apache.ecs.xhtml.table)3 org.apache.ecs.xhtml.td (org.apache.ecs.xhtml.td)3 org.apache.ecs.xhtml.tr (org.apache.ecs.xhtml.tr)3 org.apache.ecs.xhtml.div (org.apache.ecs.xhtml.div)2 org.apache.ecs.xhtml.fieldset (org.apache.ecs.xhtml.fieldset)2 org.apache.ecs.xhtml.form (org.apache.ecs.xhtml.form)2 org.apache.ecs.xhtml.h1 (org.apache.ecs.xhtml.h1)2 org.apache.ecs.xhtml.option (org.apache.ecs.xhtml.option)2 Timestamp (java.sql.Timestamp)1 Enumeration (java.util.Enumeration)1 org.apache.ecs.xhtml.b (org.apache.ecs.xhtml.b)1 org.apache.ecs.xhtml.base (org.apache.ecs.xhtml.base)1 org.apache.ecs.xhtml.body (org.apache.ecs.xhtml.body)1 org.apache.ecs.xhtml.font (org.apache.ecs.xhtml.font)1