Subversion Repositories SmartDukaan

Rev

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

Rev 2865 Rev 2866
Line 41... Line 41...
41
 
41
 
42
	@Action(value="my-notes",interceptorRefs={@InterceptorRef("myDefault")})
42
	@Action(value="my-notes",interceptorRefs={@InterceptorRef("myDefault")})
43
	public String show()	{
43
	public String show()	{
44
		String responseContentType = null;
44
		String responseContentType = null;
45
		
45
		
46
		if(userinfo.getUserId() != -1)	{
-
 
47
	        try {
46
        try {
48
	        	String[] idParts = this.id.split("-");
47
        	String[] idParts = this.id.split("-");
49
	        	
48
        	
50
	        	this.entityId = Long.parseLong(idParts[0]);
49
        	this.entityId = Long.parseLong(idParts[0]);
51
	        	responseContentType = idParts[1];
50
        	responseContentType = idParts[1];
52
	        	
51
        	
53
	        	this.slideNotes = getSlideNames(this.entityId);
52
        	this.slideNotes = getSlideNames(this.entityId);
-
 
53
 
54
	        	
54
    		if(userinfo.getUserId() != -1)	{
55
				UserContextService.Client userClient = (new UserContextServiceClient()).getClient();
55
    			UserContextService.Client userClient = (new UserContextServiceClient()).getClient();
56
				List<UserNote> userNotes = userClient.getUserNotes(userinfo.getUserId(), this.entityId);
56
    			List<UserNote> userNotes = userClient.getUserNotes(userinfo.getUserId(), this.entityId);
57
				
57
 
58
				for (UserNote note: userNotes)	{
58
    			for (UserNote note: userNotes)	{
59
					slideNotes.put(note.getSlide(), note.getNote());
59
    				slideNotes.put(note.getSlide(), note.getNote());
60
				}
60
    			}
-
 
61
    		}
61
			} catch (NumberFormatException e) {
62
		} catch (NumberFormatException e) {
62
				logger.error("Number Format Exception. String: " + this.id);
63
			logger.error("Number Format Exception. String: " + this.id);
63
			} catch (Exception e) {
64
		} catch (Exception e) {
64
				logger.error("Exception: " + e.getMessage());
65
			logger.error("Exception: " + e.getMessage());
65
			}	
-
 
66
		}
66
		}
67
 
67
 
68
		return responseContentType.equals("json") ? "json" : "show";
68
		return responseContentType.equals("json") ? "json" : "show";
69
	}
69
	}
70
 
70