| From | Sent On | Attachments |
|---|---|---|
| Karthik Sudarshan | Dec 5, 2008 2:39 am | |
| Prakash Reddy K. L. V. | Dec 5, 2008 2:44 am | |
| Karthik Sudarshan | Dec 7, 2008 11:01 pm | |
| Prakash Reddy K. L. V. | Dec 7, 2008 11:09 pm |
| Subject: | Code review | |
|---|---|---|
| From: | Karthik Sudarshan (kart...@gmail.com) | |
| Date: | Dec 5, 2008 2:39:20 am | |
| List: | net.java.dev.mirage.dev | |
Hi all,
While storing a document if no folder is selected, then the document storage happens at the root of the webdav link, and this is not accessible to the plugin. I've fixed this by adding a check to see if a folder is selected or not and then continue with the storage.
Code diff:
Index: conf/DLPluginResources.properties =================================================================== --- conf/DLPluginResources.properties (revision 311) +++ conf/DLPluginResources.properties (working copy) @@ -33,6 +33,7 @@ storeDocument=Store Document storeFileToCMS=Store File to CMS noDirectoryExists=At least one folder must be created to store a document.\nPlease create a folder using the Document Library portlet in "My Community" of WebSynergy and retry +selectDirectory=Please select a folder to store the document.
#File Save Dialog filename=File Name @@ -63,3 +64,7 @@ serverDetails=Server Details serverURL=Server URL :
+#Community Dialog +communityName=Community Name +selectCommunity=Please select a Community to connect. +myCommunity=My Community Index: java/com/sun/portal/mirage/webdav/client/DocumentStoreDialog.java =================================================================== --- java/com/sun/portal/mirage/webdav/client/DocumentStoreDialog.java (revision 311) +++ java/com/sun/portal/mirage/webdav/client/DocumentStoreDialog.java (working copy) @@ -144,6 +144,10 @@ return model.getDocuments().length > 0 ? false : true; }
+ private boolean noDirectoryIsSelected() { + return folderTree.isSelectionEmpty(); + } + private class FolderSelectionListener implements TreeSelectionListener{
public void valueChanged(TreeSelectionEvent event) { @@ -261,7 +265,11 @@ if(noDirectoryExists()) { SwingUtil.showWarningMessage("noDirectoryExists"); return; + } else if (noDirectoryIsSelected()) { + SwingUtil.showWarningMessage("selectDirectory"); + return; } + if(documentTable.getSelectedRow() == -1) { FileSaveDialog dialog = new FileSaveDialog(owner, true); String selectedName = dialog.getDocumentName(screenWidth, screenHeight);
Regards, Karthik
-- The mistake people make while designing completely foolproof systems is underestimating the ingenuity of complete fools.





