Changeset 4026
- Timestamp:
- 01/27/10 12:20:28 (2 years ago)
- Location:
- ssme/trunk
- Files:
-
- 3 added
- 21 modified
-
doc/delete_data.sql (added)
-
doc/insert_data.sql (added)
-
src/com/kh/ssme/business/GroupService.java (modified) (3 diffs)
-
src/com/kh/ssme/business/UserService.java (modified) (2 diffs)
-
src/com/kh/ssme/manage/GroupManager.java (modified) (2 diffs)
-
src/com/kh/ssme/manage/UserManager.java (modified) (2 diffs)
-
src/com/kh/ssme/model/entity/BasicDataEntity.java (modified) (1 diff)
-
src/com/kh/ssme/model/entity/GroupEntity.java (modified) (3 diffs)
-
src/com/kh/ssme/model/entity/UserEntity.java (modified) (6 diffs)
-
src/com/kh/ssme/model/ifc/Group.java (modified) (3 diffs)
-
src/com/kh/ssme/model/ifc/User.java (modified) (3 diffs)
-
src/com/kh/ssme/rest/parsers/JSONEntityCreator.java (modified) (4 diffs)
-
src/com/kh/ssme/rest/parsers/JSONEntityMerger.java (modified) (3 diffs)
-
web/css/ssme.css (modified) (2 diffs)
-
web/group.jsp (modified) (1 diff)
-
web/script/facebox.js (modified) (5 diffs)
-
web/script/group.js (modified) (4 diffs)
-
web/script/user.js (modified) (6 diffs)
-
web/script/util.js (added)
-
web/user.jsp (modified) (1 diff)
-
web/WEB-INF/tags/group.tag (modified) (1 diff)
-
web/WEB-INF/tags/head.tag (modified) (1 diff)
-
web/WEB-INF/tags/page.tag (modified) (1 diff)
-
web/WEB-INF/tags/user.tag (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ssme/trunk/src/com/kh/ssme/business/GroupService.java
r4018 r4026 28 28 import com.kh.ssme.manage.GroupManager; 29 29 import com.kh.ssme.manage.PersistenceManager; 30 import com.kh.ssme.manage.UserManager; 30 31 import com.kh.ssme.model.entity.GroupEntity; 31 32 import com.kh.ssme.model.ifc.Group; 33 import com.kh.ssme.model.ifc.User; 32 34 import com.kh.ssme.rest.parsers.EntityParserTools; 33 35 … … 40 42 private static final Logger logger_ = LoggerFactory.getLogger(GroupService.class); 41 43 42 public static Group create(Object o){44 public static Group create(Object json){ 43 45 PersistenceManager.getInstance().beginTransaction(); 44 46 try{ 45 47 Group group = new GroupEntity(); 46 EntityParserTools.getMerger( o).parseAndMerge(o, group);48 EntityParserTools.getMerger(json).parseAndMerge(json, group); 47 49 GroupManager.createGroup(group); 50 UserManager.addToOwnedGroups(group.getOwner(), group); 48 51 PersistenceManager.getInstance().commitTransaction(); 49 52 return group; … … 55 58 } 56 59 57 public static Group update(String uuid, Object o){60 public static Group update(String uuid, Object json){ 58 61 PersistenceManager.getInstance().beginTransaction(); 59 62 try{ 60 63 Group group = GroupManager.findGroupByUUID(uuid); 61 EntityParserTools.getMerger( o).parseAndMerge(o, group);64 EntityParserTools.getMerger(json).parseAndMerge(json, group); 62 65 PersistenceManager.getInstance().commitTransaction(); 63 66 return group; -
ssme/trunk/src/com/kh/ssme/business/UserService.java
r4018 r4026 26 26 import org.slf4j.LoggerFactory; 27 27 28 import com.kh.ssme.manage.GroupManager; 28 29 import com.kh.ssme.manage.PersistenceManager; 29 30 import com.kh.ssme.manage.UserManager; … … 92 93 } 93 94 95 94 96 } -
ssme/trunk/src/com/kh/ssme/manage/GroupManager.java
r4020 r4026 30 30 import com.kh.ssme.model.entity.GroupEntity; 31 31 import com.kh.ssme.model.ifc.Group; 32 import com.kh.ssme.model.ifc.User; 32 33 33 34 /** … … 105 106 return null; 106 107 } 108 109 /** 110 * Adds user to group 111 * @param group 112 * @param user 113 */ 114 public static void joinUserToGroup(Group group, User user) { 115 logger_.debug("User "+user+" added to group "+group); 116 if(!group.getUsers().contains(user)){ 117 group.getUsers().add(user); 118 PersistenceManager.getInstance().persistEntity(group); 119 } 120 } 121 107 122 } -
ssme/trunk/src/com/kh/ssme/manage/UserManager.java
r4020 r4026 29 29 30 30 import com.kh.ssme.model.entity.UserEntity; 31 import com.kh.ssme.model.ifc.Group; 31 32 import com.kh.ssme.model.ifc.User; 32 33 … … 104 105 } 105 106 return null; 107 } 108 109 /** 110 * Adds given group to users owned groups 111 * @param owner 112 * @param group 113 */ 114 public static void addToOwnedGroups(User owner, Group group) { 115 logger_.debug("Group "+group+" added to user "+owner+" owned groups "); 116 if(!owner.getOwnedGroups().contains(group)){ 117 owner.getOwnedGroups().add(group); 118 PersistenceManager.getInstance().persistEntity(owner); 119 } 106 120 } 107 121 -
ssme/trunk/src/com/kh/ssme/model/entity/BasicDataEntity.java
r4020 r4026 38 38 39 39 /** 40 * @author Michal Szopinski41 * @param <T>42 40 * 43 41 */ -
ssme/trunk/src/com/kh/ssme/model/entity/GroupEntity.java
r4022 r4026 23 23 package com.kh.ssme.model.entity; 24 24 25 import java.util. Set;26 import java.util. TreeSet;25 import java.util.ArrayList; 26 import java.util.List; 27 27 28 28 import javax.persistence.Basic; … … 64 64 joinColumns=@JoinColumn(name="ugroup__id", referencedColumnName="id"), 65 65 inverseJoinColumns=@JoinColumn(name="user__id", referencedColumnName="id")) 66 private Set<User> users_ = new TreeSet<User>();66 private List<User> users_ = new ArrayList<User>(); 67 67 68 68 @ManyToOne(optional=false, targetEntity=UserEntity.class) 69 @JoinColumn(name=" user_id", nullable=false, updatable=false)69 @JoinColumn(name="owner_user_id", nullable=false, updatable=false) 70 70 private User owner_; 71 71 … … 125 125 */ 126 126 @Override 127 public Set<User> getUsers() {127 public List<User> getUsers() { 128 128 return users_; 129 129 } 130 130 131 131 /* (non-Javadoc) 132 * @see com.kh.ssme.model.ifc.Group#setUsers(java.util. Set)132 * @see com.kh.ssme.model.ifc.Group#setUsers(java.util.List) 133 133 */ 134 134 @Override 135 public void setUsers( Set<User> users) {135 public void setUsers(List<User> users) { 136 136 users_ = users; 137 137 } -
ssme/trunk/src/com/kh/ssme/model/entity/UserEntity.java
r4022 r4026 23 23 package com.kh.ssme.model.entity; 24 24 25 import java.util. Set;26 import java.util. TreeSet;25 import java.util.ArrayList; 26 import java.util.List; 27 27 28 28 import javax.persistence.Basic; … … 73 73 74 74 @ManyToMany(targetEntity=GroupEntity.class, mappedBy="users_", cascade=CascadeType.ALL) 75 private Set<Group> groups_ = new TreeSet<Group>();75 private List<Group> groups_ = new ArrayList<Group>(); 76 76 77 77 @OneToMany(targetEntity=StayPlaceEntity.class, cascade=CascadeType.ALL, mappedBy="user_") 78 private Set<StayPlace> stayPlaces_ = new TreeSet<StayPlace>();78 private List<StayPlace> stayPlaces_ = new ArrayList<StayPlace>(); 79 79 80 80 @OneToMany(targetEntity=CalendarEntity.class, cascade=CascadeType.ALL, mappedBy="user_") 81 private Set<com.kh.ssme.model.ifc.Calendar> calendars_ = new TreeSet<com.kh.ssme.model.ifc.Calendar>();81 private List<com.kh.ssme.model.ifc.Calendar> calendars_ = new ArrayList<com.kh.ssme.model.ifc.Calendar>(); 82 82 83 83 @OneToMany(targetEntity=GroupEntity.class, cascade=CascadeType.ALL, mappedBy="owner_") 84 private Set<Group> ownedGroups_ = new TreeSet<Group>();84 private List<Group> ownedGroups_ = new ArrayList<Group>(); 85 85 86 86 … … 188 188 189 189 @Override 190 public Set<Group> getGroups() {190 public List<Group> getGroups() { 191 191 return groups_; 192 192 } 193 193 194 194 @Override 195 public void setGroups( Set<Group> groups) {195 public void setGroups(List<Group> groups) { 196 196 groups_ = groups; 197 197 } … … 201 201 */ 202 202 @Override 203 public Set<StayPlace> getStayPlaces() {203 public List<StayPlace> getStayPlaces() { 204 204 return stayPlaces_; 205 205 } 206 206 207 207 /* (non-Javadoc) 208 * @see com.kh.ssme.model.ifc.User#setStayPlaces(java.util. Set)209 */ 210 @Override 211 public void setStayPlaces( Set<StayPlace> stayPlaces) {208 * @see com.kh.ssme.model.ifc.User#setStayPlaces(java.util.List) 209 */ 210 @Override 211 public void setStayPlaces(List<StayPlace> stayPlaces) { 212 212 stayPlaces_ = stayPlaces; 213 213 } … … 217 217 */ 218 218 @Override 219 public Set<com.kh.ssme.model.ifc.Calendar> getCalendars() {219 public List<com.kh.ssme.model.ifc.Calendar> getCalendars() { 220 220 return calendars_; 221 221 } 222 222 223 223 /* (non-Javadoc) 224 * @see com.kh.ssme.model.ifc.User#setCalendars(java.util. Set)225 */ 226 @Override 227 public void setCalendars( Set<com.kh.ssme.model.ifc.Calendar> calendars) {224 * @see com.kh.ssme.model.ifc.User#setCalendars(java.util.List) 225 */ 226 @Override 227 public void setCalendars(List<com.kh.ssme.model.ifc.Calendar> calendars) { 228 228 calendars_ = calendars; 229 229 } … … 233 233 */ 234 234 @Override 235 public Set<Group> getOwnedGroups() {235 public List<Group> getOwnedGroups() { 236 236 return ownedGroups_; 237 237 } 238 238 239 239 /* (non-Javadoc) 240 * @see com.kh.ssme.model.ifc.User#setOwnedGroups(java.util. Set)241 */ 242 @Override 243 public void setOwnedGroups( Set<Group> ownedGroups) {240 * @see com.kh.ssme.model.ifc.User#setOwnedGroups(java.util.List) 241 */ 242 @Override 243 public void setOwnedGroups(List<Group> ownedGroups) { 244 244 ownedGroups_ = ownedGroups; 245 245 } -
ssme/trunk/src/com/kh/ssme/model/ifc/Group.java
r4022 r4026 23 23 package com.kh.ssme.model.ifc; 24 24 25 import java.util. Set;25 import java.util.List; 26 26 27 27 /** … … 32 32 //private String name_ = ""; 33 33 //private String description_ = ""; 34 //private Set<User> users_ = new TreeSet<User>();34 //private List<User> users_ = new ArrayList<User>(); 35 35 //private User owner_ = new User(); 36 36 … … 44 44 public void setDescription(String description); 45 45 46 public Set<User> getUsers();46 public List<User> getUsers(); 47 47 48 public void setUsers( Set<User> users);48 public void setUsers(List<User> users); 49 49 50 50 public User getOwner(); -
ssme/trunk/src/com/kh/ssme/model/ifc/User.java
r4022 r4026 23 23 package com.kh.ssme.model.ifc; 24 24 25 import java.util.Set; 26 27 import javax.persistence.Basic; 28 import javax.persistence.Column; 25 import java.util.List; 29 26 30 27 /** … … 38 35 //private String mail_ = ""; 39 36 //private String mobile_ = ""; 40 //private Set<GroupEntity> groups = new TreeSet<GroupEntity>();41 //private Set<StayPlace> stayPlaces_ = new TreeSet<StayPlace>();42 //private Set<com.kh.ssme.model.ifc.Calendar> calendars_ = new TreeSet<com.kh.ssme.model.ifc.Calendar>();43 //private Set<Group> ownedGroups_ = new TreeSet<Group>();37 //private List<GroupEntity> groups = new ArrayList<GroupEntity>(); 38 //private List<StayPlace> stayPlaces_ = new ArrayList<StayPlace>(); 39 //private List<com.kh.ssme.model.ifc.Calendar> calendars_ = new ArrayList<com.kh.ssme.model.ifc.Calendar>(); 40 //private List<Group> ownedGroups_ = new ArrayList<Group>(); 44 41 45 42 public String getLogin(); … … 63 60 public void setMobile(String mobile); 64 61 65 public Set<Group> getGroups();62 public List<Group> getGroups(); 66 63 67 public void setGroups( Set<Group> groups);64 public void setGroups(List<Group> groups); 68 65 69 public Set<StayPlace> getStayPlaces();66 public List<StayPlace> getStayPlaces(); 70 67 71 public void setStayPlaces( Set<StayPlace> stayPlaces);68 public void setStayPlaces(List<StayPlace> stayPlaces); 72 69 73 public Set<com.kh.ssme.model.ifc.Calendar> getCalendars();70 public List<com.kh.ssme.model.ifc.Calendar> getCalendars(); 74 71 75 public void setCalendars( Set<com.kh.ssme.model.ifc.Calendar> calendars);72 public void setCalendars(List<com.kh.ssme.model.ifc.Calendar> calendars); 76 73 77 public Set<Group> getOwnedGroups();74 public List<Group> getOwnedGroups(); 78 75 79 public void setOwnedGroups( Set<Group> ownedGroups);76 public void setOwnedGroups(List<Group> ownedGroups); 80 77 81 78 } -
ssme/trunk/src/com/kh/ssme/rest/parsers/JSONEntityCreator.java
r4022 r4026 111 111 //private User owner_ = new User(); 112 112 113 create((BasicData)group, json); 114 113 115 if(group.getName() != null){ 114 116 json.put("name", group.getName()); … … 118 120 json.put("description", group.getDescription()); 119 121 } 122 123 if(group.getOwner() != null){ 124 JSONObject owner = new JSONObject(); 125 create(group.getOwner(), owner); 126 json.put("owner", owner); 127 } 120 128 121 129 if(group.getUsers() != null){ … … 128 136 json.put("users", users); 129 137 } 130 131 if(group.getOwner() != null){ 132 json.put("owner", group.getOwner().getUUID()); 133 } 138 134 139 } 135 140 … … 211 216 //private Set<com.kh.ssme.model.ifc.Calendar> calendars_ = new TreeSet<com.kh.ssme.model.ifc.Calendar>(); 212 217 //private Set<Group> ownedGroups_ = new TreeSet<Group>(); 218 219 create((BasicData)user, json); 213 220 214 221 if(user.getLogin() != null){ -
ssme/trunk/src/com/kh/ssme/rest/parsers/JSONEntityMerger.java
r4022 r4026 110 110 //private User owner_ = new User(); 111 111 112 JSONObject json = (JSONObject)o; 113 Set<User> tempSet = new TreeSet<User>(); 112 JSONObject json = (JSONObject)o; 114 113 115 114 String name = (String) json.get("name"); … … 125 124 JSONArray users = (JSONArray) json.get("users"); 126 125 if(users != null){ 126 group.getUsers().clear(); 127 127 for (Object ob : users) { 128 String uuid = (String) ob; 129 if(uuid!=null){ 130 boolean add = true; 131 for(User u : group.getUsers()){ 132 if(uuid.equalsIgnoreCase(u.getUUID())){ 133 tempSet.add(u); 134 add = false; 135 break; 136 } 137 } 138 if(add){ 139 tempSet.add(UserManager.findUserByUUID(uuid)); 140 } 141 } 128 String uuid = (String) ob; 129 group.getUsers().add(UserManager.findUserByUUID(uuid)); 142 130 } 143 group.getUsers().clear();144 group.getUsers().addAll(tempSet);145 tempSet.clear();146 131 } 147 132 … … 250 235 user.setMobile(mobile); 251 236 } 252 253 Set<Group> tempSet = new TreeSet<Group>(); 237 254 238 JSONArray groups = (JSONArray) json.get("groups"); 255 239 if(groups != null){ 240 user.getGroups().clear(); 256 241 for (Object ob : groups) { 257 242 String uuid = (String) ob; 258 if(uuid!=null){ 259 boolean add = true; 260 for(Group g : user.getGroups()){ 261 if(uuid.equalsIgnoreCase(g.getUUID())){ 262 tempSet.add(g); 263 add = false; 264 break; 265 } 266 } 267 if(add){ 268 tempSet.add(GroupManager.findGroupByUUID(uuid)); 269 } 270 } 243 user.getGroups().add(GroupManager.findGroupByUUID(uuid)); 271 244 } 272 user.getGroups().clear(); 273 user.getGroups().addAll(tempSet); 274 275 } 276 277 tempSet.clear(); 245 } 246 278 247 JSONArray ownedGroups = (JSONArray) json.get("ownedGroups"); 279 248 if(ownedGroups != null){ 249 user.getOwnedGroups().clear(); 280 250 for (Object ob : ownedGroups) { 281 251 String uuid = (String) ob; 282 if(uuid!=null){ 283 boolean add = true; 284 for(Group g : user.getOwnedGroups()){ 285 if(uuid.equalsIgnoreCase(g.getUUID())){ 286 tempSet.add(g); 287 add = false; 288 break; 289 } 290 } 291 if(add){ 292 tempSet.add(GroupManager.findGroupByUUID(uuid)); 293 } 294 } 252 user.getOwnedGroups().add(GroupManager.findGroupByUUID(uuid)); 295 253 } 296 user.getOwnedGroups().clear();297 user.getOwnedGroups().addAll(tempSet);298 254 } 299 255 -
ssme/trunk/web/css/ssme.css
r4022 r4026 66 66 } 67 67 68 69 70 /** 71 * form fields 72 */ 68 73 input{ 69 74 border: 0px solid red; … … 87 92 opacity:0.6 ; 88 93 font-color: black; 94 } 95 96 97 98 /** 99 * lists of 100 * users, groups 101 */ 102 ul.groupList, ul.userList{ 103 list-style-type: none 104 } 105 ul.groupList li, ul.userList li{ 106 padding: 3px; 107 108 } 109 110 111 112 /** 113 * Wrappers 114 */ 115 .excludedFromLayout{ 116 visibility: hidden; 117 position: absolute; 118 } 119 span .container{ 120 padding: 0px; 121 margin: 0px; 122 border: 0px; 123 } 124 125 126 127 /** 128 * Toggle buttons 129 */ 130 .toggleButton { 131 border: 2px solid #bbffbb; 132 padding: 1px 3px 1px 3px; 133 margin-left: 2px; 134 margin-right: 2px; 135 } 136 137 .toggleOn { 138 border-style: inset; 139 } 140 141 .toggleOff { 142 border-style: outset; 89 143 } 90 91 .detailsButton { 144 145 146 147 /** 148 * buttons 149 */ 150 a { 151 text-decoration: none; 152 } 153 a .faceboxButton { 154 border:2px outset #bbffbb; 155 padding: 1px 3px 1px 3px; 156 } 157 a:hover .faceboxButton{ 92 158 border:1px outset #bbffbb; 159 padding: 2px 4px 2px 4px; 93 160 } 161 162 a:active .faceboxButton{ 163 border:1px inset #bbffbb; 164 padding: 2px 4px 2px 4px; 165 } 166 167 .button a{ 168 border:2px outset #bbffbb; 169 padding: 1px 3px 1px 3px; 170 } 171 .button a:hover{ 172 border:1px outset #bbffbb; 173 padding: 2px 4px 2px 4px; 174 } 175 176 .button a:active{ 177 border:1px inset #bbffbb; 178 padding: 2px 4px 2px 4px; 179 } 180 94 181 95 182 -
ssme/trunk/web/group.jsp
r4022 r4026 10 10 11 11 <jsp:body> 12 12 13 <ssme:group id="group" editable="true" /> 14 15 <ssme:user id="userDetails" infoOnly="true" /> 16 13 17 </jsp:body> 14 18 -
ssme/trunk/web/script/facebox.js
r4025 r4026 93 93 var f = this; 94 94 $$('a[rel=facebox]').each(function(elem,i){ 95 Event.observe(elem, 'click', function(e){ 96 // console.log("here's what f is :: "+ f); 95 Event.observe(elem, 'click', function(e){ 97 96 Event.stop(e); 98 97 f.click_handler(elem, e); 99 98 }); 100 99 }); 101 102 100 }, 103 101 … … 138 136 139 137 close : function(){ 138 // restore parent 139 this.restore_to_parent(); 140 140 141 new Effect.Fade('facebox', { duration: 0.2 }); 141 142 }, … … 143 144 setLocation: function(){ 144 145 var pageScroll = document.viewport.getScrollOffsets(); 145 var top = /*pageScroll.top +*/(document.viewport.getHeight()/ 10);146 var top = pageScroll.top + (document.viewport.getHeight()/ 10); 146 147 var left = (document.viewport.getWidth()/2) - ($('facebox').getWidth()) + ($('facebox').getWidth()/2); 147 148 $('facebox').setStyle({ … … 174 175 175 176 click_handler : function(elem, e){ 177 // restore parent 178 this.restore_to_parent(); 179 176 180 this.loading(); 177 181 Event.stop(e); … … 206 210 fb.ajax(url, klass); 207 211 } 212 }, 213 214 215 216 //----------------------------------------------------------------- 217 // SSME specific 218 /** 219 * Reference to parent of element that will be show in facebox 220 */ 221 parent : null, 222 /** 223 * contetn id 224 */ 225 contentID : null, 226 227 /** 228 * Restores content to it's basic parent 229 */ 230 restore_to_parent : function(){ 231 if(this.parent!=null){ 232 Element.insert(this.parent, { bottom: $(this.contentID).remove() }); 233 } 234 this.parent = null; 235 }, 236 237 buttonClick_handler : function(elem){ 238 // restore parent 239 this.restore_to_parent(); 240 241 this.loading(); 242 243 // div 244 this.open(); 245 246 if (elem.href.match(/#/)){ 247 var url = window.location.href.split('#')[0]; 248 this.contentID = elem.href.replace(url+'#',''); 249 250 //store parent and move object 251 var d = $(this.contentID); 252 this.parent = d.parentNode; 253 var data = new Element(d.parentNode.tagName); 254 Element.insert(data, { bottom: d.remove() }); //move object 255 256 this.reveal(data, ''); 257 } 208 258 } 259 //----------------------------------------------------------------- 260 209 261 }); 210 262 -
ssme/trunk/web/script/group.js
r4023 r4026 5 5 6 6 Group.prototype = { 7 //------------------------------------------- 8 // ATTRIBUTES 9 // 7 10 /** 8 11 * unique ID of this component … … 25 28 thisForm : null, 26 29 30 // 31 //------------------------------------------- 32 33 34 35 //------------------------------------------- 36 // INITIALIZE 37 // 27 38 initialize: function(formElement){ 28 $('logger').innerHTML += "Group.initialize()" + "<br/>";39 29 40 this.id = Element.identify(formElement); 30 $('logger').innerHTML += "formElement.id:[" + this.id + "]";41 Logger.debug("Group.initialize() formElement.id:[" + this.id + "] UUDI[" + $(this.id+"_uuid").value + "]"); 31 42 this.thisForm = { 43 //fields 32 44 uuid : $(this.id+"_uuid"), 33 45 name : $(this.id+"_name"), 34 46 description : $(this.id+"_description"), 35 owner_login : $(this.id+"_owner_login") 47 owner_login : $(this.id+"_owner_login"), 48 49 //buttons 50 apply_button: $(this.id+"_apply"), 51 edit_button : $(this.id+"_edit") 36 52 }; 53 this.isNew = (this.thisForm.uuid.value == ""); 54 55 //submit button 56 if(this.thisForm.apply_button){ 57 this.thisForm.apply_button.onclick = this.onApply.bindAsEventListener(this); 58 } 59 37 60 //editable 38 $(this.id+"_edit").checked = true;39 $(this.id+"_edit").onmouseup = this.changeEdit.bindAsEventListener(this, $(this.id+"_edit"));40 $(this.id+"_edit").onmouseup();41 $(this.id+"_edit").checked = false;61 if(this.thisForm.edit_button){ 62 this.thisForm.edit_button.toggle.toggleOn = this.onEdit.bindAsEventListener(this, this.thisForm.edit_button, $$("#"+this.id+" tr.controlRow .submit")[0]); 63 this.thisForm.edit_button.toggle.toggleOff = this.onEdit.bindAsEventListener(this, this.thisForm.edit_button, $$("#"+this.id+" tr.controlRow .submit")[0]); 64 } 42 65 43 66 //users list - details buttons 44 67 $$("ul.userList li").each( 45 68 function(el){ 46 var elId = el.identify(); 47 $$('#'+elId+' input.detailsButton')[0].onmouseup = this.onGroupLiClick.bindAsEventListener(this, el, elId); 48 }.bind(this) 69 var liId = el.identify(); 70 var aElement = $$('#'+liId+' span.detailsButton a')[0]; 71 aElement.onclick = this.onUserLiClick.bindAsEventListener(this, aElement, liId); 72 }.bind(this) 49 73 ); 74 75 //add to instances 76 Group.instances.set(this.id, this); 50 77 }, 51 52 loadGroup: function(group){ 78 /** 79 * Catch the onsubmit event - to make sure it is not submitted :) 80 */ 81 onSubmit : function(event) 82 { 83 return false; 84 }, 85 86 // 87 //------------------------------------------- 88 89 90 91 //------------------------------------------- 92 // LOAD 93 // 94 95 loadGroup: function(group){ 53 96 this.thisForm.uuid.value = group.uuid; 54 97 this.thisForm.name.value = group.name; 55 this.thisForm. name.description.iinnerHTML = group.description;98 this.thisForm.description.innerHTML = group.description; 56 99 this.thisForm.owner_login.value = group.owner.login; 100 Logger.debug("Group.loadGroup() : " + group.uuid + " | " + group.name + " | " + group.owner.login + " | " + group.owner); 57 101 58 102 this.isNew = (this.thisForm.uuid.value == ""); 59 103 }, 60 104 61 load: function(){ 62 63 var req = new Ajax.Request("/group/"+this.thisForm.uuid.value, 64 { 65 method: "get", 66 onSuccess: function(resp) 67 { 68 if ( resp.responseJSON === null ) 69 { 70 resp.responseJSON = resp.responseText.evalJSON(); 71 } 72 this.loadGroup(resp.responseJSON); 73 if (this.onLoad != null) 74 { 75 this.onLoad(this, true); 76 } 77 } 78 .bind(this), 79 onFailure: function(transport, problem) 80 { 81 try { console.debug(problem); } catch (e) {}; 82 if (this.onLoad != null) 83 { 84 this.onLoad(this, true); 85 } 86 } 87 .bind(this) 88 }); 105 load: function(uuid){ 106 107 if(uuid){ 108 this.thisForm.uuid.value = uuid; 109 } 110 111 Logger.debug("Group.load() PATH : " + CONTEXT_PATH+"/group/"+this.thisForm.uuid.value); 112 var req = new Ajax.Request(CONTEXT_PATH+"/group/"+this.thisForm.uuid.value, 113 { 114 method: "get", 115 onSuccess: function(resp){ 116 if ( resp.responseJSON === null ) 117 { 118 resp.responseJSON = resp.responseText.evalJSON(); 119 } 120 this.loadGroup(resp.responseJSON); 121 if (this.onLoad != null) 122 { 123 this.onLoad(this, true); 124 } 125 }.bind(this), 126 onFailure: function(transport, problem){ 127 Logger.error("Group.load.onFailure TRANSPORT:" + Util.listAttributes(transport) + " PROBLEM:" + Util.listAttributes(problem)); 128 try { console.debug(problem); } catch (e) {}; 129 if (this.onLoad != null) 130 { 131 this.onLoad(this, true); 132 } 133 }.bind(this) 134 }); 89 135 90 136 }, 137 138 /** 139 * on-load callback function (this-object, wasSuccessful) 140 */ 141 onLoad: null, 142 143 // 144 //------------------------------------------- 145 146 147 148 //------------------------------------------- 149 // SAVE 150 // 91 151 92 152 saveGroup: function(group){ … … 94 154 }, 95 155 96 /** 97 * on-load callback function (this-object, wasSuccessful) 98 */ 99 onLoad: null, 156 save: function(){ 157 var groupObject = $H( 158 { 159 uuid : this.thisForm.uuid.value, 160 name : this.thisForm.name.value, 161 description : this.thisForm.description.value, 162 owner_login : this.thisForm.owner_login.value 163 }); 164 165 Logger.debug("Group.save() Group.toJSON() : " + groupObject.toJSON()); 166 167 var _method = ( this.isNew ) ? "put" : "post"; 168 var additionalParameter = ( this.isNew ) ? "?_method=put" : ""; 169 170 Logger.debug("Group.save() PATH : " + CONTEXT_PATH+"/group/"+this.thisForm.uuid.value+additionalParameter); 171 var req = new Ajax.Request(CONTEXT_PATH+"/group/"+this.thisForm.uuid.value+additionalParameter, 172 { 173 method: _method, 174 contentType: "application/json", 175 postBody: groupObject.toJSON(), 176 onSuccess: this.onSuccessSave.bind(this), 177 onComplete: function(resp){ 178 Logger.debug("Group.save.onComplete : RESP:" + resp); 179 }, 180 onFailure: function(transport, problem){ 181 Logger.error("Group.save.onFailure TRANSPORT:" + Util.listAttributes(transport) + " PROBLEM:" + Util.listAttributes(problem)); 182 try { console.debug(problem); } catch (e) {}; 183 if (this.onSave != null) 184 { 185 this.onSave(this, false); 186 } 187 }.bind(this) 188 }); 189 }, 190 191 /** 192 * It was impossible to find any bug when it was inside the previous 193 * function. 194 */ 195 onSuccessSave: function(resp) { 196 if ( resp.responseJSON === null ) 197 { 198 resp.responseJSON = resp.responseText.evalJSON(); 199 } 200 this.loadGroup(resp.responseJSON); 201 if (this.onSave != null) 202 { 203 this.onSave(this, true); 204 } 205 }, 100 206 101 207 /** … … 103 209 */ 104 210 onSave: null, 105 106 onGroupLiClick: function(event, element, elId){ 107 facebox.reveal(event+'<br/>'+element+'<br/>'+elId+'</br> for group with UUID:'+this.thisForm.uuid.value,''); 211 212 // 213 //------------------------------------------- 214 215 216 217 //------------------------------------------- 218 // LISTENERS 219 // 220 221 onApply: function(event){ 222 Logger.debug("Group.onApply"); 223 this.save(); 108 224 }, 109 225 110 changeEdit: function(event, element){ 111 var disable = element.checked; 112 $('logger').innerHTML += disable+' -> '+element.checked + "<br/>"; 113 $$('#'+this.id+' .editable').each( 226 onCancel: function(event){ 227 Logger.debug("Group.onCancel"); 228 this.load(this.thisForm.uuid.value); 229 }, 230 231 onEdit: function(event, element, submit){ 232 var isOn = element.toggle.stateIsOn 233 Logger.debug("Group.onEdit isOn["+isOn+"]"); 234 $$('#'+this.id+' input.editable').each( 114 235 function(el){ 115 el.disabled = disable;116 Element.addClassName(el,( disable)?'disabledInput':'enabledInput');117 Element.removeClassName(el,( disable)?'enabledInput':'disabledInput');236 el.disabled = !isOn; 237 Element.addClassName(el,(isOn)?'enabledInput':'disabledInput'); 238 Element.removeClassName(el,(isOn)?'disabledInput':'enabledInput'); 118 239 }.bind(this) 119 240 ); 120 } 241 if(isOn){ //enable submit 242 Element.removeClassName(submit,'excludedFromLayout'); 243 } else { //disable submit 244 Element.addClassName(submit,'excludedFromLayout'); 245 this.onCancel(event); 246 } 247 }, 248 249 onUserLiClick: function(event, element, liId){ /* element: <a>, liId: UUID */ 250 251 Event.stop(event); 252 User.instances.get('userDetails').onLoad = function (){ 253 facebox.buttonClick_handler(element); 254 } 255 User.instances.get('userDetails').load(liId); 256 257 }, 258 259 // 260 //------------------------------------------- 121 261 122 262 } 123 263 264 /** 265 * Collection of Group instances 266 */ 267 Group.instances = $H({}); 268 124 269 Group.preload = function() { 125 $('logger').innerHTML += "Group.preload()" + "<br/>";270 Logger.debug("Group.preload()"); 126 271 $$("form.groupForm").each( 127 272 function(form){ -
ssme/trunk/web/script/user.js
r4023 r4026 5 5 6 6 User.prototype = { 7 //------------------------------------------- 8 // ATTRIBUTES 9 // 7 10 /** 8 11 * unique ID of this component … … 23 26 * The form that represents the user 24 27 */ 25 thisForm : null, 26 28 thisForm : null, 29 30 // 31 //------------------------------------------- 32 33 34 35 36 //------------------------------------------- 37 // INITIALIZE 38 // 27 39 initialize: function(formElement){ 28 $('logger').innerHTML += "User.initialize()" + "<br/>";40 29 41 this.id = Element.identify(formElement); 30 $('logger').innerHTML += "formElement.id:[" + this.id + "]";42 Logger.debug("User.initialize() formElement.id:[" + this.id + "] UUDI[" + $(this.id+"_uuid").value + "]"); 31 43 this.thisForm = { 44 // fields 32 45 uuid : $(this.id+"_uuid"), 33 46 login : $(this.id+"_login"), … … 35 48 surname : $(this.id+"_surname"), 36 49 mail : $(this.id+"_mail"), 37 mobile : $(this.id+"_mobile") 50 mobile : $(this.id+"_mobile"), 51 52 //buttons 53 apply_button: $(this.id+"_apply"), 54 edit_button : $(this.id+"_edit") 38 55 }; 56 this.isNew = (this.thisForm.uuid.value == ""); 57 58 //submit button 59 if(this.thisForm.apply_button){ 60 this.thisForm.apply_button.onclick = this.onApply.bindAsEventListener(this); 61 } 62 39 63 //editable 40 $('logger').innerHTML += (this.id+"_edit")+' -> '+$(this.id+"_edit") + "<br/>"; 41 $(this.id+"_edit").checked = true; 42 $(this.id+"_edit").onmouseup = this.changeEdit.bindAsEventListener(this, $(this.id+"_edit")); 43 $(this.id+"_edit").onmouseup(); 44 $(this.id+"_edit").checked = false; 64 if(this.thisForm.edit_button){ 65 this.thisForm.edit_button.toggle.toggleOn = this.onEdit.bindAsEventListener(this, this.thisForm.edit_button, $$("#"+this.id+" tr.controlRow .submit")[0]); 66 this.thisForm.edit_button.toggle.toggleOff = this.onEdit.bindAsEventListener(this, this.thisForm.edit_button, $$("#"+this.id+" tr.controlRow .submit")[0]); 67 } 45 68 46 69 //group lists - details buttons 47 70 $$("ul.groupList li").each( 48 71 function(el){ 49 var elId = el.identify(); 50 $$('#'+elId+' input.detailsButton')[0].onmouseup = this.onGroupLiClick.bindAsEventListener(this, el, elId); 51 }.bind(this) 52 ); 72 var liId = el.identify(); 73 var aElement = $$('#'+liId+' span.detailsButton a')[0]; 74 aElement.onclick = this.onGroupLiClick.bindAsEventListener(this, aElement, liId); 75 }.bind(this) 76 ); 77 78 79 //add to instances 80 User.instances.set(this.id, this); 53 81 }, 82 83 /** 84 * Catch the onsubmit event - to make sure it is not submitted :) 85 */ 86 onSubmit : function(event) 87 { 88 return false; 89 }, 90 91 // 92 //------------------------------------------- 93 94 95 96 //------------------------------------------- 97 // LOAD 98 // 54 99 55 100 loadUser: function(user){ … … 60 105 this.thisForm.mail.value = user.mail; 61 106 this.thisForm.mobile.value = user.mobile; 62 107 63 108 this.isNew = (this.thisForm.uuid.value == ""); 64 109 }, 65 110 66 load: function(){ 67 68 var req = new Ajax.Request("/user/"+this.thisForm.uuid.value, 69 { 70 method: "get", 71 onSuccess: function(resp) 72 { 73 if ( resp.responseJSON === null ) 74 { 75 resp.responseJSON = resp.responseText.evalJSON(); 76 } 77 this.loadUser(resp.responseJSON); 78 if (this.onLoad != null) 79 { 80 this.onLoad(this, true); 81 } 82 } 83 .bind(this), 84 onFailure: function(transport, problem) 85 { 86 try { console.debug(problem); } catch (e) {}; 87 if (this.onLoad != null) 88 { 89 this.onLoad(this, true); 90 } 91 } 92 .bind(this) 93 }); 111 load: function(uuid){ 112 113 if(uuid){ 114 this.thisForm.uuid.value = uuid; 115 } 116 117 Logger.debug("User.load() PATH : " + CONTEXT_PATH+"/user/"+this.thisForm.uuid.value); 118 var req = new Ajax.Request(CONTEXT_PATH+"/user/"+this.thisForm.uuid.value, 119 { 120 method: "get", 121 onSuccess: function(resp){ 122 if ( resp.responseJSON === null ) 123 { 124 resp.responseJSON = resp.responseText.evalJSON(); 125 } 126 this.loadUser(resp.responseJSON); 127 if (this.onLoad != null) 128 { 129 this.onLoad(this, true); 130 } 131 }.bind(this), 132 onFailure: function(transport, problem){ 133 Logger.error("User.load.onFailure TRANSPORT:" + Util.listAttributes(transport) + " PROBLEM:" + Util.listAttributes(problem)); 134 try { console.debug(problem); } catch (e) {}; 135 if (this.onLoad != null) 136 { 137 this.onLoad(this, true); 138 } 139 }.bind(this) 140 }); 94 141 95 }, 142 }, 143 144 /** 145 * on-load callback function (this-object, wasSuccessful) 146 */ 147 onLoad: null, 148 149 // 150 //------------------------------------------- 151 152 153 154 //------------------------------------------- 155 // SAVE 156 // 96 157 97 158 saveUser: function(user){ … … 101 162 102 163 save: function(){ 103 104 }, 105 106 /** 107 * on-load callback function (this-object, wasSuccessful) 108 */ 109 onLoad: null, 164 var userObject = $H( 165 { 166 uuid : this.thisForm.uuid.value, 167 login : this.thisForm.login.value, 168 name : this.thisForm.name.value, 169 surname : this.thisForm.surname.value, 170 mail : this.thisForm.mail.value, 171 mobile : this.thisForm.mobile.value 172 }); 173 174 Logger.debug("User.save() User.toJSON() : " + userObject.toJSON()); 175 176 var _method = ( this.isNew ) ? "put" : "post"; 177 var additionalParameter = ( this.isNew ) ? "?_method=put" : ""; 178 179 Logger.debug("User.save() PATH : " + CONTEXT_PATH+"/user/"+this.thisForm.uuid.value+additionalParameter); 180 var req = new Ajax.Request(CONTEXT_PATH+"/user/"+this.thisForm.uuid.value+additionalParameter, 181 { 182 method: _method, 183 contentType: "application/json", 184 postBody: userObject.toJSON(), 185 onSuccess: this.onSuccessSave.bind(this), 186 onComplete: function(resp){ 187 Logger.debug("User.save.onComplete : RESP:" + resp); 188 }, 189 onFailure: function(transport, problem){ 190 Logger.error("User.save.onFailure TRANSPORT:" + Util.listAttributes(transport) + " PROBLEM:" + Util.listAttributes(problem)); 191 try { console.debug(problem); } catch (e) {}; 192 if (this.onSave != null) 193 { 194 this.onSave(this, false); 195 } 196 }.bind(this) 197 }); 198 }, 199 200 /** 201 * It was impossible to find any bug when it was inside the previous 202 * function. 203 */ 204 onSuccessSave: function(resp) { 205 if ( resp.responseJSON === null ) 206 { 207 208 resp.responseJSON = resp.responseText.evalJSON(); 209 } 210 this.loadUser(resp.responseJSON); 211 if (this.onSave != null) 212 { 213 this.onSave(this, true); 214 } 215 }, 110 216 111 217 /** … … 114 220 onSave: null, 115 221 116 onGroupLiClick: function(event, element, elId){ 117 alert('dimensions : ' + document.viewport.getDimensions() + ' | '+ 118 'width : ' + document.viewport.getDimensions().width + ' | '+ 119 'height : ' + document.viewport.getDimensions().height + ' | '+ 120 ' }' 121 ); 122 //facebox.reveal(event+'<br/>'+element+'<br/>'+elId+'</br> for user with UUID:'+this.thisForm.uuid.value,''); 123 //facebox.reveal('<ssme:user id="user" editable="true" />',''); 222 // 223 //------------------------------------------- 224 225 226 227 //------------------------------------------- 228 // LISTENERS 229 // 230 231 onApply: function(event){ 232 Logger.debug("User.onApply"); 233 this.save(); 124 234 }, 125 235 126 changeEdit: function(event, element){ 127 var disable = element.checked; 128 $('logger').innerHTML += disable+' -> '+element.checked + "<br/>"; 236 onCancel: function(event){ 237 Logger.debug("User.onCancel"); 238 this.load(this.thisForm.uuid.value); 239 }, 240 241 onEdit: function(event, element, submit){ 242 var isOn = element.toggle.stateIsOn 243 Logger.debug("User.onEdit isOn["+isOn+"]"); 129 244 $$('#'+this.id+' input.editable').each( 130 245 function(el){ 131 el.disabled = disable; 132 Element.addClassName(el,(disable)?'disabledInput':'enabledInput'); 133 Element.removeClassName(el,(disable)?'enabledInput':'disabledInput'); 134 }.bind(this) 135 ); 136 } 246 el.disabled = !isOn; 247 Element.addClassName(el,(isOn)?'enabledInput':'disabledInput'); 248 Element.removeClassName(el,(isOn)?'disabledInput':'enabledInput'); 249 }.bind(this) 250 ); 251 if(isOn){ //enable submit 252 Element.removeClassName(submit,'excludedFromLayout'); 253 } else { //disable submit 254 Element.addClassName(submit,'excludedFromLayout'); 255 this.onCancel(event); 256 } 257 }, 258 259 onGroupLiClick: function(event, element, liId){ /* element: <a>, liId: UUID */ 260 261 Event.stop(event); 262 Group.instances.get('groupDetails').onLoad = function (){ 263 facebox.buttonClick_handler(element); 264 } 265 Group.instances.get('groupDetails').load(liId); 266 267 } 268 269 // 270 //------------------------------------------- 137 271 138 272 } 139 273 274 /** 275 * Collection of User instances 276 */ 277 User.instances = $H({}); 278 140 279 User.preload = function() { 141 $('logger').innerHTML += "User.preload()" + "<br/>";280 Logger.debug("User.preload()"); 142 281 $$("form.userForm").each( 143 282 function(form){ -
ssme/trunk/web/user.jsp
r4024 r4026 10 10 11 11 <jsp:body> 12 12 13 <ssme:user id="user" editable="true" /> 13 <!-- <ssme:user id="user" entity="${ rest:findUserByLogin('madmax') }"/> --> 14 15 <ssme:group id="groupDetails" infoOnly="true" /> 14 16 15 <ssme:user id="user" infoOnly="true" />16 17 </jsp:body> 17 18 -
ssme/trunk/web/WEB-INF/tags/group.tag
r4022 r4026 15 15 <c:if test="${ infoOnly eq true }"> 16 16 <c:set var="editable" value="false"/> 17 <c:set var="entity" value="${ null }"/> 18 <c:set var="uuid" value="${ null }"/> 17 19 </c:if> 18 20 19 <form class="groupForm" id="${ id }" action=""> 20 <input type="hidden" id="${ id }_uuid" value="${ uuid }" /> 21 22 <table> 23 <tr class="title"> 24 <td class="label"> 25 <label for="${ id }_name"> 26 Group name: 27 </label> 28 </td> 29 <td> 30 <input id="${ id }_name" class="editable disabledInput" disabled="true" value="${ entity.name }" /> 31 </td> 32 </tr> 33 <tr class="title"> 34 <td class="label"> 35 <label for="${ id }_description"> 36 Description: 37 </label> 38 </td> 39 <td> 40 <textarea id="${ id }_description" class="editable disabledInput" disabled="true" rows="4" cols="30">${ entity.description }</textarea> 41 </td> 42 </tr> 43 <tr class="title"> 44 <td class="label"> 45 <label for="${ id }_owner_login"> 46 Owner: 47 </label> 48 </td> 49 <td> 50 <input id="${ id }_owner_login" class="disabledInput" disabled="true" value="${ entity.owner.login }" /> 51 </td> 52 </tr> 53 <c:if test="${ editable }"> 54 <tr class="title"> 55 <td class="label"> 56 <label for="${ id }_edit"> 57 Edit: 58 </label> 59 </td> 60 <td> 61 <input id="${ id }_edit" type="checkbox" /> 62 </td> 63 </tr> 64 </c:if> 65 </table> 66 67 <c:if test="${ infoOnly != true }"> 68 <ul class="userList"> 69 <c:forEach items="${entity.users}" var="user"> 70 <li id="${ user.UUID }" class="label" > 71 <span> 72 <a href="${pageContext.request.contextPath}/user/${user.UUID}" > 73 ${ user.login } 74 </a> 75 </span> 76 <span> 77 <input class="detailsButton" type="button" value="details" /> 78 </span> 79 </li> 80 </c:forEach> 81 </ul> 82 </c:if> 83 84 </form> 21 <div id="${ id }_wrapper" class="${ (infoOnly)?'excludedFromLayout':'' }"> 22 <form class="groupForm" id="${ id }" action=""> 23 <input type="hidden" id="${ id }_uuid" value="${ uuid }" /> 24 25 <table> 26 <tr> 27 <td class="label"> 28 <label for="${ id }_name"> 29 Group name: 30 </label> 31 </td> 32 <td> 33 <input id="${ id }_name" class="editable disabledInput" disabled="true" value="${ entity.name }" /> 34 </td> 35 </tr> 36 <tr> 37 <td class="label"> 38 <label for="${ id }_description"> 39 Description: 40 </label> 41 </td> 42 <td> 43 <textarea id="${ id }_description" class="editable disabledInput" disabled="true" rows="4" cols="30">${ entity.description }</textarea> 44 </td> 45 </tr> 46 <tr> 47 <td class="label"> 48 <label for="${ id }_owner_login"> 49 Owner: 50 </label> 51 </td> 52 <td> 53 <input id="${ id }_owner_login" class="disabledInput" disabled="true" value="${ entity.owner.login }" /> 54 </td> 55 </tr> 56 <c:if test="${ editable }"> 57 <tr class="controlRow"> 58 <td class="label" /> 59 <td> 60 <span id="${ id }_edit" class="toggleButton">Edit</span> 61 <span class="button excludedFromLayout submit"><a id="${ id }_apply">Apply</a></span> 62 </td> 63 </tr> 64 </c:if> 65 </table> 66 67 <c:if test="${ infoOnly != true }"> 68 <ul class="userList"> 69 <c:forEach items="${entity.users}" var="user"> 70 <li id="${ user.UUID }"> 71 <span> 72 <a href="${pageContext.request.contextPath}/user/${user.UUID}" > 73 ${ user.login } 74 </a> 75 </span> 76 <span class="detailsButton"> 77 <a href="#userDetails"> 78 <span class="faceboxButton">Details</span> 79 </a> 80 </span> 81 </li> 82 </c:forEach> 83 </ul> 84 </c:if> 85 86 </form> 87 </div> 85 88 -
ssme/trunk/web/WEB-INF/tags/head.tag
r4022 r4026 12 12 <script type="text/javascript" src="${pageContext.request.contextPath}/script/facebox.js" type="text/javascript"></script> 13 13 14 <script type="text/javascript" src="${pageContext.request.contextPath}/script/util.js" type="text/javascript"></script> 15 14 16 <script type="text/javascript" src="${pageContext.request.contextPath}/script/user.js" type="text/javascript"></script> 15 17 <script type="text/javascript" src="${pageContext.request.contextPath}/script/group.js" type="text/javascript"></script> 18 19 <script type='text/javascript'> 20 /** 21 * Global variables 22 */ 23 var CONTEXT_PATH = '${pageContext.request.contextPath}'; 24 </script> -
ssme/trunk/web/WEB-INF/tags/page.tag
r4020 r4026 57 57 58 58 <div id="loggerContainer"> 59 [Method: ${pageContext.request.method}][Query String: ${pageContext.request.queryString}][Request URI: ${pageContext.request.requestURI}] 60 [Request URL: ${pageContext.request.requestURL}][Servlet Path: ${pageContext.request.servletPath}][Context Path: ${pageContext.request.contextPath}] 59 <div style="padding: 5px 5px 5px 5px; border: 1px solid black;"> 60 <span style="border: 2px outset black; padding: 1px 5px 1px 5px;" onClick="$('logger').innerHTML = '';">Clear Log</span> 61 [Method: ${pageContext.request.method}][Query String: ${pageContext.request.queryString}][Request URI: ${pageContext.request.requestURI}] 62 [Request URL: ${pageContext.request.requestURL}][Servlet Path: ${pageContext.request.servletPath}][Context Path: ${pageContext.request.contextPath}] 63 </div> 61 64 <div id="logger" /> 62 65 </div> -
ssme/trunk/web/WEB-INF/tags/user.tag
r4022 r4026 15 15 <c:if test="${ infoOnly eq true }"> 16 16 <c:set var="editable" value="false"/> 17 <c:set var="entity" value="${ null }"/> 18 <c:set var="uuid" value="${ null }"/> 17 19 </c:if> 18 20 19 <form class="userForm" id="${ id }" action=""> 20 <input type="hidden" id="${ id }_uuid" value="${ uuid }" /> 21 22 <table> 23 <tr class="title"> 24 <td class="label"> 25 <label for="${ id }_login"> 26 Login: 27 </label> 28 </td> 29 <td> 30 <input id="${ id }_login" class="disabledInput" disabled="true" value="${ entity.login }" /> 31 </td> 32 </tr> 33 <tr class="title"> 34 <td class="label"> 35 <label for="${ id }_name"> 36 Name: 37 </label> 38 </td> 39 <td> 40 <input id="${ id }_name" class="editable disabledInput" disabled="true" value="${ entity.name }" /> 41 </td> 42 </tr> 43 <tr class="title"> 44 <td class="label"> 45 <label for="${ id }_surname"> 46 Surname: 47 </label> 48 </td> 49 <td> 50 <input id="${ id }_surname" class="editable disabledInput" disabled="true" value="${ entity.surname }" /> 51 </td> 52 </tr> 53 <tr class="title"> 54 <td class="label"> 55 <label for="${ id }_mail"> 56 Mail: 57 </label> 58 </td> 59 <td> 60 <input id="${ id }_mail" class="editable disabledInput" disabled="true" value="${ entity.mail }" /> 61 </td> 62 </tr> 63 <tr class="title"> 64 <td class="label"> 65 <label for="${ id }_mobile"> 66 Mobile: 67 </label> 68 </td> 69 <td> 70 <input id="${ id }_mobile" class="editable disabledInput" disabled="true" value="${ entity.mobile }" /> 71 </td> 72 </tr> 73 <c:if test="${ editable }"> 74 <tr class="title"> 75 <td class="label"> 76 <label for="${ id }_edit"> 77 Edit: 78 </label> 79 </td> 80 <td> 81 <input id="${ id }_edit" type="checkbox" /> 82 </td> 83 </tr> 21 <div id="${ id }_wrapper" class="${ (infoOnly)?'excludedFromLayout':'' }"> 22 <form class="userForm" id="${ id }" action=""> 23 <input type="hidden" id="${ id }_uuid" value="${ uuid }" /> 24 25 <table> 26 <tr> 27 <td class="label"> 28 <label for="${ id }_login"> 29 Login: 30 </label> 31 </td> 32 <td> 33 <input id="${ id }_login" class="disabledInput" disabled="true" value="${ entity.login }" /> 34 </td> 35 </tr> 36 <tr> 37 <td class="label"> 38 <label for="${ id }_name"> 39 Name: 40 </label> 41 </td> 42 <td> 43 <input id="${ id }_name" class="editable disabledInput" disabled="true" value="${ entity.name }" /> 44 </td> 45 </tr> 46 <tr> 47 <td class="label"> 48 <label for="${ id }_surname"> 49 Surname: 50 </label> 51 </td> 52 <td> 53 <input id="${ id }_surname" class="editable disabledInput" disabled="true" value="${ entity.surname }" /> 54 </td> 55 </tr> 56 <tr> 57 <td class="label"> 58 <label for="${ id }_mail"> 59 Mail: 60 </label> 61 </td> 62 <td> 63 <input id="${ id }_mail" class="editable disabledInput" disabled="true" value="${ entity.mail }" /> 64 </td> 65 </tr> 66 <tr> 67 <td class="label"> 68 <label for="${ id }_mobile"> 69 Mobile: 70 </label> 71 </td> 72 <td> 73 <input id="${ id }_mobile" class="editable disabledInput" disabled="true" value="${ entity.mobile }" /> 74 </td> 75 </tr> 76 77 <c:if test="${ editable }"> 78 <tr class="controlRow"> 79 <td class="label" /> 80 <td> 81 <span id="${ id }_edit" class="toggleButton">Edit</span> 82 <span class="button excludedFromLayout submit"><a id="${ id }_apply">Apply</a></span> 83 </td> 84 </tr> 85 </c:if> 86 87 </table> 88 89 <c:if test="${ infoOnly != true }"> 90 <ul class="groupList"> 91 <c:forEach items="${entity.ownedGroups}" var="group"> 92 <li id="${ group.UUID }"> 93 <span> 94 <a href="${pageContext.request.contextPath}/group/${group.UUID}" > 95 ${ group.name } 96 </a> 97 </span> 98 <span class="detailsButton"> 99 <a href="#groupDetails"> 100 <span class="faceboxButton">Details</span> 101 </a> 102 </span> 103 </li> 104 </c:forEach> 105 </ul> 106 107 <ul class="groupList"> 108 <c:forEach items="${entity.groups}" var="group"> 109 <li id="${ group.UUID }"> 110 <span> 111 <a href="${pageContext.request.contextPath}/group/${group.UUID}" > 112 ${ group.name } 113 </a> 114 </span> 115 <span class="detailsButton"> 116 <a href="#groupDetails"> 117 <span class="faceboxButton">Details</span> 118 </a> 119 </span> 120 </li> 121 </c:forEach> 122 </ul> 84 123 </c:if> 85 </table>86 124 87 <c:if test="${ infoOnly != true }"> 88 <ul class="groupList"> 89 <c:forEach items="${entity.ownedGroups}" var="group"> 90 <li id="${ group.UUID }" class="label" > 91 <span> 92 <a href="${pageContext.request.contextPath}/group/${group.UUID}" > 93 ${ group.name } 94 </a> 95 </span> 96 <span> 97 <input class="detailsButton" type="button" value="details" /> 98 </span> 99 </li> 100 </c:forEach> 101 </ul> 102 103 <ul class="groupList"> 104 <c:forEach items="${entity.groups}" var="group"> 105 <li id="${ group.UUID }" class="label" > 106 <span> 107 <a href="${pageContext.request.contextPath}/group/${group.UUID}" > 108 ${ group.name } 109 </a> 110 </span> 111 <span> 112 <input class="detailsButton" type="button" value="details" /> 113 </span> 114 </li> 115 </c:forEach> 116 </ul> 117 </c:if> 118 119 </form> 125 </form> 126 </div> 120 127
