Update of
/var/cvs/contributions/CMSContainer/cmsc/richtext/src/java/com/finalist/cmsc/richtext
In directory
james.mmbase.org:/tmp/cvs-serv2623/cmsc/richtext/src/java/com/finalist/cmsc/richtext
Modified Files:
Tag: b1_4
RichText.java RichTextGetProcessor.java
Log Message:
CMSC-1028 - Better handling of missing content elements in portlets - Improved
thread listing view - Added thread dump cleaning line.
See also:
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer/cmsc/richtext/src/java/com/finalist/cmsc/richtext
See also: http://www.mmbase.org/jira/browse/CMSC-1028
Index: RichText.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer/cmsc/richtext/src/java/com/finalist/cmsc/richtext/RichText.java,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -b -r1.5 -r1.5.2.1
--- RichText.java 14 Jan 2008 22:42:21 -0000 1.5
+++ RichText.java 25 Jul 2008 12:17:28 -0000 1.5.2.1
@@ -52,11 +52,12 @@
public static final String WIDTH_ATTR = "width";
public static final String HEIGHT_ATTR = "height";
- // mmbase stuff
+ // MMBase stuff
public final static String RICHTEXT_TYPE = "cmscrichtext";
public final static String INLINEREL_NM = "inlinerel";
public final static String IMAGEINLINEREL_NM = "imageinlinerel";
public static final String REFERID_FIELD = "referid";
+ public static final String TITLE_FIELD = "title";
public final static boolean hasRichtextItems(String in) {
Index: RichTextGetProcessor.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer/cmsc/richtext/src/java/com/finalist/cmsc/richtext/RichTextGetProcessor.java,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -b -r1.8 -r1.8.2.1
--- RichTextGetProcessor.java 26 Nov 2007 11:43:47 -0000 1.8
+++ RichTextGetProcessor.java 25 Jul 2008 12:17:28 -0000 1.8.2.1
@@ -153,7 +153,7 @@
if (dynamicDescriptions) {
String description = imageNode.getStringValue("description");
if (StringUtil.isEmptyOrWhitespace(description)) {
- description = imageNode.getStringValue(RichText.TITLE_ATTR);
+ description = imageNode.getStringValue(RichText.TITLE_FIELD);
}
image.setAttribute(RichText.ALT_ATTR, description);
image.setAttribute(RichText.TITLE_ATTR, description);
@@ -242,7 +242,7 @@
if ("attachments".equals(builderName)) {
name =
destinationNode.getStringValue(RichText.DESCRIPTION_ATTR);
if (StringUtil.isEmptyOrWhitespace(name)) {
- name = destinationNode.getStringValue(RichText.TITLE_ATTR);
+ name = destinationNode.getStringValue(RichText.TITLE_FIELD);
}
url = ResourcesUtil.getServletPath(destinationNode,
destinationNode.getStringValue("number"));
}
@@ -252,8 +252,8 @@
url = destinationNode.getStringValue("url");
}
else {
- if
(destinationNode.getNodeManager().hasField(RichText.TITLE_ATTR)) {
- name =
destinationNode.getStringValue(RichText.TITLE_ATTR);
+ if
(destinationNode.getNodeManager().hasField(RichText.TITLE_FIELD)) {
+ name =
destinationNode.getStringValue(RichText.TITLE_FIELD);
}
else {
if (destinationNode.getNodeManager().hasField("name")) {
@@ -288,7 +288,13 @@
private String getContentUrl(Node node) {
- String title = node.getStringValue("title");
+ String title = null;
+
+ //Check for the existence of title field of the node
+ if (node.getNodeManager().hasField(RichText.TITLE_FIELD)) {
+ title = node.getStringValue(RichText.TITLE_FIELD);
+ }
+
String id = node.getStringValue("number");
return ResourcesUtil.getServletPathWithAssociation("content",
"/content/*", id, title);
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs