shopizer-developers

2 missing files

9/11/2014 1:43:27 PM

Details

diff --git a/sm-shop/src/main/java/com/salesmanager/web/entity/order/ReadableOrderProductAttribute.java b/sm-shop/src/main/java/com/salesmanager/web/entity/order/ReadableOrderProductAttribute.java
new file mode 100644
index 0000000..b61f488
--- /dev/null
+++ b/sm-shop/src/main/java/com/salesmanager/web/entity/order/ReadableOrderProductAttribute.java
@@ -0,0 +1,36 @@
+package com.salesmanager.web.entity.order;
+
+import java.io.Serializable;
+
+import com.salesmanager.web.entity.Entity;
+
+public class ReadableOrderProductAttribute extends Entity implements Serializable {
+	
+	
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	private String attributeName;
+	private String attributePrice;
+	private String attributeValue;
+	public String getAttributeName() {
+		return attributeName;
+	}
+	public void setAttributeName(String attributeName) {
+		this.attributeName = attributeName;
+	}
+	public String getAttributePrice() {
+		return attributePrice;
+	}
+	public void setAttributePrice(String attributePrice) {
+		this.attributePrice = attributePrice;
+	}
+	public String getAttributeValue() {
+		return attributeValue;
+	}
+	public void setAttributeValue(String attributeValue) {
+		this.attributeValue = attributeValue;
+	}
+
+}
diff --git a/sm-shop/src/main/java/com/salesmanager/web/tags/ActiveLinkTag.java b/sm-shop/src/main/java/com/salesmanager/web/tags/ActiveLinkTag.java
new file mode 100644
index 0000000..2becec3
--- /dev/null
+++ b/sm-shop/src/main/java/com/salesmanager/web/tags/ActiveLinkTag.java
@@ -0,0 +1,101 @@
+package com.salesmanager.web.tags;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.salesmanager.core.business.merchant.model.MerchantStore;
+import com.salesmanager.web.constants.Constants;
+
+public class ActiveLinkTag extends TagSupport {
+	
+	
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	private static final Logger LOGGER = LoggerFactory.getLogger(ActiveLinkTag.class);
+
+	private final static String ACTIVE = "active";
+	
+	private String linkCode = null;
+	private String activeReturnCode = null;
+	private String inactiveReturnCode = null;
+		
+
+	public int doStartTag() throws JspException {
+		try {
+
+
+
+			HttpServletRequest request = (HttpServletRequest) pageContext
+					.getRequest();
+			
+			MerchantStore merchantStore = (MerchantStore)request.getAttribute(Constants.MERCHANT_STORE);
+			
+			String requestLinkCode = (String)request.getAttribute(Constants.LINK_CODE);
+			
+			if(StringUtils.isBlank(requestLinkCode)) {
+				if(!StringUtils.isBlank(inactiveReturnCode)) {
+					pageContext.getOut().print(inactiveReturnCode);
+				} else {
+					pageContext.getOut().print("");
+				}
+			} else {
+				if(requestLinkCode.equalsIgnoreCase(linkCode)) {
+					if(!StringUtils.isBlank(activeReturnCode)) {
+						pageContext.getOut().print(activeReturnCode);
+					} else {
+						pageContext.getOut().print(ACTIVE);
+					}
+				} else {
+					if(!StringUtils.isBlank(inactiveReturnCode)) {
+						pageContext.getOut().print(inactiveReturnCode);
+					} else {
+						pageContext.getOut().print("");
+					}
+				}
+			}
+
+
+			
+		} catch (Exception ex) {
+			LOGGER.error("Error while creating active link", ex);
+		}
+		return SKIP_BODY;
+	}
+
+	public int doEndTag() {
+		return EVAL_PAGE;
+	}
+
+	public String getLinkCode() {
+		return linkCode;
+	}
+
+	public void setLinkCode(String linkCode) {
+		this.linkCode = linkCode;
+	}
+
+	public String getActiveReturnCode() {
+		return activeReturnCode;
+	}
+
+	public void setActiveReturnCode(String activeReturnCode) {
+		this.activeReturnCode = activeReturnCode;
+	}
+
+
+
+
+
+
+
+
+	
+
+}