KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > services > version > EntrySaveRequest


1 //
2
// ____.
3
// __/\ ______| |__/\. _______
4
// __ .____| | \ | +----+ \
5
// _______| /--| | | - \ _ | : - \_________
6
// \\______: :---| : : | : | \________>
7
// |__\---\_____________:______: :____|____:_____\
8
// /_____|
9
//
10
// . . . i n j a h i a w e t r u s t . . .
11
//
12

13 package org.jahia.services.version;
14
15 import org.jahia.services.usermanager.JahiaUser;
16
17 /**
18  * This class should contain every info needed to specify which version (lang) the user
19  * wish to save, and what issued the command (maybe it can be usefull for rights check)
20  */

21 public class EntrySaveRequest implements Cloneable JavaDoc {
22
23     private JahiaUser theUser; // which user is the requester ? null = internal request
24
private String JavaDoc languageCode; // the language in which to save the data, null = not language-specific
25

26     public EntrySaveRequest (JahiaUser theUser, String JavaDoc languageCode)
27     {
28         this.theUser = theUser;
29         this.languageCode = languageCode;
30     }
31     
32     public EntrySaveRequest (JahiaUser theUser)
33     {
34         this.theUser = theUser;
35         this.languageCode = null;
36     }
37     
38     public EntrySaveRequest (String JavaDoc theLanguage)
39     {
40         this.theUser = null;
41         this.languageCode = theLanguage;
42     }
43     
44     public Object JavaDoc clone()
45     {
46         return new EntrySaveRequest (theUser, languageCode);
47     }
48     
49     /**
50      * Which user issued the request ?
51      * @return the user, null if it is an internal request (no user issued it)
52      */

53     public JahiaUser getUser()
54         { return theUser; }
55
56     public void setUser(JahiaUser theUser)
57         { this.theUser = theUser; }
58
59     /**
60      * In which language do we want to save
61      * @return the language, null if what we want to save is not language specific
62      */

63     public String JavaDoc getLanguageCode()
64         { return languageCode; }
65         
66     public void setLanguageCode(String JavaDoc theLanguage)
67         { this.languageCode = theLanguage; }
68
69     public String JavaDoc toString()
70     {
71         return new String JavaDoc ("[SAVEREQUEST:user="+theUser+", language="+languageCode+"]");
72     }
73 }
74
Popular Tags