1 40 package org.dspace.core; 41 42 49 public class Constants 50 { 51 52 public static final int BITSTREAM = 0; 53 54 55 public static final int BUNDLE = 1; 56 57 58 public static final int ITEM = 2; 59 60 61 public static final int COLLECTION = 3; 62 63 64 public static final int COMMUNITY = 4; 65 66 67 public static final int SITE = 5; 68 69 70 public static final int GROUP = 6; 71 72 73 public static final int EPERSON = 7; 74 75 78 public static final String [] typeText = { "BITSTREAM", "BUNDLE", "ITEM", 79 "COLLECTION", "COMMUNITY", "SITE", "GROUP", "EPERSON", }; 80 81 84 85 86 public static final String LICENSE_BITSTREAM_NAME = "license.txt"; 87 88 89 public static final String LICENSE_BUNDLE_NAME = "LICENSE"; 90 91 95 public static final String DEFAULT_BUNDLE_NAME = "ORIGINAL"; 96 97 100 public static final String CONTENT_BUNDLE_NAME = "ORIGINAL"; 101 102 103 public static final String METADATA_BUNDLE_NAME = "METADATA"; 104 105 106 107 public static final int READ = 0; 108 109 110 public static final int WRITE = 1; 111 112 118 public static final int DELETE = 2; 119 120 125 public static final int ADD = 3; 126 127 132 public static final int REMOVE = 4; 133 134 135 public static final int WORKFLOW_STEP_1 = 5; 136 137 138 public static final int WORKFLOW_STEP_2 = 6; 139 140 141 public static final int WORKFLOW_STEP_3 = 7; 142 143 144 public static final int WORKFLOW_ABORT = 8; 145 146 147 public static final int DEFAULT_BITSTREAM_READ = 9; 148 149 150 public static final int DEFAULT_ITEM_READ = 10; 151 152 156 public static final int COLLECTION_ADMIN = 11; 157 158 159 public static final int NEWS_TOP = 0; 160 161 162 public static final int NEWS_SIDE = 1; 163 164 167 public static final String [] actionText = { "READ", "WRITE", 168 "OBSOLETE (DELETE)", "ADD", "REMOVE", "WORKFLOW_STEP_1", 169 "WORKFLOW_STEP_2", "WORKFLOW_STEP_3", "WORKFLOW_ABORT", 170 "DEFAULT_BITSTREAM_READ", "DEFAULT_ITEM_READ", "COLLECTION_ADMIN" }; 171 172 176 public static final int RBITSTREAM = 1 << BITSTREAM; 177 178 public static final int RBUNDLE = 1 << BUNDLE; 179 180 public static final int RITEM = 1 << ITEM; 181 182 public static final int RCOLLECTION = 1 << COLLECTION; 183 184 public static final int RCOMMUNITY = 1 << COMMUNITY; 185 186 193 public static final int[] actionTypeRelevance = { 194 RBITSTREAM | RBUNDLE | RITEM | RCOLLECTION | RCOMMUNITY, RBITSTREAM | RBUNDLE | RITEM | RCOLLECTION | RCOMMUNITY, 0, RBUNDLE | RITEM | RCOLLECTION | RCOMMUNITY, RBUNDLE | RITEM | RCOLLECTION | RCOMMUNITY, 0, 0, 0, 0, RCOLLECTION, RCOLLECTION, RCOLLECTION }; 208 209 public static final String DEFAULT_ENCODING = "UTF-8"; 210 211 220 public static int getTypeID(String type) 221 { 222 for (int i = 0; i < typeText.length; i++) 223 { 224 if (typeText[i].equals(type)) 225 { 226 return i; 227 } 228 } 229 230 return -1; 231 } 232 233 243 public static int getActionID(String action) 244 { 245 for (int i = 0; i < actionText.length; i++) 246 { 247 if (actionText[i].equals(action)) 248 { 249 return i; 250 } 251 } 252 253 return -1; 254 } 255 } 256 | Popular Tags |