Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.4, 2.1.0
    • Component/s: ide
    • Labels:
    • Environment:
      Netbeans IDE

      Description

      Develop a plug-in, according to what reported in SYNCOPE-770, working with latest Netbeans version.

      See Google Summer of Code project proposal at https://summerofcode.withgoogle.com/projects/#5722525799546880

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user andrea-patricelli commented on the issue:

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

          Hi Nuwan,
          see comments above, there is my feedback about PR.

          • Pay attention to license headers, they are wrong! You can take correct license from whatever file into the project (for example root pom.xml).
          • Can you also rename PR by including tag SYNCOPE-808?
          Show
          githubbot ASF GitHub Bot added a comment - Github user andrea-patricelli commented on the issue: https://github.com/apache/syncope/pull/27 Hi Nuwan, see comments above, there is my feedback about PR. Pay attention to license headers, they are wrong! You can take correct license from whatever file into the project (for example root pom.xml). Can you also rename PR by including tag SYNCOPE-808 ?
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user tmess567 opened a pull request:

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

          SYNCOPE-808 Added Nuwan's #27 PR

          Please check and inform about any required changes.

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

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

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

          https://github.com/apache/syncope/pull/38.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 #38


          commit 51a382186b4c9acf1bd3d0f24ac6958bf64c8f28
          Author: Tushar <tusharm567@gmail.com>
          Date: 2016-10-28T15:02:27Z

          SYNCOPE-808 Added Nuwan's #27 PR


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user tmess567 opened a pull request: https://github.com/apache/syncope/pull/38 SYNCOPE-808 Added Nuwan's #27 PR Please check and inform about any required changes. You can merge this pull request into a Git repository by running: $ git pull https://github.com/tmess567/syncope SYNCOPE-808 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/syncope/pull/38.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 #38 commit 51a382186b4c9acf1bd3d0f24ac6958bf64c8f28 Author: Tushar <tusharm567@gmail.com> Date: 2016-10-28T15:02:27Z SYNCOPE-808 Added Nuwan's #27 PR
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ilgrosso commented on a diff in the pull request:

          https://github.com/apache/syncope/pull/38#discussion_r85550383

          — Diff: ide/netbeans/pom.xml —
          @@ -0,0 +1,141 @@
          +<?xml version="1.0" encoding="UTF-8"?>
          +<!--
          +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 owership. 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.
          +-->
          +<project xmlns="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">
          + <modelVersion>4.0.0</modelVersion>
          + <parent>
          + <groupId>org.apache.syncope</groupId>
          + <artifactId>syncope</artifactId>
          + <version>2.0.0-SNAPSHOT</version>
          — End diff –

          We're on 2.0.2-SNAPSHOT currently.

          Show
          githubbot ASF GitHub Bot added a comment - Github user ilgrosso commented on a diff in the pull request: https://github.com/apache/syncope/pull/38#discussion_r85550383 — Diff: ide/netbeans/pom.xml — @@ -0,0 +1,141 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +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 owership. 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. +--> +<project xmlns="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 "> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.syncope</groupId> + <artifactId>syncope</artifactId> + <version>2.0.0-SNAPSHOT</version> — End diff – We're on 2.0.2-SNAPSHOT currently.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ilgrosso commented on a diff in the pull request:

          https://github.com/apache/syncope/pull/38#discussion_r85550486

          — Diff: ide/netbeans/pom.xml —
          @@ -0,0 +1,141 @@
          +<?xml version="1.0" encoding="UTF-8"?>
          +<!--
          +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 owership. 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.
          +-->
          +<project xmlns="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">
          + <modelVersion>4.0.0</modelVersion>
          + <parent>
          + <groupId>org.apache.syncope</groupId>
          + <artifactId>syncope</artifactId>
          + <version>2.0.0-SNAPSHOT</version>
          + </parent>
          + <artifactId>netbeans-plugin</artifactId>
          + <name>Apache Syncope Netbeans Plugin</name>
          + <packaging>nbm</packaging>
          + <build>
          + <plugins>
          + <plugin>
          + <groupId>org.codehaus.mojo</groupId>
          + <artifactId>nbm-maven-plugin</artifactId>
          + <version>3.13</version>
          — End diff –

          Plugin and dependency version should be set in the root pom

          Show
          githubbot ASF GitHub Bot added a comment - Github user ilgrosso commented on a diff in the pull request: https://github.com/apache/syncope/pull/38#discussion_r85550486 — Diff: ide/netbeans/pom.xml — @@ -0,0 +1,141 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +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 owership. 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. +--> +<project xmlns="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 "> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.syncope</groupId> + <artifactId>syncope</artifactId> + <version>2.0.0-SNAPSHOT</version> + </parent> + <artifactId>netbeans-plugin</artifactId> + <name>Apache Syncope Netbeans Plugin</name> + <packaging>nbm</packaging> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>nbm-maven-plugin</artifactId> + <version>3.13</version> — End diff – Plugin and dependency version should be set in the root pom
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ilgrosso commented on a diff in the pull request:

          https://github.com/apache/syncope/pull/38#discussion_r85550556

          — Diff: ide/netbeans/pom.xml —
          @@ -0,0 +1,141 @@
          +<?xml version="1.0" encoding="UTF-8"?>
          +<!--
          +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 owership. 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.
          +-->
          +<project xmlns="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">
          + <modelVersion>4.0.0</modelVersion>
          + <parent>
          + <groupId>org.apache.syncope</groupId>
          + <artifactId>syncope</artifactId>
          + <version>2.0.0-SNAPSHOT</version>
          + </parent>
          + <artifactId>netbeans-plugin</artifactId>
          + <name>Apache Syncope Netbeans Plugin</name>
          + <packaging>nbm</packaging>
          + <build>
          + <plugins>
          + <plugin>
          + <groupId>org.codehaus.mojo</groupId>
          + <artifactId>nbm-maven-plugin</artifactId>
          + <version>3.13</version>
          + <extensions>true</extensions>
          + <configuration>
          + <useOSGiDependencies>false</useOSGiDependencies>
          + </configuration>
          + </plugin>
          + <plugin>
          + <groupId>org.apache.maven.plugins</groupId>
          + <artifactId>maven-jar-plugin</artifactId>
          + <version>3.0.0</version>
          + <configuration>
          + <archive>
          + <manifestFile>$

          {project.build.outputDirectory}

          /META-INF/MANIFEST.MF</manifestFile>
          + </archive>
          + </configuration>
          + </plugin>
          + <plugin>
          + <groupId>org.codehaus.mojo</groupId>
          — End diff –

          Why skipping IANAL?

          Show
          githubbot ASF GitHub Bot added a comment - Github user ilgrosso commented on a diff in the pull request: https://github.com/apache/syncope/pull/38#discussion_r85550556 — Diff: ide/netbeans/pom.xml — @@ -0,0 +1,141 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +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 owership. 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. +--> +<project xmlns="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 "> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.syncope</groupId> + <artifactId>syncope</artifactId> + <version>2.0.0-SNAPSHOT</version> + </parent> + <artifactId>netbeans-plugin</artifactId> + <name>Apache Syncope Netbeans Plugin</name> + <packaging>nbm</packaging> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>nbm-maven-plugin</artifactId> + <version>3.13</version> + <extensions>true</extensions> + <configuration> + <useOSGiDependencies>false</useOSGiDependencies> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>3.0.0</version> + <configuration> + <archive> + <manifestFile>$ {project.build.outputDirectory} /META-INF/MANIFEST.MF</manifestFile> + </archive> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> — End diff – Why skipping IANAL?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ilgrosso commented on a diff in the pull request:

          https://github.com/apache/syncope/pull/38#discussion_r85550643

          — 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 static MailTemplateManagerService MAIL_TTEMPLATE_MANAGER_SERVICE;
          + private static ReportTemplateManagerService REPORT_TEMPLATE_MANAGER_SERVICE;
          +
          + private ResourceConnector() {
          — End diff –

          Is this empty constructor needed?

          Show
          githubbot ASF GitHub Bot added a comment - Github user ilgrosso commented on a diff in the pull request: https://github.com/apache/syncope/pull/38#discussion_r85550643 — 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 static MailTemplateManagerService MAIL_TTEMPLATE_MANAGER_SERVICE; + private static ReportTemplateManagerService REPORT_TEMPLATE_MANAGER_SERVICE; + + private ResourceConnector() { — End diff – Is this empty constructor needed?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ilgrosso commented on a diff in the pull request:

          https://github.com/apache/syncope/pull/38#discussion_r85551050

          — Diff: ide/netbeans/src/main/java/org/apache/syncope/netbeans/plugin/view/ResourceExplorerTopComponent.java —
          @@ -0,0 +1,561 @@
          +/*
          + * 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.Image;
          +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.netbeans.core.spi.multiview.MultiViewDescription;
          — End diff –

          Commented imports?

          Show
          githubbot ASF GitHub Bot added a comment - Github user ilgrosso commented on a diff in the pull request: https://github.com/apache/syncope/pull/38#discussion_r85551050 — Diff: ide/netbeans/src/main/java/org/apache/syncope/netbeans/plugin/view/ResourceExplorerTopComponent.java — @@ -0,0 +1,561 @@ +/* + * 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.Image; +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.netbeans.core.spi.multiview.MultiViewDescription; — End diff – Commented imports?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ilgrosso commented on a diff in the pull request:

          https://github.com/apache/syncope/pull/38#discussion_r85551221

          — Diff: ide/netbeans/src/main/java/org/apache/syncope/netbeans/plugin/view/ResourceExplorerTopComponent.java —
          @@ -0,0 +1,561 @@
          +/*
          + * 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.Image;
          +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.netbeans.core.spi.multiview.MultiViewDescription;
          +//import org.netbeans.core.spi.multiview.MultiViewElement;
          +//import org.netbeans.core.spi.multiview.MultiViewFactory;
          +//import org.netbeans.core.spi.multiview.text.MultiViewEditorElement;
          +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.HelpCtx;
          +//import org.openide.util.Lookup;
          +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 = (DefaultMutableTreeNode) treeModel.getRoot(); + DefaultMutableTreeNode visibleRoot + = new DefaultMutableTreeNode(PluginConstants.DISPLAY_NAME); + mailTemplates = new DefaultMutableTreeNode(PluginConstants.MAIL_TEMPLTAE_CONSTANT); + reportXslts = new DefaultMutableTreeNode(PluginConstants.REPORT_XSLTS_CONSTANT); + root.add(visibleRoot); + visibleRoot.add(mailTemplates); + visibleRoot.add(reportXslts); + treeModel.reload(); + + }

          +
          + /**
          + * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The
          + * content of this method is always regenerated by the Form Editor.
          + */
          + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
          + private void initComponents() {
          +
          + jScrollPane1 = new javax.swing.JScrollPane();
          + resourceExplorerTree = new javax.swing.JTree();
          +
          + javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("root");
          + resourceExplorerTree.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1));
          + resourceExplorerTree.setRootVisible(false);
          + resourceExplorerTree.setScrollsOnExpand(true);
          + resourceExplorerTree.addMouseListener(new java.awt.event.MouseAdapter() {
          + public void mouseClicked(final java.awt.event.MouseEvent evt)

          { + resourceExplorerTreeMouseClicked(evt); + }

          + });
          + jScrollPane1.setViewportView(resourceExplorerTree);
          +
          + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
          + this.setLayout(layout);
          + layout.setHorizontalGroup(
          + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE)
          + );
          + layout.setVerticalGroup(
          + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 445, Short.MAX_VALUE)
          + );
          + }
          + // </editor-fold>//GEN-END:initComponents
          +
          + 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_TEMPLTAE_CONSTANT)) {
          + try

          { + openMailEditor(name); + }

          catch (IOException ex)

          { + Exceptions.printStackTrace(ex); + }
          + } else {
          + try { + openReportEditor(name); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + }

          + }
          + }
          + } else if (evt.getButton() == MouseEvent.BUTTON3 && evt.getClickCount() == 1) {
          + DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) resourceExplorerTree.
          + getLastSelectedPathComponent();
          + String selectedNodeName = (String) selectedNode.getUserObject();
          + if (selectedNode.isLeaf())

          { + leafRightClickAction(evt, selectedNode); + }

          else if (selectedNodeName.equals(PluginConstants.MAIL_TEMPLTAE_CONSTANT))

          { + folderRightClickAction(evt, mailTemplates); + }

          else if (selectedNodeName.equals(PluginConstants.REPORT_XSLTS_CONSTANT))

          { + folderRightClickAction(evt, reportXslts); + }

          else if (selectedNodeName.equals(PluginConstants.DISPLAY_NAME))

          { + rootRightClickAction(evt); + }

          + }
          + }
          +
          + // Variables declaration - do not modify//GEN-BEGIN:variables
          + private javax.swing.JScrollPane jScrollPane1;
          + private javax.swing.JTree resourceExplorerTree;
          + // End of variables declaration//GEN-END:variables
          +
          + @Override
          + public void componentOpened() {
          + File file = new File("UserData.txt");
          + if (!file.exists())

          { + new ServerDetailsView(null, true).setVisible(true); + }
          + try { + mailTemplateManagerService = ResourceConnector.getMailTemplateManagerService(); + } catch (IOException ex) { + JOptionPane.showMessageDialog(null, "Error Occured.", "Error", + JOptionPane.ERROR_MESSAGE); + new ServerDetailsView(null, true).setVisible(true); + }
          + try { + reportTemplateManagerService + = ResourceConnector.getReportTemplateManagerService(); + } catch (IOException ex) { + new ServerDetailsView(null, true).setVisible(true); + }

          +
          + Runnable tsk = new Runnable() {
          + @Override
          + public void run() {
          + final ProgressHandle progr = ProgressHandleFactory.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();
          + progr.progress("Loading Templates.");
          + addMailTemplates();
          + addReportXslts();
          + progr.finish();
          + }
          +
          + };
          + RequestProcessor.getDefault().post(tsk);
          + }
          +
          + @Override
          + public void componentClosed()

          { + // TODO add custom code on component closing + }

          +
          + void writeProperties(final java.util.Properties p)

          { + // better to version settings since initial version as advocated at + // http://wiki.apidesign.org/wiki/PropertyFiles + p.setProperty("version", "1.0"); + // TODO store your settings + }

          +
          + void readProperties(final java.util.Properties p) {
          + String version = p.getProperty("version");
          + // TODO read your settings according to their version
          — End diff –

          TODO?

          Show
          githubbot ASF GitHub Bot added a comment - Github user ilgrosso commented on a diff in the pull request: https://github.com/apache/syncope/pull/38#discussion_r85551221 — Diff: ide/netbeans/src/main/java/org/apache/syncope/netbeans/plugin/view/ResourceExplorerTopComponent.java — @@ -0,0 +1,561 @@ +/* + * 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.Image; +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.netbeans.core.spi.multiview.MultiViewDescription; +//import org.netbeans.core.spi.multiview.MultiViewElement; +//import org.netbeans.core.spi.multiview.MultiViewFactory; +//import org.netbeans.core.spi.multiview.text.MultiViewEditorElement; +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.HelpCtx; +//import org.openide.util.Lookup; +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 = (DefaultMutableTreeNode) treeModel.getRoot(); + DefaultMutableTreeNode visibleRoot + = new DefaultMutableTreeNode(PluginConstants.DISPLAY_NAME); + mailTemplates = new DefaultMutableTreeNode(PluginConstants.MAIL_TEMPLTAE_CONSTANT); + reportXslts = new DefaultMutableTreeNode(PluginConstants.REPORT_XSLTS_CONSTANT); + root.add(visibleRoot); + visibleRoot.add(mailTemplates); + visibleRoot.add(reportXslts); + treeModel.reload(); + + } + + /** + * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The + * content of this method is always regenerated by the Form Editor. + */ + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jScrollPane1 = new javax.swing.JScrollPane(); + resourceExplorerTree = new javax.swing.JTree(); + + javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("root"); + resourceExplorerTree.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1)); + resourceExplorerTree.setRootVisible(false); + resourceExplorerTree.setScrollsOnExpand(true); + resourceExplorerTree.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(final java.awt.event.MouseEvent evt) { + resourceExplorerTreeMouseClicked(evt); + } + }); + jScrollPane1.setViewportView(resourceExplorerTree); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 445, Short.MAX_VALUE) + ); + } + // </editor-fold>//GEN-END:initComponents + + 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_TEMPLTAE_CONSTANT)) { + try { + openMailEditor(name); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } else { + try { + openReportEditor(name); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } + } + } else if (evt.getButton() == MouseEvent.BUTTON3 && evt.getClickCount() == 1) { + DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) resourceExplorerTree. + getLastSelectedPathComponent(); + String selectedNodeName = (String) selectedNode.getUserObject(); + if (selectedNode.isLeaf()) { + leafRightClickAction(evt, selectedNode); + } else if (selectedNodeName.equals(PluginConstants.MAIL_TEMPLTAE_CONSTANT)) { + folderRightClickAction(evt, mailTemplates); + } else if (selectedNodeName.equals(PluginConstants.REPORT_XSLTS_CONSTANT)) { + folderRightClickAction(evt, reportXslts); + } else if (selectedNodeName.equals(PluginConstants.DISPLAY_NAME)) { + rootRightClickAction(evt); + } + } + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTree resourceExplorerTree; + // End of variables declaration//GEN-END:variables + + @Override + public void componentOpened() { + File file = new File("UserData.txt"); + if (!file.exists()) { + new ServerDetailsView(null, true).setVisible(true); + } + try { + mailTemplateManagerService = ResourceConnector.getMailTemplateManagerService(); + } catch (IOException ex) { + JOptionPane.showMessageDialog(null, "Error Occured.", "Error", + JOptionPane.ERROR_MESSAGE); + new ServerDetailsView(null, true).setVisible(true); + } + try { + reportTemplateManagerService + = ResourceConnector.getReportTemplateManagerService(); + } catch (IOException ex) { + new ServerDetailsView(null, true).setVisible(true); + } + + Runnable tsk = new Runnable() { + @Override + public void run() { + final ProgressHandle progr = ProgressHandleFactory.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(); + progr.progress("Loading Templates."); + addMailTemplates(); + addReportXslts(); + progr.finish(); + } + + }; + RequestProcessor.getDefault().post(tsk); + } + + @Override + public void componentClosed() { + // TODO add custom code on component closing + } + + void writeProperties(final java.util.Properties p) { + // better to version settings since initial version as advocated at + // http://wiki.apidesign.org/wiki/PropertyFiles + p.setProperty("version", "1.0"); + // TODO store your settings + } + + void readProperties(final java.util.Properties p) { + String version = p.getProperty("version"); + // TODO read your settings according to their version — End diff – TODO?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ilgrosso commented on a diff in the pull request:

          https://github.com/apache/syncope/pull/38#discussion_r85551315

          — Diff: ide/netbeans/src/main/java/org/apache/syncope/netbeans/plugin/view/ResourceExplorerTopComponent.java —
          @@ -0,0 +1,561 @@
          +/*
          + * 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.Image;
          +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.netbeans.core.spi.multiview.MultiViewDescription;
          +//import org.netbeans.core.spi.multiview.MultiViewElement;
          +//import org.netbeans.core.spi.multiview.MultiViewFactory;
          +//import org.netbeans.core.spi.multiview.text.MultiViewEditorElement;
          +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.HelpCtx;
          +//import org.openide.util.Lookup;
          +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 = (DefaultMutableTreeNode) treeModel.getRoot(); + DefaultMutableTreeNode visibleRoot + = new DefaultMutableTreeNode(PluginConstants.DISPLAY_NAME); + mailTemplates = new DefaultMutableTreeNode(PluginConstants.MAIL_TEMPLTAE_CONSTANT); + reportXslts = new DefaultMutableTreeNode(PluginConstants.REPORT_XSLTS_CONSTANT); + root.add(visibleRoot); + visibleRoot.add(mailTemplates); + visibleRoot.add(reportXslts); + treeModel.reload(); + + }

          +
          + /**
          + * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The
          + * content of this method is always regenerated by the Form Editor.
          + */
          + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
          + private void initComponents() {
          +
          + jScrollPane1 = new javax.swing.JScrollPane();
          + resourceExplorerTree = new javax.swing.JTree();
          +
          + javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("root");
          + resourceExplorerTree.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1));
          + resourceExplorerTree.setRootVisible(false);
          + resourceExplorerTree.setScrollsOnExpand(true);
          + resourceExplorerTree.addMouseListener(new java.awt.event.MouseAdapter() {
          + public void mouseClicked(final java.awt.event.MouseEvent evt)

          { + resourceExplorerTreeMouseClicked(evt); + }

          + });
          + jScrollPane1.setViewportView(resourceExplorerTree);
          +
          + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
          + this.setLayout(layout);
          + layout.setHorizontalGroup(
          + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE)
          + );
          + layout.setVerticalGroup(
          + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 445, Short.MAX_VALUE)
          + );
          + }
          + // </editor-fold>//GEN-END:initComponents
          +
          + 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_TEMPLTAE_CONSTANT)) {
          + try

          { + openMailEditor(name); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + }
          + } else {
          + try { + openReportEditor(name); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + }
          + }
          + }
          + } else if (evt.getButton() == MouseEvent.BUTTON3 && evt.getClickCount() == 1) {
          + DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) resourceExplorerTree.
          + getLastSelectedPathComponent();
          + String selectedNodeName = (String) selectedNode.getUserObject();
          + if (selectedNode.isLeaf()) { + leafRightClickAction(evt, selectedNode); + } else if (selectedNodeName.equals(PluginConstants.MAIL_TEMPLTAE_CONSTANT)) { + folderRightClickAction(evt, mailTemplates); + } else if (selectedNodeName.equals(PluginConstants.REPORT_XSLTS_CONSTANT)) { + folderRightClickAction(evt, reportXslts); + } else if (selectedNodeName.equals(PluginConstants.DISPLAY_NAME)) { + rootRightClickAction(evt); + }
          + }
          + }
          +
          + // Variables declaration - do not modify//GEN-BEGIN:variables
          + private javax.swing.JScrollPane jScrollPane1;
          + private javax.swing.JTree resourceExplorerTree;
          + // End of variables declaration//GEN-END:variables
          +
          + @Override
          + public void componentOpened() {
          + File file = new File("UserData.txt");
          + if (!file.exists()) { + new ServerDetailsView(null, true).setVisible(true); + }
          + try { + mailTemplateManagerService = ResourceConnector.getMailTemplateManagerService(); + } catch (IOException ex) { + JOptionPane.showMessageDialog(null, "Error Occured.", "Error", + JOptionPane.ERROR_MESSAGE); + new ServerDetailsView(null, true).setVisible(true); + }
          + try { + reportTemplateManagerService + = ResourceConnector.getReportTemplateManagerService(); + } catch (IOException ex) { + new ServerDetailsView(null, true).setVisible(true); + }
          +
          + Runnable tsk = new Runnable() {
          + @Override
          + public void run() {
          + final ProgressHandle progr = ProgressHandleFactory.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();
          + progr.progress("Loading Templates.");
          + addMailTemplates();
          + addReportXslts();
          + progr.finish();
          + }
          +
          + };
          + RequestProcessor.getDefault().post(tsk);
          + }
          +
          + @Override
          + public void componentClosed() { + // TODO add custom code on component closing + }
          +
          + void writeProperties(final java.util.Properties p) { + // better to version settings since initial version as advocated at + // http://wiki.apidesign.org/wiki/PropertyFiles + p.setProperty("version", "1.0"); + // TODO store your settings + }
          +
          + void readProperties(final java.util.Properties p) { + String version = p.getProperty("version"); + // TODO read your settings according to their version + }
          +
          + private void addMailTemplates() {
          + List<MailTemplateTO> mailTemplateList = mailTemplateManagerService.list();
          + for (MailTemplateTO mailTemplate : mailTemplateList) { + this.mailTemplates.add(new DefaultMutableTreeNode( + mailTemplate.getKey())); + }
          + treeModel.reload();
          + }
          +
          + private void addReportXslts() {
          + List<ReportTemplateTO> reportTemplates = reportTemplateManagerService.list();
          + for (ReportTemplateTO reportTemplate : reportTemplates) { + reportXslts.add(new DefaultMutableTreeNode( + reportTemplate.getKey())); + }
          + treeModel.reload();
          + }
          +
          + private void rootRightClickAction(final MouseEvent evt) {
          + JPopupMenu menu = new JPopupMenu();
          + JMenuItem saveItem = new JMenuItem("Save");
          + JMenuItem resetConnectionItem = new JMenuItem("Reset Connection");
          + menu.add(saveItem);
          + menu.add(resetConnectionItem);
          +
          + saveItem.addActionListener(new ActionListener() {
          + @Override
          + public void actionPerformed(final ActionEvent e) { + saveContent(); + }
          + });
          +
          + resetConnectionItem.addActionListener(new ActionListener() {
          + @Override
          + public void actionPerformed(final ActionEvent e) {
          + File file = new File("UserData.txt");
          + try { + BufferedReader bf = new BufferedReader(new FileReader(file)); + String host = bf.readLine(); + String userName = bf.readLine(); + String password = bf.readLine(); + ServerDetailsView serverDetails = new ServerDetailsView(null, true); + serverDetails.setDetails(host, userName, password); + serverDetails.setVisible(true); + } catch (FileNotFoundException ex) { + Exceptions.printStackTrace(ex); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + }
          + }
          + });
          +
          + menu.show(evt.getComponent(), evt.getX(), evt.getY());
          + }
          +
          + private void folderRightClickAction(final MouseEvent evt,
          + final DefaultMutableTreeNode node) {
          + JPopupMenu menu = new JPopupMenu();
          + JMenuItem addItem = new JMenuItem("New");
          + menu.add(addItem);
          +
          + addItem.addActionListener(new ActionListener() {
          + @Override
          + public void actionPerformed(final ActionEvent e) {
          + String name = JOptionPane.showInputDialog("Enter Name");
          + boolean added = false;
          + if (node.getUserObject().equals(
          + PluginConstants.MAIL_TEMPLTAE_CONSTANT)) {
          + 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); + }

          + }
          + });
          +
          + menu.show(evt.getComponent(), evt.getX(), evt.getY());
          + }
          +
          + private void leafRightClickAction(final MouseEvent evt,
          + final DefaultMutableTreeNode node) {
          + JPopupMenu menu = new JPopupMenu();
          + JMenuItem deleteItem = new JMenuItem("Delete");
          + menu.add(deleteItem);
          +
          + deleteItem.addActionListener(new ActionListener() {
          + public void actionPerformed(final ActionEvent e) {
          + int result = JOptionPane.showConfirmDialog(null,
          + "Do you want to delete ?");
          + if (result == JOptionPane.OK_OPTION) {
          + DefaultMutableTreeNode parent
          + = (DefaultMutableTreeNode) node.getParent();
          + String name = (String) node.getUserObject();
          + boolean deleted;
          + if (parent.getUserObject().equals(
          + PluginConstants.MAIL_TEMPLTAE_CONSTANT))

          { + deleted = mailTemplateManagerService.delete( + (String) node.getUserObject()); + }

          else

          { + deleted = reportTemplateManagerService.delete( + (String) node.getUserObject()); + }

          + if (deleted)

          { + node.removeFromParent(); + treeModel.reload(parent); + }

          else

          { + + JOptionPane.showMessageDialog(null, + "Error while deleting new element", "Error", + JOptionPane.ERROR_MESSAGE); + }

          + }
          + }
          + });
          +
          + menu.show(evt.getComponent(), evt.getX(), evt.getY());
          + }
          +
          + private void openMailEditor(final String name) throws IOException {
          + String type = "";
          + String content = "";
          + InputStream is;
          + Object format = JOptionPane.showInputDialog(null, "Select File Format",
          + "File format", JOptionPane.QUESTION_MESSAGE, null,
          + PluginConstants.MAIL_TEMPLATE_FORMATS, "TEXT");
          +
          + if (format.equals("HTML"))

          { + type = "html"; + is = (InputStream) mailTemplateManagerService.getFormat(name, + MailTemplateFormat.HTML); + content = IOUtils.toString(is, encodingPattern); + }

          else

          { + type = "txt"; + is = (InputStream) mailTemplateManagerService.getFormat(name, + MailTemplateFormat.TEXT); + content = IOUtils.toString(is, encodingPattern); + }

          +
          + File directory = new File("Template/Mail");
          + if (!directory.exists())

          { + directory.mkdirs(); + }

          + File file = new File("Template/Mail/" + name + "." + type);
          + FileWriter fw = new FileWriter(file);
          + fw.write(content);
          + fw.flush();
          + FileObject fob = FileUtil.toFileObject(file.getAbsoluteFile());
          + fob.setAttribute("description", "TEXT");
          + DataObject data = DataObject.find(fob);
          + OpenCookie cookie = (OpenCookie) data.getCookie(OpenCookie.class);
          + cookie.open();
          +
          +/* TopComponent ctc = MultiViewFactory.createMultiView(descriptionArray, descriptionArray[0]);
          — End diff –

          Commented code

          Show
          githubbot ASF GitHub Bot added a comment - Github user ilgrosso commented on a diff in the pull request: https://github.com/apache/syncope/pull/38#discussion_r85551315 — Diff: ide/netbeans/src/main/java/org/apache/syncope/netbeans/plugin/view/ResourceExplorerTopComponent.java — @@ -0,0 +1,561 @@ +/* + * 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.Image; +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.netbeans.core.spi.multiview.MultiViewDescription; +//import org.netbeans.core.spi.multiview.MultiViewElement; +//import org.netbeans.core.spi.multiview.MultiViewFactory; +//import org.netbeans.core.spi.multiview.text.MultiViewEditorElement; +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.HelpCtx; +//import org.openide.util.Lookup; +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 = (DefaultMutableTreeNode) treeModel.getRoot(); + DefaultMutableTreeNode visibleRoot + = new DefaultMutableTreeNode(PluginConstants.DISPLAY_NAME); + mailTemplates = new DefaultMutableTreeNode(PluginConstants.MAIL_TEMPLTAE_CONSTANT); + reportXslts = new DefaultMutableTreeNode(PluginConstants.REPORT_XSLTS_CONSTANT); + root.add(visibleRoot); + visibleRoot.add(mailTemplates); + visibleRoot.add(reportXslts); + treeModel.reload(); + + } + + /** + * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The + * content of this method is always regenerated by the Form Editor. + */ + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jScrollPane1 = new javax.swing.JScrollPane(); + resourceExplorerTree = new javax.swing.JTree(); + + javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("root"); + resourceExplorerTree.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1)); + resourceExplorerTree.setRootVisible(false); + resourceExplorerTree.setScrollsOnExpand(true); + resourceExplorerTree.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(final java.awt.event.MouseEvent evt) { + resourceExplorerTreeMouseClicked(evt); + } + }); + jScrollPane1.setViewportView(resourceExplorerTree); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 445, Short.MAX_VALUE) + ); + } + // </editor-fold>//GEN-END:initComponents + + 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_TEMPLTAE_CONSTANT)) { + try { + openMailEditor(name); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } else { + try { + openReportEditor(name); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } + } + } else if (evt.getButton() == MouseEvent.BUTTON3 && evt.getClickCount() == 1) { + DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) resourceExplorerTree. + getLastSelectedPathComponent(); + String selectedNodeName = (String) selectedNode.getUserObject(); + if (selectedNode.isLeaf()) { + leafRightClickAction(evt, selectedNode); + } else if (selectedNodeName.equals(PluginConstants.MAIL_TEMPLTAE_CONSTANT)) { + folderRightClickAction(evt, mailTemplates); + } else if (selectedNodeName.equals(PluginConstants.REPORT_XSLTS_CONSTANT)) { + folderRightClickAction(evt, reportXslts); + } else if (selectedNodeName.equals(PluginConstants.DISPLAY_NAME)) { + rootRightClickAction(evt); + } + } + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTree resourceExplorerTree; + // End of variables declaration//GEN-END:variables + + @Override + public void componentOpened() { + File file = new File("UserData.txt"); + if (!file.exists()) { + new ServerDetailsView(null, true).setVisible(true); + } + try { + mailTemplateManagerService = ResourceConnector.getMailTemplateManagerService(); + } catch (IOException ex) { + JOptionPane.showMessageDialog(null, "Error Occured.", "Error", + JOptionPane.ERROR_MESSAGE); + new ServerDetailsView(null, true).setVisible(true); + } + try { + reportTemplateManagerService + = ResourceConnector.getReportTemplateManagerService(); + } catch (IOException ex) { + new ServerDetailsView(null, true).setVisible(true); + } + + Runnable tsk = new Runnable() { + @Override + public void run() { + final ProgressHandle progr = ProgressHandleFactory.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(); + progr.progress("Loading Templates."); + addMailTemplates(); + addReportXslts(); + progr.finish(); + } + + }; + RequestProcessor.getDefault().post(tsk); + } + + @Override + public void componentClosed() { + // TODO add custom code on component closing + } + + void writeProperties(final java.util.Properties p) { + // better to version settings since initial version as advocated at + // http://wiki.apidesign.org/wiki/PropertyFiles + p.setProperty("version", "1.0"); + // TODO store your settings + } + + void readProperties(final java.util.Properties p) { + String version = p.getProperty("version"); + // TODO read your settings according to their version + } + + private void addMailTemplates() { + List<MailTemplateTO> mailTemplateList = mailTemplateManagerService.list(); + for (MailTemplateTO mailTemplate : mailTemplateList) { + this.mailTemplates.add(new DefaultMutableTreeNode( + mailTemplate.getKey())); + } + treeModel.reload(); + } + + private void addReportXslts() { + List<ReportTemplateTO> reportTemplates = reportTemplateManagerService.list(); + for (ReportTemplateTO reportTemplate : reportTemplates) { + reportXslts.add(new DefaultMutableTreeNode( + reportTemplate.getKey())); + } + treeModel.reload(); + } + + private void rootRightClickAction(final MouseEvent evt) { + JPopupMenu menu = new JPopupMenu(); + JMenuItem saveItem = new JMenuItem("Save"); + JMenuItem resetConnectionItem = new JMenuItem("Reset Connection"); + menu.add(saveItem); + menu.add(resetConnectionItem); + + saveItem.addActionListener(new ActionListener() { + @Override + public void actionPerformed(final ActionEvent e) { + saveContent(); + } + }); + + resetConnectionItem.addActionListener(new ActionListener() { + @Override + public void actionPerformed(final ActionEvent e) { + File file = new File("UserData.txt"); + try { + BufferedReader bf = new BufferedReader(new FileReader(file)); + String host = bf.readLine(); + String userName = bf.readLine(); + String password = bf.readLine(); + ServerDetailsView serverDetails = new ServerDetailsView(null, true); + serverDetails.setDetails(host, userName, password); + serverDetails.setVisible(true); + } catch (FileNotFoundException ex) { + Exceptions.printStackTrace(ex); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } + }); + + menu.show(evt.getComponent(), evt.getX(), evt.getY()); + } + + private void folderRightClickAction(final MouseEvent evt, + final DefaultMutableTreeNode node) { + JPopupMenu menu = new JPopupMenu(); + JMenuItem addItem = new JMenuItem("New"); + menu.add(addItem); + + addItem.addActionListener(new ActionListener() { + @Override + public void actionPerformed(final ActionEvent e) { + String name = JOptionPane.showInputDialog("Enter Name"); + boolean added = false; + if (node.getUserObject().equals( + PluginConstants.MAIL_TEMPLTAE_CONSTANT)) { + 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); + } + } + }); + + menu.show(evt.getComponent(), evt.getX(), evt.getY()); + } + + private void leafRightClickAction(final MouseEvent evt, + final DefaultMutableTreeNode node) { + JPopupMenu menu = new JPopupMenu(); + JMenuItem deleteItem = new JMenuItem("Delete"); + menu.add(deleteItem); + + deleteItem.addActionListener(new ActionListener() { + public void actionPerformed(final ActionEvent e) { + int result = JOptionPane.showConfirmDialog(null, + "Do you want to delete ?"); + if (result == JOptionPane.OK_OPTION) { + DefaultMutableTreeNode parent + = (DefaultMutableTreeNode) node.getParent(); + String name = (String) node.getUserObject(); + boolean deleted; + if (parent.getUserObject().equals( + PluginConstants.MAIL_TEMPLTAE_CONSTANT)) { + deleted = mailTemplateManagerService.delete( + (String) node.getUserObject()); + } else { + deleted = reportTemplateManagerService.delete( + (String) node.getUserObject()); + } + if (deleted) { + node.removeFromParent(); + treeModel.reload(parent); + } else { + + JOptionPane.showMessageDialog(null, + "Error while deleting new element", "Error", + JOptionPane.ERROR_MESSAGE); + } + } + } + }); + + menu.show(evt.getComponent(), evt.getX(), evt.getY()); + } + + private void openMailEditor(final String name) throws IOException { + String type = ""; + String content = ""; + InputStream is; + Object format = JOptionPane.showInputDialog(null, "Select File Format", + "File format", JOptionPane.QUESTION_MESSAGE, null, + PluginConstants.MAIL_TEMPLATE_FORMATS, "TEXT"); + + if (format.equals("HTML")) { + type = "html"; + is = (InputStream) mailTemplateManagerService.getFormat(name, + MailTemplateFormat.HTML); + content = IOUtils.toString(is, encodingPattern); + } else { + type = "txt"; + is = (InputStream) mailTemplateManagerService.getFormat(name, + MailTemplateFormat.TEXT); + content = IOUtils.toString(is, encodingPattern); + } + + File directory = new File("Template/Mail"); + if (!directory.exists()) { + directory.mkdirs(); + } + File file = new File("Template/Mail/" + name + "." + type); + FileWriter fw = new FileWriter(file); + fw.write(content); + fw.flush(); + FileObject fob = FileUtil.toFileObject(file.getAbsoluteFile()); + fob.setAttribute("description", "TEXT"); + DataObject data = DataObject.find(fob); + OpenCookie cookie = (OpenCookie) data.getCookie(OpenCookie.class); + cookie.open(); + +/* TopComponent ctc = MultiViewFactory.createMultiView(descriptionArray, descriptionArray [0] ); — End diff – Commented code
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ilgrosso commented on a diff in the pull request:

          https://github.com/apache/syncope/pull/38#discussion_r85551619

          — Diff: ide/netbeans/src/main/nbm/manifest.mf —
          @@ -0,0 +1,5 @@
          +Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
          — End diff –

          lowercase `manifest.mf`?

          Show
          githubbot ASF GitHub Bot added a comment - Github user ilgrosso commented on a diff in the pull request: https://github.com/apache/syncope/pull/38#discussion_r85551619 — Diff: ide/netbeans/src/main/nbm/manifest.mf — @@ -0,0 +1,5 @@ +Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt — End diff – lowercase `manifest.mf`?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ilgrosso commented on a diff in the pull request:

          https://github.com/apache/syncope/pull/38#discussion_r85551675

          — Diff: ide/netbeans/src/main/resources/org/apache/syncope/checkstyle.xml —
          @@ -0,0 +1,223 @@
          +<?xml version="1.0" encoding="UTF-8"?>
          — End diff –

          Why is this file needed at all?

          Show
          githubbot ASF GitHub Bot added a comment - Github user ilgrosso commented on a diff in the pull request: https://github.com/apache/syncope/pull/38#discussion_r85551675 — Diff: ide/netbeans/src/main/resources/org/apache/syncope/checkstyle.xml — @@ -0,0 +1,223 @@ +<?xml version="1.0" encoding="UTF-8"?> — End diff – Why is this file needed at all?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ilgrosso commented on a diff in the pull request:

          https://github.com/apache/syncope/pull/38#discussion_r85551735

          — Diff: ide/netbeans/src/main/resources/org/apache/syncope/java-formatter.xml —
          @@ -0,0 +1,309 @@
          +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
          — End diff –

          Why is this file needed at all?

          Show
          githubbot ASF GitHub Bot added a comment - Github user ilgrosso commented on a diff in the pull request: https://github.com/apache/syncope/pull/38#discussion_r85551735 — Diff: ide/netbeans/src/main/resources/org/apache/syncope/java-formatter.xml — @@ -0,0 +1,309 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> — End diff – Why is this file needed at all?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ilgrosso commented on a diff in the pull request:

          https://github.com/apache/syncope/pull/38#discussion_r85551795

          — Diff: ide/netbeans/src/main/resources/org/apache/syncope/netbeans/plugin/service/bundle.properties —
          @@ -0,0 +1,17 @@
          +#Licensed to the Apache Software Foundation (ASF) under one
          — End diff –

          Why is this file needed at all?

          Show
          githubbot ASF GitHub Bot added a comment - Github user ilgrosso commented on a diff in the pull request: https://github.com/apache/syncope/pull/38#discussion_r85551795 — Diff: ide/netbeans/src/main/resources/org/apache/syncope/netbeans/plugin/service/bundle.properties — @@ -0,0 +1,17 @@ +#Licensed to the Apache Software Foundation (ASF) under one — End diff – Why is this file needed at all?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ilgrosso commented on the issue:

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

          Glad to see you back at work on Syncope @tmess567!

          Show
          githubbot ASF GitHub Bot added a comment - Github user ilgrosso commented on the issue: https://github.com/apache/syncope/pull/38 Glad to see you back at work on Syncope @tmess567!
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user tmess567 commented on a diff in the pull request:

          https://github.com/apache/syncope/pull/38#discussion_r85687391

          — 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 static MailTemplateManagerService MAIL_TTEMPLATE_MANAGER_SERVICE;
          + private static ReportTemplateManagerService REPORT_TEMPLATE_MANAGER_SERVICE;
          +
          + private ResourceConnector() {
          — End diff –

          [ERROR] src/main/java/org/apache/syncope/netbeans/plugin/connector/ResourceConnector.java:[30,1] (design) HideUtilityClassConstructor: Utility classes should not have a public or default constructor.

          Show
          githubbot ASF GitHub Bot added a comment - Github user tmess567 commented on a diff in the pull request: https://github.com/apache/syncope/pull/38#discussion_r85687391 — 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 static MailTemplateManagerService MAIL_TTEMPLATE_MANAGER_SERVICE; + private static ReportTemplateManagerService REPORT_TEMPLATE_MANAGER_SERVICE; + + private ResourceConnector() { — End diff – [ERROR] src/main/java/org/apache/syncope/netbeans/plugin/connector/ResourceConnector.java: [30,1] (design) HideUtilityClassConstructor: Utility classes should not have a public or default constructor.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user tmess567 commented on a diff in the pull request:

          https://github.com/apache/syncope/pull/38#discussion_r85687637

          — Diff: ide/netbeans/pom.xml —
          @@ -0,0 +1,141 @@
          +<?xml version="1.0" encoding="UTF-8"?>
          +<!--
          +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 owership. 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.
          +-->
          +<project xmlns="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">
          + <modelVersion>4.0.0</modelVersion>
          + <parent>
          + <groupId>org.apache.syncope</groupId>
          + <artifactId>syncope</artifactId>
          + <version>2.0.0-SNAPSHOT</version>
          + </parent>
          + <artifactId>netbeans-plugin</artifactId>
          + <name>Apache Syncope Netbeans Plugin</name>
          + <packaging>nbm</packaging>
          + <build>
          + <plugins>
          + <plugin>
          + <groupId>org.codehaus.mojo</groupId>
          + <artifactId>nbm-maven-plugin</artifactId>
          + <version>3.13</version>
          + <extensions>true</extensions>
          + <configuration>
          + <useOSGiDependencies>false</useOSGiDependencies>
          + </configuration>
          + </plugin>
          + <plugin>
          + <groupId>org.apache.maven.plugins</groupId>
          + <artifactId>maven-jar-plugin</artifactId>
          + <version>3.0.0</version>
          + <configuration>
          + <archive>
          + <manifestFile>$

          {project.build.outputDirectory}

          /META-INF/MANIFEST.MF</manifestFile>
          + </archive>
          + </configuration>
          + </plugin>
          + <plugin>
          + <groupId>org.codehaus.mojo</groupId>
          — End diff –

          [ERROR] Failed to execute goal org.codehaus.mojo:ianal-maven-plugin:1.0-alpha-1:verify-legal-files (default) on project syncope-ide-netbeans: Artifact does not contain any legal files: syncope-ide-netbeans-2.1.0-SNAPSHOT.nbm -> [Help 1]

          Show
          githubbot ASF GitHub Bot added a comment - Github user tmess567 commented on a diff in the pull request: https://github.com/apache/syncope/pull/38#discussion_r85687637 — Diff: ide/netbeans/pom.xml — @@ -0,0 +1,141 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +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 owership. 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. +--> +<project xmlns="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 "> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.syncope</groupId> + <artifactId>syncope</artifactId> + <version>2.0.0-SNAPSHOT</version> + </parent> + <artifactId>netbeans-plugin</artifactId> + <name>Apache Syncope Netbeans Plugin</name> + <packaging>nbm</packaging> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>nbm-maven-plugin</artifactId> + <version>3.13</version> + <extensions>true</extensions> + <configuration> + <useOSGiDependencies>false</useOSGiDependencies> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>3.0.0</version> + <configuration> + <archive> + <manifestFile>$ {project.build.outputDirectory} /META-INF/MANIFEST.MF</manifestFile> + </archive> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> — End diff – [ERROR] Failed to execute goal org.codehaus.mojo:ianal-maven-plugin:1.0-alpha-1:verify-legal-files (default) on project syncope-ide-netbeans: Artifact does not contain any legal files: syncope-ide-netbeans-2.1.0-SNAPSHOT.nbm -> [Help 1]
          Hide
          githubbot ASF GitHub Bot added a comment -

          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 <tusharm567@gmail.com>
          Date: 2016-10-31T15:33:58Z

          SYNCOPE-808 Added Netbeans Plugin to SYNCOPE 2_0_X


          Show
          githubbot ASF GitHub Bot added a comment - 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 <tusharm567@gmail.com> Date: 2016-10-31T15:33:58Z SYNCOPE-808 Added Netbeans Plugin to SYNCOPE 2_0_X
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user tmess567 closed the pull request at:

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

          Show
          githubbot ASF GitHub Bot added a comment - Github user tmess567 closed the pull request at: https://github.com/apache/syncope/pull/38
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user tmess567 commented on the issue:

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

          See #39

          Show
          githubbot ASF GitHub Bot added a comment - Github user tmess567 commented on the issue: https://github.com/apache/syncope/pull/38 See #39
          Hide
          githubbot ASF GitHub Bot added a comment -

          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 @@
          +<?xml version="1.0" encoding="UTF-8"?>
          +<!--
          +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 owership. 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.
          +-->
          +<project xmlns="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">
          + <modelVersion>4.0.0</modelVersion>
          + <parent>
          + <groupId>org.apache.syncope</groupId>
          + <artifactId>syncope-ide</artifactId>
          + <version>2.0.2-SNAPSHOT</version>
          + </parent>
          +
          + <name>Apache Syncope IDE Netbeans</name>
          + <description>Apache Syncope IDE Netbeans</description>
          + <groupId>org.apache.syncope.ide</groupId>
          + <artifactId>syncope-ide-netbeans</artifactId>
          +
          + <packaging>nbm</packaging>
          +
          + <properties>
          + <rootpom.basedir>$

          {basedir}

          /../..</rootpom.basedir>
          + </properties>
          +
          + <build>
          + <plugins>
          + <plugin>
          + <groupId>org.codehaus.mojo</groupId>
          + <artifactId>nbm-maven-plugin</artifactId>
          + <version>$

          {nbm-maven-plugin-version}

          </version>
          — End diff –

          This should be declared in the `<plugin-management>` section of the root POM and then put here without version.

          Show
          githubbot ASF GitHub Bot added a comment - 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +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 owership. 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. +--> +<project xmlns="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 "> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.syncope</groupId> + <artifactId>syncope-ide</artifactId> + <version>2.0.2-SNAPSHOT</version> + </parent> + + <name>Apache Syncope IDE Netbeans</name> + <description>Apache Syncope IDE Netbeans</description> + <groupId>org.apache.syncope.ide</groupId> + <artifactId>syncope-ide-netbeans</artifactId> + + <packaging>nbm</packaging> + + <properties> + <rootpom.basedir>$ {basedir} /../..</rootpom.basedir> + </properties> + + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>nbm-maven-plugin</artifactId> + <version>$ {nbm-maven-plugin-version} </version> — End diff – This should be declared in the `<plugin-management>` section of the root POM and then put here without version.
          Hide
          githubbot ASF GitHub Bot added a comment -

          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 @@
          +<?xml version="1.0" encoding="UTF-8"?>
          +<!--
          +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 owership. 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.
          +-->
          +<project xmlns="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">
          + <modelVersion>4.0.0</modelVersion>
          + <parent>
          + <groupId>org.apache.syncope</groupId>
          + <artifactId>syncope-ide</artifactId>
          + <version>2.0.2-SNAPSHOT</version>
          + </parent>
          +
          + <name>Apache Syncope IDE Netbeans</name>
          + <description>Apache Syncope IDE Netbeans</description>
          + <groupId>org.apache.syncope.ide</groupId>
          + <artifactId>syncope-ide-netbeans</artifactId>
          +
          + <packaging>nbm</packaging>
          +
          + <properties>
          + <rootpom.basedir>$

          {basedir}

          /../..</rootpom.basedir>
          + </properties>
          +
          + <build>
          + <plugins>
          + <plugin>
          + <groupId>org.codehaus.mojo</groupId>
          + <artifactId>nbm-maven-plugin</artifactId>
          + <version>$

          {nbm-maven-plugin-version}

          </version>
          + <extensions>true</extensions>
          + <configuration>
          + <useOSGiDependencies>false</useOSGiDependencies>
          + </configuration>
          + </plugin>
          + <plugin>
          + <groupId>org.apache.maven.plugins</groupId>
          + <artifactId>maven-jar-plugin</artifactId>
          + <version>$

          {maven-jar-plugin-version}

          </version>
          — End diff –

          This should be declared in the `<plugin-management>` section of the root POM and then put here without version.

          Show
          githubbot ASF GitHub Bot added a comment - 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +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 owership. 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. +--> +<project xmlns="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 "> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.syncope</groupId> + <artifactId>syncope-ide</artifactId> + <version>2.0.2-SNAPSHOT</version> + </parent> + + <name>Apache Syncope IDE Netbeans</name> + <description>Apache Syncope IDE Netbeans</description> + <groupId>org.apache.syncope.ide</groupId> + <artifactId>syncope-ide-netbeans</artifactId> + + <packaging>nbm</packaging> + + <properties> + <rootpom.basedir>$ {basedir} /../..</rootpom.basedir> + </properties> + + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>nbm-maven-plugin</artifactId> + <version>$ {nbm-maven-plugin-version} </version> + <extensions>true</extensions> + <configuration> + <useOSGiDependencies>false</useOSGiDependencies> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>$ {maven-jar-plugin-version} </version> — End diff – This should be declared in the `<plugin-management>` section of the root POM and then put here without version.
          Hide
          githubbot ASF GitHub Bot added a comment -

          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 @@
          +<?xml version="1.0" encoding="UTF-8"?>
          +<!--
          +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 owership. 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.
          +-->
          +<project xmlns="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">
          + <modelVersion>4.0.0</modelVersion>
          + <parent>
          + <groupId>org.apache.syncope</groupId>
          + <artifactId>syncope-ide</artifactId>
          + <version>2.0.2-SNAPSHOT</version>
          + </parent>
          +
          + <name>Apache Syncope IDE Netbeans</name>
          + <description>Apache Syncope IDE Netbeans</description>
          + <groupId>org.apache.syncope.ide</groupId>
          + <artifactId>syncope-ide-netbeans</artifactId>
          +
          + <packaging>nbm</packaging>
          +
          + <properties>
          + <rootpom.basedir>$

          {basedir}

          /../..</rootpom.basedir>
          + </properties>
          +
          + <build>
          + <plugins>
          + <plugin>
          + <groupId>org.codehaus.mojo</groupId>
          + <artifactId>nbm-maven-plugin</artifactId>
          + <version>$

          {nbm-maven-plugin-version}

          </version>
          + <extensions>true</extensions>
          + <configuration>
          + <useOSGiDependencies>false</useOSGiDependencies>
          + </configuration>
          + </plugin>
          + <plugin>
          + <groupId>org.apache.maven.plugins</groupId>
          + <artifactId>maven-jar-plugin</artifactId>
          + <version>$

          {maven-jar-plugin-version}

          </version>
          + <configuration>
          + <archive>
          + <manifestFile>$

          {project.build.outputDirectory}

          /META-INF/MANIFEST.MF</manifestFile>
          + </archive>
          + </configuration>
          + </plugin>
          + </plugins>
          + </build>
          +
          + <dependencies>
          + <dependency>
          + <groupId>org.netbeans.api</groupId>
          + <artifactId>org-netbeans-api-annotations-common</artifactId>
          + <version>$

          {org-netbeans-api-version}

          </version>
          — End diff –

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

          Show
          githubbot ASF GitHub Bot added a comment - 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +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 owership. 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. +--> +<project xmlns="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 "> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.syncope</groupId> + <artifactId>syncope-ide</artifactId> + <version>2.0.2-SNAPSHOT</version> + </parent> + + <name>Apache Syncope IDE Netbeans</name> + <description>Apache Syncope IDE Netbeans</description> + <groupId>org.apache.syncope.ide</groupId> + <artifactId>syncope-ide-netbeans</artifactId> + + <packaging>nbm</packaging> + + <properties> + <rootpom.basedir>$ {basedir} /../..</rootpom.basedir> + </properties> + + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>nbm-maven-plugin</artifactId> + <version>$ {nbm-maven-plugin-version} </version> + <extensions>true</extensions> + <configuration> + <useOSGiDependencies>false</useOSGiDependencies> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>$ {maven-jar-plugin-version} </version> + <configuration> + <archive> + <manifestFile>$ {project.build.outputDirectory} /META-INF/MANIFEST.MF</manifestFile> + </archive> + </configuration> + </plugin> + </plugins> + </build> + + <dependencies> + <dependency> + <groupId>org.netbeans.api</groupId> + <artifactId>org-netbeans-api-annotations-common</artifactId> + <version>$ {org-netbeans-api-version} </version> — End diff – This should be declared in the `<dependencyManagement>` section of the root POM and then put here without version.
          Hide
          githubbot ASF GitHub Bot added a comment -

          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?

          Show
          githubbot ASF GitHub Bot added a comment - 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?
          Hide
          githubbot ASF GitHub Bot added a comment -

          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 = (DefaultMutableTreeNode) treeModel.getRoot(); + DefaultMutableTreeNode visibleRoot + = new DefaultMutableTreeNode(PluginConstants.DISPLAY_NAME); + mailTemplates = new DefaultMutableTreeNode(PluginConstants.MAIL_TEMPLTAE_CONSTANT); + reportXslts = new DefaultMutableTreeNode(PluginConstants.REPORT_XSLTS_CONSTANT); + root.add(visibleRoot); + visibleRoot.add(mailTemplates); + visibleRoot.add(reportXslts); + treeModel.reload(); + + }

          +
          + /**
          + * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The
          + * content of this method is always regenerated by the Form Editor.
          + */
          + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
          + private void initComponents() {
          +
          + jScrollPane1 = new javax.swing.JScrollPane();
          + resourceExplorerTree = new javax.swing.JTree();
          +
          + javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("root");
          + resourceExplorerTree.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1));
          + resourceExplorerTree.setRootVisible(false);
          + resourceExplorerTree.setScrollsOnExpand(true);
          + resourceExplorerTree.addMouseListener(new java.awt.event.MouseAdapter() {
          + public void mouseClicked(final java.awt.event.MouseEvent evt)

          { + resourceExplorerTreeMouseClicked(evt); + }

          + });
          + jScrollPane1.setViewportView(resourceExplorerTree);
          +
          + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
          + this.setLayout(layout);
          + layout.setHorizontalGroup(
          + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE)
          + );
          + layout.setVerticalGroup(
          + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 445, Short.MAX_VALUE)
          + );
          + }
          + // </editor-fold>//GEN-END:initComponents
          +
          + 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_TEMPLTAE_CONSTANT)) {
          + try

          { + openMailEditor(name); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + }
          + } else {
          + try { + openReportEditor(name); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + }
          + }
          + }
          + } else if (evt.getButton() == MouseEvent.BUTTON3 && evt.getClickCount() == 1) {
          + DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) resourceExplorerTree.
          + getLastSelectedPathComponent();
          + String selectedNodeName = (String) selectedNode.getUserObject();
          + if (selectedNode.isLeaf()) { + leafRightClickAction(evt, selectedNode); + } else if (selectedNodeName.equals(PluginConstants.MAIL_TEMPLTAE_CONSTANT)) { + folderRightClickAction(evt, mailTemplates); + } else if (selectedNodeName.equals(PluginConstants.REPORT_XSLTS_CONSTANT)) { + folderRightClickAction(evt, reportXslts); + } else if (selectedNodeName.equals(PluginConstants.DISPLAY_NAME)) { + rootRightClickAction(evt); + }
          + }
          + }
          +
          + // Variables declaration - do not modify//GEN-BEGIN:variables
          + private javax.swing.JScrollPane jScrollPane1;
          + private javax.swing.JTree resourceExplorerTree;
          + // End of variables declaration//GEN-END:variables
          +
          + @Override
          + public void componentOpened() {
          + File file = new File("UserData.txt");
          + if (!file.exists()) { + new ServerDetailsView(null, true).setVisible(true); + }
          + try { + mailTemplateManagerService = ResourceConnector.getMailTemplateManagerService(); + } catch (IOException ex) { + JOptionPane.showMessageDialog(null, "Error Occured.", "Error", + JOptionPane.ERROR_MESSAGE); + new ServerDetailsView(null, true).setVisible(true); + }
          + try { + reportTemplateManagerService + = ResourceConnector.getReportTemplateManagerService(); + } catch (IOException ex) { + new ServerDetailsView(null, true).setVisible(true); + }
          +
          + Runnable tsk = new Runnable() {
          + @Override
          + public void run() {
          + final ProgressHandle progr = ProgressHandleFactory.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();
          + progr.progress("Loading Templates.");
          + addMailTemplates();
          + addReportXslts();
          + progr.finish();
          + }
          +
          + };
          + RequestProcessor.getDefault().post(tsk);
          + }
          +
          + @Override
          + public void componentClosed() { + // TODO add custom code on component closing + }
          +
          + void writeProperties(final java.util.Properties p) { + // better to version settings since initial version as advocated at + // http://wiki.apidesign.org/wiki/PropertyFiles + p.setProperty("version", "1.0"); + // TODO store your settings + }
          +
          + void readProperties(final java.util.Properties p) { + String version = p.getProperty("version"); + // TODO read your settings according to their version + }
          +
          + private void addMailTemplates() {
          + List<MailTemplateTO> mailTemplateList = mailTemplateManagerService.list();
          + for (MailTemplateTO mailTemplate : mailTemplateList) { + this.mailTemplates.add(new DefaultMutableTreeNode( + mailTemplate.getKey())); + }
          + treeModel.reload();
          + }
          +
          + private void addReportXslts() {
          + List<ReportTemplateTO> reportTemplates = reportTemplateManagerService.list();
          + for (ReportTemplateTO reportTemplate : reportTemplates) { + reportXslts.add(new DefaultMutableTreeNode( + reportTemplate.getKey())); + }
          + treeModel.reload();
          + }
          +
          + private void rootRightClickAction(final MouseEvent evt) {
          + JPopupMenu menu = new JPopupMenu();
          + JMenuItem saveItem = new JMenuItem("Save");
          + JMenuItem resetConnectionItem = new JMenuItem("Reset Connection");
          + menu.add(saveItem);
          + menu.add(resetConnectionItem);
          +
          + saveItem.addActionListener(new ActionListener() {
          + @Override
          + public void actionPerformed(final ActionEvent e) { + saveContent(); + }
          + });
          +
          + resetConnectionItem.addActionListener(new ActionListener() {
          + @Override
          + public void actionPerformed(final ActionEvent e) {
          + File file = new File("UserData.txt");
          + try { + BufferedReader bf = new BufferedReader(new FileReader(file)); + String host = bf.readLine(); + String userName = bf.readLine(); + String password = bf.readLine(); + ServerDetailsView serverDetails = new ServerDetailsView(null, true); + serverDetails.setDetails(host, userName, password); + serverDetails.setVisible(true); + } catch (FileNotFoundException ex) { + Exceptions.printStackTrace(ex); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + }
          + }
          + });
          +
          + menu.show(evt.getComponent(), evt.getX(), evt.getY());
          + }
          +
          + private void folderRightClickAction(final MouseEvent evt,
          + final DefaultMutableTreeNode node) {
          + JPopupMenu menu = new JPopupMenu();
          + JMenuItem addItem = new JMenuItem("New");
          + menu.add(addItem);
          +
          + addItem.addActionListener(new ActionListener() {
          + @Override
          + public void actionPerformed(final ActionEvent e) {
          + String name = JOptionPane.showInputDialog("Enter Name");
          + boolean added = false;
          + if (node.getUserObject().equals(
          + PluginConstants.MAIL_TEMPLTAE_CONSTANT)) {
          + 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); + }

          + }
          + });
          +
          + menu.show(evt.getComponent(), evt.getX(), evt.getY());
          + }
          +
          + private void leafRightClickAction(final MouseEvent evt,
          + final DefaultMutableTreeNode node) {
          + JPopupMenu menu = new JPopupMenu();
          + JMenuItem deleteItem = new JMenuItem("Delete");
          + menu.add(deleteItem);
          +
          + deleteItem.addActionListener(new ActionListener() {
          + public void actionPerformed(final ActionEvent e) {
          + int result = JOptionPane.showConfirmDialog(null,
          + "Do you want to delete ?");
          + if (result == JOptionPane.OK_OPTION) {
          + DefaultMutableTreeNode parent
          + = (DefaultMutableTreeNode) node.getParent();
          + String name = (String) node.getUserObject();
          + boolean deleted;
          + if (parent.getUserObject().equals(
          + PluginConstants.MAIL_TEMPLTAE_CONSTANT))

          { + deleted = mailTemplateManagerService.delete( + (String) node.getUserObject()); + }

          else

          { + deleted = reportTemplateManagerService.delete( + (String) node.getUserObject()); + }

          + if (deleted)

          { + node.removeFromParent(); + treeModel.reload(parent); + }

          else

          { + + JOptionPane.showMessageDialog(null, + "Error while deleting new element", "Error", + JOptionPane.ERROR_MESSAGE); + }

          + }
          + }
          + });
          +
          + menu.show(evt.getComponent(), evt.getX(), evt.getY());
          + }
          +
          + private void openMailEditor(final String name) throws IOException {
          + String type = "";
          + String content = "";
          + InputStream is;
          + Object format = JOptionPane.showInputDialog(null, "Select File Format",
          + "File format", JOptionPane.QUESTION_MESSAGE, null,
          + PluginConstants.MAIL_TEMPLATE_FORMATS, "TEXT");
          +
          + if (format.equals("HTML"))

          { + type = "html"; + is = (InputStream) mailTemplateManagerService.getFormat(name, + MailTemplateFormat.HTML); + content = IOUtils.toString(is, encodingPattern); + }

          else

          { + type = "txt"; + is = (InputStream) mailTemplateManagerService.getFormat(name, + MailTemplateFormat.TEXT); + content = IOUtils.toString(is, encodingPattern); + }

          +
          + File directory = new File("Template/Mail");
          + if (!directory.exists())

          { + directory.mkdirs(); + }

          + File file = new File("Template/Mail/" + name + "." + type);
          + FileWriter fw = new FileWriter(file);
          + fw.write(content);
          + fw.flush();
          + FileObject fob = FileUtil.toFileObject(file.getAbsoluteFile());
          + fob.setAttribute("description", "TEXT");
          + DataObject data = DataObject.find(fob);
          + OpenCookie cookie = (OpenCookie) data.getCookie(OpenCookie.class);
          + cookie.open();
          + }
          +
          + private void openReportEditor(final String name) throws IOException {
          + String type;
          + String content;
          + InputStream is;
          + Object format = JOptionPane.showInputDialog(null, "Select File Format",
          + "File format", JOptionPane.QUESTION_MESSAGE, null,
          + PluginConstants.REPORT_TEMPLATE_FORMATS, "TEXT");
          +
          + if (format.equals("HTML")) {
          — End diff –

          Any chance to use the proper enum here?

          Show
          githubbot ASF GitHub Bot added a comment - 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 = (DefaultMutableTreeNode) treeModel.getRoot(); + DefaultMutableTreeNode visibleRoot + = new DefaultMutableTreeNode(PluginConstants.DISPLAY_NAME); + mailTemplates = new DefaultMutableTreeNode(PluginConstants.MAIL_TEMPLTAE_CONSTANT); + reportXslts = new DefaultMutableTreeNode(PluginConstants.REPORT_XSLTS_CONSTANT); + root.add(visibleRoot); + visibleRoot.add(mailTemplates); + visibleRoot.add(reportXslts); + treeModel.reload(); + + } + + /** + * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The + * content of this method is always regenerated by the Form Editor. + */ + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jScrollPane1 = new javax.swing.JScrollPane(); + resourceExplorerTree = new javax.swing.JTree(); + + javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("root"); + resourceExplorerTree.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1)); + resourceExplorerTree.setRootVisible(false); + resourceExplorerTree.setScrollsOnExpand(true); + resourceExplorerTree.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(final java.awt.event.MouseEvent evt) { + resourceExplorerTreeMouseClicked(evt); + } + }); + jScrollPane1.setViewportView(resourceExplorerTree); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 445, Short.MAX_VALUE) + ); + } + // </editor-fold>//GEN-END:initComponents + + 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_TEMPLTAE_CONSTANT)) { + try { + openMailEditor(name); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } else { + try { + openReportEditor(name); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } + } + } else if (evt.getButton() == MouseEvent.BUTTON3 && evt.getClickCount() == 1) { + DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) resourceExplorerTree. + getLastSelectedPathComponent(); + String selectedNodeName = (String) selectedNode.getUserObject(); + if (selectedNode.isLeaf()) { + leafRightClickAction(evt, selectedNode); + } else if (selectedNodeName.equals(PluginConstants.MAIL_TEMPLTAE_CONSTANT)) { + folderRightClickAction(evt, mailTemplates); + } else if (selectedNodeName.equals(PluginConstants.REPORT_XSLTS_CONSTANT)) { + folderRightClickAction(evt, reportXslts); + } else if (selectedNodeName.equals(PluginConstants.DISPLAY_NAME)) { + rootRightClickAction(evt); + } + } + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTree resourceExplorerTree; + // End of variables declaration//GEN-END:variables + + @Override + public void componentOpened() { + File file = new File("UserData.txt"); + if (!file.exists()) { + new ServerDetailsView(null, true).setVisible(true); + } + try { + mailTemplateManagerService = ResourceConnector.getMailTemplateManagerService(); + } catch (IOException ex) { + JOptionPane.showMessageDialog(null, "Error Occured.", "Error", + JOptionPane.ERROR_MESSAGE); + new ServerDetailsView(null, true).setVisible(true); + } + try { + reportTemplateManagerService + = ResourceConnector.getReportTemplateManagerService(); + } catch (IOException ex) { + new ServerDetailsView(null, true).setVisible(true); + } + + Runnable tsk = new Runnable() { + @Override + public void run() { + final ProgressHandle progr = ProgressHandleFactory.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(); + progr.progress("Loading Templates."); + addMailTemplates(); + addReportXslts(); + progr.finish(); + } + + }; + RequestProcessor.getDefault().post(tsk); + } + + @Override + public void componentClosed() { + // TODO add custom code on component closing + } + + void writeProperties(final java.util.Properties p) { + // better to version settings since initial version as advocated at + // http://wiki.apidesign.org/wiki/PropertyFiles + p.setProperty("version", "1.0"); + // TODO store your settings + } + + void readProperties(final java.util.Properties p) { + String version = p.getProperty("version"); + // TODO read your settings according to their version + } + + private void addMailTemplates() { + List<MailTemplateTO> mailTemplateList = mailTemplateManagerService.list(); + for (MailTemplateTO mailTemplate : mailTemplateList) { + this.mailTemplates.add(new DefaultMutableTreeNode( + mailTemplate.getKey())); + } + treeModel.reload(); + } + + private void addReportXslts() { + List<ReportTemplateTO> reportTemplates = reportTemplateManagerService.list(); + for (ReportTemplateTO reportTemplate : reportTemplates) { + reportXslts.add(new DefaultMutableTreeNode( + reportTemplate.getKey())); + } + treeModel.reload(); + } + + private void rootRightClickAction(final MouseEvent evt) { + JPopupMenu menu = new JPopupMenu(); + JMenuItem saveItem = new JMenuItem("Save"); + JMenuItem resetConnectionItem = new JMenuItem("Reset Connection"); + menu.add(saveItem); + menu.add(resetConnectionItem); + + saveItem.addActionListener(new ActionListener() { + @Override + public void actionPerformed(final ActionEvent e) { + saveContent(); + } + }); + + resetConnectionItem.addActionListener(new ActionListener() { + @Override + public void actionPerformed(final ActionEvent e) { + File file = new File("UserData.txt"); + try { + BufferedReader bf = new BufferedReader(new FileReader(file)); + String host = bf.readLine(); + String userName = bf.readLine(); + String password = bf.readLine(); + ServerDetailsView serverDetails = new ServerDetailsView(null, true); + serverDetails.setDetails(host, userName, password); + serverDetails.setVisible(true); + } catch (FileNotFoundException ex) { + Exceptions.printStackTrace(ex); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } + }); + + menu.show(evt.getComponent(), evt.getX(), evt.getY()); + } + + private void folderRightClickAction(final MouseEvent evt, + final DefaultMutableTreeNode node) { + JPopupMenu menu = new JPopupMenu(); + JMenuItem addItem = new JMenuItem("New"); + menu.add(addItem); + + addItem.addActionListener(new ActionListener() { + @Override + public void actionPerformed(final ActionEvent e) { + String name = JOptionPane.showInputDialog("Enter Name"); + boolean added = false; + if (node.getUserObject().equals( + PluginConstants.MAIL_TEMPLTAE_CONSTANT)) { + 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); + } + } + }); + + menu.show(evt.getComponent(), evt.getX(), evt.getY()); + } + + private void leafRightClickAction(final MouseEvent evt, + final DefaultMutableTreeNode node) { + JPopupMenu menu = new JPopupMenu(); + JMenuItem deleteItem = new JMenuItem("Delete"); + menu.add(deleteItem); + + deleteItem.addActionListener(new ActionListener() { + public void actionPerformed(final ActionEvent e) { + int result = JOptionPane.showConfirmDialog(null, + "Do you want to delete ?"); + if (result == JOptionPane.OK_OPTION) { + DefaultMutableTreeNode parent + = (DefaultMutableTreeNode) node.getParent(); + String name = (String) node.getUserObject(); + boolean deleted; + if (parent.getUserObject().equals( + PluginConstants.MAIL_TEMPLTAE_CONSTANT)) { + deleted = mailTemplateManagerService.delete( + (String) node.getUserObject()); + } else { + deleted = reportTemplateManagerService.delete( + (String) node.getUserObject()); + } + if (deleted) { + node.removeFromParent(); + treeModel.reload(parent); + } else { + + JOptionPane.showMessageDialog(null, + "Error while deleting new element", "Error", + JOptionPane.ERROR_MESSAGE); + } + } + } + }); + + menu.show(evt.getComponent(), evt.getX(), evt.getY()); + } + + private void openMailEditor(final String name) throws IOException { + String type = ""; + String content = ""; + InputStream is; + Object format = JOptionPane.showInputDialog(null, "Select File Format", + "File format", JOptionPane.QUESTION_MESSAGE, null, + PluginConstants.MAIL_TEMPLATE_FORMATS, "TEXT"); + + if (format.equals("HTML")) { + type = "html"; + is = (InputStream) mailTemplateManagerService.getFormat(name, + MailTemplateFormat.HTML); + content = IOUtils.toString(is, encodingPattern); + } else { + type = "txt"; + is = (InputStream) mailTemplateManagerService.getFormat(name, + MailTemplateFormat.TEXT); + content = IOUtils.toString(is, encodingPattern); + } + + File directory = new File("Template/Mail"); + if (!directory.exists()) { + directory.mkdirs(); + } + File file = new File("Template/Mail/" + name + "." + type); + FileWriter fw = new FileWriter(file); + fw.write(content); + fw.flush(); + FileObject fob = FileUtil.toFileObject(file.getAbsoluteFile()); + fob.setAttribute("description", "TEXT"); + DataObject data = DataObject.find(fob); + OpenCookie cookie = (OpenCookie) data.getCookie(OpenCookie.class); + cookie.open(); + } + + private void openReportEditor(final String name) throws IOException { + String type; + String content; + InputStream is; + Object format = JOptionPane.showInputDialog(null, "Select File Format", + "File format", JOptionPane.QUESTION_MESSAGE, null, + PluginConstants.REPORT_TEMPLATE_FORMATS, "TEXT"); + + if (format.equals("HTML")) { — End diff – Any chance to use the proper enum here?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ilgrosso commented on the issue:

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

          hi @tmess567 chances you can take a look at the comments and fix anytime soon?

          Show
          githubbot ASF GitHub Bot added a comment - Github user ilgrosso commented on the issue: https://github.com/apache/syncope/pull/39 hi @tmess567 chances you can take a look at the comments and fix anytime soon?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user tmess567 commented on the issue:

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

          I'm kinda busy with a family function.. Will work on the suggested fixes in a day or two

          Show
          githubbot ASF GitHub Bot added a comment - Github user tmess567 commented on the issue: https://github.com/apache/syncope/pull/39 I'm kinda busy with a family function.. Will work on the suggested fixes in a day or two
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ilgrosso commented on the issue:

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

          > @tmess567 commented 14 days ago
          > Will work on the suggested fixes in a day or two

          Guess you are hardly finding some time to work on this task, right?

          Show
          githubbot ASF GitHub Bot added a comment - Github user ilgrosso commented on the issue: https://github.com/apache/syncope/pull/39 > @tmess567 commented 14 days ago > Will work on the suggested fixes in a day or two Guess you are hardly finding some time to work on this task, right?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user tmess567 commented on the issue:

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

          Busy with end semester examinations and a major project, but I'll try to find more time for this as well. @ilgrosso you weren't at the irc today, I have some questions about the thread safe comment. Please contact me when you're on.

          Show
          githubbot ASF GitHub Bot added a comment - Github user tmess567 commented on the issue: https://github.com/apache/syncope/pull/39 Busy with end semester examinations and a major project, but I'll try to find more time for this as well. @ilgrosso you weren't at the irc today, I have some questions about the thread safe comment. Please contact me when you're on.
          Hide
          githubbot ASF GitHub Bot added a comment -

          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.
          <dependencies>
          <dependency>
          <groupId>org.netbeans.api</groupId>

          • <artifactId>org-netbeans-api-annotations-common</artifactId>
              • End diff –

          `artifactId` removed??!?

          Show
          githubbot ASF GitHub Bot added a comment - 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. <dependencies> <dependency> <groupId>org.netbeans.api</groupId> <artifactId>org-netbeans-api-annotations-common</artifactId> End diff – `artifactId` removed??!?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ilgrosso commented on the issue:

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

          > @ilgrosso you weren't at the irc today, I have some questions about the thread safe comment. Please contact me when you're on.

          When I am not in IRC, just add a comment here or send an e-mail to dev@syncope.apache.org, for better off-line handling.

          Show
          githubbot ASF GitHub Bot added a comment - Github user ilgrosso commented on the issue: https://github.com/apache/syncope/pull/39 > @ilgrosso you weren't at the irc today, I have some questions about the thread safe comment. Please contact me when you're on. When I am not in IRC, just add a comment here or send an e-mail to dev@syncope.apache.org, for better off-line handling.
          Hide
          githubbot ASF GitHub Bot added a comment -

          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.
          <dependencies>
          <dependency>
          <groupId>org.netbeans.api</groupId>

          • <artifactId>org-netbeans-api-annotations-common</artifactId>
              • End diff –

          Re-added it.

          Show
          githubbot ASF GitHub Bot added a comment - 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. <dependencies> <dependency> <groupId>org.netbeans.api</groupId> <artifactId>org-netbeans-api-annotations-common</artifactId> End diff – Re-added it.
          Hide
          githubbot ASF GitHub Bot added a comment -

          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)
            Unknown macro: { 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;
            ```

          Show
          githubbot ASF GitHub Bot added a comment - 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) Unknown macro: { 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; ```
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user tmess567 closed the pull request at:

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

          Show
          githubbot ASF GitHub Bot added a comment - Github user tmess567 closed the pull request at: https://github.com/apache/syncope/pull/39
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ilgrosso commented on the issue:

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

          Linking to SYNCOPE-808

          Show
          githubbot ASF GitHub Bot added a comment - Github user ilgrosso commented on the issue: https://github.com/apache/syncope/pull/43 Linking to SYNCOPE-808
          Hide
          tusharm Tushar Mishra added a comment -

          I've added a PR fixing the ianal archive issue. Please have a look to see if we can close this issue.

          Show
          tusharm Tushar Mishra added a comment - I've added a PR fixing the ianal archive issue. Please have a look to see if we can close this issue.
          Hide
          ilgrosso Francesco Chicchiriccò added a comment -

          Hey, sounds good!
          Sorry if I haven't reviewed you last PR as promised, I'll try to do that by tomorrow at latest - I am looking forward to resolve this issue, too

          Show
          ilgrosso Francesco Chicchiriccò added a comment - Hey, sounds good! Sorry if I haven't reviewed you last PR as promised, I'll try to do that by tomorrow at latest - I am looking forward to resolve this issue, too
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ilgrosso commented on the issue:

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

          I have added a temporary [SYNCOPE-808 branch](https://github.com/apache/syncope/tree/SYNCOPE-808), based on `2_0_X` with the content of this PR + my attached commit above.

          Show
          githubbot ASF GitHub Bot added a comment - Github user ilgrosso commented on the issue: https://github.com/apache/syncope/pull/43 I have added a temporary [SYNCOPE-808 branch] ( https://github.com/apache/syncope/tree/SYNCOPE-808 ), based on `2_0_X` with the content of this PR + my attached commit above.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 1e2fa36f3ecc218d2786067fd8a1641e0068b15e in syncope's branch refs/heads/SYNCOPE-808 from Tushar Mishra
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=1e2fa36 ]

          SYNCOPE-808 Added netbeans to syncope/ide

          Show
          jira-bot ASF subversion and git services added a comment - Commit 1e2fa36f3ecc218d2786067fd8a1641e0068b15e in syncope's branch refs/heads/ SYNCOPE-808 from Tushar Mishra [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=1e2fa36 ] SYNCOPE-808 Added netbeans to syncope/ide
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 57f4893f33971f3b2e005725a79cb5bee698baf3 in syncope's branch refs/heads/SYNCOPE-808 from Tushar Mishra
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=57f4893 ]

          SYNCOPE-808 Antrun plugin to add LICENSE and PlUGIN to nbm archive

          Show
          jira-bot ASF subversion and git services added a comment - Commit 57f4893f33971f3b2e005725a79cb5bee698baf3 in syncope's branch refs/heads/ SYNCOPE-808 from Tushar Mishra [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=57f4893 ] SYNCOPE-808 Antrun plugin to add LICENSE and PlUGIN to nbm archive
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 22102eac90f56c4964bd3f07d2cfbd6e71139f36 in syncope's branch refs/heads/SYNCOPE-808 from Francesco Chicchiriccò
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=22102ea ]

          SYNCOPE-808 Several pom fixes, proper LICENSE and NOTICE, package reorganization, checkstyle setup

          Show
          jira-bot ASF subversion and git services added a comment - Commit 22102eac90f56c4964bd3f07d2cfbd6e71139f36 in syncope's branch refs/heads/ SYNCOPE-808 from Francesco Chicchiriccò [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=22102ea ] SYNCOPE-808 Several pom fixes, proper LICENSE and NOTICE, package reorganization, checkstyle setup
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit eb1e4f1ce74f6a46af62c1012ef9cb64c2bb03e4 in syncope's branch refs/heads/SYNCOPE-808 from Andrea Patricelli
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=eb1e4f1 ]

          SYNCOPE-808 fixed problems about bundle not found, fixed some editor bugs and added validation

          Show
          jira-bot ASF subversion and git services added a comment - Commit eb1e4f1ce74f6a46af62c1012ef9cb64c2bb03e4 in syncope's branch refs/heads/ SYNCOPE-808 from Andrea Patricelli [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=eb1e4f1 ] SYNCOPE-808 fixed problems about bundle not found, fixed some editor bugs and added validation
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 39b7198098a49179c3fdfa246ae8e5a94dc5f59c in syncope's branch refs/heads/SYNCOPE-808 from Andrea Patricelli
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=39b7198 ]

          Merge branch 'SYNCOPE-808' of https://git-wip-us.apache.org/repos/asf/syncope into SYNCOPE-808

          Show
          jira-bot ASF subversion and git services added a comment - Commit 39b7198098a49179c3fdfa246ae8e5a94dc5f59c in syncope's branch refs/heads/ SYNCOPE-808 from Andrea Patricelli [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=39b7198 ] Merge branch ' SYNCOPE-808 ' of https://git-wip-us.apache.org/repos/asf/syncope into SYNCOPE-808
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 39b7198098a49179c3fdfa246ae8e5a94dc5f59c in syncope's branch refs/heads/SYNCOPE-808 from Andrea Patricelli
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=39b7198 ]

          Merge branch 'SYNCOPE-808' of https://git-wip-us.apache.org/repos/asf/syncope into SYNCOPE-808

          Show
          jira-bot ASF subversion and git services added a comment - Commit 39b7198098a49179c3fdfa246ae8e5a94dc5f59c in syncope's branch refs/heads/ SYNCOPE-808 from Andrea Patricelli [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=39b7198 ] Merge branch ' SYNCOPE-808 ' of https://git-wip-us.apache.org/repos/asf/syncope into SYNCOPE-808
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit f26e20302c0d1398c18969c5f80d409287b760e3 in syncope's branch refs/heads/2_0_X from Tushar Mishra
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=f26e203 ]

          SYNCOPE-808 Added netbeans to syncope/ide

          Show
          jira-bot ASF subversion and git services added a comment - Commit f26e20302c0d1398c18969c5f80d409287b760e3 in syncope's branch refs/heads/2_0_X from Tushar Mishra [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=f26e203 ] SYNCOPE-808 Added netbeans to syncope/ide
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit f63aedd6247f2a737872844a9ae1618f17cc6af7 in syncope's branch refs/heads/2_0_X from Tushar Mishra
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=f63aedd ]

          SYNCOPE-808 Antrun plugin to add LICENSE and PlUGIN to nbm archive

          Show
          jira-bot ASF subversion and git services added a comment - Commit f63aedd6247f2a737872844a9ae1618f17cc6af7 in syncope's branch refs/heads/2_0_X from Tushar Mishra [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=f63aedd ] SYNCOPE-808 Antrun plugin to add LICENSE and PlUGIN to nbm archive
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 28f7795af302914539140fbf76c8d1f086be6545 in syncope's branch refs/heads/2_0_X from Francesco Chicchiriccò
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=28f7795 ]

          SYNCOPE-808 Several pom fixes, proper LICENSE and NOTICE, package reorganization, checkstyle setup

          Show
          jira-bot ASF subversion and git services added a comment - Commit 28f7795af302914539140fbf76c8d1f086be6545 in syncope's branch refs/heads/2_0_X from Francesco Chicchiriccò [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=28f7795 ] SYNCOPE-808 Several pom fixes, proper LICENSE and NOTICE, package reorganization, checkstyle setup
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit a31ce3c6dc79cdafe0d48a834664e4d3964c0c8c in syncope's branch refs/heads/2_0_X from Andrea Patricelli
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=a31ce3c ]

          SYNCOPE-808 fixed problems about bundle not found, fixed some editor bugs and added validation

          Show
          jira-bot ASF subversion and git services added a comment - Commit a31ce3c6dc79cdafe0d48a834664e4d3964c0c8c in syncope's branch refs/heads/2_0_X from Andrea Patricelli [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=a31ce3c ] SYNCOPE-808 fixed problems about bundle not found, fixed some editor bugs and added validation
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 20501b8e6a16862462bbe3df19e6588e7ad88b06 in syncope's branch refs/heads/master from Tushar Mishra
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=20501b8 ]

          SYNCOPE-808 Added netbeans to syncope/ide

          Show
          jira-bot ASF subversion and git services added a comment - Commit 20501b8e6a16862462bbe3df19e6588e7ad88b06 in syncope's branch refs/heads/master from Tushar Mishra [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=20501b8 ] SYNCOPE-808 Added netbeans to syncope/ide
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 9c744a9807a6e8e78bbad72a8ed4585932a11c32 in syncope's branch refs/heads/master from Tushar Mishra
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=9c744a9 ]

          SYNCOPE-808 Antrun plugin to add LICENSE and PlUGIN to nbm archive

          Show
          jira-bot ASF subversion and git services added a comment - Commit 9c744a9807a6e8e78bbad72a8ed4585932a11c32 in syncope's branch refs/heads/master from Tushar Mishra [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=9c744a9 ] SYNCOPE-808 Antrun plugin to add LICENSE and PlUGIN to nbm archive
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 218674e75e669127cd677f1d199984973b005b41 in syncope's branch refs/heads/master from Francesco Chicchiriccò
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=218674e ]

          SYNCOPE-808 Several pom fixes, proper LICENSE and NOTICE, package reorganization, checkstyle setup

          Show
          jira-bot ASF subversion and git services added a comment - Commit 218674e75e669127cd677f1d199984973b005b41 in syncope's branch refs/heads/master from Francesco Chicchiriccò [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=218674e ] SYNCOPE-808 Several pom fixes, proper LICENSE and NOTICE, package reorganization, checkstyle setup
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit b03947a33a3ee3dced1cac6a863856824a4ae158 in syncope's branch refs/heads/master from Andrea Patricelli
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=b03947a ]

          SYNCOPE-808 fixed problems about bundle not found, fixed some editor bugs and added validation - This closes #43 / This closes #27

          Show
          jira-bot ASF subversion and git services added a comment - Commit b03947a33a3ee3dced1cac6a863856824a4ae158 in syncope's branch refs/heads/master from Andrea Patricelli [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=b03947a ] SYNCOPE-808 fixed problems about bundle not found, fixed some editor bugs and added validation - This closes #43 / This closes #27
          Hide
          andrea.patricelli Andrea Patricelli added a comment - - edited

          Now what is missing is:

          1. documentation
          2. favicon
          3. adjust license and links shown while installing
          4. Save must be more clear and intuitive

          Show
          andrea.patricelli Andrea Patricelli added a comment - - edited Now what is missing is: 1. documentation 2. favicon 3. adjust license and links shown while installing 4. Save must be more clear and intuitive
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 69657ca44cdfc24461e247960b4f65a7076e827e in syncope's branch refs/heads/2_0_X from Francesco Chicchiriccò
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=69657ca ]

          SYNCOPE-808 Clearing up the root pom.xml after merge

          Show
          jira-bot ASF subversion and git services added a comment - Commit 69657ca44cdfc24461e247960b4f65a7076e827e in syncope's branch refs/heads/2_0_X from Francesco Chicchiriccò [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=69657ca ] SYNCOPE-808 Clearing up the root pom.xml after merge
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit d76ed3e8b73a5947d286077208f22f741f4f3561 in syncope's branch refs/heads/master from Francesco Chicchiriccò
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=d76ed3e ]

          SYNCOPE-808 Clearing up the root pom.xml after merge

          Show
          jira-bot ASF subversion and git services added a comment - Commit d76ed3e8b73a5947d286077208f22f741f4f3561 in syncope's branch refs/heads/master from Francesco Chicchiriccò [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=d76ed3e ] SYNCOPE-808 Clearing up the root pom.xml after merge
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit d8e18a6c30634e673eb62785bf79df51114dd6b0 in syncope's branch refs/heads/master from Andrea Patricelli
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=d8e18a6 ]

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

          Show
          jira-bot ASF subversion and git services added a comment - Commit d8e18a6c30634e673eb62785bf79df51114dd6b0 in syncope's branch refs/heads/master from Andrea Patricelli [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=d8e18a6 ] SYNCOPE-808 added documentation, fixed problems on license and connection refresh, bugfixes
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit fbda9672010c777bafdd4bb7e2bd4b59fe617ab4 in syncope's branch refs/heads/master from Andrea Patricelli
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=fbda967 ]

          SYNCOPE-808 constant name change

          Show
          jira-bot ASF subversion and git services added a comment - Commit fbda9672010c777bafdd4bb7e2bd4b59fe617ab4 in syncope's branch refs/heads/master from Andrea Patricelli [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=fbda967 ] SYNCOPE-808 constant name change
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 17056055af2829786f90f6a76462740ca79259c0 in syncope's branch refs/heads/2_0_X from Andrea Patricelli
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=1705605 ]

          SYNCOPE-808 correct license file

          Show
          jira-bot ASF subversion and git services added a comment - Commit 17056055af2829786f90f6a76462740ca79259c0 in syncope's branch refs/heads/2_0_X from Andrea Patricelli [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=1705605 ] SYNCOPE-808 correct license file
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit c540189478a10e2d62265df31f25a4790fe9910c in syncope's branch refs/heads/2_0_X from Andrea Patricelli
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=c540189 ]

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

          Show
          jira-bot ASF subversion and git services added a comment - Commit c540189478a10e2d62265df31f25a4790fe9910c in syncope's branch refs/heads/2_0_X from Andrea Patricelli [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=c540189 ] SYNCOPE-808 added documentation, fixed problems on license and connection refresh, bugfixes
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 31bcdcc28dbf9fde5c01946382008d26d93ef7a4 in syncope's branch refs/heads/2_0_X from Francesco Chicchiriccò
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=31bcdcc ]

          SYNCOPE-808 Finalizing docs

          Show
          jira-bot ASF subversion and git services added a comment - Commit 31bcdcc28dbf9fde5c01946382008d26d93ef7a4 in syncope's branch refs/heads/2_0_X from Francesco Chicchiriccò [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=31bcdcc ] SYNCOPE-808 Finalizing docs
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 97a5d21ebc8575c8002a284e577324abe93048ef in syncope's branch refs/heads/master from Francesco Chicchiriccò
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=97a5d21 ]

          SYNCOPE-808 Finalizing docs

          Show
          jira-bot ASF subversion and git services added a comment - Commit 97a5d21ebc8575c8002a284e577324abe93048ef in syncope's branch refs/heads/master from Francesco Chicchiriccò [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=97a5d21 ] SYNCOPE-808 Finalizing docs
          Hide
          andrea.patricelli Andrea Patricelli added a comment -

          At the moment template cache is stored in the user's home, use a more general directory.

          Show
          andrea.patricelli Andrea Patricelli added a comment - At the moment template cache is stored in the user's home, use a more general directory.
          Hide
          andrea.patricelli Andrea Patricelli added a comment -

          Move cache to a tmp directory different from home directory

          Show
          andrea.patricelli Andrea Patricelli added a comment - Move cache to a tmp directory different from home directory
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 5adb643d16091f9e19ba82357e41d77087928d35 in syncope's branch refs/heads/master from Andrea Patricelli
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=5adb643 ]

          SYNCOPE-808 working dir now is system temp directory

          Show
          jira-bot ASF subversion and git services added a comment - Commit 5adb643d16091f9e19ba82357e41d77087928d35 in syncope's branch refs/heads/master from Andrea Patricelli [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=5adb643 ] SYNCOPE-808 working dir now is system temp directory
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit d7b337a9a07eca7ab75d5c79dfb31233e968796a in syncope's branch refs/heads/2_0_X from Andrea Patricelli
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=d7b337a ]

          SYNCOPE-808 working dir now is system temp directory

          Show
          jira-bot ASF subversion and git services added a comment - Commit d7b337a9a07eca7ab75d5c79dfb31233e968796a in syncope's branch refs/heads/2_0_X from Andrea Patricelli [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=d7b337a ] SYNCOPE-808 working dir now is system temp directory
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 960f8d37c65d96885fd7a5f205cdaccbe0b6256f in syncope's branch refs/heads/master from Andrea Patricelli
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=960f8d3 ]

          SYNCOPE-808 logging review and cleanup

          Show
          jira-bot ASF subversion and git services added a comment - Commit 960f8d37c65d96885fd7a5f205cdaccbe0b6256f in syncope's branch refs/heads/master from Andrea Patricelli [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=960f8d3 ] SYNCOPE-808 logging review and cleanup
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 42d131dd23734c7a4379c217e443d19375f8a689 in syncope's branch refs/heads/2_0_X from Andrea Patricelli
          [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=42d131d ]

          SYNCOPE-808 logging review and cleanup

          Show
          jira-bot ASF subversion and git services added a comment - Commit 42d131dd23734c7a4379c217e443d19375f8a689 in syncope's branch refs/heads/2_0_X from Andrea Patricelli [ https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=42d131d ] SYNCOPE-808 logging review and cleanup

            People

            • Assignee:
              andrea.patricelli Andrea Patricelli
              Reporter:
              ilgrosso Francesco Chicchiriccò
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development