incubator-hise-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wi...@apache.org
Subject svn commit: r986299 - /incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/TaskEvaluator.java
Date Tue, 17 Aug 2010 13:05:16 GMT
Author: witek
Date: Tue Aug 17 13:05:16 2010
New Revision: 986299

URL: http://svn.apache.org/viewvc?rev=986299&view=rev
Log:
HISE-80: empty presentationSubject in response to getMyTaskAbstracts (Thanks to Michał Więcław)

Modified:
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/TaskEvaluator.java

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/TaskEvaluator.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/TaskEvaluator.java?rev=986299&r1=986298&r2=986299&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/TaskEvaluator.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/TaskEvaluator.java
Tue Aug 17 13:05:16 2010
@@ -370,21 +370,36 @@ public class TaskEvaluator {
     }
 
     public static String getTemplateExpr(List<Object> expr) {
-        return "xs:string(<v>" + XmlUtils.getStringContent(expr) + "</v>)";
+    	return "xs:string(<v>" + XmlUtils.getStringContent(expr) + "</v>)";
     }
 
 
     public String evalPresentationSubject() {
         String subjectExpr;
+        String subject;
         Node subjectNode = null;
         try {
-            subjectNode = task.getTaskDefinition().getPresentationElements().getSubjectList().get(0).getDomNode();
-            subjectExpr = getTemplateExpr(Arrays.asList(new Object[] {subjectNode}));
+        	subjectNode = task.getTaskDefinition().getPresentationElements().getSubjectList().get(0).getDomNode();
+        	/*
+        	 //version with support for the language
+        	List<TText> subjectList = task.getTaskDefinition().getPresentationElements().getSubjectList();
+        	for(TText i: subjectList){
+        		if(i.getLang().equals(selectedLanguage)){
+        			subjectNode = i.getDomNode();
+        		}
+        	}
+        	*/
         } catch (Throwable t) {
             return null;
         }
+        
+        if(subjectNode == null) 
+        	return "";
         XQueryEvaluator e = buildPresentationEvaluator(subjectNode);
-        return "" + e.evaluateExpression(subjectExpr, null).get(0);
+        subjectExpr = "xs:string(<v>" + subjectNode.getFirstChild().getNodeValue()
+ "</v>)";
+        subject = (String)e.evaluateExpression(subjectExpr, null).get(0);
+
+        return subject;
     }
 
     public String evalPresentationDescription() {



Mime
View raw message