Skip to content

Commit

Permalink
Merged latest github changes into branch_9_5_x
Browse files Browse the repository at this point in the history
  • Loading branch information
aKandzior committed Feb 27, 2015
2 parents ef3c0cf + 6545001 commit cc4518a
Show file tree
Hide file tree
Showing 11 changed files with 514 additions and 203 deletions.
22 changes: 12 additions & 10 deletions create_version_properties.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,15 @@ OPENCMS_BUILD_DATE=$(date +"%Y-%m-%d %H:%M")
GIT_COMMIT="${GIT_COMMIT:-Unknown}"
OPENCMS_GIT_ID="${GIT_COMMIT:0:7}"
OPENCMS_GIT_BRANCH="${GIT_BRANCH:-Unknown}"
OPENCMS_GIT_BRANCH_SHOWN="${GIT_BRANCH_SHOWN:$OPENCMS_GIT_BRANCH}"

#
# The OpenCms version ID.
#
# This is a condensed String from the variables set above.
# It can be accessed in OpenCms by OpenCms.getSystemInfo().getVersionId().
#
OPENCMS_VERSION_ID="$OPENCMS_BUILD_TYPE $OPENCMS_BUILD_NUMBER ($OPENCMS_GIT_BRANCH - $OPENCMS_GIT_ID) $OPENCMS_BUILD_DATE"
OPENCMS_VERSION_ID="$OPENCMS_BUILD_TYPE $OPENCMS_BUILD_NUMBER ($GIT_BRANCH_SHOWN - $OPENCMS_GIT_ID) $OPENCMS_BUILD_DATE"


#
Expand All @@ -76,14 +77,15 @@ OPENCMS_VERSION_ID="$OPENCMS_BUILD_TYPE $OPENCMS_BUILD_NUMBER ($OPENCMS_GIT_BRAN
echo "# "
echo "# OpenCms Version Information:"
echo "# "
echo "# Build Type : $OPENCMS_BUILD_TYPE"
echo "# Build System : $OPENCMS_BUILD_SYSTEM"
echo "# Build Number : $OPENCMS_BUILD_NUMBER"
echo "# Version Number: $OPENCMS_VERSION_NUMBER"
echo "# Version ID : $OPENCMS_VERSION_ID"
echo "# Version File : $OUTPUT_FILE"
echo "# Git commit : $OPENCMS_GIT_ID"
echo "# Git branch : $OPENCMS_GIT_BRANCH"
echo "# Build Type : $OPENCMS_BUILD_TYPE"
echo "# Build System : $OPENCMS_BUILD_SYSTEM"
echo "# Build Number : $OPENCMS_BUILD_NUMBER"
echo "# Version Number : $OPENCMS_VERSION_NUMBER"
echo "# Version ID : $OPENCMS_VERSION_ID"
echo "# Version File : $OUTPUT_FILE"
echo "# Git commit : $OPENCMS_GIT_ID"
echo "# Git branch : $OPENCMS_GIT_BRANCH"
echo "# Git branch shown: $OPENCMS_GIT_BRANCH_SHOWN"
echo "# "

#
Expand All @@ -103,7 +105,7 @@ echo "build.date=$OPENCMS_BUILD_DATE" >> "$OUTPUT_FILE"
echo "build.type=$OPENCMS_BUILD_TYPE" >> "$OUTPUT_FILE"
echo "build.system=$OPENCMS_BUILD_SYSTEM" >> "$OUTPUT_FILE"
echo "build.gitid=$OPENCMS_GIT_ID" >> "$OUTPUT_FILE"
echo "build.gitbranch=$OPENCMS_GIT_BRANCH" >> "$OUTPUT_FILE"
echo "build.gitbranch=$OPENCMS_GIT_BRANCH_SHOWN" >> "$OUTPUT_FILE"
#
# Nice names for the build information (optional).
#
Expand Down
9 changes: 6 additions & 3 deletions history.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ OpenCms 9.5.1 - ?????
! Added further configuration options for OpenCms auto-setup.
! Added option to use permanent instead of temporary redirects from a non-secure to a secure server.
! Added Solr "rows" parameter in workplace's source search.
! Added support for configuring a JDBC connection in the OpenCms db properties.
- Demo template updated to Bootstrap 3.3.2.
* Fixed issue #197 with static export links being generated even if the static export was disabled.
* Fixed issue #240 with malfunctioning "invalid date" error message in date select widget.
Expand All @@ -33,16 +34,17 @@ OpenCms 9.5.1 - ?????
* Fixed issue #291 that occurred when using "Assign categories" in the legacy xmlpage direct edit provider.
* Fixed issue #292 that an exception was thrown when editing settings for the "content check" tool.
* Fixed issue #295 with user administration when using MS SQL Server.
* Fixed issue #296 with XML content correction saving a wrong order of choice elements after a schema change.
* Fixed XSS security issues affecting the request parameter based locale handler.
* Fixed several issues with secure site handling.
* Fixed issue in page editor where a selected formatter was reset to the default when content was dragged to a different container.
* Fixed an issue where detail page URLs with fragments were not processed correctly in the editor.
* Fixed issue where detail page URLs with fragments were not processed correctly in the editor.
* Fixed issue that the "Keep permissions" option was ignored during database imports.
* Fixed issue where database entries were not removed after a deleted file was published if versioning was disabled.
* Fixed issue where only the latest historic version was actually saved when the file history was set to "unlimited".
* Fixed issue where OU deletion caused server timeouts with large VFS repositories.
* Fixed issue where new roles were not created for existing sub OUs of the root OU.
* Fixed performance issue for systems using many web user OUs.
* Fixed issue with slow performance for systems using many web user OUs.
* Fixed issue where the initial role given to a new user was always in the root OU.
* Fixed issue with "editableby" attribute of <cms:container> not working correctly for roles of users outside the root OUs.
* Fixed issue where modified JSPs were infrequently not updated after publishing.
Expand All @@ -54,8 +56,9 @@ OpenCms 9.5.1 - ?????
* Fixed issue where enabling detail views in traditional workplace lists affected all other users.
* Fixed issue in link substitution with folders using the OpenCms servlet name when OpenCms is installed as ROOT application.
* Fixed issue with editor change handler not updating optional fields in the content editor.
* Fixed validation issue with hidden fields in the content editor.
* Fixed issue with validation of hidden fields in the content editor.
* Fixed issue with <cms:bundle> tag not using the default locale as a fallback.
* Fixed issue in cmsshell.sh and setup.sh so that running the scripts outside of WEB-INF is now possible.
* Fixed issue with CodeMirror editor configuration not working for Internet Explorer 11.

OpenCms 9.5.0 - November 3, 2014
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ private void adjustConfigs(CmsModule targetModule, Map<I_CmsResourceType, I_CmsR
List<CmsResource> resources = cms.readResources(
modPath,
CmsResourceFilter.requireType(OpenCms.getResourceManager().getResourceType(
CmsFormatterConfigurationCache.TYPE_FORMATTER_CONFIG).getTypeId()));
CmsFormatterConfigurationCache.TYPE_FORMATTER_CONFIG)));
String source = "<Type><!\\[CDATA\\[" + m_cloneInfo.getSourceNamePrefix();
String target = "<Type><!\\[CDATA\\[" + m_cloneInfo.getTargetNamePrefix();
Function<String, String> replaceType = new ReplaceAll(source, target);
Expand All @@ -368,7 +368,7 @@ private void adjustConfigs(CmsModule targetModule, Map<I_CmsResourceType, I_CmsR
CmsResource config = cms.readResource(
modPath + CmsADEManager.CONFIG_FILE_NAME,
CmsResourceFilter.requireType(OpenCms.getResourceManager().getResourceType(
CmsADEManager.MODULE_CONFIG_TYPE).getTypeId()));
CmsADEManager.MODULE_CONFIG_TYPE)));
Function<String, String> substitution = Functions.identity();
// compose the substitution functions from simple substitution functions for each type

Expand Down Expand Up @@ -462,7 +462,7 @@ private void changeResourceTypes(Map<I_CmsResourceType, I_CmsResourceType> resTy
}

for (Map.Entry<I_CmsResourceType, I_CmsResourceType> mapping : resTypeMap.entrySet()) {
CmsResourceFilter filter = CmsResourceFilter.requireType(mapping.getKey().getTypeId());
CmsResourceFilter filter = CmsResourceFilter.requireType(mapping.getKey());
List<CmsResource> resources = cloneCms.readResources("/", filter);
String sourceSchemaPath = mapping.getKey().getConfiguration().get("schema");
String targetSchemaPath = mapping.getValue().getConfiguration().get("schema");
Expand Down Expand Up @@ -502,7 +502,7 @@ private void cloneExplorerTypeIcons(Map<String, String> iconPaths) throws CmsExc
for (Map.Entry<String, String> entry : iconPaths.entrySet()) {
String source = ICON_PATH + entry.getKey();
String target = ICON_PATH + entry.getValue();
if (!getCms().existsResource(target)) {
if (getCms().existsResource(source) && !getCms().existsResource(target)) {
getCms().copyResource(source, target);
}
}
Expand Down
87 changes: 44 additions & 43 deletions src/org/opencms/xml/A_CmsXmlDocument.java
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,17 @@ public CmsFile correctXmlStructure(CmsObject cms) throws CmsXmlException {
// if it's a multiple choice element, the child elements must not be sorted into their types,
// but must keep their original order
if (isMultipleChoice) {
List<Element> nodeList = new ArrayList<Element>();
List<Element> nodeList = new ArrayList<Element>();
List<Element> elements = CmsXmlGenericWrapper.elements(root);
Set<String> typeNames = cd.getSchemaTypes();
for (Element element : elements) {
// check if the node type is still in the definition
if (typeNames.contains(element.getName())) {
nodeList.add(element);
}
}
Set<String> typeNames = cd.getSchemaTypes();
for (Element element : elements) {
// check if the node type is still in the definition
if (typeNames.contains(element.getName())) {
nodeList.add(element);
}
}
checkMaxOccurs(nodeList, cd.getChoiceMaxOccurs(), cd.getTypeName());
nodeLists.add(nodeList);
nodeLists.add(nodeList);
}
// if it's a sequence, the children are sorted according to the sequence type definition
else {
Expand Down Expand Up @@ -336,40 +336,6 @@ public CmsFile correctXmlStructure(CmsObject cms) throws CmsXmlException {
return m_file;
}

/**
* Removes all nodes that exceed newly defined maxOccurs rules from the list of elements
* @param cd the content type definition
* @param maxOccurs maximum number of elements allowed
* @param typeName name of the element type
*/
private void checkMaxOccurs(List<Element> elements, int maxOccurs, String typeName) {
if (elements.size() > maxOccurs) {
if (typeName.equals(CmsXmlCategoryValue.TYPE_NAME)) {
if (maxOccurs == 1) {
Element category = elements.get(0);
List<Element> categories = new ArrayList<Element>();
for (Element value : elements) {
@SuppressWarnings("unchecked")
Iterator<Element> itLink = value.elementIterator();
while (itLink.hasNext()) {
Element link = itLink.next();
categories.add((Element)link.clone());
}
}
category.clearContent();
for (Element value : categories) {
category.add(value);
}
}
}

// too many nodes of this type appear according to the current schema definition
for (int lo = (elements.size() - 1); lo >= maxOccurs; lo--) {
elements.remove(lo);
}
}
}

/**
* @see org.opencms.xml.I_CmsXmlDocument#getBestMatchingLocale(java.util.Locale)
*/
Expand Down Expand Up @@ -921,6 +887,41 @@ protected I_CmsXmlContentValue removeBookmark(String path, Locale locale) {
return m_bookmarks.remove(getBookmarkName(path, locale));
}

/**
* Removes all nodes that exceed newly defined maxOccurs rules from the list of elements.<p>
*
* @param elements the list of elements to check
* @param maxOccurs maximum number of elements allowed
* @param typeName name of the element type
*/
private void checkMaxOccurs(List<Element> elements, int maxOccurs, String typeName) {

if (elements.size() > maxOccurs) {
if (typeName.equals(CmsXmlCategoryValue.TYPE_NAME)) {
if (maxOccurs == 1) {
Element category = elements.get(0);
List<Element> categories = new ArrayList<Element>();
for (Element value : elements) {
Iterator<Element> itLink = value.elementIterator();
while (itLink.hasNext()) {
Element link = itLink.next();
categories.add((Element)link.clone());
}
}
category.clearContent();
for (Element value : categories) {
category.add(value);
}
}
}

// too many nodes of this type appear according to the current schema definition
for (int lo = (elements.size() - 1); lo >= maxOccurs; lo--) {
elements.remove(lo);
}
}
}

/**
* Creates a partial deep element copy according to the set of element paths.<p>
* Only elements contained in that set will be copied.
Expand Down
Loading

0 comments on commit cc4518a

Please sign in to comment.