Author: xlawrence
Date: Thu Jun 21 15:01:06 2007
New Revision: 17690
URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D17690&repname=
=3Djahia
Log:
Resolive issue http://www.jahia.net/jira/browse/JAHIA-2067: SP2 WAI checkin=
g: an image is missing on ALT attribute error
Modified:
branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/engines/shared/Big=
Text_Field.java
branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/htmlparse=
r/WAIValidator.java
branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/taglibs/resourcebu=
ndle/MessageTag.java
Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/engines/shar=
ed/BigText_Field.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/engines/shared/BigText_Field.java&rev=3D176=
90&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/engines/shared/Big=
Text_Field.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/engines/shared/Big=
Text_Field.java Thu Jun 21 15:01:06 2007
@@ -107,8 +107,8 @@
theField.setValue(value);
=
if (logger.isDebugEnabled())
- logger.debug("handling mode : " + mode + " for field " +
- theField.getID() + " value=3D" + theField.getValue());
+ logger.debug("handling mode : " + mode + " for field " +
+ theField.getID() + " value=3D" + theField.getValue());
=
// Set Session attribute for AJAX sitemap
((ParamBean) jParams).getRequest().getSession().setAttribute("entr=
yPoint",
@@ -145,15 +145,15 @@
=
ignoreAllWarnings =3D jParams.getParameter("ignoreAllWarnings") !=
=3D null;
if (logger.isDebugEnabled())
- logger.debug("ignoreAllWarnings: " + ignoreAllWarnings);
+ logger.debug("ignoreAllWarnings: " + ignoreAllWarnings);
((ParamBean) jParams).getRequest().setAttribute("ignoreAllWarnings=
",
Boolean.valueOf(ignoreAllWarnings));
=
boolean out =3D true;
String fieldValue =3D jParams.getParameter("_" + theField.getID());
if (logger.isDebugEnabled())
- logger.debug("GetFormData: theField.getValue(): " +
theField.getV=
alue() +
- ", fieldValue: " + fieldValue);
+ logger.debug("GetFormData: theField.getValue(): " + theField.g=
etValue() +
+ ", fieldValue: " + fieldValue);
=
final JahiaSite site =3D ServicesRegistry.getInstance().
getJahiaSitesService().getSite(jParams.getSiteID());
@@ -210,7 +210,7 @@
}
=
if (logger.isDebugEnabled())
- logger.debug("fieldValue: " + fieldValue);
+ logger.debug("fieldValue: " + fieldValue);
=
fieldValue =3D StringUtils.replace(fieldValue, "\"" + jParams.getC=
ontextPath() + JahiaBigTextField.SERVLET_PATH, "\"" + JahiaBigTextField.URL=
_MARKER);
fieldValue =3D StringUtils.replace(fieldValue, "'" + jParams.getCo=
ntextPath() + JahiaBigTextField.SERVLET_PATH, "'" + JahiaBigTextField.URL_M=
ARKER);
@@ -229,7 +229,7 @@
final Set pageXRefs =3D ((JahiaBigTextField) theField).getInternal=
Links();
engineMap.put("pageXRefs", pageXRefs);
if (logger.isDebugEnabled())
- logger.debug("pageXRefs: " + pageXRefs);
+ logger.debug("pageXRefs: " + pageXRefs);
=
if (! ignoreAllWarnings) {
// Display or ignore URL integrity checks (warnings)
@@ -608,9 +608,9 @@
*/
public Collection getFieldGroupsNotHavingAccessOnPage(int pageID,
JahiaField field=
, ProcessingContext jParams, Map engineMap) throws JahiaException {
- if (logger.isDebugEnabled())
- logger.debug("Comparing ACLs of field " + field.getID() + " and
page=
" +
- pageID);
+ if (logger.isDebugEnabled())
+ logger.debug("Comparing ACLs of field " + field.getID() + " an=
d page " +
+ pageID);
final ContentPage page =3D ContentPage.getPage(pageID);
final JahiaBaseACL aclObject =3D getFieldACLObject(field, engineMa=
p);
=
@@ -621,7 +621,7 @@
// Get all the groups which can see the field
final Vector fieldACLGroups =3D aclObject.getGroupnameListNoAdmin(=
aclEntry);
if (logger.isDebugEnabled())
- logger.debug("fieldACLGroups: " + fieldACLGroups);
+ logger.debug("fieldACLGroups: " + fieldACLGroups);
=
if (page =3D=3D null) {
return fieldACLGroups;
@@ -630,7 +630,7 @@
// Get all the groups which can see the target page
final Vector pageACLGroups =3D page.getACL().getGroupnameListNoAdm=
in(aclEntry);
if (logger.isDebugEnabled())
- logger.debug("pageACLGroups: " + pageACLGroups);
+ logger.debug("pageACLGroups: " + pageACLGroups);
=
final Vector result =3D new Vector(fieldACLGroups.size());
=
@@ -646,7 +646,7 @@
if (! result.contains(groupID)) {
result.addElement(groupID);
if (logger.isDebugEnabled())
- logger.debug("Adding group " + groupID + " to result"=
);
+ logger.debug("Adding group " + groupID + " to resu=
lt");
}
}
}
@@ -695,22 +695,22 @@
// fetch the parent container ACL entry instead...
final JahiaContainer container =3D (JahiaContainer) engineMap.=
get("theContainer");
if (logger.isDebugEnabled())
- logger.debug("Trying to use parent Container ACL instead: ID =
=3D " +
- container.getID());
+ logger.debug("Trying to use parent Container ACL instead: =
ID =3D " +
+ container.getID());
=
if (container.getID() <=3D 0) { // this means the container ha=
s not yet been saved
// fetch the parent container list ACL entry instead...
final int ctnListID =3D container.getListID();
if (logger.isDebugEnabled())
- logger.debug("Trying to use parent ContainerList ACL
inst=
ead: ID =3D " +
- ctnListID);
+ logger.debug("Trying to use parent ContainerList ACL i=
nstead: ID =3D " +
+ ctnListID);
=
if (ctnListID <=3D 0) { // this means the containerList is=
empty
// fetch the page ACL entry instead
final ContentPage fieldPage =3D ContentPage.getPage(fi=
eld.getPageID());
if (logger.isDebugEnabled())
- logger.debug("Trying to use parent ContentPage ACL in=
stead: ID =3D " +
- field.getPageID());
+ logger.debug("Trying to use parent ContentPage ACL=
instead: ID =3D " +
+ field.getPageID());
=
if (fieldPage =3D=3D null) {
logger.error("Field ContentPage is null !!!");
@@ -813,15 +813,15 @@
}
final String value =3D theField.getValue();
if (logger.isDebugEnabled())
- logger.debug("composeWarningMessages... " + value);
+ logger.debug("composeWarningMessages... " + value);
=
final Set pids =3D ((JahiaBigTextField) theField).getInternalLinks=
();
final Set wrongKeys =3D ((JahiaBigTextField) theField).getWrongURL=
Keys();
final EngineMessages result =3D new EngineMessages();
=
if (pids.size() > 0) {
- if (logger.isDebugEnabled())
- logger.debug("PIDs are: " + pids);
+ if (logger.isDebugEnabled())
+ logger.debug("PIDs are: " + pids);
=
final Iterator ite =3D pids.iterator();
final Vector langs;
@@ -849,7 +849,7 @@
} catch (JahiaPageNotFoundException e) {
final EngineMessage msg =3D new EngineMessage(
"org.jahia.engines.shared.BigText_Field.notExi=
stingWarning",
- Integer.toString(pid));
+ new String[]{Integer.toString(pid)});
result.add("BigText.notExisting", msg);
continue;
}
@@ -857,7 +857,7 @@
if (page =3D=3D null) {
final EngineMessage msg =3D new EngineMessage(
"org.jahia.engines.shared.BigText_Field.notExi=
stingWarning",
- Integer.toString(pid));
+ new String[]{Integer.toString(pid)});
result.add("BigText.notExisting", msg);
continue;
}
@@ -902,7 +902,7 @@
} else if ("markForDeleted".equals(state)) {
final EngineMessage msg =3D new EngineMessage(
"org.jahia.engines.shared.BigText_Field.ma=
rkForDeleteWarning",
- Integer.toString(pid));
+ new String[]{Integer.toString(pid)});
result.add("BigText.markForDeleted", msg);
=
} else if ("waiting".equals(state)) {
@@ -932,12 +932,12 @@
final String urlKey =3D (String) ite.next();
final EngineMessage msg =3D new EngineMessage(
"org.jahia.engines.shared.BigText_Field.wrongKeys",
- urlKey);
+ new String[]{urlKey});
result.add("BigText.wrongURLKeys", msg);
}
}
if (logger.isDebugEnabled())
- logger.debug("Returning " + result.getSize() + " warning
message(=
s): " + result);
+ logger.debug("Returning " + result.getSize() + " warning messa=
ge(s): " + result);
jParams.setCurrentLocale(oldLoc);
return result;
}
Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/htm=
lparser/WAIValidator.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/services/htmlparser/WAIValidator.java&rev=
=3D17690&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/htmlparse=
r/WAIValidator.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/htmlparse=
r/WAIValidator.java Thu Jun 21 15:01:06 2007
@@ -499,7 +499,7 @@
*
*/
=
- /*
+ /*
// Criteria 5.1
final Node summary =3D node.getAttributes().getNamedItem("summary"=
);
if (summary =3D=3D null) {
@@ -527,7 +527,7 @@
return errors;
}
*/
- =
+
// Criteria 5.3
Node header =3D node.getFirstChild();
=
@@ -917,9 +917,16 @@
serial.reset();
}
}
- buff.append("<b><u>");
- buff.append(boldText);
- buff.append("</u></b>");
+ if (node.getClass() =3D=3D HTMLImageElementImpl.class) {
+ final String src =3D node.getAttributes().getNamedItem("sr=
c").getNodeValue();
+ buff.append("<img border=3D'0' src=3D'");
+ buff.append(src);
+ buff.append("' />");
+ } else {
+ buff.append("<b><u>");
+ buff.append(boldText);
+ buff.append("</u></b>");
+ }
=
Node next =3D node.getNextSibling();
if (next =3D=3D null) node.getFirstChild();
Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/taglibs/reso=
urcebundle/MessageTag.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/taglibs/resourcebundle/MessageTag.java&rev=
=3D17690&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/taglibs/resourcebu=
ndle/MessageTag.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/taglibs/resourcebu=
ndle/MessageTag.java Thu Jun 21 15:01:06 2007
@@ -14,7 +14,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied=
. =
* See the License for the specific language governing permissions and =
* limitations under the License.
- */package org.jahia.taglibs.resourcebundle;
+ */
+package org.jahia.taglibs.resourcebundle;
=
import java.io.IOException;
import java.text.MessageFormat;
@@ -33,57 +34,52 @@
=
/**
* Support for Jahia Message ResourceBundle within Jahia
- *
+ * <p/>
* Returns the requested resource.
*
- * @see JahiaResourceBundle
- * @see SetAdminResourceBundleTag
- * @see JahiaEnginesResources.properties
- *
* @author Khue Nguyen
- *
- *
* @jsp:tag name=3D"message" body-content=3D"empty"
* description=3D"display a specific value in a resource bundle and format=
s it using
* <a href=3D'http://java.sun.com/j2se/1.4.2/docs/api/java/text/MessageFor=
mat.html' target=3D'tagFrame'>java.text.MessageFormat</a>.
- *
+ * <p/>
* <p><attriInfo>Lowest level support for resource bundle messages. This i=
s inspired by the Struts bean message tag
* except that it checks a session variable (org.jahia.services.multilang.=
currentlocale) to
* determine if a Locale has been chosen.
- *
+ * <p/>
* <p>The value lookup is done in the 'JahiaMessageResources.properties' r=
esource bundle.
- *
+ * <p/>
* <p>Similar in functionality to <a href=3D'resourceBundle.html' target=
=3D'tagFrame'>content:resourceBundle</a>.
- *
- *
+ * <p/>
+ * <p/>
* <p><b>Example 1 :</b>
- * <p>
+ * <p/>
* <logic:present name=3D\"engineMessages\"> <br>
-<div id=3D\"errors\"> <br>
- <content:resourceBundle resourceBundle=3D\"jahiatemplates.=
Corporate_portal_templates\" resourceName=3D\"mySettingsErrors\"/> : <=
;br/> <br>
- <ul> <br>
- <logic:iterate name=3D\"engineMessages\" property=3D\"mess=
ages\" id=3D\"curMessage\"> <br>
- <li><content:message name=3D\"curMessage=
\"/></li> <br>
- </logic:iterate> <br>
- </ul> <br>
-</div><br>
-</logic:present> <br>
- *
+ * <div id=3D\"errors\"> <br>
+ * <content:resourceBundle resourceBundle=3D\"jahiatemplate=
s.Corporate_portal_templates\" resourceName=3D\"mySettingsErrors\"/> : &=
lt;br/> <br>
+ * <ul> <br>
+ * <logic:iterate name=3D\"engineMessages\" property=3D\"me=
ssages\" id=3D\"curMessage\"> <br>
+ * <li><content:message name=3D\"curMessa=
ge\"/></li> <br>
+ * </logic:iterate> <br>
+ * </ul> <br>
+ * </div><br>
+ * </logic:present> <br>
+ * <p/>
* <p>The above example takes all the EngineMessage objects in EngineMessa=
ges and displays them using the content:message tag. The
* EngineMessages is instanciated when Jahia detects an error.
- *
+ * <p/>
* <p><b>Example 2 :</b>
- * <p>
+ * <p/>
* <content:message key=3D\"org.jahia.bin.JahiaConfigurationWizard.root=
.adminUserName.label\" />
- *
+ * <p/>
* </attriInfo>"
+ * @see JahiaResourceBundle
+ * see SetAdminResourceBundleTag
+ * see JahiaEnginesResources.properties
*/
public class MessageTag extends TagSupport {
=
- private static org.apache.log4j.Logger logger =3D
- org.apache.log4j.Logger.getLogger(MessageTag.class);
-
- private static final String CLASS_NAME =3D MessageTag.class.getName();
+ private static final org.apache.log4j.Logger logger =3D
+ org.apache.log4j.Logger.getLogger(MessageTag.class);
=
private String key =3D null;
private String name =3D null;
@@ -93,11 +89,11 @@
/**
* @jsp:attribute name=3D"key" required=3D"false" rtexprvalue=3D"true"
* description=3D"the key of the resource to fetch in the resource bun=
dle.
- *
+ * <p/>
* <p><attriInfo>If it is defined, all other attributes are ignored.
* </attriInfo>"
*/
- public void setKey (String key) {
+ public void setKey(String key) {
if (key =3D=3D null) {
key =3D "";
}
@@ -107,83 +103,67 @@
/**
* @jsp:attribute name=3D"name" required=3D"false" rtexprvalue=3D"true"
* description=3D"name of the pageContext attribute which holds the be=
an to fetch and display.
- *
+ * <p/>
* <p><attriInfo>
* </attriInfo>"
*/
- public String getName () {
+ public String getName() {
return name;
}
=
- public void setName (String name) {
+ public void setName(String name) {
this.name =3D name;
}
=
=
- public boolean isDisplay () {
+ public boolean isDisplay() {
return display;
}
=
- public void setDisplay (boolean display) {
+ public void setDisplay(boolean display) {
this.display =3D display;
}
=
- public String getProperty () {
+ public String getProperty() {
return property;
}
=
- public void setProperty (String property) {
+ public void setProperty(String property) {
this.property =3D property;
}
=
- public int doStartTag () {
+ public int doStartTag() {
=
- HttpServletRequest request =3D (HttpServletRequest) pageContext.
- getRequest();
+ HttpServletRequest request =3D (HttpServletRequest) pageContext.ge=
tRequest();
String resValue =3D null;
=
Locale currentLocale =3D request.getLocale();
HttpSession session =3D pageContext.getSession();
if (session !=3D null) {
if (session.getAttribute(ProcessingContext.SESSION_LOCALE) !=
=3D null) {
- currentLocale =3D (Locale) session.getAttribute(Processing=
Context.
- SESSION_LOCALE);
+ currentLocale =3D (Locale) session.getAttribute(Processing=
Context.SESSION_LOCALE);
}
}
=
try {
-
- String keyName =3D null;
if (key !=3D null) {
- resValue =3D JahiaResourceBundle
- .getMessageResource(key,
- currentLocale);
+ resValue =3D JahiaResourceBundle.getMessageResource(key, c=
urrentLocale);
} else if (name !=3D null) {
- EngineMessage message =3D (EngineMessage) pageContext.
- findAttribute(name);
+ EngineMessage message =3D (EngineMessage) pageContext.find=
Attribute(name);
if (message !=3D null) {
- String keyValue =3D JahiaResourceBundle
- .getMessageResource(message.getKey(),
- currentLocale);
+ String keyValue =3D JahiaResourceBundle.getMessageReso=
urce(message.getKey(), currentLocale);
if (keyValue !=3D null && message.getValues() !=3D nul=
l) {
- MessageFormat msgFormat =3D new MessageFormat(
- keyValue);
- msgFormat.setLocale(currentLocale);
+ MessageFormat msgFormat =3D new MessageFormat(keyV=
alue, currentLocale);
resValue =3D msgFormat.format(message.getValues());
} else {
resValue =3D keyValue;
}
=
} else {
- logger.error(
- "Couldn't find any EngineMessage bean with name " +
- name + "!");
+ logger.error("Couldn't find any EngineMessage bean wit=
h name " + name + "!");
}
}
=
- if (key !=3D null) {
- }
-
} catch (MissingResourceException mre) {
logger.warn("Couldn't find resource : ", mre);
}
@@ -203,8 +183,8 @@
=
}
=
- public int doEndTag ()
- throws JspException {
+ public int doEndTag()
+ throws JspException {
// let's reinitialize the tag variables to allow tag object reuse =
in
// pooling.
key =3D null;
_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list