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

📄 uireportfield.java

📁 国外的一套开源CRM
💻 JAVA
字号:
package com.sourcetap.sfa.ui;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.entity.GenericDelegator;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;

public class UIReportField {
	public static final String module = UIReportField.class.getName();

	protected String reportFieldId;
	protected String reportId;
	protected String attributeId;
	protected String displayTypeId;
	protected String displayObjectId;
	protected String groupBy;
	protected int displayOrder;
	protected String displayLabel;
	protected String sqlFunction;

	protected String attributeName;
	protected String entityName;

	protected String sectionId;
	protected String sectionName;

	protected GenericDelegator delegator;

	public static List loadFromGVL( List reportFieldGVL )
	{
		List retList = new ArrayList();
		Iterator iter = reportFieldGVL.iterator();
		while ( iter.hasNext() )
		{
			GenericValue gv = (GenericValue) iter.next();
			retList.add(new UIReportField(gv));
		}
		return retList;
	}
		
	public UIReportField(GenericValue reportFieldGV)
	{
		setReportFieldId(reportFieldGV.getString("reportFieldId"));
		setReportId(reportFieldGV.getString("reportId"));
		setAttributeId(reportFieldGV.getString("attributeId"));
		setDisplayTypeId(reportFieldGV.getString("displayTypeId"));
		setDisplayObjectId(reportFieldGV.getString("displayObjectId"));
		setGroupBy(reportFieldGV.getString("groupBy"));
		setSqlFunction(reportFieldGV.getString("sqlFunction"));
		
		setDisplayOrder(reportFieldGV.getString("displayOrder"));
		setDisplayLabel(reportFieldGV.getString("displayLabel"));
			
		setDelegator(reportFieldGV.getDelegator());
		loadEntityAttributeInfo(delegator, attributeId);
	}

	public UIReportField(String attributeId, String displayTypeId, String displayObjectId, String displayLabel, String displayOrder)
	{
		setAttributeId(attributeId);
		setDisplayTypeId(displayTypeId);
		setDisplayObjectId(displayObjectId);
		setDisplayLabel(displayLabel);
		setDisplayOrder(displayOrder);
	}
		
	public void loadEntityAttributeInfo(GenericDelegator delegator, String attributeId)
	{
		try
		{
			List eaGVL = delegator.findByAnd("UiEntityAttribute", UtilMisc.toMap("attributeId", attributeId));
			GenericValue eaGV = (GenericValue) eaGVL.get(0);
				
			setEntityName(eaGV.getString("entityName"));
			setAttributeName(eaGV.getString("attributeName"));
				 
		} catch (GenericEntityException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	/**
	 * @return
	 */
	public String getAttributeId()
	{
		return attributeId;
	}

	/**
	 * @return
	 */
	public String getAttributeName()
	{
		return attributeName;
	}

	/**
	 * @return
	 */
	public GenericDelegator getDelegator()
	{
		return delegator;
	}

	/**
	 * @return
	 */
	public String getDisplayLabel()
	{
		return displayLabel;
	}

	/**
	 * @return
	 */
	public String getDisplayObjectId()
	{
		return displayObjectId;
	}

	/**
	 * @return
	 */
	public int getDisplayOrder()
	{
		return displayOrder;
	}

	/**
	 * @return
	 */
	public String getDisplayTypeId()
	{
		return displayTypeId;
	}

	/**
	 * @return
	 */
	public String getEntityName()
	{
		return entityName;
	}

	/**
	 * @return
	 */
	public String getGroupBy()
	{
		return groupBy;
	}

	/**
	 * @return
	 */
	public String getReportFieldId()
	{
		return reportFieldId;
	}

	/**
	 * @return
	 */
	public String getReportId()
	{
		return reportId;
	}

	/**
	 * @return
	 */
	public String getSectionId()
	{
		return sectionId;
	}

	/**
	 * @return
	 */
	public String getSectionName()
	{
		return sectionName;
	}

	/**
	 * @param string
	 */
	public void setAttributeId(String string)
	{
		attributeId = string;
	}

	/**
	 * @param string
	 */
	public void setAttributeName(String string)
	{
		attributeName = string;
	}

	/**
	 * @param delegator
	 */
	public void setDelegator(GenericDelegator delegator)
	{
		this.delegator = delegator;
	}

	/**
	 * @param string
	 */
	public void setDisplayLabel(String string)
	{
		displayLabel = string;
	}

	/**
	 * @param string
	 */
	public void setDisplayObjectId(String string)
	{
		displayObjectId = string;
	}

	/**
	 * @param intVal
	 */
	public void setDisplayOrder(int intVal)
	{
		displayOrder = intVal;
	}

	/**
	 * @param intVal
	 */
	public void setDisplayOrder(String string)
	{
		try
		{
			setDisplayOrder(Integer.valueOf(string).intValue());
		} catch (NumberFormatException e)
		{
			setDisplayOrder(0);
			Debug.logError("invalid number:" + string, module);
		}
	}

	/**
	 * @param string
	 */
	public void setDisplayTypeId(String string)
	{
		displayTypeId = string;
	}

	/**
	 * @param string
	 */
	public void setEntityName(String string)
	{
		entityName = string;
	}

	/**
	 * @param string
	 */
	public void setGroupBy(String string)
	{
		groupBy = string;
	}

	/**
	 * @param string
	 */
	public void setReportFieldId(String string)
	{
		reportFieldId = string;
	}

	/**
	 * @param string
	 */
	public void setReportId(String string)
	{
		reportId = string;
	}

	/**
	 * @param string
	 */
	public void setSectionId(String string)
	{
		sectionId = string;
	}

	/**
	 * @param string
	 */
	public void setSectionName(String string)
	{
		sectionName = string;
	}

	/**
	 * @return
	 */
	public String getSqlFunction()
	{
		return sqlFunction;
	}

	/**
	 * @param string
	 */
	public void setSqlFunction(String string)
	{
		sqlFunction = string;
	}

}

⌨️ 快捷键说明

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