Update of
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/util
In directory james.mmbase.org:/tmp/cvs-serv25509/newsletter/util
Modified Files:
NewsletterPublicationUtil.java NewsletterUtil.java
Log Message:
CMSC-743,Newsletter:send email,add term parameter to NewsletterContentPortlet
See also:
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/util
See also: http://www.mmbase.org/jira/browse/CMSC-743
Index: NewsletterPublicationUtil.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/util/NewsletterPublicationUtil.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- NewsletterPublicationUtil.java 5 May 2008 01:50:56 -0000 1.23
+++ NewsletterPublicationUtil.java 5 May 2008 10:26:59 -0000 1.24
@@ -32,11 +32,10 @@
private static void copyOtherRelations(Node newsletterNode, Node
publicationNode) {
PagesUtil.copyPageRelations(newsletterNode, publicationNode);
- copyImageAndAttachment(newsletterNode, publicationNode);
+ copyImageAndAttachmentRelations(newsletterNode, publicationNode);
}
-
- private static void copyImageAndAttachment(Node newsletterNode, Node
publicationNode) {
+ private static void copyImageAndAttachmentRelations(Node newsletterNode,
Node publicationNode) {
CloneUtil.cloneRelations(newsletterNode,publicationNode,"namedrel","images");
CloneUtil.cloneRelations(newsletterNode,publicationNode,"posrel","attachments");
}
@@ -83,7 +82,7 @@
publicationNode.setStringValue("status",
Publication.STATUS.INITIAL.toString());
publicationNode.commit();
- copyTermsAndContent(newsletterNode, publicationNode, copyContent);
+ //copyTermsAndContent(newsletterNode, publicationNode,
copyContent);
copyOtherRelations(newsletterNode, publicationNode);
NavigationUtil.appendChild(newsletterNode, publicationNode);
Node layoutNode = PagesUtil.getLayout(publicationNode);
Index: NewsletterUtil.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/util/NewsletterUtil.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- NewsletterUtil.java 30 Apr 2008 07:30:10 -0000 1.20
+++ NewsletterUtil.java 5 May 2008 10:26:59 -0000 1.21
@@ -17,6 +17,7 @@
import org.mmbase.bridge.NodeList;
import org.mmbase.bridge.NodeManager;
import org.mmbase.bridge.NodeQuery;
+import org.mmbase.bridge.RelationList;
import org.mmbase.bridge.util.Queries;
import org.mmbase.bridge.util.SearchUtil;
import org.mmbase.storage.search.Step;
@@ -64,10 +65,10 @@
public static int countThemes() {
Cloud cloud = CloudProviderFactory.getCloudProvider().getCloud();
- NodeList themeList = SearchUtil.findNodeList(cloud, "newslettertheme");
- if (themeList != null) {
+ NodeList termList = SearchUtil.findNodeList(cloud, "newslettertheme");
+ if (termList != null) {
int newsletters = countNewsletters();
- return (0 - newsletters + themeList.size());
+ return (0 - newsletters + termList.size());
}
return (0);
}
@@ -429,11 +430,20 @@
List<Node> relatedportlets =
publicationNode.getRelatedNodes("portlet");
+ String termIds = "";
+ for(Term term :terms) {
+ termIds += term.getId()+",";
+ }
+ if(termIds.endsWith(",")) {
+ termIds = termIds.substring(0, termIds.length()-2);
+ }
for (Node portlet : relatedportlets) {
List<Node> portletdefNodes =
portlet.getRelatedNodes("portletdefinition");
String portletDefinition =
portletdefNodes.get(0).getStringValue("definition");
if (portletDefinition.equals(NewsletterContentPortlet.DEFINITION))
{
-// todo: add real logic
+ RelationList relations = portlet.getRelations("portletrel",
publicationNode.getNodeManager());
+ String name = relations.getNode(0).getStringValue("name");
+ url +=
"/_rp_".concat(name).concat("_").concat(NewsletterContentPortlet.NEWSLETTER_TERMS_PARAM).concat("/1_").concat(termIds);
}
}
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs