vnkatesh (SVN) wrote:
Author: vnkatesh
Date: 2009-06-05 18:43:32 +0200 (Fri, 05 Jun 2009)
New Revision: 20881
Added:
sandbox/gsoc/xeclipse/org.xwiki.eclipse.core/src/main/java/org/xwiki/eclipse/core/model/ProxyXMLRpc.java
sandbox/gsoc/xeclipse/org.xwiki.eclipse.core/src/main/java/org/xwiki/eclipse/core/model/XWikiEclipseAttachmentSummary.java
sandbox/gsoc/xeclipse/org.xwiki.eclipse.ui/icons/xwiki.attachment.png
sandbox/gsoc/xeclipse/org.xwiki.eclipse.ui/src/main/java/org/xwiki/eclipse/ui/actions/XWikiEclipseAttachmentSummaryActionProvider.java
sandbox/gsoc/xeclipse/org.xwiki.eclipse.ui/src/main/java/org/xwiki/eclipse/ui/adapters/XWikiEclipseAttachmentSummaryAdapter.java
Modified:
sandbox/gsoc/xeclipse/org.xwiki.eclipse.core/src/main/java/org/xwiki/eclipse/core/DataManager.java
sandbox/gsoc/xeclipse/org.xwiki.eclipse.core/src/main/java/org/xwiki/eclipse/core/storage/LocalXWikiDataStorage.java
sandbox/gsoc/xeclipse/org.xwiki.eclipse.core/src/main/java/org/xwiki/eclipse/core/storage/RemoteXWikiDataStorage.java
sandbox/gsoc/xeclipse/org.xwiki.eclipse.ui/plugin.xml
sandbox/gsoc/xeclipse/org.xwiki.eclipse.ui/src/main/java/org/xwiki/eclipse/ui/UIConstants.java
sandbox/gsoc/xeclipse/org.xwiki.eclipse.ui/src/main/java/org/xwiki/eclipse/ui/adapters/AdapterFactory.java
sandbox/gsoc/xeclipse/org.xwiki.eclipse.ui/src/main/java/org/xwiki/eclipse/ui/adapters/XWikiEclipsePageSummaryAdapter.java
Log:
Basic Attachment Display.
No Functionality (Open/Properties)
Unsure of LocalDataStorageFunctionalities as of yet.
Added:
sandbox/gsoc/xeclipse/org.xwiki.eclipse.core/src/main/java/org/xwiki/eclipse/core/model/ProxyXMLRpc.java
===================================================================
---
sandbox/gsoc/xeclipse/org.xwiki.eclipse.core/src/main/java/org/xwiki/eclipse/core/model/ProxyXMLRpc.java
(rev 0)
+++
sandbox/gsoc/xeclipse/org.xwiki.eclipse.core/src/main/java/org/xwiki/eclipse/core/model/ProxyXMLRpc.java 2009-06-05
16:43:32 UTC (rev 20881)
This is definitely not right:
+ String url =
"http://192.168.121.161:5005/xwiki/xmlrpc/confluence";
+ String user = "vnkatesh";
+ String pass = "ranjith";
Added:
sandbox/gsoc/xeclipse/org.xwiki.eclipse.core/src/main/java/org/xwiki/eclipse/core/model/XWikiEclipseAttachmentSummary.java
===================================================================
---
sandbox/gsoc/xeclipse/org.xwiki.eclipse.core/src/main/java/org/xwiki/eclipse/core/model/XWikiEclipseAttachmentSummary.java
(rev 0)
+++
sandbox/gsoc/xeclipse/org.xwiki.eclipse.core/src/main/java/org/xwiki/eclipse/core/model/XWikiEclipseAttachmentSummary.java 2009-06-05
16:43:32 UTC (rev 20881)
@@ -0,0 +1,47 @@
You should add the standard copyright notice header at the start of each
new file.
+/**
+ *
+ */
+package org.xwiki.eclipse.core.model;
+
(non-Javadoc) comments are not useful. Either remove them or add a
proper Javadoc. For @Override methods it's enough to turn the plain
comment into a javadoc and replace the (non-Javadoc) line with
{@inheritDoc}.
+ /*
+ * (non-Javadoc)
+ * @see org.xwiki.eclipse.core.model.ModelObject#getXWikiEclipseId()
+ */
+ @Override
Modified:
sandbox/gsoc/xeclipse/org.xwiki.eclipse.core/src/main/java/org/xwiki/eclipse/core/storage/LocalXWikiDataStorage.java
===================================================================
---
sandbox/gsoc/xeclipse/org.xwiki.eclipse.core/src/main/java/org/xwiki/eclipse/core/storage/LocalXWikiDataStorage.java 2009-06-05
16:37:12 UTC (rev 20880)
+++
sandbox/gsoc/xeclipse/org.xwiki.eclipse.core/src/main/java/org/xwiki/eclipse/core/storage/LocalXWikiDataStorage.java 2009-06-05
16:43:32 UTC (rev 20881)
+ public List<Attachment> getAttachments(String pageId) throws
XWikiEclipseException
+ {
+ List<Attachment> result = new ArrayList<Attachment>();
+
+ XWikiPage page = getPage(pageId);
+ if (page == null) {
+ return result;
+ }
+
+ IFolder pageFolder =
baseFolder.getFolder(INDEX_DIRECTORY).getFolder(page.getSpace()).getFolder(pageId);
+ if (pageFolder.exists()) {
+ try {
+ List<IResource> pageFolderResources =
getChildResources(pageFolder, IResource.DEPTH_ONE);
+ for (IResource pageFolderResource : pageFolderResources) {
+ if (pageFolderResource instanceof IFile) {
+ IFile file = (IFile) pageFolderResource;
Are you sure it's supposed to be OBJECT_SUMMARY_FILE_EXTENSION? Also see
the comment for the next file.
+ if
(file.getFileExtension().equals(OBJECT_SUMMARY_FILE_EXTENSION)) {
+ Map<String, Object> map = (Map<String, Object>)
CoreUtils.readDataFromXML(file);
+ Attachment attachment = new Attachment(map);
+ result.add(attachment);
+ }
Modified:
sandbox/gsoc/xeclipse/org.xwiki.eclipse.ui/src/main/java/org/xwiki/eclipse/ui/adapters/XWikiEclipsePageSummaryAdapter.java
===================================================================
---
sandbox/gsoc/xeclipse/org.xwiki.eclipse.ui/src/main/java/org/xwiki/eclipse/ui/adapters/XWikiEclipsePageSummaryAdapter.java 2009-06-05
16:37:12 UTC (rev 20880)
+++
sandbox/gsoc/xeclipse/org.xwiki.eclipse.ui/src/main/java/org/xwiki/eclipse/ui/adapters/XWikiEclipsePageSummaryAdapter.java 2009-06-05
16:43:32 UTC (rev 20881)
@@ -32,7 +32,6 @@
Why do you store both objects and attachments with the same code?
Shouldn't you create two lists instead?
try {
- List<XWikiEclipseObjectSummary> result =
-
pageSummary.getDataManager().getObjects(pageSummary.getData().getId());
+ List result =
pageSummary.getDataManager().getObjects(pageSummary.getData().getId());
+
result.addAll(pageSummary.getDataManager().getAttachments(pageSummary.getData().getId()));
--
Sergiu Dumitriu
http://purl.org/net/sergiu/