Index: modules/org.opencms.workplace/resources/manifest.xml
===================================================================
RCS file: /usr/local/cvs/opencms/modules/org.opencms.workplace/resources/manifest.xml,v
retrieving revision 1.70
diff -u -r1.70 manifest.xml
--- modules/org.opencms.workplace/resources/manifest.xml 14 Jan 2010 14:52:05 -0000 1.70
+++ modules/org.opencms.workplace/resources/manifest.xml 10 Feb 2010 14:30:08 -0000
@@ -16,7 +16,7 @@
This module contains the OpenCms Workplace base files.
It includes common used dialogs and style sheets, that are needed by any workplace module.
(c) 2010 by Alkacon Software GmbH (http://www.alkacon.com).
]]>
- 7.5.2
+ 7.5.2.3
Mon, 27 Jun 2005 08:00:00 GMT
Index: src/org/opencms/workplace/list/CmsListResourceTypeIconAction.java
===================================================================
RCS file: /usr/local/cvs/opencms/src/org/opencms/workplace/list/CmsListResourceTypeIconAction.java,v
retrieving revision 1.8
diff -u -r1.8 CmsListResourceTypeIconAction.java
--- src/org/opencms/workplace/list/CmsListResourceTypeIconAction.java 18 Jan 2010 10:02:15 -0000 1.8
+++ src/org/opencms/workplace/list/CmsListResourceTypeIconAction.java 10 Feb 2010 14:30:09 -0000
@@ -31,7 +31,9 @@
package org.opencms.workplace.list;
+import org.apache.commons.logging.Log;
import org.opencms.i18n.CmsMessageContainer;
+import org.opencms.main.CmsLog;
import org.opencms.main.OpenCms;
import org.opencms.util.CmsStringUtil;
import org.opencms.workplace.CmsWorkplace;
@@ -49,6 +51,9 @@
*/
public class CmsListResourceTypeIconAction extends CmsListExplorerDirectAction {
+ /** The log object for this class. */
+ private static final Log LOG = CmsLog.getLog(CmsListResourceTypeIconAction.class);
+
/**
* Default Constructor.
*
@@ -148,7 +153,7 @@
html.append(name);
html.append("'");
html.append(" style='display: block; width: 20px; height: 20px;'>");
- if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(iconPath)) {
+ if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(iconPath) && hasFileExtension(iconPath)) {
html.append("
*
@@ -432,7 +441,11 @@
}
}
}
-
+
+ if (getResourcetypeIds() != null) {
+ resources = filterResourceTypes(resources);
+ }
+
// now output all the tree nodes
Iterator i = resources.iterator();
while (i.hasNext()) {
@@ -449,7 +462,7 @@
grey = true;
}
}
-
+
result.append(getNode(
resource.getRootPath(),
resource.getName(),
@@ -501,6 +514,10 @@
}
}
+ if (getResourcetypeIds() != null) {
+ result.append("parent.setResourcetypeIds('").append(getResourcetypeIds()).append("');\n");
+ }
+
result.append("}\n");
} finally {
if (storedSiteRoot != null) {
@@ -582,6 +599,7 @@
boolean rootloaded = Boolean.valueOf(request.getParameter(PARAM_ROOTLOADED)).booleanValue();
String resource = request.getParameter(PARAM_RESOURCE);
+ setResourcetypeIds(request.getParameter(PARAM_RESOURCETYPE_IDS));
setTreeType(request.getParameter(PARAM_TYPE));
String treeSite = request.getParameter(PARAM_TREESITE);
if ((getTreeType() != null) && (treeSite != null)) {
@@ -824,7 +842,7 @@
* @return error information output
*/
private String printError(Throwable t) {
-
+ LOG.error(t.getMessage(), t);
StringBuffer result = new StringBuffer(1024);
result.append("/*\n");
result.append(CmsStringUtil.escapeHtml(t.getMessage()));
@@ -893,4 +911,64 @@
m_treeType = type;
}
+
+ /**
+ * Sets the resource types to accept.
+ *
+ * @param resourcetypeIds the resource types to accept (delimited list)
+ */
+ public void setResourcetypeIds(String resourcetypeIds) {
+
+ m_resourcetypeIds = resourcetypeIds;
+ }
+
+ /**
+ * Returns the resource types to accept.
+ *
+ * @return resource types to accept
+ */
+ public String getResourcetypeIds() {
+
+ return m_resourcetypeIds;
+ }
+
+
+ /**
+ * Filters the restricted resources types.
+ * @param resources All Resources
+ * @return filtered resources.
+ */
+ private List filterResourceTypes(List resources) {
+ List result = new ArrayList();
+
+ for (CmsResource cmsResource : resources) {
+ if (getResourcetypeIdsAsList().contains(Integer.valueOf(cmsResource.getTypeId()))) {
+ result.add(cmsResource);
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * @return
+ */
+ private List getResourcetypeIdsAsList() {
+
+ List result = new ArrayList();
+ //always show folder
+ result.add(Integer.valueOf(0));
+
+ String[] splitedIdsAsString = CmsStringUtil.splitAsArray(m_resourcetypeIds, PARAM_RESOURCETYPE_IDS_DELIMITER);
+ for (int i = 0; i < splitedIdsAsString.length; i++) {
+ String idString = splitedIdsAsString[i];
+ try {
+ result.add(Integer.valueOf(idString.trim()));
+ } catch (NumberFormatException e) {
+ LOG.error("The resourcTypeIds '" + m_resourcetypeIds + "' contains invalid characters: " + e.getMessage());
+ }
+ }
+
+ return result;
+ }
}
\ No newline at end of file
Index: src/org/opencms/workplace/CmsWidgetDialog.java
===================================================================
RCS file: /usr/local/cvs/opencms/src/org/opencms/workplace/CmsWidgetDialog.java,v
retrieving revision 1.73
diff -u -r1.73 CmsWidgetDialog.java
--- src/org/opencms/workplace/CmsWidgetDialog.java 18 Jan 2010 10:03:37 -0000 1.73
+++ src/org/opencms/workplace/CmsWidgetDialog.java 10 Feb 2010 14:30:09 -0000
@@ -238,7 +238,7 @@
href.append(elementName);
href.append("', ");
href.append(insertAfter);
- href.append(");");
+ href.append(",[]);");
return button(href.toString(), null, "new.png", Messages.GUI_DIALOG_BUTTON_ADDNEW_0, 0);
} else {
return "";
Index: src/org/opencms/workplace/CmsWorkplace.java
===================================================================
RCS file: /usr/local/cvs/opencms/src/org/opencms/workplace/CmsWorkplace.java,v
retrieving revision 1.180
diff -u -r1.180 CmsWorkplace.java
--- src/org/opencms/workplace/CmsWorkplace.java 18 Jan 2010 10:03:36 -0000 1.180
+++ src/org/opencms/workplace/CmsWorkplace.java 10 Feb 2010 14:30:09 -0000
@@ -748,7 +748,7 @@
String anchorStart = " don't jump to the Top of the page.
}
result.append("");
Index: build.xml
===================================================================
RCS file: /usr/local/cvs/opencms/build.xml,v
retrieving revision 1.225
diff -u -r1.225 build.xml
--- build.xml 19 Jan 2010 10:39:16 -0000 1.225
+++ build.xml 10 Feb 2010 14:30:07 -0000
@@ -1,8 +1,8 @@
-
+
-
+
@@ -54,6 +54,8 @@
+
+
@@ -64,6 +66,13 @@
+
+
+
+
+
+
+
@@ -212,6 +221,13 @@
includes="org/opencms/**" >
+
+
+
+
+
+
+
@@ -342,7 +358,17 @@
-
+
+
+
+
+
+
@@ -436,7 +462,7 @@
-
+
@@ -523,7 +549,6 @@
-
@@ -561,7 +586,14 @@
jarfile="${opencms.output.jars}/opencms-setup.jar"
basedir="${opencms.output}/build/setup"
includes="org/opencms/**" />
-
+
+
+
+
+
+
+
+
@@ -658,6 +690,184 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: src/org/opencms/xml/CmsXmlComplexTypeSequence.java
===================================================================
RCS file: /usr/local/cvs/opencms/src/org/opencms/xml/CmsXmlComplexTypeSequence.java,v
retrieving revision 1.8
diff -u -r1.8 CmsXmlComplexTypeSequence.java
--- src/org/opencms/xml/CmsXmlComplexTypeSequence.java 18 Jan 2010 10:04:10 -0000 1.8
+++ src/org/opencms/xml/CmsXmlComplexTypeSequence.java 10 Feb 2010 14:30:09 -0000
@@ -55,18 +55,23 @@
/** The type sequence elements. */
private List m_sequence;
+ /** Returns true if this sequence is created from a {@link CmsXmlContentDefinition#XSD_NODE_CHOICE}-Element. */
+ protected boolean m_isChoiceSequence;
+
/**
* Creates a new complex type sequence data structure.
*
* @param name the name of the sequence
* @param sequence the type sequence element list
* @param hasLanguageAttribute indicates if a "language" attribute is present
+ * @param isChoiceSequence the type choice element list
*/
- protected CmsXmlComplexTypeSequence(String name, List sequence, boolean hasLanguageAttribute) {
+ protected CmsXmlComplexTypeSequence(String name, List sequence, boolean hasLanguageAttribute, boolean isChoiceSequence) {
m_name = name;
m_sequence = sequence;
m_hasLanguageAttribute = hasLanguageAttribute;
+ m_isChoiceSequence = isChoiceSequence;
}
/**
Index: src/org/opencms/xml/CmsXmlContentTypeManager.java
===================================================================
RCS file: /usr/local/cvs/opencms/src/org/opencms/xml/CmsXmlContentTypeManager.java,v
retrieving revision 1.39
diff -u -r1.39 CmsXmlContentTypeManager.java
--- src/org/opencms/xml/CmsXmlContentTypeManager.java 18 Jan 2010 10:04:11 -0000 1.39
+++ src/org/opencms/xml/CmsXmlContentTypeManager.java 10 Feb 2010 14:30:09 -0000
@@ -324,15 +324,19 @@
* Generates an initialized instance of a XML content type definition
* from the given XML schema element.
*
- * @param typeElement the element to generate the XML content type definition from
- * @param nestedDefinitions the nested (included) XML content sub-definitions
+ * @param typeElement
+ * The element to generate the XML content type definition from
+ * @param nestedDefinitions
+ * The nested (included) XML content sub-definitions
+ * @param isChoice
+ * true if this node is an element of a Choice XSD element.
+ * In this case the maxOccurs is always handled as "1" and minOccurs is always handled as "0".
*
* @return an initialized instance of a XML content type definition
* @throws CmsXmlException in case the element does not describe a valid XML content type definition
*/
- public I_CmsXmlSchemaType getContentType(Element typeElement, Set nestedDefinitions)
+ public I_CmsXmlSchemaType getContentType(Element typeElement, Set nestedDefinitions, boolean isChoice)
throws CmsXmlException {
-
if (!CmsXmlContentDefinition.XSD_NODE_ELEMENT.equals(typeElement.getQName())) {
throw new CmsXmlException(Messages.get().container(Messages.ERR_INVALID_CD_SCHEMA_STRUCTURE_0));
}
@@ -345,7 +349,12 @@
String defaultValue = typeElement.attributeValue(CmsXmlContentDefinition.XSD_ATTRIBUTE_DEFAULT);
String maxOccrs = typeElement.attributeValue(CmsXmlContentDefinition.XSD_ATTRIBUTE_MAX_OCCURS);
String minOccrs = typeElement.attributeValue(CmsXmlContentDefinition.XSD_ATTRIBUTE_MIN_OCCURS);
-
+ // a schemyType inside a Choice-ContentDefinition can only occurred one time.
+ if (isChoice) {
+ minOccrs = CmsXmlContentDefinition.XSD_ATTRIBUTE_VALUE_ZERO;
+ maxOccrs = "1";
+ }
+
if (CmsStringUtil.isEmpty(elementName) || CmsStringUtil.isEmpty(typeName)) {
throw new CmsXmlException(Messages.get().container(Messages.ERR_INVALID_CD_SCHEMA_STRUCTURE_0));
}
@@ -362,7 +371,14 @@
if (typeName.equals(cd.getTypeName())) {
simpleType = false;
- return new CmsXmlNestedContentDefinition(cd, elementName, minOccrs, maxOccrs);
+ if (cd.isChoiceType()) {
+ // A Choice Element itself is always optional.
+ // the initial XML content (create new resource) can not be automatically generated if minOccurs > 0
+ // the editor must choose the sub element!
+ return new CmsXmlNestedContentDefinition(cd, elementName, CmsXmlContentDefinition.XSD_ATTRIBUTE_VALUE_ZERO, maxOccrs);
+ } else {
+ return new CmsXmlNestedContentDefinition(cd, elementName, minOccrs, maxOccrs);
+ }
}
}
Index: src/org/opencms/xml/CmsXmlContentDefinition.java
===================================================================
RCS file: /usr/local/cvs/opencms/src/org/opencms/xml/CmsXmlContentDefinition.java,v
retrieving revision 1.47
diff -u -r1.47 CmsXmlContentDefinition.java
--- src/org/opencms/xml/CmsXmlContentDefinition.java 18 Jan 2010 10:04:12 -0000 1.47
+++ src/org/opencms/xml/CmsXmlContentDefinition.java 10 Feb 2010 14:30:09 -0000
@@ -146,6 +146,9 @@
/** Constant for the "sequence" node in the XML schema namespace. */
public static final QName XSD_NODE_SEQUENCE = QName.get("sequence", XSD_NAMESPACE);
+ /** Constant for the "choice" node in the XML schema namespace. */
+ public static final QName XSD_NODE_CHOICE = QName.get("choice", XSD_NAMESPACE);
+
/** The XML content handler. */
private I_CmsXmlContentHandler m_contentHandler;
@@ -158,6 +161,9 @@
/** The outer element name of the content definition (language sequence). */
private String m_outerName;
+ /** Returns true if this sequence is created from a {@link #XSD_NODE_CHOICE}-Element. */
+ private boolean m_isChoiceSequence;
+
/** The location from which the XML schema was read (XML system id). */
private String m_schemaLocation;
@@ -523,15 +529,21 @@
// no error: then the language attribute is valid
hasLanguageAttribute = true;
}
-
+
+ boolean isChoice = false;
+
// check the main element type sequence
Element typeSequence = mainElements.get(0);
if (!XSD_NODE_SEQUENCE.equals(typeSequence.getQName())) {
+ if (!XSD_NODE_CHOICE.equals(typeSequence.getQName())) {
throw new CmsXmlException(Messages.get().container(
Messages.ERR_CD_ELEMENT_NAME_3,
typeSequence.getUniquePath(),
XSD_NODE_SEQUENCE.getQualifiedName(),
typeSequence.getQName().getQualifiedName()));
+ } else {
+ isChoice = true;
+ }
}
// check the type definition sequence
@@ -553,7 +565,7 @@
CmsXmlContentTypeManager typeManager = OpenCms.getXmlContentTypeManager();
Iterator i = typeSequenceElements.iterator();
while (i.hasNext()) {
- sequence.add(typeManager.getContentType(i.next(), includes));
+ sequence.add(typeManager.getContentType((Element)i.next(), includes, isChoice));
}
} else {
// generate a nested content definition for the main type sequence
@@ -569,7 +581,7 @@
}
// return a data structure with the collected values
- return new CmsXmlComplexTypeSequence(name, sequence, hasLanguageAttribute);
+ return new CmsXmlComplexTypeSequence(name, sequence, hasLanguageAttribute, isChoice);
}
/**
@@ -704,8 +716,8 @@
result.setInnerName(outer.getName());
// get the inner element sequence, this must be the second element
- CmsXmlComplexTypeSequence innerSequence = complexTypeData.get(1);
-
+ CmsXmlComplexTypeSequence innerSequence = (CmsXmlComplexTypeSequence)complexTypeData.get(1);
+ result.m_isChoiceSequence =innerSequence.m_isChoiceSequence;
// add the types from the main sequence node
Iterator it = innerSequence.getSequence().iterator();
while (it.hasNext()) {
@@ -852,6 +864,7 @@
result.m_contentHandler = m_contentHandler;
result.m_typeName = m_typeName;
result.m_includes = m_includes;
+ result.m_isChoiceSequence = m_isChoiceSequence;
return result;
}
@@ -1174,4 +1187,16 @@
m_outerName = outerName;
}
+
+
+ /**
+ * Returns true if this sequence is created from a {@link #XSD_NODE_CHOICE}-Element.
+ *
+ * @return true if this sequence is created from a {@link #XSD_NODE_CHOICE}-Element.
+ *
+ * @see CmsXmlNestedContentDefinition
+ */
+ public boolean isChoiceType() {
+ return m_isChoiceSequence;
+ }
}
\ No newline at end of file
Index: modules/org.opencms.workplace/resources/system/workplace/resources/components/widgets/fileselector.js
===================================================================
RCS file: /usr/local/cvs/opencms/modules/org.opencms.workplace/resources/system/workplace/resources/components/widgets/fileselector.js,v
retrieving revision 1.12
diff -u -r1.12 fileselector.js
--- modules/org.opencms.workplace/resources/system/workplace/resources/components/widgets/fileselector.js 5 Jun 2009 13:31:35 -0000 1.12
+++ modules/org.opencms.workplace/resources/system/workplace/resources/components/widgets/fileselector.js 10 Feb 2010 14:30:08 -0000
@@ -43,7 +43,7 @@
var treeField = null;
var treeDoc = null;
-function openTreeWin(formName, fieldName, curDoc, showSiteSelector, startSite, includeFiles, projectAware) {
+function openTreeWin(formName, fieldName, curDoc, showSiteSelector, startSite, includeFiles, projectAware, resourcetypeIds) {
if (includeFiles == null) {
includeFiles = true;
@@ -65,6 +65,10 @@
paramString += "&treesite=";
paramString += startSite;
}
+
+ if (resourcetypeIds != null) {
+ paramString += "&resourcetypeIds="+ resourcetypeIds;
+ }
treewin = openWin(vr.contextPath + vr.workplacePath + "views/explorer/tree_fs.jsp" + paramString, "opencms", 300, 450);
treeForm = formName;
Index: modules/build.xml
===================================================================
RCS file: /usr/local/cvs/opencms/modules/build.xml,v
retrieving revision 1.20
diff -u -r1.20 build.xml
--- modules/build.xml 8 Jun 2009 10:01:17 -0000 1.20
+++ modules/build.xml 10 Feb 2010 14:30:07 -0000
@@ -274,5 +274,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: modules/build-single.xml
===================================================================
RCS file: /usr/local/cvs/opencms/modules/build-single.xml,v
retrieving revision 1.37
diff -u -r1.37 build-single.xml
--- modules/build-single.xml 28 Sep 2009 15:34:29 -0000 1.37
+++ modules/build-single.xml 10 Feb 2010 14:30:07 -0000
@@ -1,6 +1,6 @@
-
+
@@ -30,6 +30,13 @@
+
+
+
+
+
+
+
@@ -306,14 +313,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -350,6 +372,15 @@
+
+
+
+
+
+
+
+
+
@@ -383,6 +414,13 @@
+
+
+
+
+
+
+
@@ -400,7 +438,7 @@
-
+
@@ -469,4 +507,152 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: modules/org.opencms.workplace.explorer/resources/manifest.xml
===================================================================
RCS file: /usr/local/cvs/opencms/modules/org.opencms.workplace.explorer/resources/manifest.xml,v
retrieving revision 1.56
diff -u -r1.56 manifest.xml
--- modules/org.opencms.workplace.explorer/resources/manifest.xml 20 Jan 2010 10:37:22 -0000 1.56
+++ modules/org.opencms.workplace.explorer/resources/manifest.xml 10 Feb 2010 14:30:08 -0000
@@ -16,7 +16,7 @@
This module contains the OpenCms Workplace Explorer.
Install this module if you want a GUI to work on the OpenCms VFS.
(c) 2008 by Alkacon Software GmbH (http://www.alkacon.com). ]]>
- 7.5.2
+ 7.5.2.3
Mon, 27 Jun 2005 08:00:00 GMT
Index: src-setup/org/opencms/setup/CmsSetupBean.java
===================================================================
RCS file: /usr/local/cvs/opencms/src-setup/org/opencms/setup/CmsSetupBean.java,v
retrieving revision 1.13
diff -u -r1.13 CmsSetupBean.java
--- src-setup/org/opencms/setup/CmsSetupBean.java 18 Jan 2010 10:02:59 -0000 1.13
+++ src-setup/org/opencms/setup/CmsSetupBean.java 10 Feb 2010 14:30:08 -0000
@@ -1909,6 +1909,11 @@
// initialize the database name with the app name
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(request.getContextPath())) {
dbName = request.getContextPath().substring(1);
+ // transform Maven default finalName "${artifactId}-${version}.war"
+ // e.g.: "opencms-demo-7.5.2" -> "opencms_demo_7_5_2"
+ // reason: e.g.: MySql cannot have '-', '.' in Database-Name.
+ dbName = dbName.replace('-', '_');
+ dbName = dbName.replace('.', '_');
}
if (provider.equals(ORACLE_PROVIDER)
|| provider.equals(POSTGRESQL_PROVIDER)
Index: modules/org.opencms.editors/resources/system/workplace/editors/xmlcontent/editor_form.jsp
===================================================================
RCS file: /usr/local/cvs/opencms/modules/org.opencms.editors/resources/system/workplace/editors/xmlcontent/editor_form.jsp,v
retrieving revision 1.15
diff -u -r1.15 editor_form.jsp
--- modules/org.opencms.editors/resources/system/workplace/editors/xmlcontent/editor_form.jsp 9 Jun 2009 12:21:36 -0000 1.15
+++ modules/org.opencms.editors/resources/system/workplace/editors/xmlcontent/editor_form.jsp 10 Feb 2010 14:30:07 -0000
@@ -298,9 +298,42 @@
//-->
+
+
+
+
+
|