usersession fix
git-svn-id: svn://svn.dsv.su.se/scipro/scipro/trunk@539 73ecded7-942e-4092-bab0-0e58ef0ee984
This commit is contained in:
parent
f98d1fa441
commit
755c4be7ef
src/main/java/se/su/dsv/scipro/knol/resource/panels
@ -81,7 +81,6 @@ public class ResourceBookmarkablePanel extends Panel {
|
||||
private WebMarkupContainer listContainer = new WebMarkupContainer(
|
||||
"listContainer");
|
||||
|
||||
private User user;
|
||||
@SpringBean
|
||||
private TagDao tagDao;
|
||||
private int point;
|
||||
@ -108,7 +107,7 @@ public class ResourceBookmarkablePanel extends Panel {
|
||||
if (resource == null)
|
||||
failAndRedirect();
|
||||
}
|
||||
user = userDao.load(SciProSession.get().getUser().getId());
|
||||
|
||||
loadListView();
|
||||
listContainer.setOutputMarkupId(true);
|
||||
add(listContainer);
|
||||
@ -382,7 +381,7 @@ public class ResourceBookmarkablePanel extends Panel {
|
||||
boolean rated = false;
|
||||
Rating rating = null;
|
||||
for (Rating r : ratingList) {
|
||||
if (r.getUser().equals(user)) {
|
||||
if (r.getUser().equals(SciProSession.get().getUser())) {
|
||||
rating = r;
|
||||
rated = true;
|
||||
break;
|
||||
@ -391,7 +390,7 @@ public class ResourceBookmarkablePanel extends Panel {
|
||||
|
||||
if (rating == null) {
|
||||
rating = new Rating();
|
||||
rating.setUser(user);
|
||||
rating.setUser(SciProSession.get().getUser());
|
||||
}
|
||||
this.removeAll();
|
||||
if (rated && rating.getRatingValue() == RatingValue.UP) {
|
||||
@ -437,7 +436,7 @@ public class ResourceBookmarkablePanel extends Panel {
|
||||
boolean rated = false;
|
||||
Rating rating = null;
|
||||
for (Rating r : ratingList) {
|
||||
if (r.getUser().equals(user)) {
|
||||
if (r.getUser().equals(SciProSession.get().getUser())) {
|
||||
rating = r;
|
||||
rated = true;
|
||||
break;
|
||||
@ -445,7 +444,7 @@ public class ResourceBookmarkablePanel extends Panel {
|
||||
}
|
||||
if (rating == null) {
|
||||
rating = new Rating();
|
||||
rating.setUser(user);
|
||||
rating.setUser(SciProSession.get().getUser());
|
||||
}
|
||||
removeAll();
|
||||
if (rated && rating.getRatingValue() == RatingValue.DOWN) {
|
||||
@ -485,7 +484,7 @@ public class ResourceBookmarkablePanel extends Panel {
|
||||
|
||||
public boolean isRated(RatingValue ratingValue, Resource resource) {
|
||||
for (Rating r : resource.getRatingList()) {
|
||||
if (r.getUser().equals(user)) {
|
||||
if (r.getUser().equals(SciProSession.get().getUser())) {
|
||||
if (r.getRatingValue().equals(ratingValue)) {
|
||||
return true;
|
||||
}
|
||||
@ -568,7 +567,7 @@ public class ResourceBookmarkablePanel extends Panel {
|
||||
|
||||
link.setInfo(resourceModel.getInfo());
|
||||
link.setLink(resourceModel.getLink());
|
||||
link.setCreator(user);
|
||||
link.setCreator(SciProSession.get().getUser());
|
||||
|
||||
link.setTagSet(new HashSet<Tag>(tagList));
|
||||
link.setLastModified(new Date());
|
||||
@ -702,7 +701,7 @@ public class ResourceBookmarkablePanel extends Panel {
|
||||
link.setHeading(resourceModel.getLinkName());
|
||||
link.setEmbedCode(resourceModel.getEmbedCode());
|
||||
link.setInfo(resourceModel.getInfo());
|
||||
link.setCreator(user);
|
||||
link.setCreator(SciProSession.get().getUser());
|
||||
link.setTagSet(new HashSet<Tag>(tagList));
|
||||
|
||||
link.setLastModified(new Date());
|
||||
|
@ -86,7 +86,7 @@ public class ResourcesPanel extends Panel {
|
||||
|
||||
private PageableListView<Resource> linkListView;
|
||||
|
||||
private User user;
|
||||
|
||||
private WebMarkupContainer linkDialogContainer, embedDialogContainer,
|
||||
editLinkDialogContainer, editEmbedDialogContainer;
|
||||
private Dialog linkDialog, embedDialog, editLinkDialog, editEmbedDialog;
|
||||
@ -104,7 +104,6 @@ public class ResourcesPanel extends Panel {
|
||||
|
||||
public ResourcesPanel(String id) {
|
||||
super(id);
|
||||
user = userDao.load(SciProSession.get().getUser().getId());
|
||||
loadListView();
|
||||
listContainer = new WebMarkupContainer("listContainer");
|
||||
listContainer.add(linkListView);
|
||||
@ -450,7 +449,7 @@ public class ResourcesPanel extends Panel {
|
||||
boolean rated = false;
|
||||
Rating rating = null;
|
||||
for (Rating r : ratingList) {
|
||||
if (r.getUser().equals(user)) {
|
||||
if (r.getUser().equals(SciProSession.get().getUser())) {
|
||||
rating = r;
|
||||
rated = true;
|
||||
break;
|
||||
@ -459,7 +458,7 @@ public class ResourcesPanel extends Panel {
|
||||
|
||||
if (rating == null) {
|
||||
rating = new Rating();
|
||||
rating.setUser(user);
|
||||
rating.setUser(SciProSession.get().getUser());
|
||||
}
|
||||
removeAll();
|
||||
if (rated && rating.getRatingValue() == RatingValue.UP) {
|
||||
@ -506,7 +505,7 @@ public class ResourcesPanel extends Panel {
|
||||
boolean rated = false;
|
||||
Rating rating = null;
|
||||
for (Rating r : ratingList) {
|
||||
if (r.getUser().equals(user)) {
|
||||
if (r.getUser().equals(SciProSession.get().getUser())) {
|
||||
rating = r;
|
||||
rated = true;
|
||||
break;
|
||||
@ -514,7 +513,7 @@ public class ResourcesPanel extends Panel {
|
||||
}
|
||||
if (rating == null) {
|
||||
rating = new Rating();
|
||||
rating.setUser(user);
|
||||
rating.setUser(SciProSession.get().getUser());
|
||||
}
|
||||
this.removeAll();
|
||||
if (rated && rating.getRatingValue() == RatingValue.DOWN) {
|
||||
@ -554,7 +553,7 @@ public class ResourcesPanel extends Panel {
|
||||
|
||||
public boolean isRated(RatingValue ratingValue, Resource resource) {
|
||||
for (Rating r : resource.getRatingList()) {
|
||||
if (r.getUser().equals(user)) {
|
||||
if (r.getUser().equals(SciProSession.get().getUser())) {
|
||||
if (r.getRatingValue().equals(ratingValue)) {
|
||||
return true;
|
||||
}
|
||||
@ -626,7 +625,7 @@ public class ResourcesPanel extends Panel {
|
||||
|
||||
link.setInfo(resourceModel.getInfo());
|
||||
link.setLink(resourceModel.getLink());
|
||||
link.setCreator(user);
|
||||
link.setCreator(SciProSession.get().getUser());
|
||||
link.setTagSet(tagList);
|
||||
if (resourceModel.getLinkName() != null) {
|
||||
link.setHeading(resourceModel.getLinkName());
|
||||
@ -726,7 +725,7 @@ public class ResourcesPanel extends Panel {
|
||||
|
||||
link.setInfo(resourceModel.getInfo());
|
||||
link.setLink(resourceModel.getLink());
|
||||
link.setCreator(user);
|
||||
link.setCreator(SciProSession.get().getUser());
|
||||
|
||||
link.setTagSet(new HashSet<Tag>(tagList));
|
||||
link.setLastModified(new Date());
|
||||
@ -859,7 +858,7 @@ public class ResourcesPanel extends Panel {
|
||||
link.setHeading(resourceModel.getLinkName());
|
||||
link.setEmbedCode(resourceModel.getEmbedCode());
|
||||
link.setInfo(resourceModel.getInfo());
|
||||
link.setCreator(user);
|
||||
link.setCreator(SciProSession.get().getUser());
|
||||
link.setTagSet(tagList);
|
||||
if (resourceModel.getLinkName() != null) {
|
||||
link.setHeading(resourceModel.getLinkName());
|
||||
@ -952,7 +951,7 @@ public class ResourcesPanel extends Panel {
|
||||
link.setHeading(resourceModel.getLinkName());
|
||||
link.setEmbedCode(resourceModel.getEmbedCode());
|
||||
link.setInfo(resourceModel.getInfo());
|
||||
link.setCreator(user);
|
||||
link.setCreator(SciProSession.get().getUser());
|
||||
link.setTagSet(new HashSet<Tag>(tagList));
|
||||
|
||||
link.setLastModified(new Date());
|
||||
|
Loading…
x
Reference in New Issue
Block a user