r948 - xwiki/trunk/src/main/java/com/xpn/xwiki/doc

Jeremi Joslin jeremi at users.forge.objectweb.org
Wed Mar 1 03:45:08 CET 2006


Author: jeremi
Date: 2006-03-01 03:45:05 +0100 (Wed, 01 Mar 2006)
New Revision: 948

Modified:
   xwiki/trunk/src/main/java/com/xpn/xwiki/doc/XWikiAttachment.java
Log:
XWIKI-220 the setdirty was not on the comments getter instead of the  setter

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/doc/XWikiAttachment.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/doc/XWikiAttachment.java	2006-02-28 09:48:47 UTC (rev 947)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/doc/XWikiAttachment.java	2006-03-01 02:45:05 UTC (rev 948)
@@ -1,26 +1,26 @@
-/*
- * Copyright 2006, XpertNet SARL, and individual contributors as indicated
- * by the contributors.txt.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *
- * @author ludovic
- * @author jeremi
- * @author sdumitriu
- */
+/*
+ * Copyright 2006, XpertNet SARL, and individual contributors as indicated
+ * by the contributors.txt.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ * @author ludovic
+ * @author jeremi
+ * @author sdumitriu
+ */
 
 package com.xpn.xwiki.doc;
 
@@ -166,13 +166,13 @@
     }
 
     public String getComment() {
-        if (!comment.equals(this.comment)) {
-                setMetaDataDirty(true);
-            }
         return comment;
     }
 
     public void setComment(String comment) {
+        if (!comment.equals(this.comment)) {
+            setMetaDataDirty(true);
+        }
         this.comment = comment;
     }
 
@@ -195,9 +195,9 @@
 
     public boolean isContentDirty() {
         if (attachment_content==null)
-         return false;
+            return false;
         else
-         return attachment_content.isContentDirty();
+            return attachment_content.isContentDirty();
     }
 
     public void incrementVersion() {
@@ -216,59 +216,6 @@
         isMetaDataDirty = metaDataDirty;
     }
 
-    /*
-    // This code should not be needed..
-    // Meta Data archiving is done
-    // in the main document..
-    public Archive getRCSMetaArchive() {
-        return metaArchive;
-    }
-
-    public void setRCSMetaArchive(Archive metaArchive) {
-        this.metaArchive = metaArchive;
-    }
-
-
-    public String getMetaArchive() throws XWikiException {
-        if (metaArchive==null)
-            updateMetaArchive(toXML());
-        if (metaArchive==null)
-            return "";
-        else {
-            StringBuffer buffer = new StringBuffer();
-            metaArchive.toString(buffer);
-            return buffer.toString();
-        }
-    }
-
-    public void setMetaArchive(String text) throws XWikiException {
-        try {
-            StringInputStream is = new StringInputStream(text);
-            metaArchive = new Archive(getFilename(), is);
-        }
-        catch (Exception e) {
-            Object[] args = { getFilename() };
-            throw new XWikiException( XWikiException.MODULE_XWIKI_STORE, XWikiException.ERROR_XWIKI_STORE_ATTACHMENT_ARCHIVEFORMAT,
-                    "Exception while manipulating the archive for file {0}", e, args);
-        }
-    }
-
-    public void updateMetaArchive(String text) throws XWikiException {
-        try {
-            Lines lines = new Lines(text);
-            if (metaArchive!=null)
-                metaArchive.addRevision(lines.toArray(),"");
-            else
-                metaArchive = new Archive(lines.toArray(),getFilename(),getVersion());
-        }
-        catch (Exception e) {
-            Object[] args = { getFilename() };
-            throw new XWikiException( XWikiException.MODULE_XWIKI_STORE, XWikiException.ERROR_XWIKI_STORE_ARCHIVEFORMAT,
-                    "Exception while manipulating the archive for file {0}", e, args);
-        }
-    }
-    */
-
     public Element toXML(XWikiContext context) throws XWikiException {
         return toXML(false, false, context);
     }





More information about the Xwiki-notifications mailing list