1 19 20 package com.sslexplorer.navigation; 21 22 import java.util.List ; 23 24 import javax.servlet.http.HttpServletRequest ; 25 26 import com.sslexplorer.policyframework.Resource; 27 import com.sslexplorer.policyframework.ResourceItem; 28 29 37 public abstract class AbstractFavoriteItem extends ResourceItem implements Comparable { 38 39 43 public final static String NO_FAVORITE = "none"; 44 45 49 public final static String USER_FAVORITE = "user"; 50 51 55 public final static String GLOBAL_FAVORITE = "policy"; 56 57 59 private String favoriteType; 60 61 68 public int compareTo(Object o) { 69 int i = getResource().getResourceType().compareTo(((ResourceItem) o).getResource().getResourceType()); 70 return i == 0 ? new Integer (getResource().getResourceId()).compareTo(new Integer (((ResourceItem) o).getResource() 71 .getResourceId())) : i; 72 } 73 74 80 public AbstractFavoriteItem(Resource resource, List policies) { 81 super(resource, policies); 82 } 83 84 92 public String getFavoriteLink(int policy, HttpServletRequest request) { 93 return getLink(-1, "/showFavorites.do?actionTarget=unspecified", request); 94 } 95 96 104 public String getFavoriteType() { 105 return favoriteType; 106 } 107 108 116 public void setFavoriteType(String favoriteType) { 117 this.favoriteType = favoriteType; 118 } 119 120 125 public abstract String getTarget(); 126 127 133 public abstract String getOnClick(int policy, HttpServletRequest request); 134 135 142 public abstract String getLink(int policy, String referer, HttpServletRequest request); 143 144 149 public abstract String getFavoriteName(); 150 151 156 public abstract String getFavoriteSubType(); 157 158 165 public abstract String getSmallIconPath(HttpServletRequest request); 166 167 174 public abstract String getLargeIconPath(HttpServletRequest request); 175 176 } 177 | Popular Tags |