You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by an...@apache.org on 2017/04/24 15:31:19 UTC

[1/2] syncope git commit: [SYNCOPE-808] added documentation, fixed problems on license and connection refresh, bugfixes

Repository: syncope
Updated Branches:
  refs/heads/master 31c7e8f90 -> fbda96720


[SYNCOPE-808] added documentation, fixed problems on license and connection refresh, bugfixes


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/d8e18a6c
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/d8e18a6c
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/d8e18a6c

Branch: refs/heads/master
Commit: d8e18a6c30634e673eb62785bf79df51114dd6b0
Parents: 31c7e8f
Author: Andrea Patricelli <an...@apache.org>
Authored: Mon Apr 24 14:59:12 2017 +0200
Committer: Andrea Patricelli <an...@apache.org>
Committed: Mon Apr 24 17:26:21 2017 +0200

----------------------------------------------------------------------
 .../syncope/ide/netbeans/ConnectionParams.java  |  11 +
 .../syncope/ide/netbeans/PluginConstants.java   |   2 +-
 .../syncope/ide/netbeans/ResourceConnector.java |  27 +-
 .../view/ResourceExplorerTopComponent.form      |   1 -
 .../view/ResourceExplorerTopComponent.java      | 255 +++++++++++--------
 .../ide/netbeans/view/ServerDetailsView.java    |   2 +-
 src/main/asciidoc/getting-started/obtain.adoc   |  66 +++++
 src/main/asciidoc/images/netbeans01.png         | Bin 0 -> 25791 bytes
 src/main/asciidoc/images/netbeans02.png         | Bin 0 -> 16210 bytes
 src/main/asciidoc/images/netbeans03.png         | Bin 0 -> 45644 bytes
 src/main/asciidoc/images/netbeans04.png         | Bin 0 -> 29113 bytes
 src/main/asciidoc/images/netbeans05.png         | Bin 0 -> 44042 bytes
 src/main/asciidoc/images/netbeans06.png         | Bin 0 -> 41707 bytes
 src/main/asciidoc/images/netbeans07.png         | Bin 0 -> 43136 bytes
 src/main/asciidoc/images/netbeans08.png         | Bin 0 -> 37402 bytes
 src/main/asciidoc/images/netbeans09.png         | Bin 0 -> 36001 bytes
 src/main/asciidoc/images/netbeans10.png         | Bin 0 -> 35085 bytes
 src/main/asciidoc/images/netbeans11.png         | Bin 0 -> 35307 bytes
 src/main/asciidoc/images/netbeans12.png         | Bin 0 -> 9614 bytes
 src/main/asciidoc/images/netbeans13.png         | Bin 0 -> 9899 bytes
 .../architecture/architecture.adoc              |   6 +
 21 files changed, 244 insertions(+), 126 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/ConnectionParams.java
----------------------------------------------------------------------
diff --git a/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/ConnectionParams.java b/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/ConnectionParams.java
index 13bbd69..f280bbb 100644
--- a/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/ConnectionParams.java
+++ b/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/ConnectionParams.java
@@ -119,4 +119,15 @@ public final class ConnectionParams {
         return this;
     }
 
+    @Override
+    public String toString() {
+        StringBuilder toStringBuilder;
+        toStringBuilder = new StringBuilder("ConnectionParams{");
+        toStringBuilder.append("url=").append(this.url);
+        toStringBuilder.append(",username=").append(this.username);
+        toStringBuilder.append(",password=").append(this.password);
+        toStringBuilder.append('}');
+        return toStringBuilder.toString();
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/PluginConstants.java
----------------------------------------------------------------------
diff --git a/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/PluginConstants.java b/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/PluginConstants.java
index 676d9a9..146e36d 100644
--- a/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/PluginConstants.java
+++ b/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/PluginConstants.java
@@ -23,7 +23,7 @@ import org.apache.syncope.common.lib.types.ReportTemplateFormat;
 
 public final class PluginConstants {
 
-    public static final String MAIL_TEMPLATE = "Mail Template";
+    public static final String MAIL_TEMPLATES = "Mail Templates";
 
     public static final String REPORT_XSLTS = "Report XSLTs";
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/ResourceConnector.java
----------------------------------------------------------------------
diff --git a/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/ResourceConnector.java b/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/ResourceConnector.java
index e666c4a..b7739fa 100644
--- a/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/ResourceConnector.java
+++ b/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/ResourceConnector.java
@@ -41,40 +41,35 @@ public final class ResourceConnector {
 
     public static MailTemplateManagerService getMailTemplateManagerService() throws IOException {
         synchronized (MAIL_TEMPLATE_MONITOR) {
-            if (MAIL_TEMPLATE_MANAGER_SERVICE == null) {
-                ConnectionParams connParams = getConnectionParams();
-                MAIL_TEMPLATE_MANAGER_SERVICE = new MailTemplateManagerService(
-                        connParams.getUrl(),
-                        connParams.getUsername(),
-                        connParams.getPassword());
-            }
+            ConnectionParams connParams = getConnectionParams();
+            MAIL_TEMPLATE_MANAGER_SERVICE = new MailTemplateManagerService(
+                    connParams.getUrl(),
+                    connParams.getUsername(),
+                    connParams.getPassword());
         }
         return MAIL_TEMPLATE_MANAGER_SERVICE;
     }
 
     public static ReportTemplateManagerService getReportTemplateManagerService() throws IOException {
         synchronized (REPORT_TEMPLATE_MONITOR) {
-            if (REPORT_TEMPLATE_MANAGER_SERVICE == null) {
-                ConnectionParams connParams = getConnectionParams();
-                REPORT_TEMPLATE_MANAGER_SERVICE = new ReportTemplateManagerService(
-                        connParams.getUrl(),
-                        connParams.getUsername(),
-                        connParams.getPassword());
-            }
+            ConnectionParams connParams = getConnectionParams();
+            REPORT_TEMPLATE_MANAGER_SERVICE = new ReportTemplateManagerService(
+                    connParams.getUrl(),
+                    connParams.getUsername(),
+                    connParams.getPassword());
         }
         return REPORT_TEMPLATE_MANAGER_SERVICE;
     }
 
     public static ConnectionParams getConnectionParams() {
         Preferences prefs = NbPreferences.forModule(ResourceExplorerTopComponent.class);
-        ConnectionParams connectionParams = ConnectionParams.builder()
+        return ConnectionParams.builder()
                 .scheme(prefs.get("scheme", "http"))
                 .host(prefs.get("host", "localhost"))
                 .port(prefs.get("port", "8080"))
                 .username(prefs.get("username", StringUtils.EMPTY))
                 .password(prefs.get("password", StringUtils.EMPTY))
                 .build();
-        return connectionParams;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/view/ResourceExplorerTopComponent.form
----------------------------------------------------------------------
diff --git a/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/view/ResourceExplorerTopComponent.form b/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/view/ResourceExplorerTopComponent.form
index f7d5783..78cec38 100644
--- a/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/view/ResourceExplorerTopComponent.form
+++ b/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/view/ResourceExplorerTopComponent.form
@@ -57,7 +57,6 @@ under the License.
               <TreeModel code=""/>
             </Property>
             <Property name="rootVisible" type="boolean" value="false"/>
-            <Property name="scrollsOnExpand" type="boolean" value="true"/>
           </Properties>
           <Events>
             <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="resourceExplorerTreeMouseClicked"/>

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/view/ResourceExplorerTopComponent.java
----------------------------------------------------------------------
diff --git a/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/view/ResourceExplorerTopComponent.java b/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/view/ResourceExplorerTopComponent.java
index 6305abe..735bc22 100644
--- a/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/view/ResourceExplorerTopComponent.java
+++ b/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/view/ResourceExplorerTopComponent.java
@@ -18,10 +18,10 @@
  */
 package org.apache.syncope.ide.netbeans.view;
 
+import java.awt.Image;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.MouseEvent;
-import java.beans.PropertyChangeListener;
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
@@ -31,7 +31,7 @@ import java.util.List;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import java.util.prefs.Preferences;
-import javax.swing.Action;
+import javax.swing.ImageIcon;
 import javax.swing.JMenuItem;
 import javax.swing.JOptionPane;
 import javax.swing.JPopupMenu;
@@ -54,7 +54,6 @@ import org.apache.syncope.ide.netbeans.service.MailTemplateManagerService;
 import org.apache.syncope.ide.netbeans.service.ReportTemplateManagerService;
 import org.netbeans.api.editor.EditorRegistry;
 import org.netbeans.api.progress.ProgressHandle;
-import org.netbeans.api.progress.ProgressHandleFactory;
 import org.netbeans.api.settings.ConvertAsProperties;
 import org.openide.awt.ActionID;
 import org.openide.awt.ActionReference;
@@ -93,8 +92,12 @@ public final class ResourceExplorerTopComponent extends TopComponent {
 
     public static final Logger LOG = Logger.getLogger("ResourceExplorerTopComponent");
 
+    private static final RequestProcessor REQUEST_PROCESSOR = new RequestProcessor(ResourceExplorerTopComponent.class);
+
     private final DefaultTreeModel treeModel;
 
+    private final DefaultMutableTreeNode visibleRoot;
+
     private final DefaultMutableTreeNode root;
 
     private final DefaultMutableTreeNode mailTemplates;
@@ -110,18 +113,16 @@ public final class ResourceExplorerTopComponent extends TopComponent {
     public ResourceExplorerTopComponent() {
 
         initComponents();
-        setName(PluginConstants.DISPLAY_NAME);
+        setName(PluginConstants.ROOT_NAME);
         setToolTipText(PluginConstants.TOOL_TIP_TEXT);
 
         treeModel = (DefaultTreeModel) resourceExplorerTree.getModel();
         root = (DefaultMutableTreeNode) treeModel.getRoot();
-        DefaultMutableTreeNode visibleRoot = new DefaultMutableTreeNode(PluginConstants.DISPLAY_NAME);
-        mailTemplates = new DefaultMutableTreeNode(PluginConstants.MAIL_TEMPLATE);
+        visibleRoot = new DefaultMutableTreeNode(PluginConstants.ROOT_NAME);
+        mailTemplates = new DefaultMutableTreeNode(PluginConstants.MAIL_TEMPLATES);
         reportXslts = new DefaultMutableTreeNode(PluginConstants.REPORT_XSLTS);
         root.add(visibleRoot);
-        visibleRoot.add(mailTemplates);
-        visibleRoot.add(reportXslts);
-        treeModel.reload();
+        initTemplatesTree();
     }
 
     /**
@@ -159,38 +160,43 @@ public final class ResourceExplorerTopComponent extends TopComponent {
     }// </editor-fold>//GEN-END:initComponents
     //CHECKSTYLE:ON
 
+    @Override
+    public Image getIcon() {
+        return new ImageIcon(getClass().getResource("/org/apache/syncope/ide/netbeans/view/favicon.png")).getImage();
+    }
+
     private void resourceExplorerTreeMouseClicked(final java.awt.event.MouseEvent evt) {
         if (evt.getButton() == MouseEvent.BUTTON1 && evt.getClickCount() == 2) {
             DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) resourceExplorerTree.
                     getLastSelectedPathComponent();
             DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode) selectedNode.getParent();
-            if (selectedNode.isLeaf()) {
-                String name = (String) selectedNode.getUserObject();
-                if (parentNode.getUserObject().equals(PluginConstants.MAIL_TEMPLATE)) {
-                    try {
-                        openMailEditor(name);
-                    } catch (IOException e) {
-                        Exceptions.printStackTrace(e);
-                    }
-                } else {
-                    try {
-                        openReportEditor(name);
-                    } catch (IOException e) {
-                        Exceptions.printStackTrace(e);
+            String parentNodeName = parentNode == null ? null : String.valueOf(parentNode.getUserObject());
+            if (selectedNode.isLeaf() && StringUtils.isNotBlank(parentNodeName)) {
+                String leafNodeName = (String) selectedNode.getUserObject();
+                try {
+                    if (PluginConstants.MAIL_TEMPLATES.equals(parentNodeName)) {
+                        openMailEditor(leafNodeName);
+                    } else if (PluginConstants.REPORT_XSLTS.equals(parentNodeName)) {
+                        openReportEditor(leafNodeName);
                     }
+                } catch (IOException e) {
+                    Exceptions.printStackTrace(e);
                 }
             }
         } else if (evt.getButton() == MouseEvent.BUTTON3 && evt.getClickCount() == 1) {
             DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) resourceExplorerTree.
                     getLastSelectedPathComponent();
             String selectedNodeName = (String) selectedNode.getUserObject();
-            if (selectedNode.isLeaf()) {
+            if (selectedNode.isLeaf()
+                    && !PluginConstants.ROOT_NAME.equals(selectedNodeName)
+                    && !PluginConstants.MAIL_TEMPLATES.equals(selectedNodeName)
+                    && !PluginConstants.REPORT_XSLTS.equals(selectedNodeName)) {
                 leafRightClickAction(evt, selectedNode);
-            } else if (selectedNodeName.equals(PluginConstants.MAIL_TEMPLATE)) {
+            } else if (PluginConstants.MAIL_TEMPLATES.equals(selectedNodeName)) {
                 folderRightClickAction(evt, mailTemplates);
-            } else if (selectedNodeName.equals(PluginConstants.REPORT_XSLTS)) {
+            } else if (PluginConstants.REPORT_XSLTS.equals(selectedNodeName)) {
                 folderRightClickAction(evt, reportXslts);
-            } else if (selectedNodeName.equals(PluginConstants.DISPLAY_NAME)) {
+            } else if (PluginConstants.ROOT_NAME.equals(selectedNodeName)) {
                 rootRightClickAction(evt);
             }
         }
@@ -215,53 +221,47 @@ public final class ResourceExplorerTopComponent extends TopComponent {
         try {
             mailTemplateManagerService = ResourceConnector.getMailTemplateManagerService();
             reportTemplateManagerService = ResourceConnector.getReportTemplateManagerService();
-        } catch (IOException e) {
-            JOptionPane.showMessageDialog(null, e.getMessage(), "Error while retrieving templates",
-                    JOptionPane.ERROR_MESSAGE);
-            new ServerDetailsView(null, true).setVisible(true);
+            // init tree, because on close it is reset
+            initTemplatesTree();
+            // Load templates
+            LOG.info("Loading Apache Syncope templates...");
+            Runnable tsk = new Runnable() {
+
+                @Override
+                public void run() {
+
+                    final ProgressHandle progr = ProgressHandle.createHandle("Loading Templates", new Cancellable() {
+
+                        @Override
+                        public boolean cancel() {
+                            return true;
+                        }
+                    });
+
+                    progr.start();
+                    progr.progress("Loading Templates.");
+                    addMailTemplates();
+                    addReportXslts();
+                    progr.finish();
+                }
+
+            };
+            REQUEST_PROCESSOR.post(tsk);
+        } catch (Exception e) {
+            JOptionPane.showMessageDialog(null, e.getMessage(), "Generic Error", JOptionPane.ERROR_MESSAGE);
+            ServerDetailsView serverDetails = getRefreshServerDetails();
         }
 
         Runnable tsk = new Runnable() {
 
             @Override
             public void run() {
-                final ProgressHandle progr = ProgressHandleFactory.createHandle("Loading Templates", new Cancellable() {
+                final ProgressHandle progr = ProgressHandle.createHandle("Loading Templates", new Cancellable() {
 
                     @Override
                     public boolean cancel() {
                         return true;
                     }
-                }, new Action() {
-
-                    @Override
-                    public Object getValue(final String key) {
-                        return null;
-                    }
-
-                    @Override
-                    public void putValue(final String key, final Object value) {
-                    }
-
-                    @Override
-                    public void setEnabled(final boolean b) {
-                    }
-
-                    @Override
-                    public boolean isEnabled() {
-                        return false;
-                    }
-
-                    @Override
-                    public void addPropertyChangeListener(final PropertyChangeListener listener) {
-                    }
-
-                    @Override
-                    public void removePropertyChangeListener(final PropertyChangeListener listener) {
-                    }
-
-                    @Override
-                    public void actionPerformed(final ActionEvent e) {
-                    }
                 });
 
                 progr.start();
@@ -312,16 +312,18 @@ public final class ResourceExplorerTopComponent extends TopComponent {
 
     private void rootRightClickAction(final MouseEvent evt) {
         JPopupMenu menu = new JPopupMenu();
-        JMenuItem saveItem = new JMenuItem("Save");
+        JMenuItem refreshItem = new JMenuItem("Refresh Templates");
         JMenuItem resetConnectionItem = new JMenuItem("Reset Connection");
-        menu.add(saveItem);
+        menu.add(refreshItem);
         menu.add(resetConnectionItem);
 
-        saveItem.addActionListener(new ActionListener() {
+        refreshItem.addActionListener(new ActionListener() {
 
             @Override
             public void actionPerformed(final ActionEvent e) {
-                saveContent();
+                // simulate close and open to refresh the tree
+                componentClosed();
+                componentOpened();
             }
         });
 
@@ -329,7 +331,7 @@ public final class ResourceExplorerTopComponent extends TopComponent {
 
             @Override
             public void actionPerformed(final ActionEvent evt) {
-                ServerDetailsView serverDetails = new ServerDetailsView(null, true);
+                ServerDetailsView serverDetails = getRefreshServerDetails();
                 // set previous preferences
                 Preferences prefs = NbPreferences.forModule(ResourceExplorerTopComponent.class);
                 serverDetails.setDetails(prefs.get("scheme", "http"),
@@ -361,47 +363,50 @@ public final class ResourceExplorerTopComponent extends TopComponent {
             public void actionPerformed(final ActionEvent e) {
                 String name = JOptionPane.showInputDialog("Enter Name");
                 boolean added = false;
-                if (node.getUserObject().equals(PluginConstants.MAIL_TEMPLATE)) {
-                    MailTemplateTO mailTemplate = new MailTemplateTO();
-                    mailTemplate.setKey(name);
-                    added = mailTemplateManagerService.create(mailTemplate);
-                    mailTemplateManagerService.setFormat(name,
-                            MailTemplateFormat.HTML,
-                            IOUtils.toInputStream("//Enter Content here", encodingPattern));
-                    mailTemplateManagerService.setFormat(name,
-                            MailTemplateFormat.TEXT,
-                            IOUtils.toInputStream("//Enter Content here", encodingPattern));
-                    try {
-                        openMailEditor(name);
-                    } catch (IOException ex) {
-                        Exceptions.printStackTrace(ex);
-                    }
-                } else {
-                    ReportTemplateTO reportTemplate = new ReportTemplateTO();
-                    reportTemplate.setKey(name);
-                    added = reportTemplateManagerService.create(reportTemplate);
-                    reportTemplateManagerService.setFormat(name,
-                            ReportTemplateFormat.FO,
-                            IOUtils.toInputStream("//Enter content here", encodingPattern));
-                    reportTemplateManagerService.setFormat(name,
-                            ReportTemplateFormat.CSV,
-                            IOUtils.toInputStream("//Enter content here", encodingPattern));
-                    reportTemplateManagerService.setFormat(name,
-                            ReportTemplateFormat.HTML,
-                            IOUtils.toInputStream("//Enter content here", encodingPattern));
-                    try {
-                        openReportEditor(name);
-                    } catch (IOException ex) {
-                        Exceptions.printStackTrace(ex);
+                if (!"exit".equals(e.getActionCommand())) {
+
+                    if (node.getUserObject().equals(PluginConstants.MAIL_TEMPLATES)) {
+                        MailTemplateTO mailTemplate = new MailTemplateTO();
+                        mailTemplate.setKey(name);
+                        added = mailTemplateManagerService.create(mailTemplate);
+                        mailTemplateManagerService.setFormat(name,
+                                MailTemplateFormat.HTML,
+                                IOUtils.toInputStream("//Enter Content here", encodingPattern));
+                        mailTemplateManagerService.setFormat(name,
+                                MailTemplateFormat.TEXT,
+                                IOUtils.toInputStream("//Enter Content here", encodingPattern));
+                        try {
+                            openMailEditor(name);
+                        } catch (IOException ex) {
+                            Exceptions.printStackTrace(ex);
+                        }
+                    } else {
+                        ReportTemplateTO reportTemplate = new ReportTemplateTO();
+                        reportTemplate.setKey(name);
+                        added = reportTemplateManagerService.create(reportTemplate);
+                        reportTemplateManagerService.setFormat(name,
+                                ReportTemplateFormat.FO,
+                                IOUtils.toInputStream("//Enter content here", encodingPattern));
+                        reportTemplateManagerService.setFormat(name,
+                                ReportTemplateFormat.CSV,
+                                IOUtils.toInputStream("//Enter content here", encodingPattern));
+                        reportTemplateManagerService.setFormat(name,
+                                ReportTemplateFormat.HTML,
+                                IOUtils.toInputStream("//Enter content here", encodingPattern));
+                        try {
+                            openReportEditor(name);
+                        } catch (IOException ex) {
+                            Exceptions.printStackTrace(ex);
+                        }
                     }
-                }
 
-                if (added) {
-                    node.add(new DefaultMutableTreeNode(name));
-                    treeModel.reload(node);
-                } else {
-                    JOptionPane.showMessageDialog(
-                            null, "Error while creating new element", "Error", JOptionPane.ERROR_MESSAGE);
+                    if (added) {
+                        node.add(new DefaultMutableTreeNode(name));
+                        treeModel.reload(node);
+                    } else {
+                        JOptionPane.showMessageDialog(
+                                null, "Error while creating new element", "Error", JOptionPane.ERROR_MESSAGE);
+                    }
                 }
             }
         });
@@ -423,7 +428,7 @@ public final class ResourceExplorerTopComponent extends TopComponent {
                 if (result == JOptionPane.OK_OPTION) {
                     DefaultMutableTreeNode parent = (DefaultMutableTreeNode) node.getParent();
                     boolean deleted;
-                    if (parent.getUserObject().equals(PluginConstants.MAIL_TEMPLATE)) {
+                    if (parent.getUserObject().equals(PluginConstants.MAIL_TEMPLATES)) {
                         deleted = mailTemplateManagerService.delete((String) node.getUserObject());
                     } else {
                         deleted = reportTemplateManagerService.delete((String) node.getUserObject());
@@ -600,4 +605,40 @@ public final class ResourceExplorerTopComponent extends TopComponent {
         }
     }
 
+    private void closeComponent() {
+        boolean isClosed = this.close();
+        if (!isClosed) {
+            LOG.log(Level.SEVERE, "Unable to close {0}", getClass().getSimpleName());
+        }
+    }
+
+    private void initTemplatesTree() {
+        visibleRoot.add(mailTemplates);
+        visibleRoot.add(reportXslts);
+        treeModel.reload();
+    }
+
+    private void resetTree() {
+        visibleRoot.removeAllChildren();
+        mailTemplates.removeAllChildren();
+        reportXslts.removeAllChildren();
+        treeModel.reload();
+    }
+
+    private ServerDetailsView getRefreshServerDetails() {
+        return new ServerDetailsView(null, true) {
+
+            private static final long serialVersionUID = 3926689175745815987L;
+
+            @Override
+            protected void okButtonActionPerformed(final ActionEvent evt) {
+                super.okButtonActionPerformed(evt);
+                // simulate close and open to refresh the tree
+                componentClosed();
+                componentOpened();
+            }
+
+        };
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/view/ServerDetailsView.java
----------------------------------------------------------------------
diff --git a/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/view/ServerDetailsView.java b/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/view/ServerDetailsView.java
index f4177ac..ba9c60c 100644
--- a/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/view/ServerDetailsView.java
+++ b/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/view/ServerDetailsView.java
@@ -160,7 +160,7 @@ public class ServerDetailsView extends JDialog {
     }// </editor-fold>//GEN-END:initComponents
     //CHECKSTYLE:ON
 
-    private void okButtonActionPerformed(final java.awt.event.ActionEvent evt) {
+    protected void okButtonActionPerformed(final java.awt.event.ActionEvent evt) {
         // validation
         List<String> validation = validate(schemeTxt, hostTxt, portTxt, userNameTxt);
         if (validation.isEmpty()) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/src/main/asciidoc/getting-started/obtain.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/getting-started/obtain.adoc b/src/main/asciidoc/getting-started/obtain.adoc
index e879e95..748716d 100644
--- a/src/main/asciidoc/getting-started/obtain.adoc
+++ b/src/main/asciidoc/getting-started/obtain.adoc
@@ -701,3 +701,69 @@ By double-clicking on each folder, the list of available templates is shown:
 image::eclipse15.png[eclipse15]
 
 Each template is now ready for authoring or removal; new templates can also be created.
+
+=== Netbeans IDE Plugin
+
+The Netbeans IDE plugin allows remote management of notification e-mail and report templates.
+
+[[netbeansplugin-installation]]
+==== Installation
+
+After http://syncope.apache.org/downloads.html[download^], start the most recent Netbeans IDE distribution then go to 
+`Tools > Plugins`:
+
+image::netbeans01.png[netbeans01]
+
+Click on `Downloaded > Add plugins`:
+
+image::netbeans02.png[netbeans02]
+
+image::netbeans03.png[netbeans03]
+
+image::netbeans04.png[netbeans04]
+
+Select `Apache Syncope` and click on `Install`:
+
+image::netbeans05.png[netbeans05]
+
+image::netbeans06.png[netbeans06]
+
+==== Setup
+
+Once installed go to `Window` > `Apache Syncope` and click on the link:
+
+image::netbeans07.png[netbeans07]
+
+If connection hasn't already been setup you will be prompted to insert connection settings:
+
+image::netbeans12.png[netbeans12]
+
+If plugin successfully connects to Apache Syncope a window showing Mail and Report templates will appear on the left and
+by double-clicking on each folder, the list of available templates is shown:
+
+image::netbeans08.png[netbeans08]
+
+To refresh templates list or to change connection parameters right-click on `Apache Syncope` root node:
+
+image::netbeans09.png[netbeans09]
+
+To create a new template right-click on the `Mail Templates` or `Report XSLTs` folder and then click on `New`:
+
+image::netbeans10.png[netbeans10]
+
+To delete an existing template right-click on the secific template file and then click on `Delete`:
+
+image::netbeans11.png[netbeans11]
+
+To edit a template jus double-click on the template and an editor will appear. While saving (CTRL+S or save button) the 
+template will automatically be saved on Apache Syncope.
+Before creating/editing a template a window will be shown with the available formats:
+
+image::netbeans13.png[netbeans13]
+
+[NOTE]
+====
+While creating a new template, though you have to choose a single format, an empty instance will be created for each 
+format available. For example for mail templates will be created three files (HTML and TEXT).
+====
+

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/src/main/asciidoc/images/netbeans01.png
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/images/netbeans01.png b/src/main/asciidoc/images/netbeans01.png
new file mode 100644
index 0000000..1fc62ae
Binary files /dev/null and b/src/main/asciidoc/images/netbeans01.png differ

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/src/main/asciidoc/images/netbeans02.png
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/images/netbeans02.png b/src/main/asciidoc/images/netbeans02.png
new file mode 100644
index 0000000..119a58b
Binary files /dev/null and b/src/main/asciidoc/images/netbeans02.png differ

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/src/main/asciidoc/images/netbeans03.png
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/images/netbeans03.png b/src/main/asciidoc/images/netbeans03.png
new file mode 100644
index 0000000..90b3bc9
Binary files /dev/null and b/src/main/asciidoc/images/netbeans03.png differ

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/src/main/asciidoc/images/netbeans04.png
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/images/netbeans04.png b/src/main/asciidoc/images/netbeans04.png
new file mode 100644
index 0000000..772b99b
Binary files /dev/null and b/src/main/asciidoc/images/netbeans04.png differ

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/src/main/asciidoc/images/netbeans05.png
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/images/netbeans05.png b/src/main/asciidoc/images/netbeans05.png
new file mode 100644
index 0000000..2018ea5
Binary files /dev/null and b/src/main/asciidoc/images/netbeans05.png differ

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/src/main/asciidoc/images/netbeans06.png
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/images/netbeans06.png b/src/main/asciidoc/images/netbeans06.png
new file mode 100644
index 0000000..6010051
Binary files /dev/null and b/src/main/asciidoc/images/netbeans06.png differ

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/src/main/asciidoc/images/netbeans07.png
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/images/netbeans07.png b/src/main/asciidoc/images/netbeans07.png
new file mode 100644
index 0000000..3078269
Binary files /dev/null and b/src/main/asciidoc/images/netbeans07.png differ

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/src/main/asciidoc/images/netbeans08.png
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/images/netbeans08.png b/src/main/asciidoc/images/netbeans08.png
new file mode 100644
index 0000000..a7a8b3d
Binary files /dev/null and b/src/main/asciidoc/images/netbeans08.png differ

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/src/main/asciidoc/images/netbeans09.png
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/images/netbeans09.png b/src/main/asciidoc/images/netbeans09.png
new file mode 100644
index 0000000..9445b67
Binary files /dev/null and b/src/main/asciidoc/images/netbeans09.png differ

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/src/main/asciidoc/images/netbeans10.png
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/images/netbeans10.png b/src/main/asciidoc/images/netbeans10.png
new file mode 100644
index 0000000..71a87a2
Binary files /dev/null and b/src/main/asciidoc/images/netbeans10.png differ

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/src/main/asciidoc/images/netbeans11.png
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/images/netbeans11.png b/src/main/asciidoc/images/netbeans11.png
new file mode 100644
index 0000000..885a945
Binary files /dev/null and b/src/main/asciidoc/images/netbeans11.png differ

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/src/main/asciidoc/images/netbeans12.png
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/images/netbeans12.png b/src/main/asciidoc/images/netbeans12.png
new file mode 100644
index 0000000..32400cf
Binary files /dev/null and b/src/main/asciidoc/images/netbeans12.png differ

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/src/main/asciidoc/images/netbeans13.png
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/images/netbeans13.png b/src/main/asciidoc/images/netbeans13.png
new file mode 100644
index 0000000..009f645
Binary files /dev/null and b/src/main/asciidoc/images/netbeans13.png differ

http://git-wip-us.apache.org/repos/asf/syncope/blob/d8e18a6c/src/main/asciidoc/reference-guide/architecture/architecture.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/reference-guide/architecture/architecture.adoc b/src/main/asciidoc/reference-guide/architecture/architecture.adoc
index 3bd9692..ce26e8c 100644
--- a/src/main/asciidoc/reference-guide/architecture/architecture.adoc
+++ b/src/main/asciidoc/reference-guide/architecture/architecture.adoc
@@ -63,3 +63,9 @@ Java <<client-library,Client Library>> (the basis of Admin UI, End-user UI and C
 The Eclipse IDE plugin allows remote management of <<notification-templates,notification e-mail>> and
 <<report-templates,report>> templates, and constitutes an example of a Java application relying on the Client Library
 for interacting with the Core via REST.
+
+==== Netbeans IDE Plugin
+
+The Netbeans IDE plugin allows remote management of <<notification-templates,notification e-mail>> and
+<<report-templates,report>> templates, and constitutes an example of a Java application relying on the Client Library
+for interacting with the Core via REST.


[2/2] syncope git commit: [SYNCOPE-808] constant name change

Posted by an...@apache.org.
[SYNCOPE-808] constant name change


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/fbda9672
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/fbda9672
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/fbda9672

Branch: refs/heads/master
Commit: fbda9672010c777bafdd4bb7e2bd4b59fe617ab4
Parents: d8e18a6
Author: Andrea Patricelli <an...@apache.org>
Authored: Mon Apr 24 17:29:24 2017 +0200
Committer: Andrea Patricelli <an...@apache.org>
Committed: Mon Apr 24 17:29:24 2017 +0200

----------------------------------------------------------------------
 ide/netbeans/nb-configuration.xml                         | 10 +++++-----
 .../org/apache/syncope/ide/netbeans/PluginConstants.java  |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/fbda9672/ide/netbeans/nb-configuration.xml
----------------------------------------------------------------------
diff --git a/ide/netbeans/nb-configuration.xml b/ide/netbeans/nb-configuration.xml
index 5f6593d..93c2817 100644
--- a/ide/netbeans/nb-configuration.xml
+++ b/ide/netbeans/nb-configuration.xml
@@ -18,19 +18,19 @@ specific language governing permissions and limitations
 under the License.
 -->
 <project-shared-configuration>
-  <!--
+    <!--
   This file contains additional configuration written by modules in the NetBeans IDE.
   The configuration is intended to be shared among all the users of project and
   therefore it is assumed to be part of version control checkout.
   Without this configuration present, some functionality in the IDE may be limited or fail altogether.
   -->
-  <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
-    <!--
+    <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
+        <!--
     Properties that influence various parts of the IDE, especially code formatting and the like. 
     You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
     That way multiple projects can share the same settings (useful for formatting rules for example).
     Any value defined here will override the pom.xml file value but is only applicable to the current project.
     -->
-    <org-netbeans-modules-javascript2-requirejs.enabled>true</org-netbeans-modules-javascript2-requirejs.enabled>
-  </properties>
+        <org-netbeans-modules-javascript2-requirejs.enabled>true</org-netbeans-modules-javascript2-requirejs.enabled>
+    </properties>
 </project-shared-configuration>

http://git-wip-us.apache.org/repos/asf/syncope/blob/fbda9672/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/PluginConstants.java
----------------------------------------------------------------------
diff --git a/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/PluginConstants.java b/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/PluginConstants.java
index 146e36d..ea2fd80 100644
--- a/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/PluginConstants.java
+++ b/ide/netbeans/src/main/java/org/apache/syncope/ide/netbeans/PluginConstants.java
@@ -33,7 +33,7 @@ public final class PluginConstants {
     public static final String[] REPORT_TEMPLATE_FORMATS = {
         ReportTemplateFormat.HTML.name(), ReportTemplateFormat.CSV.name(), ReportTemplateFormat.FO.name() };
 
-    public static final String DISPLAY_NAME = "Apache Syncope";
+    public static final String ROOT_NAME = "Apache Syncope";
 
     public static final String TOOL_TIP_TEXT = "This is a Apache Syncope window";