Skip to content
Snippets Groups Projects
Commit 2ee47d2b authored by fkiefer's avatar fkiefer
Browse files

OO-2456 naming of methods and fields

parent 65a47ff6
No related branches found
No related tags found
No related merge requests found
...@@ -60,7 +60,7 @@ import org.olat.core.helpers.Settings; ...@@ -60,7 +60,7 @@ import org.olat.core.helpers.Settings;
public class Formatter { public class Formatter {
private static final DateFormat formatterDatetimeFilesystem = new SimpleDateFormat("yyyy-MM-dd'T'HH-mm-ss_SSS"); private static final DateFormat formatterDatetimeFilesystem = new SimpleDateFormat("yyyy-MM-dd'T'HH-mm-ss_SSS");
private static final DateFormat formatterDatetime = new SimpleDateFormat("yyyy-MM-dd'T'HH-mm"); private static final DateFormat formatterDatetimeWithMinutes = new SimpleDateFormat("yyyy-MM-dd'T'HH-mm");
private static final DateFormat formatDateTime = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); private static final DateFormat formatDateTime = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
private static final DateFormat shortFormatDateFileSystem = new SimpleDateFormat("yyyyMMdd"); private static final DateFormat shortFormatDateFileSystem = new SimpleDateFormat("yyyyMMdd");
...@@ -311,9 +311,9 @@ public class Formatter { ...@@ -311,9 +311,9 @@ public class Formatter {
* @param d the date to be formatted * @param d the date to be formatted
* @return a String with the formatted date and time * @return a String with the formatted date and time
*/ */
public static String formatDatetimeSave(Date d) { public static String formatDatetimeWithMinutes(Date d) {
synchronized (formatterDatetime) { synchronized (formatterDatetimeWithMinutes) {
return formatterDatetime.format(d); return formatterDatetimeWithMinutes.format(d);
} }
} }
......
...@@ -95,7 +95,7 @@ public class ArchiveResource implements MediaResource { ...@@ -95,7 +95,7 @@ public class ArchiveResource implements MediaResource {
} }
String label = StringHelper.transformDisplayNameToFileSystemName(courseNode.getShortName()) String label = StringHelper.transformDisplayNameToFileSystemName(courseNode.getShortName())
+ "_" + Formatter.formatDatetimeSave(new Date()) + ".zip"; + "_" + Formatter.formatDatetimeWithMinutes(new Date()) + ".zip";
String urlEncodedLabel = StringHelper.urlEncodeUTF8(label); String urlEncodedLabel = StringHelper.urlEncodeUTF8(label);
hres.setHeader("Content-Disposition","attachment; filename*=UTF-8''" + urlEncodedLabel); hres.setHeader("Content-Disposition","attachment; filename*=UTF-8''" + urlEncodedLabel);
hres.setHeader("Content-Description", urlEncodedLabel); hres.setHeader("Content-Description", urlEncodedLabel);
......
...@@ -266,7 +266,7 @@ public class HighScoreEditController extends FormBasicController { ...@@ -266,7 +266,7 @@ public class HighScoreEditController extends FormBasicController {
|| showPodium.isSelected(0) || showPosition.isSelected(0); || showPodium.isSelected(0) || showPosition.isSelected(0);
} }
if (dateStart.getDate() != null && new Date().after(dateStart.getDate())) { if (dateStart.getDate() != null && new Date().after(dateStart.getDate())) {
dateStart.setErrorKey("dateElement.toearly", null); dateStart.setErrorKey("datestart.toearly", null);
allOK &= false; allOK &= false;
} }
return allOK & super.validateFormLogic(ureq); return allOK & super.validateFormLogic(ureq);
......
...@@ -195,7 +195,7 @@ public class QTI21ArchiveFormat { ...@@ -195,7 +195,7 @@ public class QTI21ArchiveFormat {
ICourse course = CourseFactory.loadCourse(searchParams.getCourseEntry()); ICourse course = CourseFactory.loadCourse(searchParams.getCourseEntry());
CourseNode courseNode = course.getRunStructure().getNode(searchParams.getNodeIdent()); CourseNode courseNode = course.getRunStructure().getNode(searchParams.getNodeIdent());
String label = StringHelper.transformDisplayNameToFileSystemName(courseNode.getShortName()) String label = StringHelper.transformDisplayNameToFileSystemName(courseNode.getShortName())
+ "_" + Formatter.formatDatetimeSave(new Date()) + "_" + Formatter.formatDatetimeWithMinutes(new Date())
+ ".xlsx"; + ".xlsx";
if("iqself".equals(courseNode.getType())) { if("iqself".equals(courseNode.getType())) {
......
...@@ -69,7 +69,7 @@ public class DisplayPortraitController extends BasicController implements Generi ...@@ -69,7 +69,7 @@ public class DisplayPortraitController extends BasicController implements Generi
private final boolean isAnonymous; private final boolean isAnonymous;
private final boolean displayPortraitImage; private final boolean displayPortraitImage;
private boolean anonymous; private boolean forceAnonymous;
/** /**
...@@ -91,7 +91,7 @@ public class DisplayPortraitController extends BasicController implements Generi ...@@ -91,7 +91,7 @@ public class DisplayPortraitController extends BasicController implements Generi
public DisplayPortraitController(UserRequest ureq, WindowControl wControl, Identity portraitIdent, public DisplayPortraitController(UserRequest ureq, WindowControl wControl, Identity portraitIdent,
boolean useLarge, boolean canLinkToHomePage, boolean setAnonymous) { boolean useLarge, boolean canLinkToHomePage, boolean setAnonymous) {
this(ureq, wControl, portraitIdent, useLarge, canLinkToHomePage, false, true); this(ureq, wControl, portraitIdent, useLarge, canLinkToHomePage, false, true);
this.anonymous = setAnonymous; this.forceAnonymous = setAnonymous;
loadPortrait(); loadPortrait();
} }
...@@ -177,9 +177,9 @@ public class DisplayPortraitController extends BasicController implements Generi ...@@ -177,9 +177,9 @@ public class DisplayPortraitController extends BasicController implements Generi
if (useLarge) { if (useLarge) {
image = DisplayPortraitManager.getInstance().getBigPortrait(portraitIdent.getName()); image = DisplayPortraitManager.getInstance().getBigPortrait(portraitIdent.getName());
if (image != null && !anonymous) { if (image != null && !forceAnonymous) {
myContent.contextPut("portraitCssClass", DisplayPortraitManager.AVATAR_BIG_CSS_CLASS); myContent.contextPut("portraitCssClass", DisplayPortraitManager.AVATAR_BIG_CSS_CLASS);
} else if (isAnonymous || anonymous) { } else if (isAnonymous || forceAnonymous) {
myContent.contextPut("portraitCssClass", DisplayPortraitManager.ANONYMOUS_BIG_CSS_CLASS); myContent.contextPut("portraitCssClass", DisplayPortraitManager.ANONYMOUS_BIG_CSS_CLASS);
} else if (gender.equals("-")) { } else if (gender.equals("-")) {
myContent.contextPut("portraitCssClass", DisplayPortraitManager.DUMMY_BIG_CSS_CLASS); myContent.contextPut("portraitCssClass", DisplayPortraitManager.DUMMY_BIG_CSS_CLASS);
...@@ -190,9 +190,9 @@ public class DisplayPortraitController extends BasicController implements Generi ...@@ -190,9 +190,9 @@ public class DisplayPortraitController extends BasicController implements Generi
} }
} else { } else {
image = DisplayPortraitManager.getInstance().getSmallPortrait(portraitIdent.getName()); image = DisplayPortraitManager.getInstance().getSmallPortrait(portraitIdent.getName());
if (image != null && !anonymous) { if (image != null && !forceAnonymous) {
myContent.contextPut("portraitCssClass", DisplayPortraitManager.AVATAR_SMALL_CSS_CLASS); myContent.contextPut("portraitCssClass", DisplayPortraitManager.AVATAR_SMALL_CSS_CLASS);
} else if (isAnonymous || anonymous) { } else if (isAnonymous || forceAnonymous) {
myContent.contextPut("portraitCssClass", DisplayPortraitManager.ANONYMOUS_SMALL_CSS_CLASS); myContent.contextPut("portraitCssClass", DisplayPortraitManager.ANONYMOUS_SMALL_CSS_CLASS);
} else if (gender.equals("-")) { } else if (gender.equals("-")) {
myContent.contextPut("portraitCssClass", DisplayPortraitManager.DUMMY_SMALL_CSS_CLASS); myContent.contextPut("portraitCssClass", DisplayPortraitManager.DUMMY_SMALL_CSS_CLASS);
...@@ -212,7 +212,7 @@ public class DisplayPortraitController extends BasicController implements Generi ...@@ -212,7 +212,7 @@ public class DisplayPortraitController extends BasicController implements Generi
myContent.contextRemove("mapperUrl"); myContent.contextRemove("mapperUrl");
} }
myContent.contextPut("hasPortrait", (image != null && !anonymous) ? Boolean.TRUE : Boolean.FALSE); myContent.contextPut("hasPortrait", (image != null && !forceAnonymous) ? Boolean.TRUE : Boolean.FALSE);
} }
@Override @Override
......
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