[GitHub] syncope pull request #39: [SYNCOPE-808] Added Netbeans Plugin to SYNCOPE 2_0...

2017-01-03 Thread tmess567
Github user tmess567 closed the pull request at:

https://github.com/apache/syncope/pull/39


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #39: [SYNCOPE-808] Added Netbeans Plugin to SYNCOPE 2_0...

2016-12-02 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/39#discussion_r90640284
  
--- Diff: 
ide/netbeans/src/main/java/org/apache/syncope/netbeans/plugin/connector/ResourceConnector.java
 ---
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.netbeans.plugin.connector;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import org.apache.syncope.netbeans.plugin.entity.UserProperties;
+import 
org.apache.syncope.netbeans.plugin.service.MailTemplateManagerService;
+import 
org.apache.syncope.netbeans.plugin.service.ReportTemplateManagerService;
+
+public final class ResourceConnector {
+
+private ResourceConnector() {
+}
+
+private static MailTemplateManagerService 
MAIL_TTEMPLATE_MANAGER_SERVICE;
+private static ReportTemplateManagerService 
REPORT_TEMPLATE_MANAGER_SERVICE;
+
+public static MailTemplateManagerService 
getMailTemplateManagerService() throws IOException {
+if (MAIL_TTEMPLATE_MANAGER_SERVICE == null) {
--- End diff --

Static code can be accessed by multiple concurrent threads.
I would:
 * declare a monitor object as class static field:
  ```java
private static final Object MONITOR = new Object();
  ```
 * put the whole if block within a `synchronized` block, like as
  ```java
synchronized(MONITOR) {
if (MAIL_TTEMPLATE_MANAGER_SERVICE == null) {
 UserProperties userProperties = getUserProperties();
 MAIL_TTEMPLATE_MANAGER_SERVICE = new 
MailTemplateManagerService(
 userProperties.getUrl(), userProperties.getUserName(),
 userProperties.getPassword());
 }
}
 return MAIL_TTEMPLATE_MANAGER_SERVICE;
  ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #39: [SYNCOPE-808] Added Netbeans Plugin to SYNCOPE 2_0...

2016-12-02 Thread tmess567
Github user tmess567 commented on a diff in the pull request:

https://github.com/apache/syncope/pull/39#discussion_r90639419
  
--- Diff: ide/netbeans/pom.xml ---
@@ -63,99 +61,79 @@ under the License.
 
 
 org.netbeans.api
-org-netbeans-api-annotations-common
--- End diff --

Re-added it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #39: [SYNCOPE-808] Added Netbeans Plugin to SYNCOPE 2_0...

2016-12-02 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/39#discussion_r90599936
  
--- Diff: ide/netbeans/pom.xml ---
@@ -63,99 +61,79 @@ under the License.
 
 
 org.netbeans.api
-org-netbeans-api-annotations-common
--- End diff --

`artifactId` removed??!?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #39: [SYNCOPE-808] Added Netbeans Plugin to SYNCOPE 2_0...

2016-10-31 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/39#discussion_r85767004
  
--- Diff: 
ide/netbeans/src/main/java/org/apache/syncope/netbeans/plugin/view/ResourceExplorerTopComponent.java
 ---
@@ -0,0 +1,550 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.netbeans.plugin.view;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.beans.PropertyChangeListener;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.Charset;
+import java.util.List;
+import javax.swing.Action;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPopupMenu;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import javax.swing.text.JTextComponent;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeModel;
+import org.apache.commons.io.IOUtils;
+import org.apache.syncope.common.lib.to.MailTemplateTO;
+import org.apache.syncope.common.lib.to.ReportTemplateTO;
+import org.apache.syncope.common.lib.types.MailTemplateFormat;
+import org.apache.syncope.common.lib.types.ReportTemplateFormat;
+import org.apache.syncope.netbeans.plugin.connector.ResourceConnector;
+import org.apache.syncope.netbeans.plugin.constants.PluginConstants;
+import 
org.apache.syncope.netbeans.plugin.service.MailTemplateManagerService;
+import 
org.apache.syncope.netbeans.plugin.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;
+import org.openide.cookies.OpenCookie;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.loaders.DataObject;
+import org.openide.util.Cancellable;
+import org.openide.util.Exceptions;
+import org.openide.util.RequestProcessor;
+import org.openide.windows.TopComponent;
+
+/**
+ * Top component which displays something.
+ */
+@ConvertAsProperties(
+dtd = 
"-//org.apache.syncope.netbeans.plugin//ResourceExplorer//EN",
+autostore = false
+)
+@TopComponent.Description(
+preferredID = "ResourceExplorerTopComponent",
+iconBase = "images/syncope.png",
+persistenceType = TopComponent.PERSISTENCE_ALWAYS
+)
+@TopComponent.Registration(mode = "explorer", openAtStartup = false)
+@ActionID(category = "Window", id = 
"org.apache.syncope.netbeans.plugin.ResourceExplorerTopComponent")
+@ActionReference(path = "Menu/Window" /*, position = 333 */)
+@TopComponent.OpenActionRegistration(
+displayName = "Apache Syncope",
+preferredID = "ResourceExplorerTopComponent"
+)
+
+public final class ResourceExplorerTopComponent extends TopComponent {
+
+private DefaultTreeModel treeModel;
+private DefaultMutableTreeNode root;
+private DefaultMutableTreeNode mailTemplates;
+private DefaultMutableTreeNode reportXslts;
+private MailTemplateManagerService mailTemplateManagerService;
+private ReportTemplateManagerService reportTemplateManagerService;
+private Charset encodingPattern;
+
+public ResourceExplorerTopComponent() {
+
+initComponents();
+setName(PluginConstants.DISPLAY_NAME);
+setToolTipText(PluginConstants.TOOL_TIP_TEXT);
+
+treeModel = (DefaultTreeModel) resourceExplorerTree.getModel();
+root = 

[GitHub] syncope pull request #39: [SYNCOPE-808] Added Netbeans Plugin to SYNCOPE 2_0...

2016-10-31 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/39#discussion_r85766497
  
--- Diff: 
ide/netbeans/src/main/java/org/apache/syncope/netbeans/plugin/connector/ResourceConnector.java
 ---
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.netbeans.plugin.connector;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import org.apache.syncope.netbeans.plugin.entity.UserProperties;
+import 
org.apache.syncope.netbeans.plugin.service.MailTemplateManagerService;
+import 
org.apache.syncope.netbeans.plugin.service.ReportTemplateManagerService;
+
+public final class ResourceConnector {
+
+private ResourceConnector() {
+}
+
+private static MailTemplateManagerService 
MAIL_TTEMPLATE_MANAGER_SERVICE;
+private static ReportTemplateManagerService 
REPORT_TEMPLATE_MANAGER_SERVICE;
+
+public static MailTemplateManagerService 
getMailTemplateManagerService() throws IOException {
+if (MAIL_TTEMPLATE_MANAGER_SERVICE == null) {
--- End diff --

Is this thead safe?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #39: [SYNCOPE-808] Added Netbeans Plugin to SYNCOPE 2_0...

2016-10-31 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/39#discussion_r85766261
  
--- Diff: ide/netbeans/pom.xml ---
@@ -0,0 +1,161 @@
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+4.0.0
+
+  org.apache.syncope
+  syncope-ide
+  2.0.2-SNAPSHOT
+
+
+Apache Syncope IDE Netbeans
+Apache Syncope IDE Netbeans
+org.apache.syncope.ide
+syncope-ide-netbeans
+
+nbm
+
+
+  ${basedir}/../..
+
+
+
+
+
+org.codehaus.mojo
+nbm-maven-plugin
+${nbm-maven-plugin-version}
+true
+
+false
+
+
+
+org.apache.maven.plugins
+maven-jar-plugin
+${maven-jar-plugin-version}
+
+
+
${project.build.outputDirectory}/META-INF/MANIFEST.MF
+
+
+
+
+
+
+
+
+org.netbeans.api
+org-netbeans-api-annotations-common
+${org-netbeans-api-version}
--- End diff --

This should be declared in the `` section of the root 
POM and then put here without version.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #39: [SYNCOPE-808] Added Netbeans Plugin to SYNCOPE 2_0...

2016-10-31 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/39#discussion_r85766165
  
--- Diff: ide/netbeans/pom.xml ---
@@ -0,0 +1,161 @@
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+4.0.0
+
+  org.apache.syncope
+  syncope-ide
+  2.0.2-SNAPSHOT
+
+
+Apache Syncope IDE Netbeans
+Apache Syncope IDE Netbeans
+org.apache.syncope.ide
+syncope-ide-netbeans
+
+nbm
+
+
+  ${basedir}/../..
+
+
+
+
+
+org.codehaus.mojo
+nbm-maven-plugin
+${nbm-maven-plugin-version}
--- End diff --

This should be declared in the `` section of the root 
POM and then put here without version.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #39: [SYNCOPE-808] Added Netbeans Plugin to SYNCOPE 2_0...

2016-10-31 Thread ilgrosso
Github user ilgrosso commented on a diff in the pull request:

https://github.com/apache/syncope/pull/39#discussion_r85766205
  
--- Diff: ide/netbeans/pom.xml ---
@@ -0,0 +1,161 @@
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+4.0.0
+
+  org.apache.syncope
+  syncope-ide
+  2.0.2-SNAPSHOT
+
+
+Apache Syncope IDE Netbeans
+Apache Syncope IDE Netbeans
+org.apache.syncope.ide
+syncope-ide-netbeans
+
+nbm
+
+
+  ${basedir}/../..
+
+
+
+
+
+org.codehaus.mojo
+nbm-maven-plugin
+${nbm-maven-plugin-version}
+true
+
+false
+
+
+
+org.apache.maven.plugins
+maven-jar-plugin
+${maven-jar-plugin-version}
--- End diff --

This should be declared in the `` section of the root 
POM and then put here without version.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] syncope pull request #39: [SYNCOPE-808] Added Netbeans Plugin to SYNCOPE 2_0...

2016-10-31 Thread tmess567
GitHub user tmess567 opened a pull request:

https://github.com/apache/syncope/pull/39

[SYNCOPE-808] Added Netbeans Plugin to SYNCOPE 2_0_X

Please have a look

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/tmess567/syncope SYNCOPE-808-2.0.X

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/syncope/pull/39.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #39


commit f6540f2a9660d3a07a1d713bac4ca9b363a7e3ed
Author: Tushar 
Date:   2016-10-31T15:33:58Z

SYNCOPE-808 Added Netbeans Plugin to SYNCOPE 2_0_X




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---