Commits

Jenny Gurney  committed 08bab46

Adding changes necessary for CNDA to work properly with xdat_release. Ideally xdat_release will pull
these changes back.

  • Participants
  • Parent commits c19cf14

Comments (0)

Files changed (6)

File plugin-resources/project-skeletons/xnat/src/schemas/xnat/display/xnat_projectData_display.xml

 	</DisplayField>
 	<DisplayField id="NAME_CSV" header="Title" visible="true" searchable="true">
 		<DisplayFieldElement name="Field1" schema-element="xnat:projectData/name"/>
+		<HTML-Link>
+			<Property name="HREF" value="@WEBAPPapp/action/DisplayItemAction/search_value/@Field1/search_element/xnat:projectData/search_field/xnat:projectData.ID">
+				<InsertValue id="Field1" field="ID"/>
+			</Property>
+			<Property name="ONCLICK" value="return rpt('@Field1','xnat:projectData','xnat:projectData.ID');">
+				<InsertValue id="Field1" field="ID"/>
+			</Property>
+		</HTML-Link>
 	</DisplayField>
 	<DisplayField id="DESCRIPTION" header="Description" visible="true" searchable="true">
 		<DisplayFieldElement name="Field1" schema-element="xnat:projectData/description"/>

File plugin-resources/webapp/xdat-templates/macros/TurbineMacros.vm

     #end
 #end
 
-
 #macro (xdatPKDisplay $name $item)
 	<input id="$name" type="hidden" name="$name" value="$item.getStringProperty($name)"/>
 	$item.getProperty($name)
 	#end
 #end
 
+#macro (xdatBooleanCheckbox $name $item $vr)
+#if ($vr)
+	#if($vr.getField($name))
+		<font color="red">&#8658</font>
+	#end
+#end
+	#set($value = $!item.getBooleanProperty($name))
+
+	## The hidden box is necessary to submit a "false" value if the checkbox is unchecked
+	## If the checkbox is checked, its true value will override the hidden's "false" value
+	<input type="checkbox" name="$name" value="1" #if($value) CHECKED #end />
+	<input type="hidden" name="$name" value="0" />`
+#end
+
 #macro (xdatBooleanRadio $name $item $defaultValue $vr)
 #if ($vr)
 	#if($vr.getField($name))
 		<font color="red">&#8658</font>
 	#end
 #end
-	#set($value = $!item.getBooleanProperty($name))
+	#set($value = "$!item.getBooleanProperty($name)")
 
-	#if ($value == true)
+	#if ($value == "true")
 	<input type="radio" name="$name" value="1" CHECKED/>&nbsp;yes
 	<input type="radio" name="$name" value="0"/>&nbsp;no
-	#elseif ($value == false)
+	#elseif ($value == "false")
 	<input type="radio" name="$name" value="1"/>&nbsp;yes
 	<input type="radio" name="$name" value="0" CHECKED/>&nbsp;no
 	#else
  <!-- no object found -->
  #end
 #end
-
-#macro(escapeHTML $s)
-$!turbineUtils.escapeHTML($s)
-#end
- 
-#macro(escapeJS $s)
-$!turbineUtils.escapeJS($s)
-#end

File plugin-resources/webapp/xnat/java/org/nrg/xdat/om/base/BaseXnatResourcecatalog.java

 	    	if(entry.getId()==null || !entry.getId().equals("")){
 		        String entryPath = StringUtils.ReplaceStr(FileUtils.AppendRootPath(catPath,entry.getUri()),"\\","/");
 		        File f =getFileOnLocalFileSystem(entryPath);
-		        entry.setId((entryCount++) + "/" + f.getName());
-		        modified=true;
+		        if(f!=null){
+			        entry.setId((entryCount++) + "/" + f.getName());
+			        modified=true;
+		        }else{
+		        	logger.error("Missing Resource:" + entryPath);
+		        }
 	    	}
 	    }
 	    
         	if(!existingLocation.exists())
         		existingLocation=getFileOnLocalFileSystem(existingLocation.getAbsolutePath());
         	
-        	if(existingLocation.exists()){
+        	if(existingLocation!=null && existingLocation.exists()){
             	FileUtils.MoveFile(existingLocation, newFile, true, true);
         	}
     	}

File plugin-resources/webapp/xnat/java/org/nrg/xnat/restlet/resources/ProjectPipelineListResource.java

 
 package org.nrg.xnat.restlet.resources;
 
+import java.util.ArrayList;
+
 import org.nrg.pipeline.PipelineRepositoryManager;
 import org.nrg.xdat.om.ArcProject;
 import org.nrg.xdat.om.XnatProjectdata;
 		if(pID!=null){
 			proj = XnatProjectdata.getXnatProjectdatasById(pID, user, false);
 		}
+			
+		if(proj==null){ 
+			ArrayList<XnatProjectdata> matches=XnatProjectdata.getXnatProjectdatasByField("xnat:projectData/aliases/alias/alias", pID, user, false);
+			if(matches.size()>0){
+				proj=matches.get(0);
+			}
+		}
 	}
 	
 	
 		return true;
 	}
 	
-	@Override
-	public boolean allowPost() {
-		return true;
-	}
-
-	@Override
-	public void handlePost() {
-		
-	}
-	
 	public void handleDelete() {
 		//Remove the Pipeline identified by the path for the project and the datatype
 		if (proj != null) {

File plugin-resources/webapp/xnat/java/org/nrg/xnat/restlet/resources/files/DIRResource.java

 	public DIRResource(Context context, Request request, Response response) {
 		super(context, request, response);
 
+		if(user==null){
+			response.setStatus(Status.CLIENT_ERROR_UNAUTHORIZED);
+			return;
+		}
+		
 		final String pID = (String) request.getAttributes().get("PROJECT_ID");
 		if (pID != null) {
 			proj = XnatProjectdata.getXnatProjectdatasById(pID, user, false);
 	public Representation getRepresentation(Variant variant) {
 		MediaType mt = overrideVariant(variant);
 		
+		if(user==null){
+			this.getResponse().setStatus(Status.CLIENT_ERROR_UNAUTHORIZED);
+					return null;
+		}
+		
 		if(expt instanceof XnatSubjectassessordata){
 			if(filepath==null){
 				filepath="";

File plugin-resources/webapp/xnat/java/org/nrg/xnat/turbine/modules/screens/IMGFile.java

         String fileName= (String)TurbineUtils.GetPassedParameter("file_name",data);
         String project= (String)TurbineUtils.GetPassedParameter("project",data);
         System.out.println("FILE: " + fileName);
-        if (fileName.toLowerCase().endsWith(".jpg") || fileName.toLowerCase().endsWith(".jpeg") || fileName.toLowerCase().endsWith(".gif") )
+        if (fileName.toLowerCase().endsWith(".jpg") || fileName.toLowerCase().endsWith(".jpeg") || fileName.toLowerCase().endsWith(".gif") || fileName.toLowerCase().endsWith(".png") )
         {
             String path =null;
             if (project!=null){