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

📄 uireportorderby.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 UIReportOrderBy {
	public static final String module = UIReportOrderBy.class.getName();

	protected String reportOrderId;
	protected String reportId;
	protected String attributeId;
	protected int sortOrder;
	protected String displayLabel;

	protected boolean attNameLoaded = false;
	protected String attributeName;
	protected String entityName;

	protected GenericDelegator delegator;

	public static List loadFromGVL( List reportOrderByGVL )
	{
		List retList = new ArrayList();
		Iterator iter = reportOrderByGVL.iterator();
		while ( iter.hasNext() )
		{
			GenericValue gv = (GenericValue) iter.next();
			retList.add(new UIReportOrderBy(gv));
		}
		return retList;
	}
		
	public UIReportOrderBy(GenericValue genricValue)
	{
		setReportOrderId(genricValue.getString("reportOrderId"));
		setReportId(genricValue.getString("reportId"));
		setAttributeId(genricValue.getString("attributeId"));
		setDisplayLabel(genricValue.getString("displayLabel"));
		setSortOrder(genricValue.getString("sortOrder"));
			
		setDelegator(genricValue.getDelegator());
	}
	
	public UIReportOrderBy( String attributeId, int sortOrder, String displayLabel )
	{
		setAttributeId(attributeId);
		setSortOrder(sortOrder);
		setDisplayLabel(displayLabel);
	}
		
	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"));
			attNameLoaded = true;
				 
		} catch (GenericEntityException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	/**
	 * @return
	 */
	public String getAttributeId()
	{
		return attributeId;
	}

	/**
	 * @return
	 */
	public String getAttributeName()
	{
		if ( !attNameLoaded)
			loadEntityAttributeInfo(getDelegator(), getAttributeId());
		return attributeName;
	}

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

	/**
	 * @return
	 */
	public String getEntityName()
	{
		if ( !attNameLoaded)
			loadEntityAttributeInfo(getDelegator(), getAttributeId());
		return entityName;
	}

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

	/**
	 * @return
	 */
	public String getReportOrderId()
	{
		return reportOrderId;
	}

	/**
	 * @return
	 */
	public int getSortOrder()
	{
		return sortOrder;
	}

	/**
	 * @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 setEntityName(String string)
	{
		entityName = string;
	}

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

	/**
	 * @param string
	 */
	public void setReportOrderId(String string)
	{
		reportOrderId = string;
	}

	/**
	 * @param i
	 */
	public void setSortOrder(int i)
	{
		sortOrder = i;
	}
	/**
	 * @param s
	 */
	public void setSortOrder(String s)
	{
		try
		{
			sortOrder = Integer.valueOf(s).intValue();
		} catch (NumberFormatException e)
		{
			Debug.logError("error converting sortOrder to int: " + s, module);
		}
	}

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

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

}

⌨️ 快捷键说明

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