⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 page4form.java

📁 开源项目CRM之OpenCustomer
💻 JAVA
字号:
/*******************************************************************************
 * ***** BEGIN LICENSE BLOCK Version: MPL 1.1
 * 
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with the
 * License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
 * 
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
 * the specific language governing rights and limitations under the License.
 * 
 * The Original Code is the OpenCustomer CRM.
 * 
 * The Initial Developer of the Original Code is Thomas Bader (Bader & Jene
 * Software-Ingenieurb黵o). Portions created by the Initial Developer are
 * Copyright (C) 2005 the Initial Developer. All Rights Reserved.
 * 
 * Contributor(s): Thomas Bader <thomas.bader@bader-jene.de>
 * 
 * ***** END LICENSE BLOCK *****
 */

package org.opencustomer.application.web.module.crm.company.edit;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
import org.apache.struts.util.ImageButtonBean;
import org.opencustomer.web.util.FormUtility;
import org.opencustomer.web.util.MessageUtil;
import org.opencustomer.web.util.Sort;

public final class Page4Form extends DefaultPageForm
{
    private static final long serialVersionUID = 3257853160084353849L;

    private String subject;

    private String boundType;

    private String contactType;

    private String contactTimestampStart;

    private String contactTimestampEnd;

    private String name;

    private ImageButtonBean doSearch = new ImageButtonBean();

    private ImageButtonBean doResetSearch = new ImageButtonBean();

    private String sort;

    private int page;

    public void validate(ActionMapping mapping, ActionMessages errors, HttpServletRequest request)
    {
        setDoPage4(null);

        subject = FormUtility.adjustParameter(subject);
        boundType = FormUtility.adjustParameter(boundType);
        contactType = FormUtility.adjustParameter(contactType);
        contactTimestampStart = FormUtility.adjustParameter(contactTimestampStart);
        contactTimestampEnd = FormUtility.adjustParameter(contactTimestampEnd);
        name = FormUtility.adjustParameter(name);

        sort = FormUtility.adjustParameter(sort);

        sort = Sort.parseRequest(request, sort);

        if (!isTokenValid(request) || doResetSearch.isSelected())
        {
            subject = null;
            boundType = null;
            contactType = null;
            contactTimestampStart = null;
            contactTimestampEnd = null;
            name = null;
        }
        else
        {
            String format = MessageUtil.message(request, "format.input.date");
            SimpleDateFormat sdf = new SimpleDateFormat(format);

            if (contactTimestampStart != null)
            {
                try
                {
                    Date date = sdf.parse(contactTimestampStart);
                    contactTimestampStart = sdf.format(date);
                }
                catch (ParseException e)
                {
                    errors.add("contactTimestamp", new ActionMessage("default.error.invalidFormat", MessageUtil.message(request, "domain.crm.person.contactTimestamp.dateStart"), format));
                }
            }
            if (contactTimestampEnd != null)
            {
                try
                {
                    Date date = sdf.parse(contactTimestampEnd);
                    contactTimestampEnd = sdf.format(date);
                }
                catch (ParseException e)
                {
                    errors.add("contactTimestamp", new ActionMessage("default.error.invalidFormat", MessageUtil.message(request, "domain.crm.person.contactTimestamp.dateEnd"), format));
                }
            }
        }
    }

    public final String getBoundType()
    {
        return boundType;
    }

    public final void setBoundType(String boundType)
    {
        this.boundType = boundType;
    }

    public final String getContactType()
    {
        return contactType;
    }

    public final void setContactType(String contactType)
    {
        this.contactType = contactType;
    }

    public final ImageButtonBean getDoResetSearch()
    {
        return doResetSearch;
    }

    public final void setDoResetSearch(ImageButtonBean doResetSearch)
    {
        this.doResetSearch = doResetSearch;
    }

    public final ImageButtonBean getDoSearch()
    {
        return doSearch;
    }

    public final void setDoSearch(ImageButtonBean doSearch)
    {
        this.doSearch = doSearch;
    }

    public final int getPage()
    {
        return page;
    }

    public final void setPage(int page)
    {
        this.page = page;
    }

    public final String getSort()
    {
        return sort;
    }

    public final void setSort(String sort)
    {
        this.sort = sort;
    }

    public final String getSubject()
    {
        return subject;
    }

    public final void setSubject(String subject)
    {
        this.subject = subject;
    }

    public final String getContactTimestampEnd()
    {
        return contactTimestampEnd;
    }

    public final void setContactTimestampEnd(String contactTimestampEnd)
    {
        this.contactTimestampEnd = contactTimestampEnd;
    }

    public final String getContactTimestampStart()
    {
        return contactTimestampStart;
    }

    public final void setContactTimestampStart(String contactTimestampStart)
    {
        this.contactTimestampStart = contactTimestampStart;
    }

    /**
     * @return Returns the name.
     */
    public final String getName()
    {
        return name;
    }

    /**
     * @param name The name to set.
     */
    public final void setName(String name)
    {
        this.name = name;
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -