_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q1900 | CmsResourceTypeXmlContent.getDetailContainerResources | train | private List<CmsResource> getDetailContainerResources(CmsObject cms, CmsResource res) throws CmsException {
CmsRelationFilter filter = CmsRelationFilter.relationsFromStructureId(res.getStructureId()).filterType(
CmsRelationType.DETAIL_ONLY);
List<CmsResource> result = Lists.newArrayList();
... | java | {
"resource": ""
} |
q1901 | CmsMappingsList.getMappings | train | private List<I_CmsSearchFieldMapping> getMappings() {
CmsSearchManager manager = OpenCms.getSearchManager();
I_CmsSearchFieldConfiguration fieldConfig = manager.getFieldConfiguration(getParamFieldconfiguration());
CmsLuceneField field;
List<I_CmsSearchFieldMapping> result = null;
... | java | {
"resource": ""
} |
q1902 | CmsSetupErrorDialog.showErrorDialog | train | public static void showErrorDialog(String message, String details) {
Window window = prepareWindow(DialogWidth.wide);
window.setCaption("Error");
window.setContent(new CmsSetupErrorDialog(message, details, null, window));
A_CmsUI.get().addWindow(window);
} | java | {
"resource": ""
} |
q1903 | CmsMacroFormatterResolver.getMacroBeanValue | train | protected Object getMacroBeanValue(Object bean, String property) {
Object result = null;
if ((bean != null) && CmsStringUtil.isNotEmptyOrWhitespaceOnly(property)) {
try {
PropertyUtilsBean propBean = BeanUtilsBean.getInstance().getPropertyUtils();
result = pr... | java | {
"resource": ""
} |
q1904 | CmsSerialDateController.setEndTime | train | public void setEndTime(final Date date) {
if (!Objects.equals(m_model.getEnd(), date)) {
m_model.setEnd(date);
valueChanged();
}
} | java | {
"resource": ""
} |
q1905 | CmsSerialDateController.setEndType | train | public void setEndType(final String value) {
final EndType endType = EndType.valueOf(value);
if (!endType.equals(m_model.getEndType())) {
removeExceptionsOnChange(new Command() {
public void execute() {
switch (endType) {
... | java | {
"resource": ""
} |
q1906 | CmsSerialDateController.setIsSeries | train | public void setIsSeries(Boolean isSeries) {
if (null != isSeries) {
final boolean series = isSeries.booleanValue();
if ((null != m_model.getParentSeriesId()) && series) {
m_removeSeriesBindingConfirmDialog.show(new Command() {
public void exec... | java | {
"resource": ""
} |
q1907 | CmsSerialDateController.setOccurrences | train | public void setOccurrences(String occurrences) {
int o = CmsSerialDateUtil.toIntWithDefault(occurrences, -1);
if (m_model.getOccurrences() != o) {
m_model.setOccurrences(o);
valueChanged();
}
} | java | {
"resource": ""
} |
q1908 | CmsSerialDateController.setPattern | train | public void setPattern(String patternType) {
final PatternType type = PatternType.valueOf(patternType);
if (type != m_model.getPatternType()) {
removeExceptionsOnChange(new Command() {
public void execute() {
EndType oldEndType = m_model.getEndT... | java | {
"resource": ""
} |
q1909 | CmsSerialDateController.setSeriesEndDate | train | public void setSeriesEndDate(Date date) {
if (!Objects.equals(m_model.getSeriesEndDate(), date)) {
m_model.setSeriesEndDate(date);
valueChanged();
}
} | java | {
"resource": ""
} |
q1910 | CmsSerialDateController.setStartTime | train | public void setStartTime(final Date date) {
if (!Objects.equals(m_model.getStart(), date)) {
removeExceptionsOnChange(new Command() {
public void execute() {
m_model.setStart(date);
setPatternDefaultValues(date);
... | java | {
"resource": ""
} |
q1911 | CmsSerialDateController.setWholeDay | train | public void setWholeDay(Boolean isWholeDay) {
if (m_model.isWholeDay() ^ ((null != isWholeDay) && isWholeDay.booleanValue())) {
m_model.setWholeDay(isWholeDay);
valueChanged();
}
} | java | {
"resource": ""
} |
q1912 | CmsSerialDateController.updateExceptions | train | public void updateExceptions(SortedSet<Date> exceptions) {
SortedSet<Date> e = null == exceptions ? new TreeSet<Date>() : exceptions;
if (!m_model.getExceptions().equals(e)) {
m_model.setExceptions(e);
m_view.updateExceptions();
valueChanged();
siz... | java | {
"resource": ""
} |
q1913 | CmsSerialDateController.getService | train | I_CmsSerialDateServiceAsync getService() {
if (SERVICE == null) {
SERVICE = GWT.create(I_CmsSerialDateService.class);
String serviceUrl = CmsCoreProvider.get().link("org.opencms.ade.contenteditor.CmsSerialDateService.gwt");
((ServiceDefTarget)SERVICE).setServiceEntryPoi... | java | {
"resource": ""
} |
q1914 | CmsSerialDateController.setPatternDefaultValues | train | void setPatternDefaultValues(Date startDate) {
if ((m_patternDefaultValues == null) || !Objects.equals(m_patternDefaultValues.getDate(), startDate)) {
m_patternDefaultValues = new PatternDefaultValues(startDate);
}
} | java | {
"resource": ""
} |
q1915 | CmsSerialDateController.initPatternControllers | train | private void initPatternControllers() {
m_patternControllers.put(PatternType.NONE, new CmsPatternPanelNoneController());
m_patternControllers.put(PatternType.DAILY, new CmsPatternPanelDailyController(m_model, this));
m_patternControllers.put(PatternType.WEEKLY, new CmsPatternPanelWeeklyCont... | java | {
"resource": ""
} |
q1916 | CmsSetNextRule.begin | train | @Override
public void begin(String namespace, String name, Attributes attributes) throws Exception {
// not now: 6.0.0
// digester.setLogger(CmsLog.getLog(digester.getClass()));
// Push an array to capture the parameter values if necessary
if (m_paramCount > 0) {
Object... | java | {
"resource": ""
} |
q1917 | CmsPublishManager.setPublishQueueShutdowntime | train | public void setPublishQueueShutdowntime(String publishQueueShutdowntime) {
if (m_frozen) {
throw new CmsRuntimeException(Messages.get().container(Messages.ERR_CONFIG_FROZEN_0));
}
m_publishQueueShutdowntime = Integer.parseInt(publishQueueShutdowntime);
} | java | {
"resource": ""
} |
q1918 | CmsUserSettingsStringPropertyWrapper.getElementView | train | @PrefMetadata(type = CmsElementViewPreference.class)
public String getElementView() {
return m_settings.getAdditionalPreference(CmsElementViewPreference.PREFERENCE_NAME, false);
} | java | {
"resource": ""
} |
q1919 | CmsUserSettingsStringPropertyWrapper.getExplorerFileEntryOptions | train | @PrefMetadata(type = CmsHiddenBuiltinPreference.class)
public String getExplorerFileEntryOptions() {
if (m_settings.getExplorerFileEntryOptions() == null) {
return "";
} else {
return "" + m_settings.getExplorerFileEntryOptions();
}
} | java | {
"resource": ""
} |
q1920 | CmsUserSettingsStringPropertyWrapper.getTimeWarp | train | @PrefMetadata(type = CmsTimeWarpPreference.class)
public String getTimeWarp() {
long warp = m_settings.getTimeWarp();
return warp < 0 ? "" : "" + warp; // if timewarp < 0 (i.e. time warp is not set), use the empty string because we don't want the date selector widget to interpret the negative value... | java | {
"resource": ""
} |
q1921 | CmsUserSettingsStringPropertyWrapper.setTimeWarp | train | public void setTimeWarp(String l) {
long warp = CmsContextInfo.CURRENT_TIME;
try {
warp = Long.parseLong(l);
} catch (NumberFormatException e) {
// if parsing the time warp fails, it will be set to -1 (i.e. disabled)
}
m_settings.setTimeWarp(warp);
} | java | {
"resource": ""
} |
q1922 | A_CmsSerialDateValue.setExceptions | train | public final void setExceptions(SortedSet<Date> dates) {
m_exceptions.clear();
if (null != dates) {
m_exceptions.addAll(dates);
}
} | java | {
"resource": ""
} |
q1923 | A_CmsSerialDateValue.setIndividualDates | train | public final void setIndividualDates(SortedSet<Date> dates) {
m_individualDates.clear();
if (null != dates) {
m_individualDates.addAll(dates);
}
for (Date d : getExceptions()) {
if (!m_individualDates.contains(d)) {
m_exceptions.remove(d);
... | java | {
"resource": ""
} |
q1924 | A_CmsSerialDateValue.setWeekDay | train | public final void setWeekDay(WeekDay weekDay) {
SortedSet<WeekDay> wds = new TreeSet<>();
if (null != weekDay) {
wds.add(weekDay);
}
setWeekDays(wds);
} | java | {
"resource": ""
} |
q1925 | A_CmsSerialDateValue.setWeekDays | train | public final void setWeekDays(SortedSet<WeekDay> weekDays) {
m_weekDays.clear();
if (null != weekDays) {
m_weekDays.addAll(weekDays);
}
} | java | {
"resource": ""
} |
q1926 | A_CmsSerialDateValue.setWeekOfMonth | train | public final void setWeekOfMonth(WeekOfMonth weekOfMonth) {
SortedSet<WeekOfMonth> woms = new TreeSet<>();
if (null != weekOfMonth) {
woms.add(weekOfMonth);
}
setWeeksOfMonth(woms);
} | java | {
"resource": ""
} |
q1927 | A_CmsSerialDateValue.setWeeksOfMonth | train | public final void setWeeksOfMonth(SortedSet<WeekOfMonth> weeksOfMonth) {
m_weeksOfMonth.clear();
if (null != weeksOfMonth) {
m_weeksOfMonth.addAll(weeksOfMonth);
}
} | java | {
"resource": ""
} |
q1928 | A_CmsSerialDateValue.isDurationValid | train | protected final boolean isDurationValid() {
if (isValidEndTypeForPattern()) {
switch (getEndType()) {
case DATE:
return (getStart().getTime() < (getSeriesEndDate().getTime() + DAY_IN_MILLIS));
case TIMES:
return getOccurrences(... | java | {
"resource": ""
} |
q1929 | A_CmsSerialDateValue.isPatternValid | train | protected final boolean isPatternValid() {
switch (getPatternType()) {
case DAILY:
return isEveryWorkingDay() || isIntervalValid();
case WEEKLY:
return isIntervalValid() && isWeekDaySet();
case MONTHLY:
return isIntervalValid()... | java | {
"resource": ""
} |
q1930 | A_CmsSerialDateValue.isValidEndTypeForPattern | train | protected final boolean isValidEndTypeForPattern() {
if (getEndType() == null) {
return false;
}
switch (getPatternType()) {
case DAILY:
case WEEKLY:
case MONTHLY:
case YEARLY:
return (getEndType().equals(EndType.DATE) ... | java | {
"resource": ""
} |
q1931 | A_CmsSerialDateValue.setDefaultValue | train | protected final void setDefaultValue() {
m_start = null;
m_end = null;
m_patterntype = PatternType.NONE;
m_dayOfMonth = 0;
m_exceptions.clear();
m_individualDates.clear();
m_interval = 0;
m_isEveryWorkingDay = false;
m_isWholeDay = false;
... | java | {
"resource": ""
} |
q1932 | A_CmsSerialDateValue.setDerivedEndType | train | protected final void setDerivedEndType() {
m_endType = getPatternType().equals(PatternType.NONE) || getPatternType().equals(PatternType.INDIVIDUAL)
? EndType.SINGLE
: null != getSeriesEndDate() ? EndType.DATE : EndType.TIMES;
} | java | {
"resource": ""
} |
q1933 | CmsFunctionRenderer.defaultHtml | train | public static String defaultHtml(HttpServletRequest request) {
CmsObject cms = CmsFlexController.getController(request).getCmsObject();
// We only want the big red warning in Offline mode
if (cms.getRequestContext().getCurrentProject().isOnlineProject()) {
return "<div><!--Dynamic ... | java | {
"resource": ""
} |
q1934 | RemoteServiceProxy.getEncodedInstance | train | private static String getEncodedInstance(String encodedResponse) {
if (isReturnValue(encodedResponse) || isThrownException(encodedResponse)) {
return encodedResponse.substring(4);
}
return encodedResponse;
} | java | {
"resource": ""
} |
q1935 | RemoteServiceProxy.doInvoke | train | protected <T> Request doInvoke(ResponseReader responseReader,
String methodName, RpcStatsContext statsContext, String requestData,
AsyncCallback<T> callback) {
RequestBuilder rb = doPrepareRequestBuilderImpl(responseReader, methodName,
statsContext, requestData, callback);
try {
retu... | java | {
"resource": ""
} |
q1936 | RemoteServiceProxy.doPrepareRequestBuilder | train | protected <T> RequestBuilder doPrepareRequestBuilder(
ResponseReader responseReader, String methodName, RpcStatsContext statsContext,
String requestData, AsyncCallback<T> callback) {
RequestBuilder rb = doPrepareRequestBuilderImpl(responseReader, methodName,
statsContext, requestData, callback)... | java | {
"resource": ""
} |
q1937 | RemoteServiceProxy.doPrepareRequestBuilderImpl | train | private <T> RequestBuilder doPrepareRequestBuilderImpl(
ResponseReader responseReader, String methodName, RpcStatsContext statsContext,
String requestData, AsyncCallback<T> callback) {
if (getServiceEntryPoint() == null) {
throw new NoServiceEntryPointSpecifiedException();
}
RequestCallb... | java | {
"resource": ""
} |
q1938 | CmsCategoryTree.deselectChildren | train | private void deselectChildren(CmsTreeItem item) {
for (String childId : m_childrens.get(item.getId())) {
CmsTreeItem child = m_categories.get(childId);
deselectChildren(child);
child.getCheckBox().setChecked(false);
if (m_selectedCategories.contains(childId... | java | {
"resource": ""
} |
q1939 | CmsCategoryTree.normalizeSelectedCategories | train | private void normalizeSelectedCategories() {
Collection<String> normalizedCategories = new ArrayList<String>(m_selectedCategories.size());
for (CmsTreeItem item : m_categories.values()) {
if (item.getCheckBox().isChecked()) {
normalizedCategories.add(item.getId());
... | java | {
"resource": ""
} |
q1940 | CmsCategoryTree.uncheckAll | train | private void uncheckAll(CmsList<? extends I_CmsListItem> list) {
for (Widget it : list) {
CmsTreeItem treeItem = (CmsTreeItem)it;
treeItem.getCheckBox().setChecked(false);
uncheckAll(treeItem.getChildren());
}
} | java | {
"resource": ""
} |
q1941 | Messages.getButtonName | train | public static String getButtonName(String gallery) {
StringBuffer sb = new StringBuffer(GUI_BUTTON_PREF);
sb.append(gallery.toUpperCase());
sb.append(GUI_BUTTON_SUF);
return sb.toString();
} | java | {
"resource": ""
} |
q1942 | CmsMessageBundleEditorModel.addDescriptor | train | public boolean addDescriptor() {
saveLocalization();
IndexedContainer oldContainer = m_container;
try {
createAndLockDescriptorFile();
unmarshalDescriptor();
updateBundleDescriptorContent();
m_hasMasterMode = true;
m_container = create... | java | {
"resource": ""
} |
q1943 | CmsMessageBundleEditorModel.deleteDescriptorIfNecessary | train | public void deleteDescriptorIfNecessary() throws CmsException {
if (m_removeDescriptorOnCancel && (m_desc != null)) {
m_cms.deleteResource(m_desc, CmsResourceDeleteMode.valueOf(2));
}
} | java | {
"resource": ""
} |
q1944 | CmsMessageBundleEditorModel.getConfigurableMessages | train | public ConfigurableMessages getConfigurableMessages(CmsMessages defaultMessages, Locale locale) {
return new ConfigurableMessages(defaultMessages, locale, m_configuredBundle);
} | java | {
"resource": ""
} |
q1945 | CmsMessageBundleEditorModel.getContextMenuForItem | train | public CmsContextMenu getContextMenuForItem(Object itemId) {
CmsContextMenu result = null;
try {
final Item item = m_container.getItem(itemId);
Property<?> keyProp = item.getItemProperty(TableProperty.KEY);
String key = (String)keyProp.getValue();
if ((nu... | java | {
"resource": ""
} |
q1946 | CmsMessageBundleEditorModel.getEditableColumns | train | public List<TableProperty> getEditableColumns(CmsMessageBundleEditorTypes.EditMode mode) {
return m_editorState.get(mode).getEditableColumns();
} | java | {
"resource": ""
} |
q1947 | CmsMessageBundleEditorModel.getEditedFilePath | train | public String getEditedFilePath() {
switch (getBundleType()) {
case DESCRIPTOR:
return m_cms.getSitePath(m_desc);
case PROPERTY:
return null != m_lockedBundleFiles.get(getLocale())
? m_cms.getSitePath(m_lockedBundleFiles.get(getLocale()).g... | java | {
"resource": ""
} |
q1948 | CmsMessageBundleEditorModel.handleChange | train | public void handleChange(Object propertyId) {
try {
lockOnChange(propertyId);
} catch (CmsException e) {
LOG.debug(e);
}
if (isDescriptorProperty(propertyId)) {
m_descriptorHasChanges = true;
}
if (isBundleProperty(propertyId)) {
... | java | {
"resource": ""
} |
q1949 | CmsMessageBundleEditorModel.handleKeyChange | train | public KeyChangeResult handleKeyChange(EntryChangeEvent event, boolean allLanguages) {
if (m_keyset.getKeySet().contains(event.getNewValue())) {
m_container.getItem(event.getItemId()).getItemProperty(TableProperty.KEY).setValue(event.getOldValue());
return KeyChangeResult.FAILED_DUPLICA... | java | {
"resource": ""
} |
q1950 | CmsMessageBundleEditorModel.handleKeyDeletion | train | public boolean handleKeyDeletion(final String key) {
if (m_keyset.getKeySet().contains(key)) {
if (removeKeyForAllLanguages(key)) {
m_keyset.removeKey(key);
return true;
} else {
return false;
}
}
return true;
... | java | {
"resource": ""
} |
q1951 | CmsMessageBundleEditorModel.publish | train | public void publish() {
CmsDirectPublishDialogAction action = new CmsDirectPublishDialogAction();
List<CmsResource> resources = getBundleResources();
I_CmsDialogContext context = new A_CmsDialogContext("", ContextType.appToolbar, resources) {
public void focus(CmsUUID structureId) ... | java | {
"resource": ""
} |
q1952 | CmsMessageBundleEditorModel.save | train | public void save() throws CmsException {
if (hasChanges()) {
switch (m_bundleType) {
case PROPERTY:
saveLocalization();
saveToPropertyVfsBundle();
break;
case XML:
saveLocalization();
... | java | {
"resource": ""
} |
q1953 | CmsMessageBundleEditorModel.saveAsPropertyBundle | train | public void saveAsPropertyBundle() throws UnsupportedEncodingException, CmsException, IOException {
switch (m_bundleType) {
case XML:
saveLocalization();
loadAllRemainingLocalizations();
createPropertyVfsBundleFiles();
saveToPropertyVf... | java | {
"resource": ""
} |
q1954 | CmsMessageBundleEditorModel.unlock | train | public void unlock() {
for (Locale l : m_lockedBundleFiles.keySet()) {
LockedFile f = m_lockedBundleFiles.get(l);
f.tryUnlock();
}
if (null != m_descFile) {
m_descFile.tryUnlock();
}
} | java | {
"resource": ""
} |
q1955 | CmsMessageBundleEditorModel.getBundleResources | train | List<CmsResource> getBundleResources() {
List<CmsResource> resources = new ArrayList<>(m_bundleFiles.values());
if (m_desc != null) {
resources.add(m_desc);
}
return resources;
} | java | {
"resource": ""
} |
q1956 | CmsMessageBundleEditorModel.createAndLockDescriptorFile | train | private void createAndLockDescriptorFile() throws CmsException {
String sitePath = m_sitepath + m_basename + CmsMessageBundleEditorTypes.Descriptor.POSTFIX;
m_desc = m_cms.createResource(
sitePath,
OpenCms.getResourceManager().getResourceType(CmsMessageBundleEditorTypes.BundleTy... | java | {
"resource": ""
} |
q1957 | CmsMessageBundleEditorModel.createContainerForBundleWithDescriptor | train | private IndexedContainer createContainerForBundleWithDescriptor() throws IOException, CmsException {
IndexedContainer container = new IndexedContainer();
// create properties
container.addContainerProperty(TableProperty.KEY, String.class, "");
container.addContainerProperty(TableProper... | java | {
"resource": ""
} |
q1958 | CmsMessageBundleEditorModel.createContainerForBundleWithoutDescriptor | train | private IndexedContainer createContainerForBundleWithoutDescriptor() throws IOException, CmsException {
IndexedContainer container = new IndexedContainer();
// create properties
container.addContainerProperty(TableProperty.KEY, String.class, "");
container.addContainerProperty(TablePro... | java | {
"resource": ""
} |
q1959 | CmsMessageBundleEditorModel.createContainerForDescriptorEditing | train | private IndexedContainer createContainerForDescriptorEditing() {
IndexedContainer container = new IndexedContainer();
// create properties
container.addContainerProperty(TableProperty.KEY, String.class, "");
container.addContainerProperty(TableProperty.DESCRIPTION, String.class, "");
... | java | {
"resource": ""
} |
q1960 | CmsMessageBundleEditorModel.createPropertyVfsBundleFiles | train | private void createPropertyVfsBundleFiles() throws CmsIllegalArgumentException, CmsLoaderException, CmsException {
String bundleFileBasePath = m_sitepath + m_basename + "_";
for (Locale l : m_localizations.keySet()) {
CmsResource res = m_cms.createResource(
bundleFileBasePat... | java | {
"resource": ""
} |
q1961 | CmsMessageBundleEditorModel.getDefaultState | train | private EditorState getDefaultState() {
List<TableProperty> cols = new ArrayList<TableProperty>(1);
cols.add(TableProperty.TRANSLATION);
return new EditorState(cols, false);
} | java | {
"resource": ""
} |
q1962 | CmsMessageBundleEditorModel.getLocalization | train | private SortedProperties getLocalization(Locale locale) throws IOException, CmsException {
if (null == m_localizations.get(locale)) {
switch (m_bundleType) {
case PROPERTY:
loadLocalizationFromPropertyBundle(locale);
break;
cas... | java | {
"resource": ""
} |
q1963 | CmsMessageBundleEditorModel.getMasterState | train | private EditorState getMasterState() {
List<TableProperty> cols = new ArrayList<TableProperty>(4);
cols.add(TableProperty.KEY);
cols.add(TableProperty.DESCRIPTION);
cols.add(TableProperty.DEFAULT);
cols.add(TableProperty.TRANSLATION);
return new EditorState(cols, true);
... | java | {
"resource": ""
} |
q1964 | CmsMessageBundleEditorModel.initBundleType | train | private CmsMessageBundleEditorTypes.BundleType initBundleType() {
String resourceTypeName = OpenCms.getResourceManager().getResourceType(m_resource).getTypeName();
return CmsMessageBundleEditorTypes.BundleType.toBundleType(resourceTypeName);
} | java | {
"resource": ""
} |
q1965 | CmsMessageBundleEditorModel.initDescriptor | train | private void initDescriptor() throws CmsXmlException, CmsException {
if (m_bundleType.equals(CmsMessageBundleEditorTypes.BundleType.DESCRIPTOR)) {
m_desc = m_resource;
} else {
//First try to read from same folder like resource, if it fails use CmsMessageBundleEditorTypes.getDes... | java | {
"resource": ""
} |
q1966 | CmsMessageBundleEditorModel.initEditorStates | train | private void initEditorStates() {
m_editorState = new HashMap<CmsMessageBundleEditorTypes.EditMode, EditorState>();
List<TableProperty> cols = null;
switch (m_bundleType) {
case PROPERTY:
case XML:
if (hasDescriptor()) { // bundle descriptor is present, k... | java | {
"resource": ""
} |
q1967 | CmsMessageBundleEditorModel.initHasMasterMode | train | private void initHasMasterMode() throws CmsException {
if (hasDescriptor()
&& m_cms.hasPermissions(m_desc, CmsPermissionSet.ACCESS_WRITE, false, CmsResourceFilter.ALL)) {
m_hasMasterMode = true;
} else {
m_hasMasterMode = false;
}
} | java | {
"resource": ""
} |
q1968 | CmsMessageBundleEditorModel.initKeySetForXmlBundle | train | private void initKeySetForXmlBundle() {
// consider only available locales
for (Locale l : m_locales) {
if (m_xmlBundle.hasLocale(l)) {
Set<Object> keys = new HashSet<Object>();
for (I_CmsXmlContentValue msg : m_xmlBundle.getValueSequence("Message", l).getVal... | java | {
"resource": ""
} |
q1969 | CmsMessageBundleEditorModel.initLocales | train | private Collection<Locale> initLocales() {
Collection<Locale> locales = null;
switch (m_bundleType) {
case DESCRIPTOR:
locales = new ArrayList<Locale>(1);
locales.add(Descriptor.LOCALE);
break;
case XML:
case PROPERTY:
... | java | {
"resource": ""
} |
q1970 | CmsMessageBundleEditorModel.initPropertyBundle | train | private void initPropertyBundle() throws CmsLoaderException, CmsException, IOException {
for (Locale l : m_locales) {
String filePath = m_sitepath + m_basename + "_" + l.toString();
CmsResource resource = null;
if (m_cms.existsResource(
filePath,
... | java | {
"resource": ""
} |
q1971 | CmsMessageBundleEditorModel.initXmlBundle | train | private void initXmlBundle() throws CmsException {
CmsFile file = m_cms.readFile(m_resource);
m_bundleFiles.put(null, m_resource);
m_xmlBundle = CmsXmlContentFactory.unmarshal(m_cms, file);
initKeySetForXmlBundle();
} | java | {
"resource": ""
} |
q1972 | CmsMessageBundleEditorModel.isBundleProperty | train | private boolean isBundleProperty(Object property) {
return (property.equals(TableProperty.KEY) || property.equals(TableProperty.TRANSLATION));
} | java | {
"resource": ""
} |
q1973 | CmsMessageBundleEditorModel.isDescriptorProperty | train | private boolean isDescriptorProperty(Object property) {
return (getBundleType().equals(BundleType.DESCRIPTOR)
|| (hasDescriptor()
&& (property.equals(TableProperty.KEY)
|| property.equals(TableProperty.DEFAULT)
|| property.equals(TableProperty... | java | {
"resource": ""
} |
q1974 | CmsMessageBundleEditorModel.loadAllRemainingLocalizations | train | private void loadAllRemainingLocalizations() throws CmsException, UnsupportedEncodingException, IOException {
if (!m_alreadyLoadedAllLocalizations) {
// is only necessary for property bundles
if (m_bundleType.equals(BundleType.PROPERTY)) {
for (Locale l : m_locales) {
... | java | {
"resource": ""
} |
q1975 | CmsMessageBundleEditorModel.loadLocalizationFromXmlBundle | train | private void loadLocalizationFromXmlBundle(Locale locale) {
CmsXmlContentValueSequence messages = m_xmlBundle.getValueSequence("Message", locale);
SortedProperties props = new SortedProperties();
if (null != messages) {
for (I_CmsXmlContentValue msg : messages.getValues()) {
... | java | {
"resource": ""
} |
q1976 | CmsMessageBundleEditorModel.lockDescriptor | train | private void lockDescriptor() throws CmsException {
if ((null == m_descFile) && (null != m_desc)) {
m_descFile = LockedFile.lockResource(m_cms, m_desc);
}
} | java | {
"resource": ""
} |
q1977 | CmsMessageBundleEditorModel.lockLocalization | train | private void lockLocalization(Locale l) throws CmsException {
if (null == m_lockedBundleFiles.get(l)) {
LockedFile lf = LockedFile.lockResource(m_cms, m_bundleFiles.get(l));
m_lockedBundleFiles.put(l, lf);
}
} | java | {
"resource": ""
} |
q1978 | CmsMessageBundleEditorModel.lockOnChange | train | private void lockOnChange(Object propertyId) throws CmsException {
if (isDescriptorProperty(propertyId)) {
lockDescriptor();
} else {
Locale l = m_bundleType.equals(BundleType.PROPERTY) ? m_locale : null;
lockLocalization(l);
}
} | java | {
"resource": ""
} |
q1979 | CmsMessageBundleEditorModel.removeKeyForAllLanguages | train | private boolean removeKeyForAllLanguages(String key) {
try {
if (hasDescriptor()) {
lockDescriptor();
}
loadAllRemainingLocalizations();
lockAllLocalizations(key);
} catch (CmsException | IOException e) {
LOG.warn("Not able loc... | java | {
"resource": ""
} |
q1980 | CmsMessageBundleEditorModel.removeXmlBundleFile | train | private void removeXmlBundleFile() throws CmsException {
lockLocalization(null);
m_cms.deleteResource(m_resource, CmsResource.DELETE_PRESERVE_SIBLINGS);
m_resource = null;
} | java | {
"resource": ""
} |
q1981 | CmsMessageBundleEditorModel.renameKeyForAllLanguages | train | private boolean renameKeyForAllLanguages(String oldKey, String newKey) {
try {
loadAllRemainingLocalizations();
lockAllLocalizations(oldKey);
if (hasDescriptor()) {
lockDescriptor();
}
} catch (CmsException | IOException e) {
L... | java | {
"resource": ""
} |
q1982 | CmsMessageBundleEditorModel.replaceValues | train | private boolean replaceValues(Locale locale) {
try {
SortedProperties localization = getLocalization(locale);
if (hasDescriptor()) {
for (Object itemId : m_container.getItemIds()) {
Item item = m_container.getItem(itemId);
String k... | java | {
"resource": ""
} |
q1983 | CmsMessageBundleEditorModel.saveLocalization | train | private void saveLocalization() {
SortedProperties localization = new SortedProperties();
for (Object itemId : m_container.getItemIds()) {
Item item = m_container.getItem(itemId);
String key = item.getItemProperty(TableProperty.KEY).getValue().toString();
String valu... | java | {
"resource": ""
} |
q1984 | CmsMessageBundleEditorModel.saveToBundleDescriptor | train | private void saveToBundleDescriptor() throws CmsException {
if (null != m_descFile) {
m_removeDescriptorOnCancel = false;
updateBundleDescriptorContent();
m_descFile.getFile().setContents(m_descContent.marshal());
m_cms.writeFile(m_descFile.getFile());
}
... | java | {
"resource": ""
} |
q1985 | CmsMessageBundleEditorModel.saveToPropertyVfsBundle | train | private void saveToPropertyVfsBundle() throws CmsException {
for (Locale l : m_changedTranslations) {
SortedProperties props = m_localizations.get(l);
LockedFile f = m_lockedBundleFiles.get(l);
if ((null != props) && (null != f)) {
try {
B... | java | {
"resource": ""
} |
q1986 | CmsMessageBundleEditorModel.saveToXmlVfsBundle | train | private void saveToXmlVfsBundle() throws CmsException {
if (m_lockedBundleFiles.get(null) != null) { // If the file was not locked, no changes were made, i.e., storing is not necessary.
for (Locale l : m_locales) {
SortedProperties props = m_localizations.get(l);
if ... | java | {
"resource": ""
} |
q1987 | CmsMessageBundleEditorModel.setResourceInformation | train | private void setResourceInformation() {
String sitePath = m_cms.getSitePath(m_resource);
int pathEnd = sitePath.lastIndexOf('/') + 1;
String baseName = sitePath.substring(pathEnd);
m_sitepath = sitePath.substring(0, pathEnd);
switch (CmsMessageBundleEditorTypes.BundleType.toBund... | java | {
"resource": ""
} |
q1988 | CmsMessageBundleEditorModel.unmarshalDescriptor | train | private void unmarshalDescriptor() throws CmsXmlException, CmsException {
if (null != m_desc) {
// unmarshal descriptor
m_descContent = CmsXmlContentFactory.unmarshal(m_cms, m_cms.readFile(m_desc));
// configure messages if wanted
CmsProperty bundleProp = m_cms... | java | {
"resource": ""
} |
q1989 | CmsMessageBundleEditorModel.updateBundleDescriptorContent | train | private void updateBundleDescriptorContent() throws CmsXmlException {
if (m_descContent.hasLocale(Descriptor.LOCALE)) {
m_descContent.removeLocale(Descriptor.LOCALE);
}
m_descContent.addLocale(m_cms, Descriptor.LOCALE);
int i = 0;
Property<Object> descProp;
... | java | {
"resource": ""
} |
q1990 | CmsSitemapTreeItem.removeInvalidChildren | train | protected void removeInvalidChildren() {
if (getLoadState() == LoadState.LOADED) {
List<CmsSitemapTreeItem> toDelete = new ArrayList<CmsSitemapTreeItem>();
for (int i = 0; i < getChildCount(); i++) {
CmsSitemapTreeItem item = (CmsSitemapTreeItem)getChild(i);
... | java | {
"resource": ""
} |
q1991 | CmsPatternPanelDailyView.onEveryDayChange | train | @UiHandler("m_everyDay")
void onEveryDayChange(ValueChangeEvent<String> event) {
if (handleChange()) {
m_controller.setInterval(m_everyDay.getFormValueAsString());
}
} | java | {
"resource": ""
} |
q1992 | CmsLocationPickerWidget.getApiKey | train | private String getApiKey(CmsObject cms, String sitePath) throws CmsException {
String res = cms.readPropertyObject(
sitePath,
CmsPropertyDefinition.PROPERTY_GOOGLE_API_KEY_WORKPLACE,
true).getValue();
if (CmsStringUtil.isEmptyOrWhitespaceOnly(res)) {
res... | java | {
"resource": ""
} |
q1993 | CmsSearchConfiguration.propagateFacetNames | train | private void propagateFacetNames() {
// collect all names and configurations
Collection<String> facetNames = new ArrayList<String>();
Collection<I_CmsSearchConfigurationFacet> facetConfigs = new ArrayList<I_CmsSearchConfigurationFacet>();
facetNames.addAll(m_fieldFacets.keySet());
... | java | {
"resource": ""
} |
q1994 | CmsSerialDateBeanWeekly.getDaysToNextMatch | train | private int getDaysToNextMatch(WeekDay weekDay) {
for (WeekDay wd : m_weekDays) {
if (wd.compareTo(weekDay) > 0) {
return wd.toInt() - weekDay.toInt();
}
}
return (m_weekDays.iterator().next().toInt() + (m_interval * I_CmsSerialDateValue.NUM_OF_WEEKDAYS))... | java | {
"resource": ""
} |
q1995 | CmsMacroResolver.newWorkplaceLocaleResolver | train | public static I_CmsMacroResolver newWorkplaceLocaleResolver(final CmsObject cms) {
// Resolve macros in the property configuration
CmsMacroResolver resolver = new CmsMacroResolver();
resolver.setCmsObject(cms);
CmsUserSettings userSettings = new CmsUserSettings(cms.getRequestContext().g... | java | {
"resource": ""
} |
q1996 | CmsJSONSearchConfigurationParser.parseMandatoryStringValues | train | protected static List<String> parseMandatoryStringValues(JSONObject json, String key) throws JSONException {
List<String> list = null;
JSONArray array = json.getJSONArray(key);
list = new ArrayList<String>(array.length());
for (int i = 0; i < array.length(); i++) {
try {
... | java | {
"resource": ""
} |
q1997 | CmsJSONSearchConfigurationParser.getEscapeQueryChars | train | protected Boolean getEscapeQueryChars() {
Boolean isEscape = parseOptionalBooleanValue(m_configObject, JSON_KEY_ESCAPE_QUERY_CHARACTERS);
return (null == isEscape) && (m_baseConfig != null)
? Boolean.valueOf(m_baseConfig.getGeneralConfig().getEscapeQueryChars())
: isEscape;
} | java | {
"resource": ""
} |
q1998 | CmsJSONSearchConfigurationParser.getExtraSolrParams | train | protected String getExtraSolrParams() {
try {
return m_configObject.getString(JSON_KEY_EXTRASOLRPARAMS);
} catch (JSONException e) {
if (null == m_baseConfig) {
if (LOG.isInfoEnabled()) {
LOG.info(Messages.get().getBundle().key(Messages.LOG_NO... | java | {
"resource": ""
} |
q1999 | CmsJSONSearchConfigurationParser.getIgnoreExpirationDate | train | protected Boolean getIgnoreExpirationDate() {
Boolean isIgnoreExpirationDate = parseOptionalBooleanValue(m_configObject, JSON_KEY_IGNORE_EXPIRATION_DATE);
return (null == isIgnoreExpirationDate) && (m_baseConfig != null)
? Boolean.valueOf(m_baseConfig.getGeneralConfig().getIgnoreExpirationDate(... | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.