Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/URLFilter.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/URLFilter.java	(revision 25590)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/URLFilter.java	(revision 25591)
@@ -31,5 +31,4 @@
 	//Restricted URLs
 	protected static final String SITECONFIG_URL = "sites/[^/]+/siteConfig.xml";
-
 	protected static final ArrayList<String> _restrictedURLs;
 	static
@@ -40,4 +39,19 @@
 	}
 
+	//Constants
+	protected static final String DOCUMENT_PATH = "document";
+	protected static final String COLLECTION_PATH = "collection";
+	protected static final String PAGE_PATH = "page";
+	protected static final String SYSTEM_PATH = "system";
+
+	protected static final String METADATA_RETRIEVAL_SERVICE = "DocumentMetadataRetrieve";
+	protected static final String ASSOCIATED_FILE_PATH = "/index/assoc/";
+	protected static final String COLLECTION_FILE_PATH = "/collect/";
+	
+	protected static final String SYSTEM_SUBACTION_CONFIGURE = "configure";
+	protected static final String SYSTEM_SUBACTION_RECONFIGURE = "reconfigure";
+	protected static final String SYSTEM_SUBACTION_ACTIVATE = "activate";
+	protected static final String SYSTEM_SUBACTION_DEACTIVATE = "deactivate";
+
 	public void init(FilterConfig filterConfig) throws ServletException
 	{
@@ -65,8 +79,9 @@
 			}
 
-			if (url.contains("/index/assoc/"))
+			//If the user is trying to access a collection file we need to run a security check
+			if (url.contains(ASSOCIATED_FILE_PATH))
 			{
 				String dir = null;
-				int dirStart = url.indexOf("/index/assoc/") + "/index/assoc/".length();
+				int dirStart = url.indexOf(ASSOCIATED_FILE_PATH) + ASSOCIATED_FILE_PATH.length();
 				int dirEnd = -1;
 				if (dirStart < url.length() && url.indexOf("/", dirStart) != -1)
@@ -84,5 +99,5 @@
 
 				String collection = null;
-				int colStart = url.indexOf("/collect/") + "/collect/".length();
+				int colStart = url.indexOf(COLLECTION_FILE_PATH) + COLLECTION_FILE_PATH.length();
 				int colEnd = -1;
 				if (colStart < url.length() && url.indexOf("/", colStart) != -1)
@@ -114,5 +129,5 @@
 
 				Element metaMessage = gsDoc.createElement(GSXML.MESSAGE_ELEM);
-				Element metaRequest = GSXML.createBasicRequest(gsDoc, GSXML.REQUEST_TYPE_PROCESS, collection + "/DocumentMetadataRetrieve", new UserContext());
+				Element metaRequest = GSXML.createBasicRequest(gsDoc, GSXML.REQUEST_TYPE_PROCESS, collection + "/" + METADATA_RETRIEVAL_SERVICE, new UserContext());
 				metaMessage.appendChild(metaRequest);
 
@@ -179,6 +194,7 @@
 			else
 			{
+				//If we have a jsessionid on the end of our URL we want to ignore it
 				int index;
-				if((index = url.indexOf(";jsessionid")) != -1)
+				if ((index = url.indexOf(";jsessionid")) != -1)
 				{
 					url = url.substring(0, index);
@@ -191,10 +207,10 @@
 
 					//COLLECTION
-					if (segments[i].equals("collection") && (i + 1) < segments.length)
+					if (segments[i].equals(COLLECTION_PATH) && (i + 1) < segments.length)
 					{
 						gRequest.setParameter(GSParams.COLLECTION, segments[i + 1]);
 					}
 					//DOCUMENT
-					else if (segments[i].equals("document") && (i + 1) < segments.length)
+					else if (segments[i].equals(DOCUMENT_PATH) && (i + 1) < segments.length)
 					{
 						gRequest.setParameter(GSParams.DOCUMENT, segments[i + 1]);
@@ -204,5 +220,5 @@
 					}
 					//PAGE
-					else if (segments[i].equals("page") && (i + 1) < segments.length)
+					else if (segments[i].equals(PAGE_PATH) && (i + 1) < segments.length)
 					{
 						gRequest.setParameter(GSParams.SUBACTION, segments[i + 1]);
@@ -211,4 +227,42 @@
 						defaultParamValues = new String[] { "p" };
 					}
+					//SYSTEM
+					else if (segments[i].equals(SYSTEM_PATH) && (i + 1) < segments.length)
+					{
+						String sa = segments[i + 1];
+						if (sa.equals(SYSTEM_SUBACTION_CONFIGURE) || sa.equals(SYSTEM_SUBACTION_RECONFIGURE))
+						{
+							sa = "c";
+						}
+						else if (sa.equals(SYSTEM_SUBACTION_ACTIVATE))
+						{
+							sa = "a";
+						}
+						else if (sa.equals(SYSTEM_SUBACTION_DEACTIVATE))
+						{
+							sa = "d";
+						}
+						
+						if (sa.equals("c") && (i + 2) < segments.length)
+						{
+							gRequest.setParameter(GSParams.SYSTEM_CLUSTER, segments[i + 2]);
+						}
+						
+						if (sa.equals("a") && (i + 2) < segments.length)
+						{
+							gRequest.setParameter(GSParams.SYSTEM_MODULE_TYPE, "collection");
+							gRequest.setParameter(GSParams.SYSTEM_MODULE_NAME, segments[i + 2]);
+						}
+						
+						if (sa.equals("d") && (i + 2) < segments.length)
+						{
+							gRequest.setParameter(GSParams.SYSTEM_CLUSTER, segments[i + 2]);
+						}
+
+						gRequest.setParameter(GSParams.SUBACTION, sa);
+
+						additionalParameters = new String[] { GSParams.ACTION };
+						defaultParamValues = new String[] { "s" };
+					}
 					//ADMIN
 					else if (segments[i].equals("admin") && (i + 1) < segments.length)
@@ -253,11 +307,10 @@
 							serviceName = segments[i + 1];
 							gRequest.setParameter("s", serviceName);
-							
+
 							additionalParameters = new String[] { GSParams.ACTION, GSParams.SUBACTION, GSParams.REQUEST_TYPE };
 							defaultParamValues = new String[] { "q", "", "d" };
 						}
-						if((i + 2) < segments.length)
-						{
-							System.err.println("HUH??");
+						if ((i + 2) < segments.length)
+						{
 							if (serviceName.equals("TextQuery") || serviceName.equals("RawQuery"))
 							{
