use of org.compiere.util.HtmlCode in project adempiere by adempiere.
the class ProductCategoryListTag method doStartTag.
/**
* Start Tag
* @return SKIP_BODY
* @throws JspException
*/
public int doStartTag() throws JspException {
Properties ctx = JSPEnv.getCtx((HttpServletRequest) pageContext.getRequest());
int AD_Client_ID = Env.getAD_Client_ID(ctx);
String name = "M_Product_Category_ID";
option[] options = getCategories(AD_Client_ID);
select sel = new select(name, options);
sel.setID("ID_" + name);
log.fine("AD_Client_ID=" + AD_Client_ID + ", #=" + options.length);
// Assemble
HtmlCode html = new HtmlCode();
html.addElement(sel);
JspWriter out = pageContext.getOut();
html.output(out);
//
return (SKIP_BODY);
}
use of org.compiere.util.HtmlCode in project adempiere by adempiere.
the class WorkflowTag method doStartTag.
// setActivityID
/**
* Start Tag
* @return SKIP_BODY
* @throws JspException
*/
public int doStartTag() throws JspException {
Properties ctx = JSPEnv.getCtx((HttpServletRequest) pageContext.getRequest());
// Activity
int AD_WF_Activity_ID = 0;
String info = null;
try {
info = (String) ExpressionUtil.evalNotNull("workflow", "activityID", m_activityID_el, String.class, this, pageContext);
if (info != null && info.length() != 0)
AD_WF_Activity_ID = Integer.parseInt(info);
} catch (Exception e) {
log.severe("doStartTag - Activity" + e);
}
MWFActivity act = new MWFActivity(ctx, AD_WF_Activity_ID, null);
if (AD_WF_Activity_ID == 0 || act == null || act.get_ID() != AD_WF_Activity_ID) {
log.severe("doStartTag - Activity Not found - " + m_activityID_el + " (" + info + ")");
return (SKIP_BODY);
}
String name = null;
if (act.isUserApproval())
name = "IsApproved";
else if (act.isUserManual())
name = "IsConfirmed";
else
return (SKIP_BODY);
// YesNo
option[] yesNoOptions = new option[3];
yesNoOptions[0] = new option(" ");
yesNoOptions[0].addElement(" ");
yesNoOptions[0].setSelected(true);
yesNoOptions[1] = new option("Y");
yesNoOptions[1].addElement(Util.maskHTML(Msg.translate(ctx, "Yes")));
yesNoOptions[2] = new option("N");
yesNoOptions[2].addElement(Util.maskHTML(Msg.translate(ctx, "No")));
select yesNoSelect = new select(name, yesNoOptions);
yesNoSelect.setID("ID_" + name);
yesNoSelect.setClass(C_MANDATORY);
//
String nameTrl = Msg.translate(ctx, name);
// Assemble
HtmlCode html = new HtmlCode();
html.addElement(new b(nameTrl));
html.addElement(yesNoSelect);
html.addElement(new br());
JspWriter out = pageContext.getOut();
html.output(out);
//
return (SKIP_BODY);
}
use of org.compiere.util.HtmlCode in project adempiere by adempiere.
the class InfoLinkTag method doStartTag.
// setOneLine
/**
* Start Tag
* @return SKIP_BODY
* @throws JspException
*/
public int doStartTag() throws JspException {
HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
// creates wsc/wu
Properties ctx = JSPEnv.getCtx(request);
WebSessionCtx wsc = WebSessionCtx.get(request);
//
HttpSession session = pageContext.getSession();
WebUser wu = (WebUser) session.getAttribute(WebUser.NAME);
if (wu != null && wu.isLoggedIn()) {
if (ctx != null) {
WebInfo info = (WebInfo) session.getAttribute(WebInfo.NAME);
if (info == null || wu.getAD_User_ID() != info.getAD_User_ID()) {
info = new WebInfo(ctx, wu);
session.setAttribute(WebInfo.NAME, info);
}
}
//
// log.fine("WebUser exists - " + wu);
//
JspWriter out = pageContext.getOut();
HtmlCode html = new HtmlCode();
//
if (wu.isCustomer() || wu.isVendor())
menuBPartner(html, wsc.wstore);
if (wu.isSalesRep())
menuSalesRep(html, wsc.wstore);
if (wu.isEmployee() || wu.isSalesRep())
menuUser(html, wu.isEmployee(), wsc.wstore);
menuAll(html, wsc.wstore);
//
html.output(out);
} else {
if (CLogMgt.isLevelFiner())
log.fine("No WebUser");
if (session.getAttribute(WebInfo.NAME) == null)
session.setAttribute(WebInfo.NAME, WebInfo.getGeneral());
}
return (SKIP_BODY);
}
use of org.compiere.util.HtmlCode in project adempiere by adempiere.
the class LoginLinkTag method getLoginLink.
// getWebUser
/**************************************************************************
* Get Login Link
* @param serverContext server context
* @return link
*/
private HtmlCode getLoginLink(String serverContext) {
HtmlCode retValue = new HtmlCode();
// Login button
input button = new input(input.TYPE_BUTTON, "Login", "Login");
button.setOnClick("window.top.location.replace('./loginServlet');");
retValue.addElement(button);
/** Link
a a = new a("https://" + serverContext + "/login.jsp");
a.setClass("menuMain");
a.addElement("Login");
retValue.addElement(a);
**/
retValue.addElement(" ");
return retValue;
}
Aggregations