Update of 
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/util
In directory 
james.mmbase.org:/tmp/cvs-serv2797/portlets-newsletter/src/java/com/finalist/newsletter/util

Modified Files:
        NewsletterUtil.java 
Log Message:
CMSC-825 Send publication out


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-825


Index: NewsletterUtil.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/util/NewsletterUtil.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- NewsletterUtil.java 7 May 2008 08:18:27 -0000       1.24
+++ NewsletterUtil.java 8 May 2008 06:37:14 -0000       1.25
@@ -350,11 +350,11 @@
          List<Node> relatedportlets = 
publicationNode.getRelatedNodes("portlet");
 
          String termIds = "";
-         for(Term term :terms) {
-            termIds += term.getId()+",";
+         for (Term term : terms) {
+            termIds += term.getId() + ",";
          }
-         if(termIds.endsWith(",")) {
-            termIds = termIds.substring(0, termIds.length()-2);
+         if (termIds.endsWith(",")) {
+            termIds = termIds.substring(0, termIds.length() - 2);
          }
          for (Node portlet : relatedportlets) {
             List<Node> portletdefNodes = 
portlet.getRelatedNodes("portletdefinition");
@@ -371,6 +371,17 @@
 
 
    public static String getHostUrl() {
+      String url = getServerURL();
+      if (StringUtils.isNotBlank(getApplicatoinURL())) {
+         url += getApplicatoinURL();
+      }
+      if (!url.endsWith("/")) {
+         url += "/";
+      }
+      return url;
+   }
+
+   public static String getServerURL() {
       String hostUrl = PropertiesUtil.getProperty("host");
 
       if (StringUtils.isEmpty(hostUrl)) {
@@ -385,4 +396,16 @@
       return hostUrl;
    }
 
+   public static String getApplicatoinURL() {
+      String application = PropertiesUtil.getProperty("application");
+
+      if (StringUtils.isEmpty(application)) {
+         throw new NewsletterSendFailException("get property <application> 
from system property and get nothing");
+      }
+
+      log.debug("get property <host> from system property and get:" + 
application);
+
+      return application;
+   }
+
 }
\ No newline at end of file
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to