Package org.apache.empire.struts2.websample.web

Examples of org.apache.empire.struts2.websample.web.SampleContext


                EmpireThreadManager.setCurrentRequest( reqObj );
                // Call init() if Request Object implements IWebRequest
                if (reqObj instanceof WebRequest)
                {
                  RequestContext req = new PortletRequestWrapper(request);
                  ResponseContext res = new PortletResponseWrapper(response);
                    return ((WebRequest)reqObj).init( req, res, sessObj );
                }
                else if (logRequestWarning)
                {
                    log.warn("Request object does not implement IWebRequest!");
View Full Code Here


                Object session = createObject(sessionClassName);
                portletSession = request.getPortletSession(true);
                // Call init() if Session Object implements IWebSession
                if (session instanceof WebSession)
                {
                    ((WebSession)session).init( new PortletSessionWrapper(portletSession), applObj );
                }
                else
                    log.warn("Session object does not implement IWebSession!");
                // Save Session
                portletSession.setAttribute( WebSession.SESSION_NAME , session);
View Full Code Here

            if (servletContext.getAttribute( WebApplication.APPLICATION_NAME )==null)
            {
                Object app = createObject( appClassName );
                if (app instanceof WebApplication)
                {
                    ((WebApplication)app).init( new ServletContextWrapper( servletContext ));
                }
                else
                    log.warn("Application object does not implement IWebApplication!");
                // Store it
                servletContext.setAttribute( WebApplication.APPLICATION_NAME, app);
View Full Code Here

                // Store Request in Thread Local variable
                EmpireThreadManager.setCurrentRequest( reqObj );
                // Call init() if Request Object implements IWebRequest
                if (reqObj instanceof WebRequest)
                {
                  RequestContext req = new ServletRequestWrapper(request);
                  ResponseContext res = new ServletResponseWrapper(response);
                    return ((WebRequest)reqObj).init( req, res, sessObj );
                }
                else if (logRequestWarning)
                {
View Full Code Here

                EmpireThreadManager.setCurrentRequest( reqObj );
                // Call init() if Request Object implements IWebRequest
                if (reqObj instanceof WebRequest)
                {
                  RequestContext req = new ServletRequestWrapper(request);
                  ResponseContext res = new ServletResponseWrapper(response);
                    return ((WebRequest)reqObj).init( req, res, sessObj );
                }
                else if (logRequestWarning)
                {
                    log.warn("Request object does not implement IWebRequest!");
View Full Code Here

                Object session = createObject(sessionClassName);
                httpSession = request.getSession(true);
                // Call init() if Session Object implements IWebSession
                if (session instanceof WebSession)
                {
                    ((WebSession)session).init( new ServletSessionWrapper(httpSession), applObj );
                }
                else
                    log.warn("Session object does not implement IWebSession!");
                // Save Session
                httpSession.setAttribute( WebSession.SESSION_NAME , session);
View Full Code Here

    // ------- Action Construction -------
   
    public EmployeeListAction()
    {
        SampleDB db = getDatabase();
        C_FULL_NAME = db.T_EMPLOYEES.C_LASTNAME.append(", ").append(db.T_EMPLOYEES.C_FIRSTNAME).as("NAME");
        C_DEPARTMENT = db.T_DEPARTMENTS.C_NAME.as("DEPARTMENT");
       
        // Set Title (optional)
        C_FULL_NAME .setTitle("!label.name");
View Full Code Here

   
    public Options getDepartments()
    {
        if (departments==null)
        {
            SampleDB db = getDatabase();
            DBCommand cmd = db.createCommand();
            cmd.select(db.T_DEPARTMENTS.C_DEPARTMENT_ID);
            cmd.select(db.T_DEPARTMENTS.C_NAME);
            cmd.orderBy(db.T_DEPARTMENTS.C_NAME.asc());
            departments = db.queryOptionList(cmd, getConnection());
        }
        return departments;
    }
View Full Code Here

        return doList();
    }

    public String doList()
    {
        SampleDB db = getDatabase();
        SampleDB.Employees EMP = db.T_EMPLOYEES;
        SampleDB.Departments DEP = db.T_DEPARTMENTS;
       
        DBCommand cmd = db.createCommand();
        cmd.select(EMP.C_EMPLOYEE_ID);
        cmd.select(C_FULL_NAME, EMP.C_GENDER, EMP.C_DATE_OF_BIRTH);
        cmd.select(C_DEPARTMENT);
        cmd.join  (DEP.C_DEPARTMENT_ID, EMP.C_DEPARTMENT_ID);
View Full Code Here

   
    @Override
    public Options getFieldOptions(DBColumn column)
    {
        if (column.equals(T.C_DEPARTMENT_ID)) {
            SampleDB db = (SampleDB)getDatabase();
            DBCommand cmd = db.createCommand();
            cmd.select(db.T_DEPARTMENTS.C_DEPARTMENT_ID);
            cmd.select(db.T_DEPARTMENTS.C_NAME);
            return db.queryOptionList(cmd, context.getConnection());
        }
        // base class implementation
        return super.getFieldOptions(column);
    }
View Full Code Here

TOP

Related Classes of org.apache.empire.struts2.websample.web.SampleContext

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.