* Matthew Toseland <toad at amphibian.dyndns.org> [2008-04-16 22:33:26]:

> Relative links don't work?
> 

Flogs might contain links which can't be relative... like the "bookmark
me!" one.

> On Wednesday 16 April 2008 18:40, dieppe at freenetproject.org wrote:
> > Author: dieppe
> > Date: 2008-04-16 17:40:18 +0000 (Wed, 16 Apr 2008)
> > New Revision: 19372
> > 
> > Modified:
> >    trunk/apps/thingamablog/src/net/sf/thingamablog/blog/TBWeblog.java
> >    
> trunk/apps/thingamablog/src/net/sf/thingamablog/generator/BlogPageContainer.java
> > Log:
> > Fix the internals links (with the <$EditionNumber$> tag)
> > Fix the bookmark link, and the EditionNumber tag (pointed to the last 
> edition, not the current one)
> > 
> > 
> > Modified: trunk/apps/thingamablog/src/net/sf/thingamablog/blog/TBWeblog.java
> > ===================================================================
> > --- trunk/apps/thingamablog/src/net/sf/thingamablog/blog/TBWeblog.java      
> 2008-04-16 17:01:45 UTC (rev 19371)
> > +++ trunk/apps/thingamablog/src/net/sf/thingamablog/blog/TBWeblog.java      
> 2008-04-16 17:40:18 UTC (rev 19372)
> > @@ -602,16 +602,34 @@
> >      
> >      public String getUrlForEntry(BlogEntry b)
> >      {
> > +        if (getPublishTransport() instanceof FCPTransport) {
> > +            String url = getArchiveUrl();
> > +            int firstSlash = url.indexOf('/');
> > +            url = url.substring(0,firstSlash+1) + ((FCPTransport) 
> getPublishTransport()).getSSKPath() + "/<$EditionNumber$>/";
> > +            return url + getEntryFileName(b);
> > +        }
> >         return getArchiveUrl() + getEntryPathPart(b) + getEntryFileName(b);
> >      }
> >      
> >      public String getUrlForCategory(String cat)
> >      {
> > +        if (getPublishTransport() instanceof FCPTransport) {
> > +            String url = getArchiveUrl();
> > +            int firstSlash = url.indexOf('/');
> > +            url = url.substring(0,firstSlash+1) + ((FCPTransport) 
> getPublishTransport()).getSSKPath() + "/<$EditionNumber$>/";
> > +            return url + getCategoryFileName(cat);
> > +        }
> >          return getArchiveUrl() + getCategoryFileName(cat);
> >      }
> >      
> >      public String getUrlForArchive(ArchiveRange arc)
> >      {
> > +        if (getPublishTransport() instanceof FCPTransport) {
> > +            String url = getArchiveUrl();
> > +            int firstSlash = url.indexOf('/');
> > +            url = url.substring(0,firstSlash+1) + ((FCPTransport) 
> getPublishTransport()).getSSKPath() + "/<$EditionNumber$>/";
> > +            return url + getArchiveFileName(arc);
> > +        }
> >          return getArchiveUrl() + getArchiveFileName(arc);
> >      }
> >      
> > @@ -625,6 +643,12 @@
> >              String url = f.toURL().toExternalForm();
> >              String wurl = getWebFilesDirectory().toURL().toExternalForm();
> >              int s = url.indexOf(wurl) + wurl.length();
> > +            if (getPublishTransport() instanceof FCPTransport) {
> > +                String uri = getBaseUrl();
> > +                int firstSlash = uri.indexOf('/');
> > +                uri = uri.substring(0,firstSlash+1) + ((FCPTransport) 
> getPublishTransport()).getSSKPath() + "/<$EditionNumber$>/";
> > +                return uri + url.substring(s, url.length());
> > +            }
> >              return getBaseUrl() +  url.substring(s, url.length());
> >          }
> >          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-16 17:01:45 UTC (rev 19371)
> > +++ 
> trunk/apps/thingamablog/src/net/sf/thingamablog/generator/BlogPageContainer.java
>       
> 2008-04-16 17:40:18 UTC (rev 19372)
> > @@ -67,9 +67,9 @@
> >          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());        
> > +            tagValues.put(new TextTag("RssLink"), "/?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("EditionNumber"), 
> (((FCPTransport)blog.getPublishTransport()).getEdition()+ 1) +"");        
> >          }
> >          tagValues.put(new TextTag("IndexPageLink"), blog.getBaseUrl() + 
> blog.getArchiveIndexFileName());
> >          tagValues.put(curDateTag, new Date());
> > 
> > _______________________________________________
> > cvs mailing list
> > cvs at freenetproject.org
> > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
> > 
> > 



> _______________________________________________
> Devl mailing list
> Devl at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20080417/84bc79f7/attachment.pgp>

Reply via email to