repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
alkacon/opencms-core | src/org/opencms/jsp/util/UAgentInfo.java | UAgentInfo.detectBlackBerryHigh | public boolean detectBlackBerryHigh() {
//Disambiguate for BlackBerry OS 6 or 7 (WebKit) browser
if (detectBlackBerryWebKit()) {
return false;
}
if (detectBlackBerry()) {
if (detectBlackBerryTouch()
|| (userAgent.indexOf(deviceBBBold) != -... | java | public boolean detectBlackBerryHigh() {
//Disambiguate for BlackBerry OS 6 or 7 (WebKit) browser
if (detectBlackBerryWebKit()) {
return false;
}
if (detectBlackBerry()) {
if (detectBlackBerryTouch()
|| (userAgent.indexOf(deviceBBBold) != -... | [
"public",
"boolean",
"detectBlackBerryHigh",
"(",
")",
"{",
"//Disambiguate for BlackBerry OS 6 or 7 (WebKit) browser\r",
"if",
"(",
"detectBlackBerryWebKit",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"detectBlackBerry",
"(",
")",
")",
"{",
"if",
... | Detects if the current browser is a BlackBerry device AND
has a more capable recent browser. Excludes the Playbook.
Examples, Storm, Bold, Tour, Curve2
Excludes the new BlackBerry OS 6 and 7 browser!!
@return detection of a Blackberry device with a better browser | [
"Detects",
"if",
"the",
"current",
"browser",
"is",
"a",
"BlackBerry",
"device",
"AND",
"has",
"a",
"more",
"capable",
"recent",
"browser",
".",
"Excludes",
"the",
"Playbook",
".",
"Examples",
"Storm",
"Bold",
"Tour",
"Curve2",
"Excludes",
"the",
"new",
"Bla... | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/UAgentInfo.java#L382-L400 | train |
alkacon/opencms-core | src/org/opencms/jsp/util/UAgentInfo.java | UAgentInfo.detectBlackBerryTouch | public boolean detectBlackBerryTouch() {
if (detectBlackBerry()
&& ((userAgent.indexOf(deviceBBStorm) != -1)
|| (userAgent.indexOf(deviceBBTorch) != -1)
|| (userAgent.indexOf(deviceBBBoldTouch) != -1)
|| (userAgent.indexOf(deviceBBCurveTouch) !=... | java | public boolean detectBlackBerryTouch() {
if (detectBlackBerry()
&& ((userAgent.indexOf(deviceBBStorm) != -1)
|| (userAgent.indexOf(deviceBBTorch) != -1)
|| (userAgent.indexOf(deviceBBBoldTouch) != -1)
|| (userAgent.indexOf(deviceBBCurveTouch) !=... | [
"public",
"boolean",
"detectBlackBerryTouch",
"(",
")",
"{",
"if",
"(",
"detectBlackBerry",
"(",
")",
"&&",
"(",
"(",
"userAgent",
".",
"indexOf",
"(",
"deviceBBStorm",
")",
"!=",
"-",
"1",
")",
"||",
"(",
"userAgent",
".",
"indexOf",
"(",
"deviceBBTorch",... | Detects if the current browser is a BlackBerry Touch
device, such as the Storm, Torch, and Bold Touch. Excludes the Playbook.
@return detection of a Blackberry touchscreen device | [
"Detects",
"if",
"the",
"current",
"browser",
"is",
"a",
"BlackBerry",
"Touch",
"device",
"such",
"as",
"the",
"Storm",
"Torch",
"and",
"Bold",
"Touch",
".",
"Excludes",
"the",
"Playbook",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/UAgentInfo.java#L440-L450 | train |
alkacon/opencms-core | src/org/opencms/jsp/util/UAgentInfo.java | UAgentInfo.detectMobileQuick | public boolean detectMobileQuick() {
//Let's exclude tablets
if (isTierTablet) {
return false;
}
//Most mobile browsing is done on smartphones
if (detectSmartphone()) {
return true;
}
//Catch-all for many mobile devices
... | java | public boolean detectMobileQuick() {
//Let's exclude tablets
if (isTierTablet) {
return false;
}
//Most mobile browsing is done on smartphones
if (detectSmartphone()) {
return true;
}
//Catch-all for many mobile devices
... | [
"public",
"boolean",
"detectMobileQuick",
"(",
")",
"{",
"//Let's exclude tablets\r",
"if",
"(",
"isTierTablet",
")",
"{",
"return",
"false",
";",
"}",
"//Most mobile browsing is done on smartphones\r",
"if",
"(",
"detectSmartphone",
"(",
")",
")",
"{",
"return",
"t... | Detects if the current device is a mobile device.
This method catches most of the popular modern devices.
Excludes Apple iPads and other modern tablets.
@return detection of any mobile device using the quicker method | [
"Detects",
"if",
"the",
"current",
"device",
"is",
"a",
"mobile",
"device",
".",
"This",
"method",
"catches",
"most",
"of",
"the",
"popular",
"modern",
"devices",
".",
"Excludes",
"Apple",
"iPads",
"and",
"other",
"modern",
"tablets",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/UAgentInfo.java#L763-L797 | train |
alkacon/opencms-core | src/org/opencms/jsp/util/UAgentInfo.java | UAgentInfo.detectNintendo | public boolean detectNintendo() {
if ((userAgent.indexOf(deviceNintendo) != -1)
|| (userAgent.indexOf(deviceWii) != -1)
|| (userAgent.indexOf(deviceNintendoDs) != -1)) {
return true;
}
return false;
} | java | public boolean detectNintendo() {
if ((userAgent.indexOf(deviceNintendo) != -1)
|| (userAgent.indexOf(deviceWii) != -1)
|| (userAgent.indexOf(deviceNintendoDs) != -1)) {
return true;
}
return false;
} | [
"public",
"boolean",
"detectNintendo",
"(",
")",
"{",
"if",
"(",
"(",
"userAgent",
".",
"indexOf",
"(",
"deviceNintendo",
")",
"!=",
"-",
"1",
")",
"||",
"(",
"userAgent",
".",
"indexOf",
"(",
"deviceWii",
")",
"!=",
"-",
"1",
")",
"||",
"(",
"userAg... | Detects if the current device is a Nintendo game device.
@return detection of Nintendo | [
"Detects",
"if",
"the",
"current",
"device",
"is",
"a",
"Nintendo",
"game",
"device",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/UAgentInfo.java#L803-L811 | train |
alkacon/opencms-core | src/org/opencms/jsp/util/UAgentInfo.java | UAgentInfo.detectOperaMobile | public boolean detectOperaMobile() {
if ((userAgent.indexOf(engineOpera) != -1)
&& ((userAgent.indexOf(mini) != -1) || (userAgent.indexOf(mobi) != -1))) {
return true;
}
return false;
} | java | public boolean detectOperaMobile() {
if ((userAgent.indexOf(engineOpera) != -1)
&& ((userAgent.indexOf(mini) != -1) || (userAgent.indexOf(mobi) != -1))) {
return true;
}
return false;
} | [
"public",
"boolean",
"detectOperaMobile",
"(",
")",
"{",
"if",
"(",
"(",
"userAgent",
".",
"indexOf",
"(",
"engineOpera",
")",
"!=",
"-",
"1",
")",
"&&",
"(",
"(",
"userAgent",
".",
"indexOf",
"(",
"mini",
")",
"!=",
"-",
"1",
")",
"||",
"(",
"user... | Detects Opera Mobile or Opera Mini.
@return detection of an Opera browser for a mobile device | [
"Detects",
"Opera",
"Mobile",
"or",
"Opera",
"Mini",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/UAgentInfo.java#L817-L824 | train |
alkacon/opencms-core | src/org/opencms/jsp/util/UAgentInfo.java | UAgentInfo.detectSonyMylo | public boolean detectSonyMylo() {
if ((userAgent.indexOf(manuSony) != -1)
&& ((userAgent.indexOf(qtembedded) != -1) || (userAgent.indexOf(mylocom2) != -1))) {
return true;
}
return false;
} | java | public boolean detectSonyMylo() {
if ((userAgent.indexOf(manuSony) != -1)
&& ((userAgent.indexOf(qtembedded) != -1) || (userAgent.indexOf(mylocom2) != -1))) {
return true;
}
return false;
} | [
"public",
"boolean",
"detectSonyMylo",
"(",
")",
"{",
"if",
"(",
"(",
"userAgent",
".",
"indexOf",
"(",
"manuSony",
")",
"!=",
"-",
"1",
")",
"&&",
"(",
"(",
"userAgent",
".",
"indexOf",
"(",
"qtembedded",
")",
"!=",
"-",
"1",
")",
"||",
"(",
"user... | Detects if the current browser is a Sony Mylo device.
@return detection of a Sony Mylo device | [
"Detects",
"if",
"the",
"current",
"browser",
"is",
"a",
"Sony",
"Mylo",
"device",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/UAgentInfo.java#L918-L925 | train |
alkacon/opencms-core | src/org/opencms/jsp/util/UAgentInfo.java | UAgentInfo.detectTierIphone | public boolean detectTierIphone() {
if (detectIphoneOrIpod()
|| detectAndroidPhone()
|| detectWindowsPhone()
|| detectBlackBerry10Phone()
|| (detectBlackBerryWebKit() && detectBlackBerryTouch())
|| detectPalmWebOS()
|| detectBada()... | java | public boolean detectTierIphone() {
if (detectIphoneOrIpod()
|| detectAndroidPhone()
|| detectWindowsPhone()
|| detectBlackBerry10Phone()
|| (detectBlackBerryWebKit() && detectBlackBerryTouch())
|| detectPalmWebOS()
|| detectBada()... | [
"public",
"boolean",
"detectTierIphone",
"(",
")",
"{",
"if",
"(",
"detectIphoneOrIpod",
"(",
")",
"||",
"detectAndroidPhone",
"(",
")",
"||",
"detectWindowsPhone",
"(",
")",
"||",
"detectBlackBerry10Phone",
"(",
")",
"||",
"(",
"detectBlackBerryWebKit",
"(",
")... | The quick way to detect for a tier of devices.
This method detects for devices which can
display iPhone-optimized web content.
Includes iPhone, iPod Touch, Android, Windows Phone 7 and 8, BB10, WebOS, Playstation Vita, etc.
@return detection of any device in the iPhone/Android/Windows Phone/BlackBerry/WebOS Tier | [
"The",
"quick",
"way",
"to",
"detect",
"for",
"a",
"tier",
"of",
"devices",
".",
"This",
"method",
"detects",
"for",
"devices",
"which",
"can",
"display",
"iPhone",
"-",
"optimized",
"web",
"content",
".",
"Includes",
"iPhone",
"iPod",
"Touch",
"Android",
... | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/UAgentInfo.java#L965-L982 | train |
alkacon/opencms-core | src/org/opencms/jsp/util/UAgentInfo.java | UAgentInfo.detectTierRichCss | public boolean detectTierRichCss() {
boolean result = false;
//The following devices are explicitly ok.
//Note: 'High' BlackBerry devices ONLY
if (detectMobileQuick()) {
//Exclude iPhone Tier and e-Ink Kindle devices.
if (!detectTierIphone() && !detectKi... | java | public boolean detectTierRichCss() {
boolean result = false;
//The following devices are explicitly ok.
//Note: 'High' BlackBerry devices ONLY
if (detectMobileQuick()) {
//Exclude iPhone Tier and e-Ink Kindle devices.
if (!detectTierIphone() && !detectKi... | [
"public",
"boolean",
"detectTierRichCss",
"(",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"//The following devices are explicitly ok.\r",
"//Note: 'High' BlackBerry devices ONLY\r",
"if",
"(",
"detectMobileQuick",
"(",
")",
")",
"{",
"//Exclude iPhone Tier and e-Ink Ki... | The quick way to detect for a tier of devices.
This method detects for devices which are likely to be capable
of viewing CSS content optimized for the iPhone,
but may not necessarily support JavaScript.
Excludes all iPhone Tier devices.
@return detection of any device in the 'Rich CSS' Tier | [
"The",
"quick",
"way",
"to",
"detect",
"for",
"a",
"tier",
"of",
"devices",
".",
"This",
"method",
"detects",
"for",
"devices",
"which",
"are",
"likely",
"to",
"be",
"capable",
"of",
"viewing",
"CSS",
"content",
"optimized",
"for",
"the",
"iPhone",
"but",
... | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/UAgentInfo.java#L1007-L1030 | train |
alkacon/opencms-core | src/org/opencms/widgets/serialdate/CmsSerialDateBeanMonthly.java | CmsSerialDateBeanMonthly.setCorrectDay | private void setCorrectDay(Calendar date) {
if (monthHasNotDay(date)) {
date.set(Calendar.DAY_OF_MONTH, date.getActualMaximum(Calendar.DAY_OF_MONTH));
} else {
date.set(Calendar.DAY_OF_MONTH, m_dayOfMonth);
}
} | java | private void setCorrectDay(Calendar date) {
if (monthHasNotDay(date)) {
date.set(Calendar.DAY_OF_MONTH, date.getActualMaximum(Calendar.DAY_OF_MONTH));
} else {
date.set(Calendar.DAY_OF_MONTH, m_dayOfMonth);
}
} | [
"private",
"void",
"setCorrectDay",
"(",
"Calendar",
"date",
")",
"{",
"if",
"(",
"monthHasNotDay",
"(",
"date",
")",
")",
"{",
"date",
".",
"set",
"(",
"Calendar",
".",
"DAY_OF_MONTH",
",",
"date",
".",
"getActualMaximum",
"(",
"Calendar",
".",
"DAY_OF_MO... | Set the correct day for the date with year and month already fixed.
@param date the date, where year and month are already correct. | [
"Set",
"the",
"correct",
"day",
"for",
"the",
"date",
"with",
"year",
"and",
"month",
"already",
"fixed",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/serialdate/CmsSerialDateBeanMonthly.java#L126-L133 | train |
alkacon/opencms-core | src-setup/org/opencms/setup/CmsSetupBean.java | CmsSetupBean.getDbProperty | public String getDbProperty(String key) {
// extract the database key out of the entire key
String databaseKey = key.substring(0, key.indexOf('.'));
Properties databaseProperties = getDatabaseProperties().get(databaseKey);
return databaseProperties.getProperty(key, "");
} | java | public String getDbProperty(String key) {
// extract the database key out of the entire key
String databaseKey = key.substring(0, key.indexOf('.'));
Properties databaseProperties = getDatabaseProperties().get(databaseKey);
return databaseProperties.getProperty(key, "");
} | [
"public",
"String",
"getDbProperty",
"(",
"String",
"key",
")",
"{",
"// extract the database key out of the entire key",
"String",
"databaseKey",
"=",
"key",
".",
"substring",
"(",
"0",
",",
"key",
".",
"indexOf",
"(",
"'",
"'",
")",
")",
";",
"Properties",
"... | Returns the value for a given key from the database properties.
@param key the property key
@return the string value for a given key | [
"Returns",
"the",
"value",
"for",
"a",
"given",
"key",
"from",
"the",
"database",
"properties",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/CmsSetupBean.java#L714-L721 | train |
alkacon/opencms-core | src-setup/org/opencms/setup/CmsSetupBean.java | CmsSetupBean.isChecked | public String isChecked(String value1, String value2) {
if ((value1 == null) || (value2 == null)) {
return "";
}
if (value1.trim().equalsIgnoreCase(value2.trim())) {
return "checked";
}
return "";
} | java | public String isChecked(String value1, String value2) {
if ((value1 == null) || (value2 == null)) {
return "";
}
if (value1.trim().equalsIgnoreCase(value2.trim())) {
return "checked";
}
return "";
} | [
"public",
"String",
"isChecked",
"(",
"String",
"value1",
",",
"String",
"value2",
")",
"{",
"if",
"(",
"(",
"value1",
"==",
"null",
")",
"||",
"(",
"value2",
"==",
"null",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"if",
"(",
"value1",
".",
"trim"... | Over simplistic helper to compare two strings to check radio buttons.
@param value1 the first value
@param value2 the second value
@return "checked" if both values are equal, the empty String "" otherwise | [
"Over",
"simplistic",
"helper",
"to",
"compare",
"two",
"strings",
"to",
"check",
"radio",
"buttons",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/CmsSetupBean.java#L1393-L1404 | train |
alkacon/opencms-core | src/org/opencms/db/CmsLoginManager.java | CmsLoginManager.canLockBecauseOfInactivity | public boolean canLockBecauseOfInactivity(CmsObject cms, CmsUser user) {
return !user.isManaged()
&& !user.isWebuser()
&& !OpenCms.getDefaultUsers().isDefaultUser(user.getName())
&& !OpenCms.getRoleManager().hasRole(cms, user.getName(), CmsRole.ROOT_ADMIN);
} | java | public boolean canLockBecauseOfInactivity(CmsObject cms, CmsUser user) {
return !user.isManaged()
&& !user.isWebuser()
&& !OpenCms.getDefaultUsers().isDefaultUser(user.getName())
&& !OpenCms.getRoleManager().hasRole(cms, user.getName(), CmsRole.ROOT_ADMIN);
} | [
"public",
"boolean",
"canLockBecauseOfInactivity",
"(",
"CmsObject",
"cms",
",",
"CmsUser",
"user",
")",
"{",
"return",
"!",
"user",
".",
"isManaged",
"(",
")",
"&&",
"!",
"user",
".",
"isWebuser",
"(",
")",
"&&",
"!",
"OpenCms",
".",
"getDefaultUsers",
"(... | Checks whether a user account can be locked because of inactivity.
@param cms the CMS context
@param user the user to check
@return true if the user may be locked after being inactive for too long | [
"Checks",
"whether",
"a",
"user",
"account",
"can",
"be",
"locked",
"because",
"of",
"inactivity",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsLoginManager.java#L265-L271 | train |
alkacon/opencms-core | src/org/opencms/ui/apps/logfile/CmsLogFileApp.java | CmsLogFileApp.addDownloadButton | private void addDownloadButton(final CmsLogFileView view) {
Button button = CmsToolBar.createButton(
FontOpenCms.DOWNLOAD,
CmsVaadinUtils.getMessageText(Messages.GUI_LOGFILE_DOWNLOAD_0));
button.addClickListener(new ClickListener() {
private static final long serial... | java | private void addDownloadButton(final CmsLogFileView view) {
Button button = CmsToolBar.createButton(
FontOpenCms.DOWNLOAD,
CmsVaadinUtils.getMessageText(Messages.GUI_LOGFILE_DOWNLOAD_0));
button.addClickListener(new ClickListener() {
private static final long serial... | [
"private",
"void",
"addDownloadButton",
"(",
"final",
"CmsLogFileView",
"view",
")",
"{",
"Button",
"button",
"=",
"CmsToolBar",
".",
"createButton",
"(",
"FontOpenCms",
".",
"DOWNLOAD",
",",
"CmsVaadinUtils",
".",
"getMessageText",
"(",
"Messages",
".",
"GUI_LOGF... | Adds the download button.
@param view layout which displays the log file | [
"Adds",
"the",
"download",
"button",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/logfile/CmsLogFileApp.java#L253-L271 | train |
alkacon/opencms-core | src/org/opencms/cmis/CmsCmisUtil.java | CmsCmisUtil.addPropertyDefault | @SuppressWarnings("unchecked")
public static boolean addPropertyDefault(PropertiesImpl props, PropertyDefinition<?> propDef) {
if ((props == null) || (props.getProperties() == null)) {
throw new IllegalArgumentException("Props must not be null!");
}
if (propDef == null) ... | java | @SuppressWarnings("unchecked")
public static boolean addPropertyDefault(PropertiesImpl props, PropertyDefinition<?> propDef) {
if ((props == null) || (props.getProperties() == null)) {
throw new IllegalArgumentException("Props must not be null!");
}
if (propDef == null) ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"boolean",
"addPropertyDefault",
"(",
"PropertiesImpl",
"props",
",",
"PropertyDefinition",
"<",
"?",
">",
"propDef",
")",
"{",
"if",
"(",
"(",
"props",
"==",
"null",
")",
"||",
"(",
"pr... | Adds the default value of property if defined.
@param props the Properties object
@param propDef the property definition
@return true if the property could be added | [
"Adds",
"the",
"default",
"value",
"of",
"property",
"if",
"defined",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cmis/CmsCmisUtil.java#L215-L261 | train |
alkacon/opencms-core | src/org/opencms/cmis/CmsCmisUtil.java | CmsCmisUtil.checkAddProperty | public static boolean checkAddProperty(
CmsCmisTypeManager typeManager,
Properties properties,
String typeId,
Set<String> filter,
String id) {
if ((properties == null) || (properties.getProperties() == null)) {
throw new IllegalArgumentException("Prop... | java | public static boolean checkAddProperty(
CmsCmisTypeManager typeManager,
Properties properties,
String typeId,
Set<String> filter,
String id) {
if ((properties == null) || (properties.getProperties() == null)) {
throw new IllegalArgumentException("Prop... | [
"public",
"static",
"boolean",
"checkAddProperty",
"(",
"CmsCmisTypeManager",
"typeManager",
",",
"Properties",
"properties",
",",
"String",
"typeId",
",",
"Set",
"<",
"String",
">",
"filter",
",",
"String",
"id",
")",
"{",
"if",
"(",
"(",
"properties",
"==",
... | Checks whether a property can be added to a Properties.
@param typeManager
@param properties the properties object
@param typeId the type id
@param filter the property filter
@param id the property id
@return true if the property should be added | [
"Checks",
"whether",
"a",
"property",
"can",
"be",
"added",
"to",
"a",
"Properties",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cmis/CmsCmisUtil.java#L373-L407 | train |
alkacon/opencms-core | src/org/opencms/cmis/CmsCmisUtil.java | CmsCmisUtil.millisToCalendar | public static GregorianCalendar millisToCalendar(long millis) {
GregorianCalendar result = new GregorianCalendar();
result.setTimeZone(TimeZone.getTimeZone("GMT"));
result.setTimeInMillis((long)(Math.ceil(millis / 1000) * 1000));
return result;
} | java | public static GregorianCalendar millisToCalendar(long millis) {
GregorianCalendar result = new GregorianCalendar();
result.setTimeZone(TimeZone.getTimeZone("GMT"));
result.setTimeInMillis((long)(Math.ceil(millis / 1000) * 1000));
return result;
} | [
"public",
"static",
"GregorianCalendar",
"millisToCalendar",
"(",
"long",
"millis",
")",
"{",
"GregorianCalendar",
"result",
"=",
"new",
"GregorianCalendar",
"(",
")",
";",
"result",
".",
"setTimeZone",
"(",
"TimeZone",
".",
"getTimeZone",
"(",
"\"GMT\"",
")",
"... | Converts milliseconds into a calendar object.
@param millis a time given in milliseconds after epoch
@return the calendar object for the given time | [
"Converts",
"milliseconds",
"into",
"a",
"calendar",
"object",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cmis/CmsCmisUtil.java#L580-L586 | train |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/CmsTextArea.java | CmsTextArea.updateGhostStyle | private void updateGhostStyle() {
if (CmsStringUtil.isEmpty(m_realValue)) {
if (CmsStringUtil.isEmpty(m_ghostValue)) {
updateTextArea(m_realValue);
return;
}
if (!m_focus) {
setGhostStyleEnabled(true);
updateTex... | java | private void updateGhostStyle() {
if (CmsStringUtil.isEmpty(m_realValue)) {
if (CmsStringUtil.isEmpty(m_ghostValue)) {
updateTextArea(m_realValue);
return;
}
if (!m_focus) {
setGhostStyleEnabled(true);
updateTex... | [
"private",
"void",
"updateGhostStyle",
"(",
")",
"{",
"if",
"(",
"CmsStringUtil",
".",
"isEmpty",
"(",
"m_realValue",
")",
")",
"{",
"if",
"(",
"CmsStringUtil",
".",
"isEmpty",
"(",
"m_ghostValue",
")",
")",
"{",
"updateTextArea",
"(",
"m_realValue",
")",
... | Updates the styling and content of the internal text area based on the real value, the ghost value, and whether
it has focus. | [
"Updates",
"the",
"styling",
"and",
"content",
"of",
"the",
"internal",
"text",
"area",
"based",
"on",
"the",
"real",
"value",
"the",
"ghost",
"value",
"and",
"whether",
"it",
"has",
"focus",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/CmsTextArea.java#L618-L636 | train |
alkacon/opencms-core | src/org/opencms/widgets/CmsCategoryWidget.java | CmsCategoryWidget.generateCommonConfigPart | private Map<String, String> generateCommonConfigPart() {
Map<String, String> result = new HashMap<>();
if (m_category != null) {
result.put(CONFIGURATION_CATEGORY, m_category);
}
// append 'only leafs' to configuration
if (m_onlyLeafs) {
result.put(CONFIG... | java | private Map<String, String> generateCommonConfigPart() {
Map<String, String> result = new HashMap<>();
if (m_category != null) {
result.put(CONFIGURATION_CATEGORY, m_category);
}
// append 'only leafs' to configuration
if (m_onlyLeafs) {
result.put(CONFIG... | [
"private",
"Map",
"<",
"String",
",",
"String",
">",
"generateCommonConfigPart",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"result",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"if",
"(",
"m_category",
"!=",
"null",
")",
"{",
"result",
... | Helper to generate the common configuration part for client-side and server-side widget.
@return the common configuration options as map | [
"Helper",
"to",
"generate",
"the",
"common",
"configuration",
"part",
"for",
"client",
"-",
"side",
"and",
"server",
"-",
"side",
"widget",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/CmsCategoryWidget.java#L642-L661 | train |
alkacon/opencms-core | src/org/opencms/importexport/CmsImportExportManager.java | CmsImportExportManager.getDefaultTimestampModes | public Map<TimestampMode, List<String>> getDefaultTimestampModes() {
Map<TimestampMode, List<String>> result = new HashMap<TimestampMode, List<String>>();
for (String resourcetype : m_defaultTimestampModes.keySet()) {
TimestampMode mode = m_defaultTimestampModes.get(resourcetype);
... | java | public Map<TimestampMode, List<String>> getDefaultTimestampModes() {
Map<TimestampMode, List<String>> result = new HashMap<TimestampMode, List<String>>();
for (String resourcetype : m_defaultTimestampModes.keySet()) {
TimestampMode mode = m_defaultTimestampModes.get(resourcetype);
... | [
"public",
"Map",
"<",
"TimestampMode",
",",
"List",
"<",
"String",
">",
">",
"getDefaultTimestampModes",
"(",
")",
"{",
"Map",
"<",
"TimestampMode",
",",
"List",
"<",
"String",
">",
">",
"result",
"=",
"new",
"HashMap",
"<",
"TimestampMode",
",",
"List",
... | Returns the map from resourcetype names to default timestamp modes.
@return the map from resourcetype names to default timestamp modes. | [
"Returns",
"the",
"map",
"from",
"resourcetype",
"names",
"to",
"default",
"timestamp",
"modes",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/CmsImportExportManager.java#L679-L693 | train |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/CmsValidationHandler.java | CmsValidationHandler.addHandler | protected <H extends EventHandler> HandlerRegistration addHandler(final H handler, GwtEvent.Type<H> type) {
return ensureHandlers().addHandlerToSource(type, this, handler);
} | java | protected <H extends EventHandler> HandlerRegistration addHandler(final H handler, GwtEvent.Type<H> type) {
return ensureHandlers().addHandlerToSource(type, this, handler);
} | [
"protected",
"<",
"H",
"extends",
"EventHandler",
">",
"HandlerRegistration",
"addHandler",
"(",
"final",
"H",
"handler",
",",
"GwtEvent",
".",
"Type",
"<",
"H",
">",
"type",
")",
"{",
"return",
"ensureHandlers",
"(",
")",
".",
"addHandlerToSource",
"(",
"ty... | Adds this handler to the widget.
@param <H> the type of handler to add
@param type the event type
@param handler the handler
@return {@link HandlerRegistration} used to remove the handler | [
"Adds",
"this",
"handler",
"to",
"the",
"widget",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/CmsValidationHandler.java#L308-L311 | train |
alkacon/opencms-core | src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java | CmsXMLSearchConfigurationParser.parseFacetQueryItems | protected List<I_CmsFacetQueryItem> parseFacetQueryItems(final String path) throws Exception {
final List<I_CmsXmlContentValue> values = m_xml.getValues(path, m_locale);
if (values == null) {
return null;
} else {
List<I_CmsFacetQueryItem> parsedItems = new ArrayList<I_C... | java | protected List<I_CmsFacetQueryItem> parseFacetQueryItems(final String path) throws Exception {
final List<I_CmsXmlContentValue> values = m_xml.getValues(path, m_locale);
if (values == null) {
return null;
} else {
List<I_CmsFacetQueryItem> parsedItems = new ArrayList<I_C... | [
"protected",
"List",
"<",
"I_CmsFacetQueryItem",
">",
"parseFacetQueryItems",
"(",
"final",
"String",
"path",
")",
"throws",
"Exception",
"{",
"final",
"List",
"<",
"I_CmsXmlContentValue",
">",
"values",
"=",
"m_xml",
".",
"getValues",
"(",
"path",
",",
"m_local... | Helper to read a mandatory String value list.
@param path The XML path of the element to read.
@return The String list stored in the XML, or <code>null</code> if the value could not be read.
@throws Exception thrown if the list of String values can not be read. | [
"Helper",
"to",
"read",
"a",
"mandatory",
"String",
"value",
"list",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java#L411-L428 | train |
alkacon/opencms-core | src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java | CmsXMLSearchConfigurationParser.parseFieldFacet | protected I_CmsSearchConfigurationFacetField parseFieldFacet(final String pathPrefix) {
try {
final String field = parseMandatoryStringValue(pathPrefix + XML_ELEMENT_FACET_FIELD);
final String name = parseOptionalStringValue(pathPrefix + XML_ELEMENT_FACET_NAME);
final String... | java | protected I_CmsSearchConfigurationFacetField parseFieldFacet(final String pathPrefix) {
try {
final String field = parseMandatoryStringValue(pathPrefix + XML_ELEMENT_FACET_FIELD);
final String name = parseOptionalStringValue(pathPrefix + XML_ELEMENT_FACET_NAME);
final String... | [
"protected",
"I_CmsSearchConfigurationFacetField",
"parseFieldFacet",
"(",
"final",
"String",
"pathPrefix",
")",
"{",
"try",
"{",
"final",
"String",
"field",
"=",
"parseMandatoryStringValue",
"(",
"pathPrefix",
"+",
"XML_ELEMENT_FACET_FIELD",
")",
";",
"final",
"String"... | Reads the configuration of a field facet.
@param pathPrefix The XML Path that leads to the field facet configuration, or <code>null</code> if the XML was not correctly structured.
@return The read configuration, or <code>null</code> if the XML was not correctly structured. | [
"Reads",
"the",
"configuration",
"of",
"a",
"field",
"facet",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java#L434-L476 | train |
alkacon/opencms-core | src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java | CmsXMLSearchConfigurationParser.parseOptionalBooleanValue | protected Boolean parseOptionalBooleanValue(final String path) {
final I_CmsXmlContentValue value = m_xml.getValue(path, m_locale);
if (value == null) {
return null;
} else {
final String stringValue = value.getStringValue(null);
try {
final B... | java | protected Boolean parseOptionalBooleanValue(final String path) {
final I_CmsXmlContentValue value = m_xml.getValue(path, m_locale);
if (value == null) {
return null;
} else {
final String stringValue = value.getStringValue(null);
try {
final B... | [
"protected",
"Boolean",
"parseOptionalBooleanValue",
"(",
"final",
"String",
"path",
")",
"{",
"final",
"I_CmsXmlContentValue",
"value",
"=",
"m_xml",
".",
"getValue",
"(",
"path",
",",
"m_locale",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"retur... | Helper to read an optional Boolean value.
@param path The XML path of the element to read.
@return The Boolean value stored in the XML, or <code>null</code> if the value could not be read. | [
"Helper",
"to",
"read",
"an",
"optional",
"Boolean",
"value",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java#L482-L497 | train |
alkacon/opencms-core | src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java | CmsXMLSearchConfigurationParser.parseOptionalIntValue | protected Integer parseOptionalIntValue(final String path) {
final I_CmsXmlContentValue value = m_xml.getValue(path, m_locale);
if (value == null) {
return null;
} else {
final String stringValue = value.getStringValue(null);
try {
final Integ... | java | protected Integer parseOptionalIntValue(final String path) {
final I_CmsXmlContentValue value = m_xml.getValue(path, m_locale);
if (value == null) {
return null;
} else {
final String stringValue = value.getStringValue(null);
try {
final Integ... | [
"protected",
"Integer",
"parseOptionalIntValue",
"(",
"final",
"String",
"path",
")",
"{",
"final",
"I_CmsXmlContentValue",
"value",
"=",
"m_xml",
".",
"getValue",
"(",
"path",
",",
"m_locale",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
... | Helper to read an optional Integer value.
@param path The XML path of the element to read.
@return The Integer value stored in the XML, or <code>null</code> if the value could not be read. | [
"Helper",
"to",
"read",
"an",
"optional",
"Integer",
"value",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java#L503-L518 | train |
alkacon/opencms-core | src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java | CmsXMLSearchConfigurationParser.parseOptionalStringValue | protected String parseOptionalStringValue(final String path) {
final I_CmsXmlContentValue value = m_xml.getValue(path, m_locale);
if (value == null) {
return null;
} else {
return value.getStringValue(null);
}
} | java | protected String parseOptionalStringValue(final String path) {
final I_CmsXmlContentValue value = m_xml.getValue(path, m_locale);
if (value == null) {
return null;
} else {
return value.getStringValue(null);
}
} | [
"protected",
"String",
"parseOptionalStringValue",
"(",
"final",
"String",
"path",
")",
"{",
"final",
"I_CmsXmlContentValue",
"value",
"=",
"m_xml",
".",
"getValue",
"(",
"path",
",",
"m_locale",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return"... | Helper to read an optional String value.
@param path The XML path of the element to read.
@return The String value stored in the XML, or <code>null</code> if the value could not be read. | [
"Helper",
"to",
"read",
"an",
"optional",
"String",
"value",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java#L524-L532 | train |
alkacon/opencms-core | src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java | CmsXMLSearchConfigurationParser.parseOptionalStringValues | protected List<String> parseOptionalStringValues(final String path) {
final List<I_CmsXmlContentValue> values = m_xml.getValues(path, m_locale);
if (values == null) {
return null;
} else {
List<String> stringValues = new ArrayList<String>(values.size());
for ... | java | protected List<String> parseOptionalStringValues(final String path) {
final List<I_CmsXmlContentValue> values = m_xml.getValues(path, m_locale);
if (values == null) {
return null;
} else {
List<String> stringValues = new ArrayList<String>(values.size());
for ... | [
"protected",
"List",
"<",
"String",
">",
"parseOptionalStringValues",
"(",
"final",
"String",
"path",
")",
"{",
"final",
"List",
"<",
"I_CmsXmlContentValue",
">",
"values",
"=",
"m_xml",
".",
"getValues",
"(",
"path",
",",
"m_locale",
")",
";",
"if",
"(",
... | Helper to read an optional String value list.
@param path The XML path of the element to read.
@return The String list stored in the XML, or <code>null</code> if the value could not be read. | [
"Helper",
"to",
"read",
"an",
"optional",
"String",
"value",
"list",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java#L538-L550 | train |
alkacon/opencms-core | src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java | CmsXMLSearchConfigurationParser.parseRangeFacet | protected I_CmsSearchConfigurationFacetRange parseRangeFacet(String pathPrefix) {
try {
final String range = parseMandatoryStringValue(pathPrefix + XML_ELEMENT_RANGE_FACET_RANGE);
final String name = parseOptionalStringValue(pathPrefix + XML_ELEMENT_FACET_NAME);
final String... | java | protected I_CmsSearchConfigurationFacetRange parseRangeFacet(String pathPrefix) {
try {
final String range = parseMandatoryStringValue(pathPrefix + XML_ELEMENT_RANGE_FACET_RANGE);
final String name = parseOptionalStringValue(pathPrefix + XML_ELEMENT_FACET_NAME);
final String... | [
"protected",
"I_CmsSearchConfigurationFacetRange",
"parseRangeFacet",
"(",
"String",
"pathPrefix",
")",
"{",
"try",
"{",
"final",
"String",
"range",
"=",
"parseMandatoryStringValue",
"(",
"pathPrefix",
"+",
"XML_ELEMENT_RANGE_FACET_RANGE",
")",
";",
"final",
"String",
"... | Reads the configuration of a range facet.
@param pathPrefix The XML Path that leads to the range facet configuration, or <code>null</code> if the XML was not correctly structured.
@return The read configuration, or <code>null</code> if the XML was not correctly structured. | [
"Reads",
"the",
"configuration",
"of",
"a",
"range",
"facet",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java#L556-L614 | train |
alkacon/opencms-core | src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java | CmsXMLSearchConfigurationParser.getPageSizes | private List<Integer> getPageSizes() {
final String pageSizes = parseOptionalStringValue(XML_ELEMENT_PAGESIZE);
if (pageSizes != null) {
String[] pageSizesArray = pageSizes.split("-");
if (pageSizesArray.length > 0) {
try {
List<Integer> resul... | java | private List<Integer> getPageSizes() {
final String pageSizes = parseOptionalStringValue(XML_ELEMENT_PAGESIZE);
if (pageSizes != null) {
String[] pageSizesArray = pageSizes.split("-");
if (pageSizesArray.length > 0) {
try {
List<Integer> resul... | [
"private",
"List",
"<",
"Integer",
">",
"getPageSizes",
"(",
")",
"{",
"final",
"String",
"pageSizes",
"=",
"parseOptionalStringValue",
"(",
"XML_ELEMENT_PAGESIZE",
")",
";",
"if",
"(",
"pageSizes",
"!=",
"null",
")",
"{",
"String",
"[",
"]",
"pageSizesArray",... | Returns the configured page size, or the default page size if it is not configured.
@return The configured page size, or the default page size if it is not configured. | [
"Returns",
"the",
"configured",
"page",
"size",
"or",
"the",
"default",
"page",
"size",
"if",
"it",
"is",
"not",
"configured",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java#L742-L760 | train |
alkacon/opencms-core | src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java | CmsXMLSearchConfigurationParser.getQueryParam | private String getQueryParam() {
final String param = parseOptionalStringValue(XML_ELEMENT_QUERYPARAM);
if (param == null) {
return DEFAULT_QUERY_PARAM;
} else {
return param;
}
} | java | private String getQueryParam() {
final String param = parseOptionalStringValue(XML_ELEMENT_QUERYPARAM);
if (param == null) {
return DEFAULT_QUERY_PARAM;
} else {
return param;
}
} | [
"private",
"String",
"getQueryParam",
"(",
")",
"{",
"final",
"String",
"param",
"=",
"parseOptionalStringValue",
"(",
"XML_ELEMENT_QUERYPARAM",
")",
";",
"if",
"(",
"param",
"==",
"null",
")",
"{",
"return",
"DEFAULT_QUERY_PARAM",
";",
"}",
"else",
"{",
"retu... | Returns the configured request parameter for the current query string, or the default parameter if the core is not specified.
@return The configured request parameter for the current query string, or the default parameter if the core is not specified. | [
"Returns",
"the",
"configured",
"request",
"parameter",
"for",
"the",
"current",
"query",
"string",
"or",
"the",
"default",
"parameter",
"if",
"the",
"core",
"is",
"not",
"specified",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java#L773-L781 | train |
alkacon/opencms-core | src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java | CmsXMLSearchConfigurationParser.getSortOptions | private List<I_CmsSearchConfigurationSortOption> getSortOptions() {
final List<I_CmsSearchConfigurationSortOption> options = new ArrayList<I_CmsSearchConfigurationSortOption>();
final CmsXmlContentValueSequence sortOptions = m_xml.getValueSequence(XML_ELEMENT_SORTOPTIONS, m_locale);
if (sortOpt... | java | private List<I_CmsSearchConfigurationSortOption> getSortOptions() {
final List<I_CmsSearchConfigurationSortOption> options = new ArrayList<I_CmsSearchConfigurationSortOption>();
final CmsXmlContentValueSequence sortOptions = m_xml.getValueSequence(XML_ELEMENT_SORTOPTIONS, m_locale);
if (sortOpt... | [
"private",
"List",
"<",
"I_CmsSearchConfigurationSortOption",
">",
"getSortOptions",
"(",
")",
"{",
"final",
"List",
"<",
"I_CmsSearchConfigurationSortOption",
">",
"options",
"=",
"new",
"ArrayList",
"<",
"I_CmsSearchConfigurationSortOption",
">",
"(",
")",
";",
"fin... | Returns the configured sort options, or the empty list if no such options are configured.
@return The configured sort options, or the empty list if no such options are configured. | [
"Returns",
"the",
"configured",
"sort",
"options",
"or",
"the",
"empty",
"list",
"if",
"no",
"such",
"options",
"are",
"configured",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java#L794-L810 | train |
alkacon/opencms-core | src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java | CmsXMLSearchConfigurationParser.parseFacetQueryItem | private I_CmsFacetQueryItem parseFacetQueryItem(final String prefix) {
I_CmsXmlContentValue query = m_xml.getValue(prefix + XML_ELEMENT_QUERY_FACET_QUERY_QUERY, m_locale);
if (null != query) {
String queryString = query.getStringValue(null);
I_CmsXmlContentValue label = m_xml.ge... | java | private I_CmsFacetQueryItem parseFacetQueryItem(final String prefix) {
I_CmsXmlContentValue query = m_xml.getValue(prefix + XML_ELEMENT_QUERY_FACET_QUERY_QUERY, m_locale);
if (null != query) {
String queryString = query.getStringValue(null);
I_CmsXmlContentValue label = m_xml.ge... | [
"private",
"I_CmsFacetQueryItem",
"parseFacetQueryItem",
"(",
"final",
"String",
"prefix",
")",
"{",
"I_CmsXmlContentValue",
"query",
"=",
"m_xml",
".",
"getValue",
"(",
"prefix",
"+",
"XML_ELEMENT_QUERY_FACET_QUERY_QUERY",
",",
"m_locale",
")",
";",
"if",
"(",
"nul... | Parses a single query facet item with query and label.
@param prefix path to the query facet item (with trailing '/').
@return the query facet item. | [
"Parses",
"a",
"single",
"query",
"facet",
"item",
"with",
"query",
"and",
"label",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java#L824-L835 | train |
alkacon/opencms-core | src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java | CmsXMLSearchConfigurationParser.parseMandatoryStringValue | private String parseMandatoryStringValue(final String path) throws Exception {
final String value = parseOptionalStringValue(path);
if (value == null) {
throw new Exception();
}
return value;
} | java | private String parseMandatoryStringValue(final String path) throws Exception {
final String value = parseOptionalStringValue(path);
if (value == null) {
throw new Exception();
}
return value;
} | [
"private",
"String",
"parseMandatoryStringValue",
"(",
"final",
"String",
"path",
")",
"throws",
"Exception",
"{",
"final",
"String",
"value",
"=",
"parseOptionalStringValue",
"(",
"path",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
... | Helper to read a mandatory String value.
@param path The XML path of the element to read.
@return The String value stored in the XML.
@throws Exception thrown if the value could not be read. | [
"Helper",
"to",
"read",
"a",
"mandatory",
"String",
"value",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/search/config/parser/CmsXMLSearchConfigurationParser.java#L842-L849 | train |
alkacon/opencms-core | src/org/opencms/search/CmsIndexingThread.java | CmsIndexingThread.createDefaultIndexDocument | protected I_CmsSearchDocument createDefaultIndexDocument() {
try {
return m_index.getFieldConfiguration().createDocument(m_cms, m_res, m_index, null);
} catch (CmsException e) {
LOG.error(
"Default document for "
+ m_res.getRootPath()
... | java | protected I_CmsSearchDocument createDefaultIndexDocument() {
try {
return m_index.getFieldConfiguration().createDocument(m_cms, m_res, m_index, null);
} catch (CmsException e) {
LOG.error(
"Default document for "
+ m_res.getRootPath()
... | [
"protected",
"I_CmsSearchDocument",
"createDefaultIndexDocument",
"(",
")",
"{",
"try",
"{",
"return",
"m_index",
".",
"getFieldConfiguration",
"(",
")",
".",
"createDocument",
"(",
"m_cms",
",",
"m_res",
",",
"m_index",
",",
"null",
")",
";",
"}",
"catch",
"(... | Creates a document for the resource without extracting the content. The aim is to get a content indexed,
even if extraction runs into a timeout.
@return the document for the resource generated if the content is discarded,
i.e., only meta information are indexed. | [
"Creates",
"a",
"document",
"for",
"the",
"resource",
"without",
"extracting",
"the",
"content",
".",
"The",
"aim",
"is",
"to",
"get",
"a",
"content",
"indexed",
"even",
"if",
"extraction",
"runs",
"into",
"a",
"timeout",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsIndexingThread.java#L197-L211 | train |
alkacon/opencms-core | src/org/opencms/jsp/util/A_CmsJspValueWrapper.java | A_CmsJspValueWrapper.getToInstanceDate | public CmsJspInstanceDateBean getToInstanceDate() {
if (m_instanceDate == null) {
m_instanceDate = new CmsJspInstanceDateBean(getToDate(), m_cms.getRequestContext().getLocale());
}
return m_instanceDate;
} | java | public CmsJspInstanceDateBean getToInstanceDate() {
if (m_instanceDate == null) {
m_instanceDate = new CmsJspInstanceDateBean(getToDate(), m_cms.getRequestContext().getLocale());
}
return m_instanceDate;
} | [
"public",
"CmsJspInstanceDateBean",
"getToInstanceDate",
"(",
")",
"{",
"if",
"(",
"m_instanceDate",
"==",
"null",
")",
"{",
"m_instanceDate",
"=",
"new",
"CmsJspInstanceDateBean",
"(",
"getToDate",
"(",
")",
",",
"m_cms",
".",
"getRequestContext",
"(",
")",
"."... | Converts a date to an instance date bean.
@return the instance date bean. | [
"Converts",
"a",
"date",
"to",
"an",
"instance",
"date",
"bean",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/A_CmsJspValueWrapper.java#L448-L454 | train |
alkacon/opencms-core | src/org/opencms/workplace/galleries/Messages.java | Messages.getGalleryNotFoundKey | public static String getGalleryNotFoundKey(String gallery) {
StringBuffer sb = new StringBuffer(ERROR_REASON_NO_PREFIX);
sb.append(gallery.toUpperCase());
sb.append(GUI_TITLE_POSTFIX);
return sb.toString();
} | java | public static String getGalleryNotFoundKey(String gallery) {
StringBuffer sb = new StringBuffer(ERROR_REASON_NO_PREFIX);
sb.append(gallery.toUpperCase());
sb.append(GUI_TITLE_POSTFIX);
return sb.toString();
} | [
"public",
"static",
"String",
"getGalleryNotFoundKey",
"(",
"String",
"gallery",
")",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
"ERROR_REASON_NO_PREFIX",
")",
";",
"sb",
".",
"append",
"(",
"gallery",
".",
"toUpperCase",
"(",
")",
")",
";",
... | Convert gallery name to not found error key.
@param gallery gallery name for example "downloadgallery"
@return key as string "ERR_REASON_NO_DOWNLOADGALLERY_0" | [
"Convert",
"gallery",
"name",
"to",
"not",
"found",
"error",
"key",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/galleries/Messages.java#L499-L505 | train |
alkacon/opencms-core | src/org/opencms/workplace/galleries/Messages.java | Messages.getTitleGalleryKey | public static String getTitleGalleryKey(String gallery) {
StringBuffer sb = new StringBuffer(GUI_TITLE_PREFIX);
sb.append(gallery.toUpperCase());
sb.append(GUI_TITLE_POSTFIX);
return sb.toString();
} | java | public static String getTitleGalleryKey(String gallery) {
StringBuffer sb = new StringBuffer(GUI_TITLE_PREFIX);
sb.append(gallery.toUpperCase());
sb.append(GUI_TITLE_POSTFIX);
return sb.toString();
} | [
"public",
"static",
"String",
"getTitleGalleryKey",
"(",
"String",
"gallery",
")",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
"GUI_TITLE_PREFIX",
")",
";",
"sb",
".",
"append",
"(",
"gallery",
".",
"toUpperCase",
"(",
")",
")",
";",
"sb",
... | Convert gallery name to title key.
@param gallery gallery name for example "downloadgallery"
@return key as string "ERR_REASON_NO_DOWNLOADGALLERY_0" | [
"Convert",
"gallery",
"name",
"to",
"title",
"key",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/galleries/Messages.java#L512-L518 | train |
alkacon/opencms-core | src/org/opencms/xml/templatemapper/CmsTemplateMapper.java | CmsTemplateMapper.getTemplateMapperConfig | public static String getTemplateMapperConfig(ServletRequest request) {
String result = null;
CmsTemplateContext templateContext = (CmsTemplateContext)request.getAttribute(
CmsTemplateContextManager.ATTR_TEMPLATE_CONTEXT);
if (templateContext != null) {
I_CmsTemplateConte... | java | public static String getTemplateMapperConfig(ServletRequest request) {
String result = null;
CmsTemplateContext templateContext = (CmsTemplateContext)request.getAttribute(
CmsTemplateContextManager.ATTR_TEMPLATE_CONTEXT);
if (templateContext != null) {
I_CmsTemplateConte... | [
"public",
"static",
"String",
"getTemplateMapperConfig",
"(",
"ServletRequest",
"request",
")",
"{",
"String",
"result",
"=",
"null",
";",
"CmsTemplateContext",
"templateContext",
"=",
"(",
"CmsTemplateContext",
")",
"request",
".",
"getAttribute",
"(",
"CmsTemplateCo... | Checks if the selected template context is "templatemapper".
@param request the current request
@return true if the selected template context is "templatemapper" | [
"Checks",
"if",
"the",
"selected",
"template",
"context",
"is",
"templatemapper",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/templatemapper/CmsTemplateMapper.java#L134-L147 | train |
alkacon/opencms-core | src/org/opencms/xml/templatemapper/CmsTemplateMapper.java | CmsTemplateMapper.getConfiguration | private CmsTemplateMapperConfiguration getConfiguration(final CmsObject cms) {
if (!m_enabled) {
return CmsTemplateMapperConfiguration.EMPTY_CONFIG;
}
if (m_configPath == null) {
m_configPath = OpenCms.getSystemInfo().getConfigFilePath(cms, "template-mapping.xml");
... | java | private CmsTemplateMapperConfiguration getConfiguration(final CmsObject cms) {
if (!m_enabled) {
return CmsTemplateMapperConfiguration.EMPTY_CONFIG;
}
if (m_configPath == null) {
m_configPath = OpenCms.getSystemInfo().getConfigFilePath(cms, "template-mapping.xml");
... | [
"private",
"CmsTemplateMapperConfiguration",
"getConfiguration",
"(",
"final",
"CmsObject",
"cms",
")",
"{",
"if",
"(",
"!",
"m_enabled",
")",
"{",
"return",
"CmsTemplateMapperConfiguration",
".",
"EMPTY_CONFIG",
";",
"}",
"if",
"(",
"m_configPath",
"==",
"null",
... | Loads the configuration file, using CmsVfsMemoryObjectCache for caching.
@param cms the CMS context
@return the template mapper configuration | [
"Loads",
"the",
"configuration",
"file",
"using",
"CmsVfsMemoryObjectCache",
"for",
"caching",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/templatemapper/CmsTemplateMapper.java#L348-L381 | train |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/CmsErrorDialog.java | CmsErrorDialog.onShow | private void onShow() {
if (m_detailsFieldset != null) {
m_detailsFieldset.getContentPanel().getElement().getStyle().setPropertyPx(
"maxHeight",
getAvailableHeight(m_messageWidget.getOffsetHeight()));
}
} | java | private void onShow() {
if (m_detailsFieldset != null) {
m_detailsFieldset.getContentPanel().getElement().getStyle().setPropertyPx(
"maxHeight",
getAvailableHeight(m_messageWidget.getOffsetHeight()));
}
} | [
"private",
"void",
"onShow",
"(",
")",
"{",
"if",
"(",
"m_detailsFieldset",
"!=",
"null",
")",
"{",
"m_detailsFieldset",
".",
"getContentPanel",
"(",
")",
".",
"getElement",
"(",
")",
".",
"getStyle",
"(",
")",
".",
"setPropertyPx",
"(",
"\"maxHeight\"",
"... | Checks the available space and sets max-height to the details field-set. | [
"Checks",
"the",
"available",
"space",
"and",
"sets",
"max",
"-",
"height",
"to",
"the",
"details",
"field",
"-",
"set",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsErrorDialog.java#L329-L336 | train |
alkacon/opencms-core | src/org/opencms/ui/apps/git/CmsGitCheckin.java | CmsGitCheckin.addModuleToExport | public void addModuleToExport(final String moduleName) {
if (m_modulesToExport == null) {
m_modulesToExport = new HashSet<String>();
}
m_modulesToExport.add(moduleName);
} | java | public void addModuleToExport(final String moduleName) {
if (m_modulesToExport == null) {
m_modulesToExport = new HashSet<String>();
}
m_modulesToExport.add(moduleName);
} | [
"public",
"void",
"addModuleToExport",
"(",
"final",
"String",
"moduleName",
")",
"{",
"if",
"(",
"m_modulesToExport",
"==",
"null",
")",
"{",
"m_modulesToExport",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"}",
"m_modulesToExport",
".",
"add"... | Adds a module to the modules that should be exported.
If called at least once, the explicitly added modules will be exported
instead of the default modules.
@param moduleName the name of the module to export. | [
"Adds",
"a",
"module",
"to",
"the",
"modules",
"that",
"should",
"be",
"exported",
".",
"If",
"called",
"at",
"least",
"once",
"the",
"explicitly",
"added",
"modules",
"will",
"be",
"exported",
"instead",
"of",
"the",
"default",
"modules",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/git/CmsGitCheckin.java#L220-L226 | train |
alkacon/opencms-core | src/org/opencms/ui/apps/git/CmsGitCheckin.java | CmsGitCheckin.checkIn | public int checkIn() {
try {
synchronized (STATIC_LOCK) {
m_logStream = new PrintStream(new FileOutputStream(DEFAULT_LOGFILE_PATH, false));
CmsObject cms = getCmsObject();
if (cms != null) {
return checkInInternal();
... | java | public int checkIn() {
try {
synchronized (STATIC_LOCK) {
m_logStream = new PrintStream(new FileOutputStream(DEFAULT_LOGFILE_PATH, false));
CmsObject cms = getCmsObject();
if (cms != null) {
return checkInInternal();
... | [
"public",
"int",
"checkIn",
"(",
")",
"{",
"try",
"{",
"synchronized",
"(",
"STATIC_LOCK",
")",
"{",
"m_logStream",
"=",
"new",
"PrintStream",
"(",
"new",
"FileOutputStream",
"(",
"DEFAULT_LOGFILE_PATH",
",",
"false",
")",
")",
";",
"CmsObject",
"cms",
"=",
... | Start export and check in of the selected modules.
@return The exit code of the check in procedure (like a script's exit code). | [
"Start",
"export",
"and",
"check",
"in",
"of",
"the",
"selected",
"modules",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/git/CmsGitCheckin.java#L232-L249 | train |
alkacon/opencms-core | src/org/opencms/ui/apps/git/CmsGitCheckin.java | CmsGitCheckin.setCurrentConfiguration | public boolean setCurrentConfiguration(CmsGitConfiguration configuration) {
if ((null != configuration) && configuration.isValid()) {
m_currentConfiguration = configuration;
return true;
}
return false;
} | java | public boolean setCurrentConfiguration(CmsGitConfiguration configuration) {
if ((null != configuration) && configuration.isValid()) {
m_currentConfiguration = configuration;
return true;
}
return false;
} | [
"public",
"boolean",
"setCurrentConfiguration",
"(",
"CmsGitConfiguration",
"configuration",
")",
"{",
"if",
"(",
"(",
"null",
"!=",
"configuration",
")",
"&&",
"configuration",
".",
"isValid",
"(",
")",
")",
"{",
"m_currentConfiguration",
"=",
"configuration",
";... | Sets the current configuration if it is a valid configuration. Otherwise the configuration is not set.
@param configuration the configuration to set.
@return flag, indicating if the configuration is set. | [
"Sets",
"the",
"current",
"configuration",
"if",
"it",
"is",
"a",
"valid",
"configuration",
".",
"Otherwise",
"the",
"configuration",
"is",
"not",
"set",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/git/CmsGitCheckin.java#L429-L436 | train |
alkacon/opencms-core | src/org/opencms/ui/apps/git/CmsGitCheckin.java | CmsGitCheckin.checkInInternal | private int checkInInternal() {
m_logStream.println("[" + new Date() + "] STARTING Git task");
m_logStream.println("=========================");
m_logStream.println();
if (m_checkout) {
m_logStream.println("Running checkout script");
} else if (!(m_resetHead || m_r... | java | private int checkInInternal() {
m_logStream.println("[" + new Date() + "] STARTING Git task");
m_logStream.println("=========================");
m_logStream.println();
if (m_checkout) {
m_logStream.println("Running checkout script");
} else if (!(m_resetHead || m_r... | [
"private",
"int",
"checkInInternal",
"(",
")",
"{",
"m_logStream",
".",
"println",
"(",
"\"[\"",
"+",
"new",
"Date",
"(",
")",
"+",
"\"] STARTING Git task\"",
")",
";",
"m_logStream",
".",
"println",
"(",
"\"=========================\"",
")",
";",
"m_logStream",... | Export modules and check them in. Assumes the log stream already open.
@return exit code of the commit-script. | [
"Export",
"modules",
"and",
"check",
"them",
"in",
".",
"Assumes",
"the",
"log",
"stream",
"already",
"open",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/git/CmsGitCheckin.java#L558-L605 | train |
alkacon/opencms-core | src/org/opencms/ui/apps/git/CmsGitCheckin.java | CmsGitCheckin.checkinScriptCommand | private String checkinScriptCommand() {
String exportModules = "";
if ((m_modulesToExport != null) && !m_modulesToExport.isEmpty()) {
StringBuffer exportModulesParam = new StringBuffer();
for (String moduleName : m_modulesToExport) {
exportModulesParam.append(" "... | java | private String checkinScriptCommand() {
String exportModules = "";
if ((m_modulesToExport != null) && !m_modulesToExport.isEmpty()) {
StringBuffer exportModulesParam = new StringBuffer();
for (String moduleName : m_modulesToExport) {
exportModulesParam.append(" "... | [
"private",
"String",
"checkinScriptCommand",
"(",
")",
"{",
"String",
"exportModules",
"=",
"\"\"",
";",
"if",
"(",
"(",
"m_modulesToExport",
"!=",
"null",
")",
"&&",
"!",
"m_modulesToExport",
".",
"isEmpty",
"(",
")",
")",
"{",
"StringBuffer",
"exportModulesP... | Returns the command to run by the shell to normally run the checkin script.
@return the command to run by the shell to normally run the checkin script. | [
"Returns",
"the",
"command",
"to",
"run",
"by",
"the",
"shell",
"to",
"normally",
"run",
"the",
"checkin",
"script",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/git/CmsGitCheckin.java#L610-L695 | train |
alkacon/opencms-core | src/org/opencms/ui/apps/git/CmsGitCheckin.java | CmsGitCheckin.exportModules | private void exportModules() {
// avoid to export modules if unnecessary
if (((null != m_copyAndUnzip) && !m_copyAndUnzip.booleanValue())
|| ((null == m_copyAndUnzip) && !m_currentConfiguration.getDefaultCopyAndUnzip())) {
m_logStream.println();
m_logStream.println("... | java | private void exportModules() {
// avoid to export modules if unnecessary
if (((null != m_copyAndUnzip) && !m_copyAndUnzip.booleanValue())
|| ((null == m_copyAndUnzip) && !m_currentConfiguration.getDefaultCopyAndUnzip())) {
m_logStream.println();
m_logStream.println("... | [
"private",
"void",
"exportModules",
"(",
")",
"{",
"// avoid to export modules if unnecessary",
"if",
"(",
"(",
"(",
"null",
"!=",
"m_copyAndUnzip",
")",
"&&",
"!",
"m_copyAndUnzip",
".",
"booleanValue",
"(",
")",
")",
"||",
"(",
"(",
"null",
"==",
"m_copyAndU... | Export the modules that should be checked in into git. | [
"Export",
"the",
"modules",
"that",
"should",
"be",
"checked",
"in",
"into",
"git",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/git/CmsGitCheckin.java#L709-L744 | train |
alkacon/opencms-core | src/org/opencms/ui/apps/git/CmsGitCheckin.java | CmsGitCheckin.readConfigFiles | private List<CmsGitConfiguration> readConfigFiles() {
List<CmsGitConfiguration> configurations = new LinkedList<CmsGitConfiguration>();
// Default configuration file for backwards compatibility
addConfigurationIfValid(configurations, new File(DEFAULT_CONFIG_FILE));
// All files in the... | java | private List<CmsGitConfiguration> readConfigFiles() {
List<CmsGitConfiguration> configurations = new LinkedList<CmsGitConfiguration>();
// Default configuration file for backwards compatibility
addConfigurationIfValid(configurations, new File(DEFAULT_CONFIG_FILE));
// All files in the... | [
"private",
"List",
"<",
"CmsGitConfiguration",
">",
"readConfigFiles",
"(",
")",
"{",
"List",
"<",
"CmsGitConfiguration",
">",
"configurations",
"=",
"new",
"LinkedList",
"<",
"CmsGitConfiguration",
">",
"(",
")",
";",
"// Default configuration file for backwards compat... | Read all configuration files.
@return the list with all available configurations | [
"Read",
"all",
"configuration",
"files",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/git/CmsGitCheckin.java#L861-L876 | train |
alkacon/opencms-core | src/org/opencms/ui/apps/git/CmsGitCheckin.java | CmsGitCheckin.runCommitScript | private int runCommitScript() {
if (m_checkout && !m_fetchAndResetBeforeImport) {
m_logStream.println("Skipping script....");
return 0;
}
try {
m_logStream.flush();
String commandParam;
if (m_resetRemoteHead) {
commandP... | java | private int runCommitScript() {
if (m_checkout && !m_fetchAndResetBeforeImport) {
m_logStream.println("Skipping script....");
return 0;
}
try {
m_logStream.flush();
String commandParam;
if (m_resetRemoteHead) {
commandP... | [
"private",
"int",
"runCommitScript",
"(",
")",
"{",
"if",
"(",
"m_checkout",
"&&",
"!",
"m_fetchAndResetBeforeImport",
")",
"{",
"m_logStream",
".",
"println",
"(",
"\"Skipping script....\"",
")",
";",
"return",
"0",
";",
"}",
"try",
"{",
"m_logStream",
".",
... | Runs the shell script for committing and optionally pushing the changes in the module.
@return exit code of the script. | [
"Runs",
"the",
"shell",
"script",
"for",
"committing",
"and",
"optionally",
"pushing",
"the",
"changes",
"in",
"the",
"module",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/git/CmsGitCheckin.java#L902-L940 | train |
alkacon/opencms-core | src/org/opencms/ui/apps/git/CmsGitToolOptionsPanel.java | CmsGitToolOptionsPanel.updateForNewConfiguration | protected void updateForNewConfiguration(CmsGitConfiguration gitConfig) {
if (!m_checkinBean.setCurrentConfiguration(gitConfig)) {
Notification.show(
CmsVaadinUtils.getMessageText(Messages.GUI_GIT_CONFIGURATION_SWITCH_FAILED_0),
CmsVaadinUtils.getMessageText(Messages... | java | protected void updateForNewConfiguration(CmsGitConfiguration gitConfig) {
if (!m_checkinBean.setCurrentConfiguration(gitConfig)) {
Notification.show(
CmsVaadinUtils.getMessageText(Messages.GUI_GIT_CONFIGURATION_SWITCH_FAILED_0),
CmsVaadinUtils.getMessageText(Messages... | [
"protected",
"void",
"updateForNewConfiguration",
"(",
"CmsGitConfiguration",
"gitConfig",
")",
"{",
"if",
"(",
"!",
"m_checkinBean",
".",
"setCurrentConfiguration",
"(",
"gitConfig",
")",
")",
"{",
"Notification",
".",
"show",
"(",
"CmsVaadinUtils",
".",
"getMessag... | Updates the options panel for a special configuration.
@param gitConfig the git configuration. | [
"Updates",
"the",
"options",
"panel",
"for",
"a",
"special",
"configuration",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/git/CmsGitToolOptionsPanel.java#L621-L648 | train |
alkacon/opencms-core | src/org/opencms/ui/apps/git/CmsGitToolOptionsPanel.java | CmsGitToolOptionsPanel.configureConfigurationSelector | private void configureConfigurationSelector() {
if (m_checkinBean.getConfigurations().size() < 2) {
// Do not show the configuration selection at all.
removeComponent(m_configurationSelectionPanel);
} else {
for (CmsGitConfiguration configuration : m_checkinBean.getC... | java | private void configureConfigurationSelector() {
if (m_checkinBean.getConfigurations().size() < 2) {
// Do not show the configuration selection at all.
removeComponent(m_configurationSelectionPanel);
} else {
for (CmsGitConfiguration configuration : m_checkinBean.getC... | [
"private",
"void",
"configureConfigurationSelector",
"(",
")",
"{",
"if",
"(",
"m_checkinBean",
".",
"getConfigurations",
"(",
")",
".",
"size",
"(",
")",
"<",
"2",
")",
"{",
"// Do not show the configuration selection at all.",
"removeComponent",
"(",
"m_configuratio... | Configures the configuration selector. | [
"Configures",
"the",
"configuration",
"selector",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/git/CmsGitToolOptionsPanel.java#L653-L682 | train |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsStylesheetLoader.java | CmsStylesheetLoader.loadWithTimeout | public void loadWithTimeout(int timeout) {
for (String stylesheet : m_stylesheets) {
boolean alreadyLoaded = checkStylesheet(stylesheet);
if (alreadyLoaded) {
m_loadCounter += 1;
} else {
appendStylesheet(stylesheet, m_jsCallback);
... | java | public void loadWithTimeout(int timeout) {
for (String stylesheet : m_stylesheets) {
boolean alreadyLoaded = checkStylesheet(stylesheet);
if (alreadyLoaded) {
m_loadCounter += 1;
} else {
appendStylesheet(stylesheet, m_jsCallback);
... | [
"public",
"void",
"loadWithTimeout",
"(",
"int",
"timeout",
")",
"{",
"for",
"(",
"String",
"stylesheet",
":",
"m_stylesheets",
")",
"{",
"boolean",
"alreadyLoaded",
"=",
"checkStylesheet",
"(",
"stylesheet",
")",
";",
"if",
"(",
"alreadyLoaded",
")",
"{",
"... | Starts the loading process and creates a timer that sets of the callback after a given tiime if it hasn't already been triggered.
@param timeout number of milliseconds after which the callback should be called if it hasn't already been | [
"Starts",
"the",
"loading",
"process",
"and",
"creates",
"a",
"timer",
"that",
"sets",
"of",
"the",
"callback",
"after",
"a",
"given",
"tiime",
"if",
"it",
"hasn",
"t",
"already",
"been",
"triggered",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsStylesheetLoader.java#L93-L117 | train |
alkacon/opencms-core | src/org/opencms/search/solr/CmsSolrIndex.java | CmsSolrIndex.hasPermissions | protected boolean hasPermissions(CmsObject cms, CmsSolrDocument doc, CmsResourceFilter filter) {
return null != (filter == null ? getResource(cms, doc) : getResource(cms, doc, filter));
} | java | protected boolean hasPermissions(CmsObject cms, CmsSolrDocument doc, CmsResourceFilter filter) {
return null != (filter == null ? getResource(cms, doc) : getResource(cms, doc, filter));
} | [
"protected",
"boolean",
"hasPermissions",
"(",
"CmsObject",
"cms",
",",
"CmsSolrDocument",
"doc",
",",
"CmsResourceFilter",
"filter",
")",
"{",
"return",
"null",
"!=",
"(",
"filter",
"==",
"null",
"?",
"getResource",
"(",
"cms",
",",
"doc",
")",
":",
"getRes... | Check, if the current user has permissions on the document's resource.
@param cms the context
@param doc the solr document (from the search result)
@param filter the resource filter to use for checking permissions
@return <code>true</code> iff the resource mirrored by the search result can be read by the current user. | [
"Check",
"if",
"the",
"current",
"user",
"has",
"permissions",
"on",
"the",
"document",
"s",
"resource",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/solr/CmsSolrIndex.java#L1491-L1494 | train |
alkacon/opencms-core | src/org/opencms/search/solr/CmsSolrIndex.java | CmsSolrIndex.isDebug | private boolean isDebug(CmsObject cms, CmsSolrQuery query) {
String[] debugSecretValues = query.remove(REQUEST_PARAM_DEBUG_SECRET);
String debugSecret = (debugSecretValues == null) || (debugSecretValues.length < 1)
? null
: debugSecretValues[0];
if ((null != debugSecret) &... | java | private boolean isDebug(CmsObject cms, CmsSolrQuery query) {
String[] debugSecretValues = query.remove(REQUEST_PARAM_DEBUG_SECRET);
String debugSecret = (debugSecretValues == null) || (debugSecretValues.length < 1)
? null
: debugSecretValues[0];
if ((null != debugSecret) &... | [
"private",
"boolean",
"isDebug",
"(",
"CmsObject",
"cms",
",",
"CmsSolrQuery",
"query",
")",
"{",
"String",
"[",
"]",
"debugSecretValues",
"=",
"query",
".",
"remove",
"(",
"REQUEST_PARAM_DEBUG_SECRET",
")",
";",
"String",
"debugSecret",
"=",
"(",
"debugSecretVa... | Checks if the query should be executed using the debug mode where the security restrictions do not apply.
@param cms the current context.
@param query the query to execute.
@return a flag, indicating, if the query should be performed in debug mode. | [
"Checks",
"if",
"the",
"query",
"should",
"be",
"executed",
"using",
"the",
"debug",
"mode",
"where",
"the",
"security",
"restrictions",
"do",
"not",
"apply",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/solr/CmsSolrIndex.java#L1595-L1616 | train |
alkacon/opencms-core | src/org/opencms/search/solr/CmsSolrIndex.java | CmsSolrIndex.throwExceptionIfSafetyRestrictionsAreViolated | private void throwExceptionIfSafetyRestrictionsAreViolated(CmsObject cms, CmsSolrQuery query, boolean isSpell)
throws CmsSearchException {
if (!isDebug(cms, query)) {
if (isSpell) {
if (m_handlerSpellDisabled) {
throw new CmsSearchException(Messages.get... | java | private void throwExceptionIfSafetyRestrictionsAreViolated(CmsObject cms, CmsSolrQuery query, boolean isSpell)
throws CmsSearchException {
if (!isDebug(cms, query)) {
if (isSpell) {
if (m_handlerSpellDisabled) {
throw new CmsSearchException(Messages.get... | [
"private",
"void",
"throwExceptionIfSafetyRestrictionsAreViolated",
"(",
"CmsObject",
"cms",
",",
"CmsSolrQuery",
"query",
",",
"boolean",
"isSpell",
")",
"throws",
"CmsSearchException",
"{",
"if",
"(",
"!",
"isDebug",
"(",
"cms",
",",
"query",
")",
")",
"{",
"i... | Throws an exception if the request can for security reasons not be performed.
Security restrictions can be set via parameters of the index.
@param cms the current context.
@param query the query.
@param isSpell flag, indicating if the spellcheck handler is requested.
@throws CmsSearchException thrown if the query cann... | [
"Throws",
"an",
"exception",
"if",
"the",
"request",
"can",
"for",
"security",
"reasons",
"not",
"be",
"performed",
".",
"Security",
"restrictions",
"can",
"be",
"set",
"via",
"parameters",
"of",
"the",
"index",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/solr/CmsSolrIndex.java#L1627-L1673 | train |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/modules/CmsCloneModuleThread.java | CmsCloneModuleThread.alterPrefix | private String alterPrefix(String word, String oldPrefix, String newPrefix) {
if (word.startsWith(oldPrefix)) {
return word.replaceFirst(oldPrefix, newPrefix);
}
return (newPrefix + word);
} | java | private String alterPrefix(String word, String oldPrefix, String newPrefix) {
if (word.startsWith(oldPrefix)) {
return word.replaceFirst(oldPrefix, newPrefix);
}
return (newPrefix + word);
} | [
"private",
"String",
"alterPrefix",
"(",
"String",
"word",
",",
"String",
"oldPrefix",
",",
"String",
"newPrefix",
")",
"{",
"if",
"(",
"word",
".",
"startsWith",
"(",
"oldPrefix",
")",
")",
"{",
"return",
"word",
".",
"replaceFirst",
"(",
"oldPrefix",
","... | Manipulates a string by cutting of a prefix, if present, and adding a new prefix.
@param word the string to be manipulated
@param oldPrefix the old prefix that should be replaced
@param newPrefix the new prefix that is added
@return the manipulated string | [
"Manipulates",
"a",
"string",
"by",
"cutting",
"of",
"a",
"prefix",
"if",
"present",
"and",
"adding",
"a",
"new",
"prefix",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/modules/CmsCloneModuleThread.java#L477-L483 | train |
alkacon/opencms-core | src-setup/org/opencms/setup/ui/CmsSetupStep02ComponentCheck.java | CmsSetupStep02ComponentCheck.updateColor | public void updateColor(TestColor color) {
switch (color) {
case green:
m_forwardButton.setEnabled(true);
m_confirmCheckbox.setVisible(false);
m_status.setValue(STATUS_GREEN);
break;
case yellow:
m_forwardBu... | java | public void updateColor(TestColor color) {
switch (color) {
case green:
m_forwardButton.setEnabled(true);
m_confirmCheckbox.setVisible(false);
m_status.setValue(STATUS_GREEN);
break;
case yellow:
m_forwardBu... | [
"public",
"void",
"updateColor",
"(",
"TestColor",
"color",
")",
"{",
"switch",
"(",
"color",
")",
"{",
"case",
"green",
":",
"m_forwardButton",
".",
"setEnabled",
"(",
"true",
")",
";",
"m_confirmCheckbox",
".",
"setVisible",
"(",
"false",
")",
";",
"m_st... | Sets test status. | [
"Sets",
"test",
"status",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/ui/CmsSetupStep02ComponentCheck.java#L121-L142 | train |
alkacon/opencms-core | src/org/opencms/relations/CmsCategoryService.java | CmsCategoryService.copyCategories | public void copyCategories(CmsObject cms, CmsResource fromResource, String toResourceSitePath) throws CmsException {
List<CmsCategory> categories = readResourceCategories(cms, fromResource);
for (CmsCategory category : categories) {
addResourceToCategory(cms, toResourceSitePath, category);
... | java | public void copyCategories(CmsObject cms, CmsResource fromResource, String toResourceSitePath) throws CmsException {
List<CmsCategory> categories = readResourceCategories(cms, fromResource);
for (CmsCategory category : categories) {
addResourceToCategory(cms, toResourceSitePath, category);
... | [
"public",
"void",
"copyCategories",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"fromResource",
",",
"String",
"toResourceSitePath",
")",
"throws",
"CmsException",
"{",
"List",
"<",
"CmsCategory",
">",
"categories",
"=",
"readResourceCategories",
"(",
"cms",
",",
... | Adds all categories from one resource to another, skipping categories that are not available for the resource copied to.
The resource where categories are copied to has to be locked.
@param cms the CmsObject used for reading and writing.
@param fromResource the resource to copy the categories from.
@param toResourceS... | [
"Adds",
"all",
"categories",
"from",
"one",
"resource",
"to",
"another",
"skipping",
"categories",
"that",
"are",
"not",
"available",
"for",
"the",
"resource",
"copied",
"to",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsCategoryService.java#L167-L173 | train |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagBundle.java | CmsJspTagBundle.getLocale | static Locale getLocale(PageContext pageContext, String name) {
Locale loc = null;
Object obj = javax.servlet.jsp.jstl.core.Config.find(pageContext, name);
if (obj != null) {
if (obj instanceof Locale) {
loc = (Locale)obj;
} else {
... | java | static Locale getLocale(PageContext pageContext, String name) {
Locale loc = null;
Object obj = javax.servlet.jsp.jstl.core.Config.find(pageContext, name);
if (obj != null) {
if (obj instanceof Locale) {
loc = (Locale)obj;
} else {
... | [
"static",
"Locale",
"getLocale",
"(",
"PageContext",
"pageContext",
",",
"String",
"name",
")",
"{",
"Locale",
"loc",
"=",
"null",
";",
"Object",
"obj",
"=",
"javax",
".",
"servlet",
".",
"jsp",
".",
"jstl",
".",
"core",
".",
"Config",
".",
"find",
"("... | Returns the locale specified by the named scoped attribute or context
configuration parameter.
<p> The named scoped attribute is searched in the page, request,
session (if valid), and application scope(s) (in this order). If no such
attribute exists in any of the scopes, the locale is taken from the
named context conf... | [
"Returns",
"the",
"locale",
"specified",
"by",
"the",
"named",
"scoped",
"attribute",
"or",
"context",
"configuration",
"parameter",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagBundle.java#L135-L149 | train |
alkacon/opencms-core | src/org/opencms/staticexport/CmsDefaultLinkSubstitutionHandler.java | CmsDefaultLinkSubstitutionHandler.generateCacheKey | protected String generateCacheKey(
CmsObject cms,
String targetSiteRoot,
String detailPagePart,
String absoluteLink) {
return cms.getRequestContext().getSiteRoot() + ":" + targetSiteRoot + ":" + detailPagePart + absoluteLink;
} | java | protected String generateCacheKey(
CmsObject cms,
String targetSiteRoot,
String detailPagePart,
String absoluteLink) {
return cms.getRequestContext().getSiteRoot() + ":" + targetSiteRoot + ":" + detailPagePart + absoluteLink;
} | [
"protected",
"String",
"generateCacheKey",
"(",
"CmsObject",
"cms",
",",
"String",
"targetSiteRoot",
",",
"String",
"detailPagePart",
",",
"String",
"absoluteLink",
")",
"{",
"return",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"getSiteRoot",
"(",
")",
"+",... | Generates the cache key for Online links.
@param cms the current CmsObject
@param targetSiteRoot the target site root
@param detailPagePart the detail page part
@param absoluteLink the absolute (site-relative) link to the resource
@return the cache key | [
"Generates",
"the",
"cache",
"key",
"for",
"Online",
"links",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsDefaultLinkSubstitutionHandler.java#L443-L450 | train |
alkacon/opencms-core | src/org/opencms/staticexport/CmsDefaultLinkSubstitutionHandler.java | CmsDefaultLinkSubstitutionHandler.isSecureLink | protected boolean isSecureLink(CmsObject cms, String vfsName, CmsSite targetSite, boolean secureRequest) {
return OpenCms.getStaticExportManager().isSecureLink(cms, vfsName, targetSite.getSiteRoot(), secureRequest);
} | java | protected boolean isSecureLink(CmsObject cms, String vfsName, CmsSite targetSite, boolean secureRequest) {
return OpenCms.getStaticExportManager().isSecureLink(cms, vfsName, targetSite.getSiteRoot(), secureRequest);
} | [
"protected",
"boolean",
"isSecureLink",
"(",
"CmsObject",
"cms",
",",
"String",
"vfsName",
",",
"CmsSite",
"targetSite",
",",
"boolean",
"secureRequest",
")",
"{",
"return",
"OpenCms",
".",
"getStaticExportManager",
"(",
")",
".",
"isSecureLink",
"(",
"cms",
","... | Checks if the link target is a secure link.<p
@param cms the current CMS context
@param vfsName the path of the link target
@param targetSite the target site containing the detail page
@param secureRequest true if the currently running request is secure
@return true if the link should be a secure link | [
"Checks",
"if",
"the",
"link",
"target",
"is",
"a",
"secure",
"link",
".",
"<p"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsDefaultLinkSubstitutionHandler.java#L692-L695 | train |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/colorpicker/CmsColor.java | CmsColor.MIN | private float MIN(float first, float second, float third) {
float min = Integer.MAX_VALUE;
if (first < min) {
min = first;
}
if (second < min) {
min = second;
}
if (third < min) {
min = third;
}
return min;
... | java | private float MIN(float first, float second, float third) {
float min = Integer.MAX_VALUE;
if (first < min) {
min = first;
}
if (second < min) {
min = second;
}
if (third < min) {
min = third;
}
return min;
... | [
"private",
"float",
"MIN",
"(",
"float",
"first",
",",
"float",
"second",
",",
"float",
"third",
")",
"{",
"float",
"min",
"=",
"Integer",
".",
"MAX_VALUE",
";",
"if",
"(",
"first",
"<",
"min",
")",
"{",
"min",
"=",
"first",
";",
"}",
"if",
"(",
... | Calculates the smallest value between the three inputs.
@param first value
@param second value
@param third value
@return the smallest value between the three inputs | [
"Calculates",
"the",
"smallest",
"value",
"between",
"the",
"three",
"inputs",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/colorpicker/CmsColor.java#L281-L294 | train |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/colorpicker/CmsColor.java | CmsColor.setHex | private void setHex() {
String hRed = Integer.toHexString(getRed());
String hGreen = Integer.toHexString(getGreen());
String hBlue = Integer.toHexString(getBlue());
if (hRed.length() == 0) {
hRed = "00";
}
if (hRed.length() == 1) {
hRed... | java | private void setHex() {
String hRed = Integer.toHexString(getRed());
String hGreen = Integer.toHexString(getGreen());
String hBlue = Integer.toHexString(getBlue());
if (hRed.length() == 0) {
hRed = "00";
}
if (hRed.length() == 1) {
hRed... | [
"private",
"void",
"setHex",
"(",
")",
"{",
"String",
"hRed",
"=",
"Integer",
".",
"toHexString",
"(",
"getRed",
"(",
")",
")",
";",
"String",
"hGreen",
"=",
"Integer",
".",
"toHexString",
"(",
"getGreen",
"(",
")",
")",
";",
"String",
"hBlue",
"=",
... | Converts from RGB to Hexadecimal notation. | [
"Converts",
"from",
"RGB",
"to",
"Hexadecimal",
"notation",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/colorpicker/CmsColor.java#L346-L372 | train |
alkacon/opencms-core | src/org/opencms/ade/contenteditor/CmsSerialDateService.java | CmsSerialDateService.formatDate | private String formatDate(Date date) {
if (null == m_dateFormat) {
m_dateFormat = DateFormat.getDateInstance(
0,
OpenCms.getWorkplaceManager().getWorkplaceLocale(getCmsObject()));
}
return m_dateFormat.format(date);
} | java | private String formatDate(Date date) {
if (null == m_dateFormat) {
m_dateFormat = DateFormat.getDateInstance(
0,
OpenCms.getWorkplaceManager().getWorkplaceLocale(getCmsObject()));
}
return m_dateFormat.format(date);
} | [
"private",
"String",
"formatDate",
"(",
"Date",
"date",
")",
"{",
"if",
"(",
"null",
"==",
"m_dateFormat",
")",
"{",
"m_dateFormat",
"=",
"DateFormat",
".",
"getDateInstance",
"(",
"0",
",",
"OpenCms",
".",
"getWorkplaceManager",
"(",
")",
".",
"getWorkplace... | Format the date for the status messages.
@param date the date to format.
@return the formatted date. | [
"Format",
"the",
"date",
"for",
"the",
"status",
"messages",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/contenteditor/CmsSerialDateService.java#L126-L134 | train |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagEdit.java | CmsJspTagEdit.createResource | public static String createResource(
CmsObject cmsObject,
String newLink,
Locale locale,
String sitePath,
String modelFileName,
String mode,
String postCreateHandler) {
String[] newLinkParts = newLink.split("\\|");
String rootPath = newLinkParts[1... | java | public static String createResource(
CmsObject cmsObject,
String newLink,
Locale locale,
String sitePath,
String modelFileName,
String mode,
String postCreateHandler) {
String[] newLinkParts = newLink.split("\\|");
String rootPath = newLinkParts[1... | [
"public",
"static",
"String",
"createResource",
"(",
"CmsObject",
"cmsObject",
",",
"String",
"newLink",
",",
"Locale",
"locale",
",",
"String",
"sitePath",
",",
"String",
"modelFileName",
",",
"String",
"mode",
",",
"String",
"postCreateHandler",
")",
"{",
"Str... | Creates a new resource.
@param cmsObject The CmsObject of the current request context.
@param newLink A string, specifying where which new content should be created.
@param locale The locale for which the
@param sitePath site path of the currently edited content.
@param modelFileName not used.
@param mode optional crea... | [
"Creates",
"a",
"new",
"resource",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagEdit.java#L104-L146 | train |
alkacon/opencms-core | src/org/opencms/i18n/CmsResourceBundleLoader.java | CmsResourceBundleLoader.tryBundle | private static I_CmsResourceBundle tryBundle(String localizedName) {
I_CmsResourceBundle result = null;
try {
String resourceName = localizedName.replace('.', '/') + ".properties";
URL url = CmsResourceBundleLoader.class.getClassLoader().getResource(resourceName);
... | java | private static I_CmsResourceBundle tryBundle(String localizedName) {
I_CmsResourceBundle result = null;
try {
String resourceName = localizedName.replace('.', '/') + ".properties";
URL url = CmsResourceBundleLoader.class.getClassLoader().getResource(resourceName);
... | [
"private",
"static",
"I_CmsResourceBundle",
"tryBundle",
"(",
"String",
"localizedName",
")",
"{",
"I_CmsResourceBundle",
"result",
"=",
"null",
";",
"try",
"{",
"String",
"resourceName",
"=",
"localizedName",
".",
"replace",
"(",
"'",
"'",
",",
"'",
"'",
")",... | Tries to load a property file with the specified name.
@param localizedName the name
@return the resource bundle if it was loaded, otherwise the backup | [
"Tries",
"to",
"load",
"a",
"property",
"file",
"with",
"the",
"specified",
"name",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/i18n/CmsResourceBundleLoader.java#L365-L412 | train |
alkacon/opencms-core | src/org/opencms/i18n/CmsResourceBundleLoader.java | CmsResourceBundleLoader.tryBundle | private static ResourceBundle tryBundle(String baseName, Locale locale, boolean wantBase) {
I_CmsResourceBundle first = null; // The most specialized bundle.
I_CmsResourceBundle last = null; // The least specialized bundle.
List<String> bundleNames = CmsLocaleManager.getLocaleVariants(baseName... | java | private static ResourceBundle tryBundle(String baseName, Locale locale, boolean wantBase) {
I_CmsResourceBundle first = null; // The most specialized bundle.
I_CmsResourceBundle last = null; // The least specialized bundle.
List<String> bundleNames = CmsLocaleManager.getLocaleVariants(baseName... | [
"private",
"static",
"ResourceBundle",
"tryBundle",
"(",
"String",
"baseName",
",",
"Locale",
"locale",
",",
"boolean",
"wantBase",
")",
"{",
"I_CmsResourceBundle",
"first",
"=",
"null",
";",
"// The most specialized bundle.",
"I_CmsResourceBundle",
"last",
"=",
"null... | Tries to load a the bundle for a given locale, also loads the backup
locales with the same language.
@param baseName the raw bundle name, without locale qualifiers
@param locale the locale
@param wantBase whether a resource bundle made only from the base name
(with no locale information attached) should be returned.
@... | [
"Tries",
"to",
"load",
"a",
"the",
"bundle",
"for",
"a",
"given",
"locale",
"also",
"loads",
"the",
"backup",
"locales",
"with",
"the",
"same",
"language",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/i18n/CmsResourceBundleLoader.java#L424-L450 | train |
alkacon/opencms-core | src/org/opencms/widgets/serialdate/CmsSerialDateValue.java | CmsSerialDateValue.validateWithMessage | public CmsMessageContainer validateWithMessage() {
if (m_parsingFailed) {
return Messages.get().container(Messages.ERR_SERIALDATE_INVALID_VALUE_0);
}
if (!isStartSet()) {
return Messages.get().container(Messages.ERR_SERIALDATE_START_MISSING_0);
}
if (!isE... | java | public CmsMessageContainer validateWithMessage() {
if (m_parsingFailed) {
return Messages.get().container(Messages.ERR_SERIALDATE_INVALID_VALUE_0);
}
if (!isStartSet()) {
return Messages.get().container(Messages.ERR_SERIALDATE_START_MISSING_0);
}
if (!isE... | [
"public",
"CmsMessageContainer",
"validateWithMessage",
"(",
")",
"{",
"if",
"(",
"m_parsingFailed",
")",
"{",
"return",
"Messages",
".",
"get",
"(",
")",
".",
"container",
"(",
"Messages",
".",
"ERR_SERIALDATE_INVALID_VALUE_0",
")",
";",
"}",
"if",
"(",
"!",
... | Validates the wrapped value and returns a localized error message in case of invalid values.
@return <code>null</code> if the value is valid, a suitable localized error message otherwise. | [
"Validates",
"the",
"wrapped",
"value",
"and",
"returns",
"a",
"localized",
"error",
"message",
"in",
"case",
"of",
"invalid",
"values",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/serialdate/CmsSerialDateValue.java#L158-L183 | train |
alkacon/opencms-core | src/org/opencms/widgets/serialdate/CmsSerialDateValue.java | CmsSerialDateValue.datesToJson | private JSONArray datesToJson(Collection<Date> individualDates) {
if (null != individualDates) {
JSONArray result = new JSONArray();
for (Date d : individualDates) {
result.put(dateToJson(d));
}
return result;
}
return null;
} | java | private JSONArray datesToJson(Collection<Date> individualDates) {
if (null != individualDates) {
JSONArray result = new JSONArray();
for (Date d : individualDates) {
result.put(dateToJson(d));
}
return result;
}
return null;
} | [
"private",
"JSONArray",
"datesToJson",
"(",
"Collection",
"<",
"Date",
">",
"individualDates",
")",
"{",
"if",
"(",
"null",
"!=",
"individualDates",
")",
"{",
"JSONArray",
"result",
"=",
"new",
"JSONArray",
"(",
")",
";",
"for",
"(",
"Date",
"d",
":",
"i... | Converts a list of dates to a Json array with the long representation of the dates as strings.
@param individualDates the list to convert.
@return Json array with long values of dates as string | [
"Converts",
"a",
"list",
"of",
"dates",
"to",
"a",
"Json",
"array",
"with",
"the",
"long",
"representation",
"of",
"the",
"dates",
"as",
"strings",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/serialdate/CmsSerialDateValue.java#L190-L200 | train |
alkacon/opencms-core | src/org/opencms/widgets/serialdate/CmsSerialDateValue.java | CmsSerialDateValue.readOptionalArray | private JSONArray readOptionalArray(JSONObject json, String key) {
try {
return json.getJSONArray(key);
} catch (JSONException e) {
LOG.debug("Reading optional JSON array failed. Default to provided default value.", e);
}
return null;
} | java | private JSONArray readOptionalArray(JSONObject json, String key) {
try {
return json.getJSONArray(key);
} catch (JSONException e) {
LOG.debug("Reading optional JSON array failed. Default to provided default value.", e);
}
return null;
} | [
"private",
"JSONArray",
"readOptionalArray",
"(",
"JSONObject",
"json",
",",
"String",
"key",
")",
"{",
"try",
"{",
"return",
"json",
".",
"getJSONArray",
"(",
"key",
")",
";",
"}",
"catch",
"(",
"JSONException",
"e",
")",
"{",
"LOG",
".",
"debug",
"(",
... | Read an optional JSON array.
@param json the JSON Object that has the array as element
@param key the key for the array in the provided JSON object
@return the array or null if reading the array fails. | [
"Read",
"an",
"optional",
"JSON",
"array",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/serialdate/CmsSerialDateValue.java#L301-L309 | train |
alkacon/opencms-core | src/org/opencms/widgets/serialdate/CmsSerialDateValue.java | CmsSerialDateValue.readOptionalBoolean | private Boolean readOptionalBoolean(JSONObject json, String key) {
try {
return Boolean.valueOf(json.getBoolean(key));
} catch (JSONException e) {
LOG.debug("Reading optional JSON boolean failed. Default to provided default value.", e);
}
return null;
} | java | private Boolean readOptionalBoolean(JSONObject json, String key) {
try {
return Boolean.valueOf(json.getBoolean(key));
} catch (JSONException e) {
LOG.debug("Reading optional JSON boolean failed. Default to provided default value.", e);
}
return null;
} | [
"private",
"Boolean",
"readOptionalBoolean",
"(",
"JSONObject",
"json",
",",
"String",
"key",
")",
"{",
"try",
"{",
"return",
"Boolean",
".",
"valueOf",
"(",
"json",
".",
"getBoolean",
"(",
"key",
")",
")",
";",
"}",
"catch",
"(",
"JSONException",
"e",
"... | Read an optional boolean value form a JSON Object.
@param json the JSON object to read from.
@param key the key for the boolean value in the provided JSON object.
@return the boolean or null if reading the boolean fails. | [
"Read",
"an",
"optional",
"boolean",
"value",
"form",
"a",
"JSON",
"Object",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/serialdate/CmsSerialDateValue.java#L317-L325 | train |
alkacon/opencms-core | src/org/opencms/widgets/serialdate/CmsSerialDateValue.java | CmsSerialDateValue.readOptionalString | private String readOptionalString(JSONObject json, String key, String defaultValue) {
try {
String str = json.getString(key);
if (str != null) {
return str;
}
} catch (JSONException e) {
LOG.debug("Reading optional JSON string failed. Def... | java | private String readOptionalString(JSONObject json, String key, String defaultValue) {
try {
String str = json.getString(key);
if (str != null) {
return str;
}
} catch (JSONException e) {
LOG.debug("Reading optional JSON string failed. Def... | [
"private",
"String",
"readOptionalString",
"(",
"JSONObject",
"json",
",",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"try",
"{",
"String",
"str",
"=",
"json",
".",
"getString",
"(",
"key",
")",
";",
"if",
"(",
"str",
"!=",
"null",
")",
... | Read an optional string value form a JSON Object.
@param json the JSON object to read from.
@param key the key for the string value in the provided JSON object.
@param defaultValue the default value, to be returned if the string can not be read from the JSON object.
@return the string or the default value if reading th... | [
"Read",
"an",
"optional",
"string",
"value",
"form",
"a",
"JSON",
"Object",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/serialdate/CmsSerialDateValue.java#L385-L397 | train |
alkacon/opencms-core | src/org/opencms/widgets/serialdate/CmsSerialDateValue.java | CmsSerialDateValue.readPattern | private void readPattern(JSONObject patternJson) {
setPatternType(readPatternType(patternJson));
setInterval(readOptionalInt(patternJson, JsonKey.PATTERN_INTERVAL));
setWeekDays(readWeekDays(patternJson));
setDayOfMonth(readOptionalInt(patternJson, JsonKey.PATTERN_DAY_OF_MONTH));
... | java | private void readPattern(JSONObject patternJson) {
setPatternType(readPatternType(patternJson));
setInterval(readOptionalInt(patternJson, JsonKey.PATTERN_INTERVAL));
setWeekDays(readWeekDays(patternJson));
setDayOfMonth(readOptionalInt(patternJson, JsonKey.PATTERN_DAY_OF_MONTH));
... | [
"private",
"void",
"readPattern",
"(",
"JSONObject",
"patternJson",
")",
"{",
"setPatternType",
"(",
"readPatternType",
"(",
"patternJson",
")",
")",
";",
"setInterval",
"(",
"readOptionalInt",
"(",
"patternJson",
",",
"JsonKey",
".",
"PATTERN_INTERVAL",
")",
")",... | Read pattern information from the provided JSON object.
@param patternJson the JSON object containing the pattern information. | [
"Read",
"pattern",
"information",
"from",
"the",
"provided",
"JSON",
"object",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/serialdate/CmsSerialDateValue.java#L423-L434 | train |
alkacon/opencms-core | src/org/opencms/widgets/serialdate/CmsSerialDateValue.java | CmsSerialDateValue.toJsonStringArray | private JSONArray toJsonStringArray(Collection<? extends Object> collection) {
if (null != collection) {
JSONArray array = new JSONArray();
for (Object o : collection) {
array.put("" + o);
}
return array;
} else {
return null;
... | java | private JSONArray toJsonStringArray(Collection<? extends Object> collection) {
if (null != collection) {
JSONArray array = new JSONArray();
for (Object o : collection) {
array.put("" + o);
}
return array;
} else {
return null;
... | [
"private",
"JSONArray",
"toJsonStringArray",
"(",
"Collection",
"<",
"?",
"extends",
"Object",
">",
"collection",
")",
"{",
"if",
"(",
"null",
"!=",
"collection",
")",
"{",
"JSONArray",
"array",
"=",
"new",
"JSONArray",
"(",
")",
";",
"for",
"(",
"Object",... | Convert a collection of objects to a JSON array with the string representations of that objects.
@param collection the collection of objects.
@return the JSON array with the string representations. | [
"Convert",
"a",
"collection",
"of",
"objects",
"to",
"a",
"JSON",
"array",
"with",
"the",
"string",
"representations",
"of",
"that",
"objects",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/serialdate/CmsSerialDateValue.java#L513-L524 | train |
alkacon/opencms-core | src/org/opencms/widgets/serialdate/CmsSerialDateValue.java | CmsSerialDateValue.validateDuration | private String validateDuration() {
if (!isValidEndTypeForPattern()) {
return Messages.ERR_SERIALDATE_INVALID_END_TYPE_FOR_PATTERN_0;
}
switch (getEndType()) {
case DATE:
return (getStart().getTime() < (getSeriesEndDate().getTime() + DAY_IN_MILLIS))
... | java | private String validateDuration() {
if (!isValidEndTypeForPattern()) {
return Messages.ERR_SERIALDATE_INVALID_END_TYPE_FOR_PATTERN_0;
}
switch (getEndType()) {
case DATE:
return (getStart().getTime() < (getSeriesEndDate().getTime() + DAY_IN_MILLIS))
... | [
"private",
"String",
"validateDuration",
"(",
")",
"{",
"if",
"(",
"!",
"isValidEndTypeForPattern",
"(",
")",
")",
"{",
"return",
"Messages",
".",
"ERR_SERIALDATE_INVALID_END_TYPE_FOR_PATTERN_0",
";",
"}",
"switch",
"(",
"getEndType",
"(",
")",
")",
"{",
"case",... | Checks if the provided duration information is valid.
@return <code>null</code> if the information is valid, the key of the suitable error message otherwise. | [
"Checks",
"if",
"the",
"provided",
"duration",
"information",
"is",
"valid",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/serialdate/CmsSerialDateValue.java#L539-L555 | train |
alkacon/opencms-core | src/org/opencms/widgets/serialdate/CmsSerialDateValue.java | CmsSerialDateValue.validatePattern | private String validatePattern() {
String error = null;
switch (getPatternType()) {
case DAILY:
error = isEveryWorkingDay() ? null : validateInterval();
break;
case WEEKLY:
error = validateInterval();
if (null == er... | java | private String validatePattern() {
String error = null;
switch (getPatternType()) {
case DAILY:
error = isEveryWorkingDay() ? null : validateInterval();
break;
case WEEKLY:
error = validateInterval();
if (null == er... | [
"private",
"String",
"validatePattern",
"(",
")",
"{",
"String",
"error",
"=",
"null",
";",
"switch",
"(",
"getPatternType",
"(",
")",
")",
"{",
"case",
"DAILY",
":",
"error",
"=",
"isEveryWorkingDay",
"(",
")",
"?",
"null",
":",
"validateInterval",
"(",
... | Check, if all values used for calculating the series for a specific pattern are valid.
@return <code>null</code> if the pattern is valid, a suitable error message otherwise. | [
"Check",
"if",
"all",
"values",
"used",
"for",
"calculating",
"the",
"series",
"for",
"a",
"specific",
"pattern",
"are",
"valid",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/serialdate/CmsSerialDateValue.java#L579-L609 | train |
alkacon/opencms-core | src/org/opencms/db/CmsDbPoolV11.java | CmsDbPoolV11.createHikariConfig | public static HikariConfig createHikariConfig(CmsParameterConfiguration config, String key) {
Map<String, String> poolMap = Maps.newHashMap();
for (Map.Entry<String, String> entry : config.entrySet()) {
String suffix = getPropertyRelativeSuffix(KEY_DATABASE_POOL + "." + key, entry.getKey())... | java | public static HikariConfig createHikariConfig(CmsParameterConfiguration config, String key) {
Map<String, String> poolMap = Maps.newHashMap();
for (Map.Entry<String, String> entry : config.entrySet()) {
String suffix = getPropertyRelativeSuffix(KEY_DATABASE_POOL + "." + key, entry.getKey())... | [
"public",
"static",
"HikariConfig",
"createHikariConfig",
"(",
"CmsParameterConfiguration",
"config",
",",
"String",
"key",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"poolMap",
"=",
"Maps",
".",
"newHashMap",
"(",
")",
";",
"for",
"(",
"Map",
".",
... | Creates the HikariCP configuration based on the configuration of a pool defined in opencms.properties.
@param config the configuration object with the properties
@param key the pool name (without the opencms prefix)
@return the HikariCP configuration for the pool | [
"Creates",
"the",
"HikariCP",
"configuration",
"based",
"on",
"the",
"configuration",
"of",
"a",
"pool",
"defined",
"in",
"opencms",
".",
"properties",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDbPoolV11.java#L183-L245 | train |
alkacon/opencms-core | src/org/opencms/ugc/CmsUgcSession.java | CmsUgcSession.unmarshalXmlContent | private CmsXmlContent unmarshalXmlContent(CmsFile file) throws CmsXmlException {
CmsXmlContent content = CmsXmlContentFactory.unmarshal(m_cms, file);
content.setAutoCorrectionEnabled(true);
content.correctXmlStructure(m_cms);
return content;
} | java | private CmsXmlContent unmarshalXmlContent(CmsFile file) throws CmsXmlException {
CmsXmlContent content = CmsXmlContentFactory.unmarshal(m_cms, file);
content.setAutoCorrectionEnabled(true);
content.correctXmlStructure(m_cms);
return content;
} | [
"private",
"CmsXmlContent",
"unmarshalXmlContent",
"(",
"CmsFile",
"file",
")",
"throws",
"CmsXmlException",
"{",
"CmsXmlContent",
"content",
"=",
"CmsXmlContentFactory",
".",
"unmarshal",
"(",
"m_cms",
",",
"file",
")",
";",
"content",
".",
"setAutoCorrectionEnabled"... | Unmarshal the XML content with auto-correction.
@param file the file that contains the XML
@return the XML read from the file
@throws CmsXmlException thrown if the XML can't be read. | [
"Unmarshal",
"the",
"XML",
"content",
"with",
"auto",
"-",
"correction",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ugc/CmsUgcSession.java#L828-L835 | train |
alkacon/opencms-core | src/org/opencms/importexport/A_CmsImport.java | A_CmsImport.getImportAccessControlEntry | protected CmsAccessControlEntry getImportAccessControlEntry(
CmsResource res,
String id,
String allowed,
String denied,
String flags) {
return new CmsAccessControlEntry(
res.getResourceId(),
new CmsUUID(id),
Integer.parseInt(allowed),
... | java | protected CmsAccessControlEntry getImportAccessControlEntry(
CmsResource res,
String id,
String allowed,
String denied,
String flags) {
return new CmsAccessControlEntry(
res.getResourceId(),
new CmsUUID(id),
Integer.parseInt(allowed),
... | [
"protected",
"CmsAccessControlEntry",
"getImportAccessControlEntry",
"(",
"CmsResource",
"res",
",",
"String",
"id",
",",
"String",
"allowed",
",",
"String",
"denied",
",",
"String",
"flags",
")",
"{",
"return",
"new",
"CmsAccessControlEntry",
"(",
"res",
".",
"ge... | Creates a new access control entry and stores it for later write out.
@param res the resource
@param id the id of the principal
@param allowed the allowed permissions
@param denied the denied permissions
@param flags the flags
@return the created ACE | [
"Creates",
"a",
"new",
"access",
"control",
"entry",
"and",
"stores",
"it",
"for",
"later",
"write",
"out",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/A_CmsImport.java#L606-L619 | train |
alkacon/opencms-core | src/org/opencms/workplace/Messages.java | Messages.getStateKey | public static String getStateKey(CmsResourceState state) {
StringBuffer sb = new StringBuffer(STATE_PREFIX);
sb.append(state);
sb.append(STATE_POSTFIX);
return sb.toString();
} | java | public static String getStateKey(CmsResourceState state) {
StringBuffer sb = new StringBuffer(STATE_PREFIX);
sb.append(state);
sb.append(STATE_POSTFIX);
return sb.toString();
} | [
"public",
"static",
"String",
"getStateKey",
"(",
"CmsResourceState",
"state",
")",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
"STATE_PREFIX",
")",
";",
"sb",
".",
"append",
"(",
"state",
")",
";",
"sb",
".",
"append",
"(",
"STATE_POSTFIX",
... | Create constant name.
@param state STATE_UNCHANGED, STATE_CHANGED, STATE_NEW or STATE_DELETED.
@return cconstanname as String | [
"Create",
"constant",
"name",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/Messages.java#L520-L527 | train |
alkacon/opencms-core | src/org/opencms/ui/components/CmsAppViewLayout.java | CmsAppViewLayout.createPublishButton | public static Button createPublishButton(final I_CmsUpdateListener<String> updateListener) {
Button publishButton = CmsToolBar.createButton(
FontOpenCms.PUBLISH,
CmsVaadinUtils.getMessageText(Messages.GUI_PUBLISH_BUTTON_TITLE_0));
if (CmsAppWorkplaceUi.isOnlineProject()) {
... | java | public static Button createPublishButton(final I_CmsUpdateListener<String> updateListener) {
Button publishButton = CmsToolBar.createButton(
FontOpenCms.PUBLISH,
CmsVaadinUtils.getMessageText(Messages.GUI_PUBLISH_BUTTON_TITLE_0));
if (CmsAppWorkplaceUi.isOnlineProject()) {
... | [
"public",
"static",
"Button",
"createPublishButton",
"(",
"final",
"I_CmsUpdateListener",
"<",
"String",
">",
"updateListener",
")",
"{",
"Button",
"publishButton",
"=",
"CmsToolBar",
".",
"createButton",
"(",
"FontOpenCms",
".",
"PUBLISH",
",",
"CmsVaadinUtils",
".... | Creates the publish button.
@param updateListener the update listener
@return the publish button | [
"Creates",
"the",
"publish",
"button",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsAppViewLayout.java#L96-L119 | train |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java | CmsMessageBundleEditor.getFilters | Map<Object, Object> getFilters() {
Map<Object, Object> result = new HashMap<Object, Object>(4);
result.put(TableProperty.KEY, m_table.getFilterFieldValue(TableProperty.KEY));
result.put(TableProperty.DEFAULT, m_table.getFilterFieldValue(TableProperty.DEFAULT));
result.put(TableProperty.... | java | Map<Object, Object> getFilters() {
Map<Object, Object> result = new HashMap<Object, Object>(4);
result.put(TableProperty.KEY, m_table.getFilterFieldValue(TableProperty.KEY));
result.put(TableProperty.DEFAULT, m_table.getFilterFieldValue(TableProperty.DEFAULT));
result.put(TableProperty.... | [
"Map",
"<",
"Object",
",",
"Object",
">",
"getFilters",
"(",
")",
"{",
"Map",
"<",
"Object",
",",
"Object",
">",
"result",
"=",
"new",
"HashMap",
"<",
"Object",
",",
"Object",
">",
"(",
"4",
")",
";",
"result",
".",
"put",
"(",
"TableProperty",
"."... | Returns the currently set filters in a map column -> filter.
@return the currently set filters in a map column -> filter. | [
"Returns",
"the",
"currently",
"set",
"filters",
"in",
"a",
"map",
"column",
"-",
">",
"filter",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java#L492-L500 | train |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java | CmsMessageBundleEditor.saveAction | void saveAction() {
Map<Object, Object> filters = getFilters();
m_table.clearFilters();
try {
m_model.save();
disableSaveButtons();
} catch (CmsException e) {
LOG.error(m_messages.key(Messages.ERR_SAVING_CHANGES_0), e);
CmsErrorDialog.s... | java | void saveAction() {
Map<Object, Object> filters = getFilters();
m_table.clearFilters();
try {
m_model.save();
disableSaveButtons();
} catch (CmsException e) {
LOG.error(m_messages.key(Messages.ERR_SAVING_CHANGES_0), e);
CmsErrorDialog.s... | [
"void",
"saveAction",
"(",
")",
"{",
"Map",
"<",
"Object",
",",
"Object",
">",
"filters",
"=",
"getFilters",
"(",
")",
";",
"m_table",
".",
"clearFilters",
"(",
")",
";",
"try",
"{",
"m_model",
".",
"save",
"(",
")",
";",
"disableSaveButtons",
"(",
"... | Save the changes. | [
"Save",
"the",
"changes",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java#L518-L535 | train |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java | CmsMessageBundleEditor.setFilters | void setFilters(Map<Object, Object> filters) {
for (Object column : filters.keySet()) {
Object filterValue = filters.get(column);
if ((filterValue != null) && !filterValue.toString().isEmpty() && !m_table.isColumnCollapsed(column)) {
m_table.setFilterFieldValue(column, f... | java | void setFilters(Map<Object, Object> filters) {
for (Object column : filters.keySet()) {
Object filterValue = filters.get(column);
if ((filterValue != null) && !filterValue.toString().isEmpty() && !m_table.isColumnCollapsed(column)) {
m_table.setFilterFieldValue(column, f... | [
"void",
"setFilters",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"filters",
")",
"{",
"for",
"(",
"Object",
"column",
":",
"filters",
".",
"keySet",
"(",
")",
")",
"{",
"Object",
"filterValue",
"=",
"filters",
".",
"get",
"(",
"column",
")",
";",... | Sets the provided filters.
@param filters a map "column id -> filter". | [
"Sets",
"the",
"provided",
"filters",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java#L571-L579 | train |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java | CmsMessageBundleEditor.adjustOptionsColumn | private void adjustOptionsColumn(
CmsMessageBundleEditorTypes.EditMode oldMode,
CmsMessageBundleEditorTypes.EditMode newMode) {
if (m_model.isShowOptionsColumn(oldMode) != m_model.isShowOptionsColumn(newMode)) {
m_table.removeGeneratedColumn(TableProperty.OPTIONS);
if (m... | java | private void adjustOptionsColumn(
CmsMessageBundleEditorTypes.EditMode oldMode,
CmsMessageBundleEditorTypes.EditMode newMode) {
if (m_model.isShowOptionsColumn(oldMode) != m_model.isShowOptionsColumn(newMode)) {
m_table.removeGeneratedColumn(TableProperty.OPTIONS);
if (m... | [
"private",
"void",
"adjustOptionsColumn",
"(",
"CmsMessageBundleEditorTypes",
".",
"EditMode",
"oldMode",
",",
"CmsMessageBundleEditorTypes",
".",
"EditMode",
"newMode",
")",
"{",
"if",
"(",
"m_model",
".",
"isShowOptionsColumn",
"(",
"oldMode",
")",
"!=",
"m_model",
... | Show or hide the options column dependent on the provided edit mode.
@param oldMode the old edit mode
@param newMode the edit mode for which the options column's visibility should be adjusted. | [
"Show",
"or",
"hide",
"the",
"options",
"column",
"dependent",
"on",
"the",
"provided",
"edit",
"mode",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java#L596-L610 | train |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java | CmsMessageBundleEditor.adjustVisibleColumns | private void adjustVisibleColumns() {
if (m_table.isColumnCollapsingAllowed()) {
if ((m_model.hasDefaultValues()) || m_model.getBundleType().equals(BundleType.DESCRIPTOR)) {
m_table.setColumnCollapsed(TableProperty.DEFAULT, false);
} else {
m_table.setCol... | java | private void adjustVisibleColumns() {
if (m_table.isColumnCollapsingAllowed()) {
if ((m_model.hasDefaultValues()) || m_model.getBundleType().equals(BundleType.DESCRIPTOR)) {
m_table.setColumnCollapsed(TableProperty.DEFAULT, false);
} else {
m_table.setCol... | [
"private",
"void",
"adjustVisibleColumns",
"(",
")",
"{",
"if",
"(",
"m_table",
".",
"isColumnCollapsingAllowed",
"(",
")",
")",
"{",
"if",
"(",
"(",
"m_model",
".",
"hasDefaultValues",
"(",
")",
")",
"||",
"m_model",
".",
"getBundleType",
"(",
")",
".",
... | Adjust the visible columns. | [
"Adjust",
"the",
"visible",
"columns",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java#L615-L631 | train |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java | CmsMessageBundleEditor.cleanUpAction | private void cleanUpAction() {
try {
m_model.deleteDescriptorIfNecessary();
} catch (CmsException e) {
LOG.error(m_messages.key(Messages.ERR_DELETING_DESCRIPTOR_0), e);
}
// unlock resource
m_model.unlock();
} | java | private void cleanUpAction() {
try {
m_model.deleteDescriptorIfNecessary();
} catch (CmsException e) {
LOG.error(m_messages.key(Messages.ERR_DELETING_DESCRIPTOR_0), e);
}
// unlock resource
m_model.unlock();
} | [
"private",
"void",
"cleanUpAction",
"(",
")",
"{",
"try",
"{",
"m_model",
".",
"deleteDescriptorIfNecessary",
"(",
")",
";",
"}",
"catch",
"(",
"CmsException",
"e",
")",
"{",
"LOG",
".",
"error",
"(",
"m_messages",
".",
"key",
"(",
"Messages",
".",
"ERR_... | Unlock all edited resources. | [
"Unlock",
"all",
"edited",
"resources",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java#L636-L645 | train |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java | CmsMessageBundleEditor.createAddDescriptorButton | @SuppressWarnings("serial")
private Component createAddDescriptorButton() {
Button addDescriptorButton = CmsToolBar.createButton(
FontOpenCms.COPY_LOCALE,
m_messages.key(Messages.GUI_ADD_DESCRIPTOR_0));
addDescriptorButton.setDisableOnClick(true);
addDescriptorButt... | java | @SuppressWarnings("serial")
private Component createAddDescriptorButton() {
Button addDescriptorButton = CmsToolBar.createButton(
FontOpenCms.COPY_LOCALE,
m_messages.key(Messages.GUI_ADD_DESCRIPTOR_0));
addDescriptorButton.setDisableOnClick(true);
addDescriptorButt... | [
"@",
"SuppressWarnings",
"(",
"\"serial\"",
")",
"private",
"Component",
"createAddDescriptorButton",
"(",
")",
"{",
"Button",
"addDescriptorButton",
"=",
"CmsToolBar",
".",
"createButton",
"(",
"FontOpenCms",
".",
"COPY_LOCALE",
",",
"m_messages",
".",
"key",
"(",
... | Returns a button component. On click, it triggers adding a bundle descriptor.
@return a button for adding a descriptor to a bundle. | [
"Returns",
"a",
"button",
"component",
".",
"On",
"click",
"it",
"triggers",
"adding",
"a",
"bundle",
"descriptor",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java#L651-L693 | train |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java | CmsMessageBundleEditor.createCloseButton | @SuppressWarnings("serial")
private Component createCloseButton() {
Button closeBtn = CmsToolBar.createButton(
FontOpenCms.CIRCLE_INV_CANCEL,
m_messages.key(Messages.GUI_BUTTON_CANCEL_0));
closeBtn.addClickListener(new ClickListener() {
public void buttonClick(C... | java | @SuppressWarnings("serial")
private Component createCloseButton() {
Button closeBtn = CmsToolBar.createButton(
FontOpenCms.CIRCLE_INV_CANCEL,
m_messages.key(Messages.GUI_BUTTON_CANCEL_0));
closeBtn.addClickListener(new ClickListener() {
public void buttonClick(C... | [
"@",
"SuppressWarnings",
"(",
"\"serial\"",
")",
"private",
"Component",
"createCloseButton",
"(",
")",
"{",
"Button",
"closeBtn",
"=",
"CmsToolBar",
".",
"createButton",
"(",
"FontOpenCms",
".",
"CIRCLE_INV_CANCEL",
",",
"m_messages",
".",
"key",
"(",
"Messages",... | Create the close button UI Component.
@return the close button. | [
"Create",
"the",
"close",
"button",
"UI",
"Component",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java#L699-L714 | train |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java | CmsMessageBundleEditor.createConvertToPropertyBundleButton | private Component createConvertToPropertyBundleButton() {
Button addDescriptorButton = CmsToolBar.createButton(
FontOpenCms.SETTINGS,
m_messages.key(Messages.GUI_CONVERT_TO_PROPERTY_BUNDLE_0));
addDescriptorButton.setDisableOnClick(true);
addDescriptorButton.addClickLi... | java | private Component createConvertToPropertyBundleButton() {
Button addDescriptorButton = CmsToolBar.createButton(
FontOpenCms.SETTINGS,
m_messages.key(Messages.GUI_CONVERT_TO_PROPERTY_BUNDLE_0));
addDescriptorButton.setDisableOnClick(true);
addDescriptorButton.addClickLi... | [
"private",
"Component",
"createConvertToPropertyBundleButton",
"(",
")",
"{",
"Button",
"addDescriptorButton",
"=",
"CmsToolBar",
".",
"createButton",
"(",
"FontOpenCms",
".",
"SETTINGS",
",",
"m_messages",
".",
"key",
"(",
"Messages",
".",
"GUI_CONVERT_TO_PROPERTY_BUND... | Creates the button for converting an XML bundle in a property bundle.
@return the created button. | [
"Creates",
"the",
"button",
"for",
"converting",
"an",
"XML",
"bundle",
"in",
"a",
"property",
"bundle",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java#L720-L744 | train |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java | CmsMessageBundleEditor.createMainComponent | private Component createMainComponent() throws IOException, CmsException {
VerticalLayout mainComponent = new VerticalLayout();
mainComponent.setSizeFull();
mainComponent.addStyleName("o-message-bundle-editor");
m_table = createTable();
Panel navigator = new Panel();
nav... | java | private Component createMainComponent() throws IOException, CmsException {
VerticalLayout mainComponent = new VerticalLayout();
mainComponent.setSizeFull();
mainComponent.addStyleName("o-message-bundle-editor");
m_table = createTable();
Panel navigator = new Panel();
nav... | [
"private",
"Component",
"createMainComponent",
"(",
")",
"throws",
"IOException",
",",
"CmsException",
"{",
"VerticalLayout",
"mainComponent",
"=",
"new",
"VerticalLayout",
"(",
")",
";",
"mainComponent",
".",
"setSizeFull",
"(",
")",
";",
"mainComponent",
".",
"a... | Creates the main component of the editor with all sub-components.
@return the completely filled main component of the editor.
@throws IOException thrown if setting the table's content data source fails.
@throws CmsException thrown if setting the table's content data source fails. | [
"Creates",
"the",
"main",
"component",
"of",
"the",
"editor",
"with",
"all",
"sub",
"-",
"components",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java#L752-L769 | train |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java | CmsMessageBundleEditor.createSaveExitButton | @SuppressWarnings("serial")
private Button createSaveExitButton() {
Button saveExitBtn = CmsToolBar.createButton(
FontOpenCms.SAVE_EXIT,
m_messages.key(Messages.GUI_BUTTON_SAVE_AND_EXIT_0));
saveExitBtn.addClickListener(new ClickListener() {
public void buttonCl... | java | @SuppressWarnings("serial")
private Button createSaveExitButton() {
Button saveExitBtn = CmsToolBar.createButton(
FontOpenCms.SAVE_EXIT,
m_messages.key(Messages.GUI_BUTTON_SAVE_AND_EXIT_0));
saveExitBtn.addClickListener(new ClickListener() {
public void buttonCl... | [
"@",
"SuppressWarnings",
"(",
"\"serial\"",
")",
"private",
"Button",
"createSaveExitButton",
"(",
")",
"{",
"Button",
"saveExitBtn",
"=",
"CmsToolBar",
".",
"createButton",
"(",
"FontOpenCms",
".",
"SAVE_EXIT",
",",
"m_messages",
".",
"key",
"(",
"Messages",
".... | Creates the save and exit button UI Component.
@return the save and exit button. | [
"Creates",
"the",
"save",
"and",
"exit",
"button",
"UI",
"Component",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java#L811-L828 | train |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java | CmsMessageBundleEditor.fillToolBar | private void fillToolBar(final I_CmsAppUIContext context) {
context.setAppTitle(m_messages.key(Messages.GUI_APP_TITLE_0));
// create components
Component publishBtn = createPublishButton();
m_saveBtn = createSaveButton();
m_saveExitBtn = createSaveExitButton();
Componen... | java | private void fillToolBar(final I_CmsAppUIContext context) {
context.setAppTitle(m_messages.key(Messages.GUI_APP_TITLE_0));
// create components
Component publishBtn = createPublishButton();
m_saveBtn = createSaveButton();
m_saveExitBtn = createSaveExitButton();
Componen... | [
"private",
"void",
"fillToolBar",
"(",
"final",
"I_CmsAppUIContext",
"context",
")",
"{",
"context",
".",
"setAppTitle",
"(",
"m_messages",
".",
"key",
"(",
"Messages",
".",
"GUI_APP_TITLE_0",
")",
")",
";",
"// create components",
"Component",
"publishBtn",
"=",
... | Adds Editor specific UI components to the toolbar.
@param context The context that provides access to the toolbar. | [
"Adds",
"Editor",
"specific",
"UI",
"components",
"to",
"the",
"toolbar",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java#L925-L950 | train |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java | CmsMessageBundleEditor.handleChange | private void handleChange(Object propertyId) {
if (!m_saveBtn.isEnabled()) {
m_saveBtn.setEnabled(true);
m_saveExitBtn.setEnabled(true);
}
m_model.handleChange(propertyId);
} | java | private void handleChange(Object propertyId) {
if (!m_saveBtn.isEnabled()) {
m_saveBtn.setEnabled(true);
m_saveExitBtn.setEnabled(true);
}
m_model.handleChange(propertyId);
} | [
"private",
"void",
"handleChange",
"(",
"Object",
"propertyId",
")",
"{",
"if",
"(",
"!",
"m_saveBtn",
".",
"isEnabled",
"(",
")",
")",
"{",
"m_saveBtn",
".",
"setEnabled",
"(",
"true",
")",
";",
"m_saveExitBtn",
".",
"setEnabled",
"(",
"true",
")",
";",... | Handle a value change.
@param propertyId the column in which the value has changed. | [
"Handle",
"a",
"value",
"change",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java#L965-L973 | train |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java | CmsMessageBundleEditor.initFieldFactories | private void initFieldFactories() {
if (m_model.hasMasterMode()) {
TranslateTableFieldFactory masterFieldFactory = new CmsMessageBundleEditorTypes.TranslateTableFieldFactory(
m_table,
m_model.getEditableColumns(CmsMessageBundleEditorTypes.EditMode.MASTER));
... | java | private void initFieldFactories() {
if (m_model.hasMasterMode()) {
TranslateTableFieldFactory masterFieldFactory = new CmsMessageBundleEditorTypes.TranslateTableFieldFactory(
m_table,
m_model.getEditableColumns(CmsMessageBundleEditorTypes.EditMode.MASTER));
... | [
"private",
"void",
"initFieldFactories",
"(",
")",
"{",
"if",
"(",
"m_model",
".",
"hasMasterMode",
"(",
")",
")",
"{",
"TranslateTableFieldFactory",
"masterFieldFactory",
"=",
"new",
"CmsMessageBundleEditorTypes",
".",
"TranslateTableFieldFactory",
"(",
"m_table",
",... | Initialize the field factories for the messages table. | [
"Initialize",
"the",
"field",
"factories",
"for",
"the",
"messages",
"table",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java#L978-L993 | train |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java | CmsMessageBundleEditor.initStyleGenerators | private void initStyleGenerators() {
if (m_model.hasMasterMode()) {
m_styleGenerators.put(
CmsMessageBundleEditorTypes.EditMode.MASTER,
new CmsMessageBundleEditorTypes.TranslateTableCellStyleGenerator(
m_model.getEditableColumns(CmsMessageBundleEd... | java | private void initStyleGenerators() {
if (m_model.hasMasterMode()) {
m_styleGenerators.put(
CmsMessageBundleEditorTypes.EditMode.MASTER,
new CmsMessageBundleEditorTypes.TranslateTableCellStyleGenerator(
m_model.getEditableColumns(CmsMessageBundleEd... | [
"private",
"void",
"initStyleGenerators",
"(",
")",
"{",
"if",
"(",
"m_model",
".",
"hasMasterMode",
"(",
")",
")",
"{",
"m_styleGenerators",
".",
"put",
"(",
"CmsMessageBundleEditorTypes",
".",
"EditMode",
".",
"MASTER",
",",
"new",
"CmsMessageBundleEditorTypes",... | Initialize the style generators for the messages table. | [
"Initialize",
"the",
"style",
"generators",
"for",
"the",
"messages",
"table",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java#L998-L1011 | train |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java | CmsMessageBundleEditor.keyAlreadyExists | private boolean keyAlreadyExists(String newKey) {
Collection<?> itemIds = m_table.getItemIds();
for (Object itemId : itemIds) {
if (m_table.getItem(itemId).getItemProperty(TableProperty.KEY).getValue().equals(newKey)) {
return true;
}
}
return fal... | java | private boolean keyAlreadyExists(String newKey) {
Collection<?> itemIds = m_table.getItemIds();
for (Object itemId : itemIds) {
if (m_table.getItem(itemId).getItemProperty(TableProperty.KEY).getValue().equals(newKey)) {
return true;
}
}
return fal... | [
"private",
"boolean",
"keyAlreadyExists",
"(",
"String",
"newKey",
")",
"{",
"Collection",
"<",
"?",
">",
"itemIds",
"=",
"m_table",
".",
"getItemIds",
"(",
")",
";",
"for",
"(",
"Object",
"itemId",
":",
"itemIds",
")",
"{",
"if",
"(",
"m_table",
".",
... | Checks if a key already exists.
@param newKey the key to check for.
@return <code>true</code> if the key already exists, <code>false</code> otherwise. | [
"Checks",
"if",
"a",
"key",
"already",
"exists",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java#L1018-L1027 | train |
alkacon/opencms-core | src-gwt/org/opencms/ugc/client/CmsUgcWrapper.java | CmsUgcWrapper.uploadFields | public void uploadFields(
final Set<String> fields,
final Function<Map<String, String>, Void> filenameCallback,
final I_CmsErrorCallback errorCallback) {
disableAllFileFieldsExcept(fields);
final String id = CmsJsUtils.generateRandomId();
updateFormAction(id);
//... | java | public void uploadFields(
final Set<String> fields,
final Function<Map<String, String>, Void> filenameCallback,
final I_CmsErrorCallback errorCallback) {
disableAllFileFieldsExcept(fields);
final String id = CmsJsUtils.generateRandomId();
updateFormAction(id);
//... | [
"public",
"void",
"uploadFields",
"(",
"final",
"Set",
"<",
"String",
">",
"fields",
",",
"final",
"Function",
"<",
"Map",
"<",
"String",
",",
"String",
">",
",",
"Void",
">",
"filenameCallback",
",",
"final",
"I_CmsErrorCallback",
"errorCallback",
")",
"{",... | Uploads files from the given file input fields.<p<
@param fields the set of names of fields containing the files to upload
@param filenameCallback the callback to call with the resulting map from field names to file paths
@param errorCallback the callback to call with an error message | [
"Uploads",
"files",
"from",
"the",
"given",
"file",
"input",
"fields",
".",
"<p<"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ugc/client/CmsUgcWrapper.java#L99-L141 | train |
alkacon/opencms-core | src/org/opencms/jsp/util/CmsJspElFunctions.java | CmsJspElFunctions.convertResource | public static CmsJspResourceWrapper convertResource(CmsObject cms, Object input) throws CmsException {
CmsJspResourceWrapper result;
if (input instanceof CmsResource) {
result = CmsJspResourceWrapper.wrap(cms, (CmsResource)input);
} else {
result = CmsJspResourceWrapper.... | java | public static CmsJspResourceWrapper convertResource(CmsObject cms, Object input) throws CmsException {
CmsJspResourceWrapper result;
if (input instanceof CmsResource) {
result = CmsJspResourceWrapper.wrap(cms, (CmsResource)input);
} else {
result = CmsJspResourceWrapper.... | [
"public",
"static",
"CmsJspResourceWrapper",
"convertResource",
"(",
"CmsObject",
"cms",
",",
"Object",
"input",
")",
"throws",
"CmsException",
"{",
"CmsJspResourceWrapper",
"result",
";",
"if",
"(",
"input",
"instanceof",
"CmsResource",
")",
"{",
"result",
"=",
"... | Returns a resource wrapper created from the input.
The wrapped result of {@link #convertRawResource(CmsObject, Object)} is returned.
@param cms the current OpenCms user context
@param input the input to create a resource from
@return a resource wrapper created from the given Object
@throws CmsException in case of e... | [
"Returns",
"a",
"resource",
"wrapper",
"created",
"from",
"the",
"input",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsJspElFunctions.java#L365-L374 | train |
alkacon/opencms-core | src/org/opencms/jsp/util/CmsJspElFunctions.java | CmsJspElFunctions.convertResourceList | public static List<CmsJspResourceWrapper> convertResourceList(CmsObject cms, List<CmsResource> list) {
List<CmsJspResourceWrapper> result = new ArrayList<CmsJspResourceWrapper>(list.size());
for (CmsResource res : list) {
result.add(CmsJspResourceWrapper.wrap(cms, res));
}
r... | java | public static List<CmsJspResourceWrapper> convertResourceList(CmsObject cms, List<CmsResource> list) {
List<CmsJspResourceWrapper> result = new ArrayList<CmsJspResourceWrapper>(list.size());
for (CmsResource res : list) {
result.add(CmsJspResourceWrapper.wrap(cms, res));
}
r... | [
"public",
"static",
"List",
"<",
"CmsJspResourceWrapper",
">",
"convertResourceList",
"(",
"CmsObject",
"cms",
",",
"List",
"<",
"CmsResource",
">",
"list",
")",
"{",
"List",
"<",
"CmsJspResourceWrapper",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"CmsJspResou... | Returns a list of resource wrappers created from the input list of resources.
@param cms the current OpenCms user context
@param list the list to create the resource wrapper list from
@return the list of wrapped resources. | [
"Returns",
"a",
"list",
"of",
"resource",
"wrappers",
"created",
"from",
"the",
"input",
"list",
"of",
"resources",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsJspElFunctions.java#L384-L391 | train |
alkacon/opencms-core | src/org/opencms/jsp/search/config/CmsSearchConfigurationPagination.java | CmsSearchConfigurationPagination.create | public static I_CmsSearchConfigurationPagination create(
String pageParam,
List<Integer> pageSizes,
Integer pageNavLength) {
return (pageParam != null) || (pageSizes != null) || (pageNavLength != null)
? new CmsSearchConfigurationPagination(pageParam, pageSizes, pageNavLength)
... | java | public static I_CmsSearchConfigurationPagination create(
String pageParam,
List<Integer> pageSizes,
Integer pageNavLength) {
return (pageParam != null) || (pageSizes != null) || (pageNavLength != null)
? new CmsSearchConfigurationPagination(pageParam, pageSizes, pageNavLength)
... | [
"public",
"static",
"I_CmsSearchConfigurationPagination",
"create",
"(",
"String",
"pageParam",
",",
"List",
"<",
"Integer",
">",
"pageSizes",
",",
"Integer",
"pageNavLength",
")",
"{",
"return",
"(",
"pageParam",
"!=",
"null",
")",
"||",
"(",
"pageSizes",
"!=",... | Creates a new pagination configuration if at least one of the provided parameters is not null.
Otherwise returns null.
@param pageParam The request parameter used to send the current page number.
@param pageSizes The page sizes for the first pages. The last provided size is the size of all following pages.
@param pageN... | [
"Creates",
"a",
"new",
"pagination",
"configuration",
"if",
"at",
"least",
"one",
"of",
"the",
"provided",
"parameters",
"is",
"not",
"null",
".",
"Otherwise",
"returns",
"null",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/search/config/CmsSearchConfigurationPagination.java#L98-L107 | train |
alkacon/opencms-core | src/org/opencms/search/CmsSearchUtil.java | CmsSearchUtil.getDateCreatedTimeRangeFilterQuery | public static String getDateCreatedTimeRangeFilterQuery(String searchField, long startTime, long endTime) {
String sStartTime = null;
String sEndTime = null;
// Convert startTime to ISO 8601 format
if ((startTime > Long.MIN_VALUE) && (startTime < Long.MAX_VALUE)) {
sStartTi... | java | public static String getDateCreatedTimeRangeFilterQuery(String searchField, long startTime, long endTime) {
String sStartTime = null;
String sEndTime = null;
// Convert startTime to ISO 8601 format
if ((startTime > Long.MIN_VALUE) && (startTime < Long.MAX_VALUE)) {
sStartTi... | [
"public",
"static",
"String",
"getDateCreatedTimeRangeFilterQuery",
"(",
"String",
"searchField",
",",
"long",
"startTime",
",",
"long",
"endTime",
")",
"{",
"String",
"sStartTime",
"=",
"null",
";",
"String",
"sEndTime",
"=",
"null",
";",
"// Convert startTime to I... | Returns a time interval as Solr compatible query string.
@param searchField the field to search for.
@param startTime the lower limit of the interval.
@param endTime the upper limit of the interval.
@return Solr compatible query string. | [
"Returns",
"a",
"time",
"interval",
"as",
"Solr",
"compatible",
"query",
"string",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchUtil.java#L209-L229 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.