Subversion Repositories SmartDukaan

Rev

Rev 448 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 448 Rev 450
Line 34... Line 34...
34
import java.util.Arrays;
34
import java.util.Arrays;
35
import java.util.Collection;
35
import java.util.Collection;
36
import java.util.HashMap;
36
import java.util.HashMap;
37
import java.util.List;
37
import java.util.List;
38
import java.util.Map;
38
import java.util.Map;
-
 
39
import java.util.StringTokenizer;
39
 
40
 
40
import org.apache.commons.lang.StringUtils;
41
import org.apache.commons.lang.StringUtils;
41
import org.apache.juli.logging.Log;
42
import org.apache.juli.logging.Log;
42
import org.apache.juli.logging.LogFactory;
43
import org.apache.juli.logging.LogFactory;
43
import org.apache.struts2.convention.annotation.Result;
44
import org.apache.struts2.convention.annotation.Result;
Line 934... Line 935...
934
     * 
935
     * 
935
     * @param ID
936
     * @param ID
936
     * @return
937
     * @return
937
     */
938
     */
938
    private FreeformContent getFreeformContent(String ID) {
939
    private FreeformContent getFreeformContent(String ID) {
-
 
940
 
-
 
941
		
939
		FreeformContent ffc = new FreeformContent();
942
		FreeformContent ffc = new FreeformContent();
940
		String[] ffts = this.reqparams.get(ID + "_fft");
943
		String[] ffts = this.reqparams.get(ID + "_fft");
941
		if(ffts != null) {
944
		if(ffts != null) {
942
			ffc.setFreeformTexts(Arrays.asList(ffts));
945
			ffc.setFreeformTexts(Arrays.asList(ffts));
943
		}
946
		}
944
		
947
		
-
 
948
    	System.out.println("String is " + ID);
-
 
949
    	
-
 
950
    	StringTokenizer tokenizer = new StringTokenizer(ID,"_");
-
 
951
    	if(tokenizer.nextToken().compareTo("slide") == 0  ){
-
 
952
    		long slideId = Long.parseLong(tokenizer.nextToken());
-
 
953
    		FreeformContent old_ffc = null;
-
 
954
    		if(this.entity.getSlide(slideId) != null){
945
		String[] imgRefs = this.reqparams.get(ID + "_image_references");
955
    			old_ffc = this.entity.getSlide(slideId).getFreeformContent();
946
		if(imgRefs != null) {
956
    			if(old_ffc != null){
947
			ffc.setMedia("image", Arrays.asList(imgRefs));
957
    				ffc.setMedia("image", old_ffc.getImageRefs());
-
 
958
    				ffc.setMedia("youtube", old_ffc.getYoutubeRefs());    			
-
 
959
    			}
948
		}
960
    		}
-
 
961
    	}
949
		
962
		
-
 
963
		
-
 
964
//		String[] imgRefs = this.reqparams.get(ID + "_image_references");
-
 
965
//		if(imgRefs != null) {
-
 
966
//			ffc.setMedia("image", Arrays.asList(imgRefs));
-
 
967
//		}
-
 
968
//		
950
		String[] youtubeRefs = 
969
//		String[] youtubeRefs = 
951
			this.reqparams.get(ID + "_youtube_references");
970
//			this.reqparams.get(ID + "_youtube_references");
952
		if(youtubeRefs != null) {
971
//		if(youtubeRefs != null) {
953
			ffc.setMedia("youtube", Arrays.asList(youtubeRefs));
972
//			ffc.setMedia("youtube", Arrays.asList(youtubeRefs));
954
		}
973
//		}
955
		
974
		
956
		log.info("ffc:" + ffc);
975
		log.info("ffc:" + ffc);
957
		return ffc;
976
		return ffc;
958
	}
977
	}
959
    
978