On Wednesday 20 February 2008 01:22, dieppe at freenetproject.org wrote:
> Author: dieppe
> Date: 2008-02-20 01:22:10 +0000 (Wed, 20 Feb 2008)
> New Revision: 18079
>
> Modified:
> trunk/apps/thingamablog/src/net/sf/thingamablog/blog/TBWeblog.java
> trunk/apps/thingamablog/src/net/sf/thingamablog/blog/Weblog.java
>
trunk/apps/thingamablog/src/net/sf/thingamablog/gui/app/WeblogPreviewer.java
>
trunk/apps/thingamablog/src/net/sf/thingamablog/gui/properties/TBPublishTransportPanel.java
>
trunk/apps/thingamablog/src/net/sf/thingamablog/gui/properties/TBWizardDialog.java
>
trunk/apps/thingamablog/src/net/sf/thingamablog/transport/FCPTransport.java
> Log:
> Insert works (not deeply tested) now;
> Few bugfixs;
>
> Modified: trunk/apps/thingamablog/src/net/sf/thingamablog/blog/Weblog.java
> ===================================================================
> --- trunk/apps/thingamablog/src/net/sf/thingamablog/blog/Weblog.java
2008-02-19 20:28:19 UTC (rev 18078)
> +++ trunk/apps/thingamablog/src/net/sf/thingamablog/blog/Weblog.java
2008-02-20 01:22:10 UTC (rev 18079)
> @@ -375,10 +375,13 @@
> }
> markWebFilesAsUpdated();
> File webFiles[] = getUpdatedWebFiles();
> + String webPaths[] = getWebFilesServerPaths(webFiles);
> long totalBytes = 0;
> //count the total bytes for this publish
> - for(int i = 0; i < webFiles.length; i++)
> - totalBytes += webFiles[i].length();
> + for(int i = 0; i < webFiles.length; i++){
> + totalBytes += webFiles[i].length();
> + ht.put(webFiles[i],webPaths[i]);
> + }
> for(Enumeration e = ht.keys() ; e.hasMoreElements() ;)
> {
> try
> @@ -403,7 +406,7 @@
> boolean failed = false;
> //we are publishing a flog with fcp
> FCPTransport fcp = (FCPTransport) transport;
> - boolean result = fcp.publishFile(ht,progress);
> + boolean result =
fcp.publishFile(ht,progress,this.getFrontPageUrl().substring(("USK@" +
fcp.getInsertURI() + "/" + fcp.getTitle() + "/" + fcp.getEdition()
+ "/").length()),getArchivePath());
This is rather odd - what are you doing here? I mean, why do you construct the
string, which presumably is identical to the first part of the other string,
and then use the first part of the other string anyway?
> Modified:
trunk/apps/thingamablog/src/net/sf/thingamablog/transport/FCPTransport.java
> ===================================================================
> ---
trunk/apps/thingamablog/src/net/sf/thingamablog/transport/FCPTransport.java
2008-02-19 20:28:19 UTC (rev 18078)
> +++
trunk/apps/thingamablog/src/net/sf/thingamablog/transport/FCPTransport.java
2008-02-20 01:22:10 UTC (rev 18079)
> @@ -174,14 +170,16 @@
> finished = success || "PutFailed".equals(messageName) ||
messageName.endsWith("Error");
> }
> }
> - hasPublish=success;
> + // If the publish has been made, we update the edition number to
the current edition +1
> + if(finalURI != null){
> + edition =
Integer.parseInt(finalURI.substring(finalURI.length()-1)) + 1;
> + }
> return success;
> }
And is this horrible hack necessary? Can't you keep the edition number as an
integer or something? For that matter, can't you keep the URI as a URI? (Feel
free to reuse code from Freenet itself e.g. FreenetURI).
>
> - private FileEntry createFileEntry(File file, int edition){
> + private FileEntry createFileEntry(File file, int edition, String path){
> String content = DefaultMIMETypes.guessMIMEType(file.getName());
> - System.out.println(content);
> - FileEntry fileEntry = new DiskFileEntry(file.getName(), content,
file.getPath());
> + FileEntry fileEntry = new DiskFileEntry(path + file.getName(),
content, file.getPath());
> return fileEntry;
> }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL:
<https://emu.freenetproject.org/pipermail/devl/attachments/20080222/4de6222a/attachment.pgp>