Merged V3.2 to HEAD

17201: Fix for ETHREEOH-1786: Time fields are displayed incorrectly
   17202: Fix for ETHREEOH-1886: alf:hint tag in XSDs results in error
   17204: Fix for ETHREEOH-1941: gMonth element is not correctly handled on creating web content based on web form process
   17206: Fixed ETHREEOH-1134 "Incorrect behavior of tab indexes for windows"
   17212: Fixed ETHREEOH-3063 "It is impossible to add tags after creating duplicate wiki page"
   17214: Fix for ETHREEOH-1940: Problem with creating web forms containing mandatory boolean attributes with default values
   17226: Fixed ETHREEOH-3105 "Error occurs when user add tag containing disallowed symbols."
   17228: ETHREEOH-3181 - Tag inconsistence between JSF and Share client
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /alfresco/BRANCHES/V3.2:r17201-17204,17206-17207,17211-17216,17219-17228


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18025 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2010-01-14 13:06:47 +00:00
parent ae4836d0dd
commit f56da7800c
7 changed files with 128 additions and 9 deletions

View File

@@ -956,9 +956,15 @@ public class Schema2XForms implements Serializable
" at " + newPathToRoot); " at " + newPathToRoot);
try try
{ {
final String defaultValue = (currentAttributeUse.getConstraintType() == XSConstants.VC_NONE String defaultValue = (currentAttributeUse.getConstraintType() == XSConstants.VC_NONE
? null ? null
: currentAttributeUse.getConstraintValue()); : currentAttributeUse.getConstraintValue());
// make sure boolean attributes have a default value
if (defaultValue == null && "boolean".equals(currentAttribute.getTypeDefinition().getName()))
{
defaultValue = "false";
}
if (namespacePrefix.length() > 0) if (namespacePrefix.length() > 0)
{ {
defaultInstanceElement.setAttributeNS(this.targetNamespace, defaultInstanceElement.setAttributeNS(this.targetNamespace,
@@ -1714,6 +1720,12 @@ public class Schema2XForms implements Serializable
Node value = xformsDocument.createTextNode(element.getConstraintValue()); Node value = xformsDocument.createTextNode(element.getConstraintValue());
newDefaultInstanceElement.appendChild(value); newDefaultInstanceElement.appendChild(value);
} }
else if ("boolean".equals(element.getTypeDefinition().getName()))
{
// we have a boolean element without a default value, default to false
Node value = xformsDocument.createTextNode("false");
newDefaultInstanceElement.appendChild(value);
}
this.addElement(xformsDocument, this.addElement(xformsDocument,
modelSection, modelSection,

View File

@@ -396,7 +396,7 @@ public class DatePickerRenderer extends BaseRenderer
if (showTime) if (showTime)
{ {
out.write(" type='text' size='1' maxlength='2'"); out.write(" type='text' size='2' maxlength='2'");
if (component.getAttributes().get("disabled") != null) if (component.getAttributes().get("disabled") != null)
{ {

View File

@@ -0,0 +1,38 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:alf="http://www.alfresco.org"
targetNamespace="http://www.alfresco.org"
elementFormDefault="qualified">
<xs:element name="simple">
<xs:complexType>
<xs:sequence>
<!-- Test an empty hint -->
<xs:element name="no-hint" type="xs:normalizedString">
<xs:annotation>
<xs:appinfo>
<alf:hint></alf:hint>
</xs:appinfo>
</xs:annotation>
</xs:element>
<!-- Test an empty alert -->
<xs:element name="no-alert" type="xs:normalizedString" minOccurs="1">
<xs:annotation>
<xs:appinfo>
<alf:hint>This control does not have an overridden alert</alf:hint>
<alf:alert></alf:alert>
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="hint-alert" type="xs:normalizedString" minOccurs="1">
<xs:annotation>
<xs:appinfo>
<alf:alert>Please enter a value for hint-alert</alf:alert>
<alf:hint>This control should have a hint.</alf:hint>
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="upload-simple">
<xs:complexType>
<xs:sequence>
<xs:element name="boolean_with_default_false" type="xs:boolean" default="false"/>
<xs:element name="file_from_element" type="xs:boolean" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="boolean_with_default_true" type="xs:boolean" default="true"/>
</xs:sequence>
<xs:attribute name="file_from_attribute" type="xs:boolean" use="required"/>
<xs:attribute name="file_from_attribute_fixed" type="xs:boolean" use="required" fixed="true"/>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="gMonth">
<xs:complexType>
<xs:sequence>
<xs:element name="string_with_default" type="xs:gMonth" default="--03"/>
<xs:element name="file_from_element" type="xs:gMonth" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="file_from_element_with_default" type="xs:gMonth" default="--04"/>
<xs:element name="year-month" type="xs:gYearMonth" />
<xs:element name="month-day" type="xs:gMonthDay" />
</xs:sequence>
<xs:attribute name="file_from_attribute" type="xs:gMonth" use="required"/>
<xs:attribute name="file_from_attribute_fixed" type="xs:gMonth" use="required" fixed="--05"/>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@@ -78,7 +78,10 @@ var AlfTagger = new Class(
// Add click event handlers for the add and cancel buttons // Add click event handlers for the add and cancel buttons
$(this.id + "-addTag-ok").addEvent("click", function() $(this.id + "-addTag-ok").addEvent("click", function()
{ {
this.addTag($(this.id + "-addTag-box").value); if (this.validateTagBox())
{
this.addTag($(this.id + "-addTag-box").value);
}
}.bind(this)); }.bind(this));
$(this.id + "-addTag-cancel").addEvent("click", function() $(this.id + "-addTag-cancel").addEvent("click", function()
@@ -110,15 +113,28 @@ var AlfTagger = new Class(
{ {
e.stop(); e.stop();
} }
} };
// Add validation of tagName and cancel enter keys
$(this.id + "-addTag-box").addEvents( $(this.id + "-addTag-box").addEvents(
{ {
"keyup": fnEnterStop, "keyup": function(e)
{
var addTagOk = $(this.id + "-addTag-ok")
if (!this.validateTagBox())
{
addTagOk.setStyle("opacity", 0.5);
}
else
{
addTagOk.setStyle("opacity", 1);
}
fnEnterStop(e);
}.bind(this),
"keypress": fnEnterStop "keypress": fnEnterStop
}); });
}, },
setDefaultIcon: function(icon) setDefaultIcon: function(icon)
{ {
this.defaultIcon = icon; this.defaultIcon = icon;
@@ -585,5 +601,11 @@ var AlfTagger = new Class(
{ {
} }
}).request(); }).request();
},
validateTagBox: function()
{
var tagBox = $(this.id + "-addTag-box");
return tagBox && tagBox.value && tagBox.value.length > 0 && validateName(tagBox);
} }
}); });

View File

@@ -412,7 +412,7 @@ alfresco.xforms.Widget = new Class({
/** Returns the widget's label. */ /** Returns the widget's label. */
getLabel: function() getLabel: function()
{ {
var result = ""; var result = "";
var node = this._getChildXFormsNode("label"); var node = this._getChildXFormsNode("label");
if (node && node.firstChild !== null) if (node && node.firstChild !== null)
@@ -430,15 +430,29 @@ alfresco.xforms.Widget = new Class({
/** Returns the widget's alert text. */ /** Returns the widget's alert text. */
getAlert: function() getAlert: function()
{ {
var result = "";
var node = this._getChildXFormsNode("alert"); var node = this._getChildXFormsNode("alert");
return node ? node.firstChild.nodeValue : "";
if (node && node.firstChild !== null)
{
result = node.firstChild.nodeValue;
}
return result;
}, },
/** Returns the widget's alert text. */ /** Returns the widget's alert text. */
getHint: function() getHint: function()
{ {
var result = null;
var node = this._getChildXFormsNode("hint"); var node = this._getChildXFormsNode("hint");
return node ? node.firstChild.nodeValue : null;
if (node && node.firstChild !== null)
{
result = node.firstChild.nodeValue;
}
return result;
}, },
/** Makes the label red. */ /** Makes the label red. */
@@ -2310,6 +2324,7 @@ alfresco.xforms.MonthPicker = alfresco.xforms.ComboboxSelect1.extend({
initialize: function(xform, xformsNode) initialize: function(xform, xformsNode)
{ {
this.parent(xform, xformsNode); this.parent(xform, xformsNode);
dojo.require("dojo.date.format");
}, },
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////