Skip to content
Snippets Groups Projects
Commit 5585290b authored by srosse's avatar srosse
Browse files

no-jira: only shorten the description once

parent 729019dc
No related branches found
No related tags found
No related merge requests found
...@@ -45,30 +45,30 @@ public class RepositoryEntryRow implements RepositoryEntryRef { ...@@ -45,30 +45,30 @@ public class RepositoryEntryRow implements RepositoryEntryRef {
private boolean marked; private boolean marked;
private boolean selected; private boolean selected;
private Long key; private final Long key;
private String externalId; private final String externalId;
private String externalRef; private final String externalRef;
private Date creationDate; private final Date creationDate;
private String name; private final String name;
private String authors; private final String authors;
private String location; private final String location;
private String expenditureOfWork; private final String expenditureOfWork;
private String thumbnailRelPath; private String thumbnailRelPath;
private String shortenedDescription; private final String shortenedDescription;
private int access; private final int access;
private int statusCode; private final int statusCode;
private String score; private final String score;
private Boolean passed; private final Boolean passed;
private boolean isMembersOnly = false; private final boolean isMembersOnly;
private boolean member; private boolean member;
private Integer myRating; private final Integer myRating;
private Double averageRating; private final Double averageRating;
private long numOfRatings; private final long numOfRatings;
private long numOfComments; private final long numOfComments;
private long launchCounter; private final long launchCounter;
private String lifecycleLabel; private String lifecycleLabel;
private String lifecycleSoftKey; private String lifecycleSoftKey;
...@@ -86,38 +86,43 @@ public class RepositoryEntryRow implements RepositoryEntryRef { ...@@ -86,38 +86,43 @@ public class RepositoryEntryRow implements RepositoryEntryRef {
private OLATResourceable olatResource; private OLATResourceable olatResource;
private FormItem ratingFormItem; private FormItem ratingFormItem;
public RepositoryEntryRow() {
//
}
public RepositoryEntryRow(RepositoryEntryMyView entry) { public RepositoryEntryRow(RepositoryEntryMyView entry) {
setKey(entry.getKey()); key = entry.getKey();
setCreationDate(entry.getCreationDate()); creationDate = entry.getCreationDate();
setExternalId(entry.getExternalId()); externalId = entry.getExternalId();
setExternalRef(entry.getExternalRef()); externalRef = entry.getExternalRef();
setDisplayName(entry.getDisplayname()); name = entry.getDisplayname();
setShortenedDescription(entry.getDescription()); if(entry.getDescription() != null) {
String shortDesc = FilterFactory.getHtmlTagsFilter().filter(entry.getDescription());
if(shortDesc.length() > 255) {
shortenedDescription = shortDesc.substring(0, 255);
} else {
shortenedDescription = shortDesc;
}
} else {
shortenedDescription = "";
}
setOLATResourceable(OresHelper.clone(entry.getOlatResource())); setOLATResourceable(OresHelper.clone(entry.getOlatResource()));
setAuthors(entry.getAuthors()); authors = entry.getAuthors();
setLocation(entry.getLocation()); location = entry.getLocation();
setExpenditureOfWork(entry.getExpenditureOfWork()); expenditureOfWork = entry.getExpenditureOfWork();
setLaunchCounter(entry.getLaunchCounter()); launchCounter = entry.getLaunchCounter();
setIsMembersOnly(entry.isMembersOnly()); isMembersOnly = entry.isMembersOnly();
setAccess(entry.getAccess()); access = entry.getAccess();
setStatusCode(entry.getStatusCode()); statusCode = entry.getStatusCode();
//bookmark //bookmark
setMarked(entry.isMarked()); setMarked(entry.isMarked());
//efficiency statement //efficiency statement
setPassed(entry.getPassed()); passed = entry.getPassed();
setScore(AssessmentHelper.getRoundedScore(entry.getScore())); score = AssessmentHelper.getRoundedScore(entry.getScore());
//rating //rating
setMyRating(entry.getMyRating()); myRating = entry.getMyRating();
setAverageRating(entry.getAverageRating()); averageRating = entry.getAverageRating();
setNumOfRatings(entry.getNumOfRatings()); numOfRatings = entry.getNumOfRatings();
setNumOfComments(entry.getNumOfComments()); numOfComments = entry.getNumOfComments();
//lifecycle //lifecycle
RepositoryEntryLifecycle reLifecycle = entry.getLifecycle(); RepositoryEntryLifecycle reLifecycle = entry.getLifecycle();
...@@ -130,10 +135,6 @@ public class RepositoryEntryRow implements RepositoryEntryRef { ...@@ -130,10 +135,6 @@ public class RepositoryEntryRow implements RepositoryEntryRef {
} }
} }
} }
private void setIsMembersOnly(boolean membersOnly) {
this.isMembersOnly = membersOnly;
}
public boolean isMembersOnly() { public boolean isMembersOnly() {
return isMembersOnly; return isMembersOnly;
...@@ -142,19 +143,11 @@ public class RepositoryEntryRow implements RepositoryEntryRef { ...@@ -142,19 +143,11 @@ public class RepositoryEntryRow implements RepositoryEntryRef {
public Long getKey() { public Long getKey() {
return key; return key;
} }
public void setKey(Long key) {
this.key = key;
}
public Date getCreationDate() { public Date getCreationDate() {
return creationDate; return creationDate;
} }
public void setCreationDate(Date creationDate) {
this.creationDate = creationDate;
}
public boolean isClosed() { public boolean isClosed() {
return new RepositoryEntryStatus(statusCode).isClosed() || new RepositoryEntryStatus(statusCode).isUnpublished() ; return new RepositoryEntryStatus(statusCode).isClosed() || new RepositoryEntryStatus(statusCode).isUnpublished() ;
} }
...@@ -163,66 +156,26 @@ public class RepositoryEntryRow implements RepositoryEntryRef { ...@@ -163,66 +156,26 @@ public class RepositoryEntryRow implements RepositoryEntryRef {
return access; return access;
} }
public void setAccess(int access) {
this.access = access;
}
public int getStatusCode() { public int getStatusCode() {
return statusCode; return statusCode;
} }
public void setStatusCode(int statusCode) {
this.statusCode = statusCode;
}
public String getExternalId() { public String getExternalId() {
return externalId; return externalId;
} }
public void setExternalId(String externalId) {
this.externalId = externalId;
}
public String getExternalRef() { public String getExternalRef() {
return externalRef; return externalRef;
} }
public void setExternalRef(String externalRef) {
this.externalRef = externalRef;
}
public String getDisplayName() { public String getDisplayName() {
return name; return name;
} }
public void setDisplayName(String name) {
this.name = name;
}
public String getShortenedDescription() { public String getShortenedDescription() {
if(shortenedDescription != null) {
String shortDesc = FilterFactory.getHtmlTagsFilter().filter(shortenedDescription);
if(shortDesc.length() > 255) {
shortDesc = shortDesc.substring(0, 255);
}
return shortDesc;
}
return shortenedDescription; return shortenedDescription;
} }
public void setShortenedDescription(String description) {
if(description != null) {
String shortDesc = FilterFactory.getHtmlTagsFilter().filter(description);
if(shortDesc.length() > 255) {
shortenedDescription = shortDesc.substring(0, 255);
} else {
shortenedDescription = shortDesc;
}
} else {
shortenedDescription = "";
}
}
/** /**
* Is member if the row as some type of access control * Is member if the row as some type of access control
* @return * @return
...@@ -230,7 +183,7 @@ public class RepositoryEntryRow implements RepositoryEntryRef { ...@@ -230,7 +183,7 @@ public class RepositoryEntryRow implements RepositoryEntryRef {
public boolean isMember() { public boolean isMember() {
return member; return member;
} }
public void setMember(boolean member) { public void setMember(boolean member) {
this.member = member; this.member = member;
} }
...@@ -239,34 +192,18 @@ public class RepositoryEntryRow implements RepositoryEntryRef { ...@@ -239,34 +192,18 @@ public class RepositoryEntryRow implements RepositoryEntryRef {
return myRating; return myRating;
} }
public void setMyRating(Integer myRating) {
this.myRating = myRating;
}
public Double getAverageRating() { public Double getAverageRating() {
return averageRating; return averageRating;
} }
public void setAverageRating(Double averageRating) {
this.averageRating = averageRating;
}
public long getNumOfRatings() { public long getNumOfRatings() {
return numOfRatings; return numOfRatings;
} }
public void setNumOfRatings(long numOfRatings) {
this.numOfRatings = numOfRatings;
}
public long getNumOfComments() { public long getNumOfComments() {
return numOfComments; return numOfComments;
} }
public void setNumOfComments(long numOfComments) {
this.numOfComments = numOfComments;
}
public String getLifecycleSoftKey() { public String getLifecycleSoftKey() {
return lifecycleSoftKey; return lifecycleSoftKey;
} }
...@@ -415,46 +352,30 @@ public class RepositoryEntryRow implements RepositoryEntryRef { ...@@ -415,46 +352,30 @@ public class RepositoryEntryRow implements RepositoryEntryRef {
return authors; return authors;
} }
public void setAuthors(String authors) {
this.authors = authors;
}
public String getLocation() { public String getLocation() {
return location; return location;
} }
public void setLocation(String location) {
this.location = location;
}
public String getExpenditureOfWork() { public String getExpenditureOfWork() {
return expenditureOfWork; return expenditureOfWork;
} }
public void setExpenditureOfWork(String expenditureOfWork) {
this.expenditureOfWork = expenditureOfWork;
}
public long getLaunchCounter() { public long getLaunchCounter() {
return launchCounter; return launchCounter;
} }
public void setLaunchCounter(long launchCounter) {
this.launchCounter = launchCounter;
}
public String getThumbnailRelPath() { public String getThumbnailRelPath() {
return thumbnailRelPath; return thumbnailRelPath;
} }
public void setThumbnailRelPath(String path) {
this.thumbnailRelPath = path;
}
public boolean isThumbnailAvailable() { public boolean isThumbnailAvailable() {
return StringHelper.containsNonWhitespace(thumbnailRelPath); return StringHelper.containsNonWhitespace(thumbnailRelPath);
} }
public void setThumbnailRelPath(String thumbnailRelPath) {
this.thumbnailRelPath = thumbnailRelPath;
}
public boolean isMarked() { public boolean isMarked() {
return marked; return marked;
} }
...@@ -475,18 +396,10 @@ public class RepositoryEntryRow implements RepositoryEntryRef { ...@@ -475,18 +396,10 @@ public class RepositoryEntryRow implements RepositoryEntryRef {
return score; return score;
} }
public void setScore(String score) {
this.score = score;
}
public boolean isPassed() { public boolean isPassed() {
return passed != null && passed.booleanValue(); return passed != null && passed.booleanValue();
} }
public void setPassed(Boolean passed) {
this.passed = passed;
}
public boolean isFailed() { public boolean isFailed() {
return passed != null && !passed.booleanValue(); return passed != null && !passed.booleanValue();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment