mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
- adding support for alerts
- allowing overriding of label and specification of alert using xs:appinfo and inner alfresco:label, alfresco:alert tags. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4027 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
|||||||
<jsp:root version="1.2"
|
<jsp:root version="1.2"
|
||||||
xmlns:jsp="http://java.sun.com/JSP/Page"
|
xmlns:jsp="http://java.sun.com/JSP/Page"
|
||||||
|
xmlns:alfresco="http://www.alfresco.org/alfresco"
|
||||||
xmlns:c="http://java.sun.com/jsp/jstl/core"
|
xmlns:c="http://java.sun.com/jsp/jstl/core"
|
||||||
xmlns:pr="http://www.alfresco.org/pr">
|
xmlns:pr="http://www.alfresco.org/pr">
|
||||||
<jsp:directive.page language="java" contentType="text/html; charset=UTF-8"/>
|
<jsp:directive.page language="java" contentType="text/html; charset=UTF-8"/>
|
||||||
@@ -13,7 +14,9 @@
|
|||||||
<jsp:attribute name="value"><c:out value="${companyFooter.href}"/></jsp:attribute>
|
<jsp:attribute name="value"><c:out value="${companyFooter.href}"/></jsp:attribute>
|
||||||
<jsp:body>
|
<jsp:body>
|
||||||
<xs:annotation>
|
<xs:annotation>
|
||||||
<xs:documentation><c:out value="${companyFooter.name}"/></xs:documentation>
|
<xs:appinfo>
|
||||||
|
<alfresco:label><c:out value="${companyFooter.name}"/></alfresco:label>
|
||||||
|
</xs:appinfo>
|
||||||
</xs:annotation>
|
</xs:annotation>
|
||||||
</jsp:body>
|
</jsp:body>
|
||||||
</jsp:element>
|
</jsp:element>
|
||||||
|
@@ -1,13 +1,44 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
|
xmlns:alfresco="http://www.alfresco.org/alfresco"
|
||||||
elementFormDefault="qualified">
|
elementFormDefault="qualified">
|
||||||
<xs:simpleType name="five_string_values">
|
<xs:simpleType name="five_string_values">
|
||||||
<xs:restriction base="xs:string">
|
<xs:restriction base="xs:string">
|
||||||
<xs:enumeration value="one"/>
|
<xs:enumeration value="one">
|
||||||
<xs:enumeration value="two"/>
|
<xs:annotation>
|
||||||
<xs:enumeration value="three"/>
|
<xs:appinfo>
|
||||||
<xs:enumeration value="four"/>
|
<alfresco:label>1 - eno</alfresco:label>
|
||||||
<xs:enumeration value="five"/>
|
</xs:appinfo>
|
||||||
|
</xs:annotation>
|
||||||
|
</xs:enumeration>
|
||||||
|
<xs:enumeration value="two">
|
||||||
|
<xs:annotation>
|
||||||
|
<xs:appinfo>
|
||||||
|
<alfresco:label>2 - owt</alfresco:label>
|
||||||
|
</xs:appinfo>
|
||||||
|
</xs:annotation>
|
||||||
|
</xs:enumeration>
|
||||||
|
<xs:enumeration value="three">
|
||||||
|
<xs:annotation>
|
||||||
|
<xs:appinfo>
|
||||||
|
<alfresco:label>3 - eerht</alfresco:label>
|
||||||
|
</xs:appinfo>
|
||||||
|
</xs:annotation>
|
||||||
|
</xs:enumeration>
|
||||||
|
<xs:enumeration value="four">
|
||||||
|
<xs:annotation>
|
||||||
|
<xs:appinfo>
|
||||||
|
<alfresco:label>4 - ruof</alfresco:label>
|
||||||
|
</xs:appinfo>
|
||||||
|
</xs:annotation>
|
||||||
|
</xs:enumeration>
|
||||||
|
<xs:enumeration value="five">
|
||||||
|
<xs:annotation>
|
||||||
|
<xs:appinfo>
|
||||||
|
<alfresco:label>5 - evif</alfresco:label>
|
||||||
|
</xs:appinfo>
|
||||||
|
</xs:annotation>
|
||||||
|
</xs:enumeration>
|
||||||
</xs:restriction>
|
</xs:restriction>
|
||||||
</xs:simpleType>
|
</xs:simpleType>
|
||||||
<xs:simpleType name="ten_string_values">
|
<xs:simpleType name="ten_string_values">
|
||||||
@@ -38,7 +69,14 @@
|
|||||||
<xs:element name="components">
|
<xs:element name="components">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="required_textfield" type="xs:string" minOccurs="1" maxOccurs="1"/>
|
<xs:element name="required_textfield" type="xs:string" minOccurs="1" maxOccurs="1">
|
||||||
|
<xs:annotation>
|
||||||
|
<xs:appinfo>
|
||||||
|
<alfresco:label>A Required String</alfresco:label>
|
||||||
|
<alfresco:alert>Please enter a non zero length string</alfresco:alert>
|
||||||
|
</xs:appinfo>
|
||||||
|
</xs:annotation>
|
||||||
|
</xs:element>
|
||||||
<xs:element name="optional_textfield" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
<xs:element name="optional_textfield" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
||||||
<xs:element name="prefilled_textfield" type="xs:string" minOccurs="0" maxOccurs="1" default="i am the default value"/>
|
<xs:element name="prefilled_textfield" type="xs:string" minOccurs="0" maxOccurs="1" default="i am the default value"/>
|
||||||
<xs:element name="integer" type="xs:integer"/>
|
<xs:element name="integer" type="xs:integer"/>
|
||||||
@@ -49,7 +87,14 @@
|
|||||||
<xs:element name="combobox" type="ten_string_values"/>
|
<xs:element name="combobox" type="ten_string_values"/>
|
||||||
<xs:element name="list_of_five" type="five_number_list"/>
|
<xs:element name="list_of_five" type="five_number_list"/>
|
||||||
<xs:element name="list_of_ten" type="ten_number_list"/>
|
<xs:element name="list_of_ten" type="ten_number_list"/>
|
||||||
<xs:element name="list_of_ten_select_three" type="ten_number_list_select_three"/>
|
<xs:element name="list_of_ten_select_three" type="ten_number_list_select_three">
|
||||||
|
<xs:annotation>
|
||||||
|
<xs:appinfo>
|
||||||
|
<alfresco:label>10 select 3</alfresco:label>
|
||||||
|
<alfresco:alert>Please select at least 3 items from the list.</alfresco:alert>
|
||||||
|
</xs:appinfo>
|
||||||
|
</xs:annotation>
|
||||||
|
</xs:element>
|
||||||
<xs:element name="textarea" type="xs:anyType"/>
|
<xs:element name="textarea" type="xs:anyType"/>
|
||||||
<xs:element name="checkbox_default_true" type="xs:boolean" default="true"/>
|
<xs:element name="checkbox_default_true" type="xs:boolean" default="true"/>
|
||||||
<xs:element name="checkbox_default_false" type="xs:boolean" default="false"/>
|
<xs:element name="checkbox_default_false" type="xs:boolean" default="false"/>
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
<xs:element name="one-to-inf" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
|
<xs:element name="one-to-inf" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
|
||||||
<xs:element name="zero-to-inf" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
|
<xs:element name="zero-to-inf" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
|
||||||
<xs:element name="one-to-five" type="xs:string" minOccurs="1" maxOccurs="5"/>
|
<xs:element name="one-to-five" type="xs:string" minOccurs="1" maxOccurs="5"/>
|
||||||
|
<xs:element name="three-to-five" type="xs:string" minOccurs="3" maxOccurs="5"/>
|
||||||
<xs:element name="zero-to-five" type="xs:string" minOccurs="0" maxOccurs="5"/>
|
<xs:element name="zero-to-five" type="xs:string" minOccurs="0" maxOccurs="5"/>
|
||||||
<xs:element name="one-to-five-multi" type="multi-input" minOccurs="1" maxOccurs="5"/>
|
<xs:element name="one-to-five-multi" type="multi-input" minOccurs="1" maxOccurs="5"/>
|
||||||
<xs:element name="zero-to-five-multi" type="multi-input" minOccurs="0" maxOccurs="5"/>
|
<xs:element name="zero-to-five-multi" type="multi-input" minOccurs="0" maxOccurs="5"/>
|
||||||
|
@@ -122,11 +122,28 @@ dojo.declare("alfresco.xforms.Widget",
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
_getAlertNode: function()
|
||||||
|
{
|
||||||
|
var labels = this.node.getElementsByTagName("alert");
|
||||||
|
for (var i = 0; i < labels.length; i++)
|
||||||
|
{
|
||||||
|
dojo.debug("parent " + labels[i].parentNode.nodeName +
|
||||||
|
" o " + this.node.nodeName);
|
||||||
|
if (labels[i].parentNode == this.node)
|
||||||
|
return labels[i];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
getLabel: function()
|
getLabel: function()
|
||||||
{
|
{
|
||||||
var node = this._getLabelNode();
|
var node = this._getLabelNode();
|
||||||
return node ? dojo.dom.textContent(node) : "";
|
return node ? dojo.dom.textContent(node) : "";
|
||||||
},
|
},
|
||||||
|
getAlert: function()
|
||||||
|
{
|
||||||
|
var node = this._getAlertNode();
|
||||||
|
return node ? dojo.dom.textContent(node) : "";
|
||||||
|
},
|
||||||
_updateDisplay: function()
|
_updateDisplay: function()
|
||||||
{
|
{
|
||||||
// this.domContainer.style.backgroundColor =
|
// this.domContainer.style.backgroundColor =
|
||||||
@@ -1206,7 +1223,7 @@ dojo.declare("alfresco.xforms.XForm",
|
|||||||
msg += "<br/><ul>";
|
msg += "<br/><ul>";
|
||||||
for (var j = 0; j < invalid.length; j++)
|
for (var j = 0; j < invalid.length; j++)
|
||||||
{
|
{
|
||||||
msg += "<li>" + invalid[j].getLabel() + "</li>";
|
msg += "<li>" + invalid[j].getAlert() + "</li>";
|
||||||
}
|
}
|
||||||
msg += "</ul>";
|
msg += "</ul>";
|
||||||
_show_error(msg);
|
_show_error(msg);
|
||||||
|
Reference in New Issue
Block a user