Author: dieppe
Date: 2008-04-16 01:57:44 +0000 (Wed, 16 Apr 2008)
New Revision: 19369

Modified:
   
trunk/apps/thingamablog/src/net/sf/thingamablog/generator/BlogEntryContainer.java
   
trunk/apps/thingamablog/src/net/sf/thingamablog/generator/BlogPageContainer.java
   
trunk/apps/thingamablog/src/net/sf/thingamablog/gui/editor/EntryImageUtils.java
Log:
New tag <$EditionNumber$> can be used in the links (or anywhere in the html 
code) to 
always point to the current edition number.
The source link of the images now point to the current edition number (and not, 
as 
previously, to the edition number of the flog when the image was inserted), 
using the 
<$EditionNumber$> tag.
The "Syndicate this site (XML)" link now point to the bookmark manager.
TODO : modify the templates to change "Syndicate..." to "Bookmark this flog" 
when, of 
course, the blog is a flog...



Modified: 
trunk/apps/thingamablog/src/net/sf/thingamablog/generator/BlogEntryContainer.java
===================================================================
--- 
trunk/apps/thingamablog/src/net/sf/thingamablog/generator/BlogEntryContainer.java
   2008-04-15 22:21:20 UTC (rev 19368)
+++ 
trunk/apps/thingamablog/src/net/sf/thingamablog/generator/BlogEntryContainer.java
   2008-04-16 01:57:44 UTC (rev 19369)
@@ -18,6 +18,7 @@
 import net.sf.thingamablog.blog.EntryEnumeration;
 import net.sf.thingamablog.blog.TBWeblog;
 import net.sf.thingamablog.blog.WeblogBackend;
+import net.sf.thingamablog.transport.FCPTransport;



@@ -59,6 +60,7 @@
        private TemplateTag entryAuthorUrlTag = new TextTag("EntryAuthorURL");
        private TemplateTag entryArchivePageTag = new 
TextTag("EntryArchivePage");
        private TemplateTag entryPermalinkTag = new TextTag("EntryPermalink");
+        private TemplateTag editionNumberTag = new TextTag("EditionNumber");
        private DateTag entryDateTag = new DateTag("EntryDate");
        private DateTag entryTimeTag = new DateTag("EntryTime");
        private DateTag entryDateTimeTag = new DateTag("EntryDateTime");        
@@ -116,6 +118,8 @@
            tags.add(entryTimeTag);
            tags.add(entryDateTimeTag);
            tags.add(entryPermalinkTag);
+            if (blog.getPublishTransport() instanceof FCPTransport)
+                tags.add(editionNumberTag);

            entryDateTag.setLocale(blog.getLocale());
            entryTimeTag.setLocale(blog.getLocale());
@@ -405,6 +409,8 @@
                        ArchiveRange ar = 
blog.getArchiveForDate(curEntry.getDate());
                        return blog.getArchiveUrl() + 
blog.getArchiveFileName(ar);
             }
+            if(tag == editionNumberTag && blog.getPublishTransport() 
instanceof FCPTransport)
+                return (((FCPTransport) 
blog.getPublishTransport()).getEdition() + 1) + "";

         }
         catch(Exception ex)

Modified: 
trunk/apps/thingamablog/src/net/sf/thingamablog/generator/BlogPageContainer.java
===================================================================
--- 
trunk/apps/thingamablog/src/net/sf/thingamablog/generator/BlogPageContainer.java
    2008-04-15 22:21:20 UTC (rev 19368)
+++ 
trunk/apps/thingamablog/src/net/sf/thingamablog/generator/BlogPageContainer.java
    2008-04-16 01:57:44 UTC (rev 19369)
@@ -12,6 +12,7 @@

 import net.sf.thingamablog.TBGlobals;
 import net.sf.thingamablog.blog.TBWeblog;
+import net.sf.thingamablog.transport.FCPTransport;



@@ -63,7 +64,13 @@
         tagValues.put(new TextTag("BlogTitle"), blog.getTitle());
         tagValues.put(new HyperTextTag("BlogDescription"), 
blog.getDescription());
         tagValues.put(new TextTag("FrontPageLink"), blog.getBaseUrl() + 
blog.getFrontPageFileName());
-        tagValues.put(new TextTag("RssLink"), blog.getBaseUrl() + 
blog.getRssFileName());        
+        if (blog.getType().equals("internet")) {
+            tagValues.put(new TextTag("RssLink"), blog.getBaseUrl() + 
blog.getRssFileName());        
+        } else {
+            tagValues.put(new TextTag("RssLink"), 
"http://127.0.0.1:8888/?newbookmark=freenet:"; + blog.getBaseUrl() + "&desc=" + 
blog.getDescription());        
+            if (blog.getPublishTransport() instanceof FCPTransport)
+                            tagValues.put(new TextTag("EditionNumber"), 
((FCPTransport)blog.getPublishTransport()).getEdition()+"");        
+        }
         tagValues.put(new TextTag("IndexPageLink"), blog.getBaseUrl() + 
blog.getArchiveIndexFileName());
         tagValues.put(curDateTag, new Date());
         tagValues.put(new TextTag("PageTitle"), pageTitle);

Modified: 
trunk/apps/thingamablog/src/net/sf/thingamablog/gui/editor/EntryImageUtils.java
===================================================================
--- 
trunk/apps/thingamablog/src/net/sf/thingamablog/gui/editor/EntryImageUtils.java 
    2008-04-15 22:21:20 UTC (rev 19368)
+++ 
trunk/apps/thingamablog/src/net/sf/thingamablog/gui/editor/EntryImageUtils.java 
    2008-04-16 01:57:44 UTC (rev 19369)
@@ -12,6 +12,7 @@
 import java.util.List;

 import net.sf.thingamablog.blog.Weblog;
+import net.sf.thingamablog.transport.FCPTransport;


 /**
@@ -138,6 +139,11 @@
     public static String changeLocalImageURLs(String html, Weblog blog)
     {
         String mediaURL = /*toRelativeUrl*/(blog.getMediaUrl());
+        if (blog.getPublishTransport() instanceof FCPTransport) {
+            int firstSlash = mediaURL.indexOf('/');
+            mediaURL = mediaURL.substring(0,firstSlash+1) + ((FCPTransport) 
blog.getPublishTransport()).getSSKPath() + "/<$EditionNumber$>/";
+        }
+            
         File dir = getImageDirectory(blog);

         List tags = parseImageTags(html);


Reply via email to