Subversion Repositories SmartDukaan

Rev

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

Rev 1051 Rev 1068
Line 114... Line 114...
114
			return "fatal";
114
			return "fatal";
115
		}
115
		}
116
    	return "edit";
116
    	return "edit";
117
    }
117
    }
118
    
118
    
-
 
119
    public String show(){
-
 
120
	    if(this.reqparams.get("sequence") != null){
-
 
121
			String itemlist = this.reqparams.get("sequence")[0];
-
 
122
			long entityID = Long.parseLong(this.getId());
-
 
123
			try {
-
 
124
				this.entity = CreationUtils.getEntity(entityID);
-
 
125
				List<Long> slideSequence = entity.getSlideSequence();
-
 
126
				List<Long> newSlideSequence = new ArrayList<Long>();
-
 
127
				String[] items = itemlist.split("-");
-
 
128
				for(int i = 0; i < items.length; i++){
-
 
129
					newSlideSequence.add(slideSequence.get(Integer.parseInt(items[i]))); 
-
 
130
				}
-
 
131
				entity.setSlideSequence(newSlideSequence);
-
 
132
				CreationUtils.updateEntity(entity);
-
 
133
			} catch (Exception e) {
-
 
134
				// TODO Auto-generated catch block
-
 
135
				e.printStackTrace();
-
 
136
			}
-
 
137
		}
-
 
138
	    this.redirectURL = "/slides/" + this.getId() + "/edit";
-
 
139
    	return "redirect";
-
 
140
    }
-
 
141
    
119
    /**
142
    /**
120
     * 
143
     * 
121
     * @return
144
     * @return
122
     */
145
     */
123
    public String update() {
146
    public String update() {
Line 126... Line 149...
126
    		String[] values = this.reqparams.get(reqparam);
149
    		String[] values = this.reqparams.get(reqparam);
127
    		for(String value: values){
150
    		for(String value: values){
128
    			System.out.println("Param:   " + reqparam + "Value:   " + value);
151
    			System.out.println("Param:   " + reqparam + "Value:   " + value);
129
    		}
152
    		}
130
    	}
153
    	}
131
    	if(this.reqparams.get("reorder") != null){
-
 
132
    		long entityID = Long.parseLong(this.getId());
-
 
133
    		try {
-
 
134
				List<Long> slideSequence = new ArrayList<Long>();
-
 
135
				
-
 
136
			} catch (Exception e) {
-
 
137
				// TODO Auto-generated catch block
-
 
138
				e.printStackTrace();
-
 
139
			}
-
 
140
    		this.redirectURL = "/slides/" + this.getId() + "/edit";
-
 
141
	    	return "redirect";
-
 
142
    	}
154
    	
143
    	//FIXME
155
    	//FIXME
144
    	/*  Need to fix me while reordering
156
    	/*  Need to fix me while reordering
145
    	if(this.reqparams.get("slideid") != null){
157
    	if(this.reqparams.get("slideid") != null){
146
    		long slideId = Long.parseLong(this.reqparams.get("slideid")[0]);
158
    		long slideId = Long.parseLong(this.reqparams.get("slideid")[0]);
147
    		long afterSlideId = Long.parseLong(this.reqparams.get("afterslide")[0]);
159
    		long afterSlideId = Long.parseLong(this.reqparams.get("afterslide")[0]);