Faxtomail-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
February 2014
- 2 participants
- 20 discussions
12 Feb '14
Author: kmorin
Date: 2014-02-12 18:16:05 +0100 (Wed, 12 Feb 2014)
New Revision: 9
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/9
Log:
continue swing ui
Added:
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielService.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeTableModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/FolderTreeNode.java
trunk/faxtomail-ui-swing/src/main/resources/log4j.properties
Removed:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/LabelAware.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/Label.java
Modified:
trunk/faxtomail-persistence/pom.xml
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/CompanyService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java
trunk/faxtomail-ui-swing/pom.xml
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties
trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
Modified: trunk/faxtomail-persistence/pom.xml
===================================================================
--- trunk/faxtomail-persistence/pom.xml 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-persistence/pom.xml 2014-02-12 17:16:05 UTC (rev 9)
@@ -150,6 +150,7 @@
<defaultPackage>com.franciaflex.faxtomail.persistence.entities</defaultPackage>
<fullPackagePath>com.franciaflex.faxtomail.persistence.entities</fullPackagePath>
<templates>
+ org.nuiton.eugene.java.JavaInterfaceTransformer,
org.nuiton.topia.templates.TopiaMetaTransformer
</templates>
</configuration>
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -134,19 +134,19 @@
FaxToMailConfigurationOption.BASEDIR.getKey(),
faxToMailBasedir.getAbsolutePath());
- if (log.isInfoEnabled()) {
- StringBuilder builder = new StringBuilder();
- List<FaxToMailConfigurationOption> options =
- Lists.newArrayList(FaxToMailConfigurationOption.values());
- for (FaxToMailConfigurationOption option : options) {
- String key = option.getKey();
- Object value = applicationConfig.getOption(option);
- builder.append(String.format("\n%1$-40s = %2$s",
- key,
- value));
- }
- log.info("faxtomail: " + builder.toString());
- }
+// if (log.isInfoEnabled()) {
+// StringBuilder builder = new StringBuilder();
+// List<FaxToMailConfigurationOption> options =
+// Lists.newArrayList(FaxToMailConfigurationOption.values());
+// for (FaxToMailConfigurationOption option : options) {
+// String key = option.getKey();
+// Object value = applicationConfig.getOption(option);
+// builder.append(String.format("\n%1$-40s = %2$s",
+// key,
+// value));
+// }
+// log.info("faxtomail: " + builder.toString());
+// }
}
public void prepareDirectories() {
Deleted: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/LabelAware.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/LabelAware.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/LabelAware.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -1,14 +0,0 @@
-package com.franciaflex.faxtomail;
-
-import java.io.Serializable;
-
-/**
- * A contract to decorate some objects
- * (not known at this level but with a label property to display them).
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public interface LabelAware extends Serializable {
- String getLabel();
-}
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -24,11 +24,14 @@
* #L%
*/
-import com.franciaflex.faxtomail.LabelAware;
+import com.franciaflex.faxtomail.persistence.entities.HasLabel;
+import org.apache.commons.logging.LogFactory;
import org.nuiton.decorator.Decorator;
import org.nuiton.decorator.DecoratorProvider;
import java.io.File;
+import java.text.DateFormat;
+import java.util.Date;
import static org.nuiton.i18n.I18n.n;
import static org.nuiton.i18n.I18n.t;
@@ -41,22 +44,6 @@
*/
public class DecoratorService extends FaxToMailServiceSupport {
- public static final String CARACTERISTIC_WITH_UNIT = "withUnit";
-
- public static final String CARACTERISTIC_PARAMETER_ONLY_WITH_UNIT = "parameterOnlyWithUnit";
-
- public static final String CARACTERISTIC_PARAMETER_ONLY = "parameterOnly";
-
- public static final String FROM_PROTOCOL = "fromProtocol";
-
- public static final String GEAR_WITH_RANK_ORDER = "gearWithrankOrder";
-
- public static final String BY_NAME = "byName";
-
- public static final String ONLY_NAME = "onlyName";
-
- public static final String FILE_NAME_COMPATIBLE = "fileNameCompatible";
-
public static final String SEPARATOR = "#";
/** Delegate decorator provider. */
@@ -102,7 +89,18 @@
return bean == null ? "" : String.valueOf(bean);
}
});
- registerMultiJXPathDecorator(LabelAware.class, "${label}$s", SEPARATOR, " - ");
+ registerDecorator(new Decorator<Date>(Date.class) {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String toString(Object bean) {
+ if (bean == null) {
+ return "";
+ }
+ return DateFormat.getDateTimeInstance().format(bean);
+ }
+ });
+ registerMultiJXPathDecorator(HasLabel.class, "${label}$s", SEPARATOR, " - ");
}
};
}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/CompanyService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/CompanyService.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/CompanyService.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -40,6 +40,12 @@
return company;
}
+ public Company getCompanyByName(String name) {
+ CompanyTopiaDao dao = getPersistenceContext().getCompanyDao();
+ Company company = dao.forNameEquals(name).findAny();
+ return company;
+ }
+
public Company saveCompany(Company company, Collection<MailFolder> mailFolders, Map<MailFilter, String> mailFilters) {
Preconditions.checkNotNull(company);
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -0,0 +1,22 @@
+package com.franciaflex.faxtomail.services.service;
+
+import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.EmailTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since x.x
+ */
+public class EmailService extends FaxToMailServiceSupport {
+
+ public List<Email> getEmailForFolder(MailFolder folder) {
+ EmailTopiaDao dao = getPersistenceContext().getEmailDao();
+ return new ArrayList<>(dao.forMailFolderEquals(folder).findAll());
+ }
+}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -28,16 +28,34 @@
import com.franciaflex.faxtomail.persistence.entities.Company;
import com.franciaflex.faxtomail.persistence.entities.CompanyTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.ConfigurationTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
+import com.franciaflex.faxtomail.persistence.entities.DemandStatusTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.DemandType;
+import com.franciaflex.faxtomail.persistence.entities.DemandTypeTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.EmailTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroupTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+import com.franciaflex.faxtomail.persistence.entities.MailFolderTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.Priority;
+import com.franciaflex.faxtomail.persistence.entities.PriorityTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.Range;
+import com.franciaflex.faxtomail.persistence.entities.RangeTopiaDao;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+import com.google.common.collect.Lists;
+import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.jaxx.application.ApplicationTechnicalException;
import java.io.File;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Random;
public class InitFaxToMailService extends FaxToMailServiceSupport {
@@ -100,27 +118,136 @@
}
protected void initSampleData() {
+ log.debug("init Sample Data");
- // companies
- CompanyTopiaDao companyTopiaDao = getPersistenceContext().getCompanyDao();
- ConfigurationTopiaDao configurationTopiaDao = getPersistenceContext().getConfigurationDao();
+ DemandTypeTopiaDao demandTypeDao = getPersistenceContext().getDemandTypeDao();
+ long count = demandTypeDao.count();
- long count = companyTopiaDao.count();
+ if (count == 0) {
+ List<DemandType> types = Lists.newArrayList(
+ demandTypeDao.create(DemandType.PROPERTY_LABEL, "Commande"),
+ demandTypeDao.create(DemandType.PROPERTY_LABEL, "SAV")
+ );
- log.debug("sample data: " + count);
- if (count == 0) {
- log.debug("add sample data");
- companyTopiaDao.create(Company.PROPERTY_NAME, "Franciaflex", Company.PROPERTY_CONFIGURATION, configurationTopiaDao.create());
+ DemandStatusTopiaDao demandStatusDao = getPersistenceContext().getDemandStatusDao();
+ List<DemandStatus> statuses = Lists.newArrayList(
+ demandStatusDao.create(DemandStatus.PROPERTY_LABEL, "Non traîtée"),
+ demandStatusDao.create(DemandStatus.PROPERTY_LABEL, "En cours"),
+ demandStatusDao.create(DemandStatus.PROPERTY_LABEL, "Validée")
+ );
+
+ PriorityTopiaDao priorityDao = getPersistenceContext().getPriorityDao();
+ List<Priority> priorities = Lists.newArrayList(
+ priorityDao.create(Priority.PROPERTY_LABEL, "Basse"),
+ priorityDao.create(Priority.PROPERTY_LABEL, "Normale"),
+ priorityDao.create(Priority.PROPERTY_LABEL, "Haute"),
+ priorityDao.create(Priority.PROPERTY_LABEL, "Urgente")
+ );
+
+ RangeTopiaDao rangeDao = getPersistenceContext().getRangeDao();
+ List<Range> ranges = Lists.newArrayList(
+ rangeDao.create(Range.PROPERTY_LABEL, "Menuiserie"),
+ rangeDao.create(Range.PROPERTY_LABEL, "Volets roulants"),
+ rangeDao.create(Range.PROPERTY_LABEL, "Accessoires")
+ );
+
+ MailFolderTopiaDao folderDao = getPersistenceContext().getMailFolderDao();
+ List<MailFolder> folders = new ArrayList<>();
+
+ Random random = new Random();
+ EmailTopiaDao emailDao = getPersistenceContext().getEmailDao();
+
+ MailFolder cyril = folderDao.create(MailFolder.PROPERTY_NAME, "Cyril");
+ int r = random.nextInt(10) + 5;
+ for (int i = 0 ; i < r ; i++) {
+ emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
+ Email.PROPERTY_OBJECT, RandomStringUtils.randomAlphabetic(10),
+ Email.PROPERTY_RECEPTION_DATE, new Date(),
+ Email.PROPERTY_MAIL_FOLDER, cyril,
+ Email.PROPERTY_DEMAND_TYPE, types.get(random.nextInt(types.size())),
+ Email.PROPERTY_DEMAND_STATUS, statuses.get(random.nextInt(statuses.size())),
+ Email.PROPERTY_PRIORITY, priorities.get(random.nextInt(priorities.size())),
+ Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))));
+ }
+
+ MailFolder claire = folderDao.create(MailFolder.PROPERTY_NAME, "Claire");
+ r = random.nextInt(10) + 5;
+ for (int i = 0 ; i < r ; i++) {
+ emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
+ Email.PROPERTY_OBJECT, RandomStringUtils.randomAlphabetic(10),
+ Email.PROPERTY_RECEPTION_DATE, new Date(),
+ Email.PROPERTY_MAIL_FOLDER, claire,
+ Email.PROPERTY_DEMAND_TYPE, types.get(random.nextInt(types.size())),
+ Email.PROPERTY_DEMAND_STATUS, statuses.get(random.nextInt(statuses.size())),
+ Email.PROPERTY_PRIORITY, priorities.get(random.nextInt(priorities.size())),
+ Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))));
+ }
+
+ MailFolder agathe = folderDao.create(MailFolder.PROPERTY_NAME, "Agathe");
+ r = random.nextInt(10) + 5;
+ for (int i = 0 ; i < r ; i++) {
+ emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
+ Email.PROPERTY_OBJECT, RandomStringUtils.randomAlphabetic(10),
+ Email.PROPERTY_RECEPTION_DATE, new Date(),
+ Email.PROPERTY_MAIL_FOLDER, agathe,
+ Email.PROPERTY_DEMAND_TYPE, types.get(random.nextInt(types.size())),
+ Email.PROPERTY_DEMAND_STATUS, statuses.get(random.nextInt(statuses.size())),
+ Email.PROPERTY_PRIORITY, priorities.get(random.nextInt(priorities.size())),
+ Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))));
+ }
+
+ folders.add(folderDao.create(MailFolder.PROPERTY_NAME, "Chargés de clientèle",
+ MailFolder.PROPERTY_CHILDREN, Lists.newArrayList(cyril, claire, agathe)));
+
+ MailFolder marc = folderDao.create(MailFolder.PROPERTY_NAME, "Marc");
+ r = random.nextInt(10) + 5;
+ for (int i = 0 ; i < r ; i++) {
+ emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
+ Email.PROPERTY_OBJECT, RandomStringUtils.randomAlphabetic(10),
+ Email.PROPERTY_RECEPTION_DATE, new Date(),
+ Email.PROPERTY_MAIL_FOLDER, marc,
+ Email.PROPERTY_DEMAND_TYPE, types.get(random.nextInt(types.size())),
+ Email.PROPERTY_DEMAND_STATUS, statuses.get(random.nextInt(statuses.size())),
+ Email.PROPERTY_PRIORITY, priorities.get(random.nextInt(priorities.size())),
+ Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))));
+ }
+
+ MailFolder frederic = folderDao.create(MailFolder.PROPERTY_NAME, "Frédéric");
+ r = random.nextInt(10) + 5;
+ for (int i = 0 ; i < r ; i++) {
+ emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
+ Email.PROPERTY_OBJECT, RandomStringUtils.randomAlphabetic(10),
+ Email.PROPERTY_RECEPTION_DATE, new Date(),
+ Email.PROPERTY_MAIL_FOLDER, frederic,
+ Email.PROPERTY_DEMAND_TYPE, types.get(random.nextInt(types.size())),
+ Email.PROPERTY_DEMAND_STATUS, statuses.get(random.nextInt(statuses.size())),
+ Email.PROPERTY_PRIORITY, priorities.get(random.nextInt(priorities.size())),
+ Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))));
+ }
+
+ MailFolder jeanne = folderDao.create(MailFolder.PROPERTY_NAME, "Jeanne");
+ r = random.nextInt(10) + 5;
+ for (int i = 0 ; i < r ; i++) {
+ emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
+ Email.PROPERTY_OBJECT, RandomStringUtils.randomAlphabetic(10),
+ Email.PROPERTY_RECEPTION_DATE, new Date(),
+ Email.PROPERTY_MAIL_FOLDER, jeanne,
+ Email.PROPERTY_DEMAND_TYPE, types.get(random.nextInt(types.size())),
+ Email.PROPERTY_DEMAND_STATUS, statuses.get(random.nextInt(statuses.size())),
+ Email.PROPERTY_PRIORITY, priorities.get(random.nextInt(priorities.size())),
+ Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))));
+ }
+ folders.add(folderDao.create(MailFolder.PROPERTY_NAME, "SAV",
+ MailFolder.PROPERTY_CHILDREN, Lists.newArrayList(marc, frederic, jeanne)));
+
+ // companies
+ CompanyTopiaDao companyTopiaDao = getPersistenceContext().getCompanyDao();
+ ConfigurationTopiaDao configurationTopiaDao = getPersistenceContext().getConfigurationDao();
+ companyTopiaDao.create(Company.PROPERTY_NAME, "Franciaflex", Company.PROPERTY_CONFIGURATION, configurationTopiaDao.create(), Company.PROPERTY_MAIL_FOLDER, folders);
companyTopiaDao.create(Company.PROPERTY_NAME, "Faber", Company.PROPERTY_CONFIGURATION, configurationTopiaDao.create());
companyTopiaDao.create(Company.PROPERTY_NAME, "France Fermeture", Company.PROPERTY_CONFIGURATION, configurationTopiaDao.create());
- getPersistenceContext().commit();
- log.debug("sample data " + companyTopiaDao.count());
- }
-
- FaxToMailUserGroupTopiaDao userGroupDao = getPersistenceContext().getFaxToMailUserGroupDao();
- count = userGroupDao.count();
- if (count == 0) {
+ FaxToMailUserGroupTopiaDao userGroupDao = getPersistenceContext().getFaxToMailUserGroupDao();
userGroupDao.create(FaxToMailUserGroup.PROPERTY_NAME, "Chargés de clientèle");
userGroupDao.create(FaxToMailUserGroup.PROPERTY_NAME, "Commerciaux");
userGroupDao.create(FaxToMailUserGroup.PROPERTY_NAME, "SAV");
@@ -128,19 +255,6 @@
getPersistenceContext().commit();
}
-
- FaxToMailUserTopiaDao userDao = getPersistenceContext().getFaxToMailUserDao();
- count = userDao.count();
- if (count == 0) {
- userDao.create(FaxToMailUser.PROPERTY_NAME, "Marc Lefebvre", FaxToMailUser.PROPERTY_LOGIN, "mlefebvre");
- userDao.create(FaxToMailUser.PROPERTY_NAME, "Cyril Baillet", FaxToMailUser.PROPERTY_LOGIN, "cbaillet");
- userDao.create(FaxToMailUser.PROPERTY_NAME, "Frédéric Viala", FaxToMailUser.PROPERTY_LOGIN, "fviala");
- userDao.create(FaxToMailUser.PROPERTY_NAME, "Claire Marquis", FaxToMailUser.PROPERTY_LOGIN, "cmarquis");
- userDao.create(FaxToMailUser.PROPERTY_NAME, "Agathe Borde", FaxToMailUser.PROPERTY_LOGIN, "aborde");
- userDao.create(FaxToMailUser.PROPERTY_NAME, "Jeanne Bourgoin", FaxToMailUser.PROPERTY_LOGIN, "jbourgoin");
-
- getPersistenceContext().commit();
- }
}
}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -20,6 +20,11 @@
private static final Log log = LogFactory.getLog(MailFolderService.class);
+ public List<MailFolder> getAllMailFolders() {
+ MailFolderTopiaDao dao = getPersistenceContext().getMailFolderDao();
+ return new ArrayList<MailFolder>(dao.findAll());
+ }
+
public List<MailFolder> getMailFolders(Collection<String> ids) {
MailFolderTopiaDao dao = getPersistenceContext().getMailFolderDao();
return new ArrayList<MailFolder>(dao.forTopiaIdIn(ids).findAll());
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielService.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielService.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -0,0 +1,41 @@
+package com.franciaflex.faxtomail.services.service;
+
+import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
+import com.franciaflex.faxtomail.persistence.entities.DemandStatusTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.DemandType;
+import com.franciaflex.faxtomail.persistence.entities.DemandTypeTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.Priority;
+import com.franciaflex.faxtomail.persistence.entities.PriorityTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.Range;
+import com.franciaflex.faxtomail.persistence.entities.RangeTopiaDao;
+import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since x.x
+ */
+public class ReferentielService extends FaxToMailServiceSupport {
+
+ public List<DemandStatus> getAllDemandStatus() {
+ DemandStatusTopiaDao dao = getPersistenceContext().getDemandStatusDao();
+ return new ArrayList<>(dao.findAll());
+ }
+
+ public List<DemandType> getAllDemandType() {
+ DemandTypeTopiaDao dao = getPersistenceContext().getDemandTypeDao();
+ return new ArrayList<>(dao.findAll());
+ }
+
+ public List<Priority> getAllPriority() {
+ PriorityTopiaDao dao = getPersistenceContext().getPriorityDao();
+ return new ArrayList<>(dao.findAll());
+ }
+
+ public List<Range> getAllRange() {
+ RangeTopiaDao dao = getPersistenceContext().getRangeDao();
+ return new ArrayList<>(dao.findAll());
+ }
+}
Modified: trunk/faxtomail-ui-swing/pom.xml
===================================================================
--- trunk/faxtomail-ui-swing/pom.xml 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/pom.xml 2014-02-12 17:16:05 UTC (rev 9)
@@ -63,13 +63,25 @@
<dependencies>
+
<dependency>
<groupId>${project.groupId}</groupId>
+ <artifactId>faxtomail-persistence</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
<artifactId>faxtomail-service</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.nuiton.topia</groupId>
+ <artifactId>topia-persistence</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.nuiton</groupId>
<artifactId>nuiton-utils</artifactId>
</dependency>
@@ -210,6 +222,13 @@
<artifactId>junit</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+
</dependencies>
<build>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -1,9 +1,18 @@
package com.franciaflex.faxtomail.ui.swing;
import com.franciaflex.faxtomail.FaxToMailConfiguration;
+import com.franciaflex.faxtomail.persistence.entities.Company;
+import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaApplicationContext;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
import com.franciaflex.faxtomail.services.DecoratorService;
import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
import com.franciaflex.faxtomail.persistence.RessourceClassLoader;
+import com.franciaflex.faxtomail.services.service.CompanyService;
+import com.franciaflex.faxtomail.services.service.EmailService;
+import com.franciaflex.faxtomail.services.service.InitFaxToMailService;
+import com.franciaflex.faxtomail.services.service.MailFolderService;
+import com.franciaflex.faxtomail.services.service.ReferentielService;
import com.franciaflex.faxtomail.ui.swing.content.MainUI;
import com.franciaflex.faxtomail.ui.swing.util.UIMessageNotifier;
import com.google.common.base.Preconditions;
@@ -170,6 +179,10 @@
private final ApplicationActionEngine faxToMailActionEngine;
+ protected Company currentCompany;
+
+ protected Email currentEmail;
+
public static FaxToMailUIContext newContext(FaxToMailConfiguration config) {
Preconditions.checkNotNull(config);
Preconditions.checkState(applicationContext == null,
@@ -200,8 +213,16 @@
this.config = config;
this.resourceLoader = new RessourceClassLoader(Thread.currentThread().getContextClassLoader());
this.serviceContext = new FaxToMailServiceContext();
+ FaxToMailTopiaApplicationContext topiaApplicationContext = new FaxToMailTopiaApplicationContext(config.getTopiaProperties());
+ FaxToMailTopiaPersistenceContext persistenceContext = topiaApplicationContext.newPersistenceContext();
+ serviceContext.setPersistenceContext(persistenceContext);
serviceContext.setApplicationConfig(config);
+ InitFaxToMailService initExtranetService =
+ serviceContext.newService(InitFaxToMailService.class);
+
+ initExtranetService.init();
+
Map<Class, State> additionalStates = Maps.newHashMap();
additionalStates.put(BeanFilterableComboBox.class, new BeanFilterableComboBoxState());
additionalStates.put(BeanDoubleList.class, new BeanDoubleListState());
@@ -380,6 +401,10 @@
// helpDirectory));
// }
//
+
+ Company franciaflex = getCompanyService().getCompanyByName("Franciaflex");
+ setCurrentCompany(franciaflex);
+
// //--------------------------------------------------------------------//
// // init action UI
// //--------------------------------------------------------------------//
@@ -447,6 +472,22 @@
return serviceContext.newService(DecoratorService.class);
}
+ public MailFolderService getMailFolderService() {
+ return serviceContext.newService(MailFolderService.class);
+ }
+
+ public CompanyService getCompanyService() {
+ return serviceContext.newService(CompanyService.class);
+ }
+
+ public EmailService getEmailService() {
+ return serviceContext.newService(EmailService.class);
+ }
+
+ public ReferentielService getReferentielService() {
+ return serviceContext.newService(ReferentielService.class);
+ }
+
//------------------------------------------------------------------------//
//-- DataContext methods --//
//------------------------------------------------------------------------//
@@ -592,4 +633,19 @@
firePropertyChange(PROPERTY_LOCALE, null, locale);
}
+ public Company getCurrentCompany() {
+ return currentCompany;
+ }
+
+ public void setCurrentCompany(Company currentCompany) {
+ this.currentCompany = currentCompany;
+ }
+
+ public Email getCurrentEmail() {
+ return currentEmail;
+ }
+
+ public void setCurrentEmail(Email currentEmail) {
+ this.currentEmail = currentEmail;
+ }
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -35,7 +35,7 @@
// Create configuration
FaxToMailConfiguration config =
- new FaxToMailConfiguration("faxtomail.config", args);
+ new FaxToMailConfiguration("faxtomail.properties", args);
// Create application context
FaxToMailUIContext context = FaxToMailUIContext.newContext(config);
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css 2014-02-12 17:16:05 UTC (rev 9)
@@ -1,68 +1,33 @@
-BeanFilterableComboBox {
- showReset: true;
- bean: {model};
+#navigationTree {
+ font-size: "11";
+ rootVisible: false;
+ showsRootHandles: true;
}
-JXDatePicker {
- _selectOnFocus: {true};
+#dataTable {
+ editable: false;
+ autoCreateRowSorter: true;
}
-JTextField {
- _selectOnFocus: {true};
+#printMenu {
+ actionIcon: print;
+ text: "faxtomail.demandeList.action.print";
+ toolTipText: "faxtomail.demandeList.action.print.tip";
+ i18nMnemonic: "faxtomail.demandeList.action.print.mnemonic";
}
-.between2ndPartLabel {
- text: "faxtomail.search.between2ndPart.label";
+#replyMenu {
+ actionIcon: reply;
+ text: "faxtomail.demandeList.action.reply";
+ toolTipText: "faxtomail.demandeList.action.reply.tip";
+ i18nMnemonic: "faxtomail.demandeList.action.reply.mnemonic";
+ enabled: {model.isReplyEnabled()};
}
-#modifiedByLabel {
- text: "faxtomail.search.modifiedBy.label";
-}
-
-#modifiedBetweenLabel {
- text: "faxtomail.search.modifiedBetween.label";
-}
-
-#receivedBetweenLabel {
- text: "faxtomail.search.receivedBetween.label";
-}
-
-#printedBetweenLabel {
- text: "faxtomail.search.printedBetween.label";
-}
-
-#objectLabel {
- text: "faxtomail.search.object.label";
-}
-
-#statusLabel {
- text: "faxtomail.search.status.label";
-}
-
-#senderLabel {
- text: "faxtomail.search.sender.label";
-}
-
-#docTypeLabel {
- text: "faxtomail.search.docType.label";
-}
-
-#clientAccountLabel {
- text: "faxtomail.search.clientAccount.label";
-}
-
-#refLabel {
- text: "faxtomail.search.ref.label";
-}
-
-#commentLabel {
- text: "faxtomail.search.comment.label";
-}
-
-#chantierLabel {
- text: "faxtomail.search.chantier.label";
-}
-
-#searchButton {
- text: "faxtomail.search.button.label"
+#addAttachmentMenu {
+ actionIcon: attachment;
+ text: "faxtomail.demandeList.action.attachment";
+ toolTipText: "faxtomail.demandeList.action.attachment.tip";
+ i18nMnemonic: "faxtomail.demandeList.action.attachment.mnemonic";
+ enabled: {model.isAddAttachmentEnabled()};
}
\ No newline at end of file
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx 2014-02-12 17:16:05 UTC (rev 9)
@@ -5,7 +5,6 @@
com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI
com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil
- com.franciaflex.faxtomail.ui.swing.util.Label
jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
@@ -23,18 +22,31 @@
<DemandeListUIModel id='model'
initializer='getContextValue(DemandeListUIModel.class)'/>
+ <!--
+ Au dessus du tableau, mettre les totaux des quantités PF et SAV. Mettre à jour en fonction des éléments affichés (suivant le filtre)
+ Liste des éléments globale (de tous les dossiers accessibles).
+ -->
+
+ <JPopupMenu id='tablePopup'>
+ <JMenuItem id='printMenu'
+ onActionPerformed='handler.print()'/>
+ <JMenuItem id='replyMenu'
+ onActionPerformed='handler.reply()'/>
+ <JMenuItem id='addAttachmentMenu'
+ onActionPerformed='handler.addAttachment()'/>
+ </JPopupMenu>
+
<JSplitPane constraints='BorderLayout.CENTER'>
<JScrollPane>
- <JTree id="navigationTree"
- font-size='11'
- rootVisible='false'
- showsRootHandles='false'/>
+ <JTree id="navigationTree"/>
</JScrollPane>
<JPanel layout='{new BorderLayout()}'>
- <JLabel id="selectedFolder" text="1 - Volets roulants" constraints='BorderLayout.NORTH'/>
+ <JLabel id="selectedFolder" constraints='BorderLayout.NORTH'/>
<JScrollPane constraints='BorderLayout.CENTER'>
- <JXTable id='dataTable' autoCreateRowSorter='true'/>
+ <JXTable id='dataTable'
+ onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'
+ onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
</JScrollPane>
</JPanel>
</JSplitPane>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -24,24 +24,38 @@
* #L%
*/
+import com.franciaflex.faxtomail.persistence.entities.Company;
+import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.ui.swing.actions.ShowDemandeAction;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
import com.franciaflex.faxtomail.ui.swing.util.CloseableUI;
-import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI;
+import jaxx.runtime.swing.JAXXWidgetUtil;
import jaxx.runtime.validator.swing.SwingValidator;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.JXTable;
+import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
+import org.jdesktop.swingx.table.TableColumnModelExt;
+import org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel;
import javax.swing.*;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableModel;
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeModel;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
import static org.nuiton.i18n.I18n.t;
@@ -75,58 +89,124 @@
*/
// private final PersistenceService persistenceService;
+ @Override
+ public void beforeInit(DemandeListUI ui) {
+ super.beforeInit(ui);
+
+ DemandeListUIModel model = new DemandeListUIModel();
+ Company franciaflex = getContext().getCurrentCompany();
+ Collection<MailFolder> folders = franciaflex.getMailFolder();
+ model.setFolders(new ArrayList<MailFolder>(folders));
+
+ model.addPropertyChangeListener(DemandeListUIModel.PROPERTY_SELECTED_FOLDER, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ DemandeListUIModel model = (DemandeListUIModel) evt.getSource();
+ MailFolder folder = (MailFolder) evt.getNewValue();
+ List<Email> emails = getContext().getEmailService().getEmailForFolder(folder);
+ model.setEmails(emails);
+ }
+ });
+
+ this.ui.setContextValue(model);
+ }
+
@Override
public void afterInit(DemandeListUI ui) {
initUI(ui);
+ // init tree
DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
+ for (MailFolder folder : getModel().getFolders()) {
+ createFolderTree(root, folder);
+ }
- DefaultMutableTreeNode commandes = new DefaultMutableTreeNode("Commandes");
- commandes.add(new DefaultMutableTreeNode("FME - 1 - Volets roulants"));
- commandes.add(new DefaultMutableTreeNode("FME - 1 - Volets roulants"));
+ TreeModel treeModel = new DefaultTreeModel(root);
+ JTree navigationTree = ui.getNavigationTree();
+ navigationTree.setModel(treeModel);
- DefaultMutableTreeNode devis = new DefaultMutableTreeNode("Devis");
- devis.add(new DefaultMutableTreeNode("FME - 1 - Volets roulants"));
- devis.add(new DefaultMutableTreeNode("FME - 1 - Volets roulants"));
+ // use the folder icon for the leaf
+ DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer();
+ Icon folderIcon = renderer.getDefaultClosedIcon();
+ renderer.setLeafIcon(folderIcon);
+ navigationTree.setCellRenderer(renderer);
- root.add(commandes);
- root.add(devis);
+ JAXXWidgetUtil.expandTree(navigationTree);
+ navigationTree.addTreeSelectionListener(new TreeSelectionListener() {
+ @Override
+ public void valueChanged(TreeSelectionEvent e) {
+ FolderTreeNode folderNode = (FolderTreeNode) e.getPath().getLastPathComponent();
+ MailFolder folder = folderNode.getMailFolder();
+ getModel().setSelectedFolder(folder);
+ }
+ });
- TreeModel treeModel = new DefaultTreeModel(root);
- ui.getNavigationTree().setModel(treeModel);
+ // init table
+ TableColumnModelExt columnModel = new DefaultTableColumnModelExt();
+ Company franciaflex = getContext().getCurrentCompany();
+ String columns = franciaflex.getConfiguration().getTableColumns();
+ if (columns == null) {
+ columns = StringUtils.join(new String[] {
+ Email.PROPERTY_OBJECT, Email.PROPERTY_RECEPTION_DATE, Email.PROPERTY_SENDER_EMAIL_ADDRESS
+ }, ',');
+ }
+ String[] columnNames = columns.split(",");
+ for (String columnName : columnNames) {
+ addColumnToModel(columnModel,
+ null,
+ Email.PROPERTY_RECEPTION_DATE.equals(columnName) ? newTableCellRender(Date.class): null,
+ DemandeTableModel.COLUMN_IDENTIFIERS.get(columnName))
+ .setSortable(true);
+ }
+ final AbstractApplicationTableModel tableModel = new DemandeTableModel(columnModel);
+ JXTable table = ui.getDataTable();
+ table.setModel(tableModel);
+ table.setColumnModel(columnModel);
+ table.getTableHeader().setReorderingAllowed(false);
- String[][] data = new String[][] {
- { "Sté 1", "Utilisateur 1", "Objet 1", "10/01/14 12:12" },
- { "Sté 2", "Utilisateur 2", "Objet 2", "13/01/14 12:12" },
- { "Sté 3", "Utilisateur 3", "Objet 3", "14/01/14 12:12" }
- };
- String[] columns = new String[] {
- "De",
- "Nom TCC",
- "Objet",
- "Reçu le"
- };
- TableModel tableModel = new DefaultTableModel(data, columns);
- ui.getDataTable().setModel(tableModel);
- ui.getDataTable().setEditable(false);
-
- ui.getDataTable().addMouseListener(new MouseAdapter() {
+ table.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent evt) {
JXTable table = (JXTable) evt.getSource();
if (evt.getClickCount() == 2) {
+ int rowIndex = table.getSelectedRow();
+ Email selectedEmail = (Email) tableModel.getEntry(rowIndex);
+ getContext().setCurrentEmail(selectedEmail);
getContext().getActionEngine().runAction(new ShowDemandeAction(getContext().getMainUI().getHandler()));
}
}
});
-// initBeanFilterableComboBox(ui.getModifiedByComboBox(), createLabelList("Utilisateur A", "Utilisateur B", "Utilisateur C"), null);
-// initBeanFilterableComboBox(ui.getStatusComboBox(), createLabelList("Nouveau", "En cours", "Archivé"), null);
-// initBeanFilterableComboBox(ui.getDocTypeComboBox(), createLabelList("Commande", "SAV"), null);
+ getModel().addPropertyChangeListener(DemandeListUIModel.PROPERTY_EMAILS, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ List<Email> emails = (List<Email>) evt.getNewValue();
+ tableModel.setRows(emails);
+ }
+ });
+ getModel().addPropertyChangeListener(DemandeListUIModel.PROPERTY_SELECTED_FOLDER, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ MailFolder folder = (MailFolder) evt.getNewValue();
+ String name = folder != null ? folder.getName() : null;
+ getUI().getSelectedFolder().setText(name);
+ }
+ });
+
}
+ protected void createFolderTree(DefaultMutableTreeNode parent, MailFolder folder) {
+ DefaultMutableTreeNode node = new FolderTreeNode(folder);
+ parent.add(node);
+ if (folder.isChildrenNotEmpty()) {
+ for (MailFolder child : folder.getChildren()) {
+ createFolderTree(node, child);
+ }
+ }
+ }
+
@Override
protected JComponent getComponentToFocus() {
return getUI().getNavigationTree();
@@ -158,4 +238,25 @@
public SwingValidator<DemandeListUIModel> getValidator() {
return null;
}
+
+ @Override
+ protected void beforeOpenPopup(int rowIndex, int columnIndex) {
+ super.beforeOpenPopup(rowIndex, columnIndex);
+
+ int selectedRowCount = getUI().getDataTable().getSelectedRowCount();
+ getModel().setAddAttachmentEnabled(selectedRowCount == 1);
+ getModel().setReplyEnabled(selectedRowCount == 1);
+ }
+
+ public void print() {
+ log.debug("print");
+ }
+
+ public void reply() {
+ log.debug("reply");
+ }
+
+ public void addAttachment() {
+ log.debug("addAttachment");
+ }
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -1,9 +1,74 @@
package com.franciaflex.faxtomail.ui.swing.content.demande;
+import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+import org.jdesktop.beans.AbstractSerializableBean;
+
+import java.util.List;
+
/**
* @author kmorin <kmorin(a)codelutin.com>
* @since x.x
*/
-public class DemandeListUIModel {
+public class DemandeListUIModel extends AbstractSerializableBean {
+ public static final String PROPERTY_FOLDERS = "folders";
+ public static final String PROPERTY_EMAILS = "emails";
+ public static final String PROPERTY_SELECTED_FOLDER = "selectedFolder";
+
+ protected List<MailFolder> folders;
+
+ protected List<Email> emails;
+
+ protected MailFolder selectedFolder;
+
+ protected boolean replyEnabled;
+
+ protected boolean addAttachmentEnabled;
+
+ public List<MailFolder> getFolders() {
+ return folders;
+ }
+
+ public void setFolders(List<MailFolder> folders) {
+ Object oldValue = getFolders();
+ this.folders = folders;
+ firePropertyChange(PROPERTY_FOLDERS, oldValue, folders);
+ }
+
+ public List<Email> getEmails() {
+ return emails;
+ }
+
+ public void setEmails(List<Email> emails) {
+ Object oldValue = getEmails();
+ this.emails = emails;
+ firePropertyChange(PROPERTY_EMAILS, oldValue, emails);
+ }
+
+ public MailFolder getSelectedFolder() {
+ return selectedFolder;
+ }
+
+ public void setSelectedFolder(MailFolder selectedFolder) {
+ Object oldValue = getSelectedFolder();
+ this.selectedFolder = selectedFolder;
+ firePropertyChange(PROPERTY_SELECTED_FOLDER, oldValue, selectedFolder);
+ }
+
+ public boolean isReplyEnabled() {
+ return replyEnabled;
+ }
+
+ public void setReplyEnabled(boolean replyEnabled) {
+ this.replyEnabled = replyEnabled;
+ }
+
+ public boolean isAddAttachmentEnabled() {
+ return addAttachmentEnabled;
+ }
+
+ public void setAddAttachmentEnabled(boolean addAttachmentEnabled) {
+ this.addAttachmentEnabled = addAttachmentEnabled;
+ }
}
Added: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeTableModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeTableModel.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeTableModel.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -0,0 +1,129 @@
+package com.franciaflex.faxtomail.ui.swing.content.demande;
+
+import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.EmailImpl;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.swingx.table.TableColumnModelExt;
+import org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel;
+import org.nuiton.jaxx.application.swing.table.ColumnIdentifier;
+
+import javax.swing.table.AbstractTableModel;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.nuiton.i18n.I18n.n;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since x.x
+ */
+public class DemandeTableModel extends AbstractApplicationTableModel<Email> {
+
+ private static final Log log =
+ LogFactory.getLog(DemandeTableModel.class);
+
+ public static final Map<String, ColumnIdentifier<Email>> COLUMN_IDENTIFIERS = new HashMap<String, ColumnIdentifier<Email>>() {{
+ put(Email.PROPERTY_SENDER_EMAIL_ADDRESS,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_SENDER_EMAIL_ADDRESS,
+ n("faxtomail.demandeList.table.header.senderEmail"),
+ n("faxtomail.demandeList.table.header.senderEmail")));
+
+ put(Email.PROPERTY_OBJECT,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_OBJECT,
+ n("faxtomail.demandeList.table.header.object"),
+ n("faxtomail.demandeList.table.header.object")));
+
+ put(Email.PROPERTY_RECEPTION_DATE,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_RECEPTION_DATE,
+ n("faxtomail.demandeList.table.header.receptionDate"),
+ n("faxtomail.demandeList.table.header.receptionDate")));
+
+ put(Email.PROPERTY_CLIENT,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_CLIENT,
+ n("faxtomail.demandeList.table.header.client"),
+ n("faxtomail.demandeList.table.header.client")));
+
+ put(Email.PROPERTY_COMMAND_NB,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_COMMAND_NB,
+ n("faxtomail.demandeList.table.header.commandNb"),
+ n("faxtomail.demandeList.table.header.commandNb")));
+
+ put(Email.PROPERTY_DEMAND_STATUS,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_DEMAND_STATUS,
+ n("faxtomail.demandeList.table.header.status"),
+ n("faxtomail.demandeList.table.header.status")));
+
+ put(Email.PROPERTY_DEMAND_TYPE,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_DEMAND_TYPE,
+ n("faxtomail.demandeList.table.header.type"),
+ n("faxtomail.demandeList.table.header.type")));
+
+ put(Email.PROPERTY_EDI_CODE_NUMBER,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_EDI_CODE_NUMBER,
+ n("faxtomail.demandeList.table.header.ediCodeNumber"),
+ n("faxtomail.demandeList.table.header.ediCodeNumber")));
+
+ put(Email.PROPERTY_ETAT_ATTENTE,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_ETAT_ATTENTE,
+ n("faxtomail.demandeList.table.header.waitingState"),
+ n("faxtomail.demandeList.table.header.waitingState")));
+
+ put(Email.PROPERTY_FAX_TO_MAIL_USER,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_FAX_TO_MAIL_USER,
+ n("faxtomail.demandeList.table.header.user"),
+ n("faxtomail.demandeList.table.header.user")));
+
+ put(Email.PROPERTY_MAIL_FOLDER,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_MAIL_FOLDER,
+ n("faxtomail.demandeList.table.header.folder"),
+ n("faxtomail.demandeList.table.header.folder")));
+
+ put(Email.PROPERTY_PRIORITY,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_PRIORITY,
+ n("faxtomail.demandeList.table.header.priority"),
+ n("faxtomail.demandeList.table.header.priority")));
+
+ put(Email.PROPERTY_PROJECT_REFERENCE,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_PROJECT_REFERENCE,
+ n("faxtomail.demandeList.table.header.projectReference"),
+ n("faxtomail.demandeList.table.header.projectReference")));
+
+ put(Email.PROPERTY_RANGE,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_RANGE,
+ n("faxtomail.demandeList.table.header.range"),
+ n("faxtomail.demandeList.table.header.range")));
+
+ put(Email.PROPERTY_SAV_NUMBER,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_SAV_NUMBER,
+ n("faxtomail.demandeList.table.header.savNumber"),
+ n("faxtomail.demandeList.table.header.savNumber")));
+
+ }};
+
+ protected DemandeTableModel(TableColumnModelExt columnModel) {
+ super(columnModel, false, false);
+ }
+
+ @Override
+ public Email createNewRow() {
+ return new EmailImpl();
+ }
+}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-02-12 17:16:05 UTC (rev 9)
@@ -15,38 +15,104 @@
text: "faxtomail.demande.object.label";
}
-#receivedLabel {
- text: "faxtomail.demande.received.label";
+#objectField {
+ text: {model.getObject()};
}
-#tccLabel {
- text: "faxtomail.demande.tcc.label";
+#receivedDateLabel {
+ text: "faxtomail.demande.receivedDate.label";
}
-#docTypeLabel {
- text: "faxtomail.demande.docType.label";
+#receivedDateField {
+ text: {getDateFormat().format(model.getReceptionDate())};
+ editable: false;
}
-#statusLabel {
- text: "faxtomail.demande.status.label";
+#senderLabel {
+ text: "faxtomail.demande.sender.label";
}
-#priorityLabel {
- text: "faxtomail.demande.priority.label";
+#senderField {
+ text: {model.getSenderEmailAddress()};
+ editable: false;
}
#clientLabel {
text: "faxtomail.demande.client.label";
}
+#docTypeLabel {
+ text: "faxtomail.demande.docType.label";
+}
+
+#docTypeComboBox {
+ property: demandType;
+ selectedItem: {model.getDemandType()};
+}
+
#demandeNumberLabel {
text: "faxtomail.demande.demandeNumber.label";
}
-#refLabel {
- text: "faxtomail.demande.ref.label";
+#demandeNumberField {
+ text: {model.getCommandNb()};
}
+#ediCodeNumberLabel {
+ text: "faxtomail.demande.ediCodeNumber.label";
+}
+
+#ediCodeNumberField {
+ text: {model.getEdiCodeNumber()};
+ editable: false;
+}
+
+#priorityLabel {
+ text: "faxtomail.demande.priority.label";
+}
+
+#priorityComboBox {
+ property: priority;
+ selectedItem: {model.getPriority()};
+}
+
+#statusLabel {
+ text: "faxtomail.demande.status.label";
+}
+
+#statusComboBox {
+ property: demandStatus;
+ selectedItem: {model.getDemandStatus()};
+}
+
+#etatAttenteLabel {
+ text: "faxtomail.demande.etatAttente.label";
+}
+
+#projectReferenceLabel {
+ text: "faxtomail.demande.projectReference.label";
+}
+
+#projectReferenceField {
+ text: {model.getProjectReference()};
+}
+
+#savNumberLabel {
+ text: "faxtomail.demande.savNumber.label";
+}
+
+#savNumberField {
+ text: {model.getSavNumber()};
+}
+
+#finishedProductsLabel {
+ text: "faxtomail.demande.finishedProducts.label";
+}
+
+//#finishedProductsField {
+//
+//}
+
#gammeLabel {
text: "faxtomail.demande.gamme.label";
}
@@ -74,4 +140,4 @@
#archiveButton {
text: "faxtomail.demande.archive.button.label";
-}
\ No newline at end of file
+}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx 2014-02-12 17:16:05 UTC (rev 9)
@@ -5,8 +5,13 @@
com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI
com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil
- com.franciaflex.faxtomail.ui.swing.util.Label
+ com.franciaflex.faxtomail.persistence.entities.Email
+ com.franciaflex.faxtomail.persistence.entities.DemandType
+ com.franciaflex.faxtomail.persistence.entities.DemandStatus
+ com.franciaflex.faxtomail.persistence.entities.Range
+ com.franciaflex.faxtomail.persistence.entities.Priority
+
jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
org.jdesktop.swingx.JXDatePicker
@@ -25,7 +30,7 @@
]]></script>
<DemandeUIModel id='model'
- initializer='getContextValue(DemandeUIModel.class)'/>
+ initializer='getContextValue(DemandeUIModel.class)'/>
<String id='patternLayout' javaBean='"dd/MM/yyyy HH:mm:ss"'/>
@@ -37,106 +42,139 @@
<JPanel layout='{new GridLayout(0,1)}'>
<Table fill='both'>
+
<row>
- <cell anchor='west'>
- <JLabel id='objectLabel'/>
+ <cell anchor='east'>
+ <JLabel id='receivedDateLabel'/>
</cell>
- <cell weightx='1' columns="3">
- <JTextField id='objectField'/>
+ <cell weightx='1'>
+ <JTextField id='receivedDateField'/>
</cell>
- </row>
- <row>
- <cell anchor='west'>
- <JLabel id='receivedLabel'/>
+ <cell anchor='east'>
+ <JLabel id='senderLabel'/>
</cell>
<cell weightx='1'>
- <JAXXDatePicker id='receivedDatePicker'
- date='{date}'
- patternLayout='{patternLayout}'/>
+ <JTextField id='senderField'/>
</cell>
- <cell>
- <JLabel id='tccLabel'/>
+
+ <cell anchor='east'>
+ <JLabel id='clientLabel'/>
</cell>
<cell weightx='1'>
- <JTextField id='tccField'/>
+ <JTextField id='clientField'/><!-- TODO list of clients -->
</cell>
</row>
<row>
- <cell anchor='west' columns='4'>
- <JLabel text="Dernière modification par Utilisateur 1 le 14/01/2014 à 08:42"/>
+ <cell anchor='east'>
+ <JLabel id='objectLabel'/>
</cell>
+ <cell weightx='1' columns="5">
+ <JTextField id='objectField'
+ onKeyReleased='handler.setText(event, "object")'/>
+ </cell>
</row>
- </Table>
- <Table>
<row>
- <cell anchor='west'>
+ <cell anchor='east'>
<JLabel id='docTypeLabel'/>
</cell>
<cell weightx='1'>
<BeanFilterableComboBox id='docTypeComboBox'
constructorParams='this'
- genericType="Label"/>
+ genericType="DemandType"/>
</cell>
- <cell anchor='west'>
+
+ <cell anchor='east'>
+ <JLabel id='demandeNumberLabel'/>
+ </cell>
+ <cell weightx='1'>
+ <JTextField id='demandeNumberField'
+ onKeyReleased='handler.setText(event, "commandNb")'/>
+ </cell>
+
+ <cell anchor='east'>
+ <JLabel id='ediCodeNumberLabel'/>
+ </cell>
+ <cell weightx='1'>
+ <JTextField id='ediCodeNumberField'/>
+ </cell>
+ </row>
+
+ <row>
+ <cell anchor='east'>
+ <JLabel id='priorityLabel'/>
+ </cell>
+ <cell weightx='1'>
+ <BeanFilterableComboBox id='priorityComboBox'
+ constructorParams='this'
+ genericType="Priority"/>
+ </cell>
+
+ <cell anchor='east'>
<JLabel id='statusLabel'/>
</cell>
<cell weightx='1'>
<BeanFilterableComboBox id='statusComboBox'
constructorParams='this'
- genericType="Label"/>
+ genericType="DemandStatus"/>
</cell>
- <cell anchor='west'>
- <JLabel id='priorityLabel'/>
+
+ <cell anchor='east'>
+ <JLabel id='etatAttenteLabel'/>
</cell>
<cell weightx='1'>
- <BeanFilterableComboBox id='priorityComboBox'
+ <BeanFilterableComboBox id='etatAttenteComboBox'
constructorParams='this'
- genericType="Label"/>
+ genericType="DemandStatus"/>
</cell>
</row>
<row>
- <cell anchor='west'>
- <JLabel id='clientLabel'/>
+ <cell anchor='east'>
+ <JLabel id='projectReferenceLabel'/>
</cell>
<cell weightx='1'>
- <JTextField id='clientField'/>
+ <JTextField id='projectReferenceField'/>
</cell>
- <cell anchor='west'>
- <JLabel id='demandeNumberLabel'/>
+
+ <cell anchor='east'>
+ <JLabel id='savNumberLabel'/>
</cell>
<cell weightx='1'>
- <JTextField id='demandeNumberField'/>
+ <JTextField id='savNumberField'/>
</cell>
- <cell anchor='west'>
- <JLabel id='refLabel'/>
+
+ <cell anchor='east'>
+ <JLabel id='finishedProductsLabel'/>
</cell>
<cell weightx='1'>
- <JTextField id='refField'/>
+ <JTextField id='finishedProductsField'/>
</cell>
</row>
<row>
- <cell anchor='west'>
+ <cell anchor='east'>
<JLabel id='gammeLabel'/>
</cell>
- <cell weightx='1'>
+ <cell weightx='1' columns='6'>
<BeanFilterableComboBox id='gammeComboBox'
constructorParams='this'
- genericType="Label"/>
+ genericType="Range"/>
</cell>
- <cell anchor='west'>
+ </row>
+
+ <row>
+ <cell anchor='east'>
<JLabel id='messageLabel'/>
</cell>
- <cell weightx='3' columns='3'>
+ <cell weightx='1' columns='5'>
<JScrollPane id='commentPane'>
<JTextArea id='messageField'/>
</JScrollPane>
</cell>
- </row>
+ </row>
</Table>
@@ -158,15 +196,6 @@
<JButton text="Ajouter"/>
</JPanel>
- <JPanel id="faxInfoPanel"
- border='{BorderFactory.createTitledBorder("Informations fax")}'
- layout='{new GridLayout(0,1)}'>
- <JLabel text="Télécopie reçue le 10/01/2014 à 13:37"/>
- <JLabel text="Origine : 02 34 56 78 90"/>
- <JLabel text="Nombre de pages : 1, durée : 13 secondes, vitesse : 31200"/>
- <JLabel text="Numéro SDA : 6374"/>
- </JPanel>
-
</JPanel>
</JScrollPane>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -24,6 +24,10 @@
* #L%
*/
+import com.franciaflex.faxtomail.persistence.entities.Company;
+import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+import com.franciaflex.faxtomail.services.service.ReferentielService;
import com.franciaflex.faxtomail.ui.swing.content.search.SearchUI;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
import com.franciaflex.faxtomail.ui.swing.util.CloseableUI;
@@ -34,6 +38,12 @@
import javax.swing.*;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
import static org.nuiton.i18n.I18n.t;
/**
@@ -66,17 +76,31 @@
*/
// private final PersistenceService persistenceService;
+ @Override
+ public void beforeInit(DemandeUI ui) {
+ super.beforeInit(ui);
+
+ DemandeUIModel model = new DemandeUIModel();
+ model.fromBean(getContext().getCurrentEmail());
+ log.debug(model.getDemandStatus());
+
+ this.ui.setContextValue(model);
+ }
+
@Override
public void afterInit(DemandeUI ui) {
initUI(ui);
- initBeanFilterableComboBox(ui.getDocTypeComboBox(), createLabelList("Commande", "SAV"), null);
- initBeanFilterableComboBox(ui.getStatusComboBox(), createLabelList("Non traité", "En cours", "Clos"), null);
- initBeanFilterableComboBox(ui.getPriorityComboBox(), createLabelList("Basse", "Normale", "Haute", "Urgente"), null);
- initBeanFilterableComboBox(ui.getGammeComboBox(), createLabelList("FFE"), null);
+ DemandeUIModel model = getModel();
+ ReferentielService referentielService = getContext().getReferentielService();
+ initBeanFilterableComboBox(ui.getDocTypeComboBox(), referentielService.getAllDemandType(), model.getDemandType());
+ initBeanFilterableComboBox(ui.getStatusComboBox(), referentielService.getAllDemandStatus(), model.getDemandStatus());
+ initBeanFilterableComboBox(ui.getPriorityComboBox(), referentielService.getAllPriority(), model.getPriority());
+ initBeanFilterableComboBox(ui.getGammeComboBox(), referentielService.getAllRange(), null);
+
}
@Override
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -1,9 +1,190 @@
package com.franciaflex.faxtomail.ui.swing.content.demande;
+import com.franciaflex.faxtomail.persistence.entities.Client;
+import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
+import com.franciaflex.faxtomail.persistence.entities.DemandType;
+import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.EmailImpl;
+import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
+import com.franciaflex.faxtomail.persistence.entities.Priority;
+import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailBeanUIModel;
+import org.nuiton.util.beans.Binder;
+import org.nuiton.util.beans.BinderFactory;
+
+import java.util.Date;
+
/**
* @author kmorin <kmorin(a)codelutin.com>
* @since x.x
*/
-public class DemandeUIModel {
+public class DemandeUIModel extends AbstractFaxToMailBeanUIModel<Email, DemandeUIModel> {
+ protected final Email editObject = new EmailImpl();
+
+ protected static Binder<DemandeUIModel, Email> toBeanBinder =
+ BinderFactory.newBinder(DemandeUIModel.class,
+ Email.class);
+
+ protected static Binder<Email, DemandeUIModel> fromBeanBinder =
+ BinderFactory.newBinder(Email.class, DemandeUIModel.class);
+
+ public DemandeUIModel() {
+ super(fromBeanBinder, toBeanBinder);
+ }
+
+ public void setSavNumber(String savNumber) {
+ Object oldValue = getSavNumber();
+ editObject.setSavNumber(savNumber);
+ firePropertyChanged(Email.PROPERTY_SAV_NUMBER, oldValue, savNumber);
+ }
+
+ public String getSavNumber() {
+ return editObject.getSavNumber();
+ }
+
+ public void setSenderEmailAddress(String senderEmailAddress) {
+ Object oldValue = getSenderEmailAddress();
+ editObject.setSenderEmailAddress(senderEmailAddress);
+ firePropertyChanged(Email.PROPERTY_SENDER_EMAIL_ADDRESS, oldValue, senderEmailAddress);
+ }
+
+ public String getSenderEmailAddress() {
+ return editObject.getSenderEmailAddress();
+ }
+
+ public void setSenderFaxNumber(String senderFaxNumber) {
+ Object oldValue = getSenderFaxNumber();
+ editObject.setSenderFaxNumber(senderFaxNumber);
+ firePropertyChanged(Email.PROPERTY_SENDER_FAX_NUMBER, oldValue, senderFaxNumber);
+ }
+
+ public String getSenderFaxNumber() {
+ return editObject.getSenderFaxNumber();
+ }
+
+ public void setReceptionEmailAddress(String receptionEmailAddress) {
+ Object oldValue = getReceptionEmailAddress();
+ editObject.setReceptionEmailAddress(receptionEmailAddress);
+ firePropertyChanged(Email.PROPERTY_RECEPTION_EMAIL_ADDRESS, oldValue, receptionEmailAddress);
+ }
+
+ public String getReceptionEmailAddress() {
+ return editObject.getReceptionEmailAddress();
+ }
+
+ public void setObject(String object) {
+ Object oldValue = getObject();
+ editObject.setObject(object);
+ firePropertyChanged(Email.PROPERTY_OBJECT, oldValue, object);
+ }
+
+ public String getObject() {
+ return editObject.getObject();
+ }
+
+ public void setClient(Client client) {
+ Object oldValue = getClient();
+ editObject.setClient(client);
+ firePropertyChanged(Email.PROPERTY_CLIENT, oldValue, client);
+ }
+
+ public Client getClient() {
+ return editObject.getClient();
+ }
+
+ public void setEtatAttente(EtatAttente etatAttente) {
+ Object oldValue = getEtatAttente();
+ editObject.setEtatAttente(etatAttente);
+ firePropertyChanged(Email.PROPERTY_ETAT_ATTENTE, oldValue, etatAttente);
+ }
+
+ public EtatAttente getEtatAttente() {
+ return editObject.getEtatAttente();
+ }
+
+ public void setFaxToMailUser(FaxToMailUser faxToMailUser) {
+ Object oldValue = getFaxToMailUser();
+ editObject.setFaxToMailUser(faxToMailUser);
+ firePropertyChanged(Email.PROPERTY_FAX_TO_MAIL_USER, oldValue, faxToMailUser);
+ }
+
+ public FaxToMailUser getFaxToMailUser() {
+ return editObject.getFaxToMailUser();
+ }
+
+ public Priority getPriority() {
+ return editObject.getPriority();
+ }
+
+ public void setPriority(Priority priority) {
+ Object oldValue = getPriority();
+ editObject.setPriority(priority);
+ firePropertyChanged(Email.PROPERTY_PRIORITY, oldValue, priority);
+ }
+
+ public DemandType getDemandType() {
+ return editObject.getDemandType();
+ }
+
+ public void setDemandType(DemandType demandType) {
+ Object oldValue = getDemandType();
+ editObject.setDemandType(demandType);
+ firePropertyChanged(Email.PROPERTY_DEMAND_TYPE, oldValue, demandType);
+ }
+
+ public DemandStatus getDemandStatus() {
+ return editObject.getDemandStatus();
+ }
+
+ public void setDemandStatus(DemandStatus demandStatus) {
+ Object oldValue = getDemandStatus();
+ editObject.setDemandStatus(demandStatus);
+ firePropertyChanged(Email.PROPERTY_DEMAND_STATUS, oldValue, demandStatus);
+ }
+
+ public void setReceptionDate(Date receptionDate) {
+ Object oldValue = getReceptionDate();
+ editObject.setReceptionDate(receptionDate);
+ firePropertyChanged(Email.PROPERTY_RECEPTION_DATE, oldValue, receptionDate);
+ }
+
+ public Date getReceptionDate() {
+ return editObject.getReceptionDate();
+ }
+
+ public void setEdiCodeNumber(String ediCodeNumber) {
+ Object oldValue = getEdiCodeNumber();
+ editObject.setEdiCodeNumber(ediCodeNumber);
+ firePropertyChanged(Email.PROPERTY_EDI_CODE_NUMBER, oldValue, ediCodeNumber);
+ }
+
+ public String getEdiCodeNumber() {
+ return editObject.getEdiCodeNumber();
+ }
+
+ public void setCommandNb(String commandNb) {
+ Object oldValue = getCommandNb();
+ editObject.setCommandNb(commandNb);
+ firePropertyChanged(Email.PROPERTY_COMMAND_NB, oldValue, commandNb);
+ }
+
+ public String getCommandNb() {
+ return editObject.getCommandNb();
+ }
+
+ public void setProjectReference(String projectReference) {
+ Object oldValue = getProjectReference();
+ editObject.setProjectReference(projectReference);
+ firePropertyChanged(Email.PROPERTY_PROJECT_REFERENCE, oldValue, projectReference);
+ }
+
+ public String getProjectReference() {
+ return editObject.getProjectReference();
+ }
+
+ @Override
+ protected Email newEntity() {
+ return new EmailImpl();
+ }
}
Added: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/FolderTreeNode.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/FolderTreeNode.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/FolderTreeNode.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -0,0 +1,26 @@
+package com.franciaflex.faxtomail.ui.swing.content.demande;
+
+import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+
+import javax.swing.tree.DefaultMutableTreeNode;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since x.x
+ */
+public class FolderTreeNode extends DefaultMutableTreeNode {
+
+ public FolderTreeNode(MailFolder folder) {
+ super(folder);
+ }
+
+ public MailFolder getMailFolder() {
+ return (MailFolder) userObject;
+ }
+
+ @Override
+ public String toString() {
+ MailFolder folder = (MailFolder) userObject;
+ return folder.getName();
+ }
+}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx 2014-02-12 17:16:05 UTC (rev 9)
@@ -5,8 +5,9 @@
com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI
com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil
- com.franciaflex.faxtomail.ui.swing.util.Label
+ com.franciaflex.faxtomail.persistence.entities.HasLabel
+
jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
org.jdesktop.swingx.JXDatePicker
@@ -34,7 +35,7 @@
<cell weightx='1'>
<BeanFilterableComboBox id='modifiedByComboBox'
constructorParams='this'
- genericType="Label"/>
+ genericType="HasLabel"/>
</cell>
<cell>
</cell>
@@ -107,7 +108,7 @@
<cell weightx='1'>
<BeanFilterableComboBox id='statusComboBox'
constructorParams='this'
- genericType="Label"/>
+ genericType="HasLabel"/>
</cell>
<cell>
</cell>
@@ -135,7 +136,7 @@
<cell weightx='1'>
<BeanFilterableComboBox id='docTypeComboBox'
constructorParams='this'
- genericType="Label"/>
+ genericType="HasLabel"/>
</cell>
<cell>
</cell>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -1,13 +1,12 @@
package com.franciaflex.faxtomail.ui.swing.util;
import com.franciaflex.faxtomail.FaxToMailConfiguration;
-import com.franciaflex.faxtomail.LabelAware;
+import com.franciaflex.faxtomail.persistence.entities.HasLabel;
import com.franciaflex.faxtomail.services.DecoratorService;
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
import com.franciaflex.faxtomail.ui.swing.content.MainUI;
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -18,6 +17,7 @@
import java.awt.Component;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
import java.util.List;
import java.util.Set;
@@ -81,8 +81,8 @@
Decorator decorator = decoratorService.getDecoratorByType(type, name);
if (decorator == null) {
- if (LabelAware.class.isAssignableFrom(type)) {
- decorator = getDecorator(LabelAware.class, null);
+ if (HasLabel.class.isAssignableFrom(type)) {
+ decorator = getDecorator(HasLabel.class, null);
}
}
Preconditions.checkNotNull(decorator);
@@ -188,10 +188,15 @@
ui.getHandler().onCloseUI();
}
- protected List<Label> createLabelList(String... labels) {
- List<Label> labelList = Lists.newArrayList();
- for (String label : labels) {
- labelList.add(new Label(label));
+ protected List<HasLabel> createLabelList(String... labels) {
+ List<HasLabel> labelList = new ArrayList<HasLabel>();
+ for (final String label : labels) {
+ labelList.add(new HasLabel() {
+ @Override
+ public String getLabel() {
+ return label;
+ }
+ });
}
return labelList;
}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/Label.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/Label.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/Label.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -1,21 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.util;
-
-import com.franciaflex.faxtomail.LabelAware;
-
-/**
- * @author kmorin <kmorin(a)codelutin.com>
- * @since x.x
- */
-public class Label implements LabelAware {
-
- String label;
-
- public Label(String label) {
- this.label = label;
- }
-
- @Override
- public String getLabel() {
- return label;
- }
-}
Modified: trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties
===================================================================
--- trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties 2014-02-12 17:16:05 UTC (rev 9)
@@ -66,18 +66,49 @@
faxtomail.demande.client.label=
faxtomail.demande.demandeNumber.label=
faxtomail.demande.docType.label=
+faxtomail.demande.ediCodeNumber.label=
+faxtomail.demande.etatAttente.label=
+faxtomail.demande.finishedProducts.label=
faxtomail.demande.gamme.label=
faxtomail.demande.message.label=
faxtomail.demande.object.label=
faxtomail.demande.print.button.label=
faxtomail.demande.priority.label=
+faxtomail.demande.projectReference.label=
faxtomail.demande.received.label=
+faxtomail.demande.receivedDate.label=
faxtomail.demande.ref.label=
+faxtomail.demande.savNumber.label=
faxtomail.demande.save.button.label=
+faxtomail.demande.sender.label=
faxtomail.demande.status.label=
faxtomail.demande.tcc.label=
faxtomail.demande.title=
faxtomail.demande.transmit.button.label=
+faxtomail.demandeList.action.attachment=
+faxtomail.demandeList.action.attachment.mnemonic=
+faxtomail.demandeList.action.attachment.tip=
+faxtomail.demandeList.action.print=
+faxtomail.demandeList.action.print.mnemonic=
+faxtomail.demandeList.action.print.tip=
+faxtomail.demandeList.action.reply=
+faxtomail.demandeList.action.reply.mnemonic=
+faxtomail.demandeList.action.reply.tip=
+faxtomail.demandeList.table.header.client=
+faxtomail.demandeList.table.header.commandNb=
+faxtomail.demandeList.table.header.ediCodeNumber=
+faxtomail.demandeList.table.header.folder=
+faxtomail.demandeList.table.header.object=
+faxtomail.demandeList.table.header.priority=
+faxtomail.demandeList.table.header.projectReference=
+faxtomail.demandeList.table.header.range=
+faxtomail.demandeList.table.header.receptionDate=
+faxtomail.demandeList.table.header.savNumber=
+faxtomail.demandeList.table.header.senderEmail=
+faxtomail.demandeList.table.header.status=
+faxtomail.demandeList.table.header.type=
+faxtomail.demandeList.table.header.user=
+faxtomail.demandeList.table.header.waitingState=
faxtomail.demandeList.title=
faxtomail.error.delete.startActionFile=
faxtomail.error.errorpane.htmlmessage=
Modified: trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties
===================================================================
--- trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-02-12 17:16:05 UTC (rev 9)
@@ -62,20 +62,48 @@
faxtomail.demande.archive.button.label=Archiver
faxtomail.demande.back.button.label=Retour
faxtomail.demande.client.label=Client
-faxtomail.demande.demandeNumber.label=N° Devis/Commande
+faxtomail.demande.demandeNumber.label=N° Devis/Cde
faxtomail.demande.docType.label=Type
+faxtomail.demande.ediCodeNumber.label=Retour EDI
+faxtomail.demande.etatAttente.label=État attente
+faxtomail.demande.finishedProducts.label=Produits finis
faxtomail.demande.gamme.label=Gamme
faxtomail.demande.message.label=Message
faxtomail.demande.object.label=Objet
faxtomail.demande.print.button.label=Imprimer
faxtomail.demande.priority.label=Priorité
-faxtomail.demande.received.label=Reçu le
-faxtomail.demande.ref.label=Rèf
+faxtomail.demande.projectReference.label=Référence travaux
+faxtomail.demande.receivedDate.label=Reçu le
+faxtomail.demande.savNumber.label=SAV
faxtomail.demande.save.button.label=Enregistrer
+faxtomail.demande.sender.label=Émetteur
faxtomail.demande.status.label=Statut
-faxtomail.demande.tcc.label=Tcc par
faxtomail.demande.title=Demande
faxtomail.demande.transmit.button.label=Transmettre
+faxtomail.demandeList.action.attachment=Ajouter une pièce-jointe
+faxtomail.demandeList.action.attachment.mnemonic=A
+faxtomail.demandeList.action.attachment.tip=Ajouter une pièce-jointe
+faxtomail.demandeList.action.print=Imprimer
+faxtomail.demandeList.action.print.mnemonic=I
+faxtomail.demandeList.action.print.tip=Imprimer
+faxtomail.demandeList.action.reply=Répondre
+faxtomail.demandeList.action.reply.mnemonic=R
+faxtomail.demandeList.action.reply.tip=Répondre
+faxtomail.demandeList.table.header.client=Client
+faxtomail.demandeList.table.header.commandNb=Numéro de commande
+faxtomail.demandeList.table.header.ediCodeNumber=Code EDI
+faxtomail.demandeList.table.header.folder=Dossier
+faxtomail.demandeList.table.header.object=Objet
+faxtomail.demandeList.table.header.priority=Priorité
+faxtomail.demandeList.table.header.projectReference=Référence travaux
+faxtomail.demandeList.table.header.range=Gamme
+faxtomail.demandeList.table.header.receptionDate=Date de réception
+faxtomail.demandeList.table.header.savNumber=Numéro SAV
+faxtomail.demandeList.table.header.senderEmail=Email de l'émetteur
+faxtomail.demandeList.table.header.status=Statut
+faxtomail.demandeList.table.header.type=Type
+faxtomail.demandeList.table.header.user=Pris pas
+faxtomail.demandeList.table.header.waitingState=État attente
faxtomail.demandeList.title=Gestion des fax
faxtomail.error.delete.startActionFile=
faxtomail.error.errorpane.htmlmessage=
@@ -129,17 +157,5 @@
swing.error.desktop.browse.not.supported=
swing.error.desktop.mail.not.supported=
swing.error.desktop.not.supported=
-tutti.action.create.error=
-tutti.db.deleteCache.error=
-tutti.editCruise.askCancelEditBeforeLeaving.cancelSaveCruise=
-tutti.editCruise.askSaveBeforeLeaving.saveCruise=
tutti.editCruise.title.create.cruise=
tutti.editCruise.title.edit.cruise=
-tutti.error.ui.business.error=
-tutti.help.mkDir.error=
-tutti.main.title.noSelectedCruise=
-tutti.main.title.noSelectedProgram=
-tutti.main.title.noSelectedProtocol=
-tutti.main.title.selectedCruise=
-tutti.main.title.selectedProgram=
-tutti.main.title.selectedProtocol=
Copied: trunk/faxtomail-ui-swing/src/main/resources/log4j.properties (from rev 7, trunk/faxtomail-ui-web/src/main/resources/log4j.properties)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/resources/log4j.properties (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/resources/log4j.properties 2014-02-12 17:16:05 UTC (rev 9)
@@ -0,0 +1,15 @@
+log4j.rootCategory=WARN, console
+
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d{yyyy/MM/dd hh:mm:ss} %5p (%F:%L) %M %m%n
+
+# global level
+log4j.logger.com.franciaflex.faxtomail=TRACE
+
+### persistence level
+# log4j.logger.org.nuiton.topia=TRACE
+# log4j.logger.com.franciaflex.faxtomail.persistence=TRACE
+
+### services level
+# log4j.logger.com.franciaflex.faxtomail.services=TRACE
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -150,11 +150,21 @@
public Map<String, String> getEmailFields() {
Map<String, String> result = new HashMap<>();
- result.put(Email.PROPERTY_EMAIL_ADDRESS, "Adresse email");
+ result.put(Email.PROPERTY_SENDER_EMAIL_ADDRESS, "Adresse email");
result.put(Email.PROPERTY_RECEPTION_DATE, "Date de réception");
result.put(Email.PROPERTY_EDI_CODE_NUMBER, "Code EDI");
result.put(Email.PROPERTY_COMMAND_NB, "Numéro de commande");
- result.put(Email.PROPERTY_PROJECT_REFERENCE, "Référence travaux");
+ result.put(Email.PROPERTY_OBJECT, "Objet");
+ result.put(Email.PROPERTY_PROJECT_REFERENCE, "Référence travaux");
+ result.put(Email.PROPERTY_PRIORITY, "Priorité");
+ result.put(Email.PROPERTY_SAV_NUMBER, "Numéro SAV");
+ result.put(Email.PROPERTY_RANGE, "Gamme");
+ result.put(Email.PROPERTY_MAIL_FOLDER, "Dossier");
+ result.put(Email.PROPERTY_CLIENT, "Client");
+ result.put(Email.PROPERTY_DEMAND_STATUS, "Statut");
+ result.put(Email.PROPERTY_DEMAND_TYPE, "Type");
+ result.put(Email.PROPERTY_FAX_TO_MAIL_USER, "Pris par");
+ result.put(Email.PROPERTY_ETAT_ATTENTE, "État attente");
return result;
}
1
0
11 Feb '14
Author: kmorin
Date: 2014-02-11 11:12:54 +0100 (Tue, 11 Feb 2014)
New Revision: 8
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/8
Log:
web admin part
Added:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entity/
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFilterService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/UserService.java
trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
Modified:
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/CompanyService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration.jsp
trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css
trunk/pom.xml
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java 2014-02-06 16:42:22 UTC (rev 7)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java 2014-02-11 10:12:54 UTC (rev 8)
@@ -29,6 +29,7 @@
import com.franciaflex.faxtomail.services.service.CompanyService;
import com.franciaflex.faxtomail.services.service.ConfigurationService;
import com.franciaflex.faxtomail.services.service.FaxToMailWebApplicationContext;
+import com.franciaflex.faxtomail.services.service.MailFilterService;
import com.franciaflex.faxtomail.services.service.MailFolderService;
import java.util.Date;
@@ -73,4 +74,7 @@
public MailFolderService getMailFolderService() {
return newService(MailFolderService.class);
}
+ public MailFilterService getMailFilterService() {
+ return newService(MailFilterService.class);
+ }
}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/CompanyService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/CompanyService.java 2014-02-06 16:42:22 UTC (rev 7)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/CompanyService.java 2014-02-11 10:12:54 UTC (rev 8)
@@ -3,13 +3,22 @@
import com.franciaflex.faxtomail.persistence.entities.Company;
import com.franciaflex.faxtomail.persistence.entities.CompanyTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.Configuration;
+import com.franciaflex.faxtomail.persistence.entities.MailFilter;
+import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+import com.google.common.base.Function;
import com.google.common.base.Preconditions;
+import com.google.common.collect.Collections2;
import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.persistence.TopiaEntities;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
+import java.util.Map;
/**
* @author kmorin <kmorin(a)codelutin.com>
@@ -21,7 +30,7 @@
public List<Company> getAllCompanies() {
CompanyTopiaDao dao = getPersistenceContext().getCompanyDao();
- List<Company> companies = Lists.newArrayList(dao.findAll());
+ List<Company> companies = new ArrayList<>(dao.findAll());
return companies;
}
@@ -31,14 +40,27 @@
return company;
}
- public Company saveCompany(Company company) {
+ public Company saveCompany(Company company, Collection<MailFolder> mailFolders, Map<MailFilter, String> mailFilters) {
Preconditions.checkNotNull(company);
+
ConfigurationService configurationService = getConfigurationService();
configurationService.saveConfiguration(company.getConfiguration());
MailFolderService mailFolderService = getMailFolderService();
- mailFolderService.saveMailFolders(company.getMailFolder());
+ mailFolders = mailFolderService.saveMailFolders(mailFolders);
+ company.setMailFolder(mailFolders);
+ if (mailFilters != null) {
+ Map<String, MailFolder> foldersById = Maps.uniqueIndex(mailFolders, TopiaEntities.getTopiaIdFunction());
+ for (MailFilter filter : mailFilters.keySet()) {
+ MailFolder folder = foldersById.get(mailFilters.get(filter));
+ filter.setMailFolder(folder);
+ }
+ }
+ MailFilterService mailFilterService = getMailFilterService();
+ Collection<MailFilter> filters = mailFilterService.saveMailFilters(mailFilters.keySet());
+ company.setMailFilter(filters);
+
CompanyTopiaDao dao = getPersistenceContext().getCompanyDao();
company = dao.update(company);
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-02-06 16:42:22 UTC (rev 7)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-02-11 10:12:54 UTC (rev 8)
@@ -28,6 +28,10 @@
import com.franciaflex.faxtomail.persistence.entities.Company;
import com.franciaflex.faxtomail.persistence.entities.CompanyTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.ConfigurationTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroupTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserTopiaDao;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -114,6 +118,29 @@
log.debug("sample data " + companyTopiaDao.count());
}
+ FaxToMailUserGroupTopiaDao userGroupDao = getPersistenceContext().getFaxToMailUserGroupDao();
+ count = userGroupDao.count();
+ if (count == 0) {
+ userGroupDao.create(FaxToMailUserGroup.PROPERTY_NAME, "Chargés de clientèle");
+ userGroupDao.create(FaxToMailUserGroup.PROPERTY_NAME, "Commerciaux");
+ userGroupDao.create(FaxToMailUserGroup.PROPERTY_NAME, "SAV");
+ userGroupDao.create(FaxToMailUserGroup.PROPERTY_NAME, "Administrateurs");
+
+ getPersistenceContext().commit();
+ }
+
+ FaxToMailUserTopiaDao userDao = getPersistenceContext().getFaxToMailUserDao();
+ count = userDao.count();
+ if (count == 0) {
+ userDao.create(FaxToMailUser.PROPERTY_NAME, "Marc Lefebvre", FaxToMailUser.PROPERTY_LOGIN, "mlefebvre");
+ userDao.create(FaxToMailUser.PROPERTY_NAME, "Cyril Baillet", FaxToMailUser.PROPERTY_LOGIN, "cbaillet");
+ userDao.create(FaxToMailUser.PROPERTY_NAME, "Frédéric Viala", FaxToMailUser.PROPERTY_LOGIN, "fviala");
+ userDao.create(FaxToMailUser.PROPERTY_NAME, "Claire Marquis", FaxToMailUser.PROPERTY_LOGIN, "cmarquis");
+ userDao.create(FaxToMailUser.PROPERTY_NAME, "Agathe Borde", FaxToMailUser.PROPERTY_LOGIN, "aborde");
+ userDao.create(FaxToMailUser.PROPERTY_NAME, "Jeanne Bourgoin", FaxToMailUser.PROPERTY_LOGIN, "jbourgoin");
+
+ getPersistenceContext().commit();
+ }
}
}
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFilterService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFilterService.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFilterService.java 2014-02-11 10:12:54 UTC (rev 8)
@@ -0,0 +1,41 @@
+package com.franciaflex.faxtomail.services.service;
+
+import com.franciaflex.faxtomail.persistence.entities.MailFilter;
+import com.franciaflex.faxtomail.persistence.entities.MailFilterTopiaDao;
+import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since x.x
+ */
+public class MailFilterService extends FaxToMailServiceSupport {
+
+ public Collection<MailFilter> saveMailFilters(Collection<MailFilter> mailFilters) {
+ MailFilterTopiaDao dao = getPersistenceContext().getMailFilterDao();
+
+ Collection<MailFilter> result = new ArrayList<>();
+ for (MailFilter mailFilter : mailFilters) {
+
+ MailFilter filter;
+ boolean create = mailFilter.getTopiaId() == null;
+ if (create) {
+ filter = dao.newInstance();
+ } else {
+ filter = dao.findByTopiaId(mailFilter.getTopiaId());
+ }
+ filter.setExpression(mailFilter.getExpression());
+ filter.setMailFolder(mailFilter.getMailFolder());
+
+ if (create) {
+ filter = dao.create(filter);
+ } else {
+ filter = dao.update(filter);
+ }
+ result.add(filter);
+ }
+ return result;
+ }
+}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java 2014-02-06 16:42:22 UTC (rev 7)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java 2014-02-11 10:12:54 UTC (rev 8)
@@ -8,7 +8,9 @@
import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.persistence.TopiaIdFactory;
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
/**
* @author kmorin <kmorin(a)codelutin.com>
@@ -18,6 +20,11 @@
private static final Log log = LogFactory.getLog(MailFolderService.class);
+ public List<MailFolder> getMailFolders(Collection<String> ids) {
+ MailFolderTopiaDao dao = getPersistenceContext().getMailFolderDao();
+ return new ArrayList<MailFolder>(dao.forTopiaIdIn(ids).findAll());
+ }
+
public Collection<MailFolder> saveMailFolders(Collection<MailFolder> mailFolders) {
if (mailFolders == null) {
return null;
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/UserService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/UserService.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/UserService.java 2014-02-11 10:12:54 UTC (rev 8)
@@ -0,0 +1,27 @@
+package com.franciaflex.faxtomail.services.service;
+
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroupTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserTopiaDao;
+import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since x.x
+ */
+public class UserService extends FaxToMailServiceSupport {
+
+ public List<FaxToMailUser> getAllUsers() {
+ FaxToMailUserTopiaDao dao = getPersistenceContext().getFaxToMailUserDao();
+ return new ArrayList<>(dao.findAll());
+ }
+
+ public List<FaxToMailUserGroup> getAllUserGroups() {
+ FaxToMailUserGroupTopiaDao dao = getPersistenceContext().getFaxToMailUserGroupDao();
+ return new ArrayList<>(dao.findAll());
+ }
+}
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java 2014-02-06 16:42:22 UTC (rev 7)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java 2014-02-11 10:12:54 UTC (rev 8)
@@ -24,7 +24,10 @@
protected static FaxToMailConfiguration applicationConfig;
public static FaxToMailConfiguration getApplicationConfig() {
- return FaxToMailConfiguration.getInstance();
+ if (applicationConfig == null) {
+ applicationConfig = new FaxToMailConfiguration("faxtomail.properties");
+ }
+ return applicationConfig;
}
public static FaxToMailTopiaApplicationContext getTopiaApplicationContext() {
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-02-06 16:42:22 UTC (rev 7)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-02-11 10:12:54 UTC (rev 8)
@@ -1,35 +1,44 @@
package com.franciaflex.faxtomail.web.action.admin;
import com.franciaflex.faxtomail.persistence.entities.Company;
-import com.franciaflex.faxtomail.persistence.entities.Configuration;
-import com.franciaflex.faxtomail.persistence.entities.ConfigurationImpl;
import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup;
+import com.franciaflex.faxtomail.persistence.entities.MailFilter;
+import com.franciaflex.faxtomail.persistence.entities.MailFilterAbstract;
+import com.franciaflex.faxtomail.persistence.entities.MailFilterImpl;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+import com.franciaflex.faxtomail.persistence.entities.MailFolderAbstract;
import com.franciaflex.faxtomail.persistence.entities.MailFolderImpl;
import com.franciaflex.faxtomail.services.service.CompanyService;
+import com.franciaflex.faxtomail.services.service.MailFolderService;
+import com.franciaflex.faxtomail.services.service.UserService;
import com.franciaflex.faxtomail.web.FaxToMailActionSupport;
+import com.google.common.base.Function;
+import com.google.common.collect.Collections2;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.gson.GsonBuilder;
-import com.google.gson.InstanceCreator;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
-import com.google.gson.TypeAdapter;
-import com.google.gson.stream.JsonReader;
-import com.google.gson.stream.JsonToken;
-import com.google.gson.stream.JsonWriter;
import com.opensymphony.xwork2.Preparable;
+import org.apache.commons.collections4.ComparatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.nuiton.topia.persistence.TopiaIdFactory;
-import org.nuiton.topia.persistence.internal.DefaultTopiaIdFactory;
+import org.nuiton.topia.persistence.TopiaEntities;
-import java.io.IOException;
import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -43,12 +52,24 @@
protected CompanyService companyService;
+ protected MailFolderService mailFolderService;
+
+ protected UserService userService;
+
protected List<Company> companies;
protected Company company;
protected List<MailFolder> mailFolders;
+ protected Map<String, String> mailFoldersFlat;
+
+ protected List<MailFilterUIBean> mailFilters;
+
+ protected List<FaxToMailUser> allUsers;
+
+ protected List<FaxToMailUserGroup> allUserGroups;
+
protected String activeTab;
@Override
@@ -63,12 +84,19 @@
@Override
public String execute() throws Exception {
- log.debug("execute " + company);
String result = super.execute();
+
if (!ERROR.equals(result)) {
if (company != null) {
- company.setMailFolder(mailFolders);
- companyService.saveCompany(company);
+ log.debug(company.getMailFilter());
+ Map<MailFilter, String> folderIdByFilter = new HashMap<>();
+ if (mailFilters != null) {
+ for (MailFilterUIBean filter : mailFilters) {
+ String folderId = filter.getMailFolderId();
+ folderIdByFilter.put(filter, folderId);
+ }
+ }
+ companyService.saveCompany(company, mailFolders, folderIdByFilter);
}
result = INPUT;
}
@@ -79,8 +107,15 @@
this.companyService = companyService;
}
+ public void setMailFolderService(MailFolderService mailFolderService) {
+ this.mailFolderService = mailFolderService;
+ }
+
+ public void setUserService(UserService userService) {
+ this.userService = userService;
+ }
+
public void setCompanyId(String companyId) {
- log.debug("set company " + companyId);
if (StringUtils.isNotEmpty(companyId)) {
this.company = companyService.getCompany(companyId);
}
@@ -98,7 +133,6 @@
}
public Company getCompany() {
- log.debug("getCompany " + company);
return company;
}
@@ -115,7 +149,7 @@
}
public Map<String, String> getEmailFields() {
- Map<String, String> result = Maps.newHashMap();
+ Map<String, String> result = new HashMap<>();
result.put(Email.PROPERTY_EMAIL_ADDRESS, "Adresse email");
result.put(Email.PROPERTY_RECEPTION_DATE, "Date de réception");
result.put(Email.PROPERTY_EDI_CODE_NUMBER, "Code EDI");
@@ -129,21 +163,81 @@
return null;
}
GsonBuilder gsonBuilder = new GsonBuilder();
- String mailFodlers = gsonBuilder.create().toJson(company.getMailFolder());
- log.debug("getFolderTreeAsJson " + mailFodlers);
- return mailFodlers;
+ String mailFolders = gsonBuilder.create().toJson(company.getMailFolder());
+ return mailFolders;
}
public void setFoldersTreeAsJson(String json) {
- log.debug("setFoldersTreeAsJson " + json);
GsonBuilder gsonBuilder = new GsonBuilder().registerTypeAdapter(MailFolder.class, new MailFolderDeserializer());
- mailFolders = Lists.newArrayList((MailFolder[])gsonBuilder.create().fromJson(json, MailFolder[].class));
- log.debug("mailfolders " + mailFolders);
- if (!mailFolders.isEmpty()) {
- log.debug("name : " + mailFolders.get(0).getName());
+ mailFolders = Arrays.asList((MailFolder[])gsonBuilder.create().fromJson(json, MailFolder[].class));
+ log.debug(mailFolders);
+ }
+
+ public Map<String, String> getAllFoldersFlat() {
+ if (mailFoldersFlat == null) {
+ mailFoldersFlat = new LinkedHashMap<>();
+ if (company.getMailFolder() != null) {
+ List<MailFolder> folders = new ArrayList<>(company.getMailFolder());
+ Collections.sort(folders, new Comparator<MailFolder>() {
+ @Override
+ public int compare(MailFolder o1, MailFolder o2) {
+ return ComparatorUtils.NATURAL_COMPARATOR.compare(o1.getName(), o2.getName());
+ }
+ });
+ for (MailFolder folder : folders) {
+ mailFoldersFlat.putAll(getAllFoldersFlat(folder, ""));
+ }
+ }
}
+ return mailFoldersFlat;
}
+ public List<MailFilterUIBean> getMailFilters() {
+ if (mailFilters == null) {
+ mailFilters = new ArrayList<>();
+ }
+ return mailFilters;
+ }
+
+ public void setMailFilters(List<MailFilterUIBean> mailFilters) {
+ this.mailFilters = mailFilters;
+ }
+
+ public List<FaxToMailUser> getAllUsers() {
+ if (allUsers == null) {
+ allUsers = userService.getAllUsers();
+ }
+ return allUsers;
+ }
+
+ public List<FaxToMailUserGroup> getAllUserGroups() {
+ if (allUserGroups == null) {
+ allUserGroups = userService.getAllUserGroups();
+ }
+ return allUserGroups;
+ }
+
+ protected Map<String, String> getAllFoldersFlat(MailFolder mailFolder, String prefix) {
+ Map<String, String> result = new LinkedHashMap<>();
+ prefix += "/" + mailFolder.getName();
+ result.put(mailFolder.getTopiaId(), prefix);
+ log.debug(prefix);
+
+ if (mailFolder.getChildren() != null) {
+ List<MailFolder> children = new ArrayList<>(mailFolder.getChildren());
+ Collections.sort(children, new Comparator<MailFolder>() {
+ @Override
+ public int compare(MailFolder o1, MailFolder o2) {
+ return ComparatorUtils.NATURAL_COMPARATOR.compare(o1.getName(), o2.getName());
+ }
+ });
+ for (MailFolder child : children) {
+ result.putAll(getAllFoldersFlat(child, prefix));
+ }
+ }
+ return result;
+ }
+
protected class MailFolderDeserializer implements JsonDeserializer<MailFolder> {
@Override
@@ -155,7 +249,7 @@
mailFolder.setName(name);
MailFolder[] children = context.deserialize(o.get(MailFolder.PROPERTY_CHILDREN), MailFolder[].class);
- List<MailFolder> mailFolders = Lists.newArrayList(children);
+ List<MailFolder> mailFolders = Arrays.asList(children);
mailFolder.setChildren(mailFolders);
String topiaId = o.get(MailFolder.PROPERTY_TOPIA_ID).getAsString();
@@ -164,4 +258,17 @@
return mailFolder;
}
}
+
+ public static class MailFilterUIBean extends MailFilterImpl {
+
+ protected String mailFolderId;
+
+ public String getMailFolderId() {
+ return mailFolderId;
+ }
+
+ public void setMailFolderId(String mailFolderId) {
+ this.mailFolderId = mailFolderId;
+ }
+ }
}
Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration.jsp 2014-02-06 16:42:22 UTC (rev 7)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration.jsp 2014-02-11 10:12:54 UTC (rev 8)
@@ -9,132 +9,24 @@
<script type="text/javascript" src="<s:url value='/js/select2/select2_locale_fr.js' />"></script>
<script type="text/javascript" src="<s:url value='/js/jstree/jstree.js' />"></script>
- <link rel="stylesheet" type="text/css" href="<s:url value='/css/select2/select2.css' />" />
- <link rel="stylesheet" type="text/css" href="<s:url value='/css/jstree/themes/default/style.min.css' />" />
- <link rel="stylesheet" type="text/css" href="<s:url value='/css/configuration.css' />" />
<script>
-
- var createNewNode = function() {
- $('.jstree').jstree(true).create_node('#', 'Nouvelle racine');
- }
-
- var formatToSendData = function(mailFolders) {
- var result = [];
- for (var i = 0 ; i < mailFolders.length ; i++) {
- var mailFolder = mailFolders[i];
- var children = formatToSendData(mailFolder.children);
- result.push({ name: mailFolder.text, children: children, topiaId: mailFolder.id });
- }
- return result;
- }
-
- var formatReceivedData = function(mailFolders) {
- var result = [];
- for (var i = 0 ; i < mailFolders.length ; i++) {
- var mailFolder = mailFolders[i];
- var children = formatReceivedData(mailFolder.children);
- result.push({ text: mailFolder.name, children: children, id: mailFolder.topiaId });
- }
- return result;
- }
-
var emailFields = {};
<s:iterator value="emailFields">
- emailFields["<s:property value='key'/>"] = "<s:property value='value'/>";
+ emailFields["<s:property value='key'/>"] = "<s:property value='value' escapeHtml='false'/>";
</s:iterator>
- var updateTableSnapshot = function() {
- var tableHeader = $("#table-snapshot thead tr");
- tableHeader.empty();
- var value = $("#tableColumns").val();
- if (value) {
- var columns = value.split(",");
- for (var i = 0 ; i < columns.length ; i++) {
- tableHeader.append("<th>" + emailFields[columns[i]] + "</th>");
- }
- }
- }
+ var folderData = JSON.parse('<s:property value="foldersTreeAsJson" escapeHtml="false"/>');
+ </script>
+ <script type="text/javascript" src="<s:url value='/js/configuration.js' />"></script>
- $().ready(function() {
+ <link rel="stylesheet" type="text/css" href="<s:url value='/css/select2/select2.css' />" />
+ <link rel="stylesheet" type="text/css" href="<s:url value='/css/jstree/themes/default/style.min.css' />" />
+ <link rel="stylesheet" type="text/css" href="<s:url value='/css/configuration.css' />" />
- $('a[data-toggle="tab"]').on('shown', function (e) {
- var hash = e.target.hash;
- $(":input[name='activeTab']").val(hash);
-
- /*if (hash == "#tabs-3") {
- $('#treeDiagram').jstree(true).refresh();
-
- } else if (hash == "#tabs-4") {
- $('#treeDiagram2choose').jstree(true).refresh();
- }*/
- });
-
- var hash = $(":input[name='activeTab']").val();
- if (!hash) {
- hash = "#tabs-1";
- }
- $('#tabs a[href="' + hash + '"]').tab('show');
-
- // table columns
-
- $('#tableColumns').select2({tags:[
- <s:iterator value="emailFields">
- { id: "<s:property value='key'/>", text: "<s:property value='value' escapeHtml='false'/>" },
- </s:iterator>
- ]}).on("change", function(e) {
- console.log(e.val)
- updateTableSnapshot();
- });
-
- $("#tableColumns").select2("container").find("ul.select2-choices").sortable({
- containment: 'parent',
- start: function() { $("#tableColumns").select2("onSortStart"); },
- update: function() { $("#tableColumns").select2("onSortEnd"); }
- });
-
- updateTableSnapshot();
-
- // tree diagram
-
- var folderData = JSON.parse('<s:property value="foldersTreeAsJson" escapeHtml="false"/>');
- folderData = formatReceivedData(folderData);
-
- $.jstree.defaults.core.themes.variant = "large";
- // so that create works
- $.jstree.defaults.core.check_callback = true;
- $.jstree.defaults.core.multiple = false;
-
- $('#treeDiagram').jstree({
- core: {
- data: folderData
- },
- state: { key: "faxtomail-treeDiagram" },
- plugins: [ "contextmenu", "sort", "state", "unique", "dnd" ]
- });
-
- $('#treeDiagram2choose').jstree({
- core: {
- data: folderData
- },
- state: { key: "faxtomail-treeDiagram2choose" },
- plugins: [ "sort", "state" ]
- });
-
- $("#main_form").submit(function(event) {
- var mailFolders = $('#treeDiagram').jstree(true).get_json('#', {});
- var foldersAsJson = formatToSendData(mailFolders);
- console.log(foldersAsJson);
-
- var input = $("<input>")
- .attr("type", "hidden")
- .attr("name", "foldersTreeAsJson").val(JSON.stringify(foldersAsJson));
- $('#main_form').append($(input));
- });
- });
- </script>
</head>
<body>
+ <!-- navbar -->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
@@ -174,15 +66,17 @@
<s:hidden name="activeTab"/>
<ul id="tabs" class="nav nav-tabs">
- <li><a href="#tabs-1" data-toggle="tab">Général</a></li>
- <li><a href="#tabs-2" data-toggle="tab">Champs du tableau</a></li>
- <li><a href="#tabs-3" data-toggle="tab">Arborescence</a></li>
- <li><a href="#tabs-4" data-toggle="tab">Filtres de mail</a></li>
+ <li><a href="#tabs-general" data-toggle="tab">Général</a></li>
+ <li><a href="#tabs-table" data-toggle="tab">Champs du tableau</a></li>
+ <li><a href="#tabs-tree" data-toggle="tab">Arborescence</a></li>
+ <li><a href="#tabs-filters" data-toggle="tab">Filtres de mail</a></li>
+ <li><a href="#tabs-rights" data-toggle="tab">Droits</a></li>
+ <li><a href="#tabs-email-accounts" data-toggle="tab">Comptes mails</a></li>
</ul>
<div class="tab-content">
- <div id="tabs-1" class="tab-pane">
+ <div id="tabs-general" class="tab-pane">
<!-- Général -->
<s:checkbox name="company.configuration.sendAknowledgement"
@@ -201,7 +95,7 @@
</div>
- <div id="tabs-2" class="tab-pane">
+ <div id="tabs-table" class="tab-pane">
<!-- Champs du tableau -->
<div class="control-group ">
@@ -225,7 +119,7 @@
</div>
- <div id="tabs-3" class="tab-pane">
+ <div id="tabs-tree" class="tab-pane">
<!-- Tree Diagram -->
<div id="treeDiagram" class="jstree margin-bottom25">
@@ -237,7 +131,7 @@
</div>
- <div id="tabs-4" class="tab-pane">
+ <div id="tabs-filters" class="tab-pane">
<!-- Filtres de mail -->
<table id="filters" class="table table-bordered">
<thead>
@@ -246,16 +140,197 @@
<th>Dossier</th>
</tr>
</thead>
+ <tbody>
+ <s:iterator value="company.mailFilter" status="rowStatus" var="filter">
+ <tr>
+ <td>
+ <s:property value='expression'/>
+ <s:hidden name="mailFilters[%{#rowStatus.index}].expression"
+ value="%{#filter.expression}"/>
+ </td>
+ <td>
+ <s:property value='allFoldersFlat.get(mailFolder.topiaId)'/>
+ <s:hidden name="mailFilters[%{#rowStatus.index}].mailFolderId"
+ value="%{#filter.mailFolder.topiaId}"/>
+ </td>
+ <s:hidden name="mailFilters[%{#rowStatus.index}].topiaId"
+ value="%{#filter.topiaId}"/>
+ </tr>
+ </s:iterator>
+ </tbody>
</table>
- <s:textfield name="newFilterExpression"
- label="Nouveau filtre"/>
+ <fieldset class="margin-bottom25">
+ <legend>Nouveau filtre</legend>
- <div id="treeDiagram2choose" class="jstree">
- </div>
+ <div id="newFilterExpression-group" class="control-group">
+ <label for="newFilterExpression">Expression</label>
+ <div class="controls">
+ <input type="text"
+ id="newFilterExpression"
+ class="input-xxlarge"
+ <s:if test="allFoldersFlat.isEmpty()">disabled</s:if>/>
+ <span id="newFilterExpression-help" class="help-inline"></span>
+ </div>
+ </div>
+ <div id="newFilterFolder-group" class="control-group">
+ <label for="newFilterFolder">Dossier de destination</label>
+ <div class="controls">
+ <select id="newFilterFolder"
+ class="input-xxlarge"
+ <s:if test="allFoldersFlat.isEmpty()">disabled</s:if>>
+ <s:iterator value="allFoldersFlat">
+ <option value="<s:property value='key'/>"><s:property value='value'/></option>
+ </s:iterator>
+ </select>
+ <span id="newFilterFolder-help" class="help-inline"></span>
+ </div>
+ </div>
+
+ <div>
+ <button class="btn" type="button" onClick="createNewFilter()" <s:if test="allFoldersFlat.isEmpty()">disabled</s:if>>
+ <i class="icon-plus"></i> Ajouter
+ </button>
+ </div>
+
+ </fieldset>
</div>
+ <div id="tabs-rights" class="tab-pane">
+ <!-- Droits d'accès -->
+ <table id="rights" class="table table-bordered">
+ <thead>
+ <tr>
+ <th>Utilisateur ou groupe</th>
+ <th>Dossier</th>
+ <th>Type</th>
+ </tr>
+ </thead>
+ <tbody></tbody>
+ </table>
+
+ <fieldset class="margin-bottom25">
+
+ <legend>Nouveau droit</legend>
+
+ <div id="newRightUser-group" class="control-group">
+ <label for="newRightUser">Utilisateur ou groupe</label>
+ <div class="controls">
+ <select id="newRightUser"
+ class="input-xxlarge"
+ <s:if test="allUsers.isEmpty() && allUserGroups.isEmpty()">disabled</s:if>>
+ <optgroup label="Utilisateurs">
+ <s:iterator value="allUsers">
+ <option value="<s:property value='topiaId'/>"><s:property value='name'/></option>
+ </s:iterator>
+ </optgroup>
+ <optgroup label="Groupes">
+ <s:iterator value="allUserGroups">
+ <option value="<s:property value='topiaId'/>"><s:property value='name'/></option>
+ </s:iterator>
+ </optgroup>
+ </select>
+ <span id="newRightUser-help" class="help-inline"></span>
+ </div>
+ </div>
+
+ <div id="newRightFolder-group" class="control-group">
+ <label for="newRightFolder">Dossier de destination</label>
+ <div class="controls">
+ <select id="newRightFolder"
+ class="input-xxlarge"
+ <s:if test="allFoldersFlat.isEmpty()">disabled</s:if>>
+ <s:iterator value="allFoldersFlat">
+ <option value="<s:property value='key'/>"><s:property value='value'/></option>
+ </s:iterator>
+ </select>
+ <span id="newRightFolder-help" class="help-inline"></span>
+ </div>
+ </div>
+
+ <div id="newRightTypes-group" class="control-group">
+ <label>Types</label>
+ <div class="controls">
+ <label class="checkbox inline">
+ <input type="checkbox" id="newRightType-read" value="READ"/> lecture
+ </label>
+ <label class="checkbox inline">
+ <input type="checkbox" id="newRightType-write" value="WRITE"/> écriture
+ </label>
+ <label class="checkbox inline">
+ <input type="checkbox" id="newRightType-archive" value="ARCHIVE"/> archives
+ </label>
+ <span id="newRightType-help" class="help-inline"></span>
+ </div>
+ </div>
+
+ <div>
+ <button class="btn" type="button" onClick="createNewRight()" <s:if test="allFoldersFlat.isEmpty()">disabled</s:if>>
+ <i class="icon-plus"></i> Ajouter
+ </button>
+ </div>
+
+ </fieldset>
+
+ </div>
+
+ <div id="tabs-email-accounts" class="tab-pane">
+ <!-- Comptes email -->
+ <table id="emailAccounts" class="table table-bordered">
+ <thead>
+ <tr>
+ <th>Nom d'utilisateur</th>
+ <th>Serveur</th>
+ <th>Port</th>
+ </tr>
+ </thead>
+ <tbody></tbody>
+ </table>
+
+ <fieldset class="margin-bottom25">
+ <legend>Nouveau compte mail</legend>
+
+ <div id="newEmailAccountUsername-group" class="control-group">
+ <label for="newEmailAccountUsername">Nom d'utilisateur</label>
+ <div class="controls">
+ <input type="text"
+ id="newEmailAccountUsername"
+ class="input-xxlarge"/>
+ <span id="newEmailAccountUsername-help" class="help-inline"></span>
+ </div>
+ </div>
+
+ <div id="newEmailAccountServer-group" class="control-group">
+ <label for="newEmailAccountServer">Serveur</label>
+ <div class="controls">
+ <input type="text"
+ id="newEmailAccountServer"
+ class="input-xxlarge"/>
+ <span id="newEmailAccountServer-help" class="help-inline"></span>
+ </div>
+ </div>
+
+ <div id="newEmailAccountPort-group" class="control-group">
+ <label for="newEmailAccountPort">Port</label>
+ <div class="controls">
+ <input type="number"
+ id="newEmailAccountPort"
+ class="input-xxlarge"/>
+ <span id="newEmailAccountPort-help" class="help-inline"></span>
+ </div>
+ </div>
+
+ <div>
+ <button class="btn" type="button" onClick="createNewEmailAccount()">
+ <i class="icon-plus"></i> Ajouter
+ </button>
+ </div>
+
+ </fieldset>
+
+ </div>
+
</div>
<div class="form-actions">
@@ -264,7 +339,6 @@
</s:form>
</s:if>
-
</div>
</body>
</html>
Modified: trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css 2014-02-06 16:42:22 UTC (rev 7)
+++ trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css 2014-02-11 10:12:54 UTC (rev 8)
@@ -21,4 +21,5 @@
}
#treeDiagram {
+ background: #f0f0f0;
}
\ No newline at end of file
Added: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-02-11 10:12:54 UTC (rev 8)
@@ -0,0 +1,238 @@
+/**
+ * adds a new folder in the tree
+ */
+var createNewNode = function() {
+ $('.jstree').jstree(true).create_node('#', 'Nouvelle racine');
+}
+
+/**
+ * adds a new filter in the table
+ */
+var createNewFilter = function() {
+ var filterExpression = $("#newFilterExpression").val();
+ if (!filterExpression) {
+ $("#newFilterExpression-group").addClass("error");
+ $("#newFilterExpression-group .help-inline").text("Veuillez entrer une valeur");
+ return;
+ }
+ $("#newFilterExpression-group").removeClass("error");
+ $("#newFilterExpression-group .help-inline").text("");
+
+ var filterFolderId = $("#newFilterFolder :selected").val();
+ var filterFolder = $("#newFilterFolder :selected").text();
+ if (!filterFolder) {
+ $("#newFilterFolder-group").addClass("error");
+ $("#newFilterFolder-group .help-inline").text("Veuillez sélectionner un dossier");
+ return;
+ }
+ $("#newFilterFolder-group").removeClass("error");
+ $("#newFilterFolder-group .help-inline").text("");
+
+ var index = $("#filters tbody tr").length;
+ var row = "<tr>" +
+ "<td>" +
+ filterExpression +
+ "<input type='hidden' name='mailFilters[" + index + "].expression' value='" + filterExpression + "'/>" +
+ "</td>" +
+ "<td>" +
+ filterFolder +
+ "<input type='hidden' name='mailFilters[" + index + "].mailFolderId' value='" + filterFolderId + "'/>" +
+ "</td>" +
+ "</tr>";
+ $("#filters tbody").append(row);
+}
+
+/**
+ * adds a new right in the table
+ */
+var createNewRight = function() {
+ var rightUserId = $("#newRightUser :selected").val();
+ var rightUser = $("#newRightUser :selected").text();
+ if (!rightUser) {
+ $("#newRightUser-group").addClass("error");
+ $("#newRightUser-group .help-inline").text("Veuillez sélectionner au moins un utilisateur");
+ return;
+ }
+ $("#newRightUser-group").removeClass("error");
+ $("#newRightUser-group .help-inline").text("");
+
+ var rightFolderId = $("#newRightFolder :selected").val();
+ var rightFolder = $("#newRightFolder :selected").text();
+ if (!rightFolder) {
+ $("#newRightFolder-group").addClass("error");
+ $("#newRightFolder-group .help-inline").text("Veuillez sélectionner un dossier");
+ return;
+ }
+ $("#newRightFolder-group").removeClass("error");
+ $("#newRightFolder-group .help-inline").text("");
+
+ var rightTypeIds = new Array();
+ var rightTypes = new Array();
+ var checkedTypes = $("#newRightTypes-group :checked");
+ if (checkedTypes.length == 0) {
+ $("#newRightTypes-group").removeClass("error");
+ $("#newRightTypes-group .help-inline").text("");
+ return;
+ }
+ $("#newRightTypes-group").addClass("error");
+ $("#newRightTypes-group .help-inline").text("Veuillez choisir au moins un type");
+ checkedTypes.each(function() {
+ rightTypeIds.push($(this).val());
+ rightTypes.push($(this).parent().text().trim());
+ });
+
+ var index = $("#rights tbody tr").length;
+ var row = "<tr>" +
+ "<td>" +
+ rightUser +
+ "<input type='hidden' name='rights[" + index + "].userId' value='" + rightUserId + "'/>" +
+ "</td>" +
+ "<td>" +
+ rightFolder +
+ "<input type='hidden' name='rights[" + index + "].mailFolderId' value='" + rightFolderId + "'/>" +
+ "</td>" +
+ "<td>" +
+ rightTypes.join(", ") +
+ "<input type='hidden' name='rights[" + index + "].types' value='" + rightTypeIds.join(",") + "'/>" +
+ "</td>" +
+ "</tr>";
+ $("#rights tbody").append(row);
+}
+
+var createNewEmailAccount = function() {
+ var emailAccountUsername = $("#newEmailAccountUsername").val();
+ if (!emailAccountUsername) {
+ $("#newEmailAccountUsername-group").addClass("error");
+ $("#newEmailAccountUsername-group .help-inline").text("Veuillez entrer une valeur");
+ return;
+ }
+ $("#newEmailAccountUsername-group").removeClass("error");
+ $("#newEmailAccountUsername-group .help-inline").text("");
+
+ var emailAccountServer = $("#newEmailAccountServer").val();
+ if (!emailAccountServer) {
+ $("#newEmailAccountServer-group").addClass("error");
+ $("#newEmailAccountServer-group .help-inline").text("Veuillez entrer une valeur");
+ return;
+ }
+ $("#newEmailAccountServer-group").removeClass("error");
+ $("#newEmailAccountServer-group .help-inline").text("");
+
+ var emailAccountPort = $("#newEmailAccountPort").val();
+ if (!emailAccountPort) {
+ $("#newEmailAccountPort-group").addClass("error");
+ $("#newEmailAccountPort-group .help-inline").text("Veuillez entrer une valeur");
+ return;
+ }
+ $("#newEmailAccountPort-group").removeClass("error");
+ $("#newEmailAccountPort-group .help-inline").text("");
+
+ var index = $("#emailAccounts tbody tr").length;
+ var row = "<tr>" +
+ "<td>" +
+ emailAccountUsername +
+ "<input type='hidden' name='emailAccounts[" + index + "].username' value='" + emailAccountUsername + "'/>" +
+ "</td>" +
+ "<td>" +
+ emailAccountServer +
+ "<input type='hidden' name='emailAccounts[" + index + "].server' value='" + emailAccountServer + "'/>" +
+ "</td>" +
+ "<td>" +
+ emailAccountPort +
+ "<input type='hidden' name='emailAccounts[" + index + "].port' value='" + emailAccountPort + "'/>" +
+ "</td>" +
+ "</tr>";
+ $("#emailAccounts tbody").append(row);
+ console.log("debig")
+}
+
+var formatToSendData = function(mailFolders) {
+ var result = [];
+ for (var i = 0 ; i < mailFolders.length ; i++) {
+ var mailFolder = mailFolders[i];
+ var children = formatToSendData(mailFolder.children);
+ result.push({ name: mailFolder.text, children: children, topiaId: mailFolder.id });
+ }
+ return result;
+}
+
+var formatReceivedData = function(mailFolders) {
+ var result = [];
+ for (var i = 0 ; i < mailFolders.length ; i++) {
+ var mailFolder = mailFolders[i];
+ var children = formatReceivedData(mailFolder.children);
+ result.push({ text: mailFolder.name, children: children, id: mailFolder.topiaId });
+ }
+ return result;
+}
+
+var updateTableSnapshot = function() {
+ var tableHeader = $("#table-snapshot thead tr");
+ tableHeader.empty();
+ var value = $("#tableColumns").val();
+ if (value) {
+ var columns = value.split(",");
+ for (var i = 0 ; i < columns.length ; i++) {
+ tableHeader.append("<th>" + emailFields[columns[i]] + "</th>");
+ }
+ }
+}
+
+$().ready(function() {
+
+ $('a[data-toggle="tab"]').on('shown', function (e) {
+ var hash = e.target.hash;
+ $(":input[name='activeTab']").val(hash);
+ });
+
+ var hash = $(":input[name='activeTab']").val();
+ if (!hash) {
+ hash = "#tabs-general";
+ }
+ $('#tabs a[href="' + hash + '"]').tab('show');
+
+ // table columns
+
+ var tableColumnTags = new Array();
+ for (var k in emailFields) {
+ tableColumnTags.push({ id: k, text: emailFields[k] })
+ }
+ $('#tableColumns').select2({tags:tableColumnTags}).on("change", function(e) {
+ updateTableSnapshot();
+ });
+
+ $("#tableColumns").select2("container").find("ul.select2-choices").sortable({
+ containment: 'parent',
+ start: function() { $("#tableColumns").select2("onSortStart"); },
+ update: function() { $("#tableColumns").select2("onSortEnd"); }
+ });
+
+ updateTableSnapshot();
+
+ // tree diagram
+ folderData = formatReceivedData(folderData);
+
+ $('#treeDiagram').jstree({
+ core: {
+ data: folderData,
+ check_callback: true,
+ multiple: false,
+ themes: {
+ variant: "large"
+ }
+ },
+ state: { key: "faxtomail-treeDiagram" },
+ plugins: [ "contextmenu", "sort", "state", "unique", "dnd" ]
+ });
+
+ $("#main_form").submit(function(event) {
+ var mailFolders = $('#treeDiagram').jstree(true).get_json('#', {});
+ var foldersAsJson = formatToSendData(mailFolders);
+ console.log(foldersAsJson);
+
+ var input = $("<input>")
+ .attr("type", "hidden")
+ .attr("name", "foldersTreeAsJson").val(JSON.stringify(foldersAsJson));
+ $('#main_form').append($(input));
+ });
+});
\ No newline at end of file
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-02-06 16:42:22 UTC (rev 7)
+++ trunk/pom.xml 2014-02-11 10:12:54 UTC (rev 8)
@@ -113,6 +113,9 @@
<license.organizationName>Franciaflex</license.organizationName>
<license.licenseName>gpl_v3</license.licenseName>
+ <!-- Java version -->
+ <maven.compiler.source>1.7</maven.compiler.source>
+ <maven.compiler.target>1.7</maven.compiler.target>
<!-- Last JRE version to use -->
<jreVersion>1.7.45</jreVersion>
@@ -451,6 +454,8 @@
</dependencyManagement>
<build>
+
+
<pluginManagement>
<plugins>
1
0
06 Feb '14
Author: kmorin
Date: 2014-02-06 17:42:22 +0100 (Thu, 06 Feb 2014)
New Revision: 7
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/7
Log:
use jaxx application api
Added:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationProvider.java
trunk/faxtomail-persistence/src/main/resources/META-INF/
trunk/faxtomail-persistence/src/main/resources/META-INF/services/
trunk/faxtomail-persistence/src/main/resources/META-INF/services/org.nuiton.config.ApplicationConfigProvider
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailActionFactory.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractChangeScreenAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractMainUIFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/CloseApplicationAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GoToPreviousScreenAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ReloadFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowConfigAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeListAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowRechercheAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/StartAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailBeanUIModel.java
Removed:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfig.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfigOption.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailBusinessException.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailIOUtil.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailTechnicalException.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/PropagatePropertyChangeListener.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DefaultFaxToMailServiceContext.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/
trunk/faxtomail-service/src/main/resources/META-INF/services/
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionException.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionHelper.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionSwingWorker.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailUIAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractChangeScreenAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractMainUIFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/CloseApplicationAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/GoToPreviousScreenAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ReloadFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowConfigAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowDemandeAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowDemandeListAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowRechercheAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailErrorHelper.java
trunk/faxtomail-ui-swing/src/main/resources/META-INF/services/
Modified:
trunk/faxtomail-persistence/pom.xml
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/ProgressionModel.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java
trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_en_GB.properties
trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_FR.properties
trunk/faxtomail-service/pom.xml
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java
trunk/faxtomail-ui-swing/pom.xml
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailExceptionHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUI.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/Label.java
trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties
trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties
trunk/faxtomail-ui-web/pom.xml
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/DefaultFaxToMailWebApplicationContext.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailActionSupport.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java
Modified: trunk/faxtomail-persistence/pom.xml
===================================================================
--- trunk/faxtomail-persistence/pom.xml 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/pom.xml 2014-02-06 16:42:22 UTC (rev 7)
@@ -49,6 +49,11 @@
</dependency>
<dependency>
+ <groupId>org.nuiton.jaxx</groupId>
+ <artifactId>jaxx-application-api</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.nuiton.i18n</groupId>
<artifactId>nuiton-i18n</artifactId>
</dependency>
Deleted: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfig.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfig.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfig.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,124 +0,0 @@
-package com.franciaflex.faxtomail;
-
-/*
- * #%L
- * Extranet ENC-AHI :: Persistence
- * $Id: ExtranetEncAhiApplicationConfig.java 866 2013-12-13 10:34:05Z bleny $
- * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-persiste… $
- * %%
- * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.config.ApplicationConfig;
-import org.nuiton.config.ArgumentsParserException;
-
-import java.io.File;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-public class FaxToMailApplicationConfig {
-
- private static final Log log = LogFactory.getLog(FaxToMailApplicationConfig.class);
-
- protected ApplicationConfig applicationConfig;
-
- public FaxToMailApplicationConfig() {
- applicationConfig = new ApplicationConfig();
- applicationConfig.loadDefaultOptions(FaxToMailApplicationConfigOption.values());
- applicationConfig.setConfigFileName("faxtomail.properties");
- try {
- applicationConfig.parse();
- } catch (ArgumentsParserException e) {
- throw new FaxToMailTechnicalException(e);
- }
- if (log.isInfoEnabled()) {
- StringBuilder builder = new StringBuilder();
- List<FaxToMailApplicationConfigOption> options =
- Lists.newArrayList(FaxToMailApplicationConfigOption.values());
- for (FaxToMailApplicationConfigOption option : options) {
- String key = option.getKey();
- Object value = applicationConfig.getOption(option);
- builder.append(String.format("\n%1$-40s = %2$s",
- key,
- value));
- }
- log.info("faxtomail: " + builder.toString());
- }
- }
-
- public boolean isDevMode() {
- boolean isDevMode = applicationConfig.getOptionAsBoolean(FaxToMailApplicationConfigOption.DEV_MODE.key);
- return isDevMode;
- }
-
- public Map<String, String> getTopiaProperties() {
- Map<String, String> jpaParameters = Maps.newHashMap();
- Properties hibernateProperties = applicationConfig.getOptionStartsWith("hibernate");
- jpaParameters.putAll((Map) hibernateProperties);
- return jpaParameters;
- }
-
- /**
- * @return Le nom d'hôte du serveur SMTP.
- */
- public String getSmtpHost() {
- return applicationConfig.getOption(FaxToMailApplicationConfigOption.SMTP_HOST.key);
- }
-
- /**
- * @return Le port du serveur SMTP.
- */
- public int getSmtpPort() {
- return applicationConfig.getOptionAsInt(FaxToMailApplicationConfigOption.SMTP_PORT.key);
- }
-
- /**
- * @return L'adresse d'expéditeur pour les mails de notifications
- */
- public String getSmtpFrom() {
- return applicationConfig.getOption(FaxToMailApplicationConfigOption.SMTP_FROM.key);
- }
-
- public String getInstanceUrl() {
- return applicationConfig.getOption(FaxToMailApplicationConfigOption.INSTANCE_URL.key);
- }
-
- public String getInstanceDisclaimer() {
- return applicationConfig.getOption(FaxToMailApplicationConfigOption.INSTANCE_DISCLAIMER.key);
- }
-
- public File getStorageFile() {
- return applicationConfig.getOptionAsFile(FaxToMailApplicationConfigOption.STORAGE_FILE.key);
- }
-
- public boolean isLogConfigurationProvided() {
- boolean logConfigurationProvided =
- StringUtils.isNotBlank(applicationConfig.getOption(FaxToMailApplicationConfigOption.LOG_CONFIGURATION_FILE.key));
- return logConfigurationProvided;
- }
-
- public File getLogConfigurationFile() {
- return applicationConfig.getOptionAsFile(FaxToMailApplicationConfigOption.LOG_CONFIGURATION_FILE.key);
- }
-}
Deleted: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfigOption.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfigOption.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfigOption.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,142 +0,0 @@
-package com.franciaflex.faxtomail;
-
-/*
- * #%L
- * Extranet ENC-AHI :: Persistence
- * $Id: ExtranetEncAhiApplicationConfigOption.java 869 2013-12-13 13:09:12Z bleny $
- * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-persiste… $
- * %%
- * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import org.nuiton.config.ConfigOptionDef;
-
-import java.io.File;
-
-public enum FaxToMailApplicationConfigOption implements ConfigOptionDef {
-
- INSTANCE_URL(
- "faxtomail.instanceUrl",
- "URL à laquelle on peut accéder à l'instance de faxToMail",
- "http://localhost:8080/faxtomail", String.class),
-
- INSTANCE_DISCLAIMER(
- "faxtomail.instanceDisclaimer",
- "Avertissement à afficher aux utilisateurs si l'instance est instable",
- null, String.class),
-
- SMTP_HOST(
- "smtp.host",
- "Nom d'hôte du serveur SMTP",
- "", String.class),
-
- SMTP_PORT(
- "smtp.port",
- "Le port du serveur SMTP",
- "25", Integer.class),
-
- SMTP_FROM(
- "smtp.from",
- "L'adresse d'expéditeur pour les mails de notifications",
- "", String.class),
-
- DEV_MODE(
- "faxtomail.devMode",
- "Mode développement, court-circuite l'envoi de mail",
- "true", Boolean.class),
-
-// CREATE_TRAINING_USERS(
-// "extranetEncAhi.createTrainingUsers",
-// "Vrai s'il faut créer les comptes de formation au démarrage de l'application",
-// "true", Boolean.class),
-
- STORAGE_FILE(
- "faxtomail.storage",
- "L'emplacement de stockage des fichiers, répertoire accessible en écriture sur le FS",
- "/tmp/faxtomail/storage", File.class),
-
-// SUPPORT_EMAIL(
-// "extranetEncAhi.supportEmail",
-// "L'adresse mail à contacter par l'utilisateur pour demander de l'aide",
-// "extranet-enc-ahi-users(a)list.forge.codelutin.com", String.class),
-
- LOG_CONFIGURATION_FILE(
- "logConfigurationFile",
- "Chemin vers le fichier de configuration des journaux",
- null,
- String.class);
-
- protected final String key;
- protected final String description;
- protected final Class<?> type;
- protected String defaultValue;
-
- private FaxToMailApplicationConfigOption(String key, String description,
- String defaultValue, Class<?> type) {
- this.key = key;
- this.description = description;
- this.defaultValue = defaultValue;
- this.type = type;
- }
-
- @Override
- public String getKey() {
- return key;
- }
-
- @Override
- public Class<?> getType() {
- return type;
- }
-
- @Override
- public String getDescription() {
- return description;
- }
-
- @Override
- public String getDefaultValue() {
- return defaultValue;
- }
-
- @Override
- public boolean isTransient() {
- return false;
- }
-
- @Override
- public boolean isFinal() {
- return false;
- }
-
- @Override
- public void setDefaultValue(String defaultValue) {
- this.defaultValue = defaultValue;
- }
-
- @Override
- public void setTransient(boolean isTransient) {
- // Nothing to do
- }
-
- @Override
- public void setFinal(boolean isFinal) {
- // Nothing to do
- }
-
-}
\ No newline at end of file
Deleted: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailBusinessException.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailBusinessException.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailBusinessException.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,24 +0,0 @@
-package com.franciaflex.faxtomail;
-
-/**
- * To box any business exception.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public class FaxToMailBusinessException extends RuntimeException {
-
- private static final long serialVersionUID = 1L;
-
- public FaxToMailBusinessException(String message) {
- super(message);
- }
-
- public FaxToMailBusinessException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public FaxToMailBusinessException(Throwable cause) {
- super(cause);
- }
-}
Copied: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java (from rev 4, trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfig.java)
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,389 @@
+package com.franciaflex.faxtomail;
+
+/*
+ * #%L
+ * Extranet ENC-AHI :: Persistence
+ * $Id: ExtranetEncAhiApplicationConfig.java 866 2013-12-13 10:34:05Z bleny $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-persiste… $
+ * %%
+ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.base.Charsets;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.config.ApplicationConfig;
+import org.nuiton.config.ApplicationConfigHelper;
+import org.nuiton.config.ApplicationConfigProvider;
+import org.nuiton.config.ArgumentsParserException;
+import org.nuiton.jaxx.application.ApplicationConfiguration;
+import org.nuiton.jaxx.application.ApplicationIOUtil;
+import org.nuiton.jaxx.application.ApplicationTechnicalException;
+import org.nuiton.util.Version;
+
+import javax.swing.*;
+import java.awt.*;
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import static org.nuiton.i18n.I18n.t;
+
+public class FaxToMailConfiguration extends ApplicationConfiguration {
+
+ private static final Log log = LogFactory.getLog(FaxToMailConfiguration.class);
+
+ private static FaxToMailConfiguration instance;
+
+ public static FaxToMailConfiguration getInstance() {
+ return instance;
+ }
+
+ public static void setInstance(FaxToMailConfiguration instance) {
+ FaxToMailConfiguration.instance = instance;
+ }
+
+ protected final String[] optionKeyToNotSave;
+
+ protected File configFile;
+
+ public FaxToMailConfiguration(ApplicationConfig applicationConfig) {
+ super(applicationConfig);
+ optionKeyToNotSave = null;
+ }
+
+ public FaxToMailConfiguration(String file, String... args) {
+ super(new ApplicationConfig());
+ applicationConfig.setEncoding(Charsets.UTF_8.name());
+
+ // get all config providers
+ Set<ApplicationConfigProvider> providers =
+ ApplicationConfigHelper.getProviders(null,
+ null,
+ null,
+ true);
+
+ // load all default options
+ ApplicationConfigHelper.loadAllDefaultOption(applicationConfig,
+ providers);
+
+ // get all transient and final option keys
+ Set<String> optionToSkip =
+ ApplicationConfigHelper.getTransientOptionKeys(providers);
+
+ if (log.isDebugEnabled()) {
+ log.debug("Option that won't be saved: " + optionToSkip);
+ }
+ optionKeyToNotSave = optionToSkip.toArray(new String[optionToSkip.size()]);
+
+ applicationConfig.setConfigFileName(file);
+
+ try {
+ applicationConfig.parse(args);
+
+ } catch (ArgumentsParserException e) {
+ throw new ApplicationTechnicalException(t("faxtomail.config.parse.error"), e);
+ }
+
+ //TODO Review this, this is very dirty to do this...
+ File faxToMailBasedir = applicationConfig.getOptionAsFile(
+ FaxToMailConfigurationOption.BASEDIR.getKey());
+
+ if (faxToMailBasedir == null) {
+ faxToMailBasedir = new File("");
+ }
+ if (!faxToMailBasedir.isAbsolute()) {
+ faxToMailBasedir = new File(faxToMailBasedir.getAbsolutePath());
+ }
+ if (faxToMailBasedir.getName().equals("..")) {
+ faxToMailBasedir = faxToMailBasedir.getParentFile().getParentFile();
+ }
+ if (faxToMailBasedir.getName().equals(".")) {
+ faxToMailBasedir = faxToMailBasedir.getParentFile();
+ }
+ if (log.isInfoEnabled()) {
+ log.info("Application basedir: " + faxToMailBasedir);
+ }
+ applicationConfig.setOption(
+ FaxToMailConfigurationOption.BASEDIR.getKey(),
+ faxToMailBasedir.getAbsolutePath());
+
+ if (log.isInfoEnabled()) {
+ StringBuilder builder = new StringBuilder();
+ List<FaxToMailConfigurationOption> options =
+ Lists.newArrayList(FaxToMailConfigurationOption.values());
+ for (FaxToMailConfigurationOption option : options) {
+ String key = option.getKey();
+ Object value = applicationConfig.getOption(option);
+ builder.append(String.format("\n%1$-40s = %2$s",
+ key,
+ value));
+ }
+ log.info("faxtomail: " + builder.toString());
+ }
+ }
+
+ public void prepareDirectories() {
+
+ File dataDirectory = getDataDirectory();
+ ApplicationIOUtil.forceMkdir(
+ dataDirectory,
+ t("faxtomail.service.mkDir.error", dataDirectory));
+
+ File tmpDirectory = getTmpDirectory();
+ if (tmpDirectory.exists()) {
+
+ ApplicationIOUtil.deleteDirectory(
+ tmpDirectory,
+ t("faxtomail.service.config.deleteTempDirectory.error", tmpDirectory));
+ }
+ ApplicationIOUtil.forceMkdir(
+ tmpDirectory,
+ t("faxtomail.service.mkDir.error", tmpDirectory));
+
+ }
+
+ public File getConfigFile() {
+ if (configFile == null) {
+ File dir = getBasedir();
+ if (dir == null || !dir.exists() || !isFullLaunchMode()) {
+ dir = new File(applicationConfig.getUserConfigDirectory());
+ }
+ configFile = new File(dir, applicationConfig.getConfigFileName());
+ }
+ return configFile;
+ }
+
+ public void save() {
+
+ File file = getConfigFile();
+ if (log.isInfoEnabled()) {
+ log.info("Save configuration at: " + file);
+ }
+ try {
+ applicationConfig.save(file, false, optionKeyToNotSave);
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(
+ t("tutti.config.save.error", file), e);
+ }
+ }
+
+ @Override
+ public String toString() {
+ return ReflectionToStringBuilder.toString(this);
+ }
+
+ // OPTION SETTERS
+
+ public void setCsvSeparator(char c) {
+ applicationConfig.setOption(
+ FaxToMailConfigurationOption.CSV_SEPARATOR.getKey(), c + "");
+ }
+
+ // OPTION GETTERS
+
+ public boolean isDevMode() {
+ boolean isDevMode = applicationConfig.getOptionAsBoolean(FaxToMailConfigurationOption.DEV_MODE.getKey());
+ return isDevMode;
+ }
+
+ public Map<String, String> getTopiaProperties() {
+ Map<String, String> jpaParameters = Maps.newHashMap();
+ Properties hibernateProperties = applicationConfig.getOptionStartsWith("hibernate");
+ jpaParameters.putAll((Map) hibernateProperties);
+ return jpaParameters;
+ }
+
+ /**
+ * @return Le nom d'hôte du serveur SMTP.
+ */
+ public String getSmtpHost() {
+ return applicationConfig.getOption(FaxToMailConfigurationOption.SMTP_HOST.getKey());
+ }
+
+ /**
+ * @return Le port du serveur SMTP.
+ */
+ public int getSmtpPort() {
+ return applicationConfig.getOptionAsInt(FaxToMailConfigurationOption.SMTP_PORT.getKey());
+ }
+
+ /**
+ * @return L'adresse d'expéditeur pour les mails de notifications
+ */
+ public String getSmtpFrom() {
+ return applicationConfig.getOption(FaxToMailConfigurationOption.SMTP_FROM.getKey());
+ }
+
+ public String getInstanceUrl() {
+ return applicationConfig.getOption(FaxToMailConfigurationOption.INSTANCE_URL.getKey());
+ }
+
+ public String getInstanceDisclaimer() {
+ return applicationConfig.getOption(FaxToMailConfigurationOption.INSTANCE_DISCLAIMER.getKey());
+ }
+
+ public File getStorageFile() {
+ return applicationConfig.getOptionAsFile(FaxToMailConfigurationOption.STORAGE_FILE.getKey());
+ }
+
+ public boolean isLogConfigurationProvided() {
+ boolean logConfigurationProvided =
+ StringUtils.isNotBlank(applicationConfig.getOption(FaxToMailConfigurationOption.LOG_CONFIGURATION_FILE.getKey()));
+ return logConfigurationProvided;
+ }
+
+ public File getLogConfigurationFile() {
+ return applicationConfig.getOptionAsFile(FaxToMailConfigurationOption.LOG_CONFIGURATION_FILE.getKey());
+ }
+
+ @Override
+ public String getApplicationName() {
+ return "FaxToMail";
+ }
+
+ /** @return {@link FaxToMailConfigurationOption#VERSION} value */
+ @Override
+ public Version getVersion() {
+ return applicationConfig.getOptionAsVersion(FaxToMailConfigurationOption.VERSION.getKey());
+ }
+
+ /** @return {@link FaxToMailConfigurationOption#SITE_URL} value */
+ public URL getSiteUrl() {
+ return applicationConfig.getOptionAsURL(FaxToMailConfigurationOption.SITE_URL.getKey());
+ }
+
+ /** @return {@link FaxToMailConfigurationOption#ORGANIZATION_NAME} value */
+ public String getOrganizationName() {
+ return applicationConfig.getOption(FaxToMailConfigurationOption.ORGANIZATION_NAME.getKey());
+ }
+
+ /** @return {@link FaxToMailConfigurationOption#INCEPTION_YEAR} value */
+ public int getInceptionYear() {
+ return applicationConfig.getOptionAsInt(FaxToMailConfigurationOption.INCEPTION_YEAR.getKey());
+ }
+
+ /** @return {@link FaxToMailConfigurationOption#BASEDIR} value */
+ public File getBasedir() {
+ File result = applicationConfig.getOptionAsFile(FaxToMailConfigurationOption.BASEDIR.getKey());
+ return result;
+ }
+
+ /** @return {@link FaxToMailConfigurationOption#DATA_DIRECTORY} value */
+ public File getDataDirectory() {
+ File result = applicationConfig.getOptionAsFile(FaxToMailConfigurationOption.DATA_DIRECTORY.getKey());
+ return result;
+ }
+
+ public File getTmpDirectory() {
+ File result = applicationConfig.getOptionAsFile(FaxToMailConfigurationOption.TMP_DIRECTORY.getKey());
+ return result;
+ }
+
+ public File newTempFile(String basename) {
+ return new File(getTmpDirectory(), basename + "_" + System.nanoTime());
+ }
+
+ public char getCsvSeparator() {
+ return applicationConfig.getOption(
+ FaxToMailConfigurationOption.CSV_SEPARATOR.getKey()).charAt(0);
+ }
+
+ public boolean isFullLaunchMode() {
+ return "full".equals(getFaxToMailLaunchMode());
+ }
+
+ public String getFaxToMailLaunchMode() {
+ return applicationConfig.getOption(FaxToMailConfigurationOption.FAXTOMAIL_LAUNCH_MODE.getKey());
+ }
+
+ /** @return {@link FaxToMailConfigurationOption#UI_CONFIG_FILE} value */
+ public File getUIConfigFile() {
+ return applicationConfig.getOptionAsFile(FaxToMailConfigurationOption.UI_CONFIG_FILE.getKey());
+ }
+
+ /** @return {@link FaxToMailConfigurationOption#START_ACTION_FILE} value */
+ public File getStartActionFile() {
+ return applicationConfig.getOptionAsFile(FaxToMailConfigurationOption.START_ACTION_FILE.getKey());
+ }
+
+ public KeyStroke getShortCut(String actionName) {
+ KeyStroke result = applicationConfig.getOptionAsKeyStroke(
+ "faxtomail.ui." + actionName);
+ return result;
+ }
+
+ public boolean isAutoPopupNumberEditor() {
+ return applicationConfig.getOptionAsBoolean(FaxToMailConfigurationOption.AUTO_POPUP_NUMBER_EDITOR.getKey());
+ }
+
+ public boolean isShowNumberEditorButton() {
+ return applicationConfig.getOptionAsBoolean(FaxToMailConfigurationOption.SHOW_NUMBER_EDITOR_BUTTON.getKey());
+ }
+
+ public Color getColorBlockingLayer() {
+ return applicationConfig.getOptionAsColor(FaxToMailConfigurationOption.COLOR_BLOCKING_LAYER.getKey());
+ }
+
+ public Color getColorAlternateRow() {
+ return applicationConfig.getOptionAsColor(FaxToMailConfigurationOption.COLOR_ALTERNATE_ROW.getKey());
+ }
+
+ public Color getColorSelectedRow() {
+ return applicationConfig.getOptionAsColor(FaxToMailConfigurationOption.COLOR_SELECTED_ROW.getKey());
+ }
+
+ @Override
+ public KeyStroke getShortcutClosePopup() {
+ return applicationConfig.getOptionAsKeyStroke(FaxToMailConfigurationOption.SHORTCUT_CLOSE_POPUP.getKey());
+ }
+
+ public String getDateFormat() {
+ return applicationConfig.getOption(FaxToMailConfigurationOption.DATE_FORMAT.getKey());
+ }
+
+ public File getNewTmpDirectory(String name) {
+ return new File(getTmpDirectory(), name + "_" + System.nanoTime());
+ }
+
+ public File getI18nDirectory() {
+ return applicationConfig.getOptionAsFile(
+ FaxToMailConfigurationOption.FAXTOMAIL_I18N_DIRECTORY.getKey());
+ }
+
+ public Locale getI18nLocale() {
+ return applicationConfig.getOptionAsLocale(
+ FaxToMailConfigurationOption.FAXTOMAIL_I18N_LOCALE.getKey());
+ }
+
+ public void setI18nLocale(Locale locale) {
+ applicationConfig.setOption(FaxToMailConfigurationOption.FAXTOMAIL_I18N_LOCALE.getKey(), locale.toString());
+ }
+
+}
Copied: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java (from rev 4, trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfigOption.java)
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,335 @@
+package com.franciaflex.faxtomail;
+
+/*
+ * #%L
+ * Extranet ENC-AHI :: Persistence
+ * $Id: ExtranetEncAhiApplicationConfigOption.java 869 2013-12-13 13:09:12Z bleny $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-persiste… $
+ * %%
+ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.nuiton.config.ConfigOptionDef;
+import org.nuiton.util.Version;
+
+import javax.swing.*;
+import java.awt.*;
+import java.io.File;
+import java.net.URL;
+import java.util.Locale;
+
+import static org.nuiton.i18n.I18n.n;
+
+public enum FaxToMailConfigurationOption implements ConfigOptionDef {
+
+ INSTANCE_URL(
+ "faxtomail.instanceUrl",
+ "URL à laquelle on peut accéder à l'instance de faxToMail",
+ "http://localhost:8080/faxtomail", String.class),
+
+ INSTANCE_DISCLAIMER(
+ "faxtomail.instanceDisclaimer",
+ "Avertissement à afficher aux utilisateurs si l'instance est instable",
+ null, String.class),
+
+ SMTP_HOST(
+ "smtp.host",
+ "Nom d'hôte du serveur SMTP",
+ "", String.class),
+
+ SMTP_PORT(
+ "smtp.port",
+ "Le port du serveur SMTP",
+ "25", Integer.class),
+
+ SMTP_FROM(
+ "smtp.from",
+ "L'adresse d'expéditeur pour les mails de notifications",
+ "", String.class),
+
+ DEV_MODE(
+ "faxtomail.devMode",
+ "Mode développement, court-circuite l'envoi de mail",
+ "true", Boolean.class),
+
+// CREATE_TRAINING_USERS(
+// "extranetEncAhi.createTrainingUsers",
+// "Vrai s'il faut créer les comptes de formation au démarrage de l'application",
+// "true", Boolean.class),
+
+ STORAGE_FILE(
+ "faxtomail.storage",
+ "L'emplacement de stockage des fichiers, répertoire accessible en écriture sur le FS",
+ "/tmp/faxtomail/storage", File.class),
+
+// SUPPORT_EMAIL(
+// "extranetEncAhi.supportEmail",
+// "L'adresse mail à contacter par l'utilisateur pour demander de l'aide",
+// "extranet-enc-ahi-users(a)list.forge.codelutin.com", String.class),
+
+ LOG_CONFIGURATION_FILE(
+ "logConfigurationFile",
+ "Chemin vers le fichier de configuration des journaux",
+ null,
+ String.class),
+
+ //SERVICE
+
+ // TRANSIENT CONFIG
+ VERSION(
+ "faxtomail.version",
+ n("faxtomail.config.option.version.description"),
+ "",
+ Version.class,
+ true),
+
+ SITE_URL(
+ "faxtomail.site.url",
+ n("faxtomail.config.option.site.url.description"),
+ "http://maven-site.forge.codelutin.com/faxtomail",
+ URL.class,
+ true),
+
+ ORGANIZATION_NAME(
+ "faxtomail.organizationName",
+ n("faxtomail.config.option.organizationName.description"),
+ "",
+ String.class,
+ true),
+
+ INCEPTION_YEAR(
+ "faxtomail.inceptionYear",
+ n("faxtomail.config.option.inceptionYear.description"),
+ "2012",
+ Integer.class,
+ true),
+
+ BASEDIR(
+ "faxtomail.basedir",
+ n("faxtomail.config.option.basedir.description"),
+ "${user.home}/.faxtomail",
+ File.class,
+ true
+ ),
+
+ DATA_DIRECTORY(
+ "faxtomail.data.directory",
+ n("faxtomail.config.option.data.directory.description"),
+ "${faxtomail.basedir}/data",
+ File.class,
+ true),
+
+ TMP_DIRECTORY(
+ "faxtomail.tmp.directory",
+ n("faxtomail.config.option.tmp.directory.description"),
+ "${faxtomail.data.directory}/temp",
+ File.class,
+ true),
+
+ // NOT TRANSIENT CONFIG
+
+ CSV_SEPARATOR(
+ "faxtomail.csv.separator",
+ n("faxtomail.config.option.csv.separator.description"),
+ ";",
+ char.class),
+
+ // UI
+
+ FAXTOMAIL_LAUNCH_MODE(
+ "faxtomail.launch.mode",
+ n("faxtomail.config.option.launch.mode.description"),
+ null,
+ String.class,
+ true
+ ),
+
+ FAXTOMAIL_I18N_DIRECTORY(
+ "faxtomail.i18n.directory",
+ n("faxtomail.config.option.i18n.directory.description"),
+ "${faxtomail.basedir}/i18n",
+ File.class,
+ true
+ ),
+
+// FAXTOMAIL_HELP_DIRECTORY(
+// "faxtomail.help.directory",
+// n("faxtomail.config.option.help.directory.description"),
+// "${faxtomail.basedir}/help",
+// File.class,
+// false,
+// true
+// ),
+
+ START_ACTION_FILE(
+ "faxtomail.startActionFile",
+ n("faxtomail.config.option.startActionFile.description"),
+ "${faxtomail.basedir}/faxtomail-start-action",
+ File.class,
+ true
+ ),
+ FAXTOMAIL_I18N_LOCALE(
+ "faxtomail.i18n.locale",
+ n("faxtomail.config.option.i18n.locale.description"),
+ Locale.FRANCE.getCountry(),
+ Locale.class
+ ),
+
+ UI_CONFIG_FILE(
+ "faxtomail.ui.config.file",
+ n("faxtomail.config.option.ui.config.file.description"),
+ "${faxtomail.data.directory}/faxtomailUI.xml",
+ File.class
+ ),
+
+ AUTO_POPUP_NUMBER_EDITOR(
+ "faxtomail.ui.autoPopupNumberEditor",
+ n("faxtomail.config.option.ui.autoPopupNumberEditor.description"),
+ String.valueOf(false),
+ Boolean.class
+ ),
+
+ SHOW_NUMBER_EDITOR_BUTTON(
+ "faxtomail.ui.showNumberEditorButton",
+ n("faxtomail.config.option.ui.showNumberEditorButton.description"),
+ String.valueOf(true),
+ Boolean.class
+ ),
+
+ COLOR_ALTERNATE_ROW(
+ "faxtomail.ui.color.alternateRow",
+ n("faxtomail.config.option.ui.color.alternateRow.description"),
+ new Color(217, 217, 217).toString(),
+ Color.class
+ ),
+ COLOR_SELECTED_ROW(
+ "faxtomail.ui.color.selectedRow",
+ n("faxtomail.config.option.ui.color.selectedRow.description"),
+ new Color(57,105,138).toString(),
+ Color.class
+ ),
+
+ /*
+ UIDefaults defaults = UIManager.getLookAndFeelDefaults();
+defaults.put("Table.alternateRowColor", new Color(217, 217, 217));
+ */
+ COLOR_BLOCKING_LAYER(
+ "faxtomail.ui.color.blockingLayer",
+ n("faxtomail.config.option.ui.color.blockingLayer.description"),
+ new Color(200, 200, 200).toString(),
+ Color.class
+ ),
+
+ SHORTCUT_CLOSE_POPUP(
+ "faxtomail.ui.shortcut.closePopup",
+ n("faxtomail.config.option.ui.shortcut.closePopup.description"),
+ "alt pressed F",
+ KeyStroke.class
+ ),
+
+ DATE_FORMAT(
+ "faxtomail.ui.dateFormat",
+ n("faxtomail.config.option.ui.dateFormat.description"),
+ "dd/MM/yyyy",
+ String.class
+ );
+
+ /** Configuration key. */
+ private final String key;
+
+ /** I18n key of option description */
+ private final String description;
+
+ /** Type of option */
+ private final Class<?> type;
+
+ /** Default value of option. */
+ private String defaultValue;
+
+ /** Flag to not keep option value on disk */
+ private boolean isTransient;
+
+ /** Flag to not allow option value modification */
+ private boolean isFinal;
+
+ FaxToMailConfigurationOption(String key,
+ String description,
+ String defaultValue,
+ Class<?> type,
+ boolean isTransient) {
+ this.key = key;
+ this.description = description;
+ this.defaultValue = defaultValue;
+ this.type = type;
+ this.isTransient = isTransient;
+ this.isFinal = isTransient;
+ }
+
+ FaxToMailConfigurationOption(String key,
+ String description,
+ String defaultValue,
+ Class<?> type) {
+ this(key, description, defaultValue, type, true);
+ }
+
+ @Override
+ public String getKey() {
+ return key;
+ }
+
+ @Override
+ public Class<?> getType() {
+ return type;
+ }
+
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ @Override
+ public String getDefaultValue() {
+ return defaultValue;
+ }
+
+ @Override
+ public boolean isTransient() {
+ return isTransient;
+ }
+
+ @Override
+ public boolean isFinal() {
+ return isFinal;
+ }
+
+ @Override
+ public void setDefaultValue(String defaultValue) {
+ this.defaultValue = defaultValue;
+ }
+
+ @Override
+ public void setTransient(boolean newValue) {
+ // not used
+ }
+
+ @Override
+ public void setFinal(boolean newValue) {
+ // not used
+ }
+
+}
\ No newline at end of file
Added: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationProvider.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationProvider.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationProvider.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,63 @@
+package com.franciaflex.faxtomail;
+
+/*
+ * #%L
+ * Tutti :: Persistence
+ * $Id: TuttiConfigurationProvider.java 1566 2014-02-04 08:31:02Z tchemit $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-persistence/src/main/j… $
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.nuiton.config.ApplicationConfigProvider;
+import org.nuiton.config.ConfigActionDef;
+import org.nuiton.config.ConfigOptionDef;
+
+import java.util.Locale;
+
+import static org.nuiton.i18n.I18n.l;
+
+/**
+ * Tutti config provider (for site generation).
+ * Created on 11/24/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 3.0
+ */
+public class FaxToMailConfigurationProvider implements ApplicationConfigProvider {
+
+ @Override
+ public String getName() {
+ return "faxToMail";
+ }
+
+ @Override
+ public String getDescription(Locale locale) {
+ return l(locale, "faxToMail.config");
+ }
+
+ @Override
+ public ConfigOptionDef[] getOptions() {
+ return FaxToMailConfigurationOption.values();
+ }
+
+ @Override
+ public ConfigActionDef[] getActions() {
+ return new ConfigActionDef[0];
+ }
+}
\ No newline at end of file
Deleted: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailIOUtil.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailIOUtil.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailIOUtil.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,231 +0,0 @@
-package com.franciaflex.faxtomail;
-
-import com.google.common.base.Charsets;
-import com.google.common.io.Files;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.FilenameUtils;
-import org.apache.commons.vfs2.FileObject;
-import org.apache.commons.vfs2.FileSelector;
-import org.apache.commons.vfs2.FileSystemManager;
-import org.apache.commons.vfs2.FileType;
-import org.apache.commons.vfs2.VFS;
-import org.nuiton.util.ZipUtil;
-
-import java.io.Closeable;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.Writer;
-import java.util.List;
-import java.util.UUID;
-
-import static org.nuiton.i18n.I18n.t;
-
-/**
- * Useful methods around IO, all method errors are boxes a
- * {@link FaxToMailTechnicalException}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0.2
- */
-public class FaxToMailIOUtil {
-
- protected FaxToMailIOUtil() {
- // no instance
- }
-
- public static void close(Closeable toClose, String errorMessage) {
-
- try {
- toClose.close();
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void zip(File source, File archiveFile, String errorMessage) {
- try {
- ZipUtil.compress(archiveFile, source);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void zip(File source, File archiveFile, List<File> files, String errorMessage) {
- try {
- ZipUtil.compressFiles(archiveFile, source, files);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(t(errorMessage, archiveFile), e);
- }
- }
-
- public static FileObject resolveFile(String file, String errorMessage) {
- try {
- FileSystemManager manager = VFS.getManager();
- FileObject targetObject = manager.resolveFile(file);
- return targetObject;
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static FileObject[] getChildren(FileObject objectFile, String errorMessage) {
- try {
- return objectFile.getChildren();
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static FileObject getChild(FileObject objectFile, String name, String errorMessage) {
- try {
- return objectFile.getChild(name);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
-
- public static FileType getType(FileObject objectFile, String errorMessage) {
- try {
- return objectFile.getType();
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void explode(FileObject archiveFile,
- File target,
- FileSelector fileSelector, String errorMessage) {
- try {
- FileSystemManager manager = VFS.getManager();
- FileObject targetObject = manager.toFileObject(target);
- targetObject.copyFrom(archiveFile, fileSelector);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void forceMkdir(File dir, String errorMessage) {
- try {
- FileUtils.forceMkdir(dir);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void cleanDirectory(File dir, String errorMessage) {
- try {
- FileUtils.cleanDirectory(dir);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void deleteDirectory(File dir, String errorMessage) {
- try {
- FileUtils.deleteDirectory(dir);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void forceDeleteOnExit(File dir, String errorMessage) {
- try {
- FileUtils.forceDeleteOnExit(dir);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void copyDirectory(File source, File target, String errorMessage) {
- try {
- FileUtils.copyDirectory(source, target);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void copyFileToDirectory(File source, File target, String errorMessage) {
- try {
- FileUtils.copyFileToDirectory(source, target);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void copyFile(File source, File target, String errorMessage) {
- try {
- FileUtils.copyFile(source, target);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void deleteFile(File file, String errorMessage) {
- try {
- FileUtils.forceDelete(file);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static String getBaseName(String file) {
- return FilenameUtils.getBaseName(file);
- }
-
- public static String getExtension(String file) {
- return FilenameUtils.getExtension(file);
- }
-
- public static Reader newReader(File file, String errorMessage) {
- try {
- return Files.newReader(file, Charsets.UTF_8);
-
- } catch (FileNotFoundException e) {
- throw new FaxToMailTechnicalException(t(errorMessage, file), e);
- }
- }
-
- public static Writer newWriter(File file, String errorMessage
- ) {
- try {
- return Files.newWriter(file, Charsets.UTF_8);
-
- } catch (FileNotFoundException e) {
- throw new FaxToMailTechnicalException(t(errorMessage, file), e);
- }
- }
-
- public static File explodeZip(File rootDirectory,
- File file,
- String errorMessage) {
- File tempDir = new File(rootDirectory, UUID.randomUUID().toString());
- try {
- ZipUtil.uncompress(file, tempDir);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(t(errorMessage, file), e);
- }
- return tempDir;
- }
-
- public static String readContent(File file, String errorMessage) {
-
- try {
- return Files.readFirstLine(file, Charsets.UTF_8);
-
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void writeContent(File file, String content, String errorMessage) {
- try {
- FileUtils.write(file, content, Charsets.UTF_8);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
-
- }
-}
Deleted: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailTechnicalException.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailTechnicalException.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailTechnicalException.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,27 +0,0 @@
-package com.franciaflex.faxtomail;
-
-/**
- * Any techincal exception should be boxed in a such exception.
- *
- * @author tchemit <chemit(a)codelutin.com/>
- * @since 0.1
- */
-public class FaxToMailTechnicalException extends RuntimeException {
-
- private static final long serialVersionUID = 1L;
-
- public FaxToMailTechnicalException() {
- }
-
- public FaxToMailTechnicalException(String message) {
- super(message);
- }
-
- public FaxToMailTechnicalException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public FaxToMailTechnicalException(Throwable cause) {
- super(cause);
- }
-}
Deleted: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/PropagatePropertyChangeListener.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/PropagatePropertyChangeListener.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/PropagatePropertyChangeListener.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,56 +0,0 @@
-package com.franciaflex.faxtomail;
-
-import org.jdesktop.beans.AbstractBean;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-/**
- * To listen a bean and propagate some of properties.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.3
- */
-public class PropagatePropertyChangeListener implements PropertyChangeListener {
-
- public static interface PropagatePropertyChange {
- void firePropertyChanged(String propertyName,
- Object oldValue,
- Object newValue);
- }
-
- public static void listenAndPropagate(AbstractBean producer,
- PropagatePropertyChange consumer,
- String propertyNameToListen,
- String propertyNameToForward) {
- PropagatePropertyChangeListener listener =
- new PropagatePropertyChangeListener(propertyNameToForward,
- consumer);
- producer.addPropertyChangeListener(propertyNameToListen, listener);
- }
-
- public static void listenAndPropagateAll(AbstractBean producer,
- PropagatePropertyChange consumer) {
- PropagatePropertyChangeListener listener =
- new PropagatePropertyChangeListener(null, consumer);
- producer.addPropertyChangeListener(listener);
- }
-
- private String propertyName;
-
- private PropagatePropertyChange editor;
-
- public PropagatePropertyChangeListener(String propertyName,
- PropagatePropertyChange editor) {
- this.propertyName = propertyName;
- this.editor = editor;
- }
-
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- String name = propertyName == null ? evt.getPropertyName() : propertyName;
- editor.firePropertyChanged(name,
- evt.getOldValue(),
- evt.getNewValue());
- }
-}
\ No newline at end of file
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/ProgressionModel.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/ProgressionModel.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/ProgressionModel.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,6 +1,7 @@
package com.franciaflex.faxtomail.persistence;
import org.jdesktop.beans.AbstractSerializableBean;
+import org.nuiton.jaxx.application.type.ApplicationProgressionModel;
import org.nuiton.updater.DownloadMonitor;
/**
@@ -9,87 +10,10 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 1.0
*/
-public class ProgressionModel extends AbstractSerializableBean implements DownloadMonitor {
+public class ProgressionModel extends ApplicationProgressionModel implements DownloadMonitor {
private static final long serialVersionUID = 1L;
- public static final String PROPERTY_TOTAL = "total";
-
- public static final String PROPERTY_CURRENT = "current";
-
- public static final String PROPERTY_RATE = "rate";
-
- public static final String PROPERTY_MESSAGE = "message";
-
- protected int total;
-
- protected int current;
-
- protected float rate;
-
- protected String message;
-
- public int getTotal() {
- return total;
- }
-
- public void setTotal(int total) {
- Object oldValue = getTotal();
- this.total = total;
- firePropertyChange(PROPERTY_TOTAL, oldValue, total);
- setCurrent(0);
- }
-
- public void adaptTotal(int total) {
- long current = getCurrent();
- setTotal(total);
- increments((int) current);
- Object oldValue = getTotal();
- this.total = total;
- firePropertyChange(PROPERTY_TOTAL, oldValue, total);
- setCurrent(current);
- }
-
- public long getCurrent() {
- return current;
- }
-
- public void setCurrent(int current) {
- Object oldValue = getCurrent();
- this.current = current;
- firePropertyChange(PROPERTY_CURRENT, oldValue, current);
- }
-
- public void increments(int nb) {
- setCurrent(current + nb);
- setRate(getCurrent() / getTotal());
- }
-
- public float getRate() {
- return rate;
- }
-
- public void setRate(float rate) {
- Object oldValue = getRate();
- this.rate = rate;
- firePropertyChange(PROPERTY_RATE, oldValue, rate);
- }
-
- public String getMessage() {
- return message;
- }
-
- public void increments(String message) {
- increments(1);
- setMessage(message);
- }
-
- public void setMessage(String message) {
- Object oldValue = getMessage();
- this.message = message;
- firePropertyChange(PROPERTY_MESSAGE, oldValue, message);
- }
-
@Override
public void setSize(long size) {
setTotal((int) size);
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,7 +1,5 @@
package com.franciaflex.faxtomail.persistence;
-import com.franciaflex.faxtomail.FaxToMailIOUtil;
-import com.franciaflex.faxtomail.FaxToMailTechnicalException;
import com.google.common.base.Preconditions;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
@@ -9,6 +7,8 @@
import org.apache.commons.io.FileUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.jaxx.application.ApplicationIOUtil;
+import org.nuiton.jaxx.application.ApplicationTechnicalException;
import java.io.File;
import java.io.IOException;
@@ -60,7 +60,7 @@
this.directories.add(directory);
// force to create directory
- FaxToMailIOUtil.forceMkdir(directory, t("faxtomail.persistence.mkDir.error", directory));
+ ApplicationIOUtil.forceMkdir(directory, t("faxtomail.persistence.mkDir.error", directory));
}
}
loader = null;
@@ -158,7 +158,7 @@
directories.toArray(new File[directories.size()]));
loader = URLClassLoader.newInstance(urls, null);
} catch (IOException e) {
- throw new FaxToMailTechnicalException(t("faxtomail.persistence.loader.error", directories), e);
+ throw new ApplicationTechnicalException(t("faxtomail.persistence.loader.error", directories), e);
}
}
return loader;
Added: trunk/faxtomail-persistence/src/main/resources/META-INF/services/org.nuiton.config.ApplicationConfigProvider
===================================================================
--- trunk/faxtomail-persistence/src/main/resources/META-INF/services/org.nuiton.config.ApplicationConfigProvider (rev 0)
+++ trunk/faxtomail-persistence/src/main/resources/META-INF/services/org.nuiton.config.ApplicationConfigProvider 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1 @@
+com.franciaflex.faxtomail.FaxToMailConfigurationProvider
\ No newline at end of file
Modified: trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_en_GB.properties
===================================================================
--- trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_en_GB.properties 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_en_GB.properties 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,2 +1,27 @@
+faxToMail.config=
+faxtomail.config.option.basedir.description=
+faxtomail.config.option.csv.separator.description=
+faxtomail.config.option.data.directory.description=
+faxtomail.config.option.i18n.directory.description=
+faxtomail.config.option.i18n.locale.description=
+faxtomail.config.option.inceptionYear.description=
+faxtomail.config.option.launch.mode.description=
+faxtomail.config.option.organizationName.description=
+faxtomail.config.option.site.url.description=
+faxtomail.config.option.startActionFile.description=
+faxtomail.config.option.tmp.directory.description=
+faxtomail.config.option.ui.autoPopupNumberEditor.description=
+faxtomail.config.option.ui.color.alternateRow.description=
+faxtomail.config.option.ui.color.blockingLayer.description=
+faxtomail.config.option.ui.color.selectedRow.description=
+faxtomail.config.option.ui.config.file.description=
+faxtomail.config.option.ui.dateFormat.description=
+faxtomail.config.option.ui.shortcut.closePopup.description=
+faxtomail.config.option.ui.showNumberEditorButton.description=
+faxtomail.config.option.version.description=
+faxtomail.config.parse.error=
faxtomail.persistence.loader.error=
faxtomail.persistence.mkDir.error=
+faxtomail.service.config.deleteTempDirectory.error=
+faxtomail.service.mkDir.error=
+tutti.config.save.error=
Modified: trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_FR.properties
===================================================================
--- trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_FR.properties 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_FR.properties 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,2 +1,27 @@
+faxToMail.config=
+faxtomail.config.option.basedir.description=
+faxtomail.config.option.csv.separator.description=
+faxtomail.config.option.data.directory.description=
+faxtomail.config.option.i18n.directory.description=
+faxtomail.config.option.i18n.locale.description=
+faxtomail.config.option.inceptionYear.description=
+faxtomail.config.option.launch.mode.description=
+faxtomail.config.option.organizationName.description=
+faxtomail.config.option.site.url.description=
+faxtomail.config.option.startActionFile.description=
+faxtomail.config.option.tmp.directory.description=
+faxtomail.config.option.ui.autoPopupNumberEditor.description=
+faxtomail.config.option.ui.color.alternateRow.description=
+faxtomail.config.option.ui.color.blockingLayer.description=
+faxtomail.config.option.ui.color.selectedRow.description=
+faxtomail.config.option.ui.config.file.description=
+faxtomail.config.option.ui.dateFormat.description=
+faxtomail.config.option.ui.shortcut.closePopup.description=
+faxtomail.config.option.ui.showNumberEditorButton.description=
+faxtomail.config.option.version.description=
+faxtomail.config.parse.error=
faxtomail.persistence.loader.error=
faxtomail.persistence.mkDir.error=
+faxtomail.service.config.deleteTempDirectory.error=
+faxtomail.service.mkDir.error=
+tutti.config.save.error=
Modified: trunk/faxtomail-service/pom.xml
===================================================================
--- trunk/faxtomail-service/pom.xml 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-service/pom.xml 2014-02-06 16:42:22 UTC (rev 7)
@@ -69,6 +69,11 @@
</dependency>
<dependency>
+ <groupId>org.nuiton.jaxx</groupId>
+ <artifactId>jaxx-application-api</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,110 @@
+package com.franciaflex.faxtomail.services;
+
+/*
+ * #%L
+ * Tutti :: Application
+ * $Id: DecoratorService.java 1566 2014-02-04 08:31:02Z tchemit $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-service/src/main/java/… $
+ * %%
+ * Copyright (C) 2012 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.franciaflex.faxtomail.LabelAware;
+import org.nuiton.decorator.Decorator;
+import org.nuiton.decorator.DecoratorProvider;
+
+import java.io.File;
+
+import static org.nuiton.i18n.I18n.n;
+import static org.nuiton.i18n.I18n.t;
+
+/**
+ * Tutti decorator service.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class DecoratorService extends FaxToMailServiceSupport {
+
+ public static final String CARACTERISTIC_WITH_UNIT = "withUnit";
+
+ public static final String CARACTERISTIC_PARAMETER_ONLY_WITH_UNIT = "parameterOnlyWithUnit";
+
+ public static final String CARACTERISTIC_PARAMETER_ONLY = "parameterOnly";
+
+ public static final String FROM_PROTOCOL = "fromProtocol";
+
+ public static final String GEAR_WITH_RANK_ORDER = "gearWithrankOrder";
+
+ public static final String BY_NAME = "byName";
+
+ public static final String ONLY_NAME = "onlyName";
+
+ public static final String FILE_NAME_COMPATIBLE = "fileNameCompatible";
+
+ public static final String SEPARATOR = "#";
+
+ /** Delegate decorator provider. */
+ protected DecoratorProvider decoratorProvider;
+
+ public <O> Decorator<O> getDecorator(O object) {
+ return decoratorProvider.getDecorator(object);
+ }
+
+ public <O> Decorator<O> getDecorator(O object, String name) {
+ return decoratorProvider.getDecorator(object, name);
+ }
+
+ public <O> Decorator<O> getDecoratorByType(Class<O> type) {
+ return decoratorProvider.getDecoratorByType(type);
+ }
+
+ public <O> Decorator<O> getDecoratorByType(Class<O> type, String name) {
+ return decoratorProvider.getDecoratorByType(type, name);
+ }
+
+ @Override
+ public void setServiceContext(FaxToMailServiceContext context) {
+ super.setServiceContext(context);
+
+ decoratorProvider = new DecoratorProvider() {
+ @Override
+ protected void loadDecorators() {
+
+ registerDecorator(new Decorator<Float>(Float.class) {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String toString(Object bean) {
+ return bean == null ? "" : String.valueOf(bean);
+ }
+ });
+ registerDecorator(new Decorator<Number>(Number.class) {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String toString(Object bean) {
+ return bean == null ? "" : String.valueOf(bean);
+ }
+ });
+ registerMultiJXPathDecorator(LabelAware.class, "${label}$s", SEPARATOR, " - ");
+ }
+ };
+ }
+
+}
Deleted: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DefaultFaxToMailServiceContext.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DefaultFaxToMailServiceContext.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DefaultFaxToMailServiceContext.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,113 +0,0 @@
-package com.franciaflex.faxtomail.services;
-
-/*
- * #%L
- * Extranet ENC-AHI :: Services
- * $Id: DefaultExtranetEncAhiServiceContext.java 827 2013-12-04 15:30:35Z bleny $
- * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-services… $
- * %%
- * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import com.franciaflex.faxtomail.FaxToMailApplicationConfig;
-import com.franciaflex.faxtomail.FaxToMailTechnicalException;
-import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
-import com.franciaflex.faxtomail.services.service.FaxToMailWebApplicationContext;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Date;
-import java.util.Random;
-
-public class DefaultFaxToMailServiceContext implements FaxToMailServiceContext {
-
- protected FaxToMailApplicationConfig applicationConfig;
-
- protected FaxToMailTopiaPersistenceContext persistenceContext;
-
- protected FaxToMailWebApplicationContext webApplicationContext;
-
- @Override
- public FaxToMailApplicationConfig getApplicationConfig() {
- return applicationConfig;
- }
-
- public void setPersistenceContext(FaxToMailTopiaPersistenceContext persistenceContext) {
- this.persistenceContext = persistenceContext;
- }
-
- @Override
- public FaxToMailTopiaPersistenceContext getPersistenceContext() {
- return persistenceContext;
- }
-
- public void setApplicationConfig(FaxToMailApplicationConfig applicationConfig) {
- this.applicationConfig = applicationConfig;
- }
-
- @Override
- public <E extends FaxToMailService> E newService(Class<E> serviceClass) {
-
- E service;
-
- try {
-
- Constructor<E> constructor = serviceClass.getConstructor();
-
- service = constructor.newInstance();
-
- } catch (NoSuchMethodException e) {
-
- throw new FaxToMailTechnicalException("all services must provide a non-argument constructor", e);
-
- } catch (InvocationTargetException e) {
-
- throw new FaxToMailTechnicalException("unable to instantiate service", e);
-
- } catch (InstantiationException e) {
-
- throw new FaxToMailTechnicalException("unable to instantiate service", e);
-
- } catch (IllegalAccessException e) {
-
- throw new FaxToMailTechnicalException("unable to instantiate service", e);
-
- }
-
- service.setServiceContext(this);
-
- return service;
-
- }
-
- @Override
- public Date getNow() {
- Date now = new Date();
- return now;
- }
-
- @Override
- public FaxToMailWebApplicationContext getWebApplicationContext() {
- return webApplicationContext;
- }
-
- public void setWebApplicationContext(FaxToMailWebApplicationContext webApplicationContext) {
- this.webApplicationContext = webApplicationContext;
- }
-
-}
Deleted: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,21 +0,0 @@
-package com.franciaflex.faxtomail.services;
-
-import com.franciaflex.faxtomail.FaxToMailApplicationConfig;
-import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
-import com.franciaflex.faxtomail.services.service.FaxToMailWebApplicationContext;
-
-import java.util.Date;
-
-public interface FaxToMailServiceContext {
-
- FaxToMailApplicationConfig getApplicationConfig();
-
- FaxToMailTopiaPersistenceContext getPersistenceContext();
-
- Date getNow();
-
- <E extends FaxToMailService> E newService(Class<E> serviceClass);
-
- FaxToMailWebApplicationContext getWebApplicationContext();
-
-}
Copied: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java (from rev 4, trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DefaultFaxToMailServiceContext.java)
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,112 @@
+package com.franciaflex.faxtomail.services;
+
+/*
+ * #%L
+ * Extranet ENC-AHI :: Services
+ * $Id: DefaultExtranetEncAhiServiceContext.java 827 2013-12-04 15:30:35Z bleny $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-services… $
+ * %%
+ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
+import com.franciaflex.faxtomail.services.service.FaxToMailWebApplicationContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.jaxx.application.ApplicationTechnicalException;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Date;
+
+public class FaxToMailServiceContext {
+
+ private static final Log log =
+ LogFactory.getLog(FaxToMailServiceContext.class);
+
+ protected FaxToMailConfiguration applicationConfig;
+
+ protected FaxToMailTopiaPersistenceContext persistenceContext;
+
+ protected FaxToMailWebApplicationContext webApplicationContext;
+
+ public FaxToMailConfiguration getApplicationConfig() {
+ return applicationConfig;
+ }
+
+ public void setPersistenceContext(FaxToMailTopiaPersistenceContext persistenceContext) {
+ this.persistenceContext = persistenceContext;
+ }
+
+ public FaxToMailTopiaPersistenceContext getPersistenceContext() {
+ return persistenceContext;
+ }
+
+ public void setApplicationConfig(FaxToMailConfiguration applicationConfig) {
+ this.applicationConfig = applicationConfig;
+ }
+
+ public <E extends FaxToMailService> E newService(Class<E> serviceClass) {
+
+ E service;
+
+ try {
+
+ Constructor<E> constructor = serviceClass.getConstructor();
+
+ service = constructor.newInstance();
+
+ } catch (NoSuchMethodException e) {
+
+ throw new ApplicationTechnicalException("all services must provide a non-argument constructor", e);
+
+ } catch (InvocationTargetException e) {
+
+ throw new ApplicationTechnicalException("unable to instantiate service", e);
+
+ } catch (InstantiationException e) {
+
+ throw new ApplicationTechnicalException("unable to instantiate service", e);
+
+ } catch (IllegalAccessException e) {
+
+ throw new ApplicationTechnicalException("unable to instantiate service", e);
+
+ }
+
+ service.setServiceContext(this);
+
+ return service;
+
+ }
+
+ public Date getNow() {
+ Date now = new Date();
+ return now;
+ }
+
+ public FaxToMailWebApplicationContext getWebApplicationContext() {
+ return webApplicationContext;
+ }
+
+ public void setWebApplicationContext(FaxToMailWebApplicationContext webApplicationContext) {
+ this.webApplicationContext = webApplicationContext;
+ }
+
+}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -24,7 +24,7 @@
* #L%
*/
-import com.franciaflex.faxtomail.FaxToMailApplicationConfig;
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
import com.franciaflex.faxtomail.services.service.CompanyService;
import com.franciaflex.faxtomail.services.service.ConfigurationService;
@@ -42,7 +42,7 @@
this.serviceContext = serviceContext;
}
- protected FaxToMailApplicationConfig getApplicationConfig() {
+ protected FaxToMailConfiguration getApplicationConfig() {
return serviceContext.getApplicationConfig();
}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -24,19 +24,16 @@
* #L%
*/
-import com.franciaflex.faxtomail.FaxToMailApplicationConfig;
-import com.franciaflex.faxtomail.FaxToMailTechnicalException;
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
import com.franciaflex.faxtomail.persistence.entities.Company;
import com.franciaflex.faxtomail.persistence.entities.CompanyTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.ConfigurationTopiaDao;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.nuiton.validator.xwork2.XWork2ValidatorUtil;
+import org.nuiton.jaxx.application.ApplicationTechnicalException;
import java.io.File;
-import java.io.InputStream;
-import java.util.List;
public class InitFaxToMailService extends FaxToMailServiceSupport {
@@ -68,7 +65,7 @@
protected void checkStorage() {
- FaxToMailApplicationConfig applicationConfig = getApplicationConfig();
+ FaxToMailConfiguration applicationConfig = getApplicationConfig();
File storageFile = applicationConfig.getStorageFile();
@@ -84,16 +81,16 @@
boolean created = storageFile.mkdirs();
if ( ! created) {
- throw new FaxToMailTechnicalException("unable to create directory " + storageFile.getAbsolutePath());
+ throw new ApplicationTechnicalException("unable to create directory " + storageFile.getAbsolutePath());
}
}
if ( ! storageFile.isDirectory()) {
- throw new FaxToMailTechnicalException("file exists but is not a directory " + storageFile.getAbsolutePath());
+ throw new ApplicationTechnicalException("file exists but is not a directory " + storageFile.getAbsolutePath());
}
if ( ! storageFile.canWrite()) {
- throw new FaxToMailTechnicalException("directory exists but is not writable " + storageFile.getAbsolutePath());
+ throw new ApplicationTechnicalException("directory exists but is not writable " + storageFile.getAbsolutePath());
}
}
Modified: trunk/faxtomail-ui-swing/pom.xml
===================================================================
--- trunk/faxtomail-ui-swing/pom.xml 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/pom.xml 2014-02-06 16:42:22 UTC (rev 7)
@@ -29,6 +29,7 @@
<jaxx.generateSearch>false</jaxx.generateSearch>
<jaxx.autoImportCss>true</jaxx.autoImportCss>
<jaxx.autoRecurseInCss>false</jaxx.autoRecurseInCss>
+ <jaxx.addAutoHandlerUI>true</jaxx.addAutoHandlerUI>
<i18n.bundleOutputName>faxtomail-i18n</i18n.bundleOutputName>
<i18n.generateCsvFile>true</i18n.generateCsvFile>
Added: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailActionFactory.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailActionFactory.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailActionFactory.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,61 @@
+package com.franciaflex.faxtomail.ui.swing;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id: TuttiActionFactory.java 1566 2014-02-04 08:31:02Z tchemit $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/java… $
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.franciaflex.faxtomail.ui.swing.actions.AbstractMainUIFaxToMailAction;
+import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
+import org.apache.commons.lang3.reflect.ConstructorUtils;
+import org.nuiton.jaxx.application.ApplicationTechnicalException;
+import org.nuiton.jaxx.application.swing.AbstractApplicationUIHandler;
+import org.nuiton.jaxx.application.swing.action.AbstractApplicationAction;
+import org.nuiton.jaxx.application.swing.action.ApplicationActionFactory;
+
+import static org.nuiton.i18n.I18n.t;
+
+/**
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 3.0
+ */
+public class FaxToMailActionFactory extends ApplicationActionFactory {
+
+ @Override
+ public <A extends AbstractApplicationAction> A createLogicAction(AbstractApplicationUIHandler handler,
+ Class<A> actionName) {
+ FaxToMailUIContext context = (FaxToMailUIContext) handler.getContext();
+ if (AbstractMainUIFaxToMailAction.class.isAssignableFrom(actionName) &&
+ context.getMainUI() != null) {
+ handler = context.getMainUI().getHandler();
+ }
+
+ try {
+ // create action
+ A result = ConstructorUtils.invokeConstructor(actionName, (AbstractFaxToMailUIHandler) handler);
+ return result;
+ } catch (Exception e) {
+ throw new ApplicationTechnicalException(t("application.action.create.error", actionName), e);
+ }
+ }
+}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,14 +1,11 @@
package com.franciaflex.faxtomail.ui.swing;
-import com.franciaflex.faxtomail.FaxToMailIOUtil;
-import com.franciaflex.faxtomail.services.DefaultFaxToMailServiceContext;
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
+import com.franciaflex.faxtomail.services.DecoratorService;
import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
import com.franciaflex.faxtomail.persistence.RessourceClassLoader;
-import com.franciaflex.faxtomail.ui.swing.config.FaxToMailApplicationConfig;
import com.franciaflex.faxtomail.ui.swing.content.MainUI;
-import com.franciaflex.faxtomail.ui.swing.util.FaxToMailErrorHelper;
import com.franciaflex.faxtomail.ui.swing.util.UIMessageNotifier;
-import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionUI;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -17,7 +14,7 @@
import jaxx.runtime.swing.session.BeanDoubleListState;
import jaxx.runtime.swing.session.BeanFilterableComboBoxState;
import jaxx.runtime.swing.session.State;
-import org.apache.commons.io.IOUtils;
+import jaxx.runtime.swing.session.SwingSession;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -25,8 +22,19 @@
import org.nuiton.i18n.I18n;
import org.nuiton.i18n.init.DefaultI18nInitializer;
import org.nuiton.i18n.init.UserI18nInitializer;
+import org.nuiton.jaxx.application.ApplicationConfiguration;
+import org.nuiton.jaxx.application.ApplicationIOUtil;
+import org.nuiton.jaxx.application.swing.ApplicationUIContext;
+import org.nuiton.jaxx.application.swing.action.ApplicationActionEngine;
+import org.nuiton.jaxx.application.swing.action.ApplicationActionFactory;
+import org.nuiton.jaxx.application.swing.action.ApplicationActionUI;
+import org.nuiton.jaxx.application.swing.util.ApplicationErrorHelper;
import org.nuiton.util.converter.ConverterUtil;
+import javax.swing.*;
+import java.awt.*;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import java.io.Closeable;
import java.io.File;
import java.util.Locale;
@@ -41,7 +49,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class FaxToMailUIContext extends AbstractBean implements Closeable, UIMessageNotifier {
+public class FaxToMailUIContext extends AbstractBean implements Closeable, UIMessageNotifier, ApplicationUIContext {
/** Logger. */
private static final Log log = LogFactory.getLog(FaxToMailUIContext.class);
@@ -50,6 +58,8 @@
public static final String PROPERTY_LOCALE = "locale";
+ public static final Set<String> PROPERTIES_TO_SAVE = Sets.newHashSet(PROPERTY_LOCALE);
+
public static final String PROPERTY_BUSY = "busy";
public static final String PROPERTY_HIDE_BODY = "hideBody";
@@ -66,7 +76,7 @@
*
* @since 0.1
*/
- protected final FaxToMailApplicationConfig config;
+ protected final FaxToMailConfiguration config;
/**
* ClassLoader ressource.
@@ -80,23 +90,30 @@
*
* @since 0.1
*/
-// protected final FaxToMailServiceContext serviceContext;
+ protected final FaxToMailServiceContext serviceContext;
/**
* Swing session used to save ui states.
*
* @since 0.1
*/
-// protected final SwingSession swingSession;
+ protected final SwingSession swingSession;
/**
* Erro helper.
*
* @since 1.0
*/
- protected final FaxToMailErrorHelper errorHelper;
+ protected final ApplicationErrorHelper errorHelper;
/**
+ * Shared data context.
+ *
+ * @since 1.0.2
+ */
+// protected TuttiDataContext dataContext;
+
+ /**
* Current screen displayed in ui.
*
* @since 0.1
@@ -133,10 +150,27 @@
private MainUI mainUI;
- private FaxToMailActionUI actionUI;
+ private ApplicationActionUI actionUI;
+ /**
+ * Flag to know if there is an exsiting db.
+ *
+ * @since 1.0
+ */
+ private boolean dbExist;
- public static FaxToMailUIContext newContext(FaxToMailApplicationConfig config) {
+ /**
+ * Flag to know if there is a loaded db.
+ *
+ * @since 1.0
+ */
+ private boolean dbLoaded;
+
+ private final ApplicationActionFactory faxToMailActionFactory;
+
+ private final ApplicationActionEngine faxToMailActionEngine;
+
+ public static FaxToMailUIContext newContext(FaxToMailConfiguration config) {
Preconditions.checkNotNull(config);
Preconditions.checkState(applicationContext == null,
"Application context was already opened!");
@@ -148,20 +182,47 @@
return applicationContext;
}
- public static FaxToMailErrorHelper getErrorHelper() {
+ public ApplicationErrorHelper getErrorHelper() {
return applicationContext.errorHelper;
}
- protected FaxToMailUIContext(FaxToMailApplicationConfig config) {
+ @Override
+ public String getI18nPrefix() {
+ return "faxtomail.property.";
+ }
+
+ @Override
+ public String getDateFormat() {
+ return getConfig().getDateFormat();
+ }
+
+ protected FaxToMailUIContext(FaxToMailConfiguration config) {
this.config = config;
this.resourceLoader = new RessourceClassLoader(Thread.currentThread().getContextClassLoader());
-// this.serviceContext = new DefaultFaxToMailServiceContext(resourceLoader, config.getServiceConfig());
+ this.serviceContext = new FaxToMailServiceContext();
+ serviceContext.setApplicationConfig(config);
Map<Class, State> additionalStates = Maps.newHashMap();
additionalStates.put(BeanFilterableComboBox.class, new BeanFilterableComboBoxState());
additionalStates.put(BeanDoubleList.class, new BeanDoubleListState());
-// this.swingSession = new SwingSession(getConfig().getUIConfigFile(), false, additionalStates);
+ this.swingSession = new SwingSession(getConfig().getUIConfigFile(), false, additionalStates);
+ this.errorHelper = new ApplicationErrorHelper(this) {
+
+ @Override
+ public void showWarningDialog(String message) {
+
+ JOptionPane.showMessageDialog(context.getActionUI(), "<html><body>" + message + "</body></html>",
+ t("application.error.ui.business.warning"),
+ JOptionPane.WARNING_MESSAGE);
+ }
+
+ @Override
+ public void showErrorDialog(String message, Throwable cause) {
+ super.showErrorDialog(message, cause);
+ }
+ };
+
UIMessageNotifier logMessageNotifier = new UIMessageNotifier() {
@Override
@@ -183,17 +244,34 @@
this.messageNotifiers = Sets.newHashSet();
addMessageNotifier(logMessageNotifier);
- this.errorHelper = new FaxToMailErrorHelper(this);
+ faxToMailActionFactory = new FaxToMailActionFactory();
+ faxToMailActionEngine = new ApplicationActionEngine(faxToMailActionFactory);
+ }
+ @Override
+ public ApplicationConfiguration getConfiguration() {
+ return config;
}
+ @Override
+ public Component getBodyUI() {
+ MainUI mainUI = getMainUI();
+ return mainUI == null ? null : mainUI.getBody();
+ }
+
+ @Override
+ public Component getStatusUI() {
+ MainUI mainUI = getMainUI();
+ return mainUI == null ? null : mainUI.getStatus();
+ }
+
//------------------------------------------------------------------------//
//-- Open / close methods --//
//------------------------------------------------------------------------//
public void init() {
- config.getServiceConfig().prepareDirectories();
+ config.prepareDirectories();
// use our special classLoader (which will read some files from resources from a configuration directory)
Thread.currentThread().setContextClassLoader(getResourceLoader());
@@ -219,7 +297,7 @@
// init db configuration
//--------------------------------------------------------------------//
-// config.getServiceConfig().getPersistenceConfig().initConfig(getResourceLoader());
+// config.initConfig(getResourceLoader());
// // clean db cache (avoid a lots of headache :(
// File cacheDirectory = config.getServiceConfig().getPersistenceConfig().getCacheDirectory();
@@ -233,36 +311,36 @@
//--------------------------------------------------------------------//
// init i18n
//--------------------------------------------------------------------//
-// File i18nDirectory = config.getI18nDirectory();
-// if (!config.isFullLaunchMode()) {
-//
-// i18nDirectory = new File(config.getDataDirectory(), "i18n");
-//
-// if (i18nDirectory.exists()) {
-// // clean i18n cache
-// FaxToMailIOUtil.cleanDirectory(
-// i18nDirectory,
-// _("faxtomail.i18n.deleteCache.error", i18nDirectory));
-// }
-// }
-//
-// FaxToMailIOUtil.forceMkdir(i18nDirectory,
-// _("faxtomail.i18n.mkDir.error", i18nDirectory));
-//
-// if (log.isDebugEnabled()) {
-// log.debug("I18N directory: " + i18nDirectory);
-// }
-//
-// Locale i18nLocale = config.getI18nLocale();
-//
-// if (log.isInfoEnabled()) {
-// log.info(String.format("Starts i18n with locale [%s] at [%s]",
-// i18nLocale, i18nDirectory));
-// }
-// I18n.init(new UserI18nInitializer(
-// i18nDirectory, new DefaultI18nInitializer("faxtomail-i18n")),
-// i18nLocale);
+ File i18nDirectory = config.getI18nDirectory();
+ if (!config.isFullLaunchMode()) {
+ i18nDirectory = new File(config.getDataDirectory(), "i18n");
+
+ if (i18nDirectory.exists()) {
+ // clean i18n cache
+ ApplicationIOUtil.cleanDirectory(
+ i18nDirectory,
+ t("faxtomail.i18n.deleteCache.error", i18nDirectory));
+ }
+ }
+
+ ApplicationIOUtil.forceMkdir(i18nDirectory,
+ t("faxtomail.i18n.mkDir.error", i18nDirectory));
+
+ if (log.isDebugEnabled()) {
+ log.debug("I18N directory: " + i18nDirectory);
+ }
+
+ Locale i18nLocale = config.getI18nLocale();
+
+ if (log.isInfoEnabled()) {
+ log.info(String.format("Starts i18n with locale [%s] at [%s]",
+ i18nLocale, i18nDirectory));
+ }
+ I18n.init(new UserI18nInitializer(
+ i18nDirectory, new DefaultI18nInitializer("faxtomail-i18n")),
+ i18nLocale);
+
// //--------------------------------------------------------------------//
// // init help
// //--------------------------------------------------------------------//
@@ -305,36 +383,31 @@
// //--------------------------------------------------------------------//
// // init action UI
// //--------------------------------------------------------------------//
- setActionUI(new FaxToMailActionUI(null, this));
+ setActionUI(new ApplicationActionUI(null, this));
}
public void open() {
setLocale(config.getI18nLocale());
-// boolean dbExists =
-// config.getServiceConfig().getPersistenceConfig().isDbExists();
+// boolean dbExists = config.isDbExists();
//
// setDbExist(dbExists);
-//
-// if (!dbExists) {
-//
-// }
-//
-// // save back to config
-// saveContextToConfig();
-//
-// // list when programId or campaingId change to save the configuration
-// addPropertyChangeListener(new PropertyChangeListener() {
-//
-// @Override
-// public void propertyChange(PropertyChangeEvent evt) {
-//
-// if (PROPERTIES_TO_SAVE.contains(evt.getPropertyName())) {
-// saveContextToConfig();
-// }
-// }
-// });
+
+ // save back to config
+ saveContextToConfig();
+
+ // list when programId or campaingId change to save the configuration
+ addPropertyChangeListener(new PropertyChangeListener() {
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ if (PROPERTIES_TO_SAVE.contains(evt.getPropertyName())) {
+ saveContextToConfig();
+ }
+ }
+ });
}
@Override
@@ -350,13 +423,13 @@
// IOUtils.closeQuietly(serviceContext);
// // remove listeners
-// PropertyChangeListener[] listeners = getPropertyChangeListeners();
-// for (PropertyChangeListener listener : listeners) {
-// if (log.isDebugEnabled()) {
-// log.debug("Remove listener: " + listener);
-// }
-// removePropertyChangeListener(listener);
-// }
+ PropertyChangeListener[] listeners = getPropertyChangeListeners();
+ for (PropertyChangeListener listener : listeners) {
+ if (log.isDebugEnabled()) {
+ log.debug("Remove listener: " + listener);
+ }
+ removePropertyChangeListener(listener);
+ }
setMainUI(null);
if (actionUI != null) {
@@ -370,9 +443,9 @@
//-- Service methods --//
//------------------------------------------------------------------------//
-// public DecoratorService getDecoratorService() {
-// return serviceContext.getService(DecoratorService.class);
-// }
+ public DecoratorService getDecoratorService() {
+ return serviceContext.newService(DecoratorService.class);
+ }
//------------------------------------------------------------------------//
//-- DataContext methods --//
@@ -382,7 +455,7 @@
//-- Config methods --//
//------------------------------------------------------------------------//
- public FaxToMailApplicationConfig getConfig() {
+ public FaxToMailConfiguration getConfig() {
return config;
}
@@ -395,7 +468,7 @@
// config.setProgramId(getProgramId());
// config.setCruiseId(getCruiseId());
// config.setProtocolId(getProtocolId());
-// config.setI18nLocale(getLocale());
+ config.setI18nLocale(getLocale());
config.save();
}
@@ -411,17 +484,31 @@
this.mainUI = mainUI;
}
- public FaxToMailActionUI getActionUI() {
+ @Override
+ public ApplicationActionUI getActionUI() {
return actionUI;
}
- public void setActionUI(FaxToMailActionUI actionUI) {
+ @Override
+ public ApplicationActionUI getExistingActionUI() {
+ while (actionUI == null) {
+
+ try {
+ Thread.sleep(50);
+ } catch (InterruptedException e) {
+ // ignore this one
+ }
+ }
+ return actionUI;
+ }
+
+ public void setActionUI(ApplicationActionUI actionUI) {
this.actionUI = actionUI;
}
-// public SwingSession getSwingSession() {
-// return swingSession;
-// }
+ public SwingSession getSwingSession() {
+ return swingSession;
+ }
public FaxToMailScreen getScreen() {
return screen;
@@ -433,24 +520,42 @@
firePropertyChange(PROPERTY_SCREEN, oldValue, screen);
}
+ @Override
public boolean isBusy() {
return busy;
}
+ @Override
public void setBusy(boolean busy) {
this.busy = busy;
firePropertyChange(PROPERTY_BUSY, null, busy);
}
+ @Override
public boolean isHideBody() {
return hideBody;
}
+ @Override
public void setHideBody(boolean hideBody) {
this.hideBody = hideBody;
firePropertyChange(PROPERTY_HIDE_BODY, null, hideBody);
}
+ @Override
+ public Color getColorBlockingLayer() {
+ return getConfig().getColorBlockingLayer();
+ }
+
+ @Override
+ public ApplicationActionFactory getActionFactory() {
+ return faxToMailActionFactory;
+ }
+
+ @Override
+ public ApplicationActionEngine getActionEngine() {
+ return faxToMailActionEngine;
+ }
//------------------------------------------------------------------------//
//-- UIMessageNotifier methods --//
//------------------------------------------------------------------------//
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,11 +1,10 @@
package com.franciaflex.faxtomail.ui.swing;
-import com.franciaflex.faxtomail.ui.swing.config.FaxToMailApplicationConfig;
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
import com.franciaflex.faxtomail.ui.swing.content.MainUI;
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
-import com.franciaflex.faxtomail.ui.swing.content.StartAction;
+import com.franciaflex.faxtomail.ui.swing.actions.StartAction;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailExceptionHandler;
-import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionHelper;
import jaxx.runtime.SwingUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -34,18 +33,18 @@
log.info("Starting FaxToMail with arguments: " + Arrays.toString(args));
}
- // override default exception management (after config init)
- Thread.setDefaultUncaughtExceptionHandler(new FaxToMailExceptionHandler());
- // See http://forge.codelutin.com/issues/2055
- //System.setProperty("sun.awt.exception.handler", TuttiExceptionHandler.class.getName());
-
// Create configuration
- FaxToMailApplicationConfig config =
- new FaxToMailApplicationConfig("faxtomail.config", args);
+ FaxToMailConfiguration config =
+ new FaxToMailConfiguration("faxtomail.config", args);
// Create application context
FaxToMailUIContext context = FaxToMailUIContext.newContext(config);
+ // override default exception management (after config init)
+ Thread.setDefaultUncaughtExceptionHandler(new FaxToMailExceptionHandler(context.getErrorHelper()));
+ // See http://forge.codelutin.com/issues/2055
+ //System.setProperty("sun.awt.exception.handler", TuttiExceptionHandler.class.getName());
+
// prepare context (mainly init configs, i18n)
context.init();
@@ -123,9 +122,9 @@
});
// launch start action (use the tutti-start-action file)
- StartAction uiAction = FaxToMailActionHelper.createLogicAction(
+ StartAction uiAction = context.getActionFactory().createLogicAction(
mainUI.getHandler(), StartAction.class);
- FaxToMailActionHelper.runAction(uiAction);
+ context.getActionEngine().runAction(uiAction);
}
public static void closeFaxToMail(MainUIHandler handler, Integer exitCode) {
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractChangeScreenAction.java (from rev 2, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractChangeScreenAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractChangeScreenAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractChangeScreenAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,94 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
+import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
+import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+import jaxx.runtime.SwingUtil;
+import jaxx.runtime.context.JAXXContextEntryDef;
+
+/**
+ * Action to change the screen.
+ * <p/>
+ * Will just check that the current screen can be quit via
+ * the {@link com.franciaflex.faxtomail.ui.swing.content.MainUIHandler#quitCurrentScreen()}.
+ * <p/>
+ *
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since 1.0
+ */
+public abstract class AbstractChangeScreenAction extends AbstractMainUIFaxToMailAction {
+
+ /**
+ * Context entry to keep previous screen.
+ *
+ * @since 1.1
+ */
+ protected static final JAXXContextEntryDef<FaxToMailScreen> PREVIOUS_SCREEN =
+ SwingUtil.newContextEntryDef("previousScreen", FaxToMailScreen.class);
+
+ /**
+ * Screen where to go.
+ *
+ * @since 1.0
+ */
+ protected FaxToMailScreen screen;
+
+ /**
+ * Flag to skip the check of current screen.
+ *
+ * @since 1.1
+ */
+ protected boolean skipCheckCurrentScreen;
+
+ protected AbstractChangeScreenAction(MainUIHandler handler,
+ boolean hideBody,
+ FaxToMailScreen screen) {
+ super(handler, hideBody);
+ this.screen = screen;
+ }
+
+ public void setSkipCheckCurrentScreen(boolean skipCheckCurrentScreen) {
+ this.skipCheckCurrentScreen = skipCheckCurrentScreen;
+ }
+
+ protected void setScreen(FaxToMailScreen screen) {
+ this.screen = screen;
+ }
+
+ @Override
+ public boolean prepareAction() throws Exception {
+ boolean result = super.prepareAction();
+ result &= skipCheckCurrentScreen || getHandler().quitCurrentScreen();
+ return result;
+ }
+
+ @Override
+ public void doAction() throws Exception {
+
+ FaxToMailUIContext context = getContext();
+
+ FaxToMailScreen previousScreen = context.getScreen();
+ if (getUI() != null) {
+ if (previousScreen == null) {
+ PREVIOUS_SCREEN.removeContextValue(getUI());
+ } else {
+ PREVIOUS_SCREEN.setContextValue(getUI(), previousScreen);
+ }
+ }
+
+ // clean current screen
+ context.setScreen(null);
+
+ // change screen
+ context.setScreen(screen);
+ }
+
+ @Override
+ public void postFailedAction(Throwable error) {
+ if (error != null) {
+
+// getContext().setFallBackScreen();
+ }
+ }
+
+}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/AbstractFaxToMailAction.java 2014-02-05 18:34:13 UTC (rev 4)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,334 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.action;
-
-import com.franciaflex.faxtomail.persistence.ProgressionModel;
-import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import com.franciaflex.faxtomail.ui.swing.config.FaxToMailApplicationConfig;
-import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
-import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI;
-import com.google.common.base.Preconditions;
-import jaxx.runtime.FileChooserUtil;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jdesktop.beans.AbstractBean;
-import org.nuiton.decorator.Decorator;
-
-import javax.swing.*;
-import java.io.File;
-
-import static org.nuiton.i18n.I18n._;
-
-/**
- * FaxToMail base action.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public abstract class AbstractFaxToMailAction<M extends AbstractBean, UI extends FaxToMailUI<M, ?>, H extends AbstractFaxToMailUIHandler<M, UI>>
- extends AbstractBean {
-
- /** Logger. */
- private static final Log log = LogFactory.getLog(AbstractFaxToMailAction.class);
-
- public static final String PROPERTY_DONE = "done";
-
- protected final H handler;
-
- protected String actionDescription;
-
- protected final boolean hideBody;
-
- protected final Object lock = new Object();
-
- public abstract void doAction() throws Exception;
-
- protected AbstractFaxToMailAction(H handler, boolean hideBody) {
- this.handler = handler;
- this.hideBody = hideBody;
- }
-
- public boolean prepareAction() throws Exception {
- // by default nothing to prepare
- return true;
- }
-
- protected void releaseAction() {
- // by default nothing to clean
- firePropertyChange(PROPERTY_DONE, null, true);
- }
-
- public void postSuccessAction() {
- // by default nothing to do after action
- }
-
- public void postFailedAction(Throwable error) {
- // by default nothing to do after action
- }
-
- public H getHandler() {
- return handler;
- }
-
- public M getModel() {
- return handler.getModel();
- }
-
- public final UI getUI() {
- return handler.getUI();
- }
-
- public FaxToMailUIContext getContext() {
- return handler.getContext();
- }
-
- public String getActionDescription() {
- return actionDescription;
- }
-
- public void setActionDescription(String actionDescription) {
- this.actionDescription = actionDescription;
- }
-
- public void setProgressionModel(ProgressionModel progressionModel) {
- getContext().getActionUI().getModel().setProgressionModel(progressionModel);
- }
-
- protected ProgressionModel getProgressionModel() {
- return getContext().getActionUI().getModel().getProgressionModel();
- }
-
- public boolean isHideBody() {
- return hideBody;
- }
-
-// public TuttiDataContext getDataContext() {
-// return getContext().getDataContext();
-// }
-
-// protected FaxToMailApplicationConfig getConfig() {
-// return getContext().getConfig();
-// }
-
- protected void sendMessage(String message) {
- getContext().showInformationMessage(message);
- }
-
-// protected <O> Decorator<O> getDecorator(Class<O> type, String name) {
-// Decorator<O> decorator = handler.getDecorator(type, name);
-// Preconditions.checkNotNull(decorator);
-// return decorator;
-// }
-
-// protected String decorate(Object object) {
-// return getDecorator(object.getClass(), null).toString(object);
-// }
-//
-// protected String decorate(Object object, String context) {
-// return getDecorator(object.getClass(), context).toString(object);
-// }
-
-// protected boolean askAdminPassword(String askMessage,
-// String askMessageTitle,
-// String errorMessage,
-// String errorMessageTitle) {
-//
-// Component container = getContext().getActionUI();
-//
-// String answer;
-// boolean result;
-// do {
-// answer = JOptionPane.showInputDialog(container,
-// askMessage,
-// askMessageTitle,
-// JOptionPane.WARNING_MESSAGE);
-// if (answer != null) {
-// String cryptedAnswer = StringUtil.encodeMD5(answer);
-// String correctAnswer = getConfig().getAdminPassword();
-// result = StringUtils.equals(cryptedAnswer, correctAnswer);
-//
-// if (!result) {
-// JOptionPane.showMessageDialog(container,
-// errorMessage,
-// errorMessageTitle,
-// JOptionPane.ERROR_MESSAGE);
-// }
-//
-// } else {
-// result = false;
-// }
-//
-// } while (!result && answer != null);
-// return result;
-// }
-
- /**
- * Choisir un fichier via un sélecteur graphique de fichiers.
- *
- * @param title le titre du dialogue de sélection
- * @param buttonLabel le label du boutton d'acceptation
- * @param filters les filtres + descriptions sur le sélecteur de
- * fichiers
- * @return le fichier choisi ou le fichier incoming si l'opération a été
- * annulée
- */
- protected File chooseFile(String title,
- String buttonLabel,
- String... filters) {
-
- File file = FileChooserUtil.getFile(title,
- buttonLabel,
- getContext().getMainUI(),
- filters);
- if (log.isDebugEnabled()) {
- log.debug(title + " : " + file);
- }
- if (file != null) {
- File newDir = file.isDirectory() ? file : file.getParentFile();
- FileChooserUtil.setCurrentDirectory(newDir);
- }
- return file;
- }
-
- /**
- * Sauver un fichier via un sélecteur graphique de fichiers.
- *
- * @param title le titre du dialogue de sélection
- * @param buttonLabel le label du boutton d'acceptation
- * @param filters les filtres + descriptions sur le sélecteur de
- * fichiers
- * @return le fichier choisi ou {@code null} si pas de fichier choisi ou
- * pas voulu écrasé un fichier existant.
- */
- protected File saveFile(File defaultFile,
- String filename,
- String extension,
- String title,
- String buttonLabel,
- String... filters) {
-
- if (defaultFile != null && FileChooserUtil.isCurrentDirectoryDefault()) {
-
- // set default directory to this one
- FileChooserUtil.setCurrentDirectory(defaultFile);
- }
- File file = saveFile(filename, extension, title, buttonLabel, filters);
- return file;
- }
-
- /**
- * Sauver un fichier via un sélecteur graphique de fichiers.
- *
- * @param title le titre du dialogue de sélection
- * @param buttonLabel le label du boutton d'acceptation
- * @param filters les filtres + descriptions sur le sélecteur de
- * fichiers
- * @return le fichier choisi ou {@code null} si pas de fichier choisi ou
- * pas voulu écrasé un fichier existant.
- */
- protected File saveFile(String filename,
- String extension,
- String title,
- String buttonLabel,
- String... filters) {
-
- boolean withExtension = StringUtils.isNotBlank(extension);
- String filenameSuffix = withExtension ? "." + extension : "";
- File file = FileChooserUtil.saveFile(filename + filenameSuffix, title, buttonLabel, getContext().getMainUI(), filters);
- if (log.isDebugEnabled()) {
- log.debug(title + " : " + file);
- }
- if (file != null) {
- Preconditions.checkState(!file.isDirectory());
-
- // add extension if missing
- if (withExtension && !file.getName().endsWith(filenameSuffix)) {
- file = new File(file.getParentFile(), file.getName() + filenameSuffix);
- }
-
- // ask user to confirm overwrite.
- boolean confirm = askOverwriteFile(file);
-
- if (confirm) {
-
- // on conserve le répertoire (pour une prochaine utilisation)
- FileChooserUtil.setCurrentDirectory(file.getParentFile());
- } else {
-
- // l'utilisateur n'a pas confirmé l'écrasement
- // donc pas de fichier en retour
- file = null;
- }
- }
-
- return file;
- }
-
- protected boolean askOverwriteFile(File file) {
- boolean result;
- if (file.exists()) {
-
- // file exists ask user to overwrite
- String htmlMessage = String.format(
- AbstractFaxToMailUIHandler.CONFIRMATION_FORMAT,
- _("faxtomail.common.askOverwriteFile.message", file),
- _("faxtomail.common.askOverwriteFile.help"));
-
- result = JOptionPane.showConfirmDialog(
- getHandler().getTopestUI(),
- htmlMessage,
- _("faxtomail.common.askOverwriteFile.title"),
- JOptionPane.OK_CANCEL_OPTION,
- JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION;
- } else {
-
- // file does not exist
- result = true;
- }
- return result;
- }
-
- protected boolean askBeforeDelete(String title, String message) {
- String htmlMessage = String.format(
- AbstractFaxToMailUIHandler.CONFIRMATION_FORMAT,
- message,
- _("faxtomail.common.askBeforeDelete.help"));
- int i = JOptionPane.showConfirmDialog(
- getHandler().getTopestUI(),
- htmlMessage,
- title,
- JOptionPane.OK_CANCEL_OPTION,
- JOptionPane.QUESTION_MESSAGE);
-
- boolean result = i == JOptionPane.OK_OPTION;
- return result;
- }
-
- protected void displayInfoMessage(String title, String message) {
- JOptionPane.showMessageDialog(
- getHandler().getTopestUI(),
- message,
- title,
- JOptionPane.INFORMATION_MESSAGE);
- }
-
- protected void displayWarningMessage(String title, String message) {
- JOptionPane.showMessageDialog(
- getHandler().getTopestUI(),
- message,
- title,
- JOptionPane.WARNING_MESSAGE);
- }
-
- protected void createProgressionModelIfRequired(int total) {
- ProgressionModel progressionModel = getProgressionModel();
- if (progressionModel==null) {
- progressionModel = new ProgressionModel();
- progressionModel.setTotal(total);
- progressionModel.setMessage("");
- progressionModel.setCurrent(0);
- setProgressionModel(progressionModel);
- } else {
- progressionModel.adaptTotal(total);
- }
- }
-}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java (from rev 6, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/AbstractFaxToMailAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,104 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
+import com.franciaflex.faxtomail.persistence.ProgressionModel;
+import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
+import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
+import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI;
+import org.jdesktop.beans.AbstractBean;
+import org.nuiton.jaxx.application.swing.action.AbstractApplicationAction;
+
+import javax.swing.*;
+import java.awt.*;
+
+/**
+ * FaxToMail base action.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public abstract class AbstractFaxToMailAction <M extends AbstractBean, UI extends FaxToMailUI<M, ?>, H extends AbstractFaxToMailUIHandler<M, UI>>
+ extends AbstractApplicationAction<M, UI, H> {
+
+ public abstract void doAction() throws Exception;
+
+ protected AbstractFaxToMailAction(H handler, boolean hideBody) {
+ super(handler, hideBody);
+ }
+
+ @Override
+ public FaxToMailUIContext getContext() {
+ return handler.getContext();
+ }
+
+ public void setProgressionModel(ProgressionModel progressionModel) {
+ super.setProgressionModel(progressionModel);
+ }
+
+ @Override
+ protected ProgressionModel getProgressionModel() {
+ return (ProgressionModel) getContext().getActionUI().getModel().getProgressionModel();
+ }
+
+// public FaxToMailDataContext getDataContext() {
+// return getContext().getDataContext();
+// }
+
+ @Override
+ protected FaxToMailConfiguration getConfig() {
+ return getContext().getConfig();
+ }
+
+ @Override
+ protected void sendMessage(String message) {
+ getContext().showInformationMessage(message);
+ }
+
+ @Override
+ protected void createProgressionModelIfRequired(int total) {
+ ProgressionModel progressionModel = getProgressionModel();
+ if (progressionModel == null) {
+ progressionModel = new ProgressionModel();
+ progressionModel.setTotal(total);
+ progressionModel.setMessage("");
+ progressionModel.setCurrent(0);
+ setProgressionModel(progressionModel);
+ } else {
+ progressionModel.adaptTotal(total);
+ }
+ }
+
+ protected boolean askAdminPassword(String askMessage,
+ String askMessageTitle,
+ String errorMessage,
+ String errorMessageTitle) {
+
+ Component container = getContext().getActionUI();
+
+ String answer;
+ boolean result;
+ do {
+ answer = JOptionPane.showInputDialog(container,
+ askMessage,
+ askMessageTitle,
+ JOptionPane.WARNING_MESSAGE);
+// if (answer != null) {
+// String cryptedAnswer = StringUtil.encodeMD5(answer);
+// String correctAnswer = getConfig().getAdminPassword();
+// result = StringUtils.equals(cryptedAnswer, correctAnswer);
+//
+// if (!result) {
+// JOptionPane.showMessageDialog(container,
+// errorMessage,
+// errorMessageTitle,
+// JOptionPane.ERROR_MESSAGE);
+// }
+//
+// } else {
+ result = false;
+// }
+
+ } while (!result && answer != null);
+ return result;
+ }
+}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractMainUIFaxToMailAction.java (from rev 4, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractMainUIFaxToMailAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractMainUIFaxToMailAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractMainUIFaxToMailAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,17 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
+import com.franciaflex.faxtomail.ui.swing.content.MainUI;
+import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public abstract class AbstractMainUIFaxToMailAction extends AbstractFaxToMailAction<FaxToMailUIContext, MainUI, MainUIHandler> {
+
+ protected AbstractMainUIFaxToMailAction(MainUIHandler handler,
+ boolean hideBody) {
+ super(handler, hideBody);
+ }
+}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/CloseApplicationAction.java (from rev 6, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/CloseApplicationAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/CloseApplicationAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/CloseApplicationAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,42 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.ui.swing.RunFaxToMail;
+import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+
+import static org.nuiton.i18n.I18n.t;
+
+/**
+ * To close FaxToMail Application.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.1
+ */
+public class CloseApplicationAction extends AbstractChangeScreenAction {
+
+ protected int exitCode = RunFaxToMail.NORMAL_EXIT_CODE;
+
+ public CloseApplicationAction(MainUIHandler handler) {
+ super(handler, false, null);
+ setSkipCheckCurrentScreen(true);
+ setActionDescription(t("faxtomail.main.action.exit.tip"));
+ }
+
+ public void setExitCode(int exitCode) {
+ this.exitCode = exitCode;
+ }
+
+ @Override
+ public void doAction() throws Exception {
+
+ super.doAction();
+
+ RunFaxToMail.closeFaxToMail(getHandler(), exitCode);
+ }
+
+
+ @Override
+ public void releaseAction() {
+ exitCode = RunFaxToMail.NORMAL_EXIT_CODE;
+ super.releaseAction();
+ }
+}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionException.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionException.java 2014-02-05 18:34:13 UTC (rev 4)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionException.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,34 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.action;
-
-/**
- * To box any error of a {@link AbstractFaxToMailAction}.
- *
- * @author kmorin
- * @since 0.1
- */
-public class FaxToMailActionException extends RuntimeException {
-
- private static final long serialVersionUID = 1L;
-
- private final AbstractFaxToMailAction action;
-
- public FaxToMailActionException(AbstractFaxToMailAction action, Throwable cause) {
- super(cause);
- this.action = action;
- }
-
- public static FaxToMailActionException propagateError(AbstractFaxToMailAction action,
- Throwable cause) {
- FaxToMailActionException result;
- if (cause instanceof FaxToMailActionException) {
- result = ((FaxToMailActionException) cause);
- } else {
- result = new FaxToMailActionException(action, cause);
- }
- return result;
- }
-
- public AbstractFaxToMailAction getAction() {
- return action;
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionHelper.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionHelper.java 2014-02-05 18:34:13 UTC (rev 4)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionHelper.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,123 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.action;
-
-import com.franciaflex.faxtomail.FaxToMailTechnicalException;
-import com.franciaflex.faxtomail.ui.swing.content.AbstractMainUIFaxToMailAction;
-import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
-import com.google.common.base.Preconditions;
-import org.apache.commons.lang3.reflect.ConstructorUtils;
-
-import javax.swing.*;
-
-import static org.nuiton.i18n.I18n._;
-
-/**
- * Useful method around FaxToMailUIAction.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.2
- */
-public class FaxToMailActionHelper {
-
- public static <A extends AbstractFaxToMailAction> void runInternalAction(A action) {
- Throwable error = null;
-
- try {
- action.doAction();
- action.postSuccessAction();
- } catch (Throwable e) {
- error = e;
- throw FaxToMailActionException.propagateError(action, e);
- } finally {
- try {
- if (error != null) {
- action.postFailedAction(error);
- }
- } finally {
-
- action.releaseAction();
- }
- }
- }
-
- public static <A extends AbstractFaxToMailAction> void runInternalAction(AbstractFaxToMailUIHandler handler,
- Class<A> actionName) {
- A action = createLogicAction(handler, actionName);
- runInternalAction(action);
- }
-
- public static <A extends AbstractFaxToMailAction> void runAction(A action) {
- FaxToMailUIAction<A> uiAction = createUIAction(null, action);
- uiAction.actionPerformed(null);
- }
-
- public static void runAction(AbstractButton button) {
- button.getAction().actionPerformed(null);
- }
-
- public static <A extends AbstractFaxToMailAction> void runActionAndWait(A action) {
- FaxToMailUIAction<A> uiAction = createUIAction(null, action);
- uiAction.launchActionAndWait();
- }
-
- public static <A extends AbstractFaxToMailAction> void runActionAndWait(AbstractFaxToMailUIHandler handler,
- Class<A> actionName) {
- A logicAction = createLogicAction(handler, actionName);
- runActionAndWait(logicAction);
- }
-
- public static <A extends AbstractFaxToMailAction> FaxToMailUIAction<A> createUIAction(AbstractFaxToMailUIHandler handler,
- Class<A> actionName) {
- return createUIAction(handler, null, actionName);
- }
-
-
- public static <A extends AbstractFaxToMailAction> FaxToMailUIAction<A> createUIAction(AbstractFaxToMailUIHandler handler,
- AbstractButton abstractButton,
- Class<A> actionName) {
- try {
-
- // create logic action
- A logicAction = createLogicAction(handler, actionName);
-
- // create ui action
- FaxToMailUIAction<A> result = createUIAction(abstractButton, logicAction);
- return result;
- } catch (Exception e) {
-// throw new FaxToMailTechnicalException(_("tutti.action.create.error", actionName), e);
- }
- return null;
- }
-
- public static <A extends AbstractFaxToMailAction> FaxToMailUIAction<A> createUIAction(AbstractButton abstractButton,
- A logicAction) {
-
- // create ui action
- FaxToMailUIAction<A> result = new FaxToMailUIAction<A>(abstractButton,
- logicAction);
- return result;
- }
-
- public static <A extends AbstractFaxToMailAction> A createLogicAction(AbstractFaxToMailUIHandler handler,
- Class<A> actionName) {
- try {
-
- if (AbstractMainUIFaxToMailAction.class.isAssignableFrom(actionName) &&
- handler.getContext().getMainUI() != null) {
- handler = handler.getContext().getMainUI().getHandler();
- }
-
- // create action
- A result = ConstructorUtils.invokeConstructor(actionName, handler);
- return result;
- } catch (Exception e) {
- throw new FaxToMailTechnicalException(_("faxtomail.action.create.error", actionName), e);
- }
- }
-
- public static <A extends AbstractFaxToMailAction> A getLogicAction(AbstractButton b) {
- Action action = b.getAction();
- Preconditions.checkNotNull(action);
- Preconditions.checkState(action instanceof FaxToMailUIAction);
- return ((FaxToMailUIAction<A>) action).getLogicAction();
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionSwingWorker.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionSwingWorker.java 2014-02-05 18:34:13 UTC (rev 4)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionSwingWorker.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,161 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.action;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.swing.*;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.Timer;
-import java.util.TimerTask;
-
-/**
- * Worker to execute logic action.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0.3
- */
-public class FaxToMailActionSwingWorker<A extends AbstractFaxToMailAction> extends SwingWorker<Void, String> {
-
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(FaxToMailActionSwingWorker.class);
-
- /**
- * Timer used to launch timerTask (to open load dialog).
- *
- * @since 1.0.2
- */
- private static final Timer t = new Timer();
-
- protected final FaxToMailActionUI actionUI;
-
- protected final A action;
-
- protected Throwable error;
-
- protected TimerTask timer;
-
- protected FaxToMailActionSwingWorker(A action) {
-
- this.action = action;
- this.actionUI = action.getContext().getActionUI();
- }
-
- public Throwable getError() {
- return error;
- }
-
- public boolean isFailed() {
- return error != null;
- }
-
- @Override
- protected Void doInBackground() throws Exception {
-
- if (!isCancelled()) {
-
- timer = new FaxToMailActionTimerTask();
-
- t.schedule(timer, 1000);
-
- try {
-
- action.doAction();
-
- } catch (Throwable e) {
- if (log.isErrorEnabled()) {
- log.error("Task [" + this + "] Error while doAction: ", e);
- }
- error = e;
- } finally {
- if (log.isDebugEnabled()) {
- log.debug("Task [" + this + "] done");
- }
- }
- }
- return null;
- }
-
- @Override
- protected void done() {
- super.done();
-
- if (log.isDebugEnabled()) {
- log.debug("Task [" + this + "] execute done method after all");
- }
-
- if (error == null) {
-
- // success hook
- action.postSuccessAction();
- } else {
-
- // fail hook
- action.postFailedAction(error);
- }
-
- action.releaseAction();
-
- if (timer != null) {
-
- timer.cancel();
- }
-
- actionUI.close();
-
- updateBusyState(false);
- }
-
- protected void updateBusyState(boolean busy) {
-
- boolean hideBody = action.isHideBody();
-
- action.getContext().setBusy(busy);
-
- if (hideBody) {
- action.getContext().setHideBody(!busy);
- }
-
- }
-
- protected class FaxToMailActionTimerTask extends TimerTask {
-
- public FaxToMailActionTimerTask() {
- action.addPropertyChangeListener(AbstractFaxToMailAction.PROPERTY_DONE, new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
-
- if (actionUI.isVisible()) {
- actionUI.close();
- }
-
- // we do NOT want the timer to wake up then the actionUI dialog
- cancel();
- }
- });
- }
-
- @Override
- public void run() {
- if (isCancelled() || isDone()) {
-
- if (log.isDebugEnabled()) {
- log.debug("Task [" + action + "] was already canceled or done, do nothing");
- }
- } else {
-
- if (log.isDebugEnabled()) {
- log.debug("Task [" + action + "] is started, show waiting dialog");
- }
-
- SwingUtilities.invokeLater(new Runnable() {
- @Override
- public void run() {
- actionUI.open(action);
- }
- });
- }
- }
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUI.css 2014-02-05 18:34:13 UTC (rev 4)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUI.css 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,45 +0,0 @@
-
-#busyBlockLayerUI {
- useIcon:false;
- blockingColor: {handler.getConfig().getColorBlockingLayer()};
- block:{true};
-}
-
-#globalPanel {
- border: {new TitledBorder((String) null)};
-}
-
-#globalActionLabel {
- border: {new EmptyBorder(5, 5, 5, 5)};
-}
-
-#globalProgressBar {
- indeterminate: true;
-}
-
-#taskPanel {
- visible: false;
- border: {new TitledBorder((String) null)};
-}
-
-#taskProgressBar {
- indeterminate: false;
-}
-
-#taskActionLabel {
- border: {new EmptyBorder(5, 5, 5, 5)};
-}
-
-#informationPanel {
- visible: false;
- border: {new TitledBorder((String) null)};
-}
-
-#informationLabel {
- border: {new EmptyBorder(5, 5, 5, 5)};
-}
-
-#okAction {
- actionIcon: information;
- text: "faxtomail.action.ok";
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUI.jaxx 2014-02-05 18:34:13 UTC (rev 4)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUI.jaxx 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,59 +0,0 @@
-<JDialog width='300' height='200' modal='true'
- undecorated='true'
- implements='com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI<FaxToMailActionUIModel, FaxToMailActionUIHandler>'>
- <import>
-
- com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI
- com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
-
- jaxx.runtime.swing.BlockingLayerUI
-
- javax.swing.border.EmptyBorder
- </import>
-
- <script><![CDATA[
-
- public FaxToMailActionUI(JFrame frame, FaxToMailUIContext context) {
- super(frame, true);
- FaxToMailActionUIHandler handler = new FaxToMailActionUIHandler(context, this);
- setContextValue(handler);
- handler.beforeInitUI();
- }
-
- public void open(AbstractFaxToMailAction action) {
- getModel().setAction(action);
- }
-
- public void close() {
- getModel().clear();
- }
-
- protected void $afterCompleteSetup() {
- handler.afterInitUI();
- }
- ]]></script>
-
-
- <BlockingLayerUI id='busyBlockLayerUI'/>
-
- <FaxToMailActionUIHandler id='handler'
- initializer='getContextValue(FaxToMailActionUIHandler.class)'/>
-
- <FaxToMailActionUIModel id='model'
- initializer='getContextValue(FaxToMailActionUIModel.class)'/>
-
- <JPanel id='rootPanel' layout='{new BorderLayout()}'
- constraints='BorderLayout.CENTER' decorator='boxed'>
- <JPanel id='globalPanel' constraints='BorderLayout.NORTH'
- layout='{new BorderLayout()}'>
- <JLabel id='globalActionLabel' constraints='BorderLayout.CENTER'/>
- <JProgressBar id='globalProgressBar' constraints='BorderLayout.SOUTH'/>
- </JPanel>
- <JPanel id='taskPanel' constraints='BorderLayout.CENTER'
- layout='{new BorderLayout()}'>
- <JLabel id='taskActionLabel' constraints='BorderLayout.CENTER'/>
- <JProgressBar id='taskProgressBar' constraints='BorderLayout.SOUTH'/>
- </JPanel>
- </JPanel>
-
-</JDialog>
\ No newline at end of file
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIHandler.java 2014-02-05 18:34:13 UTC (rev 4)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUIHandler.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,251 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.action;
-
-import com.franciaflex.faxtomail.persistence.ProgressionModel;
-import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import com.franciaflex.faxtomail.ui.swing.content.MainUI;
-import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
-import jaxx.runtime.SwingUtil;
-import jaxx.runtime.swing.StatusMessagePanel;
-import jaxx.runtime.validator.swing.SwingValidator;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.ComponentAdapter;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import static org.nuiton.i18n.I18n._;
-
-/**
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public class FaxToMailActionUIHandler extends AbstractFaxToMailUIHandler<FaxToMailActionUIModel, FaxToMailActionUI> {
-
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(FaxToMailActionUIHandler.class);
-
- public FaxToMailActionUIHandler(FaxToMailUIContext context, FaxToMailActionUI ui) {
- super(context, ui);
- }
-
- protected PropertyChangeListener progressionListener = new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
-
- String propertyName = evt.getPropertyName();
- if (ProgressionModel.PROPERTY_MESSAGE.equals(propertyName)) {
-
- // change message
- String newMessage = (String) evt.getNewValue();
- ui.getTaskActionLabel().setText("<html><body>" + newMessage + "</body></html>");
- ui.pack();
- } else if (ProgressionModel.PROPERTY_TOTAL.equals(propertyName)) {
-
- // change total progressbar max
- ui.getTaskProgressBar().setMaximum((Integer) evt.getNewValue());
-
- } else if (ProgressionModel.PROPERTY_CURRENT.equals(propertyName)) {
-
- // change value of progress bar
- ui.getTaskProgressBar().setValue((Integer) evt.getNewValue());
- }
- }
- };
-
- protected ComponentListener listener = new ComponentAdapter() {
- boolean moving;
-
- boolean resizing;
-
- @Override
- public void componentMoved(ComponentEvent e) {
-
- MainUI mainUI = (MainUI) e.getSource();
-
- if (!moving && mainUI.isShowing()) {
-
- moving = true;
- try {
- setLocation(mainUI);
- } finally {
- moving = false;
- }
- }
- }
-
- @Override
- public void componentResized(ComponentEvent e) {
-
- MainUI mainUI = (MainUI) e.getSource();
-
- if (!resizing && mainUI.isShowing()) {
-
- resizing = true;
- try {
- setSize(mainUI);
- } finally {
- resizing = false;
- }
- }
- }
- };
-
- //------------------------------------------------------------------------//
- //-- AbstractTuttiUIHandler methods --//
- //------------------------------------------------------------------------//
-
- @Override
- public void beforeInitUI() {
- FaxToMailActionUIModel model = new FaxToMailActionUIModel();
- ui.setContextValue(model);
-
- model.addPropertyChangeListener(FaxToMailActionUIModel.PROPERTY_ACTION, new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
-
- // udpate global label
- AbstractFaxToMailAction action = (AbstractFaxToMailAction) evt.getNewValue();
-
- if (log.isDebugEnabled()) {
- log.debug("Action to use: " + action);
- }
- if (action == null) {
-
- // stoping action
- hideAction();
- } else {
-
- // starting action
- showAction(action);
- }
- }
- });
-
- model.addPropertyChangeListener(FaxToMailActionUIModel.PROPERTY_PROGRESSION_MODEL, new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
-
- // change progression model
-
- ProgressionModel oldValue = (ProgressionModel) evt.getOldValue();
- ProgressionModel newValue = (ProgressionModel) evt.getNewValue();
-
- if (log.isDebugEnabled()) {
- log.debug("progression model: " + newValue);
- }
- if (oldValue != null) {
- oldValue.removePropertyChangeListener(progressionListener);
- }
-
- if (newValue == null) {
-
- // remove progression model
- ui.getTaskPanel().setVisible(false);
- } else {
-
- // use progression model
- ui.getTaskPanel().setVisible(true);
-
- newValue.addPropertyChangeListener(progressionListener);
- }
- }
- });
- }
-
- @Override
- public void afterInitUI() {
-
- initUI(ui);
-
- // installation layer de blocage en mode busy
- SwingUtil.setLayerUI(ui.getRootPanel(), ui.getBusyBlockLayerUI());
-
- ui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
- }
-
- @Override
- protected JComponent getComponentToFocus() {
- return null;
- }
-
- @Override
- public void onCloseUI() {
-
- }
-
- @Override
- public SwingValidator<FaxToMailActionUIModel> getValidator() {
- return null;
- }
-
- //------------------------------------------------------------------------//
- //-- Internal methods --//
- //------------------------------------------------------------------------//
-
- protected void hideAction() {
- ui.setVisible(false);
- }
-
- protected void showAction(AbstractFaxToMailAction action) {
- ui.setTitle(_("faxtomail.main.title.action",
-// getConfig().getVersion(),
- "0.1",
- action.getActionDescription()));
- ui.getGlobalActionLabel().setText(
- _("faxtomail.message.action.running",
- action.getActionDescription()));
- ui.pack();
-
- MainUI mainUI = getContext().getMainUI();
- if (mainUI != null) {
- mainUI.addComponentListener(listener);
-
- setLocation(mainUI);
- setSize(mainUI);
- }
- try {
- ui.setVisible(true);
- } finally {
- if (mainUI != null) {
- mainUI.removeComponentListener(listener);
- }
- }
- }
-
- protected void setLocation(MainUI mainUI) {
- Container component = mainUI.getBody();
- StatusMessagePanel status = mainUI.getStatus();
- int width = component == null ? 0 : component.getWidth();
- int height = component == null ? 0 : component.getHeight() + status.getHeight();
-
- int x;
- int y;
- if (height == 0) {
- x = mainUI.getX() + 5;
- y = mainUI.getY() + 15;
- } else {
- x = mainUI.getX() + (mainUI.getWidth() - width);
- y = mainUI.getY() + (mainUI.getHeight() - height);
- }
- ui.setLocation(x, y);
- }
-
- protected void setSize(MainUI mainUI) {
- // Better to let his own size to the action progress bar
- // see http://forge.codelutin.com/issues/3263
-// Container component = mainUI.getBody();
-// int width = component == null ? 0 : component.getWidth();
-
- ui.pack();
-
-// if (width != 0 && ui.getWidth() < width) {
-// ui.setSize(width, ui.getHeight());
-// }
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIModel.java 2014-02-05 18:34:13 UTC (rev 4)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUIModel.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,51 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.action;
-
-import com.franciaflex.faxtomail.persistence.ProgressionModel;
-import com.google.common.base.Preconditions;
-import org.jdesktop.beans.AbstractSerializableBean;
-
-/**
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public class FaxToMailActionUIModel extends AbstractSerializableBean {
-
- private static final long serialVersionUID = 1L;
-
- public static final String PROPERTY_ACTION = "action";
-
- public static final String PROPERTY_PROGRESSION_MODEL = "progressionModel";
-
- protected AbstractFaxToMailAction action;
-
- protected ProgressionModel progressionModel;
-
- public ProgressionModel getProgressionModel() {
- return progressionModel;
- }
-
- public void setProgressionModel(ProgressionModel progressionModel) {
- Object oldValue = getProgressionModel();
- this.progressionModel = progressionModel;
- firePropertyChange(PROPERTY_PROGRESSION_MODEL, oldValue, progressionModel);
- }
-
- public AbstractFaxToMailAction getAction() {
- return action;
- }
-
- public void setAction(AbstractFaxToMailAction action) {
- Preconditions.checkNotNull(action, "action can not be null");
- Object oldValue = getAction();
- this.action = action;
- firePropertyChange(PROPERTY_ACTION, oldValue, action);
- }
-
- public void clear() {
-// setProgressionModel(null);
-
- Object oldValue = getAction();
- action = null;
- firePropertyChange(PROPERTY_ACTION, oldValue, null);
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailUIAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailUIAction.java 2014-02-05 18:34:13 UTC (rev 4)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailUIAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,201 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.action;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.util.TimeLog;
-
-import javax.swing.*;
-import java.awt.event.ActionEvent;
-import java.util.concurrent.CancellationException;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * Abstract FaxToMail ui action which launch a {@link AbstractFaxToMailAction}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0.2
- */
-public class FaxToMailUIAction<A extends AbstractFaxToMailAction> extends AbstractAction {
-
- private static final long serialVersionUID = 1L;
-
- /** Logger. */
- private static final Log log = LogFactory.getLog(FaxToMailUIAction.class);
-
- private static final TimeLog TIME_LOG = new TimeLog(FaxToMailUIAction.class);
-
- public static final ExecutorService waitingThread =
- Executors.newSingleThreadExecutor();
-
- private static final String LOGIC_ACTION = "logicAction";
-
- private final Object lock = new Object();
-
- private boolean wait;
-
- private long t0;
-
- public FaxToMailUIAction(AbstractButton button, A action) {
-
- putValue(LOGIC_ACTION, action);
-
- // fill the ui action from the button
- setActionKey(action.getClass().getName());
- if (button != null) {
- setActionIcon(button.getIcon());
- setActionName(button.getText());
- setActionDescription(button.getToolTipText());
- setActionMnemonic(button.getMnemonic());
- }
- }
-
- public void launchActionAndWait() {
- wait = true;
- actionPerformed(null);
- lock();
- }
-
-
- @Override
- public final void actionPerformed(final ActionEvent event) {
-
- t0 = TimeLog.getTime();
-
- if (log.isInfoEnabled()) {
- log.info("Task [" + getLogicAction().getClass().getSimpleName() + "] starting");
- }
-
- // prepare action
- boolean doAction;
-
- A action = getLogicAction();
-
- // reset status message
-// action.sendMessage("");
-
- try {
- doAction = action.prepareAction();
- } catch (Exception e) {
- action.releaseAction();
- throw FaxToMailActionException.propagateError(action, e);
- }
-
- if (doAction) {
-
- final FaxToMailActionSwingWorker<A> worker =
- new FaxToMailActionSwingWorker<A>(action);
-
- SwingUtilities.invokeLater(new Runnable() {
- @Override
- public void run() {
-
- // make ui busy
- worker.updateBusyState(true);
-
- }
- });
-
- if (log.isDebugEnabled()) {
- log.debug("Before execute of action " + action);
- }
-
- // perform and release action
- worker.execute();
-
- // wait until action is done
- waitingThread.execute(
- new Runnable() {
- @Override
- public void run() {
-
- A action = getLogicAction();
- try {
- try {
- worker.get();
- } catch (ExecutionException e) {
- // don't care .
- } catch (CancellationException e) {
- // dont care ?
- } catch (InterruptedException e) {
- // don't care ?
- }
- if (log.isDebugEnabled()) {
- log.debug("After execute of action " + action + " (worker done? " + worker.isDone() + ")");
- }
-
- if (worker.isFailed()) {
-
- throw FaxToMailActionException.propagateError(action, worker.getError());
- }
- } finally {
- unlock();
- }
- }
- }
- );
-
- } else {
-
- try {
- // release action
- action.releaseAction();
-
- } finally {
- unlock();
- }
- }
- }
-
- public void setActionIcon(Icon actionIcon) {
- putValue(SMALL_ICON, actionIcon);
- putValue(LARGE_ICON_KEY, actionIcon);
- }
-
- public void setActionKey(String actionKey) {
- putValue(ACTION_COMMAND_KEY, actionKey);
- }
-
- public void setActionName(String actionName) {
- putValue(NAME, actionName);
- }
-
- public void setActionDescription(String actionDescription) {
- putValue(SHORT_DESCRIPTION, actionDescription);
- getLogicAction().setActionDescription(actionDescription);
- }
-
- public void setActionMnemonic(int key) {
- putValue(MNEMONIC_KEY, key);
- }
-
- public A getLogicAction() {
- return (A) getValue(LOGIC_ACTION);
- }
-
- protected void lock() {
- if (wait) {
- synchronized (lock) {
- try {
-
- lock.wait();
-
- } catch (InterruptedException e) {
- throw FaxToMailActionException.propagateError(getLogicAction(), e);
- } finally {
- wait = false;
- }
- }
- }
- }
-
- protected void unlock() {
- TIME_LOG.log(t0, "Task [" + getLogicAction().getClass().getSimpleName() + "] End");
- if (wait) {
- synchronized (lock) {
- lock.notifyAll();
- }
- }
- }
-}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GoToPreviousScreenAction.java (from rev 6, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/GoToPreviousScreenAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GoToPreviousScreenAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GoToPreviousScreenAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,22 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+
+import static org.nuiton.i18n.I18n.t;
+
+/**
+ * To return on previous screen.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.1
+ */
+public class GoToPreviousScreenAction extends AbstractChangeScreenAction {
+
+ public GoToPreviousScreenAction(MainUIHandler handler) {
+ super(handler,
+ true,
+ PREVIOUS_SCREEN.getContextValue(handler.getUI())
+ );
+ setActionDescription(t("faxtomail.main.action.goto.previousScreen.tip"));
+ }
+}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ReloadFaxToMailAction.java (from rev 6, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ReloadFaxToMailAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ReloadFaxToMailAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ReloadFaxToMailAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,28 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.ui.swing.RunFaxToMail;
+import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+
+import static org.nuiton.i18n.I18n.t;
+
+/**
+ * To reload FaxToMail application.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.3
+ */
+public class ReloadFaxToMailAction extends AbstractChangeScreenAction {
+
+ public ReloadFaxToMailAction(MainUIHandler handler) {
+ super(handler, true, null);
+ setActionDescription(t("faxtomail.main.action.reloadFaxToMail"));
+ }
+
+ @Override
+ public void doAction() throws Exception {
+
+ // Close the application, will exit and restart application
+ RunFaxToMail.closeFaxToMail(getHandler(), RunFaxToMail.UPATE_EXIT_CODE);
+ }
+
+}
\ No newline at end of file
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowConfigAction.java (from rev 2, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowConfigAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowConfigAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowConfigAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,17 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
+import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+
+/**
+ * To show config screen.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.1
+ */
+public class ShowConfigAction extends AbstractChangeScreenAction {
+
+ public ShowConfigAction(MainUIHandler handler) {
+ super(handler, true, FaxToMailScreen.CONFIG);
+ }
+}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java (from rev 2, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowDemandeAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,17 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
+import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+
+/**
+ * To show demande screen.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.1
+ */
+public class ShowDemandeAction extends AbstractChangeScreenAction {
+
+ public ShowDemandeAction(MainUIHandler handler) {
+ super(handler, true, FaxToMailScreen.DEMANDE);
+ }
+}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeListAction.java (from rev 2, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowDemandeListAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeListAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeListAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,17 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
+import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+
+/**
+ * To show demande screen.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.1
+ */
+public class ShowDemandeListAction extends AbstractChangeScreenAction {
+
+ public ShowDemandeListAction(MainUIHandler handler) {
+ super(handler, true, FaxToMailScreen.LIST);
+ }
+}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowRechercheAction.java (from rev 2, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowRechercheAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowRechercheAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowRechercheAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,17 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
+import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+
+/**
+ * To show demande screen.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.1
+ */
+public class ShowRechercheAction extends AbstractChangeScreenAction {
+
+ public ShowRechercheAction(MainUIHandler handler) {
+ super(handler, true, FaxToMailScreen.SEARCH);
+ }
+}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/StartAction.java (from rev 6, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/StartAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/StartAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,88 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Start action (when the start action file is present when
+ * starting application).
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.4
+ */
+public class StartAction extends AbstractMainUIFaxToMailAction {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(StartAction.class);
+
+ protected AbstractMainUIFaxToMailAction delegateAction;
+
+ public StartAction(MainUIHandler handler) {
+ super(handler, true);
+ }
+
+ @Override
+ public boolean prepareAction() throws Exception {
+
+// File actionfile = getConfig().getStartActionFile();
+ boolean doAction = false;//actionfile.exists();
+
+ if (doAction) {
+
+ try {
+ // get action to execute
+// String content = FaxToMailIOUtil.readContent(actionfile, _("faxtomail.error.read.startActionFile", actionfile));
+// content = content.trim();
+
+// if (InstallDbAction.class.getName().equals(content)) {
+//
+// // install db
+// delegateAction = TuttiActionHelper.createLogicAction(getHandler(), InstallDbAction.class);
+//
+// if (log.isInfoEnabled()) {
+// log.info("Found install db action");
+// }
+// } else if (content.startsWith(ImportDbAction.class.getName())) {
+//
+// // import db
+// ImportDbAction action = TuttiActionHelper.createLogicAction(getHandler(), ImportDbAction.class);
+// File importFile = new File(content.substring(ImportDbAction.class.getName().length() + 1));
+// action.setImportFile(importFile);
+// delegateAction = action;
+// if (log.isInfoEnabled()) {
+// log.info("Found import db action (with file " + importFile + ")");
+// }
+// } else {
+ doAction = false;
+// }
+
+ } finally {
+
+ // delete start action file
+// FaxToMailIOUtil.deleteFile(
+// actionfile,
+// _("faxtomail.error.delete.startActionFile", actionfile));
+ }
+ }
+
+
+ if (doAction) {
+ setActionDescription(delegateAction.getActionDescription());
+ doAction = delegateAction.prepareAction();
+ }
+ return doAction;
+ }
+
+ @Override
+ public void doAction() throws Exception {
+
+ getActionEngine().runInternalAction(delegateAction);
+ }
+
+ @Override
+ protected void releaseAction() {
+ delegateAction = null;
+ super.releaseAction();
+ }
+}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractChangeScreenAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractChangeScreenAction.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractChangeScreenAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,93 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.content;
-
-import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
-import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import jaxx.runtime.SwingUtil;
-import jaxx.runtime.context.JAXXContextEntryDef;
-
-/**
- * Action to change the screen.
- * <p/>
- * Will just check that the current screen can be quit via
- * the {@link MainUIHandler#quitCurrentScreen()}.
- * <p/>
- *
- * @author kmorin <kmorin(a)codelutin.com>
- * @since 1.0
- */
-public abstract class AbstractChangeScreenAction extends AbstractMainUIFaxToMailAction {
-
- /**
- * Context entry to keep previous screen.
- *
- * @since 1.1
- */
- protected static final JAXXContextEntryDef<FaxToMailScreen> PREVIOUS_SCREEN =
- SwingUtil.newContextEntryDef("previousScreen", FaxToMailScreen.class);
-
- /**
- * Screen where to go.
- *
- * @since 1.0
- */
- protected FaxToMailScreen screen;
-
- /**
- * Flag to skip the check of current screen.
- *
- * @since 1.1
- */
- protected boolean skipCheckCurrentScreen;
-
- protected AbstractChangeScreenAction(MainUIHandler handler,
- boolean hideBody,
- FaxToMailScreen screen) {
- super(handler, hideBody);
- this.screen = screen;
- }
-
- public void setSkipCheckCurrentScreen(boolean skipCheckCurrentScreen) {
- this.skipCheckCurrentScreen = skipCheckCurrentScreen;
- }
-
- protected void setScreen(FaxToMailScreen screen) {
- this.screen = screen;
- }
-
- @Override
- public boolean prepareAction() throws Exception {
- boolean result = super.prepareAction();
- result &= skipCheckCurrentScreen || getHandler().quitCurrentScreen();
- return result;
- }
-
- @Override
- public void doAction() throws Exception {
-
- FaxToMailUIContext context = getContext();
-
- FaxToMailScreen previousScreen = context.getScreen();
- if (getUI() != null) {
- if (previousScreen == null) {
- PREVIOUS_SCREEN.removeContextValue(getUI());
- } else {
- PREVIOUS_SCREEN.setContextValue(getUI(), previousScreen);
- }
- }
-
- // clean current screen
- context.setScreen(null);
-
- // change screen
- context.setScreen(screen);
- }
-
- @Override
- public void postFailedAction(Throwable error) {
- if (error != null) {
-
-// getContext().setFallBackScreen();
- }
- }
-
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractMainUIFaxToMailAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractMainUIFaxToMailAction.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractMainUIFaxToMailAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,16 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.content;
-
-import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import com.franciaflex.faxtomail.ui.swing.action.AbstractFaxToMailAction;
-
-/**
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public abstract class AbstractMainUIFaxToMailAction extends AbstractFaxToMailAction<FaxToMailUIContext, MainUI, MainUIHandler> {
-
- protected AbstractMainUIFaxToMailAction(MainUIHandler handler,
- boolean hideBody) {
- super(handler, hideBody);
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/CloseApplicationAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/CloseApplicationAction.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/CloseApplicationAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,41 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.content;
-
-import com.franciaflex.faxtomail.ui.swing.RunFaxToMail;
-
-import static org.nuiton.i18n.I18n.t;
-
-/**
- * To close FaxToMail Application.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.1
- */
-public class CloseApplicationAction extends AbstractChangeScreenAction {
-
- protected int exitCode = RunFaxToMail.NORMAL_EXIT_CODE;
-
- public CloseApplicationAction(MainUIHandler handler) {
- super(handler, false, null);
- setSkipCheckCurrentScreen(true);
- setActionDescription(t("faxtomail.main.action.exit.tip"));
- }
-
- public void setExitCode(int exitCode) {
- this.exitCode = exitCode;
- }
-
- @Override
- public void doAction() throws Exception {
-
- super.doAction();
-
- RunFaxToMail.closeFaxToMail(getHandler(), exitCode);
- }
-
-
- @Override
- public void releaseAction() {
- exitCode = RunFaxToMail.NORMAL_EXIT_CODE;
- super.releaseAction();
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/GoToPreviousScreenAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/GoToPreviousScreenAction.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/GoToPreviousScreenAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,20 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.content;
-
-import static org.nuiton.i18n.I18n.t;
-
-/**
- * To return on previous screen.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.1
- */
-public class GoToPreviousScreenAction extends AbstractChangeScreenAction {
-
- public GoToPreviousScreenAction(MainUIHandler handler) {
- super(handler,
- true,
- PREVIOUS_SCREEN.getContextValue(handler.getUI())
- );
- setActionDescription(t("faxtomail.main.action.goto.previousScreen.tip"));
- }
-}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.css 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.css 2014-02-06 16:42:22 UTC (rev 7)
@@ -24,7 +24,7 @@
toolTipText: "faxtomail.main.action.demandeList.tip";
i18nMnemonic: "faxtomail.main.action.demandeList.mnemonic";
enabled: true;//{model.getScreen() != TuttiScreen.LIST};
- _tuttiAction: {ShowDemandeListAction.class};
+ _applicationAction: {com.franciaflex.faxtomail.ui.swing.actions.ShowDemandeListAction.class};
}
#menuFileRecherche {
@@ -32,7 +32,7 @@
toolTipText: "faxtomail.main.action.recherche.tip";
i18nMnemonic: "faxtomail.main.action.recherche.mnemonic";
enabled: true;
- _tuttiAction: {ShowRechercheAction.class};
+ _applicationAction: {com.franciaflex.faxtomail.ui.swing.actions.ShowRechercheAction.class};
}
#menuFileConfiguration {
@@ -41,7 +41,7 @@
toolTipText: "faxtomail.main.action.configuration.tip";
i18nMnemonic: "faxtomail.main.action.configuration.mnemonic";
enabled: true;//{model.getScreen() != TuttiScreen.CONFIG};
- _tuttiAction: {ShowConfigAction.class};
+ _applicationAction: {com.franciaflex.faxtomail.ui.swing.actions.ShowConfigAction.class};
_help: {"faxtomail.main.menu.action.configuration.help"};
}
@@ -50,7 +50,7 @@
text: "faxtomail.main.action.exit";
toolTipText: "faxtomail.main.action.exit.tip";
i18nMnemonic: "faxtomail.main.action.exit.mnemonic";
- _tuttiAction: {CloseApplicationAction.class};
+ _applicationAction: {com.franciaflex.faxtomail.ui.swing.actions.CloseApplicationAction.class};
_help: {"faxtomail.main.menu.action.exit.help"};
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.jaxx 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.jaxx 2014-02-06 16:42:22 UTC (rev 7)
@@ -4,6 +4,8 @@
<import>
com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
+ com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil
+ com.franciaflex.faxtomail.ui.swing.actions.*
org.jdesktop.swingx.JXTitledPanel
@@ -13,21 +15,11 @@
<FaxToMailUIContext id='model'
initializer='getContextValue(FaxToMailUIContext.class)'/>
- <MainUIHandler id='handler'
- initializer='getContextValue(MainUIHandler.class)'/>
-
<script><![CDATA[
public MainUI(FaxToMailUIContext context) {
- setContextValue(context);
- MainUIHandler handler = new MainUIHandler(context, this);
- setContextValue(handler);
- handler.beforeInitUI();
+ FaxToMailUIUtil.setApplicationContext(this, context);
}
-
- protected void $afterCompleteSetup() {
- handler.afterInitUI();
- }
]]></script>
<!-- menu -->
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -11,7 +11,6 @@
import com.franciaflex.faxtomail.ui.swing.util.CloseableUI;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI;
import com.franciaflex.faxtomail.ui.swing.util.RemoveablePropertyChangeListener;
-import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionUI;
import com.google.common.base.Preconditions;
import jaxx.runtime.JAXXBinding;
import jaxx.runtime.SwingUtil;
@@ -19,6 +18,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.i18n.I18n;
+import org.nuiton.jaxx.application.swing.action.ApplicationActionUI;
import javax.swing.Icon;
import javax.swing.JComponent;
@@ -43,26 +43,17 @@
protected JComponent currentBody;
-// protected PersistenceService persistenceService;
-
- protected MainUIHandler(FaxToMailUIContext context, MainUI ui) {
- super(context, ui);
-// this.persistenceService = context.getPersistenceService();
- context.setMainUI(ui);
- context.setActionUI(new FaxToMailActionUI(ui, context));
- }
-
- public MainUIHandler(FaxToMailUIContext context) {
- super(context, null);
-// this.persistenceService = null;
- }
-
//------------------------------------------------------------------------//
//-- AbstractTuttiUIHandler methods --//
//------------------------------------------------------------------------//
@Override
- public void beforeInitUI() {
+ public void beforeInit(MainUI ui) {
+ super.beforeInit(ui);
+ FaxToMailUIContext context = getContext();
+ ui.setContextValue(context);
+ context.setMainUI(ui);
+ context.setActionUI(new ApplicationActionUI(ui, context));
context.addPropertyChangeListener(new RemoveablePropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
@@ -114,7 +105,7 @@
}
@Override
- public void afterInitUI() {
+ public void afterInit(MainUI ui) {
initUI(ui);
@@ -137,37 +128,7 @@
// JToolBar bar = ui.getBottomBar();
// ui.getStatus().addWidget(bar, 0);
-// if (context.isDbLoaded()) {
-//
-// // db already opened (happens when reloading ui)
-// // just go to select cruise screen
-// TuttiUIAction<SelectCruiseAction> uiAction = TuttiActionHelper.createUIAction(this, SelectCruiseAction.class);
-// SelectCruiseAction logicAction = uiAction.getLogicAction();
-// logicAction.setSkipCheckCurrentScreen(true);
-// logicAction.setActionDescription(ui.getMenuActionSelectCruise().getToolTipText());
-// uiAction.actionPerformed(null);
-//
-// } else {
-//
-// if (context.isDbExist()) {
-//
-// // open tutti db (using a fake button to have simple api)
-// TuttiUIAction<OpenDbAction> uiAction = TuttiActionHelper.createUIAction(this, OpenDbAction.class);
-// OpenDbAction logicAction = uiAction.getLogicAction();
-// logicAction.setSkipCheckCurrentScreen(true);
-// logicAction.setUpdateReferentiel(true);
-// uiAction.actionPerformed(null);
-//
-// } else {
-//
-// // clean db context
-// context.clearDbContext();
-//
-// // go to manage db screen (to install db)
-// context.setScreen(TuttiScreen.MANAGE_DB);
-// }
-// }
- context.setScreen(FaxToMailScreen.LIST);
+ getContext().setScreen(FaxToMailScreen.LIST);
}
@Override
@@ -178,6 +139,8 @@
@Override
public void onCloseUI() {
+ FaxToMailUIContext context = getContext();
+
// remove any screen
context.setScreen(null);
context.removeMessageNotifier(this);
@@ -240,8 +203,7 @@
getModel().setLocale(locale);
//
// // change i18n locale
-// I18n.setDefaultLocale(getConfig().getI18nLocale());
- I18n.setDefaultLocale(Locale.FRENCH);
+ I18n.setDefaultLocale(getConfig().getI18nLocale());
//
// // reload decorator service (TODO Check if this is necessary)
// getContext().reloadDecoratorService();
@@ -265,6 +227,11 @@
// getModel().showHelp(ui, ui.getBroker(), null);
// }
+ @Override
+ public final void showInformationMessage(String message) {
+ ui.getStatus().setStatus("<html><body>" + message + "</body></html>");
+ }
+
public void registerValidator(SwingValidator validator) {
// ui.getValidatorMessageWidget().registerValidator(validator);
}
@@ -277,7 +244,7 @@
public boolean quitCurrentScreen() {
boolean canClose;
- if (context.getScreen() == null || currentBody == null) {
+ if (getContext().getScreen() == null || currentBody == null) {
// no screen, surely can quit
canClose = true;
@@ -303,30 +270,6 @@
return canClose;
}
- public AbstractFaxToMailUIHandler getCurrentHandler() {
- FaxToMailUI<?, ?> body = (FaxToMailUI<?, ?>) currentBody;
- return body.getHandler();
- }
-
- /**
- * Reload the persistence service and set the new ne into the handler.
- *
- * @since 1.0
- */
- public void reloadPersistenceService() {
-// this.persistenceService = context.reloadPersistenceService();
- }
-
- /**
- * Get the persistence service instance used by the handler.
- *
- * @return the persistence service instance used by the handler
- * @since 1.0
- */
-// public PersistenceService getPersistenceService() {
-// return persistenceService;
-// }
-
//------------------------------------------------------------------------//
//-- Internal methods --//
//------------------------------------------------------------------------//
@@ -410,8 +353,8 @@
String title = getSelectedCruiseTitle();
ui.setTitle(t("faxtomail.main.title.application",
-// getConfig().getVersion(),
- "0.1",
+ getConfig().getVersion(),
+// "0.1",
title));
}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ReloadFaxToMailAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ReloadFaxToMailAction.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ReloadFaxToMailAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,27 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.content;
-
-import com.franciaflex.faxtomail.ui.swing.RunFaxToMail;
-
-import static org.nuiton.i18n.I18n.t;
-
-/**
- * To reload FaxToMail application.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0.3
- */
-public class ReloadFaxToMailAction extends AbstractChangeScreenAction {
-
- public ReloadFaxToMailAction(MainUIHandler handler) {
- super(handler, true, null);
- setActionDescription(t("faxtomail.main.action.reloadFaxToMail"));
- }
-
- @Override
- public void doAction() throws Exception {
-
- // Close the application, will exit and restart application
- RunFaxToMail.closeFaxToMail(getHandler(), RunFaxToMail.UPATE_EXIT_CODE);
- }
-
-}
\ No newline at end of file
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowConfigAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowConfigAction.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowConfigAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,16 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.content;
-
-import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
-
-/**
- * To show config screen.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.1
- */
-public class ShowConfigAction extends AbstractChangeScreenAction {
-
- public ShowConfigAction(MainUIHandler handler) {
- super(handler, true, FaxToMailScreen.CONFIG);
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowDemandeAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowDemandeAction.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowDemandeAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,16 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.content;
-
-import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
-
-/**
- * To show demande screen.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.1
- */
-public class ShowDemandeAction extends AbstractChangeScreenAction {
-
- public ShowDemandeAction(MainUIHandler handler) {
- super(handler, true, FaxToMailScreen.DEMANDE);
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowDemandeListAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowDemandeListAction.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowDemandeListAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,16 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.content;
-
-import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
-
-/**
- * To show demande screen.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.1
- */
-public class ShowDemandeListAction extends AbstractChangeScreenAction {
-
- public ShowDemandeListAction(MainUIHandler handler) {
- super(handler, true, FaxToMailScreen.LIST);
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowRechercheAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowRechercheAction.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowRechercheAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,18 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.content;
-
-import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
-import com.franciaflex.faxtomail.ui.swing.content.AbstractChangeScreenAction;
-import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
-
-/**
- * To show demande screen.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.1
- */
-public class ShowRechercheAction extends AbstractChangeScreenAction {
-
- public ShowRechercheAction(MainUIHandler handler) {
- super(handler, true, FaxToMailScreen.SEARCH);
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,91 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.content;
-
-import com.franciaflex.faxtomail.FaxToMailIOUtil;
-import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionHelper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.io.File;
-
-/**
- * Start action (when the start action file is present when
- * starting application).
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 2.4
- */
-public class StartAction extends AbstractMainUIFaxToMailAction {
-
- /** Logger. */
- private static final Log log = LogFactory.getLog(StartAction.class);
-
- protected AbstractMainUIFaxToMailAction delegateAction;
-
- public StartAction(MainUIHandler handler) {
- super(handler, true);
- }
-
- @Override
- public boolean prepareAction() throws Exception {
-
-// File actionfile = getConfig().getStartActionFile();
- boolean doAction = false;//actionfile.exists();
-
- if (doAction) {
-
- try {
- // get action to execute
-// String content = FaxToMailIOUtil.readContent(actionfile, _("faxtomail.error.read.startActionFile", actionfile));
-// content = content.trim();
-
-// if (InstallDbAction.class.getName().equals(content)) {
-//
-// // install db
-// delegateAction = TuttiActionHelper.createLogicAction(getHandler(), InstallDbAction.class);
-//
-// if (log.isInfoEnabled()) {
-// log.info("Found install db action");
-// }
-// } else if (content.startsWith(ImportDbAction.class.getName())) {
-//
-// // import db
-// ImportDbAction action = TuttiActionHelper.createLogicAction(getHandler(), ImportDbAction.class);
-// File importFile = new File(content.substring(ImportDbAction.class.getName().length() + 1));
-// action.setImportFile(importFile);
-// delegateAction = action;
-// if (log.isInfoEnabled()) {
-// log.info("Found import db action (with file " + importFile + ")");
-// }
-// } else {
- doAction = false;
-// }
-
- } finally {
-
- // delete start action file
-// FaxToMailIOUtil.deleteFile(
-// actionfile,
-// _("faxtomail.error.delete.startActionFile", actionfile));
- }
- }
-
-
- if (doAction) {
- setActionDescription(delegateAction.getActionDescription());
- doAction = delegateAction.prepareAction();
- }
- return doAction;
- }
-
- @Override
- public void doAction() throws Exception {
-
- FaxToMailActionHelper.runInternalAction(delegateAction);
- }
-
- @Override
- protected void releaseAction() {
- delegateAction = null;
- super.releaseAction();
- }
-}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUI.jaxx 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUI.jaxx 2014-02-06 16:42:22 UTC (rev 7)
@@ -4,29 +4,17 @@
<import>
com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI
+ com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil
</import>
<script><![CDATA[
- protected FaxToMailUIContext uiContext;
-
public FaxToMailConfigUI(FaxToMailUI parentUI) {
- JAXXUtil.initContext(this, parentUI);
- uiContext = parentUI.getHandler().getContext();
- FaxToMailConfigUIHandler handler =
- new FaxToMailConfigUIHandler(parentUI, this);
- setContextValue(handler);
- handler.beforeInitUI();
+ FaxToMailUIUtil.setParentUI(this, parentUI);
}
- protected void $afterCompleteSetup() {
- handler.afterInitUI();
- }
]]></script>
- <FaxToMailConfigUIHandler id='handler'
- initializer='getContextValue(FaxToMailConfigUIHandler.class)'/>
-
<FaxToMailUIContext id='model'
initializer='getContextValue(FaxToMailUIContext.class)'/>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUIHandler.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,10 +1,9 @@
package com.franciaflex.faxtomail.ui.swing.content.config;
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import com.franciaflex.faxtomail.ui.swing.content.ReloadFaxToMailAction;
+import com.franciaflex.faxtomail.ui.swing.actions.ReloadFaxToMailAction;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI;
-import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionHelper;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -28,23 +27,14 @@
public static final String CALLBACK_SHORTCUT = "shortcut";
- public FaxToMailConfigUIHandler(FaxToMailUI<?, ?> parentUI, FaxToMailConfigUI ui) {
- super(parentUI.getHandler().getContext(), ui);
- }
-
@Override
public SwingValidator<FaxToMailUIContext> getValidator() {
return null;
}
@Override
- public void beforeInitUI() {
+ public void afterInit(FaxToMailConfigUI faxToMailConfigUI) {
- }
-
- @Override
- public void afterInitUI() {
-
initUI(ui);
// FaxToMailApplicationConfig config = getConfig();
@@ -165,8 +155,8 @@
}
protected void reloadApplication() {
- ReloadFaxToMailAction action = FaxToMailActionHelper.createLogicAction(this, ReloadFaxToMailAction.class);
- FaxToMailActionHelper.runAction(action);
+ ReloadFaxToMailAction action = getContext().getActionFactory().createLogicAction(this, ReloadFaxToMailAction.class);
+ getContext().getActionEngine().runAction(action);
// TuttiActionHelper.runActionAndWait(this, ReloadTuttiAction.class);
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx 2014-02-06 16:42:22 UTC (rev 7)
@@ -4,6 +4,7 @@
<import>
com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI
+ com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil
com.franciaflex.faxtomail.ui.swing.util.Label
jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
@@ -13,25 +14,12 @@
<script><![CDATA[
- protected FaxToMailUIContext uiContext;
-
public DemandeListUI(FaxToMailUI parentUI) {
- JAXXUtil.initContext(this, parentUI);
- uiContext = parentUI.getHandler().getContext();
- DemandeListUIHandler handler =
- new DemandeListUIHandler(parentUI, this);
- setContextValue(handler);
- handler.beforeInitUI();
+ FaxToMailUIUtil.setParentUI(this, parentUI);
}
- protected void $afterCompleteSetup() {
- handler.afterInitUI();
- }
]]></script>
- <DemandeListUIHandler id='handler'
- initializer='getContextValue(DemandeListUIHandler.class)'/>
-
<DemandeListUIModel id='model'
initializer='getContextValue(DemandeListUIModel.class)'/>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -24,11 +24,10 @@
* #L%
*/
-import com.franciaflex.faxtomail.ui.swing.content.ShowDemandeAction;
+import com.franciaflex.faxtomail.ui.swing.actions.ShowDemandeAction;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
import com.franciaflex.faxtomail.ui.swing.util.CloseableUI;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI;
-import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionHelper;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -77,22 +76,9 @@
// private final PersistenceService persistenceService;
- public DemandeListUIHandler(FaxToMailUI parentUi, DemandeListUI ui) {
- super(parentUi.getHandler().getContext(), ui);
-// persistenceService = context.getPersistenceService();
- }
-
-
@Override
- public void beforeInitUI() {
+ public void afterInit(DemandeListUI ui) {
-// getDataContext().resetValidationDataContext();
-
- }
-
- @Override
- public void afterInitUI() {
-
initUI(ui);
DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
@@ -131,7 +117,7 @@
public void mouseClicked(MouseEvent evt) {
JXTable table = (JXTable) evt.getSource();
if (evt.getClickCount() == 2) {
- FaxToMailActionHelper.runAction(new ShowDemandeAction(getContext().getMainUI().getHandler()));
+ getContext().getActionEngine().runAction(new ShowDemandeAction(getContext().getMainUI().getHandler()));
}
}
});
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-02-06 16:42:22 UTC (rev 7)
@@ -57,7 +57,7 @@
#backButton {
text: "faxtomail.demande.back.button.label";
- _tuttiAction: {com.franciaflex.faxtomail.ui.swing.content.ShowDemandeListAction.class};
+ _applicationAction: {com.franciaflex.faxtomail.ui.swing.actions.ShowDemandeListAction.class};
}
#saveButton {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx 2014-02-06 16:42:22 UTC (rev 7)
@@ -4,6 +4,7 @@
<import>
com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI
+ com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil
com.franciaflex.faxtomail.ui.swing.util.Label
jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
@@ -17,25 +18,12 @@
<script><![CDATA[
- protected FaxToMailUIContext uiContext;
-
public DemandeUI(FaxToMailUI parentUI) {
- JAXXUtil.initContext(this, parentUI);
- uiContext = parentUI.getHandler().getContext();
- DemandeUIHandler handler =
- new DemandeUIHandler(parentUI, this);
- setContextValue(handler);
- handler.beforeInitUI();
+ FaxToMailUIUtil.setParentUI(this, parentUI);
}
- protected void $afterCompleteSetup() {
- handler.afterInitUI();
- }
]]></script>
- <DemandeUIHandler id='handler'
- initializer='getContextValue(DemandeUIHandler.class)'/>
-
<DemandeUIModel id='model'
initializer='getContextValue(DemandeUIModel.class)'/>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -67,22 +67,9 @@
// private final PersistenceService persistenceService;
- public DemandeUIHandler(FaxToMailUI parentUi, DemandeUI ui) {
- super(parentUi.getHandler().getContext(), ui);
-// persistenceService = context.getPersistenceService();
- }
-
-
@Override
- public void beforeInitUI() {
+ public void afterInit(DemandeUI ui) {
-// getDataContext().resetValidationDataContext();
-
- }
-
- @Override
- public void afterInitUI() {
-
initUI(ui);
initBeanFilterableComboBox(ui.getDocTypeComboBox(), createLabelList("Commande", "SAV"), null);
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx 2014-02-06 16:42:22 UTC (rev 7)
@@ -4,6 +4,7 @@
<import>
com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI
+ com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil
com.franciaflex.faxtomail.ui.swing.util.Label
jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
@@ -14,25 +15,12 @@
<script><![CDATA[
- protected FaxToMailUIContext uiContext;
-
public SearchUI(FaxToMailUI parentUI) {
- JAXXUtil.initContext(this, parentUI);
- uiContext = parentUI.getHandler().getContext();
- SearchUIHandler handler =
- new SearchUIHandler(parentUI, this);
- setContextValue(handler);
- handler.beforeInitUI();
+ FaxToMailUIUtil.setParentUI(this, parentUI);
}
- protected void $afterCompleteSetup() {
- handler.afterInitUI();
- }
]]></script>
- <SearchUIHandler id='handler'
- initializer='getContextValue(SearchUIHandler.class)'/>
-
<SearchUIModel id='model'
initializer='getContextValue(SearchUIModel.class)'/>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -80,22 +80,9 @@
// private final PersistenceService persistenceService;
- public SearchUIHandler(FaxToMailUI parentUi, SearchUI ui) {
- super(parentUi.getHandler().getContext(), ui);
-// persistenceService = context.getPersistenceService();
- }
-
-
@Override
- public void beforeInitUI() {
+ public void afterInit(SearchUI ui) {
-// getDataContext().resetValidationDataContext();
-
- }
-
- @Override
- public void afterInitUI() {
-
initUI(ui);
initBeanFilterableComboBox(ui.getModifiedByComboBox(), createLabelList("Utilisateur A", "Utilisateur B", "Utilisateur C"), null);
Added: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailBeanUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailBeanUIModel.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailBeanUIModel.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,160 @@
+package com.franciaflex.faxtomail.ui.swing.util;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id: AbstractTuttiBeanUIModel.java 1564 2014-01-31 10:56:26Z tchemit $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/java… $
+ * %%
+ * Copyright (C) 2012 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.jdesktop.beans.AbstractSerializableBean;
+import org.nuiton.jaxx.application.listener.PropagatePropertyChangeListener;
+import org.nuiton.util.CollectionUtil;
+import org.nuiton.util.beans.Binder;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Abstract UI model to edit a bean.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public abstract class AbstractFaxToMailBeanUIModel<E, B extends AbstractFaxToMailBeanUIModel<E, B>> extends AbstractSerializableBean implements PropagatePropertyChangeListener.PropagatePropertyChange {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String PROPERTY_ID = "id";
+
+ public static final String PROPERTY_MODIFY = "modify";
+
+ public static final String PROPERTY_VALID = "valid";
+
+ protected String id;
+
+ protected boolean modify;
+
+ protected boolean valid;
+
+ private final Binder<E, B> fromBeanBinder;
+
+ private final Binder<B, E> toBeanBinder;
+
+ protected AbstractFaxToMailBeanUIModel(Binder<E, B> fromBeanBinder,
+ Binder<B, E> toBeanBinder) {
+ this.fromBeanBinder = fromBeanBinder;
+ this.toBeanBinder = toBeanBinder;
+ }
+
+ public void fromEntity(E entity) {
+ fromBean(entity);
+ }
+
+ public E toEntity() {
+ return toBean();
+ }
+
+ public final void fromBean(E bean) {
+ fromBeanBinder.copy(bean, (B) this);
+ }
+
+ public final E toBean() {
+ E result = newEntity();
+ toBeanBinder.copy((B) this, result);
+ return result;
+ }
+
+ protected abstract E newEntity();
+
+ public boolean isModify() {
+ return modify;
+ }
+
+ public void setModify(boolean modify) {
+ Object oldValue = isModify();
+ this.modify = modify;
+ firePropertyChange(PROPERTY_MODIFY, oldValue, modify);
+ }
+
+ public boolean isValid() {
+ return valid;
+ }
+
+ public void setValid(boolean valid) {
+ Object oldValue = isValid();
+ this.valid = valid;
+ firePropertyChange(PROPERTY_VALID, oldValue, valid);
+ }
+
+ public boolean isCreate() {
+ return id == null;
+ }
+
+ //------------------------------------------------------------------------//
+ //-- TuttiEntity methods --//
+ //------------------------------------------------------------------------//
+
+// @Override
+ public Integer getIdAsInt() {
+ return id == null ? null : Integer.valueOf(id);
+ }
+
+// @Override
+ public void setId(Integer id) {
+ if (id == null) {
+ this.id = null;
+ } else {
+ this.id = id.toString();
+ }
+ }
+
+// @Override
+ public String getId() {
+ return id;
+ }
+
+// @Override
+ public void setId(String id) {
+ Object oldValue = getId();
+ this.id = id;
+ firePropertyChange(PROPERTY_ID, oldValue, id);
+ }
+
+ //------------------------------------------------------------------------//
+ //-- PropagatePropertyChangeListener methods --//
+ //------------------------------------------------------------------------//
+
+ @Override
+ public void firePropertyChanged(String propertyName,
+ Object oldValue,
+ Object newValue) {
+ firePropertyChange(propertyName, oldValue, newValue);
+ }
+
+ protected <B> B getChild(Collection<B> child, int index) {
+ return CollectionUtil.getOrNull(child, index);
+ }
+
+ protected <B> B getChild(List<B> child, int index) {
+ return CollectionUtil.getOrNull(child, index);
+ }
+
+}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,306 +1,98 @@
package com.franciaflex.faxtomail.ui.swing.util;
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
import com.franciaflex.faxtomail.LabelAware;
+import com.franciaflex.faxtomail.services.DecoratorService;
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import com.franciaflex.faxtomail.ui.swing.config.FaxToMailApplicationConfig;
import com.franciaflex.faxtomail.ui.swing.content.MainUI;
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
-import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionHelper;
-import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionUI;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
-import jaxx.runtime.JAXXUtil;
-import jaxx.runtime.SwingUtil;
-import jaxx.runtime.swing.editor.FileEditor;
-import jaxx.runtime.swing.editor.NumberEditor;
-import jaxx.runtime.swing.editor.bean.BeanFilterableComboBox;
-import jaxx.runtime.swing.renderer.DecoratorListCellRenderer;
-import jaxx.runtime.validator.swing.SwingValidator;
-import org.apache.commons.lang3.ArrayUtils;
+import com.google.common.collect.Sets;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jdesktop.swingx.JXDatePicker;
-import org.jdesktop.swingx.JXTable;
import org.nuiton.decorator.Decorator;
-import org.nuiton.decorator.JXPathDecorator;
+import org.nuiton.jaxx.application.swing.AbstractApplicationUIHandler;
+import org.nuiton.jaxx.application.swing.action.ApplicationActionUI;
-import javax.swing.*;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.text.JTextComponent;
-import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.FocusAdapter;
-import java.awt.event.FocusEvent;
-import java.awt.event.HierarchyEvent;
-import java.awt.event.HierarchyListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.io.File;
-import java.io.Serializable;
-import java.text.ParseException;
-import java.util.Date;
+import java.awt.Component;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import java.util.List;
-import java.util.Map;
+import java.util.Set;
-import static org.nuiton.i18n.I18n.t;
-
/**
* Contract of any UI handler.
*
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public abstract class AbstractFaxToMailUIHandler<M, UI extends FaxToMailUI<M, ?>> implements UIMessageNotifier {
+public abstract class AbstractFaxToMailUIHandler<M, UI extends FaxToMailUI<M, ?>>
+ extends AbstractApplicationUIHandler<M, UI> implements UIMessageNotifier {
/** Logger. */
private static final Log log =
LogFactory.getLog(AbstractFaxToMailUIHandler.class);
- public abstract void beforeInitUI();
-
- public abstract void afterInitUI();
-
- public abstract void onCloseUI();
-
- public abstract SwingValidator<M> getValidator();
-
- /**
- * Global application context.
- *
- * @since 0.1
- */
- protected final FaxToMailUIContext context;
-
- /**
- * UI handled.
- *
- * @since 0.1
- */
- protected final UI ui;
-
- protected AbstractFaxToMailUIHandler(FaxToMailUIContext context, UI ui) {
- this.context = context;
- this.ui = ui;
- }
-
- //------------------------------------------------------------------------//
- //-- Public methods --//
- //------------------------------------------------------------------------//
-
- public DefaultComboBoxModel newComboModel(Object... items) {
- return new DefaultComboBoxModel(items);
- }
-
- public final M getModel() {
- return ui.getModel();
- }
-
- public final UI getUI() {
- return ui;
- }
-
@Override
public void showInformationMessage(String message) {
- context.showInformationMessage(message);
+ getContext().showInformationMessage(message);
}
public FaxToMailUIContext getContext() {
- return context;
+ return (FaxToMailUIContext) super.getContext();
}
// public FaxToMailDataContext getDataContext() {
// return getContext().getDataContext();
// }
- public FaxToMailApplicationConfig getConfig() {
- return context.getConfig();
+ public FaxToMailConfiguration getConfig() {
+ return getContext().getConfig();
}
- public void setText(KeyEvent event, String property) {
- JTextComponent field = (JTextComponent) event.getSource();
- String value = field.getText();
- FaxToMailUIUtil.setProperty(getModel(), property, value);
- }
-
- public void setFile(ActionEvent event, String property) {
- FileEditor field = (FileEditor) event.getSource();
- File value = field.getSelectedFile();
- FaxToMailUIUtil.setProperty(getModel(), property, value);
- }
-
- public void setBoolean(ItemEvent event, String property) {
- boolean value = event.getStateChange() == ItemEvent.SELECTED;
- FaxToMailUIUtil.setProperty(getModel(), property, value);
- }
-
- public void setDate(ActionEvent event, String property) {
- JXDatePicker field = (JXDatePicker) event.getSource();
- Date value = field.getDate();
- FaxToMailUIUtil.setProperty(getModel(), property, value);
- }
-
-// public void selectListData(ListSelectionEvent event, String property) {
-// if (!event.getValueIsAdjusting()) {
-// JList list = (JList) event.getSource();
-// ListSelectionModel selectionModel = list.getSelectionModel();
-//
-// selectionModel.setValueIsAdjusting(true);
-// try {
-// List selectedList = Lists.newLinkedList();
-//
-// for (int index : list.getSelectedIndices()) {
-// Object o = list.getModel().getElementAt(index);
-// selectedList.add(o);
-// }
-// TuttiUIUtil.setProperty(getModel(), property, selectedList);
-// } finally {
-// selectionModel.setValueIsAdjusting(false);
-// }
-// }
-// }
-
- public void openDialog(FaxToMailUI dialogContent,
- String title, Dimension dim) {
- Component topestUI = getTopestUI();
-
- JDialog result;
- if (topestUI instanceof Frame) {
- result = new JDialog((Frame) topestUI, title, true);
- } else {
- result = new JDialog((Dialog) topestUI, title, true);
- }
-
- result.add((Component) dialogContent);
- result.setResizable(true);
-
- result.setSize(dim);
-
- final AbstractFaxToMailUIHandler handler = dialogContent.getHandler();
-
- if (handler instanceof Cancelable) {
-
- // add a auto-close action
- JRootPane rootPane = result.getRootPane();
-
-// KeyStroke shortcutClosePopup = getConfig().getShortcutClosePopup();
-
-// rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
-// shortcutClosePopup, "close");
- rootPane.getActionMap().put("close", new AbstractAction() {
- private static final long serialVersionUID = 1L;
-
- @Override
- public void actionPerformed(ActionEvent e) {
- ((Cancelable) handler).cancel();
- }
- });
- }
-
- result.addWindowListener(new WindowAdapter() {
-
- @Override
- public void windowClosed(WindowEvent e) {
- Component ui = (Component) e.getSource();
- if (log.isDebugEnabled()) {
- log.debug("Destroy ui " + ui);
- }
- JAXXUtil.destroy(ui);
- }
- });
- SwingUtil.center(getContext().getMainUI(), result);
- result.setVisible(true);
- }
-
- public void closeDialog(FaxToMailUI ui) {
- SwingUtil.getParentContainer(ui, JDialog.class).setVisible(false);
- }
-
- public static final String CONFIRMATION_FORMAT = "<html>%s<hr/><br/>%s</html>";
-
- public int askSaveBeforeLeaving(String message) {
- String htmlMessage = String.format(
- CONFIRMATION_FORMAT,
- message,
- t("faxtomail.common.askSaveBeforeLeaving.help"));
- int result = JOptionPane.showConfirmDialog(
- getTopestUI(),
- htmlMessage,
- t("faxtomail.common.askSaveBeforeLeaving.title"),
- JOptionPane.YES_NO_CANCEL_OPTION,
- JOptionPane.QUESTION_MESSAGE);
- return result;
- }
-
- public boolean askCancelEditBeforeLeaving(String message) {
- String htmlMessage = String.format(
- CONFIRMATION_FORMAT,
- message,
- t("faxtomail.common.askCancelEditBeforeLeaving.help"));
- int i = JOptionPane.showConfirmDialog(
- getTopestUI(),
- htmlMessage,
- t("faxtomail.common.askCancelEditBeforeLeaving.title"),
- JOptionPane.OK_CANCEL_OPTION,
- JOptionPane.QUESTION_MESSAGE);
-
- boolean result = i == JOptionPane.OK_OPTION;
- return result;
- }
-
- public void showSuccessMessage(String title, String message) {
-
- Component topestUI = getTopestUI();
- boolean alwaysOnTop = false;
-
- if (topestUI instanceof JDialog) {
- alwaysOnTop = ((JDialog) topestUI).isAlwaysOnTop();
- }
-
- if (alwaysOnTop) {
- ((JDialog) topestUI).setAlwaysOnTop(false);
- }
- try {
-
- JOptionPane.showMessageDialog(
- topestUI,
- message,
- title,
- JOptionPane.INFORMATION_MESSAGE,
- UIManager.getIcon("info")
- );
- } finally {
- if (alwaysOnTop) {
- ((JDialog) topestUI).setAlwaysOnTop(true);
- }
- }
- }
-
+ @Override
public Component getTopestUI() {
Component result;
- FaxToMailActionUI actionUI = getContext().getActionUI();
- if (actionUI.isVisible()) {
+ ApplicationActionUI actionUI = getContext().getActionUI();
+// if (actionUI.isVisible()) {
result = actionUI;
- } else {
- result = getContext().getMainUI();
- }
+// } else {
+// result = getContext().getMainUI();
+// }
return result;
}
public void clearValidators() {
- MainUI main = context.getMainUI();
+ MainUI main = getContext().getMainUI();
Preconditions.checkNotNull(
main, "No mainUI registred in application context");
MainUIHandler handler = main.getHandler();
handler.clearValidators();
}
+ @Override
+ public <O> Decorator<O> getDecorator(Class<O> type, String name) {
+ DecoratorService decoratorService =
+ getContext().getDecoratorService();
+
+ Preconditions.checkNotNull(type);
+
+ Decorator decorator = decoratorService.getDecoratorByType(type, name);
+ if (decorator == null) {
+
+ if (LabelAware.class.isAssignableFrom(type)) {
+ decorator = getDecorator(LabelAware.class, null);
+ }
+ }
+ Preconditions.checkNotNull(decorator);
+ return decorator;
+ }
+
+// @Override
// public <O> Decorator<O> getDecorator(Class<O> type, String name) {
// DecoratorService decoratorService =
-// context.getDecoratorService();
+// getContext().getDecoratorService();
//
// Preconditions.checkNotNull(type);
//
@@ -315,520 +107,33 @@
// return decorator;
// }
- public void autoSelectRowInTable(MouseEvent e, JPopupMenu popup) {
-
- boolean rightClick = SwingUtilities.isRightMouseButton(e);
-
- if (rightClick || SwingUtilities.isLeftMouseButton(e)) {
-
- // get the coordinates of the mouse click
- Point p = e.getPoint();
-
- JXTable source = (JXTable) e.getSource();
-
- int[] selectedRows = source.getSelectedRows();
- int[] selectedColumns = source.getSelectedColumns();
-
- // get the row index at this point
- int rowIndex = source.rowAtPoint(p);
-
- // get the column index at this point
- int columnIndex = source.columnAtPoint(p);
-
- if (log.isDebugEnabled()) {
- log.debug("At point [" + p + "] found Row " + rowIndex + ", Column " + columnIndex);
- }
-
- boolean canContinue = true;
-
- if (source.isEditing()) {
-
- // stop editing
- boolean stopEdit = source.getCellEditor().stopCellEditing();
- if (!stopEdit) {
- if (log.isWarnEnabled()) {
- log.warn("Could not stop edit cell...");
- }
- canContinue = false;
- }
- }
-
- if (canContinue) {
-
- // select row (could empty selection)
- if (rowIndex == -1) {
- source.clearSelection();
- } else if (!ArrayUtils.contains(selectedRows, rowIndex)) {
- if (ListSelectionModel.MULTIPLE_INTERVAL_SELECTION == source.getSelectionMode()) {
- // add to selection
- source.addRowSelectionInterval(rowIndex, rowIndex);
- } else {
- // set selection
- source.setRowSelectionInterval(rowIndex, rowIndex);
- }
- }
-
- // select column (could empty selection)
- if (columnIndex == -1) {
- source.clearSelection();
- } else if (!ArrayUtils.contains(selectedColumns, columnIndex)) {
- source.setColumnSelectionInterval(columnIndex, columnIndex);
- }
-
- if (rightClick) {
-
- // use now model coordinate
- int modelRowIndex = source.convertRowIndexToModel(rowIndex);
- int modelColumnIndex = source.convertColumnIndexToModel(columnIndex);
-
-// beforeOpenPopup(modelRowIndex, modelColumnIndex);
-
- // on right click show popup
- popup.show(source, e.getX(), e.getY());
- }
- }
- }
- }
-
- public void openRowMenu(KeyEvent e, JPopupMenu popup) {
-
- if (e.getKeyCode() == KeyEvent.VK_CONTEXT_MENU) {
-
- JXTable source = (JXTable) e.getSource();
-
- // get the lowest selected row
- int[] selectedRows = source.getSelectedRows();
- int lowestRow = -1;
- for (int row : selectedRows) {
- lowestRow = Math.max(lowestRow, row);
- }
- // get the selected column
- int selectedColumn = source.getSelectedColumn();
- Rectangle r = source.getCellRect(lowestRow, selectedColumn, true);
-
- // get the point in the middle lower of the cell
- Point p = new Point(r.x + r.width / 2, r.y + r.height);
-
- if (log.isDebugEnabled()) {
- log.debug("Row " + lowestRow + " found t point [" + p + "]");
- }
-
- boolean canContinue = true;
-
- if (source.isEditing()) {
-
- // stop editing
- boolean stopEdit = source.getCellEditor().stopCellEditing();
- if (!stopEdit) {
- if (log.isWarnEnabled()) {
- log.warn("Could not stop edit cell...");
- }
- canContinue = false;
- }
- }
-
- if (canContinue) {
-
- // use now model coordinate
- int rowIndex = source.convertRowIndexToModel(lowestRow);
- int columnIndex = source.convertColumnIndexToModel(selectedColumn);
-// beforeOpenPopup(rowIndex, columnIndex);
-
- popup.show(source, p.x, p.y);
- }
- }
- }
-
- //------------------------------------------------------------------------//
- //-- Init methods --//
- //------------------------------------------------------------------------//
-
- protected void initUI(FaxToMailUI ui) {
-
- for (Map.Entry<String, Object> entry : ui.get$objectMap().entrySet()) {
- Object component = entry.getValue();
- if (component instanceof NumberEditor) {
-
- initNumberEditor((NumberEditor) component);
- } else if (component instanceof JXDatePicker) {
-
- initDatePicker((JXDatePicker) component);
- } else if (component instanceof JLabel) {
-
- initLabel((JLabel) component);
- } else if (component instanceof JTextField) {
-
- initTextField((JTextField) component);
- } else if (component instanceof AbstractButton) {
-
- initButton((AbstractButton) component);
- } else if (component instanceof JScrollPane) {
-
- initScrollPane((JScrollPane) component);
- }
- }
-
- ((Component) ui).addHierarchyListener(new HierarchyListener() {
+ protected void listenModelModifiy(AbstractFaxToMailBeanUIModel model) {
+ model.addPropertyChangeListener(AbstractFaxToMailBeanUIModel.PROPERTY_MODIFY, new PropertyChangeListener() {
@Override
- public void hierarchyChanged(HierarchyEvent e) {
- JComponent component = getComponentToFocus();
- if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) > 0
- && e.getChanged().isShowing()
- && component != null) {
- component.requestFocus();
+ public void propertyChange(PropertyChangeEvent evt) {
+ Boolean modify = (Boolean) evt.getNewValue();
+ if (modify != null && modify) {
+ ((AbstractFaxToMailBeanUIModel) getModel()).setModify(true);
}
}
});
}
- protected abstract JComponent getComponentToFocus();
-
- protected void initTextField(JTextField jTextField) {
- Boolean computed = (Boolean) jTextField.getClientProperty("computed");
- if (computed != null && computed) {
- Font font = jTextField.getFont().deriveFont(Font.ITALIC);
- jTextField.setFont(font);
- jTextField.setEditable(false);
- jTextField.setEnabled(false);
-// jTextField.setDisabledTextColor(getConfig().getColorComputedWeights());
- }
- if (isAutoSelectOnFocus(jTextField)) {
- addAutoSelectOnFocus(jTextField);
- }
- }
-
- protected void initLabel(JLabel jLabel) {
- Boolean strongStyle = (Boolean) jLabel.getClientProperty("strongStyle");
- Boolean italicStyle = (Boolean) jLabel.getClientProperty("italicStyle");
- Font font = jLabel.getFont();
- int style = font.getStyle();
- if (strongStyle != null && strongStyle) {
- style |= Font.BOLD;
- }
- if (italicStyle != null && italicStyle) {
- style |= Font.ITALIC;
- }
- jLabel.setFont(font.deriveFont(style));
-
- }
-
-// protected void initButtonAttachment(ButtonAttachment component) {
+// //------------------------------------------------------------------------//
+// //-- Internal methods --//
+// //------------------------------------------------------------------------//
//
-// component.init();
-// }
-
- protected void initButton(AbstractButton abstractButton) {
-
- Class actionName = (Class) abstractButton.getClientProperty("tuttiAction");
- if (actionName != null) {
- Action action = FaxToMailActionHelper.createUIAction(this, abstractButton, actionName);
- abstractButton.setAction(action);
- }
- }
-
- /**
- * Prépare un component de choix d'entités pour un type d'entité donné et
- * pour un service de persistance donné.
- *
- * @param comboBox le component graphique à initialiser
- */
- protected <E extends Serializable> void initBeanFilterableComboBox(
- BeanFilterableComboBox<E> comboBox,
- List<E> data,
- E selectedData) {
-
- initBeanFilterableComboBox(comboBox, data, selectedData, null);
- }
-
- protected <E extends Serializable> void initBeanFilterableComboBox(
- BeanFilterableComboBox<E> comboBox,
- List<E> data,
- E selectedData,
- String decoratorContext) {
-
- Preconditions.checkNotNull(comboBox, "No comboBox!");
-
- Class<E> beanType = comboBox.getBeanType();
-
- Preconditions.checkNotNull(beanType, "No beanType on the combobox!");
-// Decorator<E> decorator = getDecorator(beanType, decoratorContext);;
-
- if (data == null) {
- data = Lists.newArrayList();
- }
-
- if (log.isDebugEnabled()) {
- log.debug("entity comboBox list [" + beanType.getName() + "] : " +
- (data == null ? 0 : data.size()));
- }
-
- comboBox.setI18nPrefix("tutti.property.");
-
- // add data list to combo box
-// comboBox.init((JXPathDecorator<E>) decorator, data);
-
-// comboBox.setSelectedItem(selectedData);
-
-// if (log.isDebugEnabled()) {
-// log.debug("combo [" + beanType.getName() + "] : " +
-// comboBox.getData().size());
+// protected void registerValidators(SwingValidator... validators) {
+// MainUI main = getContext().getMainUI();
+// Preconditions.checkNotNull(
+// main, "No mainUI registred in application context");
+// MainUIHandler handler = main.getHandler();
+// handler.clearValidators();
+// for (SwingValidator validator : validators) {
+// handler.registerValidator(validator);
// }
- }
-
- /**
- * Prépare un component de choix d'entités pour un type d'entité donné et
- * pour un service de persistance donné.
- *
- * @param list le component graphique à initialiser
- * @param data la liste des données à mettre dans la liste de gauche
- * @param selectedData la liste des données à mettre dans la liste de droite
- */
-// protected <E extends TuttiEntity> void initBeanList(
-// BeanDoubleList<E> list,
-// List<E> data,
-// List<E> selectedData,
-// Decorator<E> selectedDecorator) {
-//
-// Preconditions.checkNotNull(list, "No list!");
-//
-// Class<E> beanType = list.getBeanType();
-// Preconditions.checkNotNull(beanType, "No beanType on the double list!");
-//
-// DecoratorService decoratorService =
-// context.getDecoratorService();
-// Decorator<E> decorator = decoratorService.getDecoratorByType(beanType);
-//
-// if (log.isDebugEnabled()) {
-// log.debug("entity list [" + beanType.getName() + "] : " +
-// (data == null ? 0 : data.size()));
-// }
-//
-// list.setI18nPrefix("tutti.property.");
-//
-// // add data list to combo box
-// list.init((JXPathDecorator<E>) decorator,
-// (JXPathDecorator<E>) selectedDecorator,
-// data,
-// selectedData);
-//
-// if (log.isDebugEnabled()) {
-// log.debug("Jlist [" + beanType.getName() + "] : " +
-// list.getUniverseList().getModel().getSize());
-// }
// }
- /**
- * Prépare un component de choix d'entités pour un type d'entité donné et
- * pour un service de persistance donné.
- *
- * @param list le component graphique à initialiser
- * @param data la liste des données à mettre dans la liste de gauche
- * @param selectedData la liste des données à mettre dans la liste de droite
- */
-// protected <E extends TuttiEntity> void initBeanList(
-// BeanDoubleList<E> list,
-// List<E> data,
-// List<E> selectedData) {
-//
-// initBeanList(list, data, selectedData, null);
-// }
-
- protected void initNumberEditor(NumberEditor editor) {
- if (log.isDebugEnabled()) {
- log.debug("init number editor " + editor.getName());
- }
- editor.init();
-
- // Force binding if value is already in model
- Number model = editor.getModel();
- if (model != null) {
- editor.setModel(null);
- editor.setModel(model);
- }
-
- if (isAutoSelectOnFocus(editor)) {
-
- addAutoSelectOnFocus(editor.getTextField());
- }
- }
-
-// protected void initTimeEditor(SimpleTimeEditor editor) {
-// if (log.isDebugEnabled()) {
-// log.debug("init time editor " + editor.getName() +
-// " for property " + editor.getModel().getProperty());
-// }
-// editor.init();
-//
-// if (isAutoSelectOnFocus(editor)) {
-// addAutoSelectOnFocus(((JSpinner.DefaultEditor) editor.getHour().getEditor()).getTextField());
-// addAutoSelectOnFocus(((JSpinner.DefaultEditor) editor.getMinute().getEditor()).getTextField());
-// }
-// }
-
-// protected void initCoordinateDMSEditor(DmsCoordinateEditor editor) {
-// editor.init();
-// }
-
-// protected void initCoordinateDMDEditor(DmdCoordinateEditor editor) {
-// editor.init();
-// }
-
- protected void initDatePicker(final JXDatePicker picker) {
-
- if (log.isDebugEnabled()) {
- log.debug("disable JXDatePicker editor" + picker.getName());
- }
-// String dateFormat = getConfig().getDateFormat();
- picker.setFormats("dd/MM/yyyy");
- picker.setToolTipText(t("faxtomail.common.datefield.tip", "dd/MM/yyyy"));
- picker.getEditor().addFocusListener(new FocusAdapter() {
-
- @Override
- public void focusLost(FocusEvent e) {
- try {
- picker.commitEdit();
-
- } catch (ParseException ex) {
- if (log.isDebugEnabled()) {
- log.debug("format error", ex);
- }
- picker.requestFocus();
- }
- }
- });
-
- if (isAutoSelectOnFocus(picker)) {
- addAutoSelectOnFocus(picker.getEditor());
- }
- }
-
- protected void initScrollPane(JScrollPane scrollPane) {
- Boolean onlyVerticalScrollable = (Boolean) scrollPane.getClientProperty("onlyVerticalScrollable");
- if (onlyVerticalScrollable != null && onlyVerticalScrollable) {
- scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
- scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
-
- final JViewport viewport = scrollPane.getViewport();
- viewport.addChangeListener(new ChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- Dimension newDimension = new Dimension(viewport.getExtentSize().width,
- viewport.getViewSize().height);
- viewport.setViewSize(newDimension);
- }
- });
- }
- }
-
- protected boolean isAutoSelectOnFocus(JComponent comp) {
- Object selectOnFocus = comp.getClientProperty("selectOnFocus");
- return selectOnFocus != null && Boolean.valueOf(selectOnFocus.toString());
- }
-
- protected void addAutoSelectOnFocus(JTextField jTextField) {
- jTextField.addFocusListener(new FocusAdapter() {
- @Override
- public void focusGained(final FocusEvent e) {
- SwingUtilities.invokeLater(new Runnable() {
- @Override
- public void run() {
- JTextField source = (JTextField) e.getSource();
- source.selectAll();
- }
- });
-
- }
- });
- }
-
- //------------------------------------------------------------------------//
- //-- Internal methods --//
- //------------------------------------------------------------------------//
-
- protected boolean quitScreen(boolean modelIsValid,
- boolean modelIsModify,
- String askGiveUpMessage,
- String askSaveMessage,
- Action saveAction) {
- boolean result;
-
- if (!modelIsValid) {
-
- // model is not valid
- // ask user to qui or not
- result = askCancelEditBeforeLeaving(askGiveUpMessage);
-
- } else if (modelIsModify) {
-
- // something is modify ask user what to do
- int answer = askSaveBeforeLeaving(askSaveMessage);
- switch (answer) {
- case JOptionPane.YES_OPTION:
-
- // ok save
- saveAction.actionPerformed(null);
- result = true;
- break;
- case JOptionPane.NO_OPTION:
-
- // do not save but can still quit the screen (so nothing to do)
- result = true;
- break;
- default:
- // do not save and stay here (so nothing to do)
- result = false;
-
- }
- } else {
-
- // model is valid and not modify, can safely quit screen
- result = true;
- }
- return result;
- }
-
- protected void registerValidators(SwingValidator... validators) {
- MainUI main = context.getMainUI();
- Preconditions.checkNotNull(
- main, "No mainUI registred in application context");
- MainUIHandler handler = main.getHandler();
- handler.clearValidators();
- for (SwingValidator validator : validators) {
- handler.registerValidator(validator);
- }
- }
-
- protected String decorate(Object object) {
- return decorate(object, null);
- }
-
- protected String decorate(Object object, String context) {
- String result = "";
-// if (object != null) {
-// result = getDecorator(object.getClass(), context).toString(object);
-// }
- return result;
- }
-
-// protected <O> ListCellRenderer newListCellRender(Class<O> type) {
-//
-// return newListCellRender(type, null);
-// }
-
-// protected <O> ListCellRenderer newListCellRender(Class<O> type, String name) {
-
-// Decorator<O> decorator = getDecorator(type, name);
-// return newListCellRender(decorator);
-// }
-
- protected <O> ListCellRenderer newListCellRender(Decorator<O> decorator) {
-
- Preconditions.checkNotNull(decorator);
-
- ListCellRenderer result = new DecoratorListCellRenderer(decorator);
- return result;
- }
-
// protected void listenValidatorValid(SimpleBeanValidator validator,
// final AbstractTuttiBeanUIModel model) {
// validator.addPropertyChangeListener(SimpleBeanValidator.VALID_PROPERTY, new PropertyChangeListener() {
@@ -836,14 +141,14 @@
// public void propertyChange(PropertyChangeEvent evt) {
// if (log.isDebugEnabled()) {
// log.debug("Model [" + model +
-// "] pass to valid state [" +
-// evt.getNewValue() + "]");
+// "] pass to valid state [" +
+// evt.getNewValue() + "]");
// }
// model.setValid((Boolean) evt.getNewValue());
// }
// });
// }
-
+//
// protected void listenValidationTableHasNoFatalError(final SimpleBeanValidator validator,
// final AbstractTuttiBeanUIModel model) {
// getContext().getMainUI().getValidatorMessageWidget().addTableModelListener(new TableModelListener() {
@@ -852,270 +157,37 @@
// boolean valid = !validator.hasFatalErrors();
// if (log.isDebugEnabled()) {
// log.debug("Model [" + model +
-// "] pass to valid state [" + valid + "]");
+// "] pass to valid state [" + valid + "]");
// }
// model.setValid(valid);
// }
// });
// }
-//
-// protected void listModelIsModify(AbstractTuttiBeanUIModel model) {
-// model.addPropertyChangeListener(new PropertyChangeListener() {
-//
-// final Set<String> excludeProperties = getPropertiesToIgnore();
-//
-// @Override
-// public void propertyChange(PropertyChangeEvent evt) {
-// if (!excludeProperties.contains(evt.getPropertyName())) {
-// ((AbstractTuttiBeanUIModel) evt.getSource()).setModify(true);
-// }
-// }
-// });
-// }
-// protected Set<String> getPropertiesToIgnore() {
-// return Sets.newHashSet(
-// AbstractTuttiBeanUIModel.PROPERTY_MODIFY,
-// AbstractTuttiBeanUIModel.PROPERTY_VALID);
-// }
+ protected void listModelIsModify(AbstractFaxToMailBeanUIModel model) {
+ model.addPropertyChangeListener(new PropertyChangeListener() {
- protected void closeUI(FaxToMailUI ui) {
- ui.getHandler().onCloseUI();
+ final Set<String> excludeProperties = getPropertiesToIgnore();
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (!excludeProperties.contains(evt.getPropertyName())) {
+ ((AbstractFaxToMailBeanUIModel) evt.getSource()).setModify(true);
+ }
+ }
+ });
}
- protected <B> void changeValidatorContext(String newContext,
- SwingValidator<B> validator) {
- B bean = validator.getBean();
- validator.setContext(newContext);
- validator.setBean(bean);
+ protected Set<String> getPropertiesToIgnore() {
+ return Sets.newHashSet(
+ AbstractFaxToMailBeanUIModel.PROPERTY_MODIFY,
+ AbstractFaxToMailBeanUIModel.PROPERTY_VALID);
}
-// protected <R extends AbstractTuttiBeanUIModel> TableColumnExt addColumnToModel(TableColumnModel model,
-// TableCellEditor editor,
-// TableCellRenderer renderer,
-// ColumnIdentifier<R> identifier) {
-//
-// return addColumnToModel(model, editor, renderer, identifier, null);
-// }
-//
-//
-// protected <R extends AbstractTuttiBeanUIModel> TableColumnExt addColumnToModel(TableColumnModel model,
-// TableCellEditor editor,
-// TableCellRenderer renderer,
-// ColumnIdentifier<R> identifier,
-// WeightUnit weightUnit) {
-//
-// TableColumnExt col = new TableColumnExt(model.getColumnCount());
-// col.setCellEditor(editor);
-// col.setCellRenderer(renderer);
-// String label = _(identifier.getHeaderI18nKey());
-// if (weightUnit != null) {
-// label = weightUnit.decorateLabel(label);
-// }
-// col.setHeaderValue(label);
-// String tip = _(identifier.getHeaderTipI18nKey());
-// if (weightUnit != null) {
-// tip = weightUnit.decorateTip(tip);
-// }
-// col.setToolTipText(tip);
-//
-// col.setIdentifier(identifier);
-// model.addColumn(col);
-// // by default no column is sortable, must specify it
-// col.setSortable(false);
-// return col;
-// }
+ protected void closeUI(FaxToMailUI ui) {
+ ui.getHandler().onCloseUI();
+ }
-// protected <R extends AbstractTuttiBeanUIModel> TableColumnExt addColumnToModel(TableColumnModel model,
-// ColumnIdentifier<R> identifier) {
-//
-// return addColumnToModel(model, null, null, identifier, null);
-// }
-//
-// protected <R extends AbstractTuttiBeanUIModel> TableColumnExt addFloatColumnToModel(TableColumnModel model,
-// ColumnIdentifier<R> identifier,
-// String numberPattern,
-// JTable table) {
-//
-// NumberCellEditor<Float> editor =
-// JAXXWidgetUtil.newNumberTableCellEditor(Float.class, false);
-// editor.getNumberEditor().setSelectAllTextOnError(true);
-// editor.getNumberEditor().getTextField().setBorder(new LineBorder(Color.GRAY, 2));
-// editor.getNumberEditor().setNumberPattern(numberPattern);
-//
-// TableCellRenderer renderer =
-// newNumberCellRenderer(table.getDefaultRenderer(Number.class));
-//
-// return addColumnToModel(model, editor, renderer, identifier, null);
-// }
-//
-// protected <R extends AbstractTuttiBeanUIModel> TableColumnExt addFloatColumnToModel(TableColumnModel model,
-// ColumnIdentifier<R> identifier,
-// WeightUnit weightUnit,
-// JTable table) {
-//
-// Preconditions.checkNotNull(weightUnit);
-// NumberCellEditor<Float> editor =
-// JAXXWidgetUtil.newNumberTableCellEditor(Float.class, false);
-// editor.getNumberEditor().setSelectAllTextOnError(true);
-// editor.getNumberEditor().getTextField().setBorder(new LineBorder(Color.GRAY, 2));
-// editor.getNumberEditor().setNumberPattern(weightUnit.getNumberEditorPattern());
-//
-// TableCellRenderer renderer =
-// newNumberCellRenderer(table.getDefaultRenderer(Number.class));
-//
-// return addColumnToModel(model, editor, renderer, identifier, weightUnit);
-// }
-//
-// protected <R extends AbstractTuttiBeanUIModel> TableColumnExt addIntegerColumnToModel(TableColumnModel model,
-// ColumnIdentifier<R> identifier,
-// String numberPattern,
-// JTable table) {
-//
-// NumberCellEditor<Integer> editor =
-// JAXXWidgetUtil.newNumberTableCellEditor(Integer.class, false);
-// editor.getNumberEditor().setSelectAllTextOnError(true);
-// editor.getNumberEditor().getTextField().setBorder(new LineBorder(Color.GRAY, 2));
-// editor.getNumberEditor().setNumberPattern(numberPattern);
-//
-// TableCellRenderer renderer = newNumberCellRenderer(table.getDefaultRenderer(Number.class));
-// return addColumnToModel(model, editor, renderer, identifier, null);
-// }
-//
-//
-// TableCellRenderer newNumberCellRenderer(final TableCellRenderer defaultRenderer) {
-// TableCellRenderer result = new TableCellRenderer() {
-// @Override
-// public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
-// Component result = defaultRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
-// if (result instanceof JLabel) {
-// JLabel jLabel = (JLabel) result;
-// jLabel.setHorizontalTextPosition(SwingConstants.RIGHT);
-//
-// }
-// return result;
-// }
-// };
-// return result;
-// }
-//
-//
-// protected <R extends AbstractTuttiBeanUIModel> TableColumnExt addBooleanColumnToModel(TableColumnModel model,
-// ColumnIdentifier<R> identifier,
-// JTable table) {
-//
-// return addColumnToModel(model,
-// table.getDefaultEditor(Boolean.class),
-// table.getDefaultRenderer(Boolean.class),
-// identifier,
-// null);
-// }
-//
-// protected <R extends AbstractTuttiBeanUIModel, B> TableColumnExt addComboDataColumnToModel(TableColumnModel model,
-// ColumnIdentifier<R> identifier,
-// Decorator<B> decorator,
-// List<B> data) {
-// JComboBox comboBox = new JComboBox();
-// comboBox.setRenderer(newListCellRender(decorator));
-//
-// List<B> dataToList = Lists.newArrayList(data);
-//
-// // add a null value at first position
-// if (!dataToList.isEmpty() && dataToList.get(0) != null) {
-// dataToList.add(0, null);
-// }
-// SwingUtil.fillComboBox(comboBox, dataToList, null);
-//
-// ObjectToStringConverter converter = BeanUIUtil.newDecoratedObjectToStringConverter(decorator);
-// BeanUIUtil.decorate(comboBox, converter);
-// ComboBoxCellEditor editor = new ComboBoxCellEditor(comboBox);
-//
-// return addColumnToModel(model,
-// editor,
-// newTableCellRender(decorator),
-// identifier,
-// null);
-// }
-//
-// protected <O> TableCellRenderer newTableCellRender(Class<O> type) {
-//
-// return newTableCellRender(type, null);
-// }
-//
-// protected <O> TableCellRenderer newTableCellRender(Class<O> type, String name) {
-//
-// Decorator<O> decorator = getDecorator(type, name);
-//
-// TableCellRenderer result = newTableCellRender(decorator);
-// return result;
-// }
-//
-// protected <O> TableCellRenderer newTableCellRender(Decorator<O> decorator) {
-//
-// Preconditions.checkNotNull(decorator);
-//
-// DecoratorTableCellRenderer result = new DecoratorTableCellRenderer(decorator, true);
-// return result;
-// }
-//
-// /**
-// * Hook to prepare popup just before showing it.
-// * <p/>
-// * The right place to update actions accessibility; a quite better design
-// * than trying to update each time something change in the table...
-// *
-// * @param rowIndex selected row index (or lowest selected one)
-// * @param columnIndex selected column index
-// * @since 2.6
-// */
-// protected void beforeOpenPopup(int rowIndex, int columnIndex) {
-//
-// }
-//
-// protected String buildReminderLabelTitle(Species species,
-// Iterable<SampleCategory<?>> categories,
-// String prefix,
-// String suffix) {
-// return buildReminderLabelTitle(
-// decorate(species),
-// categories,
-// prefix,
-// suffix);
-//
-// }
-//
-// protected String buildReminderLabelTitle(String species,
-// Iterable<SampleCategory<?>> categories,
-// String prefix,
-// String suffix) {
-// StringBuilder title = new StringBuilder(prefix);
-//
-// title.append(" - [").append(species).append("]");
-//
-// if (categories != null) {
-// for (SampleCategory<?> sampleCategory : categories) {
-// if (sampleCategory.getCategoryValue() != null) {
-// title.append(" - ");
-// title.append(decorate(sampleCategory.getCategoryValue()));
-// }
-// }
-// }
-//
-// title.append(" - ").append(suffix);
-// return title.toString();
-// }
-//
-// protected void incrementsMessage(String message) {
-//
-// TuttiActionUI actionUI = context.getActionUI();
-// if (actionUI != null) {
-// ProgressionModel progressionModel = actionUI.getModel().getProgressionModel();
-// if (progressionModel != null)
-//
-// progressionModel.increments(message);
-// }
-// }
-
protected List<Label> createLabelList(String... labels) {
List<Label> labelList = Lists.newArrayList();
for (String label : labels) {
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailErrorHelper.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailErrorHelper.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailErrorHelper.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,88 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.util;
-
-import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import org.jdesktop.swingx.JXErrorPane;
-import org.jdesktop.swingx.error.ErrorInfo;
-import org.jdesktop.swingx.error.ErrorReporter;
-import org.nuiton.csv.ImportRuntimeException;
-
-import javax.swing.*;
-
-import static org.nuiton.i18n.I18n.t;
-
-/**
- * helper around errors in FaxToMail.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public class FaxToMailErrorHelper implements ErrorReporter {
-
- protected FaxToMailUIContext context;
-
- public FaxToMailErrorHelper(FaxToMailUIContext context) {
- this.context = context;
- }
-
- /**
- * Display a user friendly error frame.
- *
- * @param message message for user
- * @param cause exception cause
- */
- public void showErrorDialog(String message, Throwable cause) {
-
- if (cause == null) {
- JOptionPane.showMessageDialog(context.getMainUI(), "<html><body>" + message + "</body></html>",
- t("faxtomail.error.ui.business.error"),
- JOptionPane.ERROR_MESSAGE);
-// } else if (cause instanceof FaxToMailBusinessException) {
-// JOptionPane.showMessageDialog(context.getMainUI(), "<html><body>" + cause.getMessage() + "</body></html>",
-// _("tutti.error.ui.business.error"),
-// JOptionPane.ERROR_MESSAGE);
- } else if (cause instanceof ImportRuntimeException) {
- JOptionPane.showMessageDialog(context.getMainUI(), cause.getMessage(),
- t("faxtomail.error.ui.business.error"),
- JOptionPane.ERROR_MESSAGE);
- } else {
-
- JXErrorPane pane = new JXErrorPane();
- ErrorInfo info = new ErrorInfo(t("faxtomail.error.ui.other.error"),
- t("faxtomail.error.errorpane.htmlmessage", message), null, null,
- cause, null, null);
- pane.setErrorInfo(info);
- pane.setErrorReporter(this);
- JXErrorPane.showDialog(context.getActionUI(), pane);
- }
-
- }
-
- /**
- * Display a user friendly error frame.
- *
- * @param message message for user
- */
- public void showErrorDialog(String message) {
- showErrorDialog(message, null);
- }
-
- @Override
- public void reportError(ErrorInfo errorInfo) throws NullPointerException {
-
- showErrorDialog(errorInfo.getBasicErrorMessage(), errorInfo.getErrorException());
- }
-
- /**
- * Display a user friendly warning frame.
- *
- * @param message message for user
- */
- public void showWarningDialog(String message) {
-
- JOptionPane.showMessageDialog(context.getMainUI(), "<html><body>" + message + "</body></html>",
- t("faxtomail.error.ui.business.warning"),
- JOptionPane.WARNING_MESSAGE);
-
- }
-
-}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailExceptionHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailExceptionHandler.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailExceptionHandler.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,13 +1,12 @@
package com.franciaflex.faxtomail.ui.swing.util;
-import com.franciaflex.faxtomail.FaxToMailTechnicalException;
-import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import com.franciaflex.faxtomail.ui.swing.content.AbstractChangeScreenAction;
-import com.franciaflex.faxtomail.ui.swing.action.AbstractFaxToMailAction;
-import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionException;
-import jaxx.runtime.swing.JAXXRuntimeException;
+import com.franciaflex.faxtomail.ui.swing.actions.AbstractChangeScreenAction;
+import com.franciaflex.faxtomail.ui.swing.actions.AbstractFaxToMailAction;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.jaxx.application.swing.action.ApplicationActionException;
+import org.nuiton.jaxx.application.swing.util.ApplicationErrorHelper;
+import org.nuiton.jaxx.application.swing.util.ApplicationExceptionHandler;
/**
* FaxToMail global exception handler.
@@ -20,57 +19,43 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 1.0
*/
-public class FaxToMailExceptionHandler implements Thread.UncaughtExceptionHandler {
+public class FaxToMailExceptionHandler extends ApplicationExceptionHandler {
private static final Log log =
LogFactory.getLog(FaxToMailExceptionHandler.class);
- @Override
- public void uncaughtException(Thread t, Throwable ex) {
- handleException(t.getName(), ex);
+ public FaxToMailExceptionHandler(ApplicationErrorHelper errorHelper) {
+ super(errorHelper);
}
- public void handle(Throwable thrown) {
- // for EDT exceptions
- handleException(Thread.currentThread().getName(), thrown);
- }
-
protected void handleException(String tname, Throwable ex) {
if (log.isErrorEnabled()) {
log.error("Global application exception [" + tname + "]", ex);
}
- Throwable cause = ex;
+ Throwable cause = getCause(ex);
- if (cause instanceof FaxToMailTechnicalException) {
- cause = cause.getCause();
- }
-
- if (cause instanceof JAXXRuntimeException) {
- cause = cause.getCause();
- }
-
boolean backToScreen = false;
AbstractFaxToMailAction action = null;
- if (cause instanceof FaxToMailActionException) {
+ if (cause instanceof ApplicationActionException) {
- FaxToMailActionException actionException = (FaxToMailActionException) cause;
+ ApplicationActionException actionException = (ApplicationActionException) cause;
cause = cause.getCause();
if (log.isDebugEnabled()) {
log.debug("Action error cause:", cause);
}
- action = actionException.getAction();
+ action = (AbstractFaxToMailAction) actionException.getAction();
if (action instanceof AbstractChangeScreenAction) {
backToScreen = true;
}
}
- FaxToMailUIContext.getErrorHelper().showErrorDialog(cause.getMessage(), cause);
+ showErrorDialog(cause.getMessage(), cause);
if (backToScreen) {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUI.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUI.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUI.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,6 +1,7 @@
package com.franciaflex.faxtomail.ui.swing.util;
import jaxx.runtime.JAXXObject;
+import org.nuiton.jaxx.application.swing.ApplicationUI;
import javax.swing.UIManager;
import java.awt.Font;
@@ -11,93 +12,6 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public interface FaxToMailUI<M, H extends AbstractFaxToMailUIHandler<M, ?>> extends JAXXObject {
+public interface FaxToMailUI<M, H extends AbstractFaxToMailUIHandler<M, ?>> extends ApplicationUI<M, H> {
- M getModel();
-
- H getHandler();
-
- /**
- * Pattern to use for short numeric values in editors with max 1 digits.
- *
- * @since 0.2
- */
- public static final String INT_1_DIGITS_PATTERN = "\\d{0,1}";
-
- /**
- * Pattern to use for short numeric values in editors with max 2 digits.
- *
- * @since 0.1
- */
- public static final String INT_2_DIGITS_PATTERN = "\\d{0,2}";
-
- /**
- * Pattern to use for signed numeric values in editors with max 2 digits.
- *
- * @since 1.0
- */
- public static final String SIGNED_INT_2_DIGITS_PATTERN = "-?\\d{0,2}";
-
- /**
- * Pattern to use for short numeric values in editors with max 3 digits.
- *
- * @since 0.1
- */
- public static final String INT_3_DIGITS_PATTERN = "\\d{0,3}";
-
- /**
- * Pattern to use for singed numeric values in editors with max 3 digits.
- *
- * @since 1.0
- */
- public static final String SIGNED_INT_3_DIGITS_PATTERN = "-?\\d{0,3}";
-
- /**
- * Pattern to use for short numeric values in editors with max 4 digits.
- *
- * @since 0.2
- */
- public static final String INT_4_DIGITS_PATTERN = "\\d{0,4}";
-
- /**
- * Pattern to use for integer numeric values in editors with max 6 digits.
- *
- * @since 0.1
- */
- public static final String INT_6_DIGITS_PATTERN = "\\d{0,6}";
-
- /**
- * Pattern to use for integer numeric values in editors with max 7 digits.
- *
- * @since 0.1
- */
- public static final String INT_7_DIGITS_PATTERN = "\\d{0,7}";
-
- /**
- * Pattern to use for decimal numeric values with 2 decimal digits in
- * editors.
- *
- * @since 0.1
- */
- public static final String DECIMAL2_PATTERN = "\\d{0,6}(\\.\\d{0,2})?";
-
- /**
- * Pattern to use for decimal numeric values with 3 decimal digits in
- * editors.
- *
- * @since 0.1
- */
- public static final String DECIMAL3_PATTERN = "\\d{0,6}(\\.\\d{0,3})?";
-
- /**
- * Pattern to use for decimal numeric values with 2 digits + 3 decimal digits in
- * editors.
- *
- * @since 1.0
- */
- public static final String DECIMAL2_DIGITS_PATTERN = "\\d{0,2}(\\.\\d*)?";
-
- public static final Font TEXTFIELD_NORMAL_FONT = UIManager.getDefaults().getFont("TextField.font");
-
- public static final Font TEXTFIELD_COMPUTED_FONT = UIManager.getDefaults().getFont("TextField.font").deriveFont(Font.ITALIC);
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -24,31 +24,18 @@
* #L%
*/
-import com.franciaflex.faxtomail.FaxToMailTechnicalException;
-import com.google.common.base.Preconditions;
-import org.apache.commons.beanutils.PropertyUtils;
+import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
+import jaxx.runtime.JAXXObject;
+import jaxx.runtime.JAXXUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jdesktop.swingx.JXTable;
+import org.nuiton.jaxx.application.swing.util.ApplicationUIUtil;
-import javax.swing.*;
-import javax.swing.table.JTableHeader;
-import java.awt.*;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
-
-import static org.nuiton.i18n.I18n.t;
-
/**
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public final class FaxToMailUIUtil {
+public final class FaxToMailUIUtil extends ApplicationUIUtil {
/** Logger. */
private static final Log log = LogFactory.getLog(FaxToMailUIUtil.class);
@@ -57,217 +44,12 @@
// never instanciate util class
}
- public static void setProperty(Object bean, String property, Object value) {
- Preconditions.checkNotNull(bean);
- Preconditions.checkNotNull(property);
- try {
- PropertyUtils.setSimpleProperty(bean, property, value);
- } catch (Exception e) {
- throw new FaxToMailTechnicalException(t("faxtomail.property.set.error", property, bean.getClass().getName()), e);
- }
+ public static FaxToMailUIContext getApplicationContext(JAXXObject ui) {
+ return (FaxToMailUIContext) ApplicationUIUtil.getApplicationContext(ui);
}
- public static Object getProperty(Object bean, String property) {
- Preconditions.checkNotNull(bean);
- Preconditions.checkNotNull(property);
- try {
- return PropertyUtils.getSimpleProperty(bean, property);
- } catch (Exception e) {
- throw new FaxToMailTechnicalException(t("faxtomail.property.get.error", property, bean.getClass().getName()), e);
- }
+ public static void setParentUI(JAXXObject ui, FaxToMailUI<?, ?> parentUI) {
+ JAXXUtil.initContext(ui, parentUI);
+ setApplicationContext(ui, parentUI.getHandler().getContext());
}
-
- private static DecimalFormatSymbols symbols;
-
- public static DecimalFormatSymbols getDecimalFormatSymbols() {
- if (symbols == null) {
- symbols = new DecimalFormatSymbols();
- symbols.setDecimalSeparator('.');
- symbols.setGroupingSeparator(' ');
- }
- return symbols;
- }
-
- private static DecimalFormat decimalFormat;
-
- public static DecimalFormat getDecimalFormat(int minDecimal, int maxDecimal) {
- if (decimalFormat == null) {
- decimalFormat = new DecimalFormat();
- decimalFormat.setDecimalFormatSymbols(getDecimalFormatSymbols());
- decimalFormat.setGroupingUsed(false);
- }
- decimalFormat.setMinimumFractionDigits(minDecimal);
- decimalFormat.setMaximumFractionDigits(maxDecimal);
- return decimalFormat;
- }
-
- public static void openLink(URL url) {
- try {
- openLink(url.toURI());
- } catch (URISyntaxException e) {
- throw new FaxToMailTechnicalException(t("swing.error.cannot.open.link", url), e);
- }
- }
-
- public static Desktop getDesktopForBrowse() {
-
- if (!Desktop.isDesktopSupported()) {
- throw new FaxToMailTechnicalException(
- t("swing.error.desktop.not.supported"));
- }
-
- Desktop desktop = Desktop.getDesktop();
-
- if (!desktop.isSupported(Desktop.Action.BROWSE)) {
-
- throw new FaxToMailTechnicalException(
- t("swing.error.desktop.browse.not.supported"));
- }
-
- return desktop;
- }
-
- public static void openLink(URI uri) {
-
- Desktop desktop = getDesktopForBrowse();
-
- try {
-
- desktop.browse(uri);
- } catch (Exception e) {
-
- throw new FaxToMailTechnicalException(
- t("swing.error.cannot.open.link", uri), e);
- }
- }
-
- public static Desktop getDesktopForMail() {
-
- if (!Desktop.isDesktopSupported()) {
- throw new FaxToMailTechnicalException(
- t("swing.error.desktop.not.supported"));
- }
-
- Desktop desktop = Desktop.getDesktop();
-
- if (!desktop.isSupported(Desktop.Action.MAIL)) {
-
- throw new FaxToMailTechnicalException(
- t("swing.error.desktop.mail.not.supported"));
- }
-
- return desktop;
- }
-
- public static void mail(String subject, String body) {
-
- Desktop desktop = getDesktopForMail();
-
- try {
- URI mailtoURI = new URI("mailto", null, null, "subject=" + subject + "&body=" + body, null);
- desktop.mail(mailtoURI);
-
- } catch (Exception e) {
-
- throw new FaxToMailTechnicalException(
- t("swing.error.cannot.mail"), e);
- }
- }
-
- public static void selectFirstCellOnFirstRowAndStopEditing(JXTable table) {
-
- // select first cell
- doSelectCell(table, 0, 0);
-
- if (table.isEditing()) {
-
- // but no edit it
- table.getCellEditor().stopCellEditing();
- }
- }
-
- public static void selectFirstCellOnLastRow(JXTable table) {
-
- // select first cell
- doSelectCell(table, table.getRowCount() - 1, 0);
- }
-
- public static void selectFirstCellOnRow(JXTable table, int row, boolean stopEdit) {
-
- // select first cell
- doSelectCell(table, row, 0);
-
- if (stopEdit && table.isEditing()) {
-
- table.getCellEditor().stopCellEditing();
- }
- }
-
- public static void doSelectCell(JTable table,
- int rowIndex,
- int columnIndex) {
-
- int rowCount = table.getRowCount();
- if (rowCount == 0) {
-
- // no row, can not selected any cell
- if (log.isWarnEnabled()) {
- log.warn("No row in table, can not select any cell");
- }
- return;
- }
- int columnCount = table.getColumnCount();
- if (columnCount == 0) {
-
- // no column, can not selected any cell
- if (log.isWarnEnabled()) {
- log.warn("No column in table, can not select any cell");
- }
- return;
- }
- if (columnIndex > columnCount) {
- if (log.isWarnEnabled()) {
- log.warn(String.format("ColumnIndex: %s is more than columnCount %s", columnIndex, columnCount));
- }
- columnIndex = columnCount - 1;
- }
- if (columnIndex < 0) {
- columnIndex = 0;
- }
- if (rowIndex >= rowCount) {
- if (log.isWarnEnabled()) {
- log.warn(String.format("RowIndex: %s is more than rowCount %s", rowIndex, rowCount));
- }
- rowIndex = rowCount - 1;
- }
- if (rowIndex < 0) {
- rowIndex = 0;
- }
-
- table.setColumnSelectionInterval(columnIndex, columnIndex);
- table.setRowSelectionInterval(rowIndex, rowIndex);
- table.editCellAt(rowIndex, columnIndex);
- }
-
- protected static class ShowSpeciesDecoratorPopupListener extends MouseAdapter {
-
- private final JPopupMenu popup;
-
- public ShowSpeciesDecoratorPopupListener(JPopupMenu popup) {
- this.popup = popup;
- }
-
- @Override
- public void mouseClicked(MouseEvent e) {
- JTableHeader source = (JTableHeader) e.getSource();
- Point point = e.getPoint();
- int columnIndex = source.columnAtPoint(point);
-
- boolean rightClick = SwingUtilities.isRightMouseButton(e);
- if (columnIndex == 0 && rightClick) {
- e.consume();
- popup.show(source, e.getX(), e.getY());
- }
- }
- }
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/Label.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/Label.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/Label.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -18,4 +18,4 @@
public String getLabel() {
return label;
}
-}
\ No newline at end of file
+}
Modified: trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties
===================================================================
--- trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties 2014-02-06 16:42:22 UTC (rev 7)
@@ -10,6 +10,8 @@
Supprimer=
T\\u00e9l\\u00e9copie\ re\\u00e7ue\ le\ 10/01/2014\ \\u00e0\ 13\:37=
Voir=
+application.action.create.error=
+application.error.ui.business.warning=
faxtomail.action.create.error=
faxtomail.archive.button.label=
faxtomail.back.button.label=
Modified: trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties
===================================================================
--- trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-02-06 16:42:22 UTC (rev 7)
@@ -10,6 +10,8 @@
Supprimer=
T\\u00e9l\\u00e9copie\ re\\u00e7ue\ le\ 10/01/2014\ \\u00e0\ 13\:37=
Voir=
+application.action.create.error=
+application.error.ui.business.warning=
faxtomail.action.create.error=
faxtomail.common.askBeforeDelete.help=
faxtomail.common.askCancelEditBeforeLeaving.help=
Modified: trunk/faxtomail-ui-web/pom.xml
===================================================================
--- trunk/faxtomail-ui-web/pom.xml 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-web/pom.xml 2014-02-06 16:42:22 UTC (rev 7)
@@ -63,6 +63,11 @@
</dependency>
<dependency>
+ <groupId>org.nuiton.jaxx</groupId>
+ <artifactId>jaxx-application-api</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -2,22 +2,16 @@
import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaApplicationContext;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
-import com.franciaflex.faxtomail.services.DefaultFaxToMailServiceContext;
import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
import com.franciaflex.faxtomail.services.service.FaxToMailWebApplicationContext;
import com.franciaflex.faxtomail.services.service.InitFaxToMailService;
import com.franciaflex.faxtomail.web.DefaultFaxToMailWebApplicationContext;
-import com.opensymphony.xwork2.util.LocalizedTextUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.LogManager;
import org.apache.log4j.PropertyConfigurator;
-import org.nuiton.i18n.I18n;
-import org.nuiton.i18n.init.DefaultI18nInitializer;
-import org.nuiton.i18n.init.I18nInitializer;
import java.io.File;
-import java.util.Locale;
public class FaxToMailApplicationContext {
@@ -27,13 +21,10 @@
protected static FaxToMailTopiaApplicationContext topiaApplicationContext;
- protected static FaxToMailApplicationConfig applicationConfig;
+ protected static FaxToMailConfiguration applicationConfig;
- public static FaxToMailApplicationConfig getApplicationConfig() {
- if (applicationConfig == null) {
- applicationConfig = new FaxToMailApplicationConfig();
- }
- return applicationConfig;
+ public static FaxToMailConfiguration getApplicationConfig() {
+ return FaxToMailConfiguration.getInstance();
}
public static FaxToMailTopiaApplicationContext getTopiaApplicationContext() {
@@ -53,10 +44,10 @@
public FaxToMailServiceContext newServiceContext(FaxToMailTopiaPersistenceContext persistenceContext) {
- DefaultFaxToMailServiceContext newServiceContext =
- new DefaultFaxToMailServiceContext();
+ FaxToMailServiceContext newServiceContext =
+ new FaxToMailServiceContext();
- FaxToMailApplicationConfig applicationConfig = getApplicationConfig();
+ FaxToMailConfiguration applicationConfig = getApplicationConfig();
newServiceContext.setApplicationConfig(applicationConfig);
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/DefaultFaxToMailWebApplicationContext.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/DefaultFaxToMailWebApplicationContext.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/DefaultFaxToMailWebApplicationContext.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -24,7 +24,6 @@
* #L%
*/
-import com.franciaflex.faxtomail.FaxToMailTechnicalException;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.services.service.FaxToMailWebApplicationContext;
import com.google.common.base.Charsets;
@@ -33,6 +32,7 @@
import com.google.common.collect.Sets;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.jaxx.application.ApplicationTechnicalException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
@@ -69,7 +69,7 @@
if (log.isErrorEnabled()) {
log.error("should never occur", e);
}
- throw new FaxToMailTechnicalException(e);
+ throw new ApplicationTechnicalException(e);
}
stringBuilder.append('?').append(Joiner.on('&').join(queryStringElements));
}
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailActionSupport.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailActionSupport.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailActionSupport.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -24,7 +24,7 @@
* #L%
*/
-import com.franciaflex.faxtomail.FaxToMailApplicationConfig;
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.nuiton.topia.persistence.TopiaEntity;
@@ -39,15 +39,15 @@
public static final String NEXT = "next";
- protected FaxToMailApplicationConfig applicationConfig;
+ protected FaxToMailConfiguration applicationConfig;
private FaxToMailSession session;
- public void setApplicationConfig(FaxToMailApplicationConfig applicationConfig) {
+ public void setApplicationConfig(FaxToMailConfiguration applicationConfig) {
this.applicationConfig = applicationConfig;
}
- public FaxToMailApplicationConfig getApplicationConfig() {
+ public FaxToMailConfiguration getApplicationConfig() {
return applicationConfig;
}
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -24,8 +24,8 @@
* #L%
*/
-import com.franciaflex.faxtomail.FaxToMailApplicationConfig;
import com.franciaflex.faxtomail.FaxToMailApplicationContext;
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
import com.franciaflex.faxtomail.services.FaxToMailService;
import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
@@ -116,7 +116,7 @@
toInject = faxToMailSession;
- } else if (FaxToMailApplicationConfig.class.isAssignableFrom(propertyType)) {
+ } else if (FaxToMailConfiguration.class.isAssignableFrom(propertyType)) {
toInject = getFaxToMailApplicationContext(invocation).getApplicationConfig();
1
0
Build failed in Jenkins: faxtomail » FaxToMail :: Persistence #3
by admin+ci-codelutin.com@codelutin.com 06 Feb '14
by admin+ci-codelutin.com@codelutin.com 06 Feb '14
06 Feb '14
See <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building FaxToMail :: Persistence 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ faxtomail-persistence ---
[INFO] Deleting <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ faxtomail-persistence ---
[INFO]
[INFO] --- eugene-maven-plugin:2.7.4:generate (default) @ faxtomail-persistence ---
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/nui…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/nui… (0 B at 0.0 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/top…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/nuiton/topia/topia-persistence/3.0-…
[INFO] Downloaded: http://repo.maven.apache.org/maven2/org/nuiton/topia/topia-persistence/3.0-… (0 B at 0.0 KB/sec)
[INFO] Process phase [zargo] for one entry.
[INFO] Expanding 1 xmi file(s) from <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] Will generate <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] Copy file <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…> to <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] Generate one file in 12.139ms.
[INFO] Process phase [xmi] for one entry.
[INFO] Processing XSL tranformation on <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…> for 1 file(s).
[INFO] Will generate <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] Copy file <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…> to <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] Generate one file in 696.813ms.
[INFO] Process phase [model] for one entry.
WARN [pool-1-thread-1 for channel] (AbstractObjectModelReader.java:126) beforeReadFile - No properties provider filled, will instanciate a new default one
WARN [pool-1-thread-1 for channel] (AbstractObjectModelReader.java:294) loadModelTagValue - Invalid model tag value [model.tagValue.java.lang.String] : the tagvalue 'java.lang.String' is unkown.
WARN [pool-1-thread-1 for channel] (AbstractObjectModelReader.java:303) loadModelTagValue - Invalid model tag value [model.tagValue.useEnumerationName] : this tagvalue 'useEnumerationName' can not be apply on the model.
INFO [pool-1-thread-1 for channel] (AbstractObjectModelReader.java:270) loadModelProperties - 5 tag values were succesfull imported from <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] No file generated.
[INFO] Apply generator TopiaMetaTransformer
[INFO] Add compile source root : <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] Add resource root :Resource {targetPath: null, filtering: false, FileSet {directory: <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…,> PatternSet [includes: {}, excludes: {**/*.java}]}}
[INFO]
[INFO] --- i18n-maven-plugin:3.0:parserJava (scan-sources) @ faxtomail-persistence ---
[INFO]
[INFO] >>> i18n-maven-plugin:3.0:gen (scan-sources) @ faxtomail-persistence >>>
[INFO]
[INFO] --- i18n-maven-plugin:3.0:get (get) @ faxtomail-persistence ---
[INFO] Copying faxtomail-persistence.properties to <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] Copying faxtomail-persistence.properties to <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO]
[INFO] <<< i18n-maven-plugin:3.0:gen (scan-sources) @ faxtomail-persistence <<<
[INFO]
[INFO] --- i18n-maven-plugin:3.0:gen (scan-sources) @ faxtomail-persistence ---
[WARNING] bundle fr_FR contains 2/2 empty entries! (use -Di18n.showEmpty to see these entries)
[WARNING] bundle en_GB contains 2/2 empty entries! (use -Di18n.showEmpty to see these entries)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ faxtomail-persistence ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] Copying 17 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ faxtomail-persistence ---
[INFO] Compiling 117 source files to <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[WARNING] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>: Some input files use unchecked or unsafe operations.
[WARNING] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>: Recompile with -Xlint:unchecked for details.
[INFO] 3 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[20,1] cannot find symbol
symbol: static _
location: class
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[23,1] cannot find symbol
symbol: static _
location: class
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[59,51] cannot find symbol
symbol: method _(java.lang.String,java.io.File)
location: class com.franciaflex.faxtomail.FaxToMailIOUtil
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[187,51] cannot find symbol
symbol: method _(java.lang.String,java.io.File)
location: class com.franciaflex.faxtomail.FaxToMailIOUtil
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[197,51] cannot find symbol
symbol: method _(java.lang.String,java.io.File)
location: class com.franciaflex.faxtomail.FaxToMailIOUtil
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[208,51] cannot find symbol
symbol: method _(java.lang.String,java.io.File)
location: class com.franciaflex.faxtomail.FaxToMailIOUtil
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[63,55] cannot find symbol
symbol: method _(java.lang.String,java.io.File)
location: class com.franciaflex.faxtomail.persistence.RessourceClassLoader
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[161,55] cannot find symbol
symbol: method _(java.lang.String,java.util.List<java.io.File>)
location: class com.franciaflex.faxtomail.persistence.RessourceClassLoader
[INFO] 8 errors
[INFO] -------------------------------------------------------------
[JENKINS] Archiving disabled
1
1
See <http://ci-ng.codelutin.com/jenkins/job/faxtomail/2/changes>
Changes:
[kmorin] start web admin part
------------------------------------------
[...truncated 750 lines...]
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[40,1] cannot find symbol
[ERROR] symbol: static t
[ERROR] location: class
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[30,1] cannot find symbol
[ERROR] symbol: static t
[ERROR] location: class
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[29,1] cannot find symbol
[ERROR] symbol: static t
[ERROR] location: class
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[34,1] cannot find symbol
[ERROR] symbol: static t
[ERROR] location: class
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[481,31] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[496,36] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[511,30] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[525,30] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[547,38] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[568,33] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[583,29] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[597,37] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[618,38] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[640,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[647,30] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[668,29] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[682,29] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[763,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[771,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[779,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[367,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[368,33] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[376,39] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[377,46] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[387,37] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[388,44] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[396,30] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[397,37] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[407,35] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[408,42] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[437,55] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[438,66] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[439,64] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[441,68] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[443,59] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[473,18] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[352,32] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[623,31] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[637,28] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[653,29] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[682,36] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[702,30] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[723,28] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[743,30] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[762,29] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[773,29] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[787,31] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[801,31] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[816,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[823,28] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[837,29] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[852,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[859,32] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[971,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1003,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1008,27] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1013,27] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1018,27] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1028,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1033,27] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1038,27] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1043,27] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1049,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1054,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1059,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1064,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project faxtomail-ui-swing: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:858)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 30 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
Failed to send e-mail to kmorin because no e-mail address is known, and no default e-mail domain is configured
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :faxtomail-ui-swing
Sending e-mails to: faxtomail-commits(a)list.forge.codelutin.com
channel stopped
Failed to send e-mail to kmorin because no e-mail address is known, and no default e-mail domain is configured
1
2
Jenkins build is back to normal : faxtomail » FaxToMail :: UI #4
by admin+ci-codelutin.com@codelutin.com 06 Feb '14
by admin+ci-codelutin.com@codelutin.com 06 Feb '14
06 Feb '14
06 Feb '14
Author: kmorin
Date: 2014-02-06 09:35:48 +0100 (Thu, 06 Feb 2014)
New Revision: 6
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/6
Log:
replace i18n _ by t
Modified:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailIOUtil.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfig.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigOption.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigProvider.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/AbstractFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionHelper.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfig.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfigOption.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfigProvider.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/CloseApplicationAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/GoToPreviousScreenAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ReloadFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailErrorHelper.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailIOUtil.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailIOUtil.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailIOUtil.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -20,7 +20,7 @@
import java.util.List;
import java.util.UUID;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* Useful methods around IO, all method errors are boxes a
@@ -56,7 +56,7 @@
try {
ZipUtil.compressFiles(archiveFile, source, files);
} catch (IOException e) {
- throw new FaxToMailTechnicalException(_(errorMessage, archiveFile), e);
+ throw new FaxToMailTechnicalException(t(errorMessage, archiveFile), e);
}
}
@@ -184,7 +184,7 @@
return Files.newReader(file, Charsets.UTF_8);
} catch (FileNotFoundException e) {
- throw new FaxToMailTechnicalException(_(errorMessage, file), e);
+ throw new FaxToMailTechnicalException(t(errorMessage, file), e);
}
}
@@ -194,7 +194,7 @@
return Files.newWriter(file, Charsets.UTF_8);
} catch (FileNotFoundException e) {
- throw new FaxToMailTechnicalException(_(errorMessage, file), e);
+ throw new FaxToMailTechnicalException(t(errorMessage, file), e);
}
}
@@ -205,7 +205,7 @@
try {
ZipUtil.uncompress(file, tempDir);
} catch (IOException e) {
- throw new FaxToMailTechnicalException(_(errorMessage, file), e);
+ throw new FaxToMailTechnicalException(t(errorMessage, file), e);
}
return tempDir;
}
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -17,7 +17,7 @@
import java.util.Enumeration;
import java.util.List;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* A class loader that search first in a given directory before in parent
@@ -60,7 +60,7 @@
this.directories.add(directory);
// force to create directory
- FaxToMailIOUtil.forceMkdir(directory, _("faxtomail.persistence.mkDir.error", directory));
+ FaxToMailIOUtil.forceMkdir(directory, t("faxtomail.persistence.mkDir.error", directory));
}
}
loader = null;
@@ -158,7 +158,7 @@
directories.toArray(new File[directories.size()]));
loader = URLClassLoader.newInstance(urls, null);
} catch (IOException e) {
- throw new FaxToMailTechnicalException(_("faxtomail.persistence.loader.error", directories), e);
+ throw new FaxToMailTechnicalException(t("faxtomail.persistence.loader.error", directories), e);
}
}
return loader;
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfig.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfig.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfig.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -7,8 +7,6 @@
import java.io.File;
import java.net.URL;
-import static org.nuiton.i18n.I18n._;
-
/**
* Configuration for the service layer.
*
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigOption.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigOption.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigOption.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -6,7 +6,7 @@
import java.io.File;
import java.net.URL;
-import static org.nuiton.i18n.I18n.n_;
+import static org.nuiton.i18n.I18n.n;
/**
* Option for service configuration.
@@ -19,35 +19,35 @@
// TRANSIENT CONFIG
VERSION(
"faxtomail.version",
- n_("faxtomail.config.option.version.description"),
+ n("faxtomail.config.option.version.description"),
"",
Version.class,
true,
true),
SITE_URL(
"faxtomail.site.url",
- n_("faxtomail.config.option.site.url.description"),
+ n("faxtomail.config.option.site.url.description"),
"http://maven-site.forge.codelutin.com/faxtomail",
URL.class,
true,
true),
ORGANIZATION_NAME(
"faxtomail.organizationName",
- n_("faxtomail.config.option.organizationName.description"),
+ n("faxtomail.config.option.organizationName.description"),
"",
String.class,
true,
true),
INCEPTION_YEAR(
"faxtomail.inceptionYear",
- n_("faxtomail.config.option.inceptionYear.description"),
+ n("faxtomail.config.option.inceptionYear.description"),
"2012",
Integer.class,
true,
true),
BASEDIR(
"faxtomail.basedir",
- n_("faxtomail.config.option.basedir.description"),
+ n("faxtomail.config.option.basedir.description"),
"${user.home}/.faxtomail",
File.class,
true,
@@ -55,14 +55,14 @@
),
DATA_DIRECTORY(
"faxtomail.data.directory",
- n_("faxtomail.config.option.data.directory.description"),
+ n("faxtomail.config.option.data.directory.description"),
"${faxtomail.basedir}/data",
File.class,
true,
true),
TMP_DIRECTORY(
"faxtomail.tmp.directory",
- n_("faxtomail.config.option.tmp.directory.description"),
+ n("faxtomail.config.option.tmp.directory.description"),
"${faxtomail.data.directory}/temp",
File.class,
true,
@@ -72,7 +72,7 @@
CSV_SEPARATOR(
"faxtomail.csv.separator",
- n_("faxtomail.config.option.csv.separator.description"),
+ n("faxtomail.config.option.csv.separator.description"),
";",
char.class);
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigProvider.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigProvider.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigProvider.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -6,7 +6,7 @@
import java.util.Locale;
-import static org.nuiton.i18n.I18n.l_;
+import static org.nuiton.i18n.I18n.l;
/**
* Service config provider (for site generation).
@@ -23,7 +23,7 @@
@Override
public String getDescription(Locale locale) {
- return l_(locale, "faxtomail.config.service");
+ return l(locale, "faxtomail.config.service");
}
@Override
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -33,7 +33,7 @@
import java.util.Map;
import java.util.Set;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* UI application context.
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/AbstractFaxToMailAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/AbstractFaxToMailAction.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/AbstractFaxToMailAction.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -16,7 +16,7 @@
import javax.swing.*;
import java.io.File;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* FaxToMail base action.
@@ -270,13 +270,13 @@
// file exists ask user to overwrite
String htmlMessage = String.format(
AbstractFaxToMailUIHandler.CONFIRMATION_FORMAT,
- _("faxtomail.common.askOverwriteFile.message", file),
- _("faxtomail.common.askOverwriteFile.help"));
+ t("faxtomail.common.askOverwriteFile.message", file),
+ t("faxtomail.common.askOverwriteFile.help"));
result = JOptionPane.showConfirmDialog(
getHandler().getTopestUI(),
htmlMessage,
- _("faxtomail.common.askOverwriteFile.title"),
+ t("faxtomail.common.askOverwriteFile.title"),
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION;
} else {
@@ -291,7 +291,7 @@
String htmlMessage = String.format(
AbstractFaxToMailUIHandler.CONFIRMATION_FORMAT,
message,
- _("faxtomail.common.askBeforeDelete.help"));
+ t("faxtomail.common.askBeforeDelete.help"));
int i = JOptionPane.showConfirmDialog(
getHandler().getTopestUI(),
htmlMessage,
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionHelper.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionHelper.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionHelper.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -8,7 +8,7 @@
import javax.swing.*;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* Useful method around FaxToMailUIAction.
@@ -110,7 +110,7 @@
A result = ConstructorUtils.invokeConstructor(actionName, handler);
return result;
} catch (Exception e) {
- throw new FaxToMailTechnicalException(_("faxtomail.action.create.error", actionName), e);
+ throw new FaxToMailTechnicalException(t("faxtomail.action.create.error", actionName), e);
}
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIHandler.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -18,7 +18,7 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* @author tchemit <chemit(a)codelutin.com>
@@ -193,12 +193,12 @@
}
protected void showAction(AbstractFaxToMailAction action) {
- ui.setTitle(_("faxtomail.main.title.action",
+ ui.setTitle(t("faxtomail.main.title.action",
// getConfig().getVersion(),
"0.1",
action.getActionDescription()));
ui.getGlobalActionLabel().setText(
- _("faxtomail.message.action.running",
+ t("faxtomail.message.action.running",
action.getActionDescription()));
ui.pack();
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfig.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfig.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfig.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -21,7 +21,7 @@
import java.util.Locale;
import java.util.Set;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* FaxToMail application config.
@@ -82,7 +82,7 @@
applicationConfig.parse(args);
} catch (ArgumentsParserException e) {
- throw new FaxToMailTechnicalException(_("faxtomail.config.parse.error"), e);
+ throw new FaxToMailTechnicalException(t("faxtomail.config.parse.error"), e);
}
//TODO Review this, this is very dirty to do this...
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfigOption.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfigOption.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfigOption.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -7,7 +7,7 @@
import java.io.File;
import java.util.Locale;
-import static org.nuiton.i18n.I18n.n_;
+import static org.nuiton.i18n.I18n.n;
/**
* All FaxToMail configuration options.
@@ -19,7 +19,7 @@
FAXTOMAIL_LAUNCH_MODE(
"faxtomail.launch.mode",
- n_("faxtomail.config.option.launch.mode.description"),
+ n("faxtomail.config.option.launch.mode.description"),
null,
String.class,
true,
@@ -28,7 +28,7 @@
FAXTOMAIL_I18N_DIRECTORY(
"faxtomail.i18n.directory",
- n_("faxtomail.config.option.i18n.directory.description"),
+ n("faxtomail.config.option.i18n.directory.description"),
"${faxtomail.basedir}/i18n",
File.class,
false,
@@ -37,7 +37,7 @@
// FAXTOMAIL_HELP_DIRECTORY(
// "faxtomail.help.directory",
-// n_("faxtomail.config.option.help.directory.description"),
+// n("faxtomail.config.option.help.directory.description"),
// "${faxtomail.basedir}/help",
// File.class,
// false,
@@ -46,7 +46,7 @@
START_ACTION_FILE(
"faxtomail.startActionFile",
- n_("faxtomail.config.option.startActionFile.description"),
+ n("faxtomail.config.option.startActionFile.description"),
"${faxtomail.basedir}/faxtomail-start-action",
File.class,
true,
@@ -54,41 +54,41 @@
),
FAXTOMAIL_I18N_LOCALE(
"faxtomail.i18n.locale",
- n_("faxtomail.config.option.i18n.locale.description"),
+ n("faxtomail.config.option.i18n.locale.description"),
Locale.FRANCE.getCountry(),
Locale.class
),
UI_CONFIG_FILE(
"faxtomail.ui.config.file",
- n_("faxtomail.config.option.ui.config.file.description"),
+ n("faxtomail.config.option.ui.config.file.description"),
"${faxtomail.data.directory}/faxtomailUI.xml",
File.class
),
AUTO_POPUP_NUMBER_EDITOR(
"faxtomail.ui.autoPopupNumberEditor",
- n_("faxtomail.config.option.ui.autoPopupNumberEditor.description"),
+ n("faxtomail.config.option.ui.autoPopupNumberEditor.description"),
String.valueOf(false),
Boolean.class
),
SHOW_NUMBER_EDITOR_BUTTON(
"faxtomail.ui.showNumberEditorButton",
- n_("faxtomail.config.option.ui.showNumberEditorButton.description"),
+ n("faxtomail.config.option.ui.showNumberEditorButton.description"),
String.valueOf(true),
Boolean.class
),
COLOR_ALTERNATE_ROW(
"faxtomail.ui.color.alternateRow",
- n_("faxtomail.config.option.ui.color.alternateRow.description"),
+ n("faxtomail.config.option.ui.color.alternateRow.description"),
new Color(217, 217, 217).toString(),
Color.class
),
COLOR_SELECTED_ROW(
"faxtomail.ui.color.selectedRow",
- n_("faxtomail.config.option.ui.color.selectedRow.description"),
+ n("faxtomail.config.option.ui.color.selectedRow.description"),
new Color(57,105,138).toString(),
Color.class
),
@@ -99,21 +99,21 @@
*/
COLOR_BLOCKING_LAYER(
"faxtomail.ui.color.blockingLayer",
- n_("faxtomail.config.option.ui.color.blockingLayer.description"),
+ n("faxtomail.config.option.ui.color.blockingLayer.description"),
new Color(200, 200, 200).toString(),
Color.class
),
SHORTCUT_CLOSE_POPUP(
"faxtomail.ui.shortcut.closePopup",
- n_("faxtomail.config.option.ui.shortcut.closePopup.description"),
+ n("faxtomail.config.option.ui.shortcut.closePopup.description"),
"alt pressed F",
KeyStroke.class
),
DATE_FORMAT(
"faxtomail.ui.dateFormat",
- n_("faxtomail.config.option.ui.dateFormat.description"),
+ n("faxtomail.config.option.ui.dateFormat.description"),
"dd/MM/yyyy",
String.class
);
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfigProvider.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfigProvider.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfigProvider.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -6,7 +6,7 @@
import java.util.Locale;
-import static org.nuiton.i18n.I18n.l_;
+import static org.nuiton.i18n.I18n.l;
/**
* Application config provider (for site generation).
@@ -23,7 +23,7 @@
@Override
public String getDescription(Locale locale) {
- return l_(locale, "faxtomail.config.application");
+ return l(locale, "faxtomail.config.application");
}
@Override
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/CloseApplicationAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/CloseApplicationAction.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/CloseApplicationAction.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -2,7 +2,7 @@
import com.franciaflex.faxtomail.ui.swing.RunFaxToMail;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* To close FaxToMail Application.
@@ -17,7 +17,7 @@
public CloseApplicationAction(MainUIHandler handler) {
super(handler, false, null);
setSkipCheckCurrentScreen(true);
- setActionDescription(_("faxtomail.main.action.exit.tip"));
+ setActionDescription(t("faxtomail.main.action.exit.tip"));
}
public void setExitCode(int exitCode) {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/GoToPreviousScreenAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/GoToPreviousScreenAction.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/GoToPreviousScreenAction.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -1,6 +1,6 @@
package com.franciaflex.faxtomail.ui.swing.content;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* To return on previous screen.
@@ -15,6 +15,6 @@
true,
PREVIOUS_SCREEN.getContextValue(handler.getUI())
);
- setActionDescription(_("faxtomail.main.action.goto.previousScreen.tip"));
+ setActionDescription(t("faxtomail.main.action.goto.previousScreen.tip"));
}
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -30,7 +30,7 @@
import java.beans.PropertyChangeListenerProxy;
import java.util.Locale;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* @author tchemit <chemit(a)codelutin.com>
@@ -358,26 +358,26 @@
case CONFIG:
screenUI = new FaxToMailConfigUI(ui);
- screenTitle = _("faxtomail.config.title");
+ screenTitle = t("faxtomail.config.title");
icon = ui.getMenuFileConfiguration().getIcon();
break;
case SEARCH:
screenUI = new SearchUI(ui);
- screenTitle = _("faxtomail.search.title");
+ screenTitle = t("faxtomail.search.title");
icon = ui.getMenuFileConfiguration().getIcon();
break;
case DEMANDE:
screenUI = new DemandeUI(ui);
- screenTitle = _("faxtomail.demande.title");
+ screenTitle = t("faxtomail.demande.title");
icon = ui.getMenuFileConfiguration().getIcon();
break;
default:
case LIST:
screenUI = new DemandeListUI(ui);
- screenTitle = _("faxtomail.demandeList.title");
+ screenTitle = t("faxtomail.demandeList.title");
icon = ui.getMenuFileConfiguration().getIcon();
break;
}
@@ -409,7 +409,7 @@
String title = getSelectedCruiseTitle();
- ui.setTitle(_("faxtomail.main.title.application",
+ ui.setTitle(t("faxtomail.main.title.application",
// getConfig().getVersion(),
"0.1",
title));
@@ -471,7 +471,7 @@
// no db loaded
- title = _("faxtomail.main.title.nodb");
+ title = t("faxtomail.main.title.nodb");
// }
return title;
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ReloadFaxToMailAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ReloadFaxToMailAction.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ReloadFaxToMailAction.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -2,7 +2,7 @@
import com.franciaflex.faxtomail.ui.swing.RunFaxToMail;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* To reload FaxToMail application.
@@ -14,7 +14,7 @@
public ReloadFaxToMailAction(MainUIHandler handler) {
super(handler, true, null);
- setActionDescription(_("faxtomail.main.action.reloadFaxToMail"));
+ setActionDescription(t("faxtomail.main.action.reloadFaxToMail"));
}
@Override
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -7,8 +7,6 @@
import java.io.File;
-import static org.nuiton.i18n.I18n._;
-
/**
* Start action (when the start action file is present when
* starting application).
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -44,7 +44,7 @@
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* Handler of UI {@link com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUIHandler}.
@@ -62,9 +62,9 @@
String result;
if (exist) {
- result = _("tutti.editCruise.title.edit.cruise");
+ result = t("tutti.editCruise.title.edit.cruise");
} else {
- result = _("tutti.editCruise.title.create.cruise");
+ result = t("tutti.editCruise.title.create.cruise");
}
return result;
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -34,7 +34,7 @@
import javax.swing.*;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* Handler of UI {@link DemandeUIHandler}.
@@ -52,9 +52,9 @@
String result;
if (exist) {
- result = _("tutti.editCruise.title.edit.cruise");
+ result = t("tutti.editCruise.title.edit.cruise");
} else {
- result = _("tutti.editCruise.title.create.cruise");
+ result = t("tutti.editCruise.title.create.cruise");
}
return result;
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -47,7 +47,7 @@
import java.util.List;
import java.util.Set;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* Handler of UI {@link SearchUIHandler}.
@@ -65,9 +65,9 @@
String result;
if (exist) {
- result = _("tutti.editCruise.title.edit.cruise");
+ result = t("tutti.editCruise.title.edit.cruise");
} else {
- result = _("tutti.editCruise.title.create.cruise");
+ result = t("tutti.editCruise.title.create.cruise");
}
return result;
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -46,7 +46,7 @@
import java.util.List;
import java.util.Map;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* Contract of any UI handler.
@@ -225,11 +225,11 @@
String htmlMessage = String.format(
CONFIRMATION_FORMAT,
message,
- _("faxtomail.common.askSaveBeforeLeaving.help"));
+ t("faxtomail.common.askSaveBeforeLeaving.help"));
int result = JOptionPane.showConfirmDialog(
getTopestUI(),
htmlMessage,
- _("faxtomail.common.askSaveBeforeLeaving.title"),
+ t("faxtomail.common.askSaveBeforeLeaving.title"),
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE);
return result;
@@ -239,11 +239,11 @@
String htmlMessage = String.format(
CONFIRMATION_FORMAT,
message,
- _("faxtomail.common.askCancelEditBeforeLeaving.help"));
+ t("faxtomail.common.askCancelEditBeforeLeaving.help"));
int i = JOptionPane.showConfirmDialog(
getTopestUI(),
htmlMessage,
- _("faxtomail.common.askCancelEditBeforeLeaving.title"),
+ t("faxtomail.common.askCancelEditBeforeLeaving.title"),
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE);
@@ -680,7 +680,7 @@
}
// String dateFormat = getConfig().getDateFormat();
picker.setFormats("dd/MM/yyyy");
- picker.setToolTipText(_("faxtomail.common.datefield.tip", "dd/MM/yyyy"));
+ picker.setToolTipText(t("faxtomail.common.datefield.tip", "dd/MM/yyyy"));
picker.getEditor().addFocusListener(new FocusAdapter() {
@Override
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailErrorHelper.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailErrorHelper.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailErrorHelper.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -8,7 +8,7 @@
import javax.swing.*;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* helper around errors in FaxToMail.
@@ -34,7 +34,7 @@
if (cause == null) {
JOptionPane.showMessageDialog(context.getMainUI(), "<html><body>" + message + "</body></html>",
- _("faxtomail.error.ui.business.error"),
+ t("faxtomail.error.ui.business.error"),
JOptionPane.ERROR_MESSAGE);
// } else if (cause instanceof FaxToMailBusinessException) {
// JOptionPane.showMessageDialog(context.getMainUI(), "<html><body>" + cause.getMessage() + "</body></html>",
@@ -42,13 +42,13 @@
// JOptionPane.ERROR_MESSAGE);
} else if (cause instanceof ImportRuntimeException) {
JOptionPane.showMessageDialog(context.getMainUI(), cause.getMessage(),
- _("faxtomail.error.ui.business.error"),
+ t("faxtomail.error.ui.business.error"),
JOptionPane.ERROR_MESSAGE);
} else {
JXErrorPane pane = new JXErrorPane();
- ErrorInfo info = new ErrorInfo(_("faxtomail.error.ui.other.error"),
- _("faxtomail.error.errorpane.htmlmessage", message), null, null,
+ ErrorInfo info = new ErrorInfo(t("faxtomail.error.ui.other.error"),
+ t("faxtomail.error.errorpane.htmlmessage", message), null, null,
cause, null, null);
pane.setErrorInfo(info);
pane.setErrorReporter(this);
@@ -80,7 +80,7 @@
public void showWarningDialog(String message) {
JOptionPane.showMessageDialog(context.getMainUI(), "<html><body>" + message + "</body></html>",
- _("faxtomail.error.ui.business.warning"),
+ t("faxtomail.error.ui.business.warning"),
JOptionPane.WARNING_MESSAGE);
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -42,7 +42,7 @@
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* @author tchemit <chemit(a)codelutin.com>
@@ -63,7 +63,7 @@
try {
PropertyUtils.setSimpleProperty(bean, property, value);
} catch (Exception e) {
- throw new FaxToMailTechnicalException(_("faxtomail.property.set.error", property, bean.getClass().getName()), e);
+ throw new FaxToMailTechnicalException(t("faxtomail.property.set.error", property, bean.getClass().getName()), e);
}
}
@@ -73,7 +73,7 @@
try {
return PropertyUtils.getSimpleProperty(bean, property);
} catch (Exception e) {
- throw new FaxToMailTechnicalException(_("faxtomail.property.get.error", property, bean.getClass().getName()), e);
+ throw new FaxToMailTechnicalException(t("faxtomail.property.get.error", property, bean.getClass().getName()), e);
}
}
@@ -105,7 +105,7 @@
try {
openLink(url.toURI());
} catch (URISyntaxException e) {
- throw new FaxToMailTechnicalException(_("swing.error.cannot.open.link", url), e);
+ throw new FaxToMailTechnicalException(t("swing.error.cannot.open.link", url), e);
}
}
@@ -113,7 +113,7 @@
if (!Desktop.isDesktopSupported()) {
throw new FaxToMailTechnicalException(
- _("swing.error.desktop.not.supported"));
+ t("swing.error.desktop.not.supported"));
}
Desktop desktop = Desktop.getDesktop();
@@ -121,7 +121,7 @@
if (!desktop.isSupported(Desktop.Action.BROWSE)) {
throw new FaxToMailTechnicalException(
- _("swing.error.desktop.browse.not.supported"));
+ t("swing.error.desktop.browse.not.supported"));
}
return desktop;
@@ -137,7 +137,7 @@
} catch (Exception e) {
throw new FaxToMailTechnicalException(
- _("swing.error.cannot.open.link", uri), e);
+ t("swing.error.cannot.open.link", uri), e);
}
}
@@ -145,7 +145,7 @@
if (!Desktop.isDesktopSupported()) {
throw new FaxToMailTechnicalException(
- _("swing.error.desktop.not.supported"));
+ t("swing.error.desktop.not.supported"));
}
Desktop desktop = Desktop.getDesktop();
@@ -153,7 +153,7 @@
if (!desktop.isSupported(Desktop.Action.MAIL)) {
throw new FaxToMailTechnicalException(
- _("swing.error.desktop.mail.not.supported"));
+ t("swing.error.desktop.mail.not.supported"));
}
return desktop;
@@ -170,7 +170,7 @@
} catch (Exception e) {
throw new FaxToMailTechnicalException(
- _("swing.error.cannot.mail"), e);
+ t("swing.error.cannot.mail"), e);
}
}
1
0
Author: kmorin
Date: 2014-02-05 19:56:18 +0100 (Wed, 05 Feb 2014)
New Revision: 5
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/5
Log:
use latest versions
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-02-05 18:34:13 UTC (rev 4)
+++ trunk/pom.xml 2014-02-05 18:56:18 UTC (rev 5)
@@ -6,7 +6,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>4.5</version>
+ <version>4.7</version>
</parent>
<groupId>com.franciaflex</groupId>
@@ -78,17 +78,17 @@
<!-- libraries version -->
- <nuitonI18nVersion>2.5.2</nuitonI18nVersion>
- <nuitonConfigVersion>3.0-alpha-1</nuitonConfigVersion>
- <nuitonCsvVersion>3.0-alpha-1</nuitonCsvVersion>
- <nuitonDecoratorVersion>3.0-alpha-2</nuitonDecoratorVersion>
- <nuitonUpdaterVersion>3.0-alpha-1</nuitonUpdaterVersion>
- <nuitonUtilsVersion>2.7.1</nuitonUtilsVersion>
- <nuitonValidatorVersion>3.0-alpha-2</nuitonValidatorVersion>
- <nuitonWebVersion>1.14</nuitonWebVersion>
+ <nuitonI18nVersion>3.0</nuitonI18nVersion>
+ <nuitonConfigVersion>3.0-alpha-2</nuitonConfigVersion>
+ <nuitonCsvVersion>3.0-alpha-3</nuitonCsvVersion>
+ <nuitonDecoratorVersion>3.0-alpha-3</nuitonDecoratorVersion>
+ <nuitonUpdaterVersion>3.0-alpha-2</nuitonUpdaterVersion>
+ <nuitonUtilsVersion>3.0-rc-2</nuitonUtilsVersion>
+ <nuitonValidatorVersion>3.0-alpha-3</nuitonValidatorVersion>
+ <nuitonWebVersion>1.15-alpha-3</nuitonWebVersion>
- <eugeneVersion>2.7.3</eugeneVersion>
- <topiaVersion>3.0-SNAPSHOT</topiaVersion>
+ <eugeneVersion>2.7.4</eugeneVersion>
+ <topiaVersion>3.0-alpha-10</topiaVersion>
<hibernateVersion>4.2.8.Final</hibernateVersion>
<h2Version>1.3.174</h2Version>
1
0
Build failed in Jenkins: faxtomail » FaxToMail :: UI #2
by admin+ci-codelutin.com@codelutin.com 05 Feb '14
by admin+ci-codelutin.com@codelutin.com 05 Feb '14
05 Feb '14
See <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
Changes:
[kmorin] start web admin part
------------------------------------------
[...truncated 72 lines...]
[INFO] >>> i18n-maven-plugin:2.5.2:bundle (make-bundle) @ faxtomail-ui-swing >>>
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:collect-i18n-artifacts (collect-i18n-artifacts) @ faxtomail-ui-swing ---
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/nui…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/nui… (0 B at 0.0 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/nuiton/jaxx/2.8/jaxx-2.8.pom
[INFO] Downloaded: http://repo.maven.apache.org/maven2/org/nuiton/jaxx/2.8/jaxx-2.8.pom (0 B at 0.0 KB/sec)
[INFO] collected 11 i18n artifacts for locale fr_FR stored in <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] collected 11 i18n artifacts for locale en_GB stored in <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO]
[INFO] <<< i18n-maven-plugin:2.5.2:bundle (make-bundle) @ faxtomail-ui-swing <<<
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:bundle (make-bundle) @ faxtomail-ui-swing ---
[WARNING] bundle fr_FR contains 160/398 empty entries! (use -Di18n.showEmpty to see these entries)
[WARNING] bundle en_GB contains 243/415 empty entries! (use -Di18n.showEmpty to see these entries)
[INFO]
[INFO] --- license-maven-plugin:1.5:update-project-license (attach-licenses) @ faxtomail-ui-swing ---
[INFO] Will create or update license file [gpl_v3] to <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO]
[INFO] --- license-maven-plugin:1.5:add-third-party (attach-licenses) @ faxtomail-ui-swing ---
[WARNING] No license name defined for org.hibernate.javax.persistence--hibernate-jpa-2.0-api--1.0.1.Final
[INFO] Load missing file <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] Missing file <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…> is up-to-date.
[INFO] Writing third-party file to <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] Writing bundled third-party file to <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] Will attach third party file from <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ faxtomail-ui-swing ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] Copying 8 resources
[INFO] Copying 4 resources
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ faxtomail-ui-swing ---
[INFO] Compiling 47 source files to <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[WARNING] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>: Some input files use unchecked or unsafe operations.
[WARNING] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>: Recompile with -Xlint:unchecked for details.
[INFO] 3 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[40,1] cannot find symbol
symbol: static t
location: class
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[30,1] cannot find symbol
symbol: static t
location: class
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[29,1] cannot find symbol
symbol: static t
location: class
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[34,1] cannot find symbol
symbol: static t
location: class
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[481,31] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[496,36] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[511,30] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[525,30] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[547,38] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[568,33] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[583,29] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[597,37] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[618,38] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[640,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[647,30] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[668,29] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[682,29] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[763,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[771,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[779,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[367,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[368,33] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[376,39] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[377,46] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[387,37] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[388,44] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[396,30] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[397,37] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[407,35] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[408,42] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[437,55] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[438,66] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[439,64] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[441,68] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[443,59] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[473,18] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[352,32] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[623,31] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[637,28] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[653,29] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[682,36] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[702,30] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[723,28] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[743,30] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[762,29] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[773,29] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[787,31] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[801,31] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[816,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[823,28] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[837,29] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[852,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[859,32] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[971,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1003,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1008,27] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1013,27] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1018,27] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1028,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1033,27] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1038,27] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1043,27] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1049,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1054,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1059,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1064,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[INFO] 66 errors
[INFO] -------------------------------------------------------------
[JENKINS] Archiving disabled
1
0
05 Feb '14
Author: kmorin
Date: 2014-02-05 19:34:13 +0100 (Wed, 05 Feb 2014)
New Revision: 4
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/4
Log:
start web admin part
Added:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfig.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfigOption.java
trunk/faxtomail-persistence/src/main/resources/faxtomail.properties
trunk/faxtomail-persistence/src/main/xmi/
trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DefaultFaxToMailServiceContext.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/CompanyService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/FaxToMailWebApplicationContext.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java
trunk/faxtomail-ui-swing/src/main/assembly/
trunk/faxtomail-ui-swing/src/main/assembly/faxtomail-full-component.xml
trunk/faxtomail-ui-swing/src/main/assembly/full-linux-i586.xml
trunk/faxtomail-ui-swing/src/main/assembly/full-linux-x64.xml
trunk/faxtomail-ui-swing/src/main/assembly/full-windows-i586.xml
trunk/faxtomail-ui-swing/src/main/assembly/full-windows-x64.xml
trunk/faxtomail-ui-swing/src/main/assembly/full/
trunk/faxtomail-ui-swing/src/main/assembly/full/faxtomail.bat
trunk/faxtomail-ui-swing/src/main/assembly/full/faxtomail.sh
trunk/faxtomail-ui-swing/src/main/assembly/i18n.xml
trunk/faxtomail-ui-swing/src/main/assembly/min/
trunk/faxtomail-ui-swing/src/main/assembly/min/README.txt
trunk/faxtomail-ui-swing/src/main/assembly/min/launch.bat
trunk/faxtomail-ui-swing/src/main/assembly/min/launch.sh
trunk/faxtomail-ui-swing/src/main/assembly/standalone.xml
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/AbstractFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionException.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionHelper.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionSwingWorker.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailUIAction.java
trunk/faxtomail-ui-web/
trunk/faxtomail-ui-web/LICENSE.txt
trunk/faxtomail-ui-web/README.txt
trunk/faxtomail-ui-web/pom.xml
trunk/faxtomail-ui-web/src/
trunk/faxtomail-ui-web/src/main/
trunk/faxtomail-ui-web/src/main/java/
trunk/faxtomail-ui-web/src/main/java/com/
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/DefaultFaxToMailWebApplicationContext.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailActionSupport.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailApplicationListener.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailEntityNotFoundException.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailIllegalAccessException.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailNoIdException.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailSession.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailStrutsObjectFactory.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/IndexAction.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
trunk/faxtomail-ui-web/src/main/resources/
trunk/faxtomail-ui-web/src/main/resources/i18n/
trunk/faxtomail-ui-web/src/main/resources/i18n/faxtomail-web_fr_FR.properties
trunk/faxtomail-ui-web/src/main/resources/log4j.properties
trunk/faxtomail-ui-web/src/main/resources/shiro.ini
trunk/faxtomail-ui-web/src/main/resources/struts.properties
trunk/faxtomail-ui-web/src/main/resources/struts.xml
trunk/faxtomail-ui-web/src/main/resources/validators.xml
trunk/faxtomail-ui-web/src/main/resources/xwork-conversion.properties
trunk/faxtomail-ui-web/src/main/webapp/
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration.jsp
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/index.jsp
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators.xml
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/version.jsp
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/web.xml
trunk/faxtomail-ui-web/src/main/webapp/css/
trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css
trunk/faxtomail-ui-web/src/main/webapp/css/jstree/
trunk/faxtomail-ui-web/src/main/webapp/css/jstree/themes/
trunk/faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/
trunk/faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/32px.png
trunk/faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/40px.png
trunk/faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/style.css
trunk/faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/style.min.css
trunk/faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/throbber.gif
trunk/faxtomail-ui-web/src/main/webapp/css/select2/
trunk/faxtomail-ui-web/src/main/webapp/css/select2/select2-spinner.gif
trunk/faxtomail-ui-web/src/main/webapp/css/select2/select2.css
trunk/faxtomail-ui-web/src/main/webapp/css/select2/select2.png
trunk/faxtomail-ui-web/src/main/webapp/css/select2/select2x2.png
trunk/faxtomail-ui-web/src/main/webapp/js/
trunk/faxtomail-ui-web/src/main/webapp/js/jquery.ui.touch.js
trunk/faxtomail-ui-web/src/main/webapp/js/jstree/
trunk/faxtomail-ui-web/src/main/webapp/js/jstree/jstree.js
trunk/faxtomail-ui-web/src/main/webapp/js/jstree/jstree.min.js
trunk/faxtomail-ui-web/src/main/webapp/js/require.js
trunk/faxtomail-ui-web/src/main/webapp/js/select2/
trunk/faxtomail-ui-web/src/main/webapp/js/select2/LICENSE
trunk/faxtomail-ui-web/src/main/webapp/js/select2/select2.min.js
trunk/faxtomail-ui-web/src/main/webapp/js/select2/select2_locale_fr.js
Removed:
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/service/
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/AbstractFaxToMailService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/AbstractFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionException.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionHelper.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionSwingWorker.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailUIAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/action/
Modified:
trunk/faxtomail-persistence/pom.xml
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailDecorator.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfig.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigOption.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigProvider.java
trunk/faxtomail-service/src/main/resources/META-INF/services/org.nuiton.config.ApplicationConfigProvider
trunk/faxtomail-ui-swing/pom.xml
trunk/faxtomail-ui-swing/src/license/THIRD-PARTY.properties
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailScreen.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfig.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractMainUIFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailExceptionHandler.java
trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties
trunk/pom.xml
Modified: trunk/faxtomail-persistence/pom.xml
===================================================================
--- trunk/faxtomail-persistence/pom.xml 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-persistence/pom.xml 2014-02-05 18:34:13 UTC (rev 4)
@@ -19,6 +19,16 @@
<!-- commons -->
<dependency>
+ <groupId>org.nuiton.topia</groupId>
+ <artifactId>topia-persistence</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-c3p0</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.nuiton</groupId>
<artifactId>nuiton-utils</artifactId>
</dependency>
@@ -124,33 +134,26 @@
</pluginManagement>
<plugins>
- <!--<plugin>-->
- <!--<groupId>org.nuiton.eugene</groupId>-->
- <!--<artifactId>eugene-maven-plugin</artifactId>-->
- <!--<configuration>-->
- <!--<resolver>org.nuiton.util.FasterCachedResourceResolver</resolver>-->
- <!--<templates>-->
- <!--org.nuiton.eugene.java.JavaInterfaceTransformer,-->
- <!--org.nuiton.eugene.java.SimpleJavaBeanTransformer,-->
- <!--org.nuiton.eugene.java.JavaEnumerationTransformer-->
- <!--</templates>-->
- <!--</configuration>-->
- <!--<executions>-->
- <!--<execution>-->
- <!--<phase>generate-sources</phase>-->
- <!--<configuration>-->
- <!--<defaultPackage>fr.ifremer.tutti.persistence.entities-->
- <!--</defaultPackage>-->
- <!--<fullPackagePath>fr.ifremer.tutti.persistence.entities-->
- <!--</fullPackagePath>-->
- <!--<inputs>zargo</inputs>-->
- <!--</configuration>-->
- <!--<goals>-->
- <!--<goal>generate</goal>-->
- <!--</goals>-->
- <!--</execution>-->
- <!--</executions>-->
- <!--</plugin>-->
+ <plugin>
+ <groupId>org.nuiton.eugene</groupId>
+ <artifactId>eugene-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <configuration>
+ <inputs>zargo</inputs>
+ <defaultPackage>com.franciaflex.faxtomail.persistence.entities</defaultPackage>
+ <fullPackagePath>com.franciaflex.faxtomail.persistence.entities</fullPackagePath>
+ <templates>
+ org.nuiton.topia.templates.TopiaMetaTransformer
+ </templates>
+ </configuration>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.nuiton.i18n</groupId>
Added: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfig.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfig.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfig.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,124 @@
+package com.franciaflex.faxtomail;
+
+/*
+ * #%L
+ * Extranet ENC-AHI :: Persistence
+ * $Id: ExtranetEncAhiApplicationConfig.java 866 2013-12-13 10:34:05Z bleny $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-persiste… $
+ * %%
+ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.config.ApplicationConfig;
+import org.nuiton.config.ArgumentsParserException;
+
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+public class FaxToMailApplicationConfig {
+
+ private static final Log log = LogFactory.getLog(FaxToMailApplicationConfig.class);
+
+ protected ApplicationConfig applicationConfig;
+
+ public FaxToMailApplicationConfig() {
+ applicationConfig = new ApplicationConfig();
+ applicationConfig.loadDefaultOptions(FaxToMailApplicationConfigOption.values());
+ applicationConfig.setConfigFileName("faxtomail.properties");
+ try {
+ applicationConfig.parse();
+ } catch (ArgumentsParserException e) {
+ throw new FaxToMailTechnicalException(e);
+ }
+ if (log.isInfoEnabled()) {
+ StringBuilder builder = new StringBuilder();
+ List<FaxToMailApplicationConfigOption> options =
+ Lists.newArrayList(FaxToMailApplicationConfigOption.values());
+ for (FaxToMailApplicationConfigOption option : options) {
+ String key = option.getKey();
+ Object value = applicationConfig.getOption(option);
+ builder.append(String.format("\n%1$-40s = %2$s",
+ key,
+ value));
+ }
+ log.info("faxtomail: " + builder.toString());
+ }
+ }
+
+ public boolean isDevMode() {
+ boolean isDevMode = applicationConfig.getOptionAsBoolean(FaxToMailApplicationConfigOption.DEV_MODE.key);
+ return isDevMode;
+ }
+
+ public Map<String, String> getTopiaProperties() {
+ Map<String, String> jpaParameters = Maps.newHashMap();
+ Properties hibernateProperties = applicationConfig.getOptionStartsWith("hibernate");
+ jpaParameters.putAll((Map) hibernateProperties);
+ return jpaParameters;
+ }
+
+ /**
+ * @return Le nom d'hôte du serveur SMTP.
+ */
+ public String getSmtpHost() {
+ return applicationConfig.getOption(FaxToMailApplicationConfigOption.SMTP_HOST.key);
+ }
+
+ /**
+ * @return Le port du serveur SMTP.
+ */
+ public int getSmtpPort() {
+ return applicationConfig.getOptionAsInt(FaxToMailApplicationConfigOption.SMTP_PORT.key);
+ }
+
+ /**
+ * @return L'adresse d'expéditeur pour les mails de notifications
+ */
+ public String getSmtpFrom() {
+ return applicationConfig.getOption(FaxToMailApplicationConfigOption.SMTP_FROM.key);
+ }
+
+ public String getInstanceUrl() {
+ return applicationConfig.getOption(FaxToMailApplicationConfigOption.INSTANCE_URL.key);
+ }
+
+ public String getInstanceDisclaimer() {
+ return applicationConfig.getOption(FaxToMailApplicationConfigOption.INSTANCE_DISCLAIMER.key);
+ }
+
+ public File getStorageFile() {
+ return applicationConfig.getOptionAsFile(FaxToMailApplicationConfigOption.STORAGE_FILE.key);
+ }
+
+ public boolean isLogConfigurationProvided() {
+ boolean logConfigurationProvided =
+ StringUtils.isNotBlank(applicationConfig.getOption(FaxToMailApplicationConfigOption.LOG_CONFIGURATION_FILE.key));
+ return logConfigurationProvided;
+ }
+
+ public File getLogConfigurationFile() {
+ return applicationConfig.getOptionAsFile(FaxToMailApplicationConfigOption.LOG_CONFIGURATION_FILE.key);
+ }
+}
Added: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfigOption.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfigOption.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfigOption.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,142 @@
+package com.franciaflex.faxtomail;
+
+/*
+ * #%L
+ * Extranet ENC-AHI :: Persistence
+ * $Id: ExtranetEncAhiApplicationConfigOption.java 869 2013-12-13 13:09:12Z bleny $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-persiste… $
+ * %%
+ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.nuiton.config.ConfigOptionDef;
+
+import java.io.File;
+
+public enum FaxToMailApplicationConfigOption implements ConfigOptionDef {
+
+ INSTANCE_URL(
+ "faxtomail.instanceUrl",
+ "URL à laquelle on peut accéder à l'instance de faxToMail",
+ "http://localhost:8080/faxtomail", String.class),
+
+ INSTANCE_DISCLAIMER(
+ "faxtomail.instanceDisclaimer",
+ "Avertissement à afficher aux utilisateurs si l'instance est instable",
+ null, String.class),
+
+ SMTP_HOST(
+ "smtp.host",
+ "Nom d'hôte du serveur SMTP",
+ "", String.class),
+
+ SMTP_PORT(
+ "smtp.port",
+ "Le port du serveur SMTP",
+ "25", Integer.class),
+
+ SMTP_FROM(
+ "smtp.from",
+ "L'adresse d'expéditeur pour les mails de notifications",
+ "", String.class),
+
+ DEV_MODE(
+ "faxtomail.devMode",
+ "Mode développement, court-circuite l'envoi de mail",
+ "true", Boolean.class),
+
+// CREATE_TRAINING_USERS(
+// "extranetEncAhi.createTrainingUsers",
+// "Vrai s'il faut créer les comptes de formation au démarrage de l'application",
+// "true", Boolean.class),
+
+ STORAGE_FILE(
+ "faxtomail.storage",
+ "L'emplacement de stockage des fichiers, répertoire accessible en écriture sur le FS",
+ "/tmp/faxtomail/storage", File.class),
+
+// SUPPORT_EMAIL(
+// "extranetEncAhi.supportEmail",
+// "L'adresse mail à contacter par l'utilisateur pour demander de l'aide",
+// "extranet-enc-ahi-users(a)list.forge.codelutin.com", String.class),
+
+ LOG_CONFIGURATION_FILE(
+ "logConfigurationFile",
+ "Chemin vers le fichier de configuration des journaux",
+ null,
+ String.class);
+
+ protected final String key;
+ protected final String description;
+ protected final Class<?> type;
+ protected String defaultValue;
+
+ private FaxToMailApplicationConfigOption(String key, String description,
+ String defaultValue, Class<?> type) {
+ this.key = key;
+ this.description = description;
+ this.defaultValue = defaultValue;
+ this.type = type;
+ }
+
+ @Override
+ public String getKey() {
+ return key;
+ }
+
+ @Override
+ public Class<?> getType() {
+ return type;
+ }
+
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ @Override
+ public String getDefaultValue() {
+ return defaultValue;
+ }
+
+ @Override
+ public boolean isTransient() {
+ return false;
+ }
+
+ @Override
+ public boolean isFinal() {
+ return false;
+ }
+
+ @Override
+ public void setDefaultValue(String defaultValue) {
+ this.defaultValue = defaultValue;
+ }
+
+ @Override
+ public void setTransient(boolean isTransient) {
+ // Nothing to do
+ }
+
+ @Override
+ public void setFinal(boolean isFinal) {
+ // Nothing to do
+ }
+
+}
\ No newline at end of file
Added: trunk/faxtomail-persistence/src/main/resources/faxtomail.properties
===================================================================
--- trunk/faxtomail-persistence/src/main/resources/faxtomail.properties (rev 0)
+++ trunk/faxtomail-persistence/src/main/resources/faxtomail.properties 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,40 @@
+###
+# #%L
+# Extranet ENC-AHI :: Persistence
+# $Id: extranet-enc-ahi.properties 827 2013-12-04 15:30:35Z bleny $
+# $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-persiste… $
+# %%
+# Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Lesser Public License for more details.
+#
+# You should have received a copy of the GNU General Lesser Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/lgpl-3.0.html>.
+# #L%
+###
+hibernate.connection.driver_class=org.h2.Driver
+hibernate.connection.url=jdbc:h2:file:/tmp/faxtomail/h2data
+hibernate.connection.username=sa
+hibernate.connection.password=
+
+hibernate.dialect=org.hibernate.dialect.H2Dialect
+hibernate.hbm2ddl.auto=update
+hibernate.show_sql=false
+hibernate.format_sql=true
+hibernate.ejb.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy
+
+hibernate.c3p0.min_size=5
+hibernate.c3p0.max_size=20
+hibernate.c3p0.timeout=1800
+hibernate.c3p0.max_statements=50
+
+# hibernate.connection.provider_class=org.nuiton.topia.framework.TopiaConnectionProvider
Added: trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties
===================================================================
--- trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties (rev 0)
+++ trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,28 @@
+###
+# #%L
+# Extranet ENC-AHI :: Persistence
+# $Id: extranet-enc-ahi.properties 827 2013-12-04 15:30:35Z bleny $
+# $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-persiste… $
+# %%
+# Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Lesser Public License for more details.
+#
+# You should have received a copy of the GNU General Lesser Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/lgpl-3.0.html>.
+# #L%
+###
+model.tagValue.notGenerateToString=true
+model.tagValue.constantPrefix=PROPERTY_
+model.tagValue.java.lang.String=text
+model.tagValue.useEnumerationName=true
+model.tagValue.doNotGenerateBooleanGetMethods=true
Added: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
Property changes on: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/AbstractFaxToMailService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/service/AbstractFaxToMailService.java 2014-01-15 16:23:40 UTC (rev 2)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/AbstractFaxToMailService.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,57 +0,0 @@
-package com.franciaflex.faxtomail.service;
-
-import com.franciaflex.faxtomail.FaxToMailTechnicalException;
-import org.apache.commons.io.FileUtils;
-import org.nuiton.util.ZipUtil;
-
-import java.io.File;
-import java.io.IOException;
-
-import static org.nuiton.i18n.I18n._;
-
-/**
- * Sammoa service support.
- * <p/>
- * This simple implementation of {@link FaxToMailService}, offer to keep the
- * {@link #context}.
- * <p/>
- * <strong>Note:</strong> should be used for any service! and never
- * instanciated by hand but via {@link FaxToMailServiceContext#getService(Class)} method.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.1
- */
-public abstract class AbstractFaxToMailService implements FaxToMailService {
-
- protected FaxToMailServiceContext context;
-
- @Override
- public void setServiceContext(FaxToMailServiceContext context) {
- this.context = context;
- }
-
- public <S extends FaxToMailService> S getService(Class<S> serviceType) {
- return context.getService(serviceType);
- }
-
- @Override
- public void close() throws IOException {
- // by default nothing to close
- }
-
- protected void compressZipFile(File zipFile, File directory) {
-
- try {
- FileUtils.forceMkdir(zipFile.getParentFile());
-
- try {
- ZipUtil.compress(zipFile, directory);
- } finally {
- FileUtils.deleteDirectory(directory);
-
- }
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(_("faxtomail.service.compressZipFile.error", directory, zipFile), e);
- }
- }
-}
Deleted: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/service/DecoratorService.java 2014-01-15 16:23:40 UTC (rev 2)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,85 +0,0 @@
-package com.franciaflex.faxtomail.service;
-
-import com.franciaflex.faxtomail.LabelAware;
-import org.nuiton.decorator.Decorator;
-import org.nuiton.decorator.DecoratorProvider;
-import org.nuiton.decorator.JXPathDecorator;
-
-import java.io.File;
-
-/**
- * Tutti decorator service.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.1
- */
-public class DecoratorService extends AbstractFaxToMailService {
-
- public static final String CARACTERISTIC_WITH_UNIT = "withUnit";
-
- public static final String CARACTERISTIC_PARAMETER_ONLY_WITH_UNIT = "parameterOnlyWithUnit";
-
- public static final String CARACTERISTIC_PARAMETER_ONLY = "parameterOnly";
-
- public static final String FROM_PROTOCOL = "fromProtocol";
-
- public static final String GEAR_WITH_RANK_ORDER = "gearWithrankOrder";
-
- public static final String BY_NAME = "byName";
-
- public static final String ONLY_NAME = "onlyName";
-
- public static final String FILE_NAME_COMPATIBLE = "fileNameCompatible";
-
- public static final String SEPARATOR = "#";
-
- /** Delegate decorator provider. */
- protected DecoratorProvider decoratorProvider;
-
- public <O> Decorator<O> getDecorator(O object) {
- return decoratorProvider.getDecorator(object);
- }
-
- public <O> Decorator<O> getDecorator(O object, String name) {
- return decoratorProvider.getDecorator(object, name);
- }
-
- public <O> Decorator<O> getDecoratorByType(Class<O> type) {
- return decoratorProvider.getDecoratorByType(type);
- }
-
- public <O> Decorator<O> getDecoratorByType(Class<O> type, String name) {
- return decoratorProvider.getDecoratorByType(type, name);
- }
-
- @Override
- public void setServiceContext(FaxToMailServiceContext context) {
- super.setServiceContext(context);
-
- decoratorProvider = new DecoratorProvider() {
- @Override
- protected void loadDecorators() {
-
- registerFaxToMailDecorator(LabelAware.class, "${label}$s", SEPARATOR, " - ");
- registerFaxToMailDecorator(File.class, "${absolutePath}$s", SEPARATOR, " - ");
- registerDecorator(new Decorator<Float>(Float.class) {
- private static final long serialVersionUID = 1L;
-
- @Override
- public String toString(Object bean) {
- return bean == null ? "" : String.valueOf(bean);
- }
- });
- }
-
- public void registerFaxToMailDecorator(Class<?> klass, String expression, String separator, String separatorReplacement) {
- super.registerDecorator(FaxToMailDecorator.newDecorator(klass, expression, separator, separatorReplacement));
- }
-
- public void registerFaxToMailDecorator(Class<?> klass, String name, String expression, String separator, String separatorReplacement) {
- super.registerDecorator(name, FaxToMailDecorator.newDecorator(klass, expression, separator, separatorReplacement));
- }
- };
- }
-
-}
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DefaultFaxToMailServiceContext.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DefaultFaxToMailServiceContext.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DefaultFaxToMailServiceContext.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,113 @@
+package com.franciaflex.faxtomail.services;
+
+/*
+ * #%L
+ * Extranet ENC-AHI :: Services
+ * $Id: DefaultExtranetEncAhiServiceContext.java 827 2013-12-04 15:30:35Z bleny $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-services… $
+ * %%
+ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import com.franciaflex.faxtomail.FaxToMailApplicationConfig;
+import com.franciaflex.faxtomail.FaxToMailTechnicalException;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
+import com.franciaflex.faxtomail.services.service.FaxToMailWebApplicationContext;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Date;
+import java.util.Random;
+
+public class DefaultFaxToMailServiceContext implements FaxToMailServiceContext {
+
+ protected FaxToMailApplicationConfig applicationConfig;
+
+ protected FaxToMailTopiaPersistenceContext persistenceContext;
+
+ protected FaxToMailWebApplicationContext webApplicationContext;
+
+ @Override
+ public FaxToMailApplicationConfig getApplicationConfig() {
+ return applicationConfig;
+ }
+
+ public void setPersistenceContext(FaxToMailTopiaPersistenceContext persistenceContext) {
+ this.persistenceContext = persistenceContext;
+ }
+
+ @Override
+ public FaxToMailTopiaPersistenceContext getPersistenceContext() {
+ return persistenceContext;
+ }
+
+ public void setApplicationConfig(FaxToMailApplicationConfig applicationConfig) {
+ this.applicationConfig = applicationConfig;
+ }
+
+ @Override
+ public <E extends FaxToMailService> E newService(Class<E> serviceClass) {
+
+ E service;
+
+ try {
+
+ Constructor<E> constructor = serviceClass.getConstructor();
+
+ service = constructor.newInstance();
+
+ } catch (NoSuchMethodException e) {
+
+ throw new FaxToMailTechnicalException("all services must provide a non-argument constructor", e);
+
+ } catch (InvocationTargetException e) {
+
+ throw new FaxToMailTechnicalException("unable to instantiate service", e);
+
+ } catch (InstantiationException e) {
+
+ throw new FaxToMailTechnicalException("unable to instantiate service", e);
+
+ } catch (IllegalAccessException e) {
+
+ throw new FaxToMailTechnicalException("unable to instantiate service", e);
+
+ }
+
+ service.setServiceContext(this);
+
+ return service;
+
+ }
+
+ @Override
+ public Date getNow() {
+ Date now = new Date();
+ return now;
+ }
+
+ @Override
+ public FaxToMailWebApplicationContext getWebApplicationContext() {
+ return webApplicationContext;
+ }
+
+ public void setWebApplicationContext(FaxToMailWebApplicationContext webApplicationContext) {
+ this.webApplicationContext = webApplicationContext;
+ }
+
+}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailDecorator.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/service/FaxToMailDecorator.java 2014-01-15 16:23:40 UTC (rev 2)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailDecorator.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,4 +1,4 @@
-package com.franciaflex.faxtomail.service;
+package com.franciaflex.faxtomail.services;
import com.google.common.base.Preconditions;
import com.google.common.cache.CacheBuilder;
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/service/FaxToMailService.java 2014-01-15 16:23:40 UTC (rev 2)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailService.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,22 +1,6 @@
-package com.franciaflex.faxtomail.service;
+package com.franciaflex.faxtomail.services;
-import java.io.Closeable;
+public interface FaxToMailService {
-/**
- * Contract for any faxtomail service.
- * <p/>
- * This contract just allow to inject the {@link FaxToMailServiceContext} in your service.
- * <p/>
- * A default support implement is given: {@link AbstractFaxToMailService}.
- * <p/>
- * To use a such service, you should not instanciate it by your self but prefer
- * use the servie factory method: {@link FaxToMailServiceContext#getService(Class)}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @see AbstractFaxToMailService
- * @since 0.1
- */
-public interface FaxToMailService extends Closeable {
-
void setServiceContext(FaxToMailServiceContext context);
}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/service/FaxToMailServiceContext.java 2014-01-15 16:23:40 UTC (rev 2)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,153 +1,21 @@
-package com.franciaflex.faxtomail.service;
+package com.franciaflex.faxtomail.services;
-import com.franciaflex.faxtomail.FaxToMailTechnicalException;
-import com.franciaflex.faxtomail.service.config.FaxToMailServiceConfig;
-import com.franciaflex.faxtomail.persistence.RessourceClassLoader;
-import com.google.common.base.Preconditions;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import com.opensymphony.xwork2.util.ValueStack;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.validator.xwork2.XWork2ValidatorUtil;
+import com.franciaflex.faxtomail.FaxToMailApplicationConfig;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
+import com.franciaflex.faxtomail.services.service.FaxToMailWebApplicationContext;
-import java.io.Closeable;
-import java.io.IOException;
-import java.lang.reflect.Constructor;
import java.util.Date;
-import java.util.UUID;
-import java.util.concurrent.ExecutionException;
-import static org.nuiton.i18n.I18n._;
+public interface FaxToMailServiceContext {
-/**
- * FaxToMail application context.
- * <p/>
- * This context is load at startup time and close when application dies.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.1
- */
-public class FaxToMailServiceContext implements Closeable {
+ FaxToMailApplicationConfig getApplicationConfig();
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(FaxToMailServiceContext.class);
+ FaxToMailTopiaPersistenceContext getPersistenceContext();
- protected final FaxToMailServiceConfig config;
+ Date getNow();
-// protected final FaxToMailDataContext dataContext;
+ <E extends FaxToMailService> E newService(Class<E> serviceClass);
- protected final RessourceClassLoader resourceLoader;
+ FaxToMailWebApplicationContext getWebApplicationContext();
- protected final LoadingCache<Class<? extends FaxToMailService>, FaxToMailService> services;
-
- public FaxToMailServiceContext(RessourceClassLoader resourceLoader,
- FaxToMailServiceConfig config) {
-// this(resourceLoader, config, new FaxToMailDataContext());
- this.resourceLoader = resourceLoader;
- this.config = config;
-// this.dataContext = dataContext;
- // add datacontext in shared valueStack
- ValueStack sharedValueStack = XWork2ValidatorUtil.getSharedValueStack();
-// sharedValueStack.push(dataContext.getValidationContext());
- this.services = CacheBuilder.newBuilder().build(new CacheLoader<Class<? extends FaxToMailService>, FaxToMailService>() {
- @Override
- public FaxToMailService load(Class<? extends FaxToMailService> key) throws Exception {
- Preconditions.checkNotNull(key);
- Constructor<? extends FaxToMailService> constructor = key.getConstructor();
- Preconditions.checkNotNull(constructor);
- FaxToMailService service = constructor.newInstance();
- if (log.isDebugEnabled()) {
- log.debug("New service " + service);
- }
- service.setServiceContext(FaxToMailServiceContext.this);
- return service;
- }
- });
- }
-
-// public FaxToMailServiceContext(RessourceClassLoader resourceLoader,
-// TuttiServiceConfig config,
-// TuttiDataContext dataContext) {
-// this.resourceLoader = resourceLoader;
-// this.config = config;
-//// this.dataContext = dataContext;
-// // add datacontext in shared valueStack
-// ValueStack sharedValueStack = XWork2ValidatorUtil.getSharedValueStack();
-// sharedValueStack.push(dataContext.getValidationContext());
-// this.services = CacheBuilder.newBuilder().build(new CacheLoader<Class<? extends FaxToMailService>, FaxToMailService>() {
-// @Override
-// public FaxToMailService load(Class<? extends FaxToMailService> key) throws Exception {
-// Preconditions.checkNotNull(key);
-// Constructor<? extends FaxToMailService> constructor = key.getConstructor();
-// Preconditions.checkNotNull(constructor);
-// FaxToMailService service = constructor.newInstance();
-// if (log.isDebugEnabled()) {
-// log.debug("New service " + service);
-// }
-// service.setServiceContext(FaxToMailServiceContext.this);
-// return service;
-// }
-// });
-// }
-
- public FaxToMailServiceConfig getConfig() {
- return config;
- }
-
- public RessourceClassLoader getResourceLoader() {
- return resourceLoader;
- }
-
-// public FaxToMailDataContext getDataContext() {
-// return dataContext;
-// }
-
- public Date currentDate() {
- return new Date();
- }
-
- public <S extends FaxToMailService> S getService(Class<S> serviceType) {
- if (serviceType == null) {
- return null;
- }
- try {
- S s = (S) services.get(serviceType);
- return s;
- } catch (ExecutionException e) {
- throw new FaxToMailTechnicalException(_("tutti.service.context.serviceInstanciation.error", serviceType), e);
- }
- }
-
- public <S extends FaxToMailService> S reloadService(Class<S> serviceType) {
- S service = (S) services.getIfPresent(serviceType);
- if (service != null) {
- if (log.isDebugEnabled()) {
- log.debug("Close service " + service);
- }
- IOUtils.closeQuietly(service);
- }
- services.invalidate(serviceType);
- S result = getService(serviceType);
- return result;
- }
-
- @Override
- public void close() throws IOException {
-
- for (FaxToMailService service : services.asMap().values()) {
- if (log.isDebugEnabled()) {
- log.debug("Close service " + service);
- }
- IOUtils.closeQuietly(service);
- }
- services.invalidateAll();
- }
-
- public String generateId(Class<?> type) {
- return UUID.randomUUID().toString();
- }
}
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,76 @@
+package com.franciaflex.faxtomail.services;
+
+/*
+ * #%L
+ * Extranet ENC-AHI :: Services
+ * $Id: ExtranetEncAhiServiceSupport.java 857 2013-12-12 15:42:14Z sbavencoff $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-services… $
+ * %%
+ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import com.franciaflex.faxtomail.FaxToMailApplicationConfig;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
+import com.franciaflex.faxtomail.services.service.CompanyService;
+import com.franciaflex.faxtomail.services.service.ConfigurationService;
+import com.franciaflex.faxtomail.services.service.FaxToMailWebApplicationContext;
+import com.franciaflex.faxtomail.services.service.MailFolderService;
+
+import java.util.Date;
+
+public class FaxToMailServiceSupport implements FaxToMailService {
+
+ protected FaxToMailServiceContext serviceContext;
+
+ @Override
+ public void setServiceContext(FaxToMailServiceContext serviceContext) {
+ this.serviceContext = serviceContext;
+ }
+
+ protected FaxToMailApplicationConfig getApplicationConfig() {
+ return serviceContext.getApplicationConfig();
+ }
+
+ protected Date getNow() {
+ return serviceContext.getNow();
+ }
+
+ protected FaxToMailTopiaPersistenceContext getPersistenceContext() {
+ return serviceContext.getPersistenceContext();
+ }
+
+ public FaxToMailWebApplicationContext getWebApplicationContext() {
+ return serviceContext.getWebApplicationContext();
+ }
+
+ public <E extends FaxToMailService> E newService(Class<E> serviceClass) {
+ return serviceContext.newService(serviceClass);
+ }
+
+ public CompanyService getCompanyService() {
+ return newService(CompanyService.class);
+ }
+
+ public ConfigurationService getConfigurationService() {
+ return newService(ConfigurationService.class);
+ }
+
+ public MailFolderService getMailFolderService() {
+ return newService(MailFolderService.class);
+ }
+}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfig.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/service/config/FaxToMailServiceConfig.java 2014-01-15 16:23:40 UTC (rev 2)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfig.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,4 +1,4 @@
-package com.franciaflex.faxtomail.service.config;
+package com.franciaflex.faxtomail.services.config;
import com.franciaflex.faxtomail.FaxToMailIOUtil;
import org.nuiton.config.ApplicationConfig;
@@ -90,22 +90,22 @@
public void prepareDirectories() {
- File dataDirectory = getDataDirectory();
- FaxToMailIOUtil.forceMkdir(
- dataDirectory,
- _("faxtomail.service.mkDir.error", dataDirectory));
+// File dataDirectory = getDataDirectory();
+// FaxToMailIOUtil.forceMkdir(
+// dataDirectory,
+// _("faxtomail.service.mkDir.error", dataDirectory));
+//
+// File tmpDirectory = getTmpDirectory();
+// if (tmpDirectory.exists()) {
+//
+// FaxToMailIOUtil.deleteDirectory(
+// tmpDirectory,
+// _("faxtomail.service.config.deleteTempDirectory.error", tmpDirectory));
+// }
+// FaxToMailIOUtil.forceMkdir(
+// tmpDirectory,
+// _("faxtomail.service.mkDir.error", tmpDirectory));
- File tmpDirectory = getTmpDirectory();
- if (tmpDirectory.exists()) {
-
- FaxToMailIOUtil.deleteDirectory(
- tmpDirectory,
- _("faxtomail.service.config.deleteTempDirectory.error", tmpDirectory));
- }
- FaxToMailIOUtil.forceMkdir(
- tmpDirectory,
- _("faxtomail.service.mkDir.error", tmpDirectory));
-
}
public void setCsvSeparator(char c) {
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigOption.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/service/config/FaxToMailServiceConfigOption.java 2014-01-15 16:23:40 UTC (rev 2)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigOption.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,4 +1,4 @@
-package com.franciaflex.faxtomail.service.config;
+package com.franciaflex.faxtomail.services.config;
import org.nuiton.config.ConfigOptionDef;
import org.nuiton.util.Version;
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigProvider.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/service/config/FaxToMailServiceConfigProvider.java 2014-01-15 16:23:40 UTC (rev 2)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigProvider.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,4 +1,4 @@
-package com.franciaflex.faxtomail.service.config;
+package com.franciaflex.faxtomail.services.config;
import org.nuiton.config.ApplicationConfigProvider;
import org.nuiton.config.ConfigActionDef;
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/CompanyService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/CompanyService.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/CompanyService.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,49 @@
+package com.franciaflex.faxtomail.services.service;
+
+import com.franciaflex.faxtomail.persistence.entities.Company;
+import com.franciaflex.faxtomail.persistence.entities.CompanyTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.Configuration;
+import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.List;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since x.x
+ */
+public class CompanyService extends FaxToMailServiceSupport {
+
+ private static final Log log = LogFactory.getLog(CompanyService.class);
+
+ public List<Company> getAllCompanies() {
+ CompanyTopiaDao dao = getPersistenceContext().getCompanyDao();
+ List<Company> companies = Lists.newArrayList(dao.findAll());
+ return companies;
+ }
+
+ public Company getCompany(String id) {
+ CompanyTopiaDao dao = getPersistenceContext().getCompanyDao();
+ Company company = dao.findByTopiaId(id);
+ return company;
+ }
+
+ public Company saveCompany(Company company) {
+ Preconditions.checkNotNull(company);
+ ConfigurationService configurationService = getConfigurationService();
+ configurationService.saveConfiguration(company.getConfiguration());
+
+ MailFolderService mailFolderService = getMailFolderService();
+ mailFolderService.saveMailFolders(company.getMailFolder());
+
+ CompanyTopiaDao dao = getPersistenceContext().getCompanyDao();
+ company = dao.update(company);
+
+ getPersistenceContext().commit();
+
+ return company;
+ }
+}
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,40 @@
+package com.franciaflex.faxtomail.services.service;
+
+import com.franciaflex.faxtomail.persistence.entities.CompanyTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.Configuration;
+import com.franciaflex.faxtomail.persistence.entities.ConfigurationTopiaDao;
+import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+import com.google.common.collect.Lists;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.persistence.TopiaIdFactory;
+
+import java.util.List;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since x.x
+ */
+public class ConfigurationService extends FaxToMailServiceSupport {
+
+ private static final Log log = LogFactory.getLog(CompanyService.class);
+
+ public List<Configuration> getAllConfigurations() {
+ ConfigurationTopiaDao dao = getPersistenceContext().getConfigurationDao();
+ List<Configuration> configs = Lists.newArrayList(dao.findAll());
+ return configs;
+ }
+
+ public Configuration getConfiguration(String id) {
+ ConfigurationTopiaDao dao = getPersistenceContext().getConfigurationDao();
+ Configuration config = dao.findByTopiaId(id);
+ return config;
+ }
+
+ public Configuration saveConfiguration(Configuration config) {
+ ConfigurationTopiaDao dao = getPersistenceContext().getConfigurationDao();
+ config = dao.update(config);
+ return config;
+ }
+
+}
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/FaxToMailWebApplicationContext.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/FaxToMailWebApplicationContext.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/FaxToMailWebApplicationContext.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,15 @@
+package com.franciaflex.faxtomail.services.service;
+
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
+
+/**
+ * Make a service aware of way to generate URL to point to a
+ * precise page of the web interface.
+ *
+ * @author kmorin
+ */
+public interface FaxToMailWebApplicationContext {
+
+ String getAdministrationUrl(FaxToMailUser user);
+
+}
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,122 @@
+package com.franciaflex.faxtomail.services.service;
+
+/*
+ * #%L
+ * Extranet ENC-AHI :: Services
+ * $Id: InitExtranetService.java 827 2013-12-04 15:30:35Z bleny $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-services… $
+ * %%
+ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import com.franciaflex.faxtomail.FaxToMailApplicationConfig;
+import com.franciaflex.faxtomail.FaxToMailTechnicalException;
+import com.franciaflex.faxtomail.persistence.entities.Company;
+import com.franciaflex.faxtomail.persistence.entities.CompanyTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.ConfigurationTopiaDao;
+import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.validator.xwork2.XWork2ValidatorUtil;
+
+import java.io.File;
+import java.io.InputStream;
+import java.util.List;
+
+public class InitFaxToMailService extends FaxToMailServiceSupport {
+
+ private static final Log log = LogFactory.getLog(InitFaxToMailService.class);
+
+ public void init() {
+
+ if (log.isInfoEnabled()) {
+ log.info("extranet initialization started");
+ }
+
+ checkStorage();
+
+ boolean devMode = serviceContext.getApplicationConfig().isDevMode();
+
+ if (devMode) {
+ initSampleData();
+ }
+
+ // Reset the value stack used, if required, a new will be recreated using the struts ActionContext.
+ // Need to do it here, if we want to be synched between the struts ActionContext and the value stack.
+// XWork2ValidatorUtil.setSharedValueStack(null);
+
+ if (log.isInfoEnabled()) {
+ log.info("extranet initialization done");
+ }
+
+ }
+
+ protected void checkStorage() {
+
+ FaxToMailApplicationConfig applicationConfig = getApplicationConfig();
+
+ File storageFile = applicationConfig.getStorageFile();
+
+ if (storageFile.exists()) {
+ if (log.isInfoEnabled()) {
+ log.info("storage directory exists " + storageFile.getAbsolutePath());
+ }
+ } else {
+ if (log.isInfoEnabled()) {
+ log.info("storage directory does not exist, creating " + storageFile.getAbsolutePath());
+ }
+
+ boolean created = storageFile.mkdirs();
+
+ if ( ! created) {
+ throw new FaxToMailTechnicalException("unable to create directory " + storageFile.getAbsolutePath());
+ }
+ }
+
+ if ( ! storageFile.isDirectory()) {
+ throw new FaxToMailTechnicalException("file exists but is not a directory " + storageFile.getAbsolutePath());
+ }
+
+ if ( ! storageFile.canWrite()) {
+ throw new FaxToMailTechnicalException("directory exists but is not writable " + storageFile.getAbsolutePath());
+ }
+
+ }
+
+ protected void initSampleData() {
+
+ // companies
+ CompanyTopiaDao companyTopiaDao = getPersistenceContext().getCompanyDao();
+ ConfigurationTopiaDao configurationTopiaDao = getPersistenceContext().getConfigurationDao();
+
+ long count = companyTopiaDao.count();
+
+ log.debug("sample data: " + count);
+ if (count == 0) {
+ log.debug("add sample data");
+ companyTopiaDao.create(Company.PROPERTY_NAME, "Franciaflex", Company.PROPERTY_CONFIGURATION, configurationTopiaDao.create());
+ companyTopiaDao.create(Company.PROPERTY_NAME, "Faber", Company.PROPERTY_CONFIGURATION, configurationTopiaDao.create());
+ companyTopiaDao.create(Company.PROPERTY_NAME, "France Fermeture", Company.PROPERTY_CONFIGURATION, configurationTopiaDao.create());
+
+ getPersistenceContext().commit();
+ log.debug("sample data " + companyTopiaDao.count());
+ }
+
+ }
+
+}
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,49 @@
+package com.franciaflex.faxtomail.services.service;
+
+import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+import com.franciaflex.faxtomail.persistence.entities.MailFolderTopiaDao;
+import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+import com.google.common.collect.Lists;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.persistence.TopiaIdFactory;
+
+import java.util.Collection;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since 0.1
+ */
+public class MailFolderService extends FaxToMailServiceSupport {
+
+ private static final Log log = LogFactory.getLog(MailFolderService.class);
+
+ public Collection<MailFolder> saveMailFolders(Collection<MailFolder> mailFolders) {
+ if (mailFolders == null) {
+ return null;
+ }
+ Collection<MailFolder> result = Lists.newArrayList();
+ MailFolderTopiaDao dao = getPersistenceContext().getMailFolderDao();
+ TopiaIdFactory factory = getPersistenceContext().getTopiaIdFactory();
+
+ for (MailFolder mailFolder : mailFolders) {
+ Collection<MailFolder> children = saveMailFolders(mailFolder.getChildren());
+
+ if (!factory.isTopiaId(mailFolder.getTopiaId())) {
+ mailFolder.setTopiaId(null);
+ mailFolder.setChildren(children);
+ mailFolder = dao.create(mailFolder);
+ result.add(mailFolder);
+
+ } else {
+ MailFolder original = dao.findByTopiaId(mailFolder.getTopiaId());
+ original.setName(mailFolder.getName());
+ original.setChildren(children);
+ original = dao.update(original);
+ result.add(original);
+ }
+ }
+ return result;
+ }
+
+}
Modified: trunk/faxtomail-service/src/main/resources/META-INF/services/org.nuiton.config.ApplicationConfigProvider
===================================================================
--- trunk/faxtomail-service/src/main/resources/META-INF/services/org.nuiton.config.ApplicationConfigProvider 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-service/src/main/resources/META-INF/services/org.nuiton.config.ApplicationConfigProvider 2014-02-05 18:34:13 UTC (rev 4)
@@ -1 +1 @@
-com.franciaflex.faxtomail.service.config.FaxToMailServiceConfigProvider
\ No newline at end of file
+com.franciaflex.faxtomail.services.config.FaxToMailServiceConfigProvider
\ No newline at end of file
Modified: trunk/faxtomail-ui-swing/pom.xml
===================================================================
--- trunk/faxtomail-ui-swing/pom.xml 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/pom.xml 2014-02-05 18:34:13 UTC (rev 4)
@@ -163,6 +163,16 @@
<artifactId>jaxx-widgets</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.nuiton.jaxx</groupId>
+ <artifactId>jaxx-application-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.nuiton.jaxx</groupId>
+ <artifactId>jaxx-application-swing</artifactId>
+ </dependency>
+
<!-- swing widgets -->
<dependency>
@@ -338,6 +348,37 @@
<profiles>
<profile>
+ <id>jar-only</id>
+ <build>
+ <defaultGoal>package</defaultGoal>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>com.franciaflex.faxtomail.ui.swing.RunFaxToMail</mainClass>
+ </manifest>
+ </archive>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
<id>default-bundle</id>
<activation>
<property>
@@ -402,6 +443,270 @@
</profile>
<profile>
+ <id>linux-x64-bundle</id>
+ <!--activation>
+ <property>
+ <name>performFullRelease</name>
+ <value>true</value>
+ </property>
+ </activation-->
+ <build>
+ <defaultGoal>package</defaultGoal>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>get-linux-x64-jre</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>
+ ${project.build.directory}/jre-linux-x64
+ </outputDirectory>
+ <artifactItems>
+ <artifactItem>
+ <groupId>com.oracle</groupId>
+ <artifactId>jre</artifactId>
+ <version>${jreVersion}</version>
+ <type>zip</type>
+ <classifier>linux-x64</classifier>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <finalName>${bundlePrefix}</finalName>
+ </configuration>
+ <executions>
+ <execution>
+ <id>assembly-full-linux-x64</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <attach>false</attach>
+ <descriptors>
+ <descriptor>
+ src/main/assembly/full-linux-x64.xml
+ </descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>linux-i586-bundle</id>
+ <activation>
+ <property>
+ <name>performFullRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <build>
+ <defaultGoal>package</defaultGoal>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>get-linux-i586-jre</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>
+ ${project.build.directory}/jre-linux-i586
+ </outputDirectory>
+ <artifactItems>
+ <artifactItem>
+ <groupId>com.oracle</groupId>
+ <artifactId>jre</artifactId>
+ <version>${jreVersion}</version>
+ <type>zip</type>
+ <classifier>linux-i586</classifier>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <finalName>${bundlePrefix}</finalName>
+ </configuration>
+ <executions>
+ <execution>
+ <id>assembly-full-linux-i586</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <attach>false</attach>
+ <descriptors>
+ <descriptor>
+ src/main/assembly/full-linux-i586.xml
+ </descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>windows-i586-bundle</id>
+ <activation>
+ <property>
+ <name>performFullRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <build>
+ <defaultGoal>package</defaultGoal>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>get-windows-i586-jre</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>
+ ${project.build.directory}/jre-windows-i586
+ </outputDirectory>
+ <artifactItems>
+ <artifactItem>
+ <groupId>com.oracle</groupId>
+ <artifactId>jre</artifactId>
+ <version>${jreVersion}</version>
+ <type>zip</type>
+ <classifier>windows-i586</classifier>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <finalName>${bundlePrefix}</finalName>
+ </configuration>
+ <executions>
+ <execution>
+ <id>assembly-full-windows-i586</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <attach>false</attach>
+ <descriptors>
+ <descriptor>
+ src/main/assembly/full-windows-i586.xml
+ </descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>windows-x64-bundle</id>
+ <!--activation>
+ <property>
+ <name>performFullRelease</name>
+ <value>true</value>
+ </property>
+ </activation-->
+ <build>
+ <defaultGoal>package</defaultGoal>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>get-windows-x64-jre</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>
+ ${project.build.directory}/jre-windows-x64
+ </outputDirectory>
+ <artifactItems>
+ <artifactItem>
+ <groupId>com.oracle</groupId>
+ <artifactId>jre</artifactId>
+ <version>${jreVersion}</version>
+ <type>zip</type>
+ <classifier>windows-x64</classifier>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <finalName>${bundlePrefix}</finalName>
+ </configuration>
+ <executions>
+ <execution>
+ <id>assembly-full-windows-x64</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <attach>false</attach>
+ <descriptors>
+ <descriptor>
+ src/main/assembly/full-windows-x64.xml
+ </descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
<id>profiling</id>
<build>
Modified: trunk/faxtomail-ui-swing/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/faxtomail-ui-swing/src/license/THIRD-PARTY.properties 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/license/THIRD-PARTY.properties 2014-02-05 18:34:13 UTC (rev 4)
@@ -2,21 +2,30 @@
#-------------------------------------------------------------------------------
# Already used licenses in project :
# - Apache License
+# - Apache License 2.0
# - BSD License
+# - Common Development and Distribution License
# - Common Development and Distribution License (CDDL) v1.0
# - Common Public License Version 1.0
+# - Eclipse Public License, Version 1.0
# - GNU General Public License - Version 2 with the class path exception
+# - GNU General Public License, Version 2 with the Classpath Exception
+# - GNU Lesser General Public License, Version 2.1
+# - GNU Lesser General Public License, version 2.1
# - GNU Library or Lesser General Public License
# - General Public License (GPL)
+# - LGPL 2.1
# - Lesser General Public License (LGPL)
# - Lesser General Public License (LGPL) v 3.0
# - MIT License
+# - MPL 1.1
# - New BSD License
# - The Apache Software License, Version 2.0
+# - license.txt
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Sat Jan 11 21:21:40 CET 2014
+#Fri Jan 31 09:36:44 CET 2014
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
-javassist--javassist--3.11.0.GA=The Apache Software License, Version 2.0
+dom4j--dom4j--1.6.1=BSD License
Added: trunk/faxtomail-ui-swing/src/main/assembly/faxtomail-full-component.xml
===================================================================
--- trunk/faxtomail-ui-swing/src/main/assembly/faxtomail-full-component.xml (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/assembly/faxtomail-full-component.xml 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Tutti :: UI
+ $Id: tutti-full-component.xml 1460 2013-12-10 18:52:55Z tchemit $
+ $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/asse… $
+ %%
+ Copyright (C) 2012 Ifremer
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+ -->
+
+<component
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2 http://maven.apache.org/xsd/component-1.1.2.xsd">
+
+ <fileSets>
+
+ <fileSet>
+ <directory>src/main/assembly/full</directory>
+ <outputDirectory/>
+ <filtered>true</filtered>
+ <fileMode>0755</fileMode>
+ <includes>
+ <include>faxtomail.sh</include>
+ <include>faxtomail.bat</include>
+ <include>README*</include>
+ <include>report/**</include>
+ </includes>
+ </fileSet>
+
+ <fileSet>
+ <includes>
+ <include>LICENSE*</include>
+ </includes>
+ </fileSet>
+
+ <!-- TUTTI component -->
+
+ <fileSet>
+ <directory>target</directory>
+ <outputDirectory>faxtomail</outputDirectory>
+ <includes>
+ <include>${project.build.finalName}.${project.packaging}</include>
+ </includes>
+ </fileSet>
+
+ <fileSet>
+ <directory>target/lib</directory>
+ <outputDirectory>faxtomail/lib</outputDirectory>
+ <includes>
+ <include>*.jar</include>
+ </includes>
+ <excludes>
+ <exclude>junit-*.jar</exclude>
+ </excludes>
+ </fileSet>
+
+ <fileSet>
+ <directory>src/main/assembly/min</directory>
+ <outputDirectory>faxtomail</outputDirectory>
+ <filtered>true</filtered>
+ <fileMode>0755</fileMode>
+ <includes>
+ <include>*.sh</include>
+ <include>*.bat</include>
+ </includes>
+ </fileSet>
+
+ <fileSet>
+ <directory>src/main/assembly/min</directory>
+ <outputDirectory>faxtomail</outputDirectory>
+ <filtered>true</filtered>
+ <includes>
+ <include>*</include>
+ </includes>
+ <excludes>
+ <exclude>*.sh</exclude>
+ <exclude>*.bat</exclude>
+ <exclude>faxtomail.config</exclude>
+ </excludes>
+ </fileSet>
+
+ <!-- I18N component -->
+ <fileSet>
+ <directory>target/classes/META-INF</directory>
+ <outputDirectory>i18n</outputDirectory>
+ <includes>
+ <include>faxtomail-i18n*.properties</include>
+ <include>faxtomail-i18n*.csv</include>
+ </includes>
+ </fileSet>
+
+ </fileSets>
+</component>
Added: trunk/faxtomail-ui-swing/src/main/assembly/full/faxtomail.bat
===================================================================
--- trunk/faxtomail-ui-swing/src/main/assembly/full/faxtomail.bat (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/assembly/full/faxtomail.bat 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,27 @@
+@echo off
+
+set OLDDIR=%CD%
+cd /d %~dp0%
+
+set FAXTOMAIL_BASEDIR="%CD%"
+set FAXTOMAIL_HOME=%FAXTOMAIL_BASEDIR%\faxtomail
+set JAVA_HOME=%FAXTOMAIL_BASEDIR%\jre
+set JAVA_COMMAND=%JAVA_HOME%\bin\java
+set FAXTOMAIL_LOG_FILE=%FAXTOMAIL_BASEDIR%\data\faxtomail-${project.version}.log
+
+echo FaxToMail basedir: %FAXTOMAIL_BASEDIR%
+echo FaxToMail app home: %FAXTOMAIL_HOME%
+echo FaxToMail jre home: %JAVA_HOME%
+echo FaxToMail log file: %FAXTOMAIL_LOG_FILE%
+
+:start
+
+if exist "faxtomail.config" copy faxtomail.config faxtomail
+echo FaxToMail ${project.version} is starting...
+call faxtomail\launch.bat --option faxtomail.launch.mode full --option faxtomail.basedir %FAXTOMAIL_BASEDIR%
+if errorlevel 88 goto start
+
+goto quit
+
+:quit
+cd %OLDDIR%
Added: trunk/faxtomail-ui-swing/src/main/assembly/full/faxtomail.sh
===================================================================
--- trunk/faxtomail-ui-swing/src/main/assembly/full/faxtomail.sh (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/assembly/full/faxtomail.sh 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+export FAXTOMAIL_BASEDIR=$(pwd)
+export FAXTOMAIL_HOME=$FAXTOMAIL_BASEDIR/tutti
+export JAVA_HOME=$FAXTOMAIL_BASEDIR/jre
+export JAVA_COMMAND=$JAVA_HOME/bin/java
+export FAXTOMAIL_LOG_FILE=$FAXTOMAIL_BASEDIR/data/faxtomail-${project.version}.log
+
+cd $FAXTOMAIL_BASEDIR
+
+echo "FaxToMail basedir: $FAXTOMAIL_BASEDIR"
+echo "FaxToMail app home: $FAXTOMAIL_HOME"
+echo "FaxToMail jre home: $JAVA_HOME"
+echo "FaxToMail log file: $FAXTOMAIL_LOG_FILE"
+
+while true; do
+
+ if [ -f $FAXTOMAIL_BASEDIR/faxtomail.config ]; then
+ cp -rfv $FAXTOMAIL_BASEDIR/faxtomail.config $FAXTOMAIL_HOME
+ fi
+ echo "FaxToMail ${project.version} is starting..."
+ ./faxtomail/launch.sh --option faxtomail.launch.mode full --option faxtomail.basedir $FAXTOMAIL_BASEDIR
+ exitcode=$?
+
+ if [ ! "$exitcode" -eq "88" ]; then
+ # quit now!
+ exit $exitcode
+ fi
+done
\ No newline at end of file
Added: trunk/faxtomail-ui-swing/src/main/assembly/full-linux-i586.xml
===================================================================
--- trunk/faxtomail-ui-swing/src/main/assembly/full-linux-i586.xml (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/assembly/full-linux-i586.xml 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Tutti :: UI
+ $Id: full-linux-i586.xml 248 2013-01-28 11:22:28Z tchemit $
+ $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/asse… $
+ %%
+ Copyright (C) 2012 Ifremer
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+ -->
+
+<assembly
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+
+ <id>full-linux-i586</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <componentDescriptors>
+ <componentDescriptor>
+ src/main/assembly/faxtomail-full-component.xml
+ </componentDescriptor>
+ </componentDescriptors>
+
+ <fileSets>
+
+ <fileSet>
+ <directory>${project.build.directory}/jre-linux-i586/jre</directory>
+ <outputDirectory>jre</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </fileSet>
+
+ </fileSets>
+
+</assembly>
Added: trunk/faxtomail-ui-swing/src/main/assembly/full-linux-x64.xml
===================================================================
--- trunk/faxtomail-ui-swing/src/main/assembly/full-linux-x64.xml (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/assembly/full-linux-x64.xml 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Tutti :: UI
+ $Id: full-linux-x64.xml 248 2013-01-28 11:22:28Z tchemit $
+ $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/asse… $
+ %%
+ Copyright (C) 2012 Ifremer
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+ -->
+
+<assembly
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+
+ <id>full-linux-x64</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <componentDescriptors>
+ <componentDescriptor>
+ src/main/assembly/faxtomail-full-component.xml
+ </componentDescriptor>
+ </componentDescriptors>
+
+ <fileSets>
+
+ <fileSet>
+ <directory>${project.build.directory}/jre-linux-x64/jre</directory>
+ <outputDirectory>/jre</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </fileSet>
+
+ </fileSets>
+
+</assembly>
Added: trunk/faxtomail-ui-swing/src/main/assembly/full-windows-i586.xml
===================================================================
--- trunk/faxtomail-ui-swing/src/main/assembly/full-windows-i586.xml (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/assembly/full-windows-i586.xml 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Tutti :: UI
+ $Id: full-windows-i586.xml 248 2013-01-28 11:22:28Z tchemit $
+ $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/asse… $
+ %%
+ Copyright (C) 2012 Ifremer
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+ -->
+
+<assembly
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+
+ <id>full-windows-i586</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <componentDescriptors>
+ <componentDescriptor>
+ src/main/assembly/faxtomail-full-component.xml
+ </componentDescriptor>
+ </componentDescriptors>
+
+ <fileSets>
+
+ <fileSet>
+ <directory>${project.build.directory}/jre-windows-i586/jre</directory>
+ <outputDirectory>jre</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </fileSet>
+
+ </fileSets>
+
+</assembly>
Added: trunk/faxtomail-ui-swing/src/main/assembly/full-windows-x64.xml
===================================================================
--- trunk/faxtomail-ui-swing/src/main/assembly/full-windows-x64.xml (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/assembly/full-windows-x64.xml 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Tutti :: UI
+ $Id: full-windows-x64.xml 248 2013-01-28 11:22:28Z tchemit $
+ $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/asse… $
+ %%
+ Copyright (C) 2012 Ifremer
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+ -->
+
+<assembly
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+
+ <id>full-windows-x64</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <componentDescriptors>
+ <componentDescriptor>
+ src/main/assembly/faxtomail-full-component.xml
+ </componentDescriptor>
+ </componentDescriptors>
+
+ <fileSets>
+
+ <fileSet>
+ <directory>${project.build.directory}/jre-windows-x64/jre</directory>
+ <outputDirectory>jre</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </fileSet>
+
+ </fileSets>
+</assembly>
Added: trunk/faxtomail-ui-swing/src/main/assembly/i18n.xml
===================================================================
--- trunk/faxtomail-ui-swing/src/main/assembly/i18n.xml (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/assembly/i18n.xml 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,55 @@
+<!--
+ #%L
+ Tutti :: UI
+ $Id: i18n.xml 582 2013-03-12 09:33:46Z tchemit $
+ $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/asse… $
+ %%
+ Copyright (C) 2012 - 2013 Ifremer
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+ -->
+
+<assembly
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>i18n</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <fileSets>
+
+ <fileSet>
+ <directory>target/classes/META-INF</directory>
+ <outputDirectory/>
+ <includes>
+ <include>tutti-i18n*.properties</include>
+ <include>tutti-i18n*.csv</include>
+ </includes>
+ </fileSet>
+
+ <fileSet>
+ <directory>src/main/assembly/min</directory>
+ <outputDirectory/>
+ <filtered>true</filtered>
+ <includes>
+ <include>version.appup</include>
+ </includes>
+ </fileSet>
+
+ </fileSets>
+</assembly>
\ No newline at end of file
Added: trunk/faxtomail-ui-swing/src/main/assembly/min/README.txt
===================================================================
Added: trunk/faxtomail-ui-swing/src/main/assembly/min/launch.bat
===================================================================
--- trunk/faxtomail-ui-swing/src/main/assembly/min/launch.bat (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/assembly/min/launch.bat 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,10 @@
+@echo off
+
+set OLDDIR=%CD%
+cd /d %~dp0%
+
+%JAVA_COMMAND% -Xmx1024M -XX:MaxPermSize=128M -Dfaxtomail.log.file=%FAXTOMAIL_LOG_FILE% -jar ${project.build.finalName}.${project.packaging} %1 %2 %3 %4 %5 %6 %7 %8 %9
+set exitcode=%ERRORLEVEL%
+echo Stop FaxToMail with exitcode: %exitcode%
+cd %OLDDIR%
+exit /b %exitcode%
Added: trunk/faxtomail-ui-swing/src/main/assembly/min/launch.sh
===================================================================
--- trunk/faxtomail-ui-swing/src/main/assembly/min/launch.sh (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/assembly/min/launch.sh 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+MEMORY="-Xmx1024M -XX:MaxPermSize=128M"
+#FAXTOMAIL_JVM_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000"
+
+REP=$(dirname $0)
+
+cd $REP
+
+#echo "java command: $JAVA_COMMAND"
+
+$JAVA_COMMAND $MEMORY $FAXTOMAIL_JVM_OPTS -Dtutti.log.file=$FAXTOMAIL_LOG_FILE -jar ${project.build.finalName}.${project.packaging} $*
+exitcode=$?
+echo "Stop FaxToMail with exitcode: $exitcode"
+exit $exitcode
Property changes on: trunk/faxtomail-ui-swing/src/main/assembly/min/launch.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/faxtomail-ui-swing/src/main/assembly/standalone.xml
===================================================================
--- trunk/faxtomail-ui-swing/src/main/assembly/standalone.xml (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/assembly/standalone.xml 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Tutti :: UI
+ $Id: standalone.xml 399 2013-02-11 17:33:57Z tchemit $
+ $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/asse… $
+ %%
+ Copyright (C) 2012 Ifremer
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+ -->
+
+<assembly
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>standalone</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <fileSets>
+
+ <fileSet>
+ <directory>target</directory>
+ <outputDirectory/>
+ <includes>
+ <include>${project.build.finalName}.${project.packaging}</include>
+ </includes>
+ </fileSet>
+
+ <fileSet>
+ <directory>target/lib</directory>
+ <outputDirectory>lib</outputDirectory>
+ <includes>
+ <include>*.jar</include>
+ </includes>
+ <excludes>
+ <exclude>junit-*.jar</exclude>
+ </excludes>
+ </fileSet>
+
+ <fileSet>
+ <directory>src/main/assembly/min</directory>
+ <outputDirectory/>
+ <filtered>true</filtered>
+ <fileMode>0755</fileMode>
+ <includes>
+ <include>launch.sh</include>
+ <include>launch.bat</include>
+ </includes>
+ </fileSet>
+
+ <fileSet>
+ <includes>
+ <include>README*</include>
+ <include>LICENSE*</include>
+ </includes>
+ </fileSet>
+
+ </fileSets>
+</assembly>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailScreen.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailScreen.java 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailScreen.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -17,5 +17,7 @@
SEARCH,
- DEMANDE, LIST
+ DEMANDE,
+
+ LIST
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,14 +1,14 @@
package com.franciaflex.faxtomail.ui.swing;
-import com.franciaflex.faxtomail.service.DecoratorService;
import com.franciaflex.faxtomail.FaxToMailIOUtil;
-import com.franciaflex.faxtomail.service.FaxToMailServiceContext;
+import com.franciaflex.faxtomail.services.DefaultFaxToMailServiceContext;
+import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
import com.franciaflex.faxtomail.persistence.RessourceClassLoader;
import com.franciaflex.faxtomail.ui.swing.config.FaxToMailApplicationConfig;
import com.franciaflex.faxtomail.ui.swing.content.MainUI;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailErrorHelper;
import com.franciaflex.faxtomail.ui.swing.util.UIMessageNotifier;
-import com.franciaflex.faxtomail.ui.swing.util.action.FaxToMailActionUI;
+import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionUI;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -17,7 +17,6 @@
import jaxx.runtime.swing.session.BeanDoubleListState;
import jaxx.runtime.swing.session.BeanFilterableComboBoxState;
import jaxx.runtime.swing.session.State;
-import jaxx.runtime.swing.session.SwingSession;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
@@ -81,14 +80,14 @@
*
* @since 0.1
*/
- protected final FaxToMailServiceContext serviceContext;
+// protected final FaxToMailServiceContext serviceContext;
/**
* Swing session used to save ui states.
*
* @since 0.1
*/
- protected final SwingSession swingSession;
+// protected final SwingSession swingSession;
/**
* Erro helper.
@@ -156,12 +155,12 @@
protected FaxToMailUIContext(FaxToMailApplicationConfig config) {
this.config = config;
this.resourceLoader = new RessourceClassLoader(Thread.currentThread().getContextClassLoader());
- this.serviceContext = new FaxToMailServiceContext(resourceLoader, config.getServiceConfig());
+// this.serviceContext = new DefaultFaxToMailServiceContext(resourceLoader, config.getServiceConfig());
Map<Class, State> additionalStates = Maps.newHashMap();
additionalStates.put(BeanFilterableComboBox.class, new BeanFilterableComboBoxState());
additionalStates.put(BeanDoubleList.class, new BeanDoubleListState());
- this.swingSession = new SwingSession(getConfig().getUIConfigFile(), false, additionalStates);
+// this.swingSession = new SwingSession(getConfig().getUIConfigFile(), false, additionalStates);
UIMessageNotifier logMessageNotifier = new UIMessageNotifier() {
@@ -234,36 +233,36 @@
//--------------------------------------------------------------------//
// init i18n
//--------------------------------------------------------------------//
- File i18nDirectory = config.getI18nDirectory();
- if (!config.isFullLaunchMode()) {
+// File i18nDirectory = config.getI18nDirectory();
+// if (!config.isFullLaunchMode()) {
+//
+// i18nDirectory = new File(config.getDataDirectory(), "i18n");
+//
+// if (i18nDirectory.exists()) {
+// // clean i18n cache
+// FaxToMailIOUtil.cleanDirectory(
+// i18nDirectory,
+// _("faxtomail.i18n.deleteCache.error", i18nDirectory));
+// }
+// }
+//
+// FaxToMailIOUtil.forceMkdir(i18nDirectory,
+// _("faxtomail.i18n.mkDir.error", i18nDirectory));
+//
+// if (log.isDebugEnabled()) {
+// log.debug("I18N directory: " + i18nDirectory);
+// }
+//
+// Locale i18nLocale = config.getI18nLocale();
+//
+// if (log.isInfoEnabled()) {
+// log.info(String.format("Starts i18n with locale [%s] at [%s]",
+// i18nLocale, i18nDirectory));
+// }
+// I18n.init(new UserI18nInitializer(
+// i18nDirectory, new DefaultI18nInitializer("faxtomail-i18n")),
+// i18nLocale);
- i18nDirectory = new File(config.getDataDirectory(), "i18n");
-
- if (i18nDirectory.exists()) {
- // clean i18n cache
- FaxToMailIOUtil.cleanDirectory(
- i18nDirectory,
- _("faxtomail.i18n.deleteCache.error", i18nDirectory));
- }
- }
-
- FaxToMailIOUtil.forceMkdir(i18nDirectory,
- _("faxtomail.i18n.mkDir.error", i18nDirectory));
-
- if (log.isDebugEnabled()) {
- log.debug("I18N directory: " + i18nDirectory);
- }
-
- Locale i18nLocale = config.getI18nLocale();
-
- if (log.isInfoEnabled()) {
- log.info(String.format("Starts i18n with locale [%s] at [%s]",
- i18nLocale, i18nDirectory));
- }
- I18n.init(new UserI18nInitializer(
- i18nDirectory, new DefaultI18nInitializer("faxtomail-i18n")),
- i18nLocale);
-
// //--------------------------------------------------------------------//
// // init help
// //--------------------------------------------------------------------//
@@ -348,7 +347,7 @@
setScreen(null);
- IOUtils.closeQuietly(serviceContext);
+// IOUtils.closeQuietly(serviceContext);
// // remove listeners
// PropertyChangeListener[] listeners = getPropertyChangeListeners();
@@ -371,9 +370,9 @@
//-- Service methods --//
//------------------------------------------------------------------------//
- public DecoratorService getDecoratorService() {
- return serviceContext.getService(DecoratorService.class);
- }
+// public DecoratorService getDecoratorService() {
+// return serviceContext.getService(DecoratorService.class);
+// }
//------------------------------------------------------------------------//
//-- DataContext methods --//
@@ -420,9 +419,9 @@
this.actionUI = actionUI;
}
- public SwingSession getSwingSession() {
- return swingSession;
- }
+// public SwingSession getSwingSession() {
+// return swingSession;
+// }
public FaxToMailScreen getScreen() {
return screen;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -5,7 +5,7 @@
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
import com.franciaflex.faxtomail.ui.swing.content.StartAction;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailExceptionHandler;
-import com.franciaflex.faxtomail.ui.swing.util.action.FaxToMailActionHelper;
+import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionHelper;
import jaxx.runtime.SwingUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -136,7 +136,7 @@
handler.onCloseUI();
//close context
- context.getSwingSession().save();
+// context.getSwingSession().save();
context.close();
if (exitCode != null) {
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/AbstractFaxToMailAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/action/AbstractFaxToMailAction.java 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/AbstractFaxToMailAction.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,334 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.util.action;
-
-import com.franciaflex.faxtomail.persistence.ProgressionModel;
-import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import com.franciaflex.faxtomail.ui.swing.config.FaxToMailApplicationConfig;
-import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
-import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI;
-import com.google.common.base.Preconditions;
-import jaxx.runtime.FileChooserUtil;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jdesktop.beans.AbstractBean;
-import org.nuiton.decorator.Decorator;
-
-import javax.swing.*;
-import java.io.File;
-
-import static org.nuiton.i18n.I18n._;
-
-/**
- * FaxToMail base action.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public abstract class AbstractFaxToMailAction<M extends AbstractBean, UI extends FaxToMailUI<M, ?>, H extends AbstractFaxToMailUIHandler<M, UI>>
- extends AbstractBean {
-
- /** Logger. */
- private static final Log log = LogFactory.getLog(AbstractFaxToMailAction.class);
-
- public static final String PROPERTY_DONE = "done";
-
- protected final H handler;
-
- protected String actionDescription;
-
- protected final boolean hideBody;
-
- protected final Object lock = new Object();
-
- public abstract void doAction() throws Exception;
-
- protected AbstractFaxToMailAction(H handler, boolean hideBody) {
- this.handler = handler;
- this.hideBody = hideBody;
- }
-
- public boolean prepareAction() throws Exception {
- // by default nothing to prepare
- return true;
- }
-
- protected void releaseAction() {
- // by default nothing to clean
- firePropertyChange(PROPERTY_DONE, null, true);
- }
-
- public void postSuccessAction() {
- // by default nothing to do after action
- }
-
- public void postFailedAction(Throwable error) {
- // by default nothing to do after action
- }
-
- public H getHandler() {
- return handler;
- }
-
- public M getModel() {
- return handler.getModel();
- }
-
- public final UI getUI() {
- return handler.getUI();
- }
-
- public FaxToMailUIContext getContext() {
- return handler.getContext();
- }
-
- public String getActionDescription() {
- return actionDescription;
- }
-
- public void setActionDescription(String actionDescription) {
- this.actionDescription = actionDescription;
- }
-
- public void setProgressionModel(ProgressionModel progressionModel) {
- getContext().getActionUI().getModel().setProgressionModel(progressionModel);
- }
-
- protected ProgressionModel getProgressionModel() {
- return getContext().getActionUI().getModel().getProgressionModel();
- }
-
- public boolean isHideBody() {
- return hideBody;
- }
-
-// public TuttiDataContext getDataContext() {
-// return getContext().getDataContext();
-// }
-
- protected FaxToMailApplicationConfig getConfig() {
- return getContext().getConfig();
- }
-
- protected void sendMessage(String message) {
- getContext().showInformationMessage(message);
- }
-
- protected <O> Decorator<O> getDecorator(Class<O> type, String name) {
- Decorator<O> decorator = handler.getDecorator(type, name);
- Preconditions.checkNotNull(decorator);
- return decorator;
- }
-
- protected String decorate(Object object) {
- return getDecorator(object.getClass(), null).toString(object);
- }
-
- protected String decorate(Object object, String context) {
- return getDecorator(object.getClass(), context).toString(object);
- }
-
-// protected boolean askAdminPassword(String askMessage,
-// String askMessageTitle,
-// String errorMessage,
-// String errorMessageTitle) {
-//
-// Component container = getContext().getActionUI();
-//
-// String answer;
-// boolean result;
-// do {
-// answer = JOptionPane.showInputDialog(container,
-// askMessage,
-// askMessageTitle,
-// JOptionPane.WARNING_MESSAGE);
-// if (answer != null) {
-// String cryptedAnswer = StringUtil.encodeMD5(answer);
-// String correctAnswer = getConfig().getAdminPassword();
-// result = StringUtils.equals(cryptedAnswer, correctAnswer);
-//
-// if (!result) {
-// JOptionPane.showMessageDialog(container,
-// errorMessage,
-// errorMessageTitle,
-// JOptionPane.ERROR_MESSAGE);
-// }
-//
-// } else {
-// result = false;
-// }
-//
-// } while (!result && answer != null);
-// return result;
-// }
-
- /**
- * Choisir un fichier via un sélecteur graphique de fichiers.
- *
- * @param title le titre du dialogue de sélection
- * @param buttonLabel le label du boutton d'acceptation
- * @param filters les filtres + descriptions sur le sélecteur de
- * fichiers
- * @return le fichier choisi ou le fichier incoming si l'opération a été
- * annulée
- */
- protected File chooseFile(String title,
- String buttonLabel,
- String... filters) {
-
- File file = FileChooserUtil.getFile(title,
- buttonLabel,
- getContext().getMainUI(),
- filters);
- if (log.isDebugEnabled()) {
- log.debug(title + " : " + file);
- }
- if (file != null) {
- File newDir = file.isDirectory() ? file : file.getParentFile();
- FileChooserUtil.setCurrentDirectory(newDir);
- }
- return file;
- }
-
- /**
- * Sauver un fichier via un sélecteur graphique de fichiers.
- *
- * @param title le titre du dialogue de sélection
- * @param buttonLabel le label du boutton d'acceptation
- * @param filters les filtres + descriptions sur le sélecteur de
- * fichiers
- * @return le fichier choisi ou {@code null} si pas de fichier choisi ou
- * pas voulu écrasé un fichier existant.
- */
- protected File saveFile(File defaultFile,
- String filename,
- String extension,
- String title,
- String buttonLabel,
- String... filters) {
-
- if (defaultFile != null && FileChooserUtil.isCurrentDirectoryDefault()) {
-
- // set default directory to this one
- FileChooserUtil.setCurrentDirectory(defaultFile);
- }
- File file = saveFile(filename, extension, title, buttonLabel, filters);
- return file;
- }
-
- /**
- * Sauver un fichier via un sélecteur graphique de fichiers.
- *
- * @param title le titre du dialogue de sélection
- * @param buttonLabel le label du boutton d'acceptation
- * @param filters les filtres + descriptions sur le sélecteur de
- * fichiers
- * @return le fichier choisi ou {@code null} si pas de fichier choisi ou
- * pas voulu écrasé un fichier existant.
- */
- protected File saveFile(String filename,
- String extension,
- String title,
- String buttonLabel,
- String... filters) {
-
- boolean withExtension = StringUtils.isNotBlank(extension);
- String filenameSuffix = withExtension ? "." + extension : "";
- File file = FileChooserUtil.saveFile(filename + filenameSuffix, title, buttonLabel, getContext().getMainUI(), filters);
- if (log.isDebugEnabled()) {
- log.debug(title + " : " + file);
- }
- if (file != null) {
- Preconditions.checkState(!file.isDirectory());
-
- // add extension if missing
- if (withExtension && !file.getName().endsWith(filenameSuffix)) {
- file = new File(file.getParentFile(), file.getName() + filenameSuffix);
- }
-
- // ask user to confirm overwrite.
- boolean confirm = askOverwriteFile(file);
-
- if (confirm) {
-
- // on conserve le répertoire (pour une prochaine utilisation)
- FileChooserUtil.setCurrentDirectory(file.getParentFile());
- } else {
-
- // l'utilisateur n'a pas confirmé l'écrasement
- // donc pas de fichier en retour
- file = null;
- }
- }
-
- return file;
- }
-
- protected boolean askOverwriteFile(File file) {
- boolean result;
- if (file.exists()) {
-
- // file exists ask user to overwrite
- String htmlMessage = String.format(
- AbstractFaxToMailUIHandler.CONFIRMATION_FORMAT,
- _("faxtomail.common.askOverwriteFile.message", file),
- _("faxtomail.common.askOverwriteFile.help"));
-
- result = JOptionPane.showConfirmDialog(
- getHandler().getTopestUI(),
- htmlMessage,
- _("faxtomail.common.askOverwriteFile.title"),
- JOptionPane.OK_CANCEL_OPTION,
- JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION;
- } else {
-
- // file does not exist
- result = true;
- }
- return result;
- }
-
- protected boolean askBeforeDelete(String title, String message) {
- String htmlMessage = String.format(
- AbstractFaxToMailUIHandler.CONFIRMATION_FORMAT,
- message,
- _("faxtomail.common.askBeforeDelete.help"));
- int i = JOptionPane.showConfirmDialog(
- getHandler().getTopestUI(),
- htmlMessage,
- title,
- JOptionPane.OK_CANCEL_OPTION,
- JOptionPane.QUESTION_MESSAGE);
-
- boolean result = i == JOptionPane.OK_OPTION;
- return result;
- }
-
- protected void displayInfoMessage(String title, String message) {
- JOptionPane.showMessageDialog(
- getHandler().getTopestUI(),
- message,
- title,
- JOptionPane.INFORMATION_MESSAGE);
- }
-
- protected void displayWarningMessage(String title, String message) {
- JOptionPane.showMessageDialog(
- getHandler().getTopestUI(),
- message,
- title,
- JOptionPane.WARNING_MESSAGE);
- }
-
- protected void createProgressionModelIfRequired(int total) {
- ProgressionModel progressionModel = getProgressionModel();
- if (progressionModel==null) {
- progressionModel = new ProgressionModel();
- progressionModel.setTotal(total);
- progressionModel.setMessage("");
- progressionModel.setCurrent(0);
- setProgressionModel(progressionModel);
- } else {
- progressionModel.adaptTotal(total);
- }
- }
-}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/AbstractFaxToMailAction.java (from rev 2, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/action/AbstractFaxToMailAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/AbstractFaxToMailAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/AbstractFaxToMailAction.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,334 @@
+package com.franciaflex.faxtomail.ui.swing.action;
+
+import com.franciaflex.faxtomail.persistence.ProgressionModel;
+import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
+import com.franciaflex.faxtomail.ui.swing.config.FaxToMailApplicationConfig;
+import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
+import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI;
+import com.google.common.base.Preconditions;
+import jaxx.runtime.FileChooserUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.beans.AbstractBean;
+import org.nuiton.decorator.Decorator;
+
+import javax.swing.*;
+import java.io.File;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * FaxToMail base action.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public abstract class AbstractFaxToMailAction<M extends AbstractBean, UI extends FaxToMailUI<M, ?>, H extends AbstractFaxToMailUIHandler<M, UI>>
+ extends AbstractBean {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(AbstractFaxToMailAction.class);
+
+ public static final String PROPERTY_DONE = "done";
+
+ protected final H handler;
+
+ protected String actionDescription;
+
+ protected final boolean hideBody;
+
+ protected final Object lock = new Object();
+
+ public abstract void doAction() throws Exception;
+
+ protected AbstractFaxToMailAction(H handler, boolean hideBody) {
+ this.handler = handler;
+ this.hideBody = hideBody;
+ }
+
+ public boolean prepareAction() throws Exception {
+ // by default nothing to prepare
+ return true;
+ }
+
+ protected void releaseAction() {
+ // by default nothing to clean
+ firePropertyChange(PROPERTY_DONE, null, true);
+ }
+
+ public void postSuccessAction() {
+ // by default nothing to do after action
+ }
+
+ public void postFailedAction(Throwable error) {
+ // by default nothing to do after action
+ }
+
+ public H getHandler() {
+ return handler;
+ }
+
+ public M getModel() {
+ return handler.getModel();
+ }
+
+ public final UI getUI() {
+ return handler.getUI();
+ }
+
+ public FaxToMailUIContext getContext() {
+ return handler.getContext();
+ }
+
+ public String getActionDescription() {
+ return actionDescription;
+ }
+
+ public void setActionDescription(String actionDescription) {
+ this.actionDescription = actionDescription;
+ }
+
+ public void setProgressionModel(ProgressionModel progressionModel) {
+ getContext().getActionUI().getModel().setProgressionModel(progressionModel);
+ }
+
+ protected ProgressionModel getProgressionModel() {
+ return getContext().getActionUI().getModel().getProgressionModel();
+ }
+
+ public boolean isHideBody() {
+ return hideBody;
+ }
+
+// public TuttiDataContext getDataContext() {
+// return getContext().getDataContext();
+// }
+
+// protected FaxToMailApplicationConfig getConfig() {
+// return getContext().getConfig();
+// }
+
+ protected void sendMessage(String message) {
+ getContext().showInformationMessage(message);
+ }
+
+// protected <O> Decorator<O> getDecorator(Class<O> type, String name) {
+// Decorator<O> decorator = handler.getDecorator(type, name);
+// Preconditions.checkNotNull(decorator);
+// return decorator;
+// }
+
+// protected String decorate(Object object) {
+// return getDecorator(object.getClass(), null).toString(object);
+// }
+//
+// protected String decorate(Object object, String context) {
+// return getDecorator(object.getClass(), context).toString(object);
+// }
+
+// protected boolean askAdminPassword(String askMessage,
+// String askMessageTitle,
+// String errorMessage,
+// String errorMessageTitle) {
+//
+// Component container = getContext().getActionUI();
+//
+// String answer;
+// boolean result;
+// do {
+// answer = JOptionPane.showInputDialog(container,
+// askMessage,
+// askMessageTitle,
+// JOptionPane.WARNING_MESSAGE);
+// if (answer != null) {
+// String cryptedAnswer = StringUtil.encodeMD5(answer);
+// String correctAnswer = getConfig().getAdminPassword();
+// result = StringUtils.equals(cryptedAnswer, correctAnswer);
+//
+// if (!result) {
+// JOptionPane.showMessageDialog(container,
+// errorMessage,
+// errorMessageTitle,
+// JOptionPane.ERROR_MESSAGE);
+// }
+//
+// } else {
+// result = false;
+// }
+//
+// } while (!result && answer != null);
+// return result;
+// }
+
+ /**
+ * Choisir un fichier via un sélecteur graphique de fichiers.
+ *
+ * @param title le titre du dialogue de sélection
+ * @param buttonLabel le label du boutton d'acceptation
+ * @param filters les filtres + descriptions sur le sélecteur de
+ * fichiers
+ * @return le fichier choisi ou le fichier incoming si l'opération a été
+ * annulée
+ */
+ protected File chooseFile(String title,
+ String buttonLabel,
+ String... filters) {
+
+ File file = FileChooserUtil.getFile(title,
+ buttonLabel,
+ getContext().getMainUI(),
+ filters);
+ if (log.isDebugEnabled()) {
+ log.debug(title + " : " + file);
+ }
+ if (file != null) {
+ File newDir = file.isDirectory() ? file : file.getParentFile();
+ FileChooserUtil.setCurrentDirectory(newDir);
+ }
+ return file;
+ }
+
+ /**
+ * Sauver un fichier via un sélecteur graphique de fichiers.
+ *
+ * @param title le titre du dialogue de sélection
+ * @param buttonLabel le label du boutton d'acceptation
+ * @param filters les filtres + descriptions sur le sélecteur de
+ * fichiers
+ * @return le fichier choisi ou {@code null} si pas de fichier choisi ou
+ * pas voulu écrasé un fichier existant.
+ */
+ protected File saveFile(File defaultFile,
+ String filename,
+ String extension,
+ String title,
+ String buttonLabel,
+ String... filters) {
+
+ if (defaultFile != null && FileChooserUtil.isCurrentDirectoryDefault()) {
+
+ // set default directory to this one
+ FileChooserUtil.setCurrentDirectory(defaultFile);
+ }
+ File file = saveFile(filename, extension, title, buttonLabel, filters);
+ return file;
+ }
+
+ /**
+ * Sauver un fichier via un sélecteur graphique de fichiers.
+ *
+ * @param title le titre du dialogue de sélection
+ * @param buttonLabel le label du boutton d'acceptation
+ * @param filters les filtres + descriptions sur le sélecteur de
+ * fichiers
+ * @return le fichier choisi ou {@code null} si pas de fichier choisi ou
+ * pas voulu écrasé un fichier existant.
+ */
+ protected File saveFile(String filename,
+ String extension,
+ String title,
+ String buttonLabel,
+ String... filters) {
+
+ boolean withExtension = StringUtils.isNotBlank(extension);
+ String filenameSuffix = withExtension ? "." + extension : "";
+ File file = FileChooserUtil.saveFile(filename + filenameSuffix, title, buttonLabel, getContext().getMainUI(), filters);
+ if (log.isDebugEnabled()) {
+ log.debug(title + " : " + file);
+ }
+ if (file != null) {
+ Preconditions.checkState(!file.isDirectory());
+
+ // add extension if missing
+ if (withExtension && !file.getName().endsWith(filenameSuffix)) {
+ file = new File(file.getParentFile(), file.getName() + filenameSuffix);
+ }
+
+ // ask user to confirm overwrite.
+ boolean confirm = askOverwriteFile(file);
+
+ if (confirm) {
+
+ // on conserve le répertoire (pour une prochaine utilisation)
+ FileChooserUtil.setCurrentDirectory(file.getParentFile());
+ } else {
+
+ // l'utilisateur n'a pas confirmé l'écrasement
+ // donc pas de fichier en retour
+ file = null;
+ }
+ }
+
+ return file;
+ }
+
+ protected boolean askOverwriteFile(File file) {
+ boolean result;
+ if (file.exists()) {
+
+ // file exists ask user to overwrite
+ String htmlMessage = String.format(
+ AbstractFaxToMailUIHandler.CONFIRMATION_FORMAT,
+ _("faxtomail.common.askOverwriteFile.message", file),
+ _("faxtomail.common.askOverwriteFile.help"));
+
+ result = JOptionPane.showConfirmDialog(
+ getHandler().getTopestUI(),
+ htmlMessage,
+ _("faxtomail.common.askOverwriteFile.title"),
+ JOptionPane.OK_CANCEL_OPTION,
+ JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION;
+ } else {
+
+ // file does not exist
+ result = true;
+ }
+ return result;
+ }
+
+ protected boolean askBeforeDelete(String title, String message) {
+ String htmlMessage = String.format(
+ AbstractFaxToMailUIHandler.CONFIRMATION_FORMAT,
+ message,
+ _("faxtomail.common.askBeforeDelete.help"));
+ int i = JOptionPane.showConfirmDialog(
+ getHandler().getTopestUI(),
+ htmlMessage,
+ title,
+ JOptionPane.OK_CANCEL_OPTION,
+ JOptionPane.QUESTION_MESSAGE);
+
+ boolean result = i == JOptionPane.OK_OPTION;
+ return result;
+ }
+
+ protected void displayInfoMessage(String title, String message) {
+ JOptionPane.showMessageDialog(
+ getHandler().getTopestUI(),
+ message,
+ title,
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+
+ protected void displayWarningMessage(String title, String message) {
+ JOptionPane.showMessageDialog(
+ getHandler().getTopestUI(),
+ message,
+ title,
+ JOptionPane.WARNING_MESSAGE);
+ }
+
+ protected void createProgressionModelIfRequired(int total) {
+ ProgressionModel progressionModel = getProgressionModel();
+ if (progressionModel==null) {
+ progressionModel = new ProgressionModel();
+ progressionModel.setTotal(total);
+ progressionModel.setMessage("");
+ progressionModel.setCurrent(0);
+ setProgressionModel(progressionModel);
+ } else {
+ progressionModel.adaptTotal(total);
+ }
+ }
+}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionException.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/action/FaxToMailActionException.java 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionException.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,34 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.util.action;
-
-/**
- * To box any error of a {@link AbstractFaxToMailAction}.
- *
- * @author kmorin
- * @since 0.1
- */
-public class FaxToMailActionException extends RuntimeException {
-
- private static final long serialVersionUID = 1L;
-
- private final AbstractFaxToMailAction action;
-
- public FaxToMailActionException(AbstractFaxToMailAction action, Throwable cause) {
- super(cause);
- this.action = action;
- }
-
- public static FaxToMailActionException propagateError(AbstractFaxToMailAction action,
- Throwable cause) {
- FaxToMailActionException result;
- if (cause instanceof FaxToMailActionException) {
- result = ((FaxToMailActionException) cause);
- } else {
- result = new FaxToMailActionException(action, cause);
- }
- return result;
- }
-
- public AbstractFaxToMailAction getAction() {
- return action;
- }
-}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionException.java (from rev 2, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/action/FaxToMailActionException.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionException.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionException.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,34 @@
+package com.franciaflex.faxtomail.ui.swing.action;
+
+/**
+ * To box any error of a {@link AbstractFaxToMailAction}.
+ *
+ * @author kmorin
+ * @since 0.1
+ */
+public class FaxToMailActionException extends RuntimeException {
+
+ private static final long serialVersionUID = 1L;
+
+ private final AbstractFaxToMailAction action;
+
+ public FaxToMailActionException(AbstractFaxToMailAction action, Throwable cause) {
+ super(cause);
+ this.action = action;
+ }
+
+ public static FaxToMailActionException propagateError(AbstractFaxToMailAction action,
+ Throwable cause) {
+ FaxToMailActionException result;
+ if (cause instanceof FaxToMailActionException) {
+ result = ((FaxToMailActionException) cause);
+ } else {
+ result = new FaxToMailActionException(action, cause);
+ }
+ return result;
+ }
+
+ public AbstractFaxToMailAction getAction() {
+ return action;
+ }
+}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionHelper.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/action/FaxToMailActionHelper.java 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionHelper.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,123 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.util.action;
-
-import com.franciaflex.faxtomail.FaxToMailTechnicalException;
-import com.franciaflex.faxtomail.ui.swing.content.AbstractMainUIFaxToMailAction;
-import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
-import com.google.common.base.Preconditions;
-import org.apache.commons.lang3.reflect.ConstructorUtils;
-
-import javax.swing.*;
-
-import static org.nuiton.i18n.I18n._;
-
-/**
- * Useful method around FaxToMailUIAction.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.2
- */
-public class FaxToMailActionHelper {
-
- public static <A extends AbstractFaxToMailAction> void runInternalAction(A action) {
- Throwable error = null;
-
- try {
- action.doAction();
- action.postSuccessAction();
- } catch (Throwable e) {
- error = e;
- throw FaxToMailActionException.propagateError(action, e);
- } finally {
- try {
- if (error != null) {
- action.postFailedAction(error);
- }
- } finally {
-
- action.releaseAction();
- }
- }
- }
-
- public static <A extends AbstractFaxToMailAction> void runInternalAction(AbstractFaxToMailUIHandler handler,
- Class<A> actionName) {
- A action = createLogicAction(handler, actionName);
- runInternalAction(action);
- }
-
- public static <A extends AbstractFaxToMailAction> void runAction(A action) {
- FaxToMailUIAction<A> uiAction = createUIAction(null, action);
- uiAction.actionPerformed(null);
- }
-
- public static void runAction(AbstractButton button) {
- button.getAction().actionPerformed(null);
- }
-
- public static <A extends AbstractFaxToMailAction> void runActionAndWait(A action) {
- FaxToMailUIAction<A> uiAction = createUIAction(null, action);
- uiAction.launchActionAndWait();
- }
-
- public static <A extends AbstractFaxToMailAction> void runActionAndWait(AbstractFaxToMailUIHandler handler,
- Class<A> actionName) {
- A logicAction = createLogicAction(handler, actionName);
- runActionAndWait(logicAction);
- }
-
- public static <A extends AbstractFaxToMailAction> FaxToMailUIAction<A> createUIAction(AbstractFaxToMailUIHandler handler,
- Class<A> actionName) {
- return createUIAction(handler, null, actionName);
- }
-
-
- public static <A extends AbstractFaxToMailAction> FaxToMailUIAction<A> createUIAction(AbstractFaxToMailUIHandler handler,
- AbstractButton abstractButton,
- Class<A> actionName) {
- try {
-
- // create logic action
- A logicAction = createLogicAction(handler, actionName);
-
- // create ui action
- FaxToMailUIAction<A> result = createUIAction(abstractButton, logicAction);
- return result;
- } catch (Exception e) {
-// throw new FaxToMailTechnicalException(_("tutti.action.create.error", actionName), e);
- }
- return null;
- }
-
- public static <A extends AbstractFaxToMailAction> FaxToMailUIAction<A> createUIAction(AbstractButton abstractButton,
- A logicAction) {
-
- // create ui action
- FaxToMailUIAction<A> result = new FaxToMailUIAction<A>(abstractButton,
- logicAction);
- return result;
- }
-
- public static <A extends AbstractFaxToMailAction> A createLogicAction(AbstractFaxToMailUIHandler handler,
- Class<A> actionName) {
- try {
-
- if (AbstractMainUIFaxToMailAction.class.isAssignableFrom(actionName) &&
- handler.getContext().getMainUI() != null) {
- handler = handler.getContext().getMainUI().getHandler();
- }
-
- // create action
- A result = ConstructorUtils.invokeConstructor(actionName, handler);
- return result;
- } catch (Exception e) {
- throw new FaxToMailTechnicalException(_("faxtomail.action.create.error", actionName), e);
- }
- }
-
- public static <A extends AbstractFaxToMailAction> A getLogicAction(AbstractButton b) {
- Action action = b.getAction();
- Preconditions.checkNotNull(action);
- Preconditions.checkState(action instanceof FaxToMailUIAction);
- return ((FaxToMailUIAction<A>) action).getLogicAction();
- }
-}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionHelper.java (from rev 2, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/action/FaxToMailActionHelper.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionHelper.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionHelper.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,123 @@
+package com.franciaflex.faxtomail.ui.swing.action;
+
+import com.franciaflex.faxtomail.FaxToMailTechnicalException;
+import com.franciaflex.faxtomail.ui.swing.content.AbstractMainUIFaxToMailAction;
+import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
+import com.google.common.base.Preconditions;
+import org.apache.commons.lang3.reflect.ConstructorUtils;
+
+import javax.swing.*;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * Useful method around FaxToMailUIAction.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.2
+ */
+public class FaxToMailActionHelper {
+
+ public static <A extends AbstractFaxToMailAction> void runInternalAction(A action) {
+ Throwable error = null;
+
+ try {
+ action.doAction();
+ action.postSuccessAction();
+ } catch (Throwable e) {
+ error = e;
+ throw FaxToMailActionException.propagateError(action, e);
+ } finally {
+ try {
+ if (error != null) {
+ action.postFailedAction(error);
+ }
+ } finally {
+
+ action.releaseAction();
+ }
+ }
+ }
+
+ public static <A extends AbstractFaxToMailAction> void runInternalAction(AbstractFaxToMailUIHandler handler,
+ Class<A> actionName) {
+ A action = createLogicAction(handler, actionName);
+ runInternalAction(action);
+ }
+
+ public static <A extends AbstractFaxToMailAction> void runAction(A action) {
+ FaxToMailUIAction<A> uiAction = createUIAction(null, action);
+ uiAction.actionPerformed(null);
+ }
+
+ public static void runAction(AbstractButton button) {
+ button.getAction().actionPerformed(null);
+ }
+
+ public static <A extends AbstractFaxToMailAction> void runActionAndWait(A action) {
+ FaxToMailUIAction<A> uiAction = createUIAction(null, action);
+ uiAction.launchActionAndWait();
+ }
+
+ public static <A extends AbstractFaxToMailAction> void runActionAndWait(AbstractFaxToMailUIHandler handler,
+ Class<A> actionName) {
+ A logicAction = createLogicAction(handler, actionName);
+ runActionAndWait(logicAction);
+ }
+
+ public static <A extends AbstractFaxToMailAction> FaxToMailUIAction<A> createUIAction(AbstractFaxToMailUIHandler handler,
+ Class<A> actionName) {
+ return createUIAction(handler, null, actionName);
+ }
+
+
+ public static <A extends AbstractFaxToMailAction> FaxToMailUIAction<A> createUIAction(AbstractFaxToMailUIHandler handler,
+ AbstractButton abstractButton,
+ Class<A> actionName) {
+ try {
+
+ // create logic action
+ A logicAction = createLogicAction(handler, actionName);
+
+ // create ui action
+ FaxToMailUIAction<A> result = createUIAction(abstractButton, logicAction);
+ return result;
+ } catch (Exception e) {
+// throw new FaxToMailTechnicalException(_("tutti.action.create.error", actionName), e);
+ }
+ return null;
+ }
+
+ public static <A extends AbstractFaxToMailAction> FaxToMailUIAction<A> createUIAction(AbstractButton abstractButton,
+ A logicAction) {
+
+ // create ui action
+ FaxToMailUIAction<A> result = new FaxToMailUIAction<A>(abstractButton,
+ logicAction);
+ return result;
+ }
+
+ public static <A extends AbstractFaxToMailAction> A createLogicAction(AbstractFaxToMailUIHandler handler,
+ Class<A> actionName) {
+ try {
+
+ if (AbstractMainUIFaxToMailAction.class.isAssignableFrom(actionName) &&
+ handler.getContext().getMainUI() != null) {
+ handler = handler.getContext().getMainUI().getHandler();
+ }
+
+ // create action
+ A result = ConstructorUtils.invokeConstructor(actionName, handler);
+ return result;
+ } catch (Exception e) {
+ throw new FaxToMailTechnicalException(_("faxtomail.action.create.error", actionName), e);
+ }
+ }
+
+ public static <A extends AbstractFaxToMailAction> A getLogicAction(AbstractButton b) {
+ Action action = b.getAction();
+ Preconditions.checkNotNull(action);
+ Preconditions.checkState(action instanceof FaxToMailUIAction);
+ return ((FaxToMailUIAction<A>) action).getLogicAction();
+ }
+}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionSwingWorker.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/action/FaxToMailActionSwingWorker.java 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionSwingWorker.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,161 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.util.action;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.swing.*;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.Timer;
-import java.util.TimerTask;
-
-/**
- * Worker to execute logic action.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0.3
- */
-public class FaxToMailActionSwingWorker<A extends AbstractFaxToMailAction> extends SwingWorker<Void, String> {
-
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(FaxToMailActionSwingWorker.class);
-
- /**
- * Timer used to launch timerTask (to open load dialog).
- *
- * @since 1.0.2
- */
- private static final Timer t = new Timer();
-
- protected final FaxToMailActionUI actionUI;
-
- protected final A action;
-
- protected Throwable error;
-
- protected TimerTask timer;
-
- protected FaxToMailActionSwingWorker(A action) {
-
- this.action = action;
- this.actionUI = action.getContext().getActionUI();
- }
-
- public Throwable getError() {
- return error;
- }
-
- public boolean isFailed() {
- return error != null;
- }
-
- @Override
- protected Void doInBackground() throws Exception {
-
- if (!isCancelled()) {
-
- timer = new FaxToMailActionTimerTask();
-
- t.schedule(timer, 1000);
-
- try {
-
- action.doAction();
-
- } catch (Throwable e) {
- if (log.isErrorEnabled()) {
- log.error("Task [" + this + "] Error while doAction: ", e);
- }
- error = e;
- } finally {
- if (log.isDebugEnabled()) {
- log.debug("Task [" + this + "] done");
- }
- }
- }
- return null;
- }
-
- @Override
- protected void done() {
- super.done();
-
- if (log.isDebugEnabled()) {
- log.debug("Task [" + this + "] execute done method after all");
- }
-
- if (error == null) {
-
- // success hook
- action.postSuccessAction();
- } else {
-
- // fail hook
- action.postFailedAction(error);
- }
-
- action.releaseAction();
-
- if (timer != null) {
-
- timer.cancel();
- }
-
- actionUI.close();
-
- updateBusyState(false);
- }
-
- protected void updateBusyState(boolean busy) {
-
- boolean hideBody = action.isHideBody();
-
- action.getContext().setBusy(busy);
-
- if (hideBody) {
- action.getContext().setHideBody(!busy);
- }
-
- }
-
- protected class FaxToMailActionTimerTask extends TimerTask {
-
- public FaxToMailActionTimerTask() {
- action.addPropertyChangeListener(AbstractFaxToMailAction.PROPERTY_DONE, new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
-
- if (actionUI.isVisible()) {
- actionUI.close();
- }
-
- // we do NOT want the timer to wake up then the actionUI dialog
- cancel();
- }
- });
- }
-
- @Override
- public void run() {
- if (isCancelled() || isDone()) {
-
- if (log.isDebugEnabled()) {
- log.debug("Task [" + action + "] was already canceled or done, do nothing");
- }
- } else {
-
- if (log.isDebugEnabled()) {
- log.debug("Task [" + action + "] is started, show waiting dialog");
- }
-
- SwingUtilities.invokeLater(new Runnable() {
- @Override
- public void run() {
- actionUI.open(action);
- }
- });
- }
- }
- }
-}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionSwingWorker.java (from rev 2, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/action/FaxToMailActionSwingWorker.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionSwingWorker.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionSwingWorker.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,161 @@
+package com.franciaflex.faxtomail.ui.swing.action;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.swing.*;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.Timer;
+import java.util.TimerTask;
+
+/**
+ * Worker to execute logic action.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.3
+ */
+public class FaxToMailActionSwingWorker<A extends AbstractFaxToMailAction> extends SwingWorker<Void, String> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(FaxToMailActionSwingWorker.class);
+
+ /**
+ * Timer used to launch timerTask (to open load dialog).
+ *
+ * @since 1.0.2
+ */
+ private static final Timer t = new Timer();
+
+ protected final FaxToMailActionUI actionUI;
+
+ protected final A action;
+
+ protected Throwable error;
+
+ protected TimerTask timer;
+
+ protected FaxToMailActionSwingWorker(A action) {
+
+ this.action = action;
+ this.actionUI = action.getContext().getActionUI();
+ }
+
+ public Throwable getError() {
+ return error;
+ }
+
+ public boolean isFailed() {
+ return error != null;
+ }
+
+ @Override
+ protected Void doInBackground() throws Exception {
+
+ if (!isCancelled()) {
+
+ timer = new FaxToMailActionTimerTask();
+
+ t.schedule(timer, 1000);
+
+ try {
+
+ action.doAction();
+
+ } catch (Throwable e) {
+ if (log.isErrorEnabled()) {
+ log.error("Task [" + this + "] Error while doAction: ", e);
+ }
+ error = e;
+ } finally {
+ if (log.isDebugEnabled()) {
+ log.debug("Task [" + this + "] done");
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ protected void done() {
+ super.done();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Task [" + this + "] execute done method after all");
+ }
+
+ if (error == null) {
+
+ // success hook
+ action.postSuccessAction();
+ } else {
+
+ // fail hook
+ action.postFailedAction(error);
+ }
+
+ action.releaseAction();
+
+ if (timer != null) {
+
+ timer.cancel();
+ }
+
+ actionUI.close();
+
+ updateBusyState(false);
+ }
+
+ protected void updateBusyState(boolean busy) {
+
+ boolean hideBody = action.isHideBody();
+
+ action.getContext().setBusy(busy);
+
+ if (hideBody) {
+ action.getContext().setHideBody(!busy);
+ }
+
+ }
+
+ protected class FaxToMailActionTimerTask extends TimerTask {
+
+ public FaxToMailActionTimerTask() {
+ action.addPropertyChangeListener(AbstractFaxToMailAction.PROPERTY_DONE, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ if (actionUI.isVisible()) {
+ actionUI.close();
+ }
+
+ // we do NOT want the timer to wake up then the actionUI dialog
+ cancel();
+ }
+ });
+ }
+
+ @Override
+ public void run() {
+ if (isCancelled() || isDone()) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Task [" + action + "] was already canceled or done, do nothing");
+ }
+ } else {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Task [" + action + "] is started, show waiting dialog");
+ }
+
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ actionUI.open(action);
+ }
+ });
+ }
+ }
+ }
+}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/action/FaxToMailActionUI.css 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUI.css 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,45 +0,0 @@
-
-#busyBlockLayerUI {
- useIcon:false;
- blockingColor: {handler.getConfig().getColorBlockingLayer()};
- block:{true};
-}
-
-#globalPanel {
- border: {new TitledBorder((String) null)};
-}
-
-#globalActionLabel {
- border: {new EmptyBorder(5, 5, 5, 5)};
-}
-
-#globalProgressBar {
- indeterminate: true;
-}
-
-#taskPanel {
- visible: false;
- border: {new TitledBorder((String) null)};
-}
-
-#taskProgressBar {
- indeterminate: false;
-}
-
-#taskActionLabel {
- border: {new EmptyBorder(5, 5, 5, 5)};
-}
-
-#informationPanel {
- visible: false;
- border: {new TitledBorder((String) null)};
-}
-
-#informationLabel {
- border: {new EmptyBorder(5, 5, 5, 5)};
-}
-
-#okAction {
- actionIcon: information;
- text: "faxtomail.action.ok";
-}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUI.css (from rev 2, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/action/FaxToMailActionUI.css)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUI.css (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUI.css 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,45 @@
+
+#busyBlockLayerUI {
+ useIcon:false;
+ blockingColor: {handler.getConfig().getColorBlockingLayer()};
+ block:{true};
+}
+
+#globalPanel {
+ border: {new TitledBorder((String) null)};
+}
+
+#globalActionLabel {
+ border: {new EmptyBorder(5, 5, 5, 5)};
+}
+
+#globalProgressBar {
+ indeterminate: true;
+}
+
+#taskPanel {
+ visible: false;
+ border: {new TitledBorder((String) null)};
+}
+
+#taskProgressBar {
+ indeterminate: false;
+}
+
+#taskActionLabel {
+ border: {new EmptyBorder(5, 5, 5, 5)};
+}
+
+#informationPanel {
+ visible: false;
+ border: {new TitledBorder((String) null)};
+}
+
+#informationLabel {
+ border: {new EmptyBorder(5, 5, 5, 5)};
+}
+
+#okAction {
+ actionIcon: information;
+ text: "faxtomail.action.ok";
+}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/action/FaxToMailActionUI.jaxx 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUI.jaxx 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,59 +0,0 @@
-<JDialog width='300' height='200' modal='true'
- undecorated='true'
- implements='com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI<FaxToMailActionUIModel, FaxToMailActionUIHandler>'>
- <import>
-
- com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI
- com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
-
- jaxx.runtime.swing.BlockingLayerUI
-
- javax.swing.border.EmptyBorder
- </import>
-
- <script><![CDATA[
-
- public FaxToMailActionUI(JFrame frame, FaxToMailUIContext context) {
- super(frame, true);
- FaxToMailActionUIHandler handler = new FaxToMailActionUIHandler(context, this);
- setContextValue(handler);
- handler.beforeInitUI();
- }
-
- public void open(AbstractFaxToMailAction action) {
- getModel().setAction(action);
- }
-
- public void close() {
- getModel().clear();
- }
-
- protected void $afterCompleteSetup() {
- handler.afterInitUI();
- }
- ]]></script>
-
-
- <BlockingLayerUI id='busyBlockLayerUI'/>
-
- <FaxToMailActionUIHandler id='handler'
- initializer='getContextValue(FaxToMailActionUIHandler.class)'/>
-
- <FaxToMailActionUIModel id='model'
- initializer='getContextValue(FaxToMailActionUIModel.class)'/>
-
- <JPanel id='rootPanel' layout='{new BorderLayout()}'
- constraints='BorderLayout.CENTER' decorator='boxed'>
- <JPanel id='globalPanel' constraints='BorderLayout.NORTH'
- layout='{new BorderLayout()}'>
- <JLabel id='globalActionLabel' constraints='BorderLayout.CENTER'/>
- <JProgressBar id='globalProgressBar' constraints='BorderLayout.SOUTH'/>
- </JPanel>
- <JPanel id='taskPanel' constraints='BorderLayout.CENTER'
- layout='{new BorderLayout()}'>
- <JLabel id='taskActionLabel' constraints='BorderLayout.CENTER'/>
- <JProgressBar id='taskProgressBar' constraints='BorderLayout.SOUTH'/>
- </JPanel>
- </JPanel>
-
-</JDialog>
\ No newline at end of file
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUI.jaxx (from rev 2, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/action/FaxToMailActionUI.jaxx)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUI.jaxx (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUI.jaxx 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,59 @@
+<JDialog width='300' height='200' modal='true'
+ undecorated='true'
+ implements='com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI<FaxToMailActionUIModel, FaxToMailActionUIHandler>'>
+ <import>
+
+ com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI
+ com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
+
+ jaxx.runtime.swing.BlockingLayerUI
+
+ javax.swing.border.EmptyBorder
+ </import>
+
+ <script><![CDATA[
+
+ public FaxToMailActionUI(JFrame frame, FaxToMailUIContext context) {
+ super(frame, true);
+ FaxToMailActionUIHandler handler = new FaxToMailActionUIHandler(context, this);
+ setContextValue(handler);
+ handler.beforeInitUI();
+ }
+
+ public void open(AbstractFaxToMailAction action) {
+ getModel().setAction(action);
+ }
+
+ public void close() {
+ getModel().clear();
+ }
+
+ protected void $afterCompleteSetup() {
+ handler.afterInitUI();
+ }
+ ]]></script>
+
+
+ <BlockingLayerUI id='busyBlockLayerUI'/>
+
+ <FaxToMailActionUIHandler id='handler'
+ initializer='getContextValue(FaxToMailActionUIHandler.class)'/>
+
+ <FaxToMailActionUIModel id='model'
+ initializer='getContextValue(FaxToMailActionUIModel.class)'/>
+
+ <JPanel id='rootPanel' layout='{new BorderLayout()}'
+ constraints='BorderLayout.CENTER' decorator='boxed'>
+ <JPanel id='globalPanel' constraints='BorderLayout.NORTH'
+ layout='{new BorderLayout()}'>
+ <JLabel id='globalActionLabel' constraints='BorderLayout.CENTER'/>
+ <JProgressBar id='globalProgressBar' constraints='BorderLayout.SOUTH'/>
+ </JPanel>
+ <JPanel id='taskPanel' constraints='BorderLayout.CENTER'
+ layout='{new BorderLayout()}'>
+ <JLabel id='taskActionLabel' constraints='BorderLayout.CENTER'/>
+ <JProgressBar id='taskProgressBar' constraints='BorderLayout.SOUTH'/>
+ </JPanel>
+ </JPanel>
+
+</JDialog>
\ No newline at end of file
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/action/FaxToMailActionUIHandler.java 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIHandler.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,250 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.util.action;
-
-import com.franciaflex.faxtomail.persistence.ProgressionModel;
-import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import com.franciaflex.faxtomail.ui.swing.content.MainUI;
-import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
-import jaxx.runtime.SwingUtil;
-import jaxx.runtime.swing.StatusMessagePanel;
-import jaxx.runtime.validator.swing.SwingValidator;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.ComponentAdapter;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import static org.nuiton.i18n.I18n._;
-
-/**
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public class FaxToMailActionUIHandler extends AbstractFaxToMailUIHandler<FaxToMailActionUIModel, FaxToMailActionUI> {
-
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(FaxToMailActionUIHandler.class);
-
- public FaxToMailActionUIHandler(FaxToMailUIContext context, FaxToMailActionUI ui) {
- super(context, ui);
- }
-
- protected PropertyChangeListener progressionListener = new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
-
- String propertyName = evt.getPropertyName();
- if (ProgressionModel.PROPERTY_MESSAGE.equals(propertyName)) {
-
- // change message
- String newMessage = (String) evt.getNewValue();
- ui.getTaskActionLabel().setText("<html><body>" + newMessage + "</body></html>");
- ui.pack();
- } else if (ProgressionModel.PROPERTY_TOTAL.equals(propertyName)) {
-
- // change total progressbar max
- ui.getTaskProgressBar().setMaximum((Integer) evt.getNewValue());
-
- } else if (ProgressionModel.PROPERTY_CURRENT.equals(propertyName)) {
-
- // change value of progress bar
- ui.getTaskProgressBar().setValue((Integer) evt.getNewValue());
- }
- }
- };
-
- protected ComponentListener listener = new ComponentAdapter() {
- boolean moving;
-
- boolean resizing;
-
- @Override
- public void componentMoved(ComponentEvent e) {
-
- MainUI mainUI = (MainUI) e.getSource();
-
- if (!moving && mainUI.isShowing()) {
-
- moving = true;
- try {
- setLocation(mainUI);
- } finally {
- moving = false;
- }
- }
- }
-
- @Override
- public void componentResized(ComponentEvent e) {
-
- MainUI mainUI = (MainUI) e.getSource();
-
- if (!resizing && mainUI.isShowing()) {
-
- resizing = true;
- try {
- setSize(mainUI);
- } finally {
- resizing = false;
- }
- }
- }
- };
-
- //------------------------------------------------------------------------//
- //-- AbstractTuttiUIHandler methods --//
- //------------------------------------------------------------------------//
-
- @Override
- public void beforeInitUI() {
- FaxToMailActionUIModel model = new FaxToMailActionUIModel();
- ui.setContextValue(model);
-
- model.addPropertyChangeListener(FaxToMailActionUIModel.PROPERTY_ACTION, new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
-
- // udpate global label
- AbstractFaxToMailAction action = (AbstractFaxToMailAction) evt.getNewValue();
-
- if (log.isDebugEnabled()) {
- log.debug("Action to use: " + action);
- }
- if (action == null) {
-
- // stoping action
- hideAction();
- } else {
-
- // starting action
- showAction(action);
- }
- }
- });
-
- model.addPropertyChangeListener(FaxToMailActionUIModel.PROPERTY_PROGRESSION_MODEL, new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
-
- // change progression model
-
- ProgressionModel oldValue = (ProgressionModel) evt.getOldValue();
- ProgressionModel newValue = (ProgressionModel) evt.getNewValue();
-
- if (log.isDebugEnabled()) {
- log.debug("progression model: " + newValue);
- }
- if (oldValue != null) {
- oldValue.removePropertyChangeListener(progressionListener);
- }
-
- if (newValue == null) {
-
- // remove progression model
- ui.getTaskPanel().setVisible(false);
- } else {
-
- // use progression model
- ui.getTaskPanel().setVisible(true);
-
- newValue.addPropertyChangeListener(progressionListener);
- }
- }
- });
- }
-
- @Override
- public void afterInitUI() {
-
- initUI(ui);
-
- // installation layer de blocage en mode busy
- SwingUtil.setLayerUI(ui.getRootPanel(), ui.getBusyBlockLayerUI());
-
- ui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
- }
-
- @Override
- protected JComponent getComponentToFocus() {
- return null;
- }
-
- @Override
- public void onCloseUI() {
-
- }
-
- @Override
- public SwingValidator<FaxToMailActionUIModel> getValidator() {
- return null;
- }
-
- //------------------------------------------------------------------------//
- //-- Internal methods --//
- //------------------------------------------------------------------------//
-
- protected void hideAction() {
- ui.setVisible(false);
- }
-
- protected void showAction(AbstractFaxToMailAction action) {
- ui.setTitle(_("faxtomail.main.title.action",
- getConfig().getVersion(),
- action.getActionDescription()));
- ui.getGlobalActionLabel().setText(
- _("faxtomail.message.action.running",
- action.getActionDescription()));
- ui.pack();
-
- MainUI mainUI = getContext().getMainUI();
- if (mainUI != null) {
- mainUI.addComponentListener(listener);
-
- setLocation(mainUI);
- setSize(mainUI);
- }
- try {
- ui.setVisible(true);
- } finally {
- if (mainUI != null) {
- mainUI.removeComponentListener(listener);
- }
- }
- }
-
- protected void setLocation(MainUI mainUI) {
- Container component = mainUI.getBody();
- StatusMessagePanel status = mainUI.getStatus();
- int width = component == null ? 0 : component.getWidth();
- int height = component == null ? 0 : component.getHeight() + status.getHeight();
-
- int x;
- int y;
- if (height == 0) {
- x = mainUI.getX() + 5;
- y = mainUI.getY() + 15;
- } else {
- x = mainUI.getX() + (mainUI.getWidth() - width);
- y = mainUI.getY() + (mainUI.getHeight() - height);
- }
- ui.setLocation(x, y);
- }
-
- protected void setSize(MainUI mainUI) {
- // Better to let his own size to the action progress bar
- // see http://forge.codelutin.com/issues/3263
-// Container component = mainUI.getBody();
-// int width = component == null ? 0 : component.getWidth();
-
- ui.pack();
-
-// if (width != 0 && ui.getWidth() < width) {
-// ui.setSize(width, ui.getHeight());
-// }
- }
-}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIHandler.java (from rev 2, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/action/FaxToMailActionUIHandler.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIHandler.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIHandler.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,251 @@
+package com.franciaflex.faxtomail.ui.swing.action;
+
+import com.franciaflex.faxtomail.persistence.ProgressionModel;
+import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
+import com.franciaflex.faxtomail.ui.swing.content.MainUI;
+import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
+import jaxx.runtime.SwingUtil;
+import jaxx.runtime.swing.StatusMessagePanel;
+import jaxx.runtime.validator.swing.SwingValidator;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public class FaxToMailActionUIHandler extends AbstractFaxToMailUIHandler<FaxToMailActionUIModel, FaxToMailActionUI> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(FaxToMailActionUIHandler.class);
+
+ public FaxToMailActionUIHandler(FaxToMailUIContext context, FaxToMailActionUI ui) {
+ super(context, ui);
+ }
+
+ protected PropertyChangeListener progressionListener = new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ String propertyName = evt.getPropertyName();
+ if (ProgressionModel.PROPERTY_MESSAGE.equals(propertyName)) {
+
+ // change message
+ String newMessage = (String) evt.getNewValue();
+ ui.getTaskActionLabel().setText("<html><body>" + newMessage + "</body></html>");
+ ui.pack();
+ } else if (ProgressionModel.PROPERTY_TOTAL.equals(propertyName)) {
+
+ // change total progressbar max
+ ui.getTaskProgressBar().setMaximum((Integer) evt.getNewValue());
+
+ } else if (ProgressionModel.PROPERTY_CURRENT.equals(propertyName)) {
+
+ // change value of progress bar
+ ui.getTaskProgressBar().setValue((Integer) evt.getNewValue());
+ }
+ }
+ };
+
+ protected ComponentListener listener = new ComponentAdapter() {
+ boolean moving;
+
+ boolean resizing;
+
+ @Override
+ public void componentMoved(ComponentEvent e) {
+
+ MainUI mainUI = (MainUI) e.getSource();
+
+ if (!moving && mainUI.isShowing()) {
+
+ moving = true;
+ try {
+ setLocation(mainUI);
+ } finally {
+ moving = false;
+ }
+ }
+ }
+
+ @Override
+ public void componentResized(ComponentEvent e) {
+
+ MainUI mainUI = (MainUI) e.getSource();
+
+ if (!resizing && mainUI.isShowing()) {
+
+ resizing = true;
+ try {
+ setSize(mainUI);
+ } finally {
+ resizing = false;
+ }
+ }
+ }
+ };
+
+ //------------------------------------------------------------------------//
+ //-- AbstractTuttiUIHandler methods --//
+ //------------------------------------------------------------------------//
+
+ @Override
+ public void beforeInitUI() {
+ FaxToMailActionUIModel model = new FaxToMailActionUIModel();
+ ui.setContextValue(model);
+
+ model.addPropertyChangeListener(FaxToMailActionUIModel.PROPERTY_ACTION, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ // udpate global label
+ AbstractFaxToMailAction action = (AbstractFaxToMailAction) evt.getNewValue();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Action to use: " + action);
+ }
+ if (action == null) {
+
+ // stoping action
+ hideAction();
+ } else {
+
+ // starting action
+ showAction(action);
+ }
+ }
+ });
+
+ model.addPropertyChangeListener(FaxToMailActionUIModel.PROPERTY_PROGRESSION_MODEL, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ // change progression model
+
+ ProgressionModel oldValue = (ProgressionModel) evt.getOldValue();
+ ProgressionModel newValue = (ProgressionModel) evt.getNewValue();
+
+ if (log.isDebugEnabled()) {
+ log.debug("progression model: " + newValue);
+ }
+ if (oldValue != null) {
+ oldValue.removePropertyChangeListener(progressionListener);
+ }
+
+ if (newValue == null) {
+
+ // remove progression model
+ ui.getTaskPanel().setVisible(false);
+ } else {
+
+ // use progression model
+ ui.getTaskPanel().setVisible(true);
+
+ newValue.addPropertyChangeListener(progressionListener);
+ }
+ }
+ });
+ }
+
+ @Override
+ public void afterInitUI() {
+
+ initUI(ui);
+
+ // installation layer de blocage en mode busy
+ SwingUtil.setLayerUI(ui.getRootPanel(), ui.getBusyBlockLayerUI());
+
+ ui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ }
+
+ @Override
+ protected JComponent getComponentToFocus() {
+ return null;
+ }
+
+ @Override
+ public void onCloseUI() {
+
+ }
+
+ @Override
+ public SwingValidator<FaxToMailActionUIModel> getValidator() {
+ return null;
+ }
+
+ //------------------------------------------------------------------------//
+ //-- Internal methods --//
+ //------------------------------------------------------------------------//
+
+ protected void hideAction() {
+ ui.setVisible(false);
+ }
+
+ protected void showAction(AbstractFaxToMailAction action) {
+ ui.setTitle(_("faxtomail.main.title.action",
+// getConfig().getVersion(),
+ "0.1",
+ action.getActionDescription()));
+ ui.getGlobalActionLabel().setText(
+ _("faxtomail.message.action.running",
+ action.getActionDescription()));
+ ui.pack();
+
+ MainUI mainUI = getContext().getMainUI();
+ if (mainUI != null) {
+ mainUI.addComponentListener(listener);
+
+ setLocation(mainUI);
+ setSize(mainUI);
+ }
+ try {
+ ui.setVisible(true);
+ } finally {
+ if (mainUI != null) {
+ mainUI.removeComponentListener(listener);
+ }
+ }
+ }
+
+ protected void setLocation(MainUI mainUI) {
+ Container component = mainUI.getBody();
+ StatusMessagePanel status = mainUI.getStatus();
+ int width = component == null ? 0 : component.getWidth();
+ int height = component == null ? 0 : component.getHeight() + status.getHeight();
+
+ int x;
+ int y;
+ if (height == 0) {
+ x = mainUI.getX() + 5;
+ y = mainUI.getY() + 15;
+ } else {
+ x = mainUI.getX() + (mainUI.getWidth() - width);
+ y = mainUI.getY() + (mainUI.getHeight() - height);
+ }
+ ui.setLocation(x, y);
+ }
+
+ protected void setSize(MainUI mainUI) {
+ // Better to let his own size to the action progress bar
+ // see http://forge.codelutin.com/issues/3263
+// Container component = mainUI.getBody();
+// int width = component == null ? 0 : component.getWidth();
+
+ ui.pack();
+
+// if (width != 0 && ui.getWidth() < width) {
+// ui.setSize(width, ui.getHeight());
+// }
+ }
+}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/action/FaxToMailActionUIModel.java 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIModel.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,51 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.util.action;
-
-import com.franciaflex.faxtomail.persistence.ProgressionModel;
-import com.google.common.base.Preconditions;
-import org.jdesktop.beans.AbstractSerializableBean;
-
-/**
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public class FaxToMailActionUIModel extends AbstractSerializableBean {
-
- private static final long serialVersionUID = 1L;
-
- public static final String PROPERTY_ACTION = "action";
-
- public static final String PROPERTY_PROGRESSION_MODEL = "progressionModel";
-
- protected AbstractFaxToMailAction action;
-
- protected ProgressionModel progressionModel;
-
- public ProgressionModel getProgressionModel() {
- return progressionModel;
- }
-
- public void setProgressionModel(ProgressionModel progressionModel) {
- Object oldValue = getProgressionModel();
- this.progressionModel = progressionModel;
- firePropertyChange(PROPERTY_PROGRESSION_MODEL, oldValue, progressionModel);
- }
-
- public AbstractFaxToMailAction getAction() {
- return action;
- }
-
- public void setAction(AbstractFaxToMailAction action) {
- Preconditions.checkNotNull(action, "action can not be null");
- Object oldValue = getAction();
- this.action = action;
- firePropertyChange(PROPERTY_ACTION, oldValue, action);
- }
-
- public void clear() {
-// setProgressionModel(null);
-
- Object oldValue = getAction();
- action = null;
- firePropertyChange(PROPERTY_ACTION, oldValue, null);
- }
-}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIModel.java (from rev 2, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/action/FaxToMailActionUIModel.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIModel.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIModel.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,51 @@
+package com.franciaflex.faxtomail.ui.swing.action;
+
+import com.franciaflex.faxtomail.persistence.ProgressionModel;
+import com.google.common.base.Preconditions;
+import org.jdesktop.beans.AbstractSerializableBean;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public class FaxToMailActionUIModel extends AbstractSerializableBean {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String PROPERTY_ACTION = "action";
+
+ public static final String PROPERTY_PROGRESSION_MODEL = "progressionModel";
+
+ protected AbstractFaxToMailAction action;
+
+ protected ProgressionModel progressionModel;
+
+ public ProgressionModel getProgressionModel() {
+ return progressionModel;
+ }
+
+ public void setProgressionModel(ProgressionModel progressionModel) {
+ Object oldValue = getProgressionModel();
+ this.progressionModel = progressionModel;
+ firePropertyChange(PROPERTY_PROGRESSION_MODEL, oldValue, progressionModel);
+ }
+
+ public AbstractFaxToMailAction getAction() {
+ return action;
+ }
+
+ public void setAction(AbstractFaxToMailAction action) {
+ Preconditions.checkNotNull(action, "action can not be null");
+ Object oldValue = getAction();
+ this.action = action;
+ firePropertyChange(PROPERTY_ACTION, oldValue, action);
+ }
+
+ public void clear() {
+// setProgressionModel(null);
+
+ Object oldValue = getAction();
+ action = null;
+ firePropertyChange(PROPERTY_ACTION, oldValue, null);
+ }
+}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailUIAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/action/FaxToMailUIAction.java 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailUIAction.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,201 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.util.action;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.util.TimeLog;
-
-import javax.swing.*;
-import java.awt.event.ActionEvent;
-import java.util.concurrent.CancellationException;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * Abstract FaxToMail ui action which launch a {@link AbstractFaxToMailAction}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0.2
- */
-public class FaxToMailUIAction<A extends AbstractFaxToMailAction> extends AbstractAction {
-
- private static final long serialVersionUID = 1L;
-
- /** Logger. */
- private static final Log log = LogFactory.getLog(FaxToMailUIAction.class);
-
- private static final TimeLog TIME_LOG = new TimeLog(FaxToMailUIAction.class);
-
- public static final ExecutorService waitingThread =
- Executors.newSingleThreadExecutor();
-
- private static final String LOGIC_ACTION = "logicAction";
-
- private final Object lock = new Object();
-
- private boolean wait;
-
- private long t0;
-
- public FaxToMailUIAction(AbstractButton button, A action) {
-
- putValue(LOGIC_ACTION, action);
-
- // fill the ui action from the button
- setActionKey(action.getClass().getName());
- if (button != null) {
- setActionIcon(button.getIcon());
- setActionName(button.getText());
- setActionDescription(button.getToolTipText());
- setActionMnemonic(button.getMnemonic());
- }
- }
-
- public void launchActionAndWait() {
- wait = true;
- actionPerformed(null);
- lock();
- }
-
-
- @Override
- public final void actionPerformed(final ActionEvent event) {
-
- t0 = TimeLog.getTime();
-
- if (log.isInfoEnabled()) {
- log.info("Task [" + getLogicAction().getClass().getSimpleName() + "] starting");
- }
-
- // prepare action
- boolean doAction;
-
- A action = getLogicAction();
-
- // reset status message
-// action.sendMessage("");
-
- try {
- doAction = action.prepareAction();
- } catch (Exception e) {
- action.releaseAction();
- throw FaxToMailActionException.propagateError(action, e);
- }
-
- if (doAction) {
-
- final FaxToMailActionSwingWorker<A> worker =
- new FaxToMailActionSwingWorker<A>(action);
-
- SwingUtilities.invokeLater(new Runnable() {
- @Override
- public void run() {
-
- // make ui busy
- worker.updateBusyState(true);
-
- }
- });
-
- if (log.isDebugEnabled()) {
- log.debug("Before execute of action " + action);
- }
-
- // perform and release action
- worker.execute();
-
- // wait until action is done
- waitingThread.execute(
- new Runnable() {
- @Override
- public void run() {
-
- A action = getLogicAction();
- try {
- try {
- worker.get();
- } catch (ExecutionException e) {
- // don't care .
- } catch (CancellationException e) {
- // dont care ?
- } catch (InterruptedException e) {
- // don't care ?
- }
- if (log.isDebugEnabled()) {
- log.debug("After execute of action " + action + " (worker done? " + worker.isDone() + ")");
- }
-
- if (worker.isFailed()) {
-
- throw FaxToMailActionException.propagateError(action, worker.getError());
- }
- } finally {
- unlock();
- }
- }
- }
- );
-
- } else {
-
- try {
- // release action
- action.releaseAction();
-
- } finally {
- unlock();
- }
- }
- }
-
- public void setActionIcon(Icon actionIcon) {
- putValue(SMALL_ICON, actionIcon);
- putValue(LARGE_ICON_KEY, actionIcon);
- }
-
- public void setActionKey(String actionKey) {
- putValue(ACTION_COMMAND_KEY, actionKey);
- }
-
- public void setActionName(String actionName) {
- putValue(NAME, actionName);
- }
-
- public void setActionDescription(String actionDescription) {
- putValue(SHORT_DESCRIPTION, actionDescription);
- getLogicAction().setActionDescription(actionDescription);
- }
-
- public void setActionMnemonic(int key) {
- putValue(MNEMONIC_KEY, key);
- }
-
- public A getLogicAction() {
- return (A) getValue(LOGIC_ACTION);
- }
-
- protected void lock() {
- if (wait) {
- synchronized (lock) {
- try {
-
- lock.wait();
-
- } catch (InterruptedException e) {
- throw FaxToMailActionException.propagateError(getLogicAction(), e);
- } finally {
- wait = false;
- }
- }
- }
- }
-
- protected void unlock() {
- TIME_LOG.log(t0, "Task [" + getLogicAction().getClass().getSimpleName() + "] End");
- if (wait) {
- synchronized (lock) {
- lock.notifyAll();
- }
- }
- }
-}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailUIAction.java (from rev 2, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/action/FaxToMailUIAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailUIAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailUIAction.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,201 @@
+package com.franciaflex.faxtomail.ui.swing.action;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.TimeLog;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.util.concurrent.CancellationException;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+/**
+ * Abstract FaxToMail ui action which launch a {@link AbstractFaxToMailAction}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.2
+ */
+public class FaxToMailUIAction<A extends AbstractFaxToMailAction> extends AbstractAction {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(FaxToMailUIAction.class);
+
+ private static final TimeLog TIME_LOG = new TimeLog(FaxToMailUIAction.class);
+
+ public static final ExecutorService waitingThread =
+ Executors.newSingleThreadExecutor();
+
+ private static final String LOGIC_ACTION = "logicAction";
+
+ private final Object lock = new Object();
+
+ private boolean wait;
+
+ private long t0;
+
+ public FaxToMailUIAction(AbstractButton button, A action) {
+
+ putValue(LOGIC_ACTION, action);
+
+ // fill the ui action from the button
+ setActionKey(action.getClass().getName());
+ if (button != null) {
+ setActionIcon(button.getIcon());
+ setActionName(button.getText());
+ setActionDescription(button.getToolTipText());
+ setActionMnemonic(button.getMnemonic());
+ }
+ }
+
+ public void launchActionAndWait() {
+ wait = true;
+ actionPerformed(null);
+ lock();
+ }
+
+
+ @Override
+ public final void actionPerformed(final ActionEvent event) {
+
+ t0 = TimeLog.getTime();
+
+ if (log.isInfoEnabled()) {
+ log.info("Task [" + getLogicAction().getClass().getSimpleName() + "] starting");
+ }
+
+ // prepare action
+ boolean doAction;
+
+ A action = getLogicAction();
+
+ // reset status message
+// action.sendMessage("");
+
+ try {
+ doAction = action.prepareAction();
+ } catch (Exception e) {
+ action.releaseAction();
+ throw FaxToMailActionException.propagateError(action, e);
+ }
+
+ if (doAction) {
+
+ final FaxToMailActionSwingWorker<A> worker =
+ new FaxToMailActionSwingWorker<A>(action);
+
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+
+ // make ui busy
+ worker.updateBusyState(true);
+
+ }
+ });
+
+ if (log.isDebugEnabled()) {
+ log.debug("Before execute of action " + action);
+ }
+
+ // perform and release action
+ worker.execute();
+
+ // wait until action is done
+ waitingThread.execute(
+ new Runnable() {
+ @Override
+ public void run() {
+
+ A action = getLogicAction();
+ try {
+ try {
+ worker.get();
+ } catch (ExecutionException e) {
+ // don't care .
+ } catch (CancellationException e) {
+ // dont care ?
+ } catch (InterruptedException e) {
+ // don't care ?
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("After execute of action " + action + " (worker done? " + worker.isDone() + ")");
+ }
+
+ if (worker.isFailed()) {
+
+ throw FaxToMailActionException.propagateError(action, worker.getError());
+ }
+ } finally {
+ unlock();
+ }
+ }
+ }
+ );
+
+ } else {
+
+ try {
+ // release action
+ action.releaseAction();
+
+ } finally {
+ unlock();
+ }
+ }
+ }
+
+ public void setActionIcon(Icon actionIcon) {
+ putValue(SMALL_ICON, actionIcon);
+ putValue(LARGE_ICON_KEY, actionIcon);
+ }
+
+ public void setActionKey(String actionKey) {
+ putValue(ACTION_COMMAND_KEY, actionKey);
+ }
+
+ public void setActionName(String actionName) {
+ putValue(NAME, actionName);
+ }
+
+ public void setActionDescription(String actionDescription) {
+ putValue(SHORT_DESCRIPTION, actionDescription);
+ getLogicAction().setActionDescription(actionDescription);
+ }
+
+ public void setActionMnemonic(int key) {
+ putValue(MNEMONIC_KEY, key);
+ }
+
+ public A getLogicAction() {
+ return (A) getValue(LOGIC_ACTION);
+ }
+
+ protected void lock() {
+ if (wait) {
+ synchronized (lock) {
+ try {
+
+ lock.wait();
+
+ } catch (InterruptedException e) {
+ throw FaxToMailActionException.propagateError(getLogicAction(), e);
+ } finally {
+ wait = false;
+ }
+ }
+ }
+ }
+
+ protected void unlock() {
+ TIME_LOG.log(t0, "Task [" + getLogicAction().getClass().getSimpleName() + "] End");
+ if (wait) {
+ synchronized (lock) {
+ lock.notifyAll();
+ }
+ }
+ }
+}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfig.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfig.java 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfig.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,8 +1,8 @@
package com.franciaflex.faxtomail.ui.swing.config;
import com.franciaflex.faxtomail.FaxToMailTechnicalException;
-import com.franciaflex.faxtomail.service.config.FaxToMailServiceConfig;
-import com.franciaflex.faxtomail.service.config.FaxToMailServiceConfigOption;
+import com.franciaflex.faxtomail.services.config.FaxToMailServiceConfig;
+import com.franciaflex.faxtomail.services.config.FaxToMailServiceConfigOption;
import com.google.common.base.Charsets;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.logging.Log;
@@ -86,28 +86,28 @@
}
//TODO Review this, this is very dirty to do this...
- File faxToMailBasedir = applicationConfig.getOptionAsFile(
- FaxToMailServiceConfigOption.BASEDIR.getKey());
+// File faxToMailBasedir = applicationConfig.getOptionAsFile(
+// FaxToMailServiceConfigOption.BASEDIR.getKey());
+//
+// if (faxToMailBasedir == null) {
+// faxToMailBasedir = new File("");
+// }
+// if (!faxToMailBasedir.isAbsolute()) {
+// faxToMailBasedir = new File(faxToMailBasedir.getAbsolutePath());
+// }
+// if (faxToMailBasedir.getName().equals("..")) {
+// faxToMailBasedir = faxToMailBasedir.getParentFile().getParentFile();
+// }
+// if (faxToMailBasedir.getName().equals(".")) {
+// faxToMailBasedir = faxToMailBasedir.getParentFile();
+// }
+// if (log.isInfoEnabled()) {
+// log.info("Application basedir: " + faxToMailBasedir);
+// }
+// applicationConfig.setOption(
+// FaxToMailServiceConfigOption.BASEDIR.getKey(),
+// faxToMailBasedir.getAbsolutePath());
- if (faxToMailBasedir == null) {
- faxToMailBasedir = new File("");
- }
- if (!faxToMailBasedir.isAbsolute()) {
- faxToMailBasedir = new File(faxToMailBasedir.getAbsolutePath());
- }
- if (faxToMailBasedir.getName().equals("..")) {
- faxToMailBasedir = faxToMailBasedir.getParentFile().getParentFile();
- }
- if (faxToMailBasedir.getName().equals(".")) {
- faxToMailBasedir = faxToMailBasedir.getParentFile();
- }
- if (log.isInfoEnabled()) {
- log.info("Application basedir: " + faxToMailBasedir);
- }
- applicationConfig.setOption(
- FaxToMailServiceConfigOption.BASEDIR.getKey(),
- faxToMailBasedir.getAbsolutePath());
-
serviceConfig = new FaxToMailServiceConfig(applicationConfig);
}
@@ -119,30 +119,30 @@
return serviceConfig;
}
- protected File configFile;
+// protected File configFile;
- public File getConfigFile() {
- if (configFile == null) {
- File dir = getFaxToMailBasedir();
- if (dir == null || !dir.exists() || !isFullLaunchMode()) {
- dir = new File(applicationConfig.getUserConfigDirectory());
- }
- configFile = new File(dir, applicationConfig.getConfigFileName());
- }
- return configFile;
- }
+// public File getConfigFile() {
+// if (configFile == null) {
+// File dir = getFaxToMailBasedir();
+// if (dir == null || !dir.exists() || !isFullLaunchMode()) {
+// dir = new File(applicationConfig.getUserConfigDirectory());
+// }
+// configFile = new File(dir, applicationConfig.getConfigFileName());
+// }
+// return configFile;
+// }
public void save() {
- File file = getConfigFile();
- if (log.isInfoEnabled()) {
- log.info("Save configuration at: " + file);
- }
- try {
- applicationConfig.save(file, false, optionKeyToNotSave);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(_("faxtomail.config.save.error", file), e);
- }
+// File file = getConfigFile();
+// if (log.isInfoEnabled()) {
+// log.info("Save configuration at: " + file);
+// }
+// try {
+// applicationConfig.save(file, false, optionKeyToNotSave);
+// } catch (IOException e) {
+// throw new FaxToMailTechnicalException(_("faxtomail.config.save.error", file), e);
+// }
}
@Override
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractMainUIFaxToMailAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractMainUIFaxToMailAction.java 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractMainUIFaxToMailAction.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,7 +1,7 @@
package com.franciaflex.faxtomail.ui.swing.content;
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import com.franciaflex.faxtomail.ui.swing.util.action.AbstractFaxToMailAction;
+import com.franciaflex.faxtomail.ui.swing.action.AbstractFaxToMailAction;
/**
* @author tchemit <chemit(a)codelutin.com>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -3,7 +3,6 @@
import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
import com.franciaflex.faxtomail.ui.swing.RunFaxToMail;
-import com.franciaflex.faxtomail.ui.swing.content.MainUI;
import com.franciaflex.faxtomail.ui.swing.content.config.FaxToMailConfigUI;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUI;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI;
@@ -12,18 +11,16 @@
import com.franciaflex.faxtomail.ui.swing.util.CloseableUI;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI;
import com.franciaflex.faxtomail.ui.swing.util.RemoveablePropertyChangeListener;
-import com.franciaflex.faxtomail.ui.swing.util.action.FaxToMailActionUI;
+import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionUI;
import com.google.common.base.Preconditions;
import jaxx.runtime.JAXXBinding;
import jaxx.runtime.SwingUtil;
-import jaxx.runtime.swing.session.SwingSession;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.i18n.I18n;
import javax.swing.Icon;
-import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JToolBar;
@@ -31,7 +28,6 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeListenerProxy;
-import java.net.URL;
import java.util.Locale;
import static org.nuiton.i18n.I18n._;
@@ -244,7 +240,8 @@
getModel().setLocale(locale);
//
// // change i18n locale
- I18n.setDefaultLocale(getConfig().getI18nLocale());
+// I18n.setDefaultLocale(getConfig().getI18nLocale());
+ I18n.setDefaultLocale(Locale.FRENCH);
//
// // reload decorator service (TODO Check if this is necessary)
// getContext().reloadDecoratorService();
@@ -341,7 +338,7 @@
FaxToMailUI<?, ?> body = (FaxToMailUI<?, ?>) currentBody;
body.getHandler().onCloseUI();
- context.getSwingSession().save();
+// context.getSwingSession().save();
ui.getBody().remove(currentBody);
@@ -396,7 +393,7 @@
// }
// rightDecoration.add(showHelp, 0);
this.currentBody = screenUI;
- context.getSwingSession().add(currentBody, true);
+// context.getSwingSession().add(currentBody, true);
ui.getBody().setTitle(screenTitle);
ui.getBody().add(currentBody);
ui.getBody().setLeftDecoration(new JLabel(icon));
@@ -413,7 +410,8 @@
String title = getSelectedCruiseTitle();
ui.setTitle(_("faxtomail.main.title.application",
- getConfig().getVersion(),
+// getConfig().getVersion(),
+ "0.1",
title));
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,7 +1,7 @@
package com.franciaflex.faxtomail.ui.swing.content;
import com.franciaflex.faxtomail.FaxToMailIOUtil;
-import com.franciaflex.faxtomail.ui.swing.util.action.FaxToMailActionHelper;
+import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -30,15 +30,15 @@
@Override
public boolean prepareAction() throws Exception {
- File actionfile = getConfig().getStartActionFile();
- boolean doAction = actionfile.exists();
+// File actionfile = getConfig().getStartActionFile();
+ boolean doAction = false;//actionfile.exists();
if (doAction) {
try {
// get action to execute
- String content = FaxToMailIOUtil.readContent(actionfile, _("faxtomail.error.read.startActionFile", actionfile));
- content = content.trim();
+// String content = FaxToMailIOUtil.readContent(actionfile, _("faxtomail.error.read.startActionFile", actionfile));
+// content = content.trim();
// if (InstallDbAction.class.getName().equals(content)) {
//
@@ -65,9 +65,9 @@
} finally {
// delete start action file
- FaxToMailIOUtil.deleteFile(
- actionfile,
- _("faxtomail.error.delete.startActionFile", actionfile));
+// FaxToMailIOUtil.deleteFile(
+// actionfile,
+// _("faxtomail.error.delete.startActionFile", actionfile));
}
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUIHandler.java 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUIHandler.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,28 +1,16 @@
package com.franciaflex.faxtomail.ui.swing.content.config;
-import com.franciaflex.faxtomail.service.config.FaxToMailServiceConfigOption;
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import com.franciaflex.faxtomail.ui.swing.config.FaxToMailApplicationConfig;
-import com.franciaflex.faxtomail.ui.swing.config.FaxToMailApplicationConfigOption;
-import com.franciaflex.faxtomail.ui.swing.content.GoToPreviousScreenAction;
import com.franciaflex.faxtomail.ui.swing.content.ReloadFaxToMailAction;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI;
-import com.franciaflex.faxtomail.ui.swing.util.action.FaxToMailActionHelper;
-import jaxx.runtime.SwingUtil;
-import jaxx.runtime.swing.config.ConfigUI;
-import jaxx.runtime.swing.config.ConfigUIHelper;
-import jaxx.runtime.swing.config.model.MainCallBackFinalizer;
+import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionHelper;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.swing.*;
-import java.awt.*;
-import static org.nuiton.i18n.I18n._;
-import static org.nuiton.i18n.I18n.n_;
-
/**
* @author tchemit <chemit(a)codelutin.com>
* @since 1.1
@@ -59,109 +47,109 @@
initUI(ui);
- FaxToMailApplicationConfig config = getConfig();
+// FaxToMailApplicationConfig config = getConfig();
- ConfigUIHelper helper = new ConfigUIHelper(config.getApplicationConfig(),
- config.getConfigFile());
+// ConfigUIHelper helper = new ConfigUIHelper(config.getApplicationConfig(),
+// config.getConfigFile());
- helper.registerCallBack(
- CALLBACK_UI, n_("faxtomail.config.action.reload.ui"),
- SwingUtil.createActionIcon("reload-ui"),
- new Runnable() {
+// helper.registerCallBack(
+// CALLBACK_UI, n_("faxtomail.config.action.reload.ui"),
+// SwingUtil.createActionIcon("reload-ui"),
+// new Runnable() {
+//
+// @Override
+// public void run() {
+// reloadUI();
+// }
+// }
+// ).registerCallBack(
+// CALLBACK_APPLICATION, n_("faxtomail.config.action.reload.application"),
+// SwingUtil.createActionIcon("reload-application"),
+// new Runnable() {
+//
+// @Override
+// public void run() {
+// reloadApplication();
+// }
+// }
+// ).registerCallBack(
+// CALLBACK_SHORTCUT, n_("faxtomail.config.action.reload.actions"),
+// SwingUtil.createActionIcon("reload-shortcut"),
+// new Runnable() {
+//
+// @Override
+// public void run() {
+// reloadShortcuts();
+// }
+// }
+// );
- @Override
- public void run() {
- reloadUI();
- }
- }
- ).registerCallBack(
- CALLBACK_APPLICATION, n_("faxtomail.config.action.reload.application"),
- SwingUtil.createActionIcon("reload-application"),
- new Runnable() {
-
- @Override
- public void run() {
- reloadApplication();
- }
- }
- ).registerCallBack(
- CALLBACK_SHORTCUT, n_("faxtomail.config.action.reload.actions"),
- SwingUtil.createActionIcon("reload-shortcut"),
- new Runnable() {
-
- @Override
- public void run() {
- reloadShortcuts();
- }
- }
- );
-
// Application category
- helper.addCategory(n_("faxtomail.config.category.applications"),
- n_("faxtomail.config.category.applications.description"),
- CALLBACK_APPLICATION)
- .addOption(FaxToMailServiceConfigOption.CSV_SEPARATOR)
- .setOptionShortLabel(_("faxtomail.config.option.csv.separator.shortLabel"))
+// helper.addCategory(n_("faxtomail.config.category.applications"),
+// n_("faxtomail.config.category.applications.description"),
+// CALLBACK_APPLICATION)
+// .addOption(FaxToMailServiceConfigOption.CSV_SEPARATOR)
+// .setOptionShortLabel(_("faxtomail.config.option.csv.separator.shortLabel"))
+//
+// .addOption(FaxToMailApplicationConfigOption.UI_CONFIG_FILE)
+// .setOptionShortLabel(_("faxtomail.config.option.ui.config.file.shortLabel"));
- .addOption(FaxToMailApplicationConfigOption.UI_CONFIG_FILE)
- .setOptionShortLabel(_("faxtomail.config.option.ui.config.file.shortLabel"));
-
// UI category
- helper.addCategory(n_("faxtomail.config.category.ui"),
- n_("faxtomail.config.category.ui.description"),
- CALLBACK_UI)
- .addOption(FaxToMailApplicationConfigOption.COLOR_ALTERNATE_ROW)
- .setOptionShortLabel(_("faxtomail.config.option.ui.color.alternateRow.shortLabel"))
+// helper.addCategory(n_("faxtomail.config.category.ui"),
+// n_("faxtomail.config.category.ui.description"),
+// CALLBACK_UI)
+// .addOption(FaxToMailApplicationConfigOption.COLOR_ALTERNATE_ROW)
+// .setOptionShortLabel(_("faxtomail.config.option.ui.color.alternateRow.shortLabel"))
+//
+// .addOption(FaxToMailApplicationConfigOption.COLOR_SELECTED_ROW)
+// .setOptionShortLabel(_("faxtomail.config.option.ui.color.selectedRow.shortLabel"))
+//
+// .addOption(FaxToMailApplicationConfigOption.COLOR_BLOCKING_LAYER)
+// .setOptionShortLabel(_("faxtomail.config.option.ui.color.blockingLayer.shortLabel"))
+//
+// .addOption(FaxToMailApplicationConfigOption.DATE_FORMAT)
+// .setOptionShortLabel(_("faxtomail.config.option.ui.dateFormat.shortLabel"));
- .addOption(FaxToMailApplicationConfigOption.COLOR_SELECTED_ROW)
- .setOptionShortLabel(_("faxtomail.config.option.ui.color.selectedRow.shortLabel"))
-
- .addOption(FaxToMailApplicationConfigOption.COLOR_BLOCKING_LAYER)
- .setOptionShortLabel(_("faxtomail.config.option.ui.color.blockingLayer.shortLabel"))
-
- .addOption(FaxToMailApplicationConfigOption.DATE_FORMAT)
- .setOptionShortLabel(_("faxtomail.config.option.ui.dateFormat.shortLabel"));
-
// Technical category
- helper.addCategory(n_("faxtomail.config.category.technical"),
- n_("faxtomail.config.category.technical.description"))
- .addOption(FaxToMailServiceConfigOption.BASEDIR)
- .setOptionShortLabel(_("faxtomail.config.option.basedir.shortLabel"))
+// helper.addCategory(n_("faxtomail.config.category.technical"),
+// n_("faxtomail.config.category.technical.description"))
+// .addOption(FaxToMailServiceConfigOption.BASEDIR)
+// .setOptionShortLabel(_("faxtomail.config.option.basedir.shortLabel"))
+//
+// .addOption(FaxToMailServiceConfigOption.TMP_DIRECTORY)
+// .setOptionShortLabel(_("faxtomail.config.option.tmp.directory.shortLabel"))
+//
+// .addOption(FaxToMailApplicationConfigOption.FAXTOMAIL_I18N_DIRECTORY)
+// .setOptionShortLabel(_("faxtomail.config.option.i18n.directory.shortLabel"))
+//
+//// .addOption(FaxToMailApplicationConfigOption.FAXTOMAIL_HELP_DIRECTORY)
+//// .setOptionShortLabel(_("faxtomail.config.option.help.directory.shortLabel"))
+//
+// .addOption(FaxToMailServiceConfigOption.SITE_URL)
+// .setOptionShortLabel(_("faxtomail.config.option.site.url.shortLabel"));
- .addOption(FaxToMailServiceConfigOption.TMP_DIRECTORY)
- .setOptionShortLabel(_("faxtomail.config.option.tmp.directory.shortLabel"))
- .addOption(FaxToMailApplicationConfigOption.FAXTOMAIL_I18N_DIRECTORY)
- .setOptionShortLabel(_("faxtomail.config.option.i18n.directory.shortLabel"))
+// helper.setFinalizer(new MainCallBackFinalizer(CALLBACK_APPLICATION));
-// .addOption(FaxToMailApplicationConfigOption.FAXTOMAIL_HELP_DIRECTORY)
-// .setOptionShortLabel(_("faxtomail.config.option.help.directory.shortLabel"))
-
- .addOption(FaxToMailServiceConfigOption.SITE_URL)
- .setOptionShortLabel(_("faxtomail.config.option.site.url.shortLabel"));
-
-
- helper.setFinalizer(new MainCallBackFinalizer(CALLBACK_APPLICATION));
-
- helper.setCloseAction(new Runnable() {
- @Override
- public void run() {
-
- FaxToMailActionHelper.runInternalAction(
- FaxToMailConfigUIHandler.this,
- GoToPreviousScreenAction.class);
-
- }
- });
- ConfigUI configUI = helper.buildUI(
- getUI(),
- n_("faxtomail.config.category.applications"));
-
- configUI.getHandler().setTopContainer(getUI());
- getUI().add(configUI, BorderLayout.CENTER);
+// helper.setCloseAction(new Runnable() {
+// @Override
+// public void run() {
+//
+// FaxToMailActionHelper.runInternalAction(
+// FaxToMailConfigUIHandler.this,
+// GoToPreviousScreenAction.class);
+//
+// }
+// });
+// ConfigUI configUI = helper.buildUI(
+// getUI(),
+// n_("faxtomail.config.category.applications"));
+//
+// configUI.getHandler().setTopContainer(getUI());
+// getUI().add(configUI, BorderLayout.CENTER);
}
@Override
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -28,11 +28,10 @@
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
import com.franciaflex.faxtomail.ui.swing.util.CloseableUI;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI;
-import com.franciaflex.faxtomail.ui.swing.util.action.FaxToMailActionHelper;
+import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionHelper;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jdesktop.swingx.JXList;
import org.jdesktop.swingx.JXTable;
import javax.swing.*;
@@ -41,7 +40,6 @@
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeModel;
-import javax.swing.tree.TreeNode;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -1,13 +1,12 @@
package com.franciaflex.faxtomail.ui.swing.util;
-import com.franciaflex.faxtomail.service.DecoratorService;
import com.franciaflex.faxtomail.LabelAware;
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
import com.franciaflex.faxtomail.ui.swing.config.FaxToMailApplicationConfig;
import com.franciaflex.faxtomail.ui.swing.content.MainUI;
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
-import com.franciaflex.faxtomail.ui.swing.util.action.FaxToMailActionHelper;
-import com.franciaflex.faxtomail.ui.swing.util.action.FaxToMailActionUI;
+import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionHelper;
+import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionUI;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import jaxx.runtime.JAXXUtil;
@@ -187,10 +186,10 @@
// add a auto-close action
JRootPane rootPane = result.getRootPane();
- KeyStroke shortcutClosePopup = getConfig().getShortcutClosePopup();
+// KeyStroke shortcutClosePopup = getConfig().getShortcutClosePopup();
- rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
- shortcutClosePopup, "close");
+// rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
+// shortcutClosePopup, "close");
rootPane.getActionMap().put("close", new AbstractAction() {
private static final long serialVersionUID = 1L;
@@ -299,23 +298,23 @@
handler.clearValidators();
}
- public <O> Decorator<O> getDecorator(Class<O> type, String name) {
- DecoratorService decoratorService =
- context.getDecoratorService();
+// public <O> Decorator<O> getDecorator(Class<O> type, String name) {
+// DecoratorService decoratorService =
+// context.getDecoratorService();
+//
+// Preconditions.checkNotNull(type);
+//
+// Decorator decorator = decoratorService.getDecoratorByType(type, name);
+// if (decorator == null) {
+//
+// if (LabelAware.class.isAssignableFrom(type)) {
+// decorator = getDecorator(LabelAware.class, null);
+// }
+// }
+// Preconditions.checkNotNull(decorator);
+// return decorator;
+// }
- Preconditions.checkNotNull(type);
-
- Decorator decorator = decoratorService.getDecoratorByType(type, name);
- if (decorator == null) {
-
- if (LabelAware.class.isAssignableFrom(type)) {
- decorator = getDecorator(LabelAware.class, null);
- }
- }
- Preconditions.checkNotNull(decorator);
- return decorator;
- }
-
public void autoSelectRowInTable(MouseEvent e, JPopupMenu popup) {
boolean rightClick = SwingUtilities.isRightMouseButton(e);
@@ -552,7 +551,7 @@
Class<E> beanType = comboBox.getBeanType();
Preconditions.checkNotNull(beanType, "No beanType on the combobox!");
- Decorator<E> decorator = getDecorator(beanType, decoratorContext);;
+// Decorator<E> decorator = getDecorator(beanType, decoratorContext);;
if (data == null) {
data = Lists.newArrayList();
@@ -566,14 +565,14 @@
comboBox.setI18nPrefix("tutti.property.");
// add data list to combo box
- comboBox.init((JXPathDecorator<E>) decorator, data);
+// comboBox.init((JXPathDecorator<E>) decorator, data);
- comboBox.setSelectedItem(selectedData);
+// comboBox.setSelectedItem(selectedData);
- if (log.isDebugEnabled()) {
- log.debug("combo [" + beanType.getName() + "] : " +
- comboBox.getData().size());
- }
+// if (log.isDebugEnabled()) {
+// log.debug("combo [" + beanType.getName() + "] : " +
+// comboBox.getData().size());
+// }
}
/**
@@ -679,9 +678,9 @@
if (log.isDebugEnabled()) {
log.debug("disable JXDatePicker editor" + picker.getName());
}
- String dateFormat = getConfig().getDateFormat();
- picker.setFormats(dateFormat);
- picker.setToolTipText(_("faxtomail.common.datefield.tip", dateFormat));
+// String dateFormat = getConfig().getDateFormat();
+ picker.setFormats("dd/MM/yyyy");
+ picker.setToolTipText(_("faxtomail.common.datefield.tip", "dd/MM/yyyy"));
picker.getEditor().addFocusListener(new FocusAdapter() {
@Override
@@ -805,9 +804,9 @@
protected String decorate(Object object, String context) {
String result = "";
- if (object != null) {
- result = getDecorator(object.getClass(), context).toString(object);
- }
+// if (object != null) {
+// result = getDecorator(object.getClass(), context).toString(object);
+// }
return result;
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailExceptionHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailExceptionHandler.java 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailExceptionHandler.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -3,8 +3,8 @@
import com.franciaflex.faxtomail.FaxToMailTechnicalException;
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
import com.franciaflex.faxtomail.ui.swing.content.AbstractChangeScreenAction;
-import com.franciaflex.faxtomail.ui.swing.util.action.AbstractFaxToMailAction;
-import com.franciaflex.faxtomail.ui.swing.util.action.FaxToMailActionException;
+import com.franciaflex.faxtomail.ui.swing.action.AbstractFaxToMailAction;
+import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionException;
import jaxx.runtime.swing.JAXXRuntimeException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties
===================================================================
--- trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-02-05 18:34:13 UTC (rev 4)
@@ -32,6 +32,8 @@
faxtomail.config.category.ui.description=
faxtomail.config.option.basedir.shortLabel=
faxtomail.config.option.csv.separator.shortLabel=
+faxtomail.config.option.help.directory.description=
+faxtomail.config.option.help.directory.shortLabel=
faxtomail.config.option.i18n.directory.description=
faxtomail.config.option.i18n.directory.shortLabel=
faxtomail.config.option.i18n.locale.description=
@@ -125,7 +127,17 @@
swing.error.desktop.browse.not.supported=
swing.error.desktop.mail.not.supported=
swing.error.desktop.not.supported=
+tutti.action.create.error=
+tutti.db.deleteCache.error=
tutti.editCruise.askCancelEditBeforeLeaving.cancelSaveCruise=
tutti.editCruise.askSaveBeforeLeaving.saveCruise=
tutti.editCruise.title.create.cruise=
tutti.editCruise.title.edit.cruise=
+tutti.error.ui.business.error=
+tutti.help.mkDir.error=
+tutti.main.title.noSelectedCruise=
+tutti.main.title.noSelectedProgram=
+tutti.main.title.noSelectedProtocol=
+tutti.main.title.selectedCruise=
+tutti.main.title.selectedProgram=
+tutti.main.title.selectedProtocol=
Copied: trunk/faxtomail-ui-web/LICENSE.txt (from rev 2, trunk/faxtomail-service/LICENSE.txt)
===================================================================
--- trunk/faxtomail-ui-web/LICENSE.txt (rev 0)
+++ trunk/faxtomail-ui-web/LICENSE.txt 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,674 @@
+decorators.xml GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
Copied: trunk/faxtomail-ui-web/README.txt (from rev 2, trunk/faxtomail-service/README.txt)
===================================================================
Added: trunk/faxtomail-ui-web/pom.xml
===================================================================
--- trunk/faxtomail-ui-web/pom.xml (rev 0)
+++ trunk/faxtomail-ui-web/pom.xml 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,254 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>com.franciaflex</groupId>
+ <artifactId>faxtomail</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ </parent>
+
+ <groupId>com.franciaflex.faxtomail</groupId>
+ <artifactId>faxtomail-ui-web</artifactId>
+ <packaging>war</packaging>
+
+ <name>FaxToMail :: Web</name>
+ <description>faxToMail Web Module</description>
+
+ <properties>
+ <redmine.releaseFiles>
+ target/${project.build.finalName}.war
+ </redmine.releaseFiles>
+
+ <deployFiles>target/${project.build.finalName}.war</deployFiles>
+
+ <defaultWebContextPath>faxtomail</defaultWebContextPath>
+ <defaultSiteUrl>http://localhost:8080/${defaultWebContextPath}</defaultSiteUrl>
+
+ <!-- see http://maven-site.nuiton.org/mavenpom/mavenpom4redmine/release.html -->
+ <skipPostRelease>false</skipPostRelease>
+
+ <!-- XXX voir le profil le profil removeSlf4jJclFromClassPath -->
+ <slf4jJclScope>runtime</slf4jJclScope>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>faxtomail-persistence</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>faxtomail-service</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.nuiton.topia</groupId>
+ <artifactId>topia-persistence</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.nuiton</groupId>
+ <artifactId>nuiton-utils</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.nuiton</groupId>
+ <artifactId>nuiton-validator</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.nuiton.i18n</groupId>
+ <artifactId>nuiton-i18n</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.nuiton.web</groupId>
+ <artifactId>nuiton-struts2</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.struts.xwork</groupId>
+ <artifactId>xwork-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-collections4</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.jgeppert.struts2.jquery</groupId>
+ <artifactId>struts2-jquery-plugin</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.jgeppert.struts2.bootstrap</groupId>
+ <artifactId>struts2-bootstrap-plugin</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-convention-plugin</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-json-plugin</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-sitemesh-plugin</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.shiro</groupId>
+ <artifactId>shiro-web</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ </dependency>
+
+ <!-- FIXME bleny 2013/12/18 need to be removed to do a tomcat:run since shiro was added -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-jcl</artifactId>
+ <scope>${slf4jJclScope}</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>extranet-enc-ahi-${project.version}</finalName>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tomcat.maven</groupId>
+ <artifactId>tomcat7-maven-plugin</artifactId>
+ <configuration>
+ <path>/${defaultWebContextPath}</path>
+ <systemProperties>
+ <siteUrl>${defaultSiteUrl}</siteUrl>
+ </systemProperties>
+ <uriEncoding>UTF-8</uriEncoding>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.i18n</groupId>
+ <artifactId>i18n-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>parseJsp</id>
+ <goals>
+ <goal>parserStruts2</goal>
+ </goals>
+ <configuration>
+ <acceptKeyFormat>^extranetEncAhi\..*$</acceptKeyFormat>
+ </configuration>
+ </execution>
+ <execution>
+ <id>parseOthersAndGen</id>
+ <configuration>
+ <entries>
+ <entry>
+ <specificGoal>parserValidation</specificGoal>
+ <basedir>${maven.src.dir}/main/java/</basedir>
+ <includes>
+ <param>**/**-validation.xml</param>
+ </includes>
+ </entry>
+ </entries>
+ </configuration>
+ <goals>
+ <goal>parserJava</goal>
+ <goal>gen</goal>
+ <goal>bundle</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webResources>
+ <resource>
+ <directory>src/main/webapp/WEB-INF/decorators</directory>
+ <targetPath>WEB-INF/decorators</targetPath>
+ <includes>
+ <include>version.jsp</include>
+ </includes>
+ <filtering>true</filtering>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ <!-- XXX le profil le profil removeSlf4jJclFromClasspath permet d'exclure cette dépendance du classpath, indispensable pour que tomcat7:run fonctione -->
+ <profiles>
+ <profile>
+ <id>removeSlf4jJclFromClasspath</id>
+ <properties>
+ <slf4jJclScope>provided</slf4jJclScope>
+ </properties>
+ </profile>
+ </profiles>
+</project>
Added: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java (rev 0)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,131 @@
+package com.franciaflex.faxtomail;
+
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaApplicationContext;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
+import com.franciaflex.faxtomail.services.DefaultFaxToMailServiceContext;
+import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
+import com.franciaflex.faxtomail.services.service.FaxToMailWebApplicationContext;
+import com.franciaflex.faxtomail.services.service.InitFaxToMailService;
+import com.franciaflex.faxtomail.web.DefaultFaxToMailWebApplicationContext;
+import com.opensymphony.xwork2.util.LocalizedTextUtil;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.PropertyConfigurator;
+import org.nuiton.i18n.I18n;
+import org.nuiton.i18n.init.DefaultI18nInitializer;
+import org.nuiton.i18n.init.I18nInitializer;
+
+import java.io.File;
+import java.util.Locale;
+
+public class FaxToMailApplicationContext {
+
+ private static Log log = LogFactory.getLog(FaxToMailApplicationContext.class);
+
+ public static final String APPLICATION_CONTEXT_PARAMETER = "faxToMailApplicationContext";
+
+ protected static FaxToMailTopiaApplicationContext topiaApplicationContext;
+
+ protected static FaxToMailApplicationConfig applicationConfig;
+
+ public static FaxToMailApplicationConfig getApplicationConfig() {
+ if (applicationConfig == null) {
+ applicationConfig = new FaxToMailApplicationConfig();
+ }
+ return applicationConfig;
+ }
+
+ public static FaxToMailTopiaApplicationContext getTopiaApplicationContext() {
+ if (topiaApplicationContext == null) {
+ topiaApplicationContext = new FaxToMailTopiaApplicationContext(getApplicationConfig().getTopiaProperties());
+ }
+ return topiaApplicationContext;
+ }
+
+ public FaxToMailTopiaPersistenceContext newPersistenceContext() {
+
+ FaxToMailTopiaPersistenceContext persistenceContext = getTopiaApplicationContext().newPersistenceContext();
+
+ return persistenceContext;
+
+ }
+
+ public FaxToMailServiceContext newServiceContext(FaxToMailTopiaPersistenceContext persistenceContext) {
+
+ DefaultFaxToMailServiceContext newServiceContext =
+ new DefaultFaxToMailServiceContext();
+
+ FaxToMailApplicationConfig applicationConfig = getApplicationConfig();
+
+ newServiceContext.setApplicationConfig(applicationConfig);
+
+ newServiceContext.setPersistenceContext(persistenceContext);
+
+ FaxToMailWebApplicationContext webApplicationContext =
+ new DefaultFaxToMailWebApplicationContext(applicationConfig.getInstanceUrl());
+
+ newServiceContext.setWebApplicationContext(webApplicationContext);
+
+ return newServiceContext;
+
+ }
+
+ public void close() {
+ if (topiaApplicationContext != null) {
+ topiaApplicationContext.closeContext();
+ }
+ }
+
+ public void init() {
+
+ if (getApplicationConfig().isLogConfigurationProvided()) {
+
+ File log4jConfigurationFile = getApplicationConfig().getLogConfigurationFile();
+
+ String log4jConfigurationFileAbsolutePath = log4jConfigurationFile.getAbsolutePath();
+
+ if (log4jConfigurationFile.exists()) {
+
+ if (log.isInfoEnabled()) {
+ log.info("will use logging configuration " + log4jConfigurationFileAbsolutePath);
+ }
+
+ // reset logger configuration
+ LogManager.resetConfiguration();
+
+ // use generate log config file
+ PropertyConfigurator.configure(log4jConfigurationFileAbsolutePath);
+
+ log = LogFactory.getLog(FaxToMailApplicationContext.class);
+
+ } else {
+ if (log.isWarnEnabled()) {
+ log.warn("there is no file " + log4jConfigurationFileAbsolutePath + ". Default logging configuration will be used.");
+ }
+ }
+
+ } else {
+ log.info("will use default logging configuration");
+ }
+
+// I18nInitializer initializer = new DefaultI18nInitializer("faxtomail");
+
+// I18n.init(initializer, Locale.FRANCE);
+
+// LocalizedTextUtil.addDefaultResourceBundle("i18n.faxtomail-web");
+
+ FaxToMailTopiaPersistenceContext persistenceContext = newPersistenceContext();
+
+ FaxToMailServiceContext serviceContext = newServiceContext(persistenceContext);
+
+ InitFaxToMailService initExtranetService =
+ serviceContext.newService(InitFaxToMailService.class);
+
+ initExtranetService.init();
+
+ persistenceContext.closeContext();
+
+ }
+
+}
Added: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/DefaultFaxToMailWebApplicationContext.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/DefaultFaxToMailWebApplicationContext.java (rev 0)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/DefaultFaxToMailWebApplicationContext.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,86 @@
+package com.franciaflex.faxtomail.web;
+
+/*
+ * #%L
+ * Extranet ENC-AHI :: Web
+ * $Id: DefaultExtranetEncAhiWebApplicationContext.java 827 2013-12-04 15:30:35Z bleny $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-web/src/… $
+ * %%
+ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import com.franciaflex.faxtomail.FaxToMailTechnicalException;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
+import com.franciaflex.faxtomail.services.service.FaxToMailWebApplicationContext;
+import com.google.common.base.Charsets;
+import com.google.common.base.Joiner;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.Collections;
+import java.util.Map;
+import java.util.SortedSet;
+
+public class DefaultFaxToMailWebApplicationContext implements FaxToMailWebApplicationContext {
+
+ private static final Log log = LogFactory.getLog(DefaultFaxToMailWebApplicationContext.class);
+
+ protected String instanceUrl;
+
+ public DefaultFaxToMailWebApplicationContext(String instanceUrl) {
+ this.instanceUrl = instanceUrl;
+ }
+
+ protected String formatUrl(String actionUrl) {
+ Map<String, String> emptyMap = Collections.emptyMap();
+ return formatUrl(actionUrl, emptyMap);
+ }
+
+ protected String formatUrl(String actionUrl, Map<String, String> parameters) {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append(instanceUrl).append("/").append(actionUrl);
+ if ( ! parameters.isEmpty()) {
+ SortedSet<String> queryStringElements = Sets.newTreeSet();
+ try {
+ for (Map.Entry<String, String> parameter : parameters.entrySet()) {
+ String queryStringElement = parameter.getKey() + '=' + URLEncoder.encode(parameter.getValue(), Charsets.UTF_8.name());
+ queryStringElements.add(queryStringElement);
+ }
+ } catch (UnsupportedEncodingException e) {
+ if (log.isErrorEnabled()) {
+ log.error("should never occur", e);
+ }
+ throw new FaxToMailTechnicalException(e);
+ }
+ stringBuilder.append('?').append(Joiner.on('&').join(queryStringElements));
+ }
+ return stringBuilder.toString();
+ }
+
+ @Override
+ public String getAdministrationUrl(FaxToMailUser extranetUser) {
+ ImmutableMap<String, String> params =
+ ImmutableMap.of("yearlyDeclarationId", extranetUser.getTopiaId());
+ return formatUrl("administration/edit-user!input", params);
+ }
+
+}
Added: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailActionSupport.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailActionSupport.java (rev 0)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailActionSupport.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,113 @@
+package com.franciaflex.faxtomail.web;
+
+/*
+ * #%L
+ * Extranet ENC-AHI :: Web
+ * $Id: ExtranetEncAhiActionSupport.java 908 2013-12-20 08:49:50Z bleny $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-web/src/… $
+ * %%
+ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import com.franciaflex.faxtomail.FaxToMailApplicationConfig;
+import org.apache.struts2.convention.annotation.Result;
+import org.apache.struts2.convention.annotation.Results;
+import org.nuiton.topia.persistence.TopiaEntity;
+import org.nuiton.web.struts2.BaseAction;
+
+@Results({
+ @Result(name="login", type="redirectAction", params = { "actionName", "login!input", "namespace", "/authentication"})
+})
+public class FaxToMailActionSupport extends BaseAction {
+
+ public static final String SAVE = "save";
+
+ public static final String NEXT = "next";
+
+ protected FaxToMailApplicationConfig applicationConfig;
+
+ private FaxToMailSession session;
+
+ public void setApplicationConfig(FaxToMailApplicationConfig applicationConfig) {
+ this.applicationConfig = applicationConfig;
+ }
+
+ public FaxToMailApplicationConfig getApplicationConfig() {
+ return applicationConfig;
+ }
+
+ protected FaxToMailSession getSession() {
+ return session;
+ }
+
+ public boolean needAuthentication() {
+ return true;
+ }
+
+ public boolean rememberAsLastAction() {
+ return true;
+ }
+
+ public String translateEnum(Class cl, String name) {
+ return _(cl.getName() + "." + name);
+ }
+
+ public String translateEnum(Enum en) {
+ return translateEnum(en.getClass(), en.name());
+ }
+
+ public String getId(TopiaEntity entity) {
+ // XXX brendan 19/08/13 hashCode may return a non-unique value
+ String id = "";
+
+ if (entity.getTopiaId() != null) {
+
+ id = Integer.toString(entity.getTopiaId().hashCode());
+
+ }
+
+ return id;
+
+ }
+
+ public String getInstanceDisclaimer() {
+ return applicationConfig.getInstanceDisclaimer();
+ }
+
+// public String getUserName() {
+// ExtranetUser extranetUser = session.getExtranetUser();
+// String userName = "";
+// if (extranetUser != null) {
+// userName = extranetUser.getFirstName() + " " + extranetUser.getLastName();
+// }
+// return userName;
+// }
+
+// public boolean isConnected() {
+// ExtranetUser extranetUser = session.getExtranetUser();
+// return extranetUser != null;
+// }
+
+ public void setSession(FaxToMailSession session) {
+ this.session = session;
+ }
+
+// public String getSupportEmail() {
+// return getApplicationConfig().getSupportEmail();
+// }
+}
Added: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailApplicationListener.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailApplicationListener.java (rev 0)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailApplicationListener.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,68 @@
+package com.franciaflex.faxtomail.web;
+
+/*
+ * #%L
+ * Extranet ENC-AHI :: Web
+ * $Id: ExtranetEncAhiApplicationListener.java 827 2013-12-04 15:30:35Z bleny $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-web/src/… $
+ * %%
+ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import com.franciaflex.faxtomail.FaxToMailApplicationContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+public class FaxToMailApplicationListener implements ServletContextListener {
+
+ private static final Log log = LogFactory.getLog(FaxToMailApplicationListener.class);
+
+ protected FaxToMailApplicationContext applicationContext;
+
+ @Override
+ public void contextInitialized(ServletContextEvent sce) {
+
+ if (log.isInfoEnabled()) {
+ log.info("init FaxToMail web ui");
+ }
+
+ applicationContext = new FaxToMailApplicationContext();
+
+ applicationContext.init();
+
+ sce.getServletContext().setAttribute(
+ FaxToMailApplicationContext.APPLICATION_CONTEXT_PARAMETER,
+ applicationContext);
+
+ }
+
+ @Override
+ public void contextDestroyed(ServletContextEvent sce) {
+
+ if (log.isInfoEnabled()) {
+ log.info("stop FaxToMail web ui");
+ }
+
+ applicationContext.close();
+
+ }
+
+}
Added: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailEntityNotFoundException.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailEntityNotFoundException.java (rev 0)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailEntityNotFoundException.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,33 @@
+package com.franciaflex.faxtomail.web;
+
+/*
+ * #%L
+ * Extranet ENC-AHI :: Web
+ * $Id: ExtranetEncAhiEntityNotFoundException.java 827 2013-12-04 15:30:35Z bleny $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-web/src/… $
+ * %%
+ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since 0.5
+ */
+public class FaxToMailEntityNotFoundException extends RuntimeException {
+
+}
Added: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailIllegalAccessException.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailIllegalAccessException.java (rev 0)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailIllegalAccessException.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,8 @@
+package com.franciaflex.faxtomail.web;
+
+/**
+ * @author kmorin <morin(a)codelutin.com>
+ */
+public class FaxToMailIllegalAccessException extends RuntimeException {
+
+}
Added: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java (rev 0)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,221 @@
+package com.franciaflex.faxtomail.web;
+
+/*
+ * #%L
+ * Extranet ENC-AHI :: Web
+ * $Id: ExtranetEncAhiInterceptor.java 908 2013-12-20 08:49:50Z bleny $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-web/src/… $
+ * %%
+ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import com.franciaflex.faxtomail.FaxToMailApplicationConfig;
+import com.franciaflex.faxtomail.FaxToMailApplicationContext;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
+import com.franciaflex.faxtomail.services.FaxToMailService;
+import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
+import com.google.common.base.Preconditions;
+import com.opensymphony.xwork2.ActionInvocation;
+import com.opensymphony.xwork2.ActionProxy;
+import com.opensymphony.xwork2.interceptor.Interceptor;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.beans.BeanUtil;
+
+import java.beans.PropertyDescriptor;
+import java.util.Map;
+import java.util.Set;
+
+public class FaxToMailInterceptor implements Interceptor {
+
+ private static final Log log = LogFactory.getLog(FaxToMailInterceptor.class);
+
+ public static final String SESSION_LAST_LOCATION = "lastLocation";
+
+ @Override
+ public void init() {
+
+ if (log.isInfoEnabled()) {
+ log.info("init " + this);
+ }
+
+ }
+
+ @Override
+ public String intercept(ActionInvocation invocation) throws Exception {
+
+ Object action = invocation.getAction();
+
+ if (action instanceof FaxToMailActionSupport) {
+
+ FaxToMailActionSupport faxToMailAction = (FaxToMailActionSupport) action;
+
+ FaxToMailServiceContext serviceContext = newServiceContext(invocation);
+
+ FaxToMailSession faxToMailSession = getFaxToMailSession(invocation);
+
+ if (CollectionUtils.isNotEmpty(faxToMailSession.getMessages())) {
+
+ for (String message : faxToMailSession.getMessages()) {
+
+ faxToMailAction.addActionMessage(message);
+
+ }
+
+ faxToMailSession.getMessages().clear();
+
+ }
+
+ if (CollectionUtils.isNotEmpty(faxToMailSession.getErrorMessages())) {
+
+ for (String message : faxToMailSession.getErrorMessages()) {
+
+ faxToMailAction.addActionError(message);
+
+ }
+
+ faxToMailSession.getErrorMessages().clear();
+
+ }
+
+ Set<PropertyDescriptor> descriptors =
+ BeanUtil.getDescriptors(
+ action.getClass(),
+ BeanUtil.IS_WRITE_DESCRIPTOR);
+
+ for (PropertyDescriptor propertyDescriptor : descriptors) {
+
+ Class<?> propertyType = propertyDescriptor.getPropertyType();
+
+ Object toInject = null;
+
+ if (FaxToMailService.class.isAssignableFrom(propertyType)) {
+
+ Class<? extends FaxToMailService> serviceClass =
+ (Class<? extends FaxToMailService>) propertyType;
+
+ toInject = serviceContext.newService(serviceClass);
+
+ } else if (FaxToMailSession.class.isAssignableFrom(propertyType)) {
+
+ toInject = faxToMailSession;
+
+ } else if (FaxToMailApplicationConfig.class.isAssignableFrom(propertyType)) {
+
+ toInject = getFaxToMailApplicationContext(invocation).getApplicationConfig();
+
+ }
+
+ if (toInject != null) {
+
+ if (log.isTraceEnabled()) {
+ log.trace("injecting " + toInject + " in action " + action);
+ }
+
+ propertyDescriptor.getWriteMethod().invoke(action, toInject);
+
+ }
+ }
+
+ try {
+
+ return invocation.invoke();
+
+ } finally {
+
+ serviceContext.getPersistenceContext().closeContext();
+
+ }
+
+ } else {
+
+ // not an action, just process
+ saveLastAction(invocation);
+ return invocation.invoke();
+
+ }
+
+ }
+
+ protected void saveLastAction(ActionInvocation invocation) {
+ Map<String, Object> session = invocation.getInvocationContext().getSession();
+ ActionProxy proxy = invocation.getProxy();
+ String lastLocation = proxy.getNamespace() + "/" + proxy.getActionName() + "!" + proxy.getMethod() + "?";
+ Map<String, Object> parameters = invocation.getInvocationContext().getParameters();
+ for (String key : parameters.keySet()) {
+ Object[] value = (Object[]) parameters.get(key);
+ lastLocation += key + "=" + value[0] + "&";
+ }
+ session.put(SESSION_LAST_LOCATION, lastLocation);
+ }
+
+ protected FaxToMailSession getFaxToMailSession(ActionInvocation invocation) {
+
+ FaxToMailSession session = (FaxToMailSession) invocation.getInvocationContext().getSession().get(FaxToMailSession.SESSION_PARAMETER);
+
+ if (session == null) {
+
+ session = new FaxToMailSession();
+
+ invocation.getInvocationContext().getSession().put(FaxToMailSession.SESSION_PARAMETER, session);
+
+ }
+
+ return session;
+
+ }
+
+ protected FaxToMailApplicationContext getFaxToMailApplicationContext(ActionInvocation invocation) {
+
+ FaxToMailApplicationContext applicationContext =
+ (FaxToMailApplicationContext) invocation
+ .getInvocationContext()
+ .getApplication()
+ .get(FaxToMailApplicationContext.APPLICATION_CONTEXT_PARAMETER);
+
+ Preconditions.checkNotNull(applicationContext,
+ "application context must be initialized before calling an action");
+
+ return applicationContext;
+
+ }
+
+ protected FaxToMailServiceContext newServiceContext(ActionInvocation invocation) {
+
+ FaxToMailApplicationContext extranetEncAhiApplicationContext = getFaxToMailApplicationContext(invocation);
+
+ FaxToMailTopiaPersistenceContext persistenceContext = extranetEncAhiApplicationContext.newPersistenceContext();
+
+ FaxToMailServiceContext serviceContext =
+ extranetEncAhiApplicationContext.newServiceContext(persistenceContext);
+
+ return serviceContext;
+
+ }
+
+ @Override
+ public void destroy() {
+
+ if (log.isInfoEnabled()) {
+ log.info("destroy " + this);
+ }
+
+ }
+
+}
Added: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailNoIdException.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailNoIdException.java (rev 0)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailNoIdException.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,33 @@
+package com.franciaflex.faxtomail.web;
+
+/*
+ * #%L
+ * Extranet ENC-AHI :: Web
+ * $Id: ExtranetEncAhiNoIdException.java 827 2013-12-04 15:30:35Z bleny $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-web/src/… $
+ * %%
+ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since 0.1
+ */
+public class FaxToMailNoIdException extends RuntimeException {
+
+}
Added: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailSession.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailSession.java (rev 0)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailSession.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,76 @@
+package com.franciaflex.faxtomail.web;
+
+/*
+ * #%L
+ * Extranet ENC-AHI :: Web
+ * $Id: ExtranetEncAhiSession.java 908 2013-12-20 08:49:50Z bleny $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-web/src/… $
+ * %%
+ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.collect.Lists;
+
+import java.io.Serializable;
+import java.util.Collection;
+
+public class FaxToMailSession implements Serializable {
+
+ public static final String SESSION_PARAMETER = "faxToMailSession";
+
+ protected Collection<String> messages;
+
+ protected Collection<String> errorMessages;
+
+// protected AuthenticatedExtranetUser authenticatedExtranetUser;
+
+ public Collection<String> getMessages() {
+ if (messages == null) {
+ messages = Lists.newLinkedList();
+ }
+ return messages;
+ }
+
+ public void addMessage(String message) {
+ getMessages().add(message);
+ }
+
+ public Collection<String> getErrorMessages() {
+ if (errorMessages == null) {
+ errorMessages = Lists.newLinkedList();
+ }
+ return errorMessages;
+ }
+
+ public void addErrorMessages(String errorMessage) {
+ getErrorMessages().add(errorMessage);
+ }
+
+ public void logout() {
+// authenticatedExtranetUser.logout();
+// authenticatedExtranetUser = null;
+ }
+
+// public AuthenticatedExtranetUser getAuthenticatedExtranetUser() {
+// return authenticatedExtranetUser;
+// }
+
+// public void setAuthenticatedExtranetUser(AuthenticatedExtranetUser authenticatedExtranetUser) {
+// this.authenticatedExtranetUser = authenticatedExtranetUser;
+// }
+}
Added: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailStrutsObjectFactory.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailStrutsObjectFactory.java (rev 0)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailStrutsObjectFactory.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,65 @@
+package com.franciaflex.faxtomail.web;
+
+/*
+ * #%L
+ * Extranet ENC-AHI :: Web
+ * $Id: ExtranetEncAhiStrutsObjectFactory.java 827 2013-12-04 15:30:35Z bleny $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-web/src/… $
+ * %%
+ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.struts2.impl.StrutsObjectFactory;
+import org.nuiton.topia.persistence.TopiaEntity;
+
+import java.util.Map;
+
+public class FaxToMailStrutsObjectFactory extends StrutsObjectFactory {
+
+ private static final Log log = LogFactory.getLog(FaxToMailStrutsObjectFactory.class);
+
+// @Override
+// public Object buildBean(Class clazz, Map<String, Object> extraContext) throws Exception {
+//
+// Object instance;
+//
+// if (TopiaEntity.class.isAssignableFrom(clazz)) {
+//
+// if (log.isTraceEnabled()) {
+// log.trace(" new instance of " + clazz.getCanonicalName());
+// }
+
+// ExtranetEncAhiEntityEnum extranetEncAhiEntityEnum =
+// ExtranetEncAhiEntityEnum.valueOf(clazz);
+
+// Class<? extends TopiaEntity> implementation = extranetEncAhiEntityEnum.getImplementation();
+
+// instance = implementation.newInstance();
+
+// } else {
+//
+// instance = clazz.newInstance();
+//
+// }
+//
+// return instance;
+// }
+
+}
Added: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/IndexAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/IndexAction.java (rev 0)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/IndexAction.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,68 @@
+package com.franciaflex.faxtomail.web.action;
+
+/*
+ * #%L
+ * Extranet ENC-AHI :: Web
+ * $Id: IndexAction.java 827 2013-12-04 15:30:35Z bleny $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-web/src/… $
+ * %%
+ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import com.franciaflex.faxtomail.web.FaxToMailActionSupport;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class IndexAction extends FaxToMailActionSupport {
+
+ private static final Log log = LogFactory.getLog(IndexAction.class);
+
+// protected ApplicationSettingsService service;
+//
+// protected ApplicationSettings applicationSettings;
+
+// public void setService(ApplicationSettingsService service) {
+// this.service = service;
+// }
+
+ @Override
+ public String execute() {
+
+// applicationSettings = service.getApplicationSettings();
+
+ return SUCCESS;
+ }
+
+// public ApplicationSettings getApplicationSettings() {
+// return applicationSettings;
+// }
+
+ public String getWelcomeText() {
+
+// String text = applicationSettings.getWelcomeText();
+ String text = "Hello world";
+
+ text = "<p>" + text.replaceAll("\\r?\\n\\r?\\n", "</p><p>") + "</p>";
+
+ text = text.replaceAll("\\r?\\n", "<br/>");
+
+ return text;
+
+ }
+
+}
Added: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java (rev 0)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,167 @@
+package com.franciaflex.faxtomail.web.action.admin;
+
+import com.franciaflex.faxtomail.persistence.entities.Company;
+import com.franciaflex.faxtomail.persistence.entities.Configuration;
+import com.franciaflex.faxtomail.persistence.entities.ConfigurationImpl;
+import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+import com.franciaflex.faxtomail.persistence.entities.MailFolderImpl;
+import com.franciaflex.faxtomail.services.service.CompanyService;
+import com.franciaflex.faxtomail.web.FaxToMailActionSupport;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.gson.GsonBuilder;
+import com.google.gson.InstanceCreator;
+import com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonDeserializer;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParseException;
+import com.google.gson.TypeAdapter;
+import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonToken;
+import com.google.gson.stream.JsonWriter;
+import com.opensymphony.xwork2.Preparable;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.persistence.TopiaIdFactory;
+import org.nuiton.topia.persistence.internal.DefaultTopiaIdFactory;
+
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since x.x
+ */
+public class ConfigurationAction extends FaxToMailActionSupport implements Preparable {
+
+ private static final Log log = LogFactory.getLog(ConfigurationAction.class);
+
+ protected CompanyService companyService;
+
+ protected List<Company> companies;
+
+ protected Company company;
+
+ protected List<MailFolder> mailFolders;
+
+ protected String activeTab;
+
+ @Override
+ public void prepare() throws Exception {
+ companies = companyService.getAllCompanies();
+ }
+
+ @Override
+ public String input() throws Exception {
+ return INPUT;
+ }
+
+ @Override
+ public String execute() throws Exception {
+ log.debug("execute " + company);
+ String result = super.execute();
+ if (!ERROR.equals(result)) {
+ if (company != null) {
+ company.setMailFolder(mailFolders);
+ companyService.saveCompany(company);
+ }
+ result = INPUT;
+ }
+ return result;
+ }
+
+ public void setCompanyService(CompanyService companyService) {
+ this.companyService = companyService;
+ }
+
+ public void setCompanyId(String companyId) {
+ log.debug("set company " + companyId);
+ if (StringUtils.isNotEmpty(companyId)) {
+ this.company = companyService.getCompany(companyId);
+ }
+ }
+
+ public String getCompanyId() {
+ if (company == null) {
+ return null;
+ }
+ return company.getTopiaId();
+ }
+
+ public void setCompany(Company company) {
+ this.company = company;
+ }
+
+ public Company getCompany() {
+ log.debug("getCompany " + company);
+ return company;
+ }
+
+ public List<Company> getCompanies() {
+ return companies;
+ }
+
+ public String getActiveTab() {
+ return activeTab;
+ }
+
+ public void setActiveTab(String activeTab) {
+ this.activeTab = activeTab;
+ }
+
+ public Map<String, String> getEmailFields() {
+ Map<String, String> result = Maps.newHashMap();
+ result.put(Email.PROPERTY_EMAIL_ADDRESS, "Adresse email");
+ result.put(Email.PROPERTY_RECEPTION_DATE, "Date de réception");
+ result.put(Email.PROPERTY_EDI_CODE_NUMBER, "Code EDI");
+ result.put(Email.PROPERTY_COMMAND_NB, "Numéro de commande");
+ result.put(Email.PROPERTY_PROJECT_REFERENCE, "Référence travaux");
+ return result;
+ }
+
+ public String getFoldersTreeAsJson() {
+ if (company == null) {
+ return null;
+ }
+ GsonBuilder gsonBuilder = new GsonBuilder();
+ String mailFodlers = gsonBuilder.create().toJson(company.getMailFolder());
+ log.debug("getFolderTreeAsJson " + mailFodlers);
+ return mailFodlers;
+ }
+
+ public void setFoldersTreeAsJson(String json) {
+ log.debug("setFoldersTreeAsJson " + json);
+ GsonBuilder gsonBuilder = new GsonBuilder().registerTypeAdapter(MailFolder.class, new MailFolderDeserializer());
+ mailFolders = Lists.newArrayList((MailFolder[])gsonBuilder.create().fromJson(json, MailFolder[].class));
+ log.debug("mailfolders " + mailFolders);
+ if (!mailFolders.isEmpty()) {
+ log.debug("name : " + mailFolders.get(0).getName());
+ }
+ }
+
+ protected class MailFolderDeserializer implements JsonDeserializer<MailFolder> {
+
+ @Override
+ public MailFolder deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
+ MailFolder mailFolder = new MailFolderImpl();
+ JsonObject o = json.getAsJsonObject();
+
+ String name = o.get(MailFolder.PROPERTY_NAME).getAsString();
+ mailFolder.setName(name);
+
+ MailFolder[] children = context.deserialize(o.get(MailFolder.PROPERTY_CHILDREN), MailFolder[].class);
+ List<MailFolder> mailFolders = Lists.newArrayList(children);
+ mailFolder.setChildren(mailFolders);
+
+ String topiaId = o.get(MailFolder.PROPERTY_TOPIA_ID).getAsString();
+ mailFolder.setTopiaId(topiaId);
+
+ return mailFolder;
+ }
+ }
+}
Added: trunk/faxtomail-ui-web/src/main/resources/i18n/faxtomail-web_fr_FR.properties
===================================================================
Added: trunk/faxtomail-ui-web/src/main/resources/log4j.properties
===================================================================
--- trunk/faxtomail-ui-web/src/main/resources/log4j.properties (rev 0)
+++ trunk/faxtomail-ui-web/src/main/resources/log4j.properties 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,26 @@
+log4j.rootCategory=WARN, console
+
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d{yyyy/MM/dd hh:mm:ss} %5p (%F:%L) %M %m%n
+
+# global level
+log4j.logger.com.franciaflex.faxtomail=TRACE
+
+### persistence level
+# log4j.logger.org.nuiton.topia=TRACE
+# log4j.logger.com.franciaflex.faxtomail.persistence=TRACE
+
+### services level
+# log4j.logger.com.franciaflex.faxtomail.services=TRACE
+
+### web level
+log4j.logger.com.franciaflex.faxtomail.web.FaxToMailInterceptor=WARN
+
+# annoying errors
+#log4j.logger.com.opensymphony.xwork2.interceptor.ParametersInterceptor=FATAL
+#log4j.logger.com.opensymphony.xwork2.conversion.impl.InstantiatingNullHandler=FATAL
+#log4j.logger.com.opensymphony.xwork2.ognl.OgnlValueStack=ERROR
+
+# struts object facotry
+log4j.logger.com.franciaflex.faxtomail.web.FaxToMailStrutsObjectFactory=TRACE
Added: trunk/faxtomail-ui-web/src/main/resources/shiro.ini
===================================================================
--- trunk/faxtomail-ui-web/src/main/resources/shiro.ini (rev 0)
+++ trunk/faxtomail-ui-web/src/main/resources/shiro.ini 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,37 @@
+[main]
+# URL vers laquelle il faut rediriger si l'utilisateur n'est pas authentifié
+authc.loginUrl = /authentication/login!input.action
+
+# dans le formulaire d'authentifaction, le champs contenant le username s'appelle "email"
+authc.usernameParam = email
+# authc.passwordParam = password
+
+# on utilise un cache dans notre implémentation du Realm, il faut le configurer
+cacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager
+securityManager.cacheManager = $cacheManager
+
+# on indique notre implémentation du realm
+# extranetEncAhiRealm = fr.gouv.social.encahi.extranet.web.ExtranetEncAhiRealm
+
+# on l'indique comme seul realm à utiliser
+# securityManager.realms = $extranetEncAhiRealm
+
+[urls]
+
+# on doit pouvoir accéder à ces pages sans être authentifié
+/authentication/login* = anon
+/authentication/forgotten-password-* = anon
+/authentication/registration* = anon
+
+# on donne accès aux ressource statiques
+/css/** = anon
+/data/** = anon
+/font/** = anon
+/img/** = anon
+/js/** = anon
+/struts/js/** = anon
+/struts/themes/** = anon
+/struts/bootstrap/** = anon
+
+# pour tout le reste, il faut être authentifié
+#/** = authc
Added: trunk/faxtomail-ui-web/src/main/resources/struts.properties
===================================================================
--- trunk/faxtomail-ui-web/src/main/resources/struts.properties (rev 0)
+++ trunk/faxtomail-ui-web/src/main/resources/struts.properties 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,29 @@
+struts.ui.theme=bootstrap
+struts.ognl.allowStaticMethodAccess=true
+
+# Help debugging
+struts.devMode=${devMode}
+struts.ognl.logMissingProperties=${devMode}
+struts.el.throwExceptionOnFailure=${devMode}
+struts.i18n.reload=${devMode}
+struts.custom.i18n.resources=resources
+struts.configuration.xml.reload=${devMode}
+struts.convention.classes.reload=${devMode}
+
+# Performance tuning
+# see http://struts.apache.org/2.2.3/docs/performance-tuning.html
+struts.freemarker.templatesCache=true
+
+struts.convention.package.locators.basePackage=com.franciaflex.faxtomail.web.action
+
+# FIXME bleny 06/12/2013 définir à true ouvre une faille de sécurité,
+# voir http://struts.apache.org/release/2.3.x/docs/s2-019.html
+# si on laisse la valeur par défaut, l'appli mouline dès qu'on appel une action autre que execute,
+# on attend que convention-plugin soit adapté pour pouvoir poser une anot sur les méthodes inputs
+struts.enable.DynamicMethodInvocation=true
+
+# FIXME bleny 09/12/2013 définir à true ouvre une faille de sécurité,
+# voir http://struts.apache.org/release/2.3.x/docs/s2-018.html
+# ne pas surcharger cette valeur empêche de définir l'action!methode à appeller au submit et on passe toujours le execute,
+# ça casse le formulaire de déclaration (quand on veut passer à l'étape suivante (!next) on se retrouve dans le résumé (!execute))
+struts.mapper.action.prefix.enabled=true
Added: trunk/faxtomail-ui-web/src/main/resources/struts.xml
===================================================================
--- trunk/faxtomail-ui-web/src/main/resources/struts.xml (rev 0)
+++ trunk/faxtomail-ui-web/src/main/resources/struts.xml 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,70 @@
+<!DOCTYPE struts PUBLIC
+ "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
+ "http://struts.apache.org/dtds/struts-2.0.dtd">
+<struts>
+
+ <constant name="struts.convention.default.parent.package" value="faxtomail" />
+
+ <bean class="org.nuiton.web.struts2.I18nTextProvider" name="i18nTextProvider" type="com.opensymphony.xwork2.TextProvider" />
+
+ <constant name="struts.objectFactory" value="com.franciaflex.faxtomail.web.FaxToMailStrutsObjectFactory" />
+
+ <constant name="struts.xworkTextProvider" value="i18nTextProvider" />
+
+ <constant name="struts.multipart.maxSize" value="10485760" />
+
+ <package name="faxtomail" namespace="/" extends="json-default">
+
+ <interceptors>
+
+ <interceptor name="faxToMailInterceptor" class="com.franciaflex.faxtomail.web.FaxToMailInterceptor"/>
+
+ <interceptor-stack name="faxToMailStack">
+ <interceptor-ref name="faxToMailInterceptor" />
+
+ <interceptor-ref name="exception"/>
+ <interceptor-ref name="alias"/>
+ <interceptor-ref name="i18n"/>
+ <interceptor-ref name="checkbox"/>
+ <interceptor-ref name="multiselect"/>
+ <interceptor-ref name="params">
+ <param name="excludeParams">dojo\..*,^struts\..*,^session\..*,^request\..*,^application\..*,^servlet(Request|Response)\..*,parameters\...*</param>
+ <param name="acceptParamNames">(\w|\(|\)|\[|\]|\.|'|-|\s|\u002C|\||")+</param>
+ </interceptor-ref>
+ <interceptor-ref name="servletConfig"/>
+ <interceptor-ref name="prepare"/>
+ <interceptor-ref name="chain"/>
+ <interceptor-ref name="modelDriven"/>
+ <interceptor-ref name="fileUpload"/>
+ <interceptor-ref name="staticParams"/>
+ <interceptor-ref name="actionMappingParams"/>
+ <interceptor-ref name="params">
+ <param name="excludeParams">dojo\..*,^struts\..*,^session\..*,^request\..*,^application\..*,^servlet(Request|Response)\..*,parameters\...*</param>
+ <param name="acceptParamNames">(\w|\(|\)|\[|\]|\.|'|-|_|\s|\u002C|\||")+</param>
+ </interceptor-ref>
+ <interceptor-ref name="conversionError"/>
+ <interceptor-ref name="validation">
+ <param name="excludeMethods">input,back,cancel,browse</param>
+ </interceptor-ref>
+ <interceptor-ref name="workflow">
+ <param name="excludeMethods">input,back,cancel,browse</param>
+ </interceptor-ref>
+ </interceptor-stack>
+ </interceptors>
+
+ <default-interceptor-ref name="faxToMailStack"/>
+
+ <global-results>
+ <result name="redirect-to-login" type="redirect">/</result>
+ </global-results>
+
+ <global-exception-mappings>
+ <exception-mapping exception="com.franciaflex.faxtomail.web.FaxToMailNoIdException" result="NoIdException"></exception-mapping>
+ <exception-mapping exception="com.franciaflex.faxtomail.web.FaxToMailEntityNotFoundException" result="EntityNotFoundException"></exception-mapping>
+ <exception-mapping exception="com.franciaflex.faxtomail.web.FaxToMailIllegalAccessException" result="IllegalAccessException"></exception-mapping>
+ </global-exception-mappings>
+
+ </package>
+
+
+</struts>
Added: trunk/faxtomail-ui-web/src/main/resources/validators.xml
===================================================================
--- trunk/faxtomail-ui-web/src/main/resources/validators.xml (rev 0)
+++ trunk/faxtomail-ui-web/src/main/resources/validators.xml 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE validators PUBLIC
+ "-//Apache Struts//XWork Validator Definition 1.0//EN"
+ "http://struts.apache.org/dtds/xwork-validator-definition-1.0.dtd">
+
+<validators>
+ <!-- default validators from XWork framework -->
+ <!--validator name="required" class="com.opensymphony.xwork2.validator.validators.RequiredFieldValidator"/-->
+ <!--validator name="requiredstring" class="com.opensymphony.xwork2.validator.validators.RequiredStringValidator"/-->
+ <validator name="int" class="com.opensymphony.xwork2.validator.validators.IntRangeFieldValidator"/>
+ <validator name="long" class="com.opensymphony.xwork2.validator.validators.LongRangeFieldValidator"/>
+ <validator name="short" class="com.opensymphony.xwork2.validator.validators.ShortRangeFieldValidator"/>
+ <validator name="double" class="com.opensymphony.xwork2.validator.validators.DoubleRangeFieldValidator"/>
+ <validator name="date" class="com.opensymphony.xwork2.validator.validators.DateRangeFieldValidator"/>
+ <validator name="expression" class="com.opensymphony.xwork2.validator.validators.ExpressionValidator"/>
+ <validator name="fieldexpression" class="com.opensymphony.xwork2.validator.validators.FieldExpressionValidator"/>
+ <!--validator name="email" class="com.opensymphony.xwork2.validator.validators.EmailValidator"/-->
+ <validator name="url" class="com.opensymphony.xwork2.validator.validators.URLValidator"/>
+ <validator name="visitor" class="com.opensymphony.xwork2.validator.validators.VisitorFieldValidator"/>
+ <validator name="conversion" class="com.opensymphony.xwork2.validator.validators.ConversionErrorFieldValidator"/>
+ <validator name="stringlength" class="com.opensymphony.xwork2.validator.validators.StringLengthFieldValidator"/>
+ <validator name="regex" class="com.opensymphony.xwork2.validator.validators.RegexFieldValidator"/>
+ <validator name="conditionalvisitor"
+ class="com.opensymphony.xwork2.validator.validators.ConditionalVisitorFieldValidator"/>
+
+ <!-- default nuiton-validator validators -->
+ <validator name="collectionFieldExpression"
+ class="org.nuiton.validator.xwork2.field.CollectionFieldExpressionValidator"/>
+ <validator name="collectionUniqueKey" class="org.nuiton.validator.xwork2.field.CollectionUniqueKeyValidator"/>
+ <validator name="requiredFile" class="org.nuiton.validator.xwork2.field.RequiredFileFieldValidator"/>
+ <validator name="existingFile" class="org.nuiton.validator.xwork2.field.ExistingFileFieldValidator"/>
+ <validator name="notExistingFile" class="org.nuiton.validator.xwork2.field.NotExistingFileFieldValidator"/>
+ <validator name="existingDirectory" class="org.nuiton.validator.xwork2.field.ExistingDirectoryFieldValidator"/>
+ <validator name="notExistingDirectory" class="org.nuiton.validator.xwork2.field.NotExistingDirectoryFieldValidator"/>
+ <validator name="fieldexpressionwithparams"
+ class="org.nuiton.validator.xwork2.field.FieldExpressionWithParamsValidator"/>
+ <validator name="phoneNumber" class="org.nuiton.validator.xwork2.field.FrenchPhoneNumberFieldValidator"/>
+ <validator name="email" class="org.nuiton.validator.xwork2.field.EmailFieldValidator"/>
+ <validator name="cityName" class="org.nuiton.validator.xwork2.field.FrenchCityNameFieldValidator"/>
+ <validator name="lastName" class="org.nuiton.validator.xwork2.field.FrenchLastNameFieldValidator"/>
+ <validator name="postCode" class="org.nuiton.validator.xwork2.field.FrenchPostCodeFieldValidator"/>
+ <validator name="vat" class="org.nuiton.validator.xwork2.field.VATIdentificationNumberFieldValidator"/>
+ <validator name="siret" class="org.nuiton.validator.xwork2.field.FrenchSiretFieldValidator"/>
+ <validator name="siren" class="org.nuiton.validator.xwork2.field.FrenchSirenFieldValidator"/>
+ <validator name="finess" class="org.nuiton.validator.xwork2.field.FrenchFinessFieldValidator"/>
+ <validator name="required" class="org.nuiton.validator.xwork2.field.SkipableRequiredFieldValidator"/>
+ <validator name="requiredstring" class="org.nuiton.validator.xwork2.field.SkipableRequiredStringFieldValidator"/>
+
+</validators>
Added: trunk/faxtomail-ui-web/src/main/resources/xwork-conversion.properties
===================================================================
--- trunk/faxtomail-ui-web/src/main/resources/xwork-conversion.properties (rev 0)
+++ trunk/faxtomail-ui-web/src/main/resources/xwork-conversion.properties 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,2 @@
+java.lang.Double=org.nuiton.web.struts2.converters.DoubleConverter
+double=org.nuiton.web.struts2.converters.DoubleConverter
Added: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration.jsp (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration.jsp 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,270 @@
+<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
+<!DOCTYPE html>
+<%@taglib uri="/struts-tags" prefix="s" %>
+
+<html>
+ <head>
+ <title>Configuration</title>
+ <script type="text/javascript" src="<s:url value='/js/select2/select2.min.js' />"></script>
+ <script type="text/javascript" src="<s:url value='/js/select2/select2_locale_fr.js' />"></script>
+ <script type="text/javascript" src="<s:url value='/js/jstree/jstree.js' />"></script>
+
+ <link rel="stylesheet" type="text/css" href="<s:url value='/css/select2/select2.css' />" />
+ <link rel="stylesheet" type="text/css" href="<s:url value='/css/jstree/themes/default/style.min.css' />" />
+ <link rel="stylesheet" type="text/css" href="<s:url value='/css/configuration.css' />" />
+ <script>
+
+ var createNewNode = function() {
+ $('.jstree').jstree(true).create_node('#', 'Nouvelle racine');
+ }
+
+ var formatToSendData = function(mailFolders) {
+ var result = [];
+ for (var i = 0 ; i < mailFolders.length ; i++) {
+ var mailFolder = mailFolders[i];
+ var children = formatToSendData(mailFolder.children);
+ result.push({ name: mailFolder.text, children: children, topiaId: mailFolder.id });
+ }
+ return result;
+ }
+
+ var formatReceivedData = function(mailFolders) {
+ var result = [];
+ for (var i = 0 ; i < mailFolders.length ; i++) {
+ var mailFolder = mailFolders[i];
+ var children = formatReceivedData(mailFolder.children);
+ result.push({ text: mailFolder.name, children: children, id: mailFolder.topiaId });
+ }
+ return result;
+ }
+
+ var emailFields = {};
+ <s:iterator value="emailFields">
+ emailFields["<s:property value='key'/>"] = "<s:property value='value'/>";
+ </s:iterator>
+
+ var updateTableSnapshot = function() {
+ var tableHeader = $("#table-snapshot thead tr");
+ tableHeader.empty();
+ var value = $("#tableColumns").val();
+ if (value) {
+ var columns = value.split(",");
+ for (var i = 0 ; i < columns.length ; i++) {
+ tableHeader.append("<th>" + emailFields[columns[i]] + "</th>");
+ }
+ }
+ }
+
+ $().ready(function() {
+
+ $('a[data-toggle="tab"]').on('shown', function (e) {
+ var hash = e.target.hash;
+ $(":input[name='activeTab']").val(hash);
+
+ /*if (hash == "#tabs-3") {
+ $('#treeDiagram').jstree(true).refresh();
+
+ } else if (hash == "#tabs-4") {
+ $('#treeDiagram2choose').jstree(true).refresh();
+ }*/
+ });
+
+ var hash = $(":input[name='activeTab']").val();
+ if (!hash) {
+ hash = "#tabs-1";
+ }
+ $('#tabs a[href="' + hash + '"]').tab('show');
+
+ // table columns
+
+ $('#tableColumns').select2({tags:[
+ <s:iterator value="emailFields">
+ { id: "<s:property value='key'/>", text: "<s:property value='value' escapeHtml='false'/>" },
+ </s:iterator>
+ ]}).on("change", function(e) {
+ console.log(e.val)
+ updateTableSnapshot();
+ });
+
+ $("#tableColumns").select2("container").find("ul.select2-choices").sortable({
+ containment: 'parent',
+ start: function() { $("#tableColumns").select2("onSortStart"); },
+ update: function() { $("#tableColumns").select2("onSortEnd"); }
+ });
+
+ updateTableSnapshot();
+
+ // tree diagram
+
+ var folderData = JSON.parse('<s:property value="foldersTreeAsJson" escapeHtml="false"/>');
+ folderData = formatReceivedData(folderData);
+
+ $.jstree.defaults.core.themes.variant = "large";
+ // so that create works
+ $.jstree.defaults.core.check_callback = true;
+ $.jstree.defaults.core.multiple = false;
+
+ $('#treeDiagram').jstree({
+ core: {
+ data: folderData
+ },
+ state: { key: "faxtomail-treeDiagram" },
+ plugins: [ "contextmenu", "sort", "state", "unique", "dnd" ]
+ });
+
+ $('#treeDiagram2choose').jstree({
+ core: {
+ data: folderData
+ },
+ state: { key: "faxtomail-treeDiagram2choose" },
+ plugins: [ "sort", "state" ]
+ });
+
+ $("#main_form").submit(function(event) {
+ var mailFolders = $('#treeDiagram').jstree(true).get_json('#', {});
+ var foldersAsJson = formatToSendData(mailFolders);
+ console.log(foldersAsJson);
+
+ var input = $("<input>")
+ .attr("type", "hidden")
+ .attr("name", "foldersTreeAsJson").val(JSON.stringify(foldersAsJson));
+ $('#main_form').append($(input));
+ });
+ });
+ </script>
+ </head>
+ <body>
+
+ <div class="navbar navbar-inverse navbar-fixed-top">
+ <div class="navbar-inner">
+ <div class="container">
+ <s:a cssClass="brand">FaxToMail</s:a>
+ </div>
+ </div>
+ </div>
+
+ <div id="main-container" class="container">
+
+ <h1 class="margin-bottom25">Configuration</h1>
+
+ <s:form action='configuration!input' method="get" theme="simple">
+
+ <div class="input-append">
+
+ <s:select name="companyId"
+ label="Société"
+ emptyOption="true"
+ list="companies"
+ listKey="topiaId"
+ listValue="name"
+ value="company.topiaId"
+ cssClass="input-xxlarge"/>
+
+ <button class="btn" type="submit">OK</button>
+
+ </div>
+
+ </s:form>
+
+ <s:if test="company">
+
+ <s:form id="main_form">
+
+ <s:hidden name="companyId"/>
+ <s:hidden name="activeTab"/>
+
+ <ul id="tabs" class="nav nav-tabs">
+ <li><a href="#tabs-1" data-toggle="tab">Général</a></li>
+ <li><a href="#tabs-2" data-toggle="tab">Champs du tableau</a></li>
+ <li><a href="#tabs-3" data-toggle="tab">Arborescence</a></li>
+ <li><a href="#tabs-4" data-toggle="tab">Filtres de mail</a></li>
+ </ul>
+
+ <div class="tab-content">
+
+ <div id="tabs-1" class="tab-pane">
+ <!-- Général -->
+
+ <s:checkbox name="company.configuration.sendAknowledgement"
+ label="Envoyer directement l'accusé de réception si demandé par l'expéditeur"/>
+
+ <s:checkbox name="company.configuration.rejectUnknownSender"
+ label="Refuser les mails dont l'email est inconnu de la base client"
+ cssClass="margin-bottom25"/>
+
+ <s:textfield name="company.configuration.ediFolder"
+ label="Dossier de dépôt du fichier pour l'EDI"
+ cssClass="span12"/>
+
+ <!-- Il faut pouvoir configurer le dossier par défaut de déplacement en fonction des champs saisis sur la fiche (configuration sur statut, type de fiche, ...).
+ Ce dossier n'est qu'une proposition que l'utilisateur peut modifier)-->
+
+ </div>
+
+ <div id="tabs-2" class="tab-pane">
+ <!-- Champs du tableau -->
+
+ <div class="control-group ">
+ <label class="control-label" for="tableColumns">Champs à afficher dans le tableau (l'ordre peut être changé en faisant un glisser/déposer sur les champs)</label>
+
+ <div class="controls">
+
+ <s:hidden name="company.configuration.tableColumns"
+ id="tableColumns" cssClass="full-width margin-bottom25"/>
+
+ </div>
+
+ <div>
+ <table id='table-snapshot' class="table table-bordered">
+ <caption>Aperçu</caption>
+ <thead><tr></tr></thead>
+ </table>
+ </div>
+
+ </div>
+
+ </div>
+
+ <div id="tabs-3" class="tab-pane">
+ <!-- Tree Diagram -->
+
+ <div id="treeDiagram" class="jstree margin-bottom25">
+ </div>
+
+ <button class="btn" type="button" onClick="createNewNode()">
+ <i class="icon-plus"></i> Nouvelle racine
+ </button>
+ </div>
+
+
+ <div id="tabs-4" class="tab-pane">
+ <!-- Filtres de mail -->
+ <table id="filters" class="table table-bordered">
+ <thead>
+ <tr>
+ <th>Filtre</th>
+ <th>Dossier</th>
+ </tr>
+ </thead>
+ </table>
+
+ <s:textfield name="newFilterExpression"
+ label="Nouveau filtre"/>
+
+ <div id="treeDiagram2choose" class="jstree">
+ </div>
+
+ </div>
+
+ </div>
+
+ <div class="form-actions">
+ <button type="submit" class="btn btn-primary">Valider</button>
+ </div>
+
+ </s:form>
+ </s:if>
+
+ </div>
+ </body>
+</html>
Added: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/index.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/index.jsp (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/index.jsp 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,18 @@
+<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
+<!DOCTYPE html>
+<%@taglib uri="/struts-tags" prefix="s" %>
+<html>
+ <head>
+ <title>Accueil</title>
+ <content tag="categorie-accueil">current</content>
+ </head>
+ <body>
+ <h1>Administration FaxToMail</h1>
+
+ <div class="content info-zone">
+
+ <s:property value="welcomeText" escapeHtml="false"/>
+
+ </div>
+ </body>
+</html>
Added: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,42 @@
+<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
+<!DOCTYPE html>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sb" uri="/struts-bootstrap-tags" %>
+<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
+<%@ taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>FaxToMail : <decorator:title default="FaxToMail"/></title>
+ <sj:head locale="fr" jqueryui="true" loadAtOnce='true' jquerytheme="start" />
+ <sb:head />
+ <!--<script type="text/javascript" src="<s:url value='/js/select2/select2.min.js' />"></script>
+ <script type="text/javascript" src="<s:url value='/js/select2/select2_locale_fr.js' />"></script>
+ <script type="text/javascript" src="<s:url value='/js/extranet.js' />"></script>
+ <link rel="stylesheet" type="text/css" href="<s:url value='/css/select2/select2.css' />" />
+ <link rel="stylesheet" type="text/css" href="<s:url value='/css/extranet.css' />" />-->
+ <decorator:head/>
+ </head>
+
+ <body>
+ <div id="wrap-global">
+ <div id="wrap-main" class="<decorator:getProperty property="page.wide-display"/>">
+ <div id="faxtomail-body">
+ <s:actionerror theme="bootstrap"/>
+ <s:actionmessage theme="bootstrap"/>
+ <s:fielderror theme="bootstrap"/>
+ <decorator:body/>
+ </div>
+ </div>
+ </div>
+
+ <s:if test="%{instanceDisclaimer != null}">
+ <div id="instance-disclaimer">
+ <div>
+ <s:property value="instanceDisclaimer" />
+ </div>
+ </div>
+ </s:if>
+
+ </body>
+</html>
Added: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/version.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/version.jsp (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/version.jsp 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,25 @@
+<%--
+ #%L
+ Extranet ENC-AHI :: Web
+ $Id: version.jsp 827 2013-12-04 15:30:35Z bleny $
+ $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-web/src/… $
+ %%
+ Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ --%>
+<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
+${project.version}
\ No newline at end of file
Added: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators.xml
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators.xml (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators.xml 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,37 @@
+<!--
+ #%L
+ Extranet ENC-AHI :: Web
+ $Id: decorators.xml 827 2013-12-04 15:30:35Z bleny $
+ $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-web/src/… $
+ %%
+ Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
+<decorators defaultdir="/WEB-INF/decorators">
+ <excludes>
+ <pattern>/css/*</pattern>
+ <pattern>/img/*</pattern>
+ </excludes>
+
+ <!--<decorator name="layout-login" page="layout-login.jsp">-->
+ <!--<pattern>/authentication/login*</pattern>-->
+ <!--</decorator>-->
+
+ <decorator name="layout" page="layout.jsp">
+ <pattern>/*</pattern>
+ </decorator>
+</decorators>
Added: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/web.xml 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ metadata-complete="true">
+
+ <display-name>FaxToMail ${project.version}</display-name>
+
+ <session-config>
+ <session-timeout>600</session-timeout>
+ </session-config>
+
+ <!-- prevent excessive caching of js files -->
+ <filter>
+ <filter-name>ExpiresFilter</filter-name>
+ <filter-class>org.apache.catalina.filters.ExpiresFilter</filter-class>
+ <init-param>
+ <param-name>ExpiresByType image</param-name>
+ <param-value>access plus 10 minutes</param-value>
+ </init-param>
+ <init-param>
+ <param-name>ExpiresByType text/css</param-name>
+ <param-value>access plus 10 minutes</param-value>
+ </init-param>
+ <init-param>
+ <param-name>ExpiresByType application/javascript</param-name>
+ <param-value>access plus 10 minutes</param-value>
+ </init-param>
+ </filter>
+
+ <filter>
+ <filter-name>shiro</filter-name>
+ <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
+ </filter>
+
+ <filter>
+ <filter-name>struts-prepare</filter-name>
+ <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
+ </filter>
+
+ <filter>
+ <filter-name>sitemesh</filter-name>
+ <filter-class>com.opensymphony.sitemesh.webapp.SiteMeshFilter</filter-class>
+ </filter>
+
+ <filter>
+ <filter-name>struts-execute</filter-name>
+ <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>shiro</filter-name>
+ <url-pattern>/*</url-pattern>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ <dispatcher>ERROR</dispatcher>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>struts-prepare</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>sitemesh</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>struts-execute</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <listener>
+ <description>Init</description>
+ <listener-class>com.franciaflex.faxtomail.web.FaxToMailApplicationListener</listener-class>
+ </listener>
+
+ <listener>
+ <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
+ </listener>
+
+ <filter-mapping>
+ <filter-name>ExpiresFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ <dispatcher>REQUEST</dispatcher>
+ </filter-mapping>
+
+</web-app>
Added: trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,24 @@
+#main-container {
+ padding-top: 60px;
+}
+
+.margin-bottom25 {
+ margin-bottom: 25px;
+}
+
+.full-width {
+ width: 100%;
+}
+
+.tab-content {
+ padding-bottom: 70px;
+}
+
+.form-actions {
+ position: fixed;
+ bottom: 0;
+ width: 900px;
+}
+
+#treeDiagram {
+}
\ No newline at end of file
Added: trunk/faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/32px.png
===================================================================
(Binary files differ)
Property changes on: trunk/faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/32px.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/40px.png
===================================================================
(Binary files differ)
Property changes on: trunk/faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/40px.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/style.css
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/style.css (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/style.css 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,916 @@
+/* jsTree default theme */
+.jstree-node,
+.jstree-children,
+.jstree-container-ul {
+ display: block;
+ margin: 0;
+ padding: 0;
+ list-style-type: none;
+ list-style-image: none;
+}
+.jstree-node {
+ white-space: nowrap;
+}
+.jstree-anchor {
+ display: inline-block;
+ color: black;
+ white-space: nowrap;
+ padding: 0 4px 0 1px;
+ margin: 0;
+ vertical-align: top;
+}
+.jstree-anchor:focus {
+ outline: 0;
+}
+.jstree-anchor,
+.jstree-anchor:link,
+.jstree-anchor:visited,
+.jstree-anchor:hover,
+.jstree-anchor:active {
+ text-decoration: none;
+ color: inherit;
+}
+.jstree-icon {
+ display: inline-block;
+ text-decoration: none;
+ margin: 0;
+ padding: 0;
+ vertical-align: top;
+ text-align: center;
+}
+.jstree-icon:empty {
+ display: inline-block;
+ text-decoration: none;
+ margin: 0;
+ padding: 0;
+ vertical-align: top;
+ text-align: center;
+}
+.jstree-ocl {
+ cursor: pointer;
+}
+.jstree .jstree-open > .jstree-children {
+ display: block;
+}
+.jstree .jstree-closed > .jstree-children,
+.jstree .jstree-leaf > .jstree-children {
+ display: none;
+}
+.jstree-anchor > .jstree-themeicon {
+ margin-right: 2px;
+}
+.jstree-no-icons .jstree-themeicon,
+.jstree-anchor > .jstree-themeicon-hidden {
+ display: none;
+}
+.jstree-rtl .jstree-anchor {
+ padding: 0 1px 0 4px;
+}
+.jstree-rtl .jstree-anchor > .jstree-themeicon {
+ margin-left: 2px;
+ margin-right: 0;
+}
+.jstree-rtl .jstree-node {
+ margin-left: 0;
+}
+.jstree-rtl .jstree-container-ul > .jstree-node {
+ margin-right: 0;
+}
+.jstree-wholerow-ul {
+ position: relative;
+ display: inline-block;
+ min-width: 100%;
+}
+.jstree-wholerow-ul .jstree-anchor,
+.jstree-wholerow-ul .jstree-icon {
+ position: relative;
+}
+.jstree-wholerow-ul .jstree-wholerow {
+ width: 100%;
+ cursor: pointer;
+ position: absolute;
+ left: 0;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+.vakata-context {
+ display: none;
+}
+.vakata-context,
+.vakata-context ul {
+ margin: 0;
+ padding: 2px;
+ position: absolute;
+ background: #f5f5f5;
+ border: 1px solid #979797;
+ -moz-box-shadow: 5px 5px 4px -4px #666666;
+ -webkit-box-shadow: 2px 2px 2px #999999;
+ box-shadow: 2px 2px 2px #999999;
+}
+.vakata-context ul {
+ list-style: none;
+ left: 100%;
+ margin-top: -2.7em;
+ margin-left: -4px;
+}
+.vakata-context .vakata-context-right ul {
+ left: auto;
+ right: 100%;
+ margin-left: auto;
+ margin-right: -4px;
+}
+.vakata-context li {
+ list-style: none;
+ display: inline;
+}
+.vakata-context li > a {
+ display: block;
+ padding: 0 2em 0 2em;
+ text-decoration: none;
+ width: auto;
+ color: black;
+ white-space: nowrap;
+ line-height: 2.4em;
+ -moz-text-shadow: 1px 1px 0 white;
+ -webkit-text-shadow: 1px 1px 0 white;
+ text-shadow: 1px 1px 0 white;
+ -moz-border-radius: 1px;
+ -webkit-border-radius: 1px;
+ border-radius: 1px;
+}
+.vakata-context li > a:hover {
+ position: relative;
+ background-color: #e8eff7;
+ -moz-box-shadow: 0 0 2px #0a6aa1;
+ -webkit-box-shadow: 0 0 2px #0a6aa1;
+ box-shadow: 0 0 2px #0a6aa1;
+}
+.vakata-context li > a.vakata-context-parent {
+ background-image: url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw==");
+ background-position: right center;
+ background-repeat: no-repeat;
+}
+.vakata-context li > a:focus {
+ outline: 0;
+}
+.vakata-context .vakata-context-hover > a {
+ position: relative;
+ background-color: #e8eff7;
+ -moz-box-shadow: 0 0 2px #0a6aa1;
+ -webkit-box-shadow: 0 0 2px #0a6aa1;
+ box-shadow: 0 0 2px #0a6aa1;
+}
+.vakata-context .vakata-context-separator a,
+.vakata-context .vakata-context-separator a:hover {
+ background: white;
+ border: 0;
+ border-top: 1px solid #e2e3e3;
+ height: 1px;
+ min-height: 1px;
+ max-height: 1px;
+ padding: 0;
+ margin: 0 0 0 2.4em;
+ border-left: 1px solid #e0e0e0;
+ -moz-text-shadow: 0 0 0 transparent;
+ -webkit-text-shadow: 0 0 0 transparent;
+ text-shadow: 0 0 0 transparent;
+ -moz-box-shadow: 0 0 0 transparent;
+ -webkit-box-shadow: 0 0 0 transparent;
+ box-shadow: 0 0 0 transparent;
+ -moz-border-radius: 0;
+ -webkit-border-radius: 0;
+ border-radius: 0;
+}
+.vakata-context .vakata-contextmenu-disabled a,
+.vakata-context .vakata-contextmenu-disabled a:hover {
+ color: silver;
+ background-color: transparent;
+ border: 0;
+ box-shadow: 0 0 0;
+}
+.vakata-context li > a > i {
+ text-decoration: none;
+ display: inline-block;
+ width: 2.4em;
+ height: 2.4em;
+ background: transparent;
+ margin: 0 0 0 -2em;
+ vertical-align: top;
+ text-align: center;
+ line-height: 2.4em;
+}
+.vakata-context li > a > i:empty {
+ width: 2.4em;
+ line-height: 2.4em;
+}
+.vakata-context li > a .vakata-contextmenu-sep {
+ display: inline-block;
+ width: 1px;
+ height: 2.4em;
+ background: white;
+ margin: 0 0.5em 0 0;
+ border-left: 1px solid #e2e3e3;
+}
+.vakata-context .vakata-contextmenu-shortcut {
+ font-size: 0.8em;
+ color: silver;
+ opacity: 0.5;
+ display: none;
+}
+.vakata-context-rtl ul {
+ left: auto;
+ right: 100%;
+ margin-left: auto;
+ margin-right: -4px;
+}
+.vakata-context-rtl li > a.vakata-context-parent {
+ background-image: url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7");
+ background-position: left center;
+ background-repeat: no-repeat;
+}
+.vakata-context-rtl .vakata-context-separator > a {
+ margin: 0 2.4em 0 0;
+ border-left: 0;
+ border-right: 1px solid #e2e3e3;
+}
+.vakata-context-rtl .vakata-context-left ul {
+ right: auto;
+ left: 100%;
+ margin-left: -4px;
+ margin-right: auto;
+}
+.vakata-context-rtl li > a > i {
+ margin: 0 -2em 0 0;
+}
+.vakata-context-rtl li > a .vakata-contextmenu-sep {
+ margin: 0 0 0 0.5em;
+ border-left-color: white;
+ background: #e2e3e3;
+}
+#jstree-marker {
+ position: absolute;
+ top: 0;
+ left: 0;
+ margin: 0;
+ padding: 0;
+ border-right: 0;
+ border-top: 5px solid transparent;
+ border-bottom: 5px solid transparent;
+ border-left: 5px solid;
+ width: 0;
+ height: 0;
+ font-size: 0;
+ line-height: 0;
+}
+#jstree-dnd {
+ line-height: 16px;
+ margin: 0;
+ padding: 4px;
+}
+#jstree-dnd .jstree-icon,
+#jstree-dnd .jstree-copy {
+ display: inline-block;
+ text-decoration: none;
+ margin: 0 2px 0 0;
+ padding: 0;
+ width: 16px;
+ height: 16px;
+}
+#jstree-dnd .jstree-ok {
+ background: green;
+}
+#jstree-dnd .jstree-er {
+ background: red;
+}
+#jstree-dnd .jstree-copy {
+ margin: 0 2px 0 2px;
+}
+.jstree-default .jstree-node,
+.jstree-default .jstree-icon {
+ background-repeat: no-repeat;
+ background-color: transparent;
+}
+.jstree-default .jstree-anchor,
+.jstree-default .jstree-wholerow {
+ transition: background-color 0.15s, box-shadow 0.15s;
+}
+.jstree-default .jstree-hovered {
+ background: #e7f4f9;
+ border-radius: 2px;
+ box-shadow: inset 0 0 1px #ccc;
+}
+.jstree-default .jstree-clicked {
+ background: #beebff;
+ border-radius: 2px;
+ box-shadow: inset 0 0 1px #999;
+}
+.jstree-default .jstree-no-icons .jstree-anchor > .jstree-themeicon {
+ display: none;
+}
+.jstree-default .jstree-disabled {
+ background: transparent;
+ color: #666;
+}
+.jstree-default .jstree-disabled.jstree-hovered {
+ background: transparent;
+ box-shadow: none;
+}
+.jstree-default .jstree-disabled.jstree-clicked {
+ background: #efefef;
+}
+.jstree-default .jstree-disabled > .jstree-icon {
+ opacity: 0.8;
+ filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'jstree-grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#jstree-grayscale");
+ /* Firefox 10+ */
+ filter: gray;
+ /* IE6-9 */
+ -webkit-filter: grayscale(100%);
+ /* Chrome 19+ & Safari 6+ */
+}
+.jstree-default .jstree-search {
+ font-style: italic;
+ color: #8b0000;
+ font-weight: bold;
+}
+.jstree-default .jstree-no-checkboxes .jstree-checkbox {
+ display: none !important;
+}
+.jstree-default.jstree-checkbox-no-clicked .jstree-clicked {
+ background: transparent;
+ box-shadow: none;
+}
+.jstree-default.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered {
+ background: #e7f4f9;
+}
+.jstree-default.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked {
+ background: transparent;
+}
+.jstree-default.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked.jstree-wholerow-hovered {
+ background: #e7f4f9;
+}
+#jstree-dnd.jstree-default .jstree-ok,
+#jstree-dnd.jstree-default .jstree-er {
+ background-image: url("32px.png");
+ background-repeat: no-repeat;
+ background-color: transparent;
+}
+#jstree-dnd.jstree-default i {
+ background: transparent;
+ width: 16px;
+ height: 16px;
+}
+#jstree-dnd.jstree-default .jstree-ok {
+ background-position: -9px -71px;
+}
+#jstree-dnd.jstree-default .jstree-er {
+ background-position: -39px -71px;
+}
+.jstree-default > .jstree-striped {
+ background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAMAAAB/qqA+AAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlMNAMM9s3UAAAAXSURBVHjajcEBAQAAAIKg/H/aCQZ70AUBjAATb6YPDgAAAABJRU5ErkJggg==") left top repeat;
+}
+.jstree-default > .jstree-wholerow-ul .jstree-hovered,
+.jstree-default > .jstree-wholerow-ul .jstree-clicked {
+ background: transparent;
+ box-shadow: none;
+ border-radius: 0;
+}
+.jstree-default .jstree-wholerow {
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+}
+.jstree-default .jstree-wholerow-hovered {
+ background: #e7f4f9;
+}
+.jstree-default .jstree-wholerow-clicked {
+ background: #beebff;
+ background: -moz-linear-gradient(top, #beebff 0%, #a8e4ff 100%);
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #beebff), color-stop(100%, #a8e4ff));
+ background: -webkit-linear-gradient(top, #beebff 0%, #a8e4ff 100%);
+ background: -o-linear-gradient(top, #beebff 0%, #a8e4ff 100%);
+ background: -ms-linear-gradient(top, #beebff 0%, #a8e4ff 100%);
+ background: linear-gradient(to bottom, #beebff 0%, #a8e4ff 100%);
+ /*filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='@color1', endColorstr='@color2',GradientType=0 );*/
+}
+.jstree-default .jstree-node {
+ min-height: 24px;
+ line-height: 24px;
+ margin-left: 24px;
+ min-width: 24px;
+}
+.jstree-default .jstree-anchor {
+ line-height: 24px;
+ height: 24px;
+}
+.jstree-default .jstree-icon {
+ width: 24px;
+ height: 24px;
+ line-height: 24px;
+}
+.jstree-default .jstree-icon:empty {
+ width: 24px;
+ height: 24px;
+ line-height: 24px;
+}
+.jstree-default.jstree-rtl .jstree-node {
+ margin-right: 24px;
+}
+.jstree-default .jstree-wholerow {
+ height: 24px;
+}
+.jstree-default .jstree-node,
+.jstree-default .jstree-icon {
+ background-image: url("32px.png");
+}
+.jstree-default .jstree-node {
+ background-position: -292px -4px;
+ background-repeat: repeat-y;
+}
+.jstree-default .jstree-last {
+ background: transparent;
+}
+.jstree-default .jstree-open > .jstree-ocl {
+ background-position: -132px -4px;
+}
+.jstree-default .jstree-closed > .jstree-ocl {
+ background-position: -100px -4px;
+}
+.jstree-default .jstree-leaf > .jstree-ocl {
+ background-position: -68px -4px;
+}
+.jstree-default .jstree-anchor > .jstree-themeicon {
+ background-position: -260px -4px;
+}
+.jstree-default > .jstree-no-dots .jstree-node,
+.jstree-default > .jstree-no-dots .jstree-leaf > .jstree-ocl {
+ background: transparent;
+}
+.jstree-default > .jstree-no-dots .jstree-open > .jstree-ocl {
+ background-position: -36px -4px;
+}
+.jstree-default > .jstree-no-dots .jstree-closed > .jstree-ocl {
+ background-position: -4px -4px;
+}
+.jstree-default .jstree-disabled {
+ background: transparent;
+}
+.jstree-default .jstree-disabled.jstree-hovered {
+ background: transparent;
+}
+.jstree-default .jstree-disabled.jstree-clicked {
+ background: #efefef;
+}
+.jstree-default .jstree-checkbox {
+ background-position: -164px -4px;
+}
+.jstree-default .jstree-checkbox:hover {
+ background-position: -164px -36px;
+}
+.jstree-default .jstree-clicked > .jstree-checkbox {
+ background-position: -228px -4px;
+}
+.jstree-default .jstree-clicked > .jstree-checkbox:hover {
+ background-position: -228px -36px;
+}
+.jstree-default .jstree-anchor > .jstree-undetermined {
+ background-position: -196px -4px;
+}
+.jstree-default .jstree-anchor > .jstree-undetermined:hover {
+ background-position: -196px -36px;
+}
+.jstree-default > .jstree-striped {
+ background-size: auto 48px;
+}
+.jstree-default.jstree-rtl .jstree-node {
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==");
+ background-position: 100% 1px;
+ background-repeat: repeat-y;
+}
+.jstree-default.jstree-rtl .jstree-last {
+ background: transparent;
+}
+.jstree-default.jstree-rtl .jstree-open > .jstree-ocl {
+ background-position: -132px -36px;
+}
+.jstree-default.jstree-rtl .jstree-closed > .jstree-ocl {
+ background-position: -100px -36px;
+}
+.jstree-default.jstree-rtl .jstree-leaf > .jstree-ocl {
+ background-position: -68px -36px;
+}
+.jstree-default.jstree-rtl > .jstree-no-dots .jstree-node,
+.jstree-default.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl {
+ background: transparent;
+}
+.jstree-default.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl {
+ background-position: -36px -36px;
+}
+.jstree-default.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl {
+ background-position: -4px -36px;
+}
+.jstree-default .jstree-themeicon-custom {
+ background-color: transparent;
+ background-image: none;
+}
+.jstree-default > .jstree-container-ul .jstree-loading > .jstree-ocl {
+ background: url("throbber.gif") center center no-repeat;
+}
+.jstree-default.jstree-rtl .jstree-node {
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==");
+}
+.jstree-default.jstree-rtl .jstree-last {
+ background: transparent;
+}
+.jstree-default-small .jstree-node {
+ min-height: 18px;
+ line-height: 18px;
+ margin-left: 18px;
+ min-width: 18px;
+}
+.jstree-default-small .jstree-anchor {
+ line-height: 18px;
+ height: 18px;
+}
+.jstree-default-small .jstree-icon {
+ width: 18px;
+ height: 18px;
+ line-height: 18px;
+}
+.jstree-default-small .jstree-icon:empty {
+ width: 18px;
+ height: 18px;
+ line-height: 18px;
+}
+.jstree-default-small.jstree-rtl .jstree-node {
+ margin-right: 18px;
+}
+.jstree-default-small .jstree-wholerow {
+ height: 18px;
+}
+.jstree-default-small .jstree-node,
+.jstree-default-small .jstree-icon {
+ background-image: url("32px.png");
+}
+.jstree-default-small .jstree-node {
+ background-position: -295px -7px;
+ background-repeat: repeat-y;
+}
+.jstree-default-small .jstree-last {
+ background: transparent;
+}
+.jstree-default-small .jstree-open > .jstree-ocl {
+ background-position: -135px -7px;
+}
+.jstree-default-small .jstree-closed > .jstree-ocl {
+ background-position: -103px -7px;
+}
+.jstree-default-small .jstree-leaf > .jstree-ocl {
+ background-position: -71px -7px;
+}
+.jstree-default-small .jstree-anchor > .jstree-themeicon {
+ background-position: -263px -7px;
+}
+.jstree-default-small > .jstree-no-dots .jstree-node,
+.jstree-default-small > .jstree-no-dots .jstree-leaf > .jstree-ocl {
+ background: transparent;
+}
+.jstree-default-small > .jstree-no-dots .jstree-open > .jstree-ocl {
+ background-position: -39px -7px;
+}
+.jstree-default-small > .jstree-no-dots .jstree-closed > .jstree-ocl {
+ background-position: -7px -7px;
+}
+.jstree-default-small .jstree-disabled {
+ background: transparent;
+}
+.jstree-default-small .jstree-disabled.jstree-hovered {
+ background: transparent;
+}
+.jstree-default-small .jstree-disabled.jstree-clicked {
+ background: #efefef;
+}
+.jstree-default-small .jstree-checkbox {
+ background-position: -167px -7px;
+}
+.jstree-default-small .jstree-checkbox:hover {
+ background-position: -167px -39px;
+}
+.jstree-default-small .jstree-clicked > .jstree-checkbox {
+ background-position: -231px -7px;
+}
+.jstree-default-small .jstree-clicked > .jstree-checkbox:hover {
+ background-position: -231px -39px;
+}
+.jstree-default-small .jstree-anchor > .jstree-undetermined {
+ background-position: -199px -7px;
+}
+.jstree-default-small .jstree-anchor > .jstree-undetermined:hover {
+ background-position: -199px -39px;
+}
+.jstree-default-small > .jstree-striped {
+ background-size: auto 36px;
+}
+.jstree-default-small.jstree-rtl .jstree-node {
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==");
+ background-position: 100% 1px;
+ background-repeat: repeat-y;
+}
+.jstree-default-small.jstree-rtl .jstree-last {
+ background: transparent;
+}
+.jstree-default-small.jstree-rtl .jstree-open > .jstree-ocl {
+ background-position: -135px -39px;
+}
+.jstree-default-small.jstree-rtl .jstree-closed > .jstree-ocl {
+ background-position: -103px -39px;
+}
+.jstree-default-small.jstree-rtl .jstree-leaf > .jstree-ocl {
+ background-position: -71px -39px;
+}
+.jstree-default-small.jstree-rtl > .jstree-no-dots .jstree-node,
+.jstree-default-small.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl {
+ background: transparent;
+}
+.jstree-default-small.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl {
+ background-position: -39px -39px;
+}
+.jstree-default-small.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl {
+ background-position: -7px -39px;
+}
+.jstree-default-small .jstree-themeicon-custom {
+ background-color: transparent;
+ background-image: none;
+}
+.jstree-default-small > .jstree-container-ul .jstree-loading > .jstree-ocl {
+ background: url("throbber.gif") center center no-repeat;
+}
+.jstree-default-small.jstree-rtl .jstree-node {
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg==");
+}
+.jstree-default-small.jstree-rtl .jstree-last {
+ background: transparent;
+}
+.jstree-default-large .jstree-node {
+ min-height: 32px;
+ line-height: 32px;
+ margin-left: 32px;
+ min-width: 32px;
+}
+.jstree-default-large .jstree-anchor {
+ line-height: 32px;
+ height: 32px;
+}
+.jstree-default-large .jstree-icon {
+ width: 32px;
+ height: 32px;
+ line-height: 32px;
+}
+.jstree-default-large .jstree-icon:empty {
+ width: 32px;
+ height: 32px;
+ line-height: 32px;
+}
+.jstree-default-large.jstree-rtl .jstree-node {
+ margin-right: 32px;
+}
+.jstree-default-large .jstree-wholerow {
+ height: 32px;
+}
+.jstree-default-large .jstree-node,
+.jstree-default-large .jstree-icon {
+ background-image: url("32px.png");
+}
+.jstree-default-large .jstree-node {
+ background-position: -288px 0px;
+ background-repeat: repeat-y;
+}
+.jstree-default-large .jstree-last {
+ background: transparent;
+}
+.jstree-default-large .jstree-open > .jstree-ocl {
+ background-position: -128px 0px;
+}
+.jstree-default-large .jstree-closed > .jstree-ocl {
+ background-position: -96px 0px;
+}
+.jstree-default-large .jstree-leaf > .jstree-ocl {
+ background-position: -64px 0px;
+}
+.jstree-default-large .jstree-anchor > .jstree-themeicon {
+ background-position: -256px 0px;
+}
+.jstree-default-large > .jstree-no-dots .jstree-node,
+.jstree-default-large > .jstree-no-dots .jstree-leaf > .jstree-ocl {
+ background: transparent;
+}
+.jstree-default-large > .jstree-no-dots .jstree-open > .jstree-ocl {
+ background-position: -32px 0px;
+}
+.jstree-default-large > .jstree-no-dots .jstree-closed > .jstree-ocl {
+ background-position: 0px 0px;
+}
+.jstree-default-large .jstree-disabled {
+ background: transparent;
+}
+.jstree-default-large .jstree-disabled.jstree-hovered {
+ background: transparent;
+}
+.jstree-default-large .jstree-disabled.jstree-clicked {
+ background: #efefef;
+}
+.jstree-default-large .jstree-checkbox {
+ background-position: -160px 0px;
+}
+.jstree-default-large .jstree-checkbox:hover {
+ background-position: -160px -32px;
+}
+.jstree-default-large .jstree-clicked > .jstree-checkbox {
+ background-position: -224px 0px;
+}
+.jstree-default-large .jstree-clicked > .jstree-checkbox:hover {
+ background-position: -224px -32px;
+}
+.jstree-default-large .jstree-anchor > .jstree-undetermined {
+ background-position: -192px 0px;
+}
+.jstree-default-large .jstree-anchor > .jstree-undetermined:hover {
+ background-position: -192px -32px;
+}
+.jstree-default-large > .jstree-striped {
+ background-size: auto 64px;
+}
+.jstree-default-large.jstree-rtl .jstree-node {
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==");
+ background-position: 100% 1px;
+ background-repeat: repeat-y;
+}
+.jstree-default-large.jstree-rtl .jstree-last {
+ background: transparent;
+}
+.jstree-default-large.jstree-rtl .jstree-open > .jstree-ocl {
+ background-position: -128px -32px;
+}
+.jstree-default-large.jstree-rtl .jstree-closed > .jstree-ocl {
+ background-position: -96px -32px;
+}
+.jstree-default-large.jstree-rtl .jstree-leaf > .jstree-ocl {
+ background-position: -64px -32px;
+}
+.jstree-default-large.jstree-rtl > .jstree-no-dots .jstree-node,
+.jstree-default-large.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl {
+ background: transparent;
+}
+.jstree-default-large.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl {
+ background-position: -32px -32px;
+}
+.jstree-default-large.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl {
+ background-position: 0px -32px;
+}
+.jstree-default-large .jstree-themeicon-custom {
+ background-color: transparent;
+ background-image: none;
+}
+.jstree-default-large > .jstree-container-ul .jstree-loading > .jstree-ocl {
+ background: url("throbber.gif") center center no-repeat;
+}
+.jstree-default-large.jstree-rtl .jstree-node {
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg==");
+}
+.jstree-default-large.jstree-rtl .jstree-last {
+ background: transparent;
+}
+@media (max-width: 768px) {
+ .jstree-default-responsive {
+ /*
+ .jstree-open > .jstree-ocl,
+ .jstree-closed > .jstree-ocl { border-radius:20px; background-color:white; }
+ */
+ }
+ .jstree-default-responsive .jstree-icon {
+ background-image: url("40px.png");
+ }
+ .jstree-default-responsive .jstree-node,
+ .jstree-default-responsive .jstree-leaf > .jstree-ocl {
+ background: transparent;
+ }
+ .jstree-default-responsive .jstree-node {
+ min-height: 40px;
+ line-height: 40px;
+ margin-left: 40px;
+ min-width: 40px;
+ white-space: nowrap;
+ }
+ .jstree-default-responsive .jstree-anchor {
+ line-height: 40px;
+ height: 40px;
+ }
+ .jstree-default-responsive .jstree-icon,
+ .jstree-default-responsive .jstree-icon:empty {
+ width: 40px;
+ height: 40px;
+ line-height: 40px;
+ }
+ .jstree-default-responsive > .jstree-container-ul > .jstree-node {
+ margin-left: 0;
+ }
+ .jstree-default-responsive.jstree-rtl .jstree-node {
+ margin-left: 0;
+ margin-right: 40px;
+ }
+ .jstree-default-responsive.jstree-rtl .jstree-container-ul > .jstree-node {
+ margin-right: 0;
+ }
+ .jstree-default-responsive .jstree-ocl,
+ .jstree-default-responsive .jstree-themeicon,
+ .jstree-default-responsive .jstree-checkbox {
+ background-size: 120px 200px;
+ }
+ .jstree-default-responsive .jstree-leaf > .jstree-ocl {
+ background: transparent;
+ }
+ .jstree-default-responsive .jstree-open > .jstree-ocl {
+ background-position: 0 0px !important;
+ }
+ .jstree-default-responsive .jstree-closed > .jstree-ocl {
+ background-position: 0 -40px !important;
+ }
+ .jstree-default-responsive.jstree-rtl .jstree-closed > .jstree-ocl {
+ background-position: -40px 0px !important;
+ }
+ .jstree-default-responsive .jstree-anchor > .jstree-themeicon {
+ background-position: -40px -40px;
+ }
+ .jstree-default-responsive .jstree-checkbox,
+ .jstree-default-responsive .jstree-checkbox:hover {
+ background-position: -40px -80px;
+ }
+ .jstree-default-responsive .jstree-clicked > .jstree-checkbox,
+ .jstree-default-responsive .jstree-clicked > .jstree-checkbox:hover {
+ background-position: 0 -80px;
+ }
+ .jstree-default-responsive .jstree-anchor > .jstree-undetermined,
+ .jstree-default-responsive .jstree-anchor > .jstree-undetermined:hover {
+ background-position: 0 -120px;
+ }
+ .jstree-default-responsive .jstree-anchor {
+ font-weight: bold;
+ font-size: 1.1em;
+ text-shadow: 1px 1px white;
+ }
+ .jstree-default-responsive > .jstree-striped {
+ background: transparent;
+ }
+ .jstree-default-responsive .jstree-wholerow {
+ border-top: 1px solid rgba(255, 255, 255, 0.7);
+ border-bottom: 1px solid rgba(64, 64, 64, 0.2);
+ background: #ebebeb;
+ height: 40px;
+ }
+ .jstree-default-responsive .jstree-wholerow-hovered {
+ background: #e7f4f9;
+ }
+ .jstree-default-responsive .jstree-wholerow-clicked {
+ background: #beebff;
+ }
+ .jstree-default-responsive .jstree-children .jstree-last > .jstree-wholerow {
+ box-shadow: inset 0 -6px 3px -5px #666666;
+ }
+ .jstree-default-responsive .jstree-children .jstree-open > .jstree-wholerow {
+ box-shadow: inset 0 6px 3px -5px #666666;
+ border-top: 0;
+ }
+ .jstree-default-responsive .jstree-children .jstree-open + .jstree-open {
+ box-shadow: none;
+ }
+ .jstree-default-responsive .jstree-node,
+ .jstree-default-responsive .jstree-icon,
+ .jstree-default-responsive .jstree-node > .jstree-ocl,
+ .jstree-default-responsive .jstree-themeicon,
+ .jstree-default-responsive .jstree-checkbox {
+ background-image: url("40px.png");
+ background-size: 120px 200px;
+ }
+ .jstree-default-responsive .jstree-node {
+ background-position: -80px 0;
+ background-repeat: repeat-y;
+ }
+ .jstree-default-responsive .jstree-last {
+ background: transparent;
+ }
+ .jstree-default-responsive .jstree-leaf > .jstree-ocl {
+ background-position: -40px -120px;
+ }
+ .jstree-default-responsive .jstree-last > .jstree-ocl {
+ background-position: -40px -160px;
+ }
+ .jstree-default-responsive .jstree-themeicon-custom {
+ background-color: transparent;
+ background-image: none;
+ }
+}
+.jstree-default > .jstree-container-ul > .jstree-node {
+ margin-left: 0;
+ margin-right: 0;
+}
Added: trunk/faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/style.min.css
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/style.min.css (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/style.min.css 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1 @@
+.jstree-node,.jstree-children,.jstree-container-ul{display:block;margin:0;padding:0;list-style-type:none;list-style-image:none}.jstree-node{white-space:nowrap}.jstree-anchor{display:inline-block;color:#000;white-space:nowrap;padding:0 4px 0 1px;margin:0;vertical-align:top}.jstree-anchor:focus{outline:0}.jstree-anchor,.jstree-anchor:link,.jstree-anchor:visited,.jstree-anchor:hover,.jstree-anchor:active{text-decoration:none;color:inherit}.jstree-icon{display:inline-block;text-decoration:none;margin:0;padding:0;vertical-align:top;text-align:center}.jstree-icon:empty{display:inline-block;text-decoration:none;margin:0;padding:0;vertical-align:top;text-align:center}.jstree-ocl{cursor:pointer}.jstree .jstree-open>.jstree-children{display:block}.jstree .jstree-closed>.jstree-children,.jstree .jstree-leaf>.jstree-children{display:none}.jstree-anchor>.jstree-themeicon{margin-right:2px}.jstree-no-icons .jstree-themeicon,.jstree-anchor>.jstree-themeicon-hidden{display:none}.jstree-rtl .jstree-anchor{padding:0 1px 0 4px}.jstree-rtl .jstree-anchor>.jstree-themeicon{margin-left:2px;margin-right:0}.jstree-rtl .jstree-node{margin-left:0}.jstree-rtl .jstree-container-ul>.jstree-node{margin-right:0}.jstree-wholerow-ul{position:relative;display:inline-block;min-width:100%}.jstree-wholerow-ul .jstree-anchor,.jstree-wholerow-ul .jstree-icon{position:relative}.jstree-wholerow-ul .jstree-wholerow{width:100%;cursor:pointer;position:absolute;left:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vakata-context{display:none}.vakata-context,.vakata-context ul{margin:0;padding:2px;position:absolute;background:#f5f5f5;border:1px solid #979797;-moz-box-shadow:5px 5px 4px -4px #666;-webkit-box-shadow:2px 2px 2px #999;box-shadow:2px 2px 2px #999}.vakata-context ul{list-style:none;left:100%;margin-top:-2.7em;margin-left:-4px}.vakata-context .vakata-context-right ul{left:auto;right:100%;margin-left:auto;margin-right:-4px}.vakata-context li{list-style:none;display:inline}.vakata-context li>a{display:block;padding:0 2em;text-decoration:none;width:auto;color:#000;white-space:nowrap;line-height:2.4em;-moz-text-shadow:1px 1px 0 #fff;-webkit-text-shadow:1px 1px 0 #fff;text-shadow:1px 1px 0 #fff;-moz-border-radius:1px;-webkit-border-radius:1px;border-radius:1px}.vakata-context li>a:hover{position:relative;background-color:#e8eff7;-moz-box-shadow:0 0 2px #0a6aa1;-webkit-box-shadow:0 0 2px #0a6aa1;box-shadow:0 0 2px #0a6aa1}.vakata-context li>a.vakata-context-parent{background-image:url(data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw==);background-position:right center;background-repeat:no-repeat}.vakata-context li>a:focus{outline:0}.vakata-context .vakata-context-hover>a{position:relative;background-color:#e8eff7;-moz-box-shadow:0 0 2px #0a6aa1;-webkit-box-shadow:0 0 2px #0a6aa1;box-shadow:0 0 2px #0a6aa1}.vakata-context .vakata-context-separator a,.vakata-context .vakata-context-separator a:hover{background:#fff;border:0;border-top:1px solid #e2e3e3;height:1px;min-height:1px;max-height:1px;padding:0;margin:0 0 0 2.4em;border-left:1px solid #e0e0e0;-moz-text-shadow:0 0 0 transparent;-webkit-text-shadow:0 0 0 transparent;text-shadow:0 0 0 transparent;-moz-box-shadow:0 0 0 transparent;-webkit-box-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.vakata-context .vakata-contextmenu-disabled a,.vakata-context .vakata-contextmenu-disabled a:hover{color:silver;background-color:transparent;border:0;box-shadow:0 0 0}.vakata-context li>a>i{text-decoration:none;display:inline-block;width:2.4em;height:2.4em;background:0 0;margin:0 0 0 -2em;vertical-align:top;text-align:center;line-height:2.4em}.vakata-context li>a>i:empty{width:2.4em;line-height:2.4em}.vakata-context li>a .vakata-contextmenu-sep{display:inline-block;width:1px;height:2.4em;background:#fff;margin:0 .5em 0 0;border-left:1px solid #e2e3e3}.vakata-context .vakata-contextmenu-shortcut{font-size:.8em;color:silver;opacity:.5;display:none}.vakata-context-rtl ul{left:auto;right:100%;margin-left:auto;margin-right:-4px}.vakata-context-rtl li>a.vakata-context-parent{background-image:url(data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7);background-position:left center;background-repeat:no-repeat}.vakata-context-rtl .vakata-context-separator>a{margin:0 2.4em 0 0;border-left:0;border-right:1px solid #e2e3e3}.vakata-context-rtl .vakata-context-left ul{right:auto;left:100%;margin-left:-4px;margin-right:auto}.vakata-context-rtl li>a>i{margin:0 -2em 0 0}.vakata-context-rtl li>a .vakata-contextmenu-sep{margin:0 0 0 .5em;border-left-color:#fff;background:#e2e3e3}#jstree-marker{position:absolute;top:0;left:0;margin:0;padding:0;border-right:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid;width:0;height:0;font-size:0;line-height:0}#jstree-dnd{line-height:16px;margin:0;padding:4px}#jstree-dnd .jstree-icon,#jstree-dnd .jstree-copy{display:inline-block;text-decoration:none;margin:0 2px 0 0;padding:0;width:16px;height:16px}#jstree-dnd .jstree-ok{background:green}#jstree-dnd .jstree-er{background:red}#jstree-dnd .jstree-copy{margin:0 2px}.jstree-default .jstree-node,.jstree-default .jstree-icon{background-repeat:no-repeat;background-color:transparent}.jstree-default .jstree-anchor,.jstree-default .jstree-wholerow{transition:background-color .15s,box-shadow .15s}.jstree-default .jstree-hovered{background:#e7f4f9;border-radius:2px;box-shadow:inset 0 0 1px #ccc}.jstree-default .jstree-clicked{background:#beebff;border-radius:2px;box-shadow:inset 0 0 1px #999}.jstree-default .jstree-no-icons .jstree-anchor>.jstree-themeicon{display:none}.jstree-default .jstree-disabled{background:0 0;color:#666}.jstree-default .jstree-disabled.jstree-hovered{background:0 0;box-shadow:none}.jstree-default .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default .jstree-disabled>.jstree-icon{opacity:.8;filter:url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'jstree-grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#jstree-grayscale");filter:gray;-webkit-filter:grayscale(100%)}.jstree-default .jstree-search{font-style:italic;color:#8b0000;font-weight:700}.jstree-default .jstree-no-checkboxes .jstree-checkbox{display:none!important}.jstree-default.jstree-checkbox-no-clicked .jstree-clicked{background:0 0;box-shadow:none}.jstree-default.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered{background:#e7f4f9}.jstree-default.jstree-checkbox-no-clicked>.jstree-wholerow-ul .jstree-wholerow-clicked{background:0 0}.jstree-default.jstree-checkbox-no-clicked>.jstree-wholerow-ul .jstree-wholerow-clicked.jstree-wholerow-hovered{background:#e7f4f9}#jstree-dnd.jstree-default .jstree-ok,#jstree-dnd.jstree-default .jstree-er{background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-default i{background:0 0;width:16px;height:16px}#jstree-dnd.jstree-default .jstree-ok{background-position:-9px -71px}#jstree-dnd.jstree-default .jstree-er{background-position:-39px -71px}.jstree-default>.jstree-striped{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAMAAAB/qqA+AAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlMNAMM9s3UAAAAXSURBVHjajcEBAQAAAIKg/H/aCQZ70AUBjAATb6YPDgAAAABJRU5ErkJggg==) left top repeat}.jstree-default>.jstree-wholerow-ul .jstree-hovered,.jstree-default>.jstree-wholerow-ul .jstree-clicked{background:0 0;box-shadow:none;border-radius:0}.jstree-default .jstree-wholerow{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.jstree-default .jstree-wholerow-hovered{background:#e7f4f9}.jstree-default .jstree-wholerow-clicked{background:#beebff;background:-moz-linear-gradient(top,#beebff 0,#a8e4ff 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#beebff),color-stop(100%,#a8e4ff));background:-webkit-linear-gradient(top,#beebff 0,#a8e4ff 100%);background:-o-linear-gradient(top,#beebff 0,#a8e4ff 100%);background:-ms-linear-gradient(top,#beebff 0,#a8e4ff 100%);background:linear-gradient(to bottom,#beebff 0,#a8e4ff 100%)}.jstree-default .jstree-node{min-height:24px;line-height:24px;margin-left:24px;min-width:24px}.jstree-default .jstree-anchor{line-height:24px;height:24px}.jstree-default .jstree-icon{width:24px;height:24px;line-height:24px}.jstree-default .jstree-icon:empty{width:24px;height:24px;line-height:24px}.jstree-default.jstree-rtl .jstree-node{margin-right:24px}.jstree-default .jstree-wholerow{height:24px}.jstree-default .jstree-node,.jstree-default .jstree-icon{background-image:url(32px.png)}.jstree-default .jstree-node{background-position:-292px -4px;background-repeat:repeat-y}.jstree-default .jstree-last{background:0 0}.jstree-default .jstree-open>.jstree-ocl{background-position:-132px -4px}.jstree-default .jstree-closed>.jstree-ocl{background-position:-100px -4px}.jstree-default .jstree-leaf>.jstree-ocl{background-position:-68px -4px}.jstree-default .jstree-anchor>.jstree-themeicon{background-position:-260px -4px}.jstree-default>.jstree-no-dots .jstree-node,.jstree-default>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-36px -4px}.jstree-default>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-4px -4px}.jstree-default .jstree-disabled{background:0 0}.jstree-default .jstree-disabled.jstree-hovered{background:0 0}.jstree-default .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default .jstree-checkbox{background-position:-164px -4px}.jstree-default .jstree-checkbox:hover{background-position:-164px -36px}.jstree-default .jstree-clicked>.jstree-checkbox{background-position:-228px -4px}.jstree-default .jstree-clicked>.jstree-checkbox:hover{background-position:-228px -36px}.jstree-default .jstree-anchor>.jstree-undetermined{background-position:-196px -4px}.jstree-default .jstree-anchor>.jstree-undetermined:hover{background-position:-196px -36px}.jstree-default>.jstree-striped{background-size:auto 48px}.jstree-default.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default.jstree-rtl .jstree-last{background:0 0}.jstree-default.jstree-rtl .jstree-open>.jstree-ocl{background-position:-132px -36px}.jstree-default.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-100px -36px}.jstree-default.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-68px -36px}.jstree-default.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-default.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-36px -36px}.jstree-default.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-4px -36px}.jstree-default .jstree-themeicon-custom{background-color:transparent;background-image:none}.jstree-default>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==)}.jstree-default.jstree-rtl .jstree-last{background:0 0}.jstree-default-small .jstree-node{min-height:18px;line-height:18px;margin-left:18px;min-width:18px}.jstree-default-small .jstree-anchor{line-height:18px;height:18px}.jstree-default-small .jstree-icon{width:18px;height:18px;line-height:18px}.jstree-default-small .jstree-icon:empty{width:18px;height:18px;line-height:18px}.jstree-default-small.jstree-rtl .jstree-node{margin-right:18px}.jstree-default-small .jstree-wholerow{height:18px}.jstree-default-small .jstree-node,.jstree-default-small .jstree-icon{background-image:url(32px.png)}.jstree-default-small .jstree-node{background-position:-295px -7px;background-repeat:repeat-y}.jstree-default-small .jstree-last{background:0 0}.jstree-default-small .jstree-open>.jstree-ocl{background-position:-135px -7px}.jstree-default-small .jstree-closed>.jstree-ocl{background-position:-103px -7px}.jstree-default-small .jstree-leaf>.jstree-ocl{background-position:-71px -7px}.jstree-default-small .jstree-anchor>.jstree-themeicon{background-position:-263px -7px}.jstree-default-small>.jstree-no-dots .jstree-node,.jstree-default-small>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-small>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-39px -7px}.jstree-default-small>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-7px -7px}.jstree-default-small .jstree-disabled{background:0 0}.jstree-default-small .jstree-disabled.jstree-hovered{background:0 0}.jstree-default-small .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default-small .jstree-checkbox{background-position:-167px -7px}.jstree-default-small .jstree-checkbox:hover{background-position:-167px -39px}.jstree-default-small .jstree-clicked>.jstree-checkbox{background-position:-231px -7px}.jstree-default-small .jstree-clicked>.jstree-checkbox:hover{background-position:-231px -39px}.jstree-default-small .jstree-anchor>.jstree-undetermined{background-position:-199px -7px}.jstree-default-small .jstree-anchor>.jstree-undetermined:hover{background-position:-199px -39px}.jstree-default-small>.jstree-striped{background-size:auto 36px}.jstree-default-small.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default-small.jstree-rtl .jstree-last{background:0 0}.jstree-default-small.jstree-rtl .jstree-open>.jstree-ocl{background-position:-135px -39px}.jstree-default-small.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-103px -39px}.jstree-default-small.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-71px -39px}.jstree-default-small.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-default-small.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-small.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-39px -39px}.jstree-default-small.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-7px -39px}.jstree-default-small .jstree-themeicon-custom{background-color:transparent;background-image:none}.jstree-default-small>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default-small.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg==)}.jstree-default-small.jstree-rtl .jstree-last{background:0 0}.jstree-default-large .jstree-node{min-height:32px;line-height:32px;margin-left:32px;min-width:32px}.jstree-default-large .jstree-anchor{line-height:32px;height:32px}.jstree-default-large .jstree-icon{width:32px;height:32px;line-height:32px}.jstree-default-large .jstree-icon:empty{width:32px;height:32px;line-height:32px}.jstree-default-large.jstree-rtl .jstree-node{margin-right:32px}.jstree-default-large .jstree-wholerow{height:32px}.jstree-default-large .jstree-node,.jstree-default-large .jstree-icon{background-image:url(32px.png)}.jstree-default-large .jstree-node{background-position:-288px 0;background-repeat:repeat-y}.jstree-default-large .jstree-last{background:0 0}.jstree-default-large .jstree-open>.jstree-ocl{background-position:-128px 0}.jstree-default-large .jstree-closed>.jstree-ocl{background-position:-96px 0}.jstree-default-large .jstree-leaf>.jstree-ocl{background-position:-64px 0}.jstree-default-large .jstree-anchor>.jstree-themeicon{background-position:-256px 0}.jstree-default-large>.jstree-no-dots .jstree-node,.jstree-default-large>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-large>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-32px 0}.jstree-default-large>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:0 0}.jstree-default-large .jstree-disabled{background:0 0}.jstree-default-large .jstree-disabled.jstree-hovered{background:0 0}.jstree-default-large .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default-large .jstree-checkbox{background-position:-160px 0}.jstree-default-large .jstree-checkbox:hover{background-position:-160px -32px}.jstree-default-large .jstree-clicked>.jstree-checkbox{background-position:-224px 0}.jstree-default-large .jstree-clicked>.jstree-checkbox:hover{background-position:-224px -32px}.jstree-default-large .jstree-anchor>.jstree-undetermined{background-position:-192px 0}.jstree-default-large .jstree-anchor>.jstree-undetermined:hover{background-position:-192px -32px}.jstree-default-large>.jstree-striped{background-size:auto 64px}.jstree-default-large.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default-large.jstree-rtl .jstree-last{background:0 0}.jstree-default-large.jstree-rtl .jstree-open>.jstree-ocl{background-position:-128px -32px}.jstree-default-large.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-96px -32px}.jstree-default-large.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-64px -32px}.jstree-default-large.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-default-large.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-large.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-32px -32px}.jstree-default-large.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:0 -32px}.jstree-default-large .jstree-themeicon-custom{background-color:transparent;background-image:none}.jstree-default-large>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default-large.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg==)}.jstree-default-large.jstree-rtl .jstree-last{background:0 0}@media (max-width:768px){.jstree-default-responsive .jstree-icon{background-image:url(40px.png)}.jstree-default-responsive .jstree-node,.jstree-default-responsive .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-responsive .jstree-node{min-height:40px;line-height:40px;margin-left:40px;min-width:40px;white-space:nowrap}.jstree-default-responsive .jstree-anchor{line-height:40px;height:40px}.jstree-default-responsive .jstree-icon,.jstree-default-responsive .jstree-icon:empty{width:40px;height:40px;line-height:40px}.jstree-default-responsive>.jstree-container-ul>.jstree-node{margin-left:0}.jstree-default-responsive.jstree-rtl .jstree-node{margin-left:0;margin-right:40px}.jstree-default-responsive.jstree-rtl .jstree-container-ul>.jstree-node{margin-right:0}.jstree-default-responsive .jstree-ocl,.jstree-default-responsive .jstree-themeicon,.jstree-default-responsive .jstree-checkbox{background-size:120px 200px}.jstree-default-responsive .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-responsive .jstree-open>.jstree-ocl{background-position:0 0!important}.jstree-default-responsive .jstree-closed>.jstree-ocl{background-position:0 -40px!important}.jstree-default-responsive.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-40px 0!important}.jstree-default-responsive .jstree-anchor>.jstree-themeicon{background-position:-40px -40px}.jstree-default-responsive .jstree-checkbox,.jstree-default-responsive .jstree-checkbox:hover{background-position:-40px -80px}.jstree-default-responsive .jstree-clicked>.jstree-checkbox,.jstree-default-responsive .jstree-clicked>.jstree-checkbox:hover{background-position:0 -80px}.jstree-default-responsive .jstree-anchor>.jstree-undetermined,.jstree-default-responsive .jstree-anchor>.jstree-undetermined:hover{background-position:0 -120px}.jstree-default-responsive .jstree-anchor{font-weight:700;font-size:1.1em;text-shadow:1px 1px #fff}.jstree-default-responsive>.jstree-striped{background:0 0}.jstree-default-responsive .jstree-wholerow{border-top:1px solid rgba(255,255,255,.7);border-bottom:1px solid rgba(64,64,64,.2);background:#ebebeb;height:40px}.jstree-default-responsive .jstree-wholerow-hovered{background:#e7f4f9}.jstree-default-responsive .jstree-wholerow-clicked{background:#beebff}.jstree-default-responsive .jstree-children .jstree-last>.jstree-wholerow{box-shadow:inset 0 -6px 3px -5px #666}.jstree-default-responsive .jstree-children .jstree-open>.jstree-wholerow{box-shadow:inset 0 6px 3px -5px #666;border-top:0}.jstree-default-responsive .jstree-children .jstree-open+.jstree-open{box-shadow:none}.jstree-default-responsive .jstree-node,.jstree-default-responsive .jstree-icon,.jstree-default-responsive .jstree-node>.jstree-ocl,.jstree-default-responsive .jstree-themeicon,.jstree-default-responsive .jstree-checkbox{background-image:url(40px.png);background-size:120px 200px}.jstree-default-responsive .jstree-node{background-position:-80px 0;background-repeat:repeat-y}.jstree-default-responsive .jstree-last{background:0 0}.jstree-default-responsive .jstree-leaf>.jstree-ocl{background-position:-40px -120px}.jstree-default-responsive .jstree-last>.jstree-ocl{background-position:-40px -160px}.jstree-default-responsive .jstree-themeicon-custom{background-color:transparent;background-image:none}}.jstree-default>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}
\ No newline at end of file
Added: trunk/faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/throbber.gif
===================================================================
(Binary files differ)
Property changes on: trunk/faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/throbber.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/faxtomail-ui-web/src/main/webapp/css/select2/select2-spinner.gif
===================================================================
(Binary files differ)
Property changes on: trunk/faxtomail-ui-web/src/main/webapp/css/select2/select2-spinner.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/faxtomail-ui-web/src/main/webapp/css/select2/select2.css
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/css/select2/select2.css (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/css/select2/select2.css 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,617 @@
+/*
+Version: 3.4.3 Timestamp: Tue Sep 17 06:47:14 PDT 2013
+
+%%Ignore-License
+*/
+.select2-container {
+ margin: 0;
+ position: relative;
+ display: inline-block;
+ /* inline-block for ie7 */
+ zoom: 1;
+ *display: inline;
+ vertical-align: middle;
+}
+
+.select2-container,
+.select2-drop,
+.select2-search,
+.select2-search input {
+ /*
+ Force border-box so that % widths fit the parent
+ container without overlap because of margin/padding.
+
+ More Info : http://www.quirksmode.org/css/box.html
+ */
+ -webkit-box-sizing: border-box; /* webkit */
+ -moz-box-sizing: border-box; /* firefox */
+ box-sizing: border-box; /* css3 */
+}
+
+.select2-container .select2-choice {
+ display: block;
+ height: 26px;
+ padding: 0 0 0 8px;
+ overflow: hidden;
+ position: relative;
+
+ border: 1px solid #aaa;
+ white-space: nowrap;
+ line-height: 26px;
+ color: #444;
+ text-decoration: none;
+
+ border-radius: 4px;
+
+ background-clip: padding-box;
+
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+
+ background-color: #fff;
+ background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.5, #fff));
+ background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 50%);
+ background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 50%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0);
+ background-image: linear-gradient(top, #fff 0%, #eee 50%);
+}
+
+.select2-container.select2-drop-above .select2-choice {
+ border-bottom-color: #aaa;
+
+ border-radius: 0 0 4px 4px;
+
+ background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.9, #fff));
+ background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 90%);
+ background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 90%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0);
+ background-image: linear-gradient(top, #eee 0%, #fff 90%);
+}
+
+.select2-container.select2-allowclear .select2-choice .select2-chosen {
+ margin-right: 42px;
+}
+
+.select2-container .select2-choice > .select2-chosen {
+ margin-right: 26px;
+ display: block;
+ overflow: hidden;
+
+ white-space: nowrap;
+
+ text-overflow: ellipsis;
+}
+
+.select2-container .select2-choice abbr {
+ display: none;
+ width: 12px;
+ height: 12px;
+ position: absolute;
+ right: 24px;
+ top: 8px;
+
+ font-size: 1px;
+ text-decoration: none;
+
+ border: 0;
+ background: url('select2.png') right top no-repeat;
+ cursor: pointer;
+ outline: 0;
+}
+
+.select2-container.select2-allowclear .select2-choice abbr {
+ display: inline-block;
+}
+
+.select2-container .select2-choice abbr:hover {
+ background-position: right -11px;
+ cursor: pointer;
+}
+
+.select2-drop-mask {
+ border: 0;
+ margin: 0;
+ padding: 0;
+ position: fixed;
+ left: 0;
+ top: 0;
+ min-height: 100%;
+ min-width: 100%;
+ height: auto;
+ width: auto;
+ opacity: 0;
+ z-index: 9998;
+ /* styles required for IE to work */
+ background-color: #fff;
+ filter: alpha(opacity=0);
+}
+
+.select2-drop {
+ width: 100%;
+ margin-top: -1px;
+ position: absolute;
+ z-index: 9999;
+ top: 100%;
+
+ background: #fff;
+ color: #000;
+ border: 1px solid #aaa;
+ border-top: 0;
+
+ border-radius: 0 0 4px 4px;
+
+ -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
+ box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
+}
+
+.select2-drop-auto-width {
+ border-top: 1px solid #aaa;
+ width: auto;
+}
+
+.select2-drop-auto-width .select2-search {
+ padding-top: 4px;
+}
+
+.select2-drop.select2-drop-above {
+ margin-top: 1px;
+ border-top: 1px solid #aaa;
+ border-bottom: 0;
+
+ border-radius: 4px 4px 0 0;
+
+ -webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
+ box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
+}
+
+.select2-drop-active {
+ border: 1px solid #5897fb;
+ border-top: none;
+}
+
+.select2-drop.select2-drop-above.select2-drop-active {
+ border-top: 1px solid #5897fb;
+}
+
+.select2-container .select2-choice .select2-arrow {
+ display: inline-block;
+ width: 18px;
+ height: 100%;
+ position: absolute;
+ right: 0;
+ top: 0;
+
+ border-left: 1px solid #aaa;
+ border-radius: 0 4px 4px 0;
+
+ background-clip: padding-box;
+
+ background: #ccc;
+ background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
+ background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
+ background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0);
+ background-image: linear-gradient(top, #ccc 0%, #eee 60%);
+}
+
+.select2-container .select2-choice .select2-arrow b {
+ display: block;
+ width: 100%;
+ height: 100%;
+ background: url('select2.png') no-repeat 0 1px;
+}
+
+.select2-search {
+ display: inline-block;
+ width: 100%;
+ min-height: 26px;
+ margin: 0;
+ padding-left: 4px;
+ padding-right: 4px;
+
+ position: relative;
+ z-index: 10000;
+
+ white-space: nowrap;
+}
+
+.select2-search input {
+ width: 100%;
+ height: auto !important;
+ min-height: 26px;
+ padding: 4px 20px 4px 5px;
+ margin: 0;
+
+ outline: 0;
+ font-family: sans-serif;
+ font-size: 1em;
+
+ border: 1px solid #aaa;
+ border-radius: 0;
+
+ -webkit-box-shadow: none;
+ box-shadow: none;
+
+ background: #fff url('select2.png') no-repeat 100% -22px;
+ background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
+ background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
+ background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
+ background: url('select2.png') no-repeat 100% -22px, linear-gradient(top, #fff 85%, #eee 99%);
+}
+
+.select2-drop.select2-drop-above .select2-search input {
+ margin-top: 4px;
+}
+
+.select2-search input.select2-active {
+ background: #fff url('select2-spinner.gif') no-repeat 100%;
+ background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
+ background: url('select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
+ background: url('select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
+ background: url('select2-spinner.gif') no-repeat 100%, linear-gradient(top, #fff 85%, #eee 99%);
+}
+
+.select2-container-active .select2-choice,
+.select2-container-active .select2-choices {
+ border: 1px solid #5897fb;
+ outline: none;
+
+ -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
+ box-shadow: 0 0 5px rgba(0, 0, 0, .3);
+}
+
+.select2-dropdown-open .select2-choice {
+ border-bottom-color: transparent;
+ -webkit-box-shadow: 0 1px 0 #fff inset;
+ box-shadow: 0 1px 0 #fff inset;
+
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0;
+
+ background-color: #eee;
+ background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #fff), color-stop(0.5, #eee));
+ background-image: -webkit-linear-gradient(center bottom, #fff 0%, #eee 50%);
+ background-image: -moz-linear-gradient(center bottom, #fff 0%, #eee 50%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);
+ background-image: linear-gradient(top, #fff 0%, #eee 50%);
+}
+
+.select2-dropdown-open.select2-drop-above .select2-choice,
+.select2-dropdown-open.select2-drop-above .select2-choices {
+ border: 1px solid #5897fb;
+ border-top-color: transparent;
+
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(0.5, #eee));
+ background-image: -webkit-linear-gradient(center top, #fff 0%, #eee 50%);
+ background-image: -moz-linear-gradient(center top, #fff 0%, #eee 50%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);
+ background-image: linear-gradient(bottom, #fff 0%, #eee 50%);
+}
+
+.select2-dropdown-open .select2-choice .select2-arrow {
+ background: transparent;
+ border-left: none;
+ filter: none;
+}
+.select2-dropdown-open .select2-choice .select2-arrow b {
+ background-position: -18px 1px;
+}
+
+/* results */
+.select2-results {
+ max-height: 200px;
+ padding: 0 0 0 4px;
+ margin: 4px 4px 4px 0;
+ position: relative;
+ overflow-x: hidden;
+ overflow-y: auto;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+
+.select2-results ul.select2-result-sub {
+ margin: 0;
+ padding-left: 0;
+}
+
+.select2-results ul.select2-result-sub > li .select2-result-label { padding-left: 20px }
+.select2-results ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 40px }
+.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 60px }
+.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 80px }
+.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 100px }
+.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 110px }
+.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 120px }
+
+.select2-results li {
+ list-style: none;
+ display: list-item;
+ background-image: none;
+}
+
+.select2-results li.select2-result-with-children > .select2-result-label {
+ font-weight: bold;
+}
+
+.select2-results .select2-result-label {
+ padding: 3px 7px 4px;
+ margin: 0;
+ cursor: pointer;
+
+ min-height: 1em;
+
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.select2-results .select2-highlighted {
+ background: #3875d7;
+ color: #fff;
+}
+
+.select2-results li em {
+ background: #feffde;
+ font-style: normal;
+}
+
+.select2-results .select2-highlighted em {
+ background: transparent;
+}
+
+.select2-results .select2-highlighted ul {
+ background: #fff;
+ color: #000;
+}
+
+
+.select2-results .select2-no-results,
+.select2-results .select2-searching,
+.select2-results .select2-selection-limit {
+ background: #f4f4f4;
+ display: list-item;
+}
+
+/*
+disabled look for disabled choices in the results dropdown
+*/
+.select2-results .select2-disabled.select2-highlighted {
+ color: #666;
+ background: #f4f4f4;
+ display: list-item;
+ cursor: default;
+}
+.select2-results .select2-disabled {
+ background: #f4f4f4;
+ display: list-item;
+ cursor: default;
+}
+
+.select2-results .select2-selected {
+ display: none;
+}
+
+.select2-more-results.select2-active {
+ background: #f4f4f4 url('select2-spinner.gif') no-repeat 100%;
+}
+
+.select2-more-results {
+ background: #f4f4f4;
+ display: list-item;
+}
+
+/* disabled styles */
+
+.select2-container.select2-container-disabled .select2-choice {
+ background-color: #f4f4f4;
+ background-image: none;
+ border: 1px solid #ddd;
+ cursor: default;
+}
+
+.select2-container.select2-container-disabled .select2-choice .select2-arrow {
+ background-color: #f4f4f4;
+ background-image: none;
+ border-left: 0;
+}
+
+.select2-container.select2-container-disabled .select2-choice abbr {
+ display: none;
+}
+
+
+/* multiselect */
+
+.select2-container-multi .select2-choices {
+ height: auto !important;
+ height: 1%;
+ margin: 0;
+ padding: 0;
+ position: relative;
+
+ border: 1px solid #aaa;
+ cursor: text;
+ overflow: hidden;
+
+ background-color: #fff;
+ background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eee), color-stop(15%, #fff));
+ background-image: -webkit-linear-gradient(top, #eee 1%, #fff 15%);
+ background-image: -moz-linear-gradient(top, #eee 1%, #fff 15%);
+ background-image: linear-gradient(top, #eee 1%, #fff 15%);
+}
+
+.select2-locked {
+ padding: 3px 5px 3px 5px !important;
+}
+
+.select2-container-multi .select2-choices {
+ min-height: 26px;
+}
+
+.select2-container-multi.select2-container-active .select2-choices {
+ border: 1px solid #5897fb;
+ outline: none;
+
+ -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
+ box-shadow: 0 0 5px rgba(0, 0, 0, .3);
+}
+.select2-container-multi .select2-choices li {
+ float: left;
+ list-style: none;
+}
+.select2-container-multi .select2-choices .select2-search-field {
+ margin: 0;
+ padding: 0;
+ white-space: nowrap;
+}
+
+.select2-container-multi .select2-choices .select2-search-field input {
+ padding: 5px;
+ margin: 1px 0;
+
+ font-family: sans-serif;
+ font-size: 100%;
+ color: #666;
+ outline: 0;
+ border: 0;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ background: transparent !important;
+}
+
+.select2-container-multi .select2-choices .select2-search-field input.select2-active {
+ background: #fff url('select2-spinner.gif') no-repeat 100% !important;
+}
+
+.select2-default {
+ color: #999 !important;
+}
+
+.select2-container-multi .select2-choices .select2-search-choice {
+ padding: 3px 5px 3px 18px;
+ margin: 3px 0 3px 5px;
+ position: relative;
+
+ line-height: 13px;
+ color: #333;
+ cursor: default;
+ border: 1px solid #aaaaaa;
+
+ border-radius: 3px;
+
+ -webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
+ box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
+
+ background-clip: padding-box;
+
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+
+ background-color: #e4e4e4;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0);
+ background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eee));
+ background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
+ background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
+ background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
+}
+.select2-container-multi .select2-choices .select2-search-choice .select2-chosen {
+ cursor: default;
+}
+.select2-container-multi .select2-choices .select2-search-choice-focus {
+ background: #d4d4d4;
+}
+
+.select2-search-choice-close {
+ display: block;
+ width: 12px;
+ height: 13px;
+ position: absolute;
+ right: 3px;
+ top: 4px;
+
+ font-size: 1px;
+ outline: none;
+ background: url('select2.png') right top no-repeat;
+}
+
+.select2-container-multi .select2-search-choice-close {
+ left: 3px;
+}
+
+.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
+ background-position: right -11px;
+}
+.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
+ background-position: right -11px;
+}
+
+/* disabled styles */
+.select2-container-multi.select2-container-disabled .select2-choices {
+ background-color: #f4f4f4;
+ background-image: none;
+ border: 1px solid #ddd;
+ cursor: default;
+}
+
+.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
+ padding: 3px 5px 3px 5px;
+ border: 1px solid #ddd;
+ background-image: none;
+ background-color: #f4f4f4;
+}
+
+.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close { display: none;
+ background: none;
+}
+/* end multiselect */
+
+
+.select2-result-selectable .select2-match,
+.select2-result-unselectable .select2-match {
+ text-decoration: underline;
+}
+
+.select2-offscreen, .select2-offscreen:focus {
+ clip: rect(0 0 0 0) !important;
+ width: 1px !important;
+ height: 1px !important;
+ border: 0 !important;
+ margin: 0 !important;
+ padding: 0 !important;
+ overflow: hidden !important;
+ position: absolute !important;
+ outline: 0 !important;
+ left: 0px !important;
+ top: 0px !important;
+}
+
+.select2-display-none {
+ display: none;
+}
+
+.select2-measure-scrollbar {
+ position: absolute;
+ top: -10000px;
+ left: -10000px;
+ width: 100px;
+ height: 100px;
+ overflow: scroll;
+}
+/* Retina-ize icons */
+
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi) {
+ .select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice .select2-arrow b {
+ background-image: url('select2x2.png') !important;
+ background-repeat: no-repeat !important;
+ background-size: 60px 40px !important;
+ }
+ .select2-search input {
+ background-position: 100% -21px !important;
+ }
+}
Added: trunk/faxtomail-ui-web/src/main/webapp/css/select2/select2.png
===================================================================
(Binary files differ)
Property changes on: trunk/faxtomail-ui-web/src/main/webapp/css/select2/select2.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/faxtomail-ui-web/src/main/webapp/css/select2/select2x2.png
===================================================================
(Binary files differ)
Property changes on: trunk/faxtomail-ui-web/src/main/webapp/css/select2/select2x2.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/faxtomail-ui-web/src/main/webapp/js/jquery.ui.touch.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/jquery.ui.touch.js (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/jquery.ui.touch.js 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,192 @@
+/**
+* jQuery.UI.iPad plugin
+* Copyright (c) 2010 Stephen von Takach
+* licensed under MIT.
+* Date: 27/8/2010
+*
+* Project Home:
+* http://code.google.com/p/jquery-ui-for-ipad-and-iphone/
+*
+* Modified: 19/01/2012
+* Organized as a proper plugin and added addTouch()
+*/
+(function ($) {
+ var lastTap = null, // Holds last tapped element (so we can compare for double tap)
+ tapValid = false, // Are we still in the .6 second window where a double tap can occur
+ tapTimeout = null, // The timeout reference
+ rightClickPending = false, // Is a right click still feasible
+ rightClickEvent = null, // the original event
+ holdTimeout = null, // timeout reference
+ cancelMouseUp = false, // prevents a click from occurring as we want the context menu
+ currentDOMElement = null; // the last DOM element that was seen during a drag.
+
+ function cancelTap() {
+ tapValid = false;
+ }
+
+ function cancelHold() {
+ if (rightClickPending) {
+ window.clearTimeout(holdTimeout);
+ rightClickPending = false;
+ rightClickEvent = null;
+ }
+ }
+
+ function startHold(event) {
+ if (rightClickPending) {
+ return;
+ }
+ rightClickPending = true; // We could be performing a right click
+ rightClickEvent = (event.changedTouches)[0];
+ holdTimeout = window.setTimeout(doRightClick, 800);
+ }
+
+ function doRightClick() {
+ rightClickPending = false;
+ // We need to mouse up (as we were down)
+ var first = rightClickEvent,
+ simulatedEvent = document.createEvent("MouseEvent");
+ simulatedEvent.initMouseEvent("mouseup", true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0, null);
+ first.target.dispatchEvent(simulatedEvent);
+
+ // Emulate a right click
+ simulatedEvent = document.createEvent("MouseEvent");
+ simulatedEvent.initMouseEvent("mousedown", true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 2, null);
+ first.target.dispatchEvent(simulatedEvent);
+
+ // Show a context menu
+ simulatedEvent = document.createEvent("MouseEvent");
+ simulatedEvent.initMouseEvent("contextmenu", true, true, window, 1, first.screenX + 50, first.screenY + 5, first.clientX + 50, first.clientY + 5, false, false, false, false, 2, null);
+ first.target.dispatchEvent(simulatedEvent);
+
+ simulatedEvent = document.createEvent("MouseEvent");
+ simulatedEvent.initMouseEvent("mouseup", true, true, window, 1, first.screenX + 50, first.screenY + 5, first.clientX + 50, first.clientY + 5, false, false, false, false, 2, null);
+ first.target.dispatchEvent(simulatedEvent);
+
+ cancelMouseUp = true;
+ rightClickEvent = null; // Release memory
+ }
+
+
+ // mouse over event then mouse down
+ function iPadTouchStart(event) {
+ var touches = event.changedTouches,
+ first = touches[0],
+ type = "mouseover",
+ simulatedEvent = document.createEvent("MouseEvent");
+
+ // Mouse over first - I have live events attached on mouse over
+ simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0, null);
+ first.target.dispatchEvent(simulatedEvent);
+
+ type = "mousedown";
+ simulatedEvent = document.createEvent("MouseEvent");
+
+ simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0, null);
+ first.target.dispatchEvent(simulatedEvent);
+
+ if (!tapValid) {
+ lastTap = first.target;
+ tapValid = true;
+ tapTimeout = window.setTimeout(cancelTap, 600);
+ startHold(event);
+ } else {
+ window.clearTimeout(tapTimeout);
+ // If a double tap is still a possibility and the elements are the same then perform a double click
+ if (first.target == lastTap) {
+ lastTap = null;
+ tapValid = false;
+
+ type = "click";
+ simulatedEvent = document.createEvent("MouseEvent");
+
+ simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0, null);
+ first.target.dispatchEvent(simulatedEvent);
+
+ type = "dblclick";
+ simulatedEvent = document.createEvent("MouseEvent");
+
+ simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0, null);
+ first.target.dispatchEvent(simulatedEvent);
+ } else {
+ lastTap = first.target;
+ tapValid = true;
+ tapTimeout = window.setTimeout(cancelTap, 600);
+ startHold(event);
+ }
+ }
+ }
+
+ function getDOMElementFromEvent(event) {
+ if (event.targetTouches && event.targetTouches[0]) {
+ return document.elementFromPoint(event.targetTouches[0].pageX - window.pageXOffset, event.targetTouches[0].pageY - window.pageYOffset);
+ }
+ return null;
+ }
+
+ function iPadTouchHandler(event) {
+ var type = "",
+ button = 0; /*left*/
+ if (event.touches.length > 1) {
+ return;
+ }
+ switch (event.type) {
+ case "touchstart":
+ if ($(event.changedTouches[0].target).is("select")) {
+ return;
+ }
+ iPadTouchStart(event); /*We need to trigger two events here to support one touch drag and drop*/
+ event.preventDefault();
+ currentDOMElement = getDOMElementFromEvent(event);
+ return false;
+
+ case "touchmove":
+ cancelHold();
+ type = "mousemove";
+ event.preventDefault();
+
+ currentDOMElement = getDOMElementFromEvent(event);
+ break;
+
+ case "touchend":
+ if (cancelMouseUp) {
+ cancelMouseUp = false;
+ event.preventDefault();
+ return false;
+ }
+ cancelHold();
+ type = "mouseup";
+ break;
+
+ default:
+ return;
+ }
+ var touches = event.changedTouches,
+ first = touches[0],
+ simulatedEvent = document.createEvent("MouseEvent");
+ simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,false, false, false, false, button, null);
+ currentDOMElement.dispatchEvent(simulatedEvent);
+ if (type == "mouseup" && tapValid && first.target == lastTap) { // This actually emulates the ipad's default behavior (which we prevented)
+ simulatedEvent = document.createEvent("MouseEvent"); // This check avoids click being emulated on a double tap
+ simulatedEvent.initMouseEvent("click", true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,false, false, false, false, button, null);
+ currentDOMElement.dispatchEvent(simulatedEvent);
+ }
+ }
+
+ $.extend($.support, {
+ touch: "ontouchend" in document
+ });
+
+ $.fn.addTouch = function () {
+ if ($.support.touch) {
+ this.each(function (i, el) {
+ el.addEventListener("touchstart", iPadTouchHandler, false);
+ el.addEventListener("touchmove", iPadTouchHandler, false);
+ el.addEventListener("touchend", iPadTouchHandler, false);
+ el.addEventListener("touchcancel", iPadTouchHandler, false);
+ });
+ }
+ return this;
+ };
+
+})(jQuery);
\ No newline at end of file
Added: trunk/faxtomail-ui-web/src/main/webapp/js/jstree/jstree.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/jstree/jstree.js (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/jstree/jstree.js 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,5933 @@
+/*globals jQuery, define, exports, require, window, document */
+(function (factory) {
+ "use strict";
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ }
+ else if(typeof exports === 'object') {
+ factory(require('jquery'));
+ }
+ else {
+ factory(jQuery);
+ }
+}(function ($, undefined) {
+ "use strict";
+/*!
+ * jsTree 3.0.0
+ * http://jstree.com/
+ *
+ * Copyright (c) 2013 Ivan Bozhanov (http://vakata.com)
+ *
+ * Licensed same as jquery - under the terms of the MIT License
+ * http://www.opensource.org/licenses/mit-license.php
+ */
+/*!
+ * if using jslint please allow for the jQuery global and use following options:
+ * jslint: browser: true, ass: true, bitwise: true, continue: true, nomen: true, plusplus: true, regexp: true, unparam: true, todo: true, white: true
+ */
+
+ // prevent another load? maybe there is a better way?
+ if($.jstree) {
+ return;
+ }
+
+ /**
+ * ### jsTree core functionality
+ */
+
+ // internal variables
+ var instance_counter = 0,
+ total_nodes = 0,
+ ccp_node = false,
+ ccp_mode = false,
+ ccp_inst = false,
+ themes_loaded = [],
+ src = $('script:last').attr('src'),
+ _d = document, _node = _d.createElement('LI'), _temp1, _temp2;
+
+ _node.setAttribute('role', 'treeitem');
+ _temp1 = _d.createElement('I');
+ _temp1.className = 'jstree-icon jstree-ocl';
+ _node.appendChild(_temp1);
+ _temp1 = _d.createElement('A');
+ _temp1.className = 'jstree-anchor';
+ _temp1.setAttribute('href','#');
+ _temp2 = _d.createElement('I');
+ _temp2.className = 'jstree-icon jstree-themeicon';
+ _temp1.appendChild(_temp2);
+ _node.appendChild(_temp1);
+ _temp1 = _temp2 = null;
+
+
+ /**
+ * holds all jstree related functions and variables, including the actual class and methods to create, access and manipulate instances.
+ * @name $.jstree
+ */
+ $.jstree = {
+ /**
+ * specifies the jstree version in use
+ * @name $.jstree.version
+ */
+ version : '3.0.0-beta5',
+ /**
+ * holds all the default options used when creating new instances
+ * @name $.jstree.defaults
+ */
+ defaults : {
+ /**
+ * configure which plugins will be active on an instance. Should be an array of strings, where each element is a plugin name. The default is `[]`
+ * @name $.jstree.defaults.plugins
+ */
+ plugins : []
+ },
+ /**
+ * stores all loaded jstree plugins (used internally)
+ * @name $.jstree.plugins
+ */
+ plugins : {},
+ path : src && src.indexOf('/') !== -1 ? src.replace(/\/[^\/]+$/,'') : ''
+ };
+ /**
+ * creates a jstree instance
+ * @name $.jstree.create(el [, options])
+ * @param {DOMElement|jQuery|String} el the element to create the instance on, can be jQuery extended or a selector
+ * @param {Object} options options for this instance (extends `$.jstree.defaults`)
+ * @return {jsTree} the new instance
+ */
+ $.jstree.create = function (el, options) {
+ var tmp = new $.jstree.core(++instance_counter),
+ opt = options;
+ options = $.extend(true, {}, $.jstree.defaults, options);
+ if(opt && opt.plugins) {
+ options.plugins = opt.plugins;
+ }
+ $.each(options.plugins, function (i, k) {
+ if(i !== 'core') {
+ tmp = tmp.plugin(k, options[k]);
+ }
+ });
+ tmp.init(el, options);
+ return tmp;
+ };
+ /**
+ * the jstree class constructor, used only internally
+ * @private
+ * @name $.jstree.core(id)
+ * @param {Number} id this instance's index
+ */
+ $.jstree.core = function (id) {
+ this._id = id;
+ this._data = {
+ core : {
+ themes : {
+ name : false,
+ dots : false,
+ icons : false
+ },
+ selected : []
+ }
+ };
+ };
+ /**
+ * get a reference to an existing instance
+ *
+ * __Examples__
+ *
+ * // provided a container with an ID of "tree", and a nested node with an ID of "branch"
+ * // all of there will return the same instance
+ * $.jstree.reference('tree');
+ * $.jstree.reference('#tree');
+ * $.jstree.reference($('#tree'));
+ * $.jstree.reference(document.getElementByID('tree'));
+ * $.jstree.reference('branch');
+ * $.jstree.reference('#branch');
+ * $.jstree.reference($('#branch'));
+ * $.jstree.reference(document.getElementByID('branch'));
+ *
+ * @name $.jstree.reference(needle)
+ * @param {DOMElement|jQuery|String} needle
+ * @return {jsTree|null} the instance or `null` if not found
+ */
+ $.jstree.reference = function (needle) {
+ if(needle && !$(needle).length) {
+ if(needle.id) {
+ needle = needle.id;
+ }
+ var tmp = null;
+ $('.jstree').each(function () {
+ var inst = $(this).data('jstree');
+ if(inst && inst._model.data[needle]) {
+ tmp = inst;
+ return false;
+ }
+ });
+ return tmp;
+ }
+ return $(needle).closest('.jstree').data('jstree');
+ };
+ /**
+ * Create an instance, get an instance or invoke a command on a instance.
+ *
+ * If there is no instance associated with the current node a new one is created and `arg` is used to extend `$.jstree.defaults` for this new instance. There would be no return value (chaining is not broken).
+ *
+ * If there is an existing instance and `arg` is a string the command specified by `arg` is executed on the instance, with any additional arguments passed to the function. If the function returns a value it will be returned (chaining could break depending on function).
+ *
+ * If there is an existing instance and `arg` is not a string the instance itself is returned (similar to `$.jstree.reference`).
+ *
+ * In any other case - nothing is returned and chaining is not broken.
+ *
+ * __Examples__
+ *
+ * $('#tree1').jstree(); // creates an instance
+ * $('#tree2').jstree({ plugins : [] }); // create an instance with some options
+ * $('#tree1').jstree('open_node', '#branch_1'); // call a method on an existing instance, passing additional arguments
+ * $('#tree2').jstree(); // get an existing instance (or create an instance)
+ * $('#tree2').jstree(true); // get an existing instance (will not create new instance)
+ * $('#branch_1').jstree().select_node('#branch_1'); // get an instance (using a nested element and call a method)
+ *
+ * @name $().jstree([arg])
+ * @param {String|Object} arg
+ * @return {Mixed}
+ */
+ $.fn.jstree = function (arg) {
+ // check for string argument
+ var is_method = (typeof arg === 'string'),
+ args = Array.prototype.slice.call(arguments, 1),
+ result = null;
+ this.each(function () {
+ // get the instance (if there is one) and method (if it exists)
+ var instance = $.jstree.reference(this),
+ method = is_method && instance ? instance[arg] : null;
+ // if calling a method, and method is available - execute on the instance
+ result = is_method && method ?
+ method.apply(instance, args) :
+ null;
+ // if there is no instance and no method is being called - create one
+ if(!instance && !is_method && (arg === undefined || $.isPlainObject(arg))) {
+ $(this).data('jstree', new $.jstree.create(this, arg));
+ }
+ // if there is an instance and no method is called - return the instance
+ if(instance && !is_method) {
+ result = instance;
+ }
+ // if there was a method call which returned a result - break and return the value
+ if(result !== null && result !== undefined) {
+ return false;
+ }
+ });
+ // if there was a method call with a valid return value - return that, otherwise continue the chain
+ return result !== null && result !== undefined ?
+ result : this;
+ };
+ /**
+ * used to find elements containing an instance
+ *
+ * __Examples__
+ *
+ * $('div:jstree').each(function () {
+ * $(this).jstree('destroy');
+ * });
+ *
+ * @name $(':jstree')
+ * @return {jQuery}
+ */
+ $.expr[':'].jstree = $.expr.createPseudo(function(search) {
+ return function(a) {
+ return $(a).hasClass('jstree') &&
+ $(a).data('jstree') !== undefined;
+ };
+ });
+
+ /**
+ * stores all defaults for the core
+ * @name $.jstree.defaults.core
+ */
+ $.jstree.defaults.core = {
+ /**
+ * data configuration
+ *
+ * If left as `false` the HTML inside the jstree container element is used to populate the tree (that should be an unordered list with list items).
+ *
+ * You can also pass in a HTML string or a JSON array here.
+ *
+ * It is possible to pass in a standard jQuery-like AJAX config and jstree will automatically determine if the response is JSON or HTML and use that to populate the tree.
+ * In addition to the standard jQuery ajax options here you can suppy functions for `data` and `url`, the functions will be run in the current instance's scope and a param will be passed indicating which node is being loaded, the return value of those functions will be used.
+ *
+ * The last option is to specify a function, that function will receive the node being loaded as argument and a second param which is a function which should be called with the result.
+ *
+ * __Examples__
+ *
+ * // AJAX
+ * $('#tree').jstree({
+ * 'core' : {
+ * 'data' : {
+ * 'url' : '/get/children/',
+ * 'data' : function (node) {
+ * return { 'id' : node.id };
+ * }
+ * }
+ * });
+ *
+ * // direct data
+ * $('#tree').jstree({
+ * 'core' : {
+ * 'data' : [
+ * 'Simple root node',
+ * {
+ * 'id' : 'node_2',
+ * 'text' : 'Root node with options',
+ * 'state' : { 'opened' : true, 'selected' : true },
+ * 'children' : [ { 'text' : 'Child 1' }, 'Child 2']
+ * }
+ * ]
+ * });
+ *
+ * // function
+ * $('#tree').jstree({
+ * 'core' : {
+ * 'data' : function (obj, callback) {
+ * callback.call(this, ['Root 1', 'Root 2']);
+ * }
+ * });
+ *
+ * @name $.jstree.defaults.core.data
+ */
+ data : false,
+ /**
+ * configure the various strings used throughout the tree
+ *
+ * You can use an object where the key is the string you need to replace and the value is your replacement.
+ * Another option is to specify a function which will be called with an argument of the needed string and should return the replacement.
+ * If left as `false` no replacement is made.
+ *
+ * __Examples__
+ *
+ * $('#tree').jstree({
+ * 'core' : {
+ * 'strings' : {
+ * 'Loading...' : 'Please wait ...'
+ * }
+ * }
+ * });
+ *
+ * @name $.jstree.defaults.core.strings
+ */
+ strings : false,
+ /**
+ * determines what happens when a user tries to modify the structure of the tree
+ * If left as `false` all operations like create, rename, delete, move or copy are prevented.
+ * You can set this to `true` to allow all interactions or use a function to have better control.
+ *
+ * __Examples__
+ *
+ * $('#tree').jstree({
+ * 'core' : {
+ * 'check_callback' : function (operation, node, node_parent, node_position) {
+ * // operation can be 'create_node', 'rename_node', 'delete_node', 'move_node' or 'copy_node'
+ * // in case of 'rename_node' node_position is filled with the new node name
+ * return operation === 'rename_node' ? true : false;
+ * }
+ * }
+ * });
+ *
+ * @name $.jstree.defaults.core.check_callback
+ */
+ check_callback : false,
+ /**
+ * the open / close animation duration in milliseconds - set this to `false` to disable the animation (default is `200`)
+ * @name $.jstree.defaults.core.animation
+ */
+ animation : 200,
+ /**
+ * a boolean indicating if multiple nodes can be selected
+ * @name $.jstree.defaults.core.multiple
+ */
+ multiple : true,
+ /**
+ * theme configuration object
+ * @name $.jstree.defaults.core.themes
+ */
+ themes : {
+ /**
+ * the name of the theme to use (if left as `false` the default theme is used)
+ * @name $.jstree.defaults.core.themes.name
+ */
+ name : false,
+ /**
+ * the URL of the theme's CSS file, leave this as `false` if you have manually included the theme CSS (recommended). You can set this to `true` too which will try to autoload the theme.
+ * @name $.jstree.defaults.core.themes.url
+ */
+ url : false,
+ /**
+ * the location of all jstree themes - only used if `url` is set to `true`
+ * @name $.jstree.defaults.core.themes.dir
+ */
+ dir : false,
+ /**
+ * a boolean indicating if connecting dots are shown
+ * @name $.jstree.defaults.core.themes.dots
+ */
+ dots : true,
+ /**
+ * a boolean indicating if node icons are shown
+ * @name $.jstree.defaults.core.themes.icons
+ */
+ icons : true,
+ /**
+ * a boolean indicating if the tree background is striped
+ * @name $.jstree.defaults.core.themes.stripes
+ */
+ stripes : false,
+ /**
+ * a string (or boolean `false`) specifying the theme variant to use (if the theme supports variants)
+ * @name $.jstree.defaults.core.themes.variant
+ */
+ variant : false,
+ /**
+ * a boolean specifying if a reponsive version of the theme should kick in on smaller screens (if the theme supports it). Defaults to `true`.
+ * @name $.jstree.defaults.core.themes.responsive
+ */
+ responsive : true
+ },
+ /**
+ * if left as `true` all parents of all selected nodes will be opened once the tree loads (so that all selected nodes are visible to the user)
+ * @name $.jstree.defaults.core.expand_selected_onload
+ */
+ expand_selected_onload : true
+ };
+ $.jstree.core.prototype = {
+ /**
+ * used to decorate an instance with a plugin. Used internally.
+ * @private
+ * @name plugin(deco [, opts])
+ * @param {String} deco the plugin to decorate with
+ * @param {Object} opts options for the plugin
+ * @return {jsTree}
+ */
+ plugin : function (deco, opts) {
+ var Child = $.jstree.plugins[deco];
+ if(Child) {
+ this._data[deco] = {};
+ Child.prototype = this;
+ return new Child(opts, this);
+ }
+ return this;
+ },
+ /**
+ * used to decorate an instance with a plugin. Used internally.
+ * @private
+ * @name init(el, optons)
+ * @param {DOMElement|jQuery|String} el the element we are transforming
+ * @param {Object} options options for this instance
+ * @trigger init.jstree, loading.jstree, loaded.jstree, ready.jstree, changed.jstree
+ */
+ init : function (el, options) {
+ this._model = {
+ data : {
+ '#' : {
+ id : '#',
+ parent : null,
+ parents : [],
+ children : [],
+ children_d : [],
+ state : { loaded : false }
+ }
+ },
+ changed : [],
+ force_full_redraw : false,
+ redraw_timeout : false,
+ default_state : {
+ loaded : true,
+ opened : false,
+ selected : false,
+ disabled : false
+ }
+ };
+
+ this.element = $(el).addClass('jstree jstree-' + this._id);
+ this.settings = options;
+ this.element.bind("destroyed", $.proxy(this.teardown, this));
+
+ this._data.core.ready = false;
+ this._data.core.loaded = false;
+ this._data.core.rtl = (this.element.css("direction") === "rtl");
+ this.element[this._data.core.rtl ? 'addClass' : 'removeClass']("jstree-rtl");
+ this.element.attr('role','tree');
+
+ this.bind();
+ /**
+ * triggered after all events are bound
+ * @event
+ * @name init.jstree
+ */
+ this.trigger("init");
+
+ this._data.core.original_container_html = this.element.find(" > ul > li").clone(true);
+ this._data.core.original_container_html
+ .find("li").addBack()
+ .contents().filter(function() {
+ return this.nodeType === 3 && (!this.nodeValue || /^\s+$/.test(this.nodeValue));
+ })
+ .remove();
+ this.element.html("<"+"ul class='jstree-container-ul'><"+"li class='jstree-initial-node jstree-loading jstree-leaf jstree-last'><i class='jstree-icon jstree-ocl'></i><"+"a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'></i>" + this.get_string("Loading ...") + "</a></li></ul>");
+ this._data.core.li_height = this.get_container_ul().children("li:eq(0)").height() || 18;
+ /**
+ * triggered after the loading text is shown and before loading starts
+ * @event
+ * @name loading.jstree
+ */
+ this.trigger("loading");
+ this.load_node('#');
+ },
+ /**
+ * destroy an instance
+ * @name destroy()
+ */
+ destroy : function () {
+ this.element.unbind("destroyed", this.teardown);
+ this.teardown();
+ },
+ /**
+ * part of the destroying of an instance. Used internally.
+ * @private
+ * @name teardown()
+ */
+ teardown : function () {
+ this.unbind();
+ this.element
+ .removeClass('jstree')
+ .removeData('jstree')
+ .find("[class^='jstree']")
+ .addBack()
+ .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });
+ this.element = null;
+ },
+ /**
+ * bind all events. Used internally.
+ * @private
+ * @name bind()
+ */
+ bind : function () {
+ if($.support.touch) {
+ this.element.addTouch();
+ }
+ this.element
+ .on("dblclick.jstree", function () {
+ if(document.selection && document.selection.empty) {
+ document.selection.empty();
+ }
+ else {
+ if(window.getSelection) {
+ var sel = window.getSelection();
+ try {
+ sel.removeAllRanges();
+ sel.collapse();
+ } catch (ignore) { }
+ }
+ }
+ })
+ .on("click.jstree", ".jstree-ocl", $.proxy(function (e) {
+ this.toggle_node(e.target);
+ }, this))
+ .on("click.jstree", ".jstree-anchor", $.proxy(function (e) {
+ e.preventDefault();
+ $(e.currentTarget).focus();
+ this.activate_node(e.currentTarget, e);
+ }, this))
+ .on('keydown.jstree', '.jstree-anchor', $.proxy(function (e) {
+ var o = null;
+ switch(e.which) {
+ case 13:
+ case 32:
+ e.type = "click";
+ $(e.currentTarget).trigger(e);
+ break;
+ case 37:
+ e.preventDefault();
+ if(this.is_open(e.currentTarget)) {
+ this.close_node(e.currentTarget);
+ }
+ else {
+ o = this.get_prev_dom(e.currentTarget);
+ if(o && o.length) { o.children('.jstree-anchor').focus(); }
+ }
+ break;
+ case 38:
+ e.preventDefault();
+ o = this.get_prev_dom(e.currentTarget);
+ if(o && o.length) { o.children('.jstree-anchor').focus(); }
+ break;
+ case 39:
+ e.preventDefault();
+ if(this.is_closed(e.currentTarget)) {
+ this.open_node(e.currentTarget, function (o) { this.get_node(o, true).children('.jstree-anchor').focus(); });
+ }
+ else {
+ o = this.get_next_dom(e.currentTarget);
+ if(o && o.length) { o.children('.jstree-anchor').focus(); }
+ }
+ break;
+ case 40:
+ e.preventDefault();
+ o = this.get_next_dom(e.currentTarget);
+ if(o && o.length) { o.children('.jstree-anchor').focus(); }
+ break;
+ // delete
+ case 46:
+ e.preventDefault();
+ o = this.get_node(e.currentTarget);
+ if(o && o.id && o.id !== '#') {
+ o = this.is_selected(o) ? this.get_selected() : o;
+ // this.delete_node(o);
+ }
+ break;
+ // f2
+ case 113:
+ e.preventDefault();
+ o = this.get_node(e.currentTarget);
+ /*!
+ if(o && o.id && o.id !== '#') {
+ // this.edit(o);
+ }
+ */
+ break;
+ default:
+ // console.log(e.which);
+ break;
+ }
+ }, this))
+ .on("load_node.jstree", $.proxy(function (e, data) {
+ if(data.status) {
+ if(data.node.id === '#' && !this._data.core.loaded) {
+ this._data.core.loaded = true;
+ /**
+ * triggered after the root node is loaded for the first time
+ * @event
+ * @name loaded.jstree
+ */
+ this.trigger("loaded");
+ }
+ if(!this._data.core.ready && !this.get_container_ul().find('.jstree-loading:eq(0)').length) {
+ this._data.core.ready = true;
+ if(this._data.core.selected.length) {
+ if(this.settings.core.expand_selected_onload) {
+ var tmp = [], i, j;
+ for(i = 0, j = this._data.core.selected.length; i < j; i++) {
+ tmp = tmp.concat(this._model.data[this._data.core.selected[i]].parents);
+ }
+ tmp = $.vakata.array_unique(tmp);
+ for(i = 0, j = tmp.length; i < j; i++) {
+ this.open_node(tmp[i], false, 0);
+ }
+ }
+ this.trigger('changed', { 'action' : 'ready', 'selected' : this._data.core.selected });
+ }
+ /**
+ * triggered after all nodes are finished loading
+ * @event
+ * @name ready.jstree
+ */
+ this.trigger("ready");
+ }
+ }
+ }, this))
+ // THEME RELATED
+ .on("init.jstree", $.proxy(function () {
+ var s = this.settings.core.themes;
+ this._data.core.themes.dots = s.dots;
+ this._data.core.themes.stripes = s.stripes;
+ this._data.core.themes.icons = s.icons;
+ this.set_theme(s.name || "default", s.url);
+ this.set_theme_variant(s.variant);
+ }, this))
+ .on("loading.jstree", $.proxy(function () {
+ this[ this._data.core.themes.dots ? "show_dots" : "hide_dots" ]();
+ this[ this._data.core.themes.icons ? "show_icons" : "hide_icons" ]();
+ this[ this._data.core.themes.stripes ? "show_stripes" : "hide_stripes" ]();
+ }, this))
+ .on('focus.jstree', '.jstree-anchor', $.proxy(function (e) {
+ this.element.find('.jstree-hovered').not(e.currentTarget).mouseleave();
+ $(e.currentTarget).mouseenter();
+ }, this))
+ .on('mouseenter.jstree', '.jstree-anchor', $.proxy(function (e) {
+ this.hover_node(e.currentTarget);
+ }, this))
+ .on('mouseleave.jstree', '.jstree-anchor', $.proxy(function (e) {
+ this.dehover_node(e.currentTarget);
+ }, this));
+ },
+ /**
+ * part of the destroying of an instance. Used internally.
+ * @private
+ * @name unbind()
+ */
+ unbind : function () {
+ this.element.off('.jstree');
+ $(document).off('.jstree-' + this._id);
+ },
+ /**
+ * trigger an event. Used internally.
+ * @private
+ * @name trigger(ev [, data])
+ * @param {String} ev the name of the event to trigger
+ * @param {Object} data additional data to pass with the event
+ */
+ trigger : function (ev, data) {
+ if(!data) {
+ data = {};
+ }
+ data.instance = this;
+ this.element.triggerHandler(ev.replace('.jstree','') + '.jstree', data);
+ },
+ /**
+ * returns the jQuery extended instance container
+ * @name get_container()
+ * @return {jQuery}
+ */
+ get_container : function () {
+ return this.element;
+ },
+ /**
+ * returns the jQuery extended main UL node inside the instance container. Used internally.
+ * @private
+ * @name get_container_ul()
+ * @return {jQuery}
+ */
+ get_container_ul : function () {
+ return this.element.children("ul:eq(0)");
+ },
+ /**
+ * gets string replacements (localization). Used internally.
+ * @private
+ * @name get_string(key)
+ * @param {String} key
+ * @return {String}
+ */
+ get_string : function (key) {
+ var a = this.settings.core.strings;
+ if($.isFunction(a)) { return a.call(this, key); }
+ if(a && a[key]) { return a[key]; }
+ return key;
+ },
+ /**
+ * gets the first child of a DOM node. Used internally.
+ * @private
+ * @name _firstChild(dom)
+ * @param {DOMElement} dom
+ * @return {DOMElement}
+ */
+ _firstChild : function (dom) {
+ dom = dom ? dom.firstChild : null;
+ while(dom !== null && dom.nodeType !== 1) {
+ dom = dom.nextSibling;
+ }
+ return dom;
+ },
+ /**
+ * gets the next sibling of a DOM node. Used internally.
+ * @private
+ * @name _nextSibling(dom)
+ * @param {DOMElement} dom
+ * @return {DOMElement}
+ */
+ _nextSibling : function (dom) {
+ dom = dom ? dom.nextSibling : null;
+ while(dom !== null && dom.nodeType !== 1) {
+ dom = dom.nextSibling;
+ }
+ return dom;
+ },
+ /**
+ * gets the previous sibling of a DOM node. Used internally.
+ * @private
+ * @name _previousSibling(dom)
+ * @param {DOMElement} dom
+ * @return {DOMElement}
+ */
+ _previousSibling : function (dom) {
+ dom = dom ? dom.previousSibling : null;
+ while(dom !== null && dom.nodeType !== 1) {
+ dom = dom.previousSibling;
+ }
+ return dom;
+ },
+ /**
+ * get the JSON representation of a node (or the actual jQuery extended DOM node) by using any input (child DOM element, ID string, selector, etc)
+ * @name get_node(obj [, as_dom])
+ * @param {mixed} obj
+ * @param {Boolean} as_dom
+ * @return {Object|jQuery}
+ */
+ get_node : function (obj, as_dom) {
+ if(obj && obj.id) {
+ obj = obj.id;
+ }
+ var dom;
+ try {
+ if(this._model.data[obj]) {
+ obj = this._model.data[obj];
+ }
+ else if(((dom = $(obj, this.element)).length || (dom = $('#' + obj, this.element)).length) && this._model.data[dom.closest('li').attr('id')]) {
+ obj = this._model.data[dom.closest('li').attr('id')];
+ }
+ else if((dom = $(obj, this.element)).length && dom.hasClass('jstree')) {
+ obj = this._model.data['#'];
+ }
+ else {
+ return false;
+ }
+
+ if(as_dom) {
+ obj = obj.id === '#' ? this.element : $(document.getElementById(obj.id));
+ }
+ return obj;
+ } catch (ex) { return false; }
+ },
+ /**
+ * get the next visible node that is below the `obj` node. If `strict` is set to `true` only sibling nodes are returned.
+ * @name get_next_dom(obj [, strict])
+ * @param {mixed} obj
+ * @param {Boolean} strict
+ * @return {jQuery}
+ */
+ get_next_dom : function (obj, strict) {
+ var tmp;
+ obj = this.get_node(obj, true);
+ if(obj[0] === this.element[0]) {
+ tmp = this._firstChild(this.get_container_ul()[0]);
+ return tmp ? $(tmp) : false;
+ }
+ if(!obj || !obj.length) {
+ return false;
+ }
+ if(strict) {
+ tmp = this._nextSibling(obj[0]);
+ return tmp ? $(tmp) : false;
+ }
+ if(obj.hasClass("jstree-open")) {
+ tmp = this._firstChild(obj.children('ul')[0]);
+ return tmp ? $(tmp) : false;
+ }
+ if((tmp = this._nextSibling(obj[0])) !== null) {
+ return $(tmp);
+ }
+ return obj.parentsUntil(".jstree","li").next("li").eq(0);
+ },
+ /**
+ * get the previous visible node that is above the `obj` node. If `strict` is set to `true` only sibling nodes are returned.
+ * @name get_prev_dom(obj [, strict])
+ * @param {mixed} obj
+ * @param {Boolean} strict
+ * @return {jQuery}
+ */
+ get_prev_dom : function (obj, strict) {
+ var tmp;
+ obj = this.get_node(obj, true);
+ if(obj[0] === this.element[0]) {
+ tmp = this.get_container_ul()[0].lastChild;
+ return tmp ? $(tmp) : false;
+ }
+ if(!obj || !obj.length) {
+ return false;
+ }
+ if(strict) {
+ tmp = this._previousSibling(obj[0]);
+ return tmp ? $(tmp) : false;
+ }
+ if((tmp = this._previousSibling(obj[0])) !== null) {
+ obj = $(tmp);
+ while(obj.hasClass("jstree-open")) {
+ obj = obj.children("ul:eq(0)").children("li:last");
+ }
+ return obj;
+ }
+ tmp = obj[0].parentNode.parentNode;
+ return tmp && tmp.tagName === 'LI' ? $(tmp) : false;
+ },
+ /**
+ * get the parent ID of a node
+ * @name get_parent(obj)
+ * @param {mixed} obj
+ * @return {String}
+ */
+ get_parent : function (obj) {
+ obj = this.get_node(obj);
+ if(!obj || obj.id === '#') {
+ return false;
+ }
+ return obj.parent;
+ },
+ /**
+ * get a jQuery collection of all the children of a node (node must be rendered)
+ * @name get_children_dom(obj)
+ * @param {mixed} obj
+ * @return {jQuery}
+ */
+ get_children_dom : function (obj) {
+ obj = this.get_node(obj, true);
+ if(obj[0] === this.element[0]) {
+ return this.get_container_ul().children("li");
+ }
+ if(!obj || !obj.length) {
+ return false;
+ }
+ return obj.children("ul").children("li");
+ },
+ /**
+ * checks if a node has children
+ * @name is_parent(obj)
+ * @param {mixed} obj
+ * @return {Boolean}
+ */
+ is_parent : function (obj) {
+ obj = this.get_node(obj);
+ return obj && (obj.state.loaded === false || obj.children.length);
+ },
+ /**
+ * checks if a node is loaded (its children are available)
+ * @name is_loaded(obj)
+ * @param {mixed} obj
+ * @return {Boolean}
+ */
+ is_loaded : function (obj) {
+ obj = this.get_node(obj);
+ return obj && obj.state.loaded;
+ },
+ /**
+ * check if a node is currently loading (fetching children)
+ * @name is_loading(obj)
+ * @param {mixed} obj
+ * @return {Boolean}
+ */
+ is_loading : function (obj) {
+ obj = this.get_node(obj, true);
+ return obj && obj.hasClass("jstree-loading");
+ },
+ /**
+ * check if a node is opened
+ * @name is_open(obj)
+ * @param {mixed} obj
+ * @return {Boolean}
+ */
+ is_open : function (obj) {
+ obj = this.get_node(obj);
+ return obj && obj.state.opened;
+ },
+ /**
+ * check if a node is in a closed state
+ * @name is_closed(obj)
+ * @param {mixed} obj
+ * @return {Boolean}
+ */
+ is_closed : function (obj) {
+ obj = this.get_node(obj);
+ return obj && this.is_parent(obj) && !obj.state.opened;
+ },
+ /**
+ * check if a node has no children
+ * @name is_leaf(obj)
+ * @param {mixed} obj
+ * @return {Boolean}
+ */
+ is_leaf : function (obj) {
+ return !this.is_parent(obj);
+ },
+ /**
+ * loads a node (fetches its children using the `core.data` setting). Multiple nodes can be passed to by using an array.
+ * @name load_node(obj [, callback])
+ * @param {mixed} obj
+ * @param {function} callback a function to be executed once loading is conplete, the function is executed in the instance's scope and receives two arguments - the node and a boolean status
+ * @return {Boolean}
+ * @trigger load_node.jstree
+ */
+ load_node : function (obj, callback) {
+ var t1, t2;
+ if($.isArray(obj)) {
+ obj = obj.slice();
+ for(t1 = 0, t2 = obj.length; t1 < t2; t1++) {
+ this.load_node(obj[t1], callback);
+ }
+ return true;
+ }
+ obj = this.get_node(obj);
+ if(!obj) {
+ callback.call(this, obj, false);
+ return false;
+ }
+ this.get_node(obj, true).addClass("jstree-loading");
+ this._load_node(obj, $.proxy(function (status) {
+ obj.state.loaded = status;
+ this.get_node(obj, true).removeClass("jstree-loading");
+ /**
+ * triggered after a node is loaded
+ * @event
+ * @name load_node.jstree
+ * @param {Object} node the node that was loading
+ * @param {Boolean} status was the node loaded successfully
+ */
+ this.trigger('load_node', { "node" : obj, "status" : status });
+ if(callback) {
+ callback.call(this, obj, status);
+ }
+ }, this));
+ return true;
+ },
+ /**
+ * handles the actual loading of a node. Used only internally.
+ * @private
+ * @name _load_node(obj [, callback])
+ * @param {mixed} obj
+ * @param {function} callback a function to be executed once loading is conplete, the function is executed in the instance's scope and receives one argument - a boolean status
+ * @return {Boolean}
+ */
+ _load_node : function (obj, callback) {
+ var s = this.settings.core.data, t;
+ // use original HTML
+ if(!s) {
+ return callback.call(this, obj.id === '#' ? this._append_html_data(obj, this._data.core.original_container_html.clone(true)) : false);
+ }
+ if($.isFunction(s)) {
+ return s.call(this, obj, $.proxy(function (d) {
+ return callback.call(this, this[typeof d === 'string' ? '_append_html_data' : '_append_json_data'](obj, typeof d === 'string' ? $(d) : d));
+ }, this));
+ }
+ if(typeof s === 'object') {
+ if(s.url) {
+ s = $.extend(true, {}, s);
+ if($.isFunction(s.url)) {
+ s.url = s.url.call(this, obj);
+ }
+ if($.isFunction(s.data)) {
+ s.data = s.data.call(this, obj);
+ }
+ return $.ajax(s)
+ .done($.proxy(function (d,t,x) {
+ var type = x.getResponseHeader('Content-Type');
+ if(type.indexOf('json') !== -1) {
+ return callback.call(this, this._append_json_data(obj, d));
+ }
+ if(type.indexOf('html') !== -1) {
+ return callback.call(this, this._append_html_data(obj, $(d)));
+ }
+ }, this))
+ .fail($.proxy(function () {
+ callback.call(this, false);
+ }, this));
+ }
+ t = ($.isArray(s) || $.isPlainObject(s)) ? $.vakata.json.decode($.vakata.json.encode(s)) : s;
+ return callback.call(this, this._append_json_data(obj, t));
+ }
+ if(typeof s === 'string') {
+ return callback.call(this, this._append_html_data(obj, s));
+ }
+ return callback.call(this, false);
+ },
+ /**
+ * adds a node to the list of nodes to redraw. Used only internally.
+ * @private
+ * @name _node_changed(obj [, callback])
+ * @param {mixed} obj
+ */
+ _node_changed : function (obj) {
+ obj = this.get_node(obj);
+ if(obj) {
+ this._model.changed.push(obj.id);
+ }
+ },
+ /**
+ * appends HTML content to the tree. Used internally.
+ * @private
+ * @name _append_html_data(obj, data)
+ * @param {mixed} obj the node to append to
+ * @param {String} data the HTML string to parse and append
+ * @return {Boolean}
+ * @trigger model.jstree, changed.jstree
+ */
+ _append_html_data : function (dom, data) {
+ dom = this.get_node(dom);
+ dom.children = [];
+ dom.children_d = [];
+ var dat = data.is('ul') ? data.children() : data,
+ par = dom.id,
+ chd = [],
+ dpc = [],
+ m = this._model.data,
+ p = m[par],
+ s = this._data.core.selected.length,
+ tmp, i, j;
+ dat.each($.proxy(function (i, v) {
+ tmp = this._parse_model_from_html($(v), par, p.parents.concat());
+ if(tmp) {
+ chd.push(tmp);
+ dpc.push(tmp);
+ if(m[tmp].children_d.length) {
+ dpc = dpc.concat(m[tmp].children_d);
+ }
+ }
+ }, this));
+ p.children = chd;
+ p.children_d = dpc;
+ for(i = 0, j = p.parents.length; i < j; i++) {
+ m[p.parents[i]].children_d = m[p.parents[i]].children_d.concat(dpc);
+ }
+ /**
+ * triggered when new data is inserted to the tree model
+ * @event
+ * @name model.jstree
+ * @param {Array} nodes an array of node IDs
+ * @param {String} parent the parent ID of the nodes
+ */
+ this.trigger('model', { "nodes" : dpc, 'parent' : par });
+ if(par !== '#') {
+ this._node_changed(par);
+ this.redraw();
+ }
+ else {
+ this.get_container_ul().children('.jstree-initial-node').remove();
+ this.redraw(true);
+ }
+ if(this._data.core.selected.length !== s) {
+ this.trigger('changed', { 'action' : 'model', 'selected' : this._data.core.selected });
+ }
+ return true;
+ },
+ /**
+ * appends JSON content to the tree. Used internally.
+ * @private
+ * @name _append_json_data(obj, data)
+ * @param {mixed} obj the node to append to
+ * @param {String} data the JSON object to parse and append
+ * @return {Boolean}
+ */
+ _append_json_data : function (dom, data) {
+ dom = this.get_node(dom);
+ dom.children = [];
+ dom.children_d = [];
+ var dat = data,
+ par = dom.id,
+ chd = [],
+ dpc = [],
+ m = this._model.data,
+ p = m[par],
+ s = this._data.core.selected.length,
+ tmp, i, j;
+ // *%$@!!!
+ if(dat.d) {
+ dat = dat.d;
+ if(typeof dat === "string") {
+ dat = $.vakata.json.decode(dat);
+ }
+ }
+ if(!$.isArray(dat)) { dat = [dat]; }
+ if(dat.length && dat[0].id !== undefined && dat[0].parent !== undefined) {
+ // Flat JSON support (for easy import from DB):
+ // 1) convert to object (foreach)
+ for(i = 0, j = dat.length; i < j; i++) {
+ if(!dat[i].children) {
+ dat[i].children = [];
+ }
+ m[dat[i].id] = dat[i];
+ }
+ // 2) populate children (foreach)
+ for(i = 0, j = dat.length; i < j; i++) {
+ m[dat[i].parent].children.push(dat[i].id);
+ // populate parent.children_d
+ p.children_d.push(dat[i].id);
+ }
+ // 3) normalize && populate parents and children_d with recursion
+ for(i = 0, j = p.children.length; i < j; i++) {
+ tmp = this._parse_model_from_flat_json(m[p.children[i]], par, p.parents.concat());
+ dpc.push(tmp);
+ if(m[tmp].children_d.length) {
+ dpc = dpc.concat(m[tmp].children_d);
+ }
+ }
+ // ?) three_state selection - p.state.selected && t - (if three_state foreach(dat => ch) -> foreach(parents) if(parent.selected) child.selected = true;
+ }
+ else {
+ for(i = 0, j = dat.length; i < j; i++) {
+ tmp = this._parse_model_from_json(dat[i], par, p.parents.concat());
+ if(tmp) {
+ chd.push(tmp);
+ dpc.push(tmp);
+ if(m[tmp].children_d.length) {
+ dpc = dpc.concat(m[tmp].children_d);
+ }
+ }
+ }
+ p.children = chd;
+ p.children_d = dpc;
+ for(i = 0, j = p.parents.length; i < j; i++) {
+ m[p.parents[i]].children_d = m[p.parents[i]].children_d.concat(dpc);
+ }
+ }
+ this.trigger('model', { "nodes" : dpc, 'parent' : par });
+
+ if(par !== '#') {
+ this._node_changed(par);
+ this.redraw();
+ }
+ else {
+ // this.get_container_ul().children('.jstree-initial-node').remove();
+ this.redraw(true);
+ }
+ if(this._data.core.selected.length !== s) {
+ this.trigger('changed', { 'action' : 'model', 'selected' : this._data.core.selected });
+ }
+ return true;
+ },
+ /**
+ * parses a node from a jQuery object and appends them to the in memory tree model. Used internally.
+ * @private
+ * @name _parse_model_from_html(d [, p, ps])
+ * @param {jQuery} d the jQuery object to parse
+ * @param {String} p the parent ID
+ * @param {Array} ps list of all parents
+ * @return {String} the ID of the object added to the model
+ */
+ _parse_model_from_html : function (d, p, ps) {
+ if(!ps) { ps = []; }
+ else { ps = [].concat(ps); }
+ if(p) { ps.unshift(p); }
+ var c, e, m = this._model.data,
+ data = {
+ id : false,
+ text : false,
+ icon : true,
+ parent : p,
+ parents : ps,
+ children : [],
+ children_d : [],
+ data : null,
+ state : { },
+ li_attr : { id : false },
+ a_attr : { href : '#' },
+ original : false
+ }, i, tmp, tid;
+ for(i in this._model.default_state) {
+ if(this._model.default_state.hasOwnProperty(i)) {
+ data.state[i] = this._model.default_state[i];
+ }
+ }
+ tmp = $.vakata.attributes(d, true);
+ $.each(tmp, function (i, v) {
+ v = $.trim(v);
+ if(!v.length) { return true; }
+ data.li_attr[i] = v;
+ if(i === 'id') {
+ data.id = v;
+ }
+ });
+ tmp = d.children('a').eq(0);
+ if(tmp.length) {
+ tmp = $.vakata.attributes(tmp, true);
+ $.each(tmp, function (i, v) {
+ v = $.trim(v);
+ if(v.length) {
+ data.a_attr[i] = v;
+ }
+ });
+ }
+ tmp = d.children("a:eq(0)").length ? d.children("a:eq(0)").clone() : d.clone();
+ tmp.children("ins, i, ul").remove();
+ tmp = tmp.html();
+ tmp = $('<div />').html(tmp);
+ data.text = tmp.html();
+ tmp = d.data();
+ data.data = tmp ? $.extend(true, {}, tmp) : null;
+ data.state.opened = d.hasClass('jstree-open');
+ data.state.selected = d.children('a').hasClass('jstree-clicked');
+ data.state.disabled = d.children('a').hasClass('jstree-disabled');
+ if(data.data && data.data.jstree) {
+ for(i in data.data.jstree) {
+ if(data.data.jstree.hasOwnProperty(i)) {
+ data.state[i] = data.data.jstree[i];
+ }
+ }
+ }
+ tmp = d.children("a").children(".jstree-themeicon");
+ if(tmp.length) {
+ data.icon = tmp.hasClass('jstree-themeicon-hidden') ? false : tmp.attr('rel');
+ }
+ if(data.state.icon) {
+ data.icon = data.state.icon;
+ }
+ tmp = d.children("ul").children("li");
+ do {
+ tid = 'j' + this._id + '_' + (++total_nodes);
+ } while(m[tid]);
+ data.id = data.li_attr.id || tid;
+ if(tmp.length) {
+ tmp.each($.proxy(function (i, v) {
+ c = this._parse_model_from_html($(v), data.id, ps);
+ e = this._model.data[c];
+ data.children.push(c);
+ if(e.children_d.length) {
+ data.children_d = data.children_d.concat(e.children_d);
+ }
+ }, this));
+ data.children_d = data.children_d.concat(data.children);
+ }
+ else {
+ if(d.hasClass('jstree-closed')) {
+ data.state.loaded = false;
+ }
+ }
+ if(data.li_attr['class']) {
+ data.li_attr['class'] = data.li_attr['class'].replace('jstree-closed','').replace('jstree-open','');
+ }
+ if(data.a_attr['class']) {
+ data.a_attr['class'] = data.a_attr['class'].replace('jstree-clicked','').replace('jstree-disabled','');
+ }
+ m[data.id] = data;
+ if(data.state.selected) {
+ this._data.core.selected.push(data.id);
+ }
+ return data.id;
+ },
+ /**
+ * parses a node from a JSON object (used when dealing with flat data, which has no nesting of children, but has id and parent properties) and appends it to the in memory tree model. Used internally.
+ * @private
+ * @name _parse_model_from_flat_json(d [, p, ps])
+ * @param {Object} d the JSON object to parse
+ * @param {String} p the parent ID
+ * @param {Array} ps list of all parents
+ * @return {String} the ID of the object added to the model
+ */
+ _parse_model_from_flat_json : function (d, p, ps) {
+ if(!ps) { ps = []; }
+ else { ps = ps.concat(); }
+ if(p) { ps.unshift(p); }
+ var tid = d.id,
+ m = this._model.data,
+ df = this._model.default_state,
+ i, j, c, e,
+ tmp = {
+ id : tid,
+ text : d.text || '',
+ icon : d.icon !== undefined ? d.icon : true,
+ parent : p,
+ parents : ps,
+ children : d.children || [],
+ children_d : d.children_d || [],
+ data : d.data,
+ state : { },
+ li_attr : { id : false },
+ a_attr : { href : '#' },
+ original : false
+ };
+ for(i in df) {
+ if(df.hasOwnProperty(i)) {
+ tmp.state[i] = df[i];
+ }
+ }
+ if(d && d.data && d.data.jstree && d.data.jstree.icon) {
+ tmp.icon = d.data.jstree.icon;
+ }
+ if(d && d.data) {
+ tmp.data = d.data;
+ if(d.data.jstree) {
+ for(i in d.data.jstree) {
+ if(d.data.jstree.hasOwnProperty(i)) {
+ tmp.state[i] = d.data.jstree[i];
+ }
+ }
+ }
+ }
+ if(d && typeof d.state === 'object') {
+ for (i in d.state) {
+ if(d.state.hasOwnProperty(i)) {
+ tmp.state[i] = d.state[i];
+ }
+ }
+ }
+ if(d && typeof d.li_attr === 'object') {
+ for (i in d.li_attr) {
+ if(d.li_attr.hasOwnProperty(i)) {
+ tmp.li_attr[i] = d.li_attr[i];
+ }
+ }
+ }
+ if(!tmp.li_attr.id) {
+ tmp.li_attr.id = tid;
+ }
+ if(d && typeof d.a_attr === 'object') {
+ for (i in d.a_attr) {
+ if(d.a_attr.hasOwnProperty(i)) {
+ tmp.a_attr[i] = d.a_attr[i];
+ }
+ }
+ }
+ if(d && d.children && d.children === true) {
+ tmp.state.loaded = false;
+ tmp.children = [];
+ tmp.children_d = [];
+ }
+ m[tmp.id] = tmp;
+ for(i = 0, j = tmp.children.length; i < j; i++) {
+ c = this._parse_model_from_flat_json(m[tmp.children[i]], tmp.id, ps);
+ e = m[c];
+ tmp.children_d.push(c);
+ if(e.children_d.length) {
+ tmp.children_d = tmp.children_d.concat(e.children_d);
+ }
+ }
+ delete d.data;
+ delete d.children;
+ m[tmp.id].original = d;
+ if(tmp.state.selected) {
+ this._data.core.selected.push(tmp.id);
+ }
+ return tmp.id;
+ },
+ /**
+ * parses a node from a JSON object and appends it to the in memory tree model. Used internally.
+ * @private
+ * @name _parse_model_from_json(d [, p, ps])
+ * @param {Object} d the JSON object to parse
+ * @param {String} p the parent ID
+ * @param {Array} ps list of all parents
+ * @return {String} the ID of the object added to the model
+ */
+ _parse_model_from_json : function (d, p, ps) {
+ if(!ps) { ps = []; }
+ else { ps = ps.concat(); }
+ if(p) { ps.unshift(p); }
+ var tid = false, i, j, c, e, m = this._model.data, df = this._model.default_state, tmp;
+ do {
+ tid = 'j' + this._id + '_' + (++total_nodes);
+ } while(m[tid]);
+
+ tmp = {
+ id : false,
+ text : typeof d === 'string' ? d : '',
+ icon : typeof d === 'object' && d.icon !== undefined ? d.icon : true,
+ parent : p,
+ parents : ps,
+ children : [],
+ children_d : [],
+ data : null,
+ state : { },
+ li_attr : { id : false },
+ a_attr : { href : '#' },
+ original : false
+ };
+ for(i in df) {
+ if(df.hasOwnProperty(i)) {
+ tmp.state[i] = df[i];
+ }
+ }
+ if(d && d.id) { tmp.id = d.id; }
+ if(d && d.text) { tmp.text = d.text; }
+ if(d && d.data && d.data.jstree && d.data.jstree.icon) {
+ tmp.icon = d.data.jstree.icon;
+ }
+ if(d && d.data) {
+ tmp.data = d.data;
+ if(d.data.jstree) {
+ for(i in d.data.jstree) {
+ if(d.data.jstree.hasOwnProperty(i)) {
+ tmp.state[i] = d.data.jstree[i];
+ }
+ }
+ }
+ }
+ if(d && typeof d.state === 'object') {
+ for (i in d.state) {
+ if(d.state.hasOwnProperty(i)) {
+ tmp.state[i] = d.state[i];
+ }
+ }
+ }
+ if(d && typeof d.li_attr === 'object') {
+ for (i in d.li_attr) {
+ if(d.li_attr.hasOwnProperty(i)) {
+ tmp.li_attr[i] = d.li_attr[i];
+ }
+ }
+ }
+ if(tmp.li_attr.id && !tmp.id) {
+ tmp.id = tmp.li_attr.id;
+ }
+ if(!tmp.id) {
+ tmp.id = tid;
+ }
+ if(!tmp.li_attr.id) {
+ tmp.li_attr.id = tmp.id;
+ }
+ if(d && typeof d.a_attr === 'object') {
+ for (i in d.a_attr) {
+ if(d.a_attr.hasOwnProperty(i)) {
+ tmp.a_attr[i] = d.a_attr[i];
+ }
+ }
+ }
+ if(d && d.children && d.children.length) {
+ for(i = 0, j = d.children.length; i < j; i++) {
+ c = this._parse_model_from_json(d.children[i], tmp.id, ps);
+ e = m[c];
+ tmp.children.push(c);
+ if(e.children_d.length) {
+ tmp.children_d = tmp.children_d.concat(e.children_d);
+ }
+ }
+ tmp.children_d = tmp.children_d.concat(tmp.children);
+ }
+ if(d && d.children && d.children === true) {
+ tmp.state.loaded = false;
+ tmp.children = [];
+ tmp.children_d = [];
+ }
+ delete d.data;
+ delete d.children;
+ tmp.original = d;
+ m[tmp.id] = tmp;
+ if(tmp.state.selected) {
+ this._data.core.selected.push(tmp.id);
+ }
+ return tmp.id;
+ },
+ /**
+ * redraws all nodes that need to be redrawn. Used internally.
+ * @private
+ * @name _redraw()
+ * @trigger redraw.jstree
+ */
+ _redraw : function () {
+ var nodes = this._model.force_full_redraw ? this._model.data['#'].children.concat([]) : this._model.changed.concat([]),
+ f = document.createElement('UL'), tmp, i, j;
+ for(i = 0, j = nodes.length; i < j; i++) {
+ tmp = this.redraw_node(nodes[i], true, this._model.force_full_redraw);
+ if(tmp && this._model.force_full_redraw) {
+ f.appendChild(tmp);
+ }
+ }
+ if(this._model.force_full_redraw) {
+ f.className = this.get_container_ul()[0].className;
+ this.element.empty().append(f);
+ //this.get_container_ul()[0].appendChild(f);
+ }
+ this._model.force_full_redraw = false;
+ this._model.changed = [];
+ /**
+ * triggered after nodes are redrawn
+ * @event
+ * @name redraw.jstree
+ * @param {array} nodes the redrawn nodes
+ */
+ this.trigger('redraw', { "nodes" : nodes });
+ },
+ /**
+ * redraws all nodes that need to be redrawn or optionally - the whole tree
+ * @name redraw([full])
+ * @param {Boolean} full if set to `true` all nodes are redrawn.
+ */
+ redraw : function (full) {
+ if(full) {
+ this._model.force_full_redraw = true;
+ }
+ //if(this._model.redraw_timeout) {
+ // clearTimeout(this._model.redraw_timeout);
+ //}
+ //this._model.redraw_timeout = setTimeout($.proxy(this._redraw, this),0);
+ this._redraw();
+ },
+ /**
+ * redraws a single node. Used internally.
+ * @private
+ * @name redraw_node(node, deep, is_callback)
+ * @param {mixed} node the node to redraw
+ * @param {Boolean} deep should child nodes be redrawn too
+ * @param {Boolean} is_callback is this a recursion call
+ */
+ redraw_node : function (node, deep, is_callback) {
+ var obj = this.get_node(node),
+ par = false,
+ ind = false,
+ old = false,
+ i = false,
+ j = false,
+ k = false,
+ c = '',
+ d = document,
+ m = this._model.data;
+ if(!obj) { return false; }
+ if(obj.id === '#') { return this.redraw(true); }
+ deep = deep || obj.children.length === 0;
+ node = d.getElementById(obj.id); //, this.element);
+ if(!node) {
+ deep = true;
+ //node = d.createElement('LI');
+ if(!is_callback) {
+ par = obj.parent !== '#' ? $('#' + obj.parent, this.element)[0] : null;
+ if(par !== null && (!par || !m[obj.parent].state.opened)) {
+ return false;
+ }
+ ind = $.inArray(obj.id, par === null ? m['#'].children : m[obj.parent].children);
+ }
+ }
+ else {
+ node = $(node);
+ if(!is_callback) {
+ par = node.parent().parent()[0];
+ if(par === this.element[0]) {
+ par = null;
+ }
+ ind = node.index();
+ }
+ // m[obj.id].data = node.data(); // use only node's data, no need to touch jquery storage
+ if(!deep && obj.children.length && !node.children('ul').length) {
+ deep = true;
+ }
+ if(!deep) {
+ old = node.children('UL')[0];
+ }
+ node.remove();
+ //node = d.createElement('LI');
+ //node = node[0];
+ }
+ node = _node.cloneNode(true);
+ // node is DOM, deep is boolean
+
+ c = 'jstree-node ';
+ for(i in obj.li_attr) {
+ if(obj.li_attr.hasOwnProperty(i)) {
+ if(i === 'id') { continue; }
+ if(i !== 'class') {
+ node.setAttribute(i, obj.li_attr[i]);
+ }
+ else {
+ c += obj.li_attr[i];
+ }
+ }
+ }
+ if(!obj.children.length && obj.state.loaded) {
+ c += ' jstree-leaf';
+ }
+ else {
+ c += obj.state.opened ? ' jstree-open' : ' jstree-closed';
+ }
+ if(obj.parent !== null && m[obj.parent].children[m[obj.parent].children.length - 1] === obj.id) {
+ c += ' jstree-last';
+ }
+ node.id = obj.id;
+ node.className = c;
+ c = ( obj.state.selected ? ' jstree-clicked' : '') + ( obj.state.disabled ? ' jstree-disabled' : '');
+ for(j in obj.a_attr) {
+ if(obj.a_attr.hasOwnProperty(j)) {
+ if(j === 'href' && obj.a_attr[j] === '#') { continue; }
+ if(j !== 'class') {
+ node.childNodes[1].setAttribute(j, obj.a_attr[j]);
+ }
+ else {
+ c += ' ' + obj.a_attr[j];
+ }
+ }
+ }
+ if(c.length) {
+ node.childNodes[1].className = 'jstree-anchor ' + c;
+ }
+ if((obj.icon && obj.icon !== true) || obj.icon === false) {
+ if(obj.icon === false) {
+ node.childNodes[1].childNodes[0].className += ' jstree-themeicon-hidden';
+ }
+ else if(obj.icon.indexOf('/') === -1 && obj.icon.indexOf('.') === -1) {
+ node.childNodes[1].childNodes[0].className += ' ' + obj.icon + ' jstree-themeicon-custom';
+ }
+ else {
+ node.childNodes[1].childNodes[0].style.backgroundImage = 'url('+obj.icon+')';
+ node.childNodes[1].childNodes[0].style.backgroundPosition = 'center center';
+ node.childNodes[1].childNodes[0].style.backgroundSize = 'auto';
+ node.childNodes[1].childNodes[0].className += ' jstree-themeicon-custom';
+ }
+ }
+ //node.childNodes[1].appendChild(d.createTextNode(obj.text));
+ node.childNodes[1].innerHTML += obj.text;
+ // if(obj.data) { $.data(node, obj.data); } // always work with node's data, no need to touch jquery store
+
+ if(deep && obj.children.length && obj.state.opened) {
+ k = d.createElement('UL');
+ k.setAttribute('role', 'group');
+ k.className = 'jstree-children';
+ for(i = 0, j = obj.children.length; i < j; i++) {
+ k.appendChild(this.redraw_node(obj.children[i], deep, true));
+ }
+ node.appendChild(k);
+ }
+ if(old) {
+ node.appendChild(old);
+ }
+ if(!is_callback) {
+ // append back using par / ind
+ if(!par) {
+ par = this.element[0];
+ }
+ if(!par.getElementsByTagName('UL').length) {
+ i = d.createElement('UL');
+ i.setAttribute('role', 'group');
+ i.className = 'jstree-children';
+ par.appendChild(i);
+ par = i;
+ }
+ else {
+ par = par.getElementsByTagName('UL')[0];
+ }
+
+ if(ind < par.childNodes.length) {
+ par.insertBefore(node, par.childNodes[ind]);
+ }
+ else {
+ par.appendChild(node);
+ }
+ }
+ return node;
+ },
+ /**
+ * opens a node, revaling its children. If the node is not loaded it will be loaded and opened once ready.
+ * @name open_node(obj [, callback, animation])
+ * @param {mixed} obj the node to open
+ * @param {Function} callback a function to execute once the node is opened
+ * @param {Number} animation the animation duration in milliseconds when opening the node (overrides the `core.animation` setting). Use `false` for no animation.
+ * @trigger open_node.jstree, after_open.jstree
+ */
+ open_node : function (obj, callback, animation) {
+ var t1, t2, d, t;
+ if($.isArray(obj)) {
+ obj = obj.slice();
+ for(t1 = 0, t2 = obj.length; t1 < t2; t1++) {
+ this.open_node(obj[t1], callback, animation);
+ }
+ return true;
+ }
+ obj = this.get_node(obj);
+ if(!obj || obj.id === '#') {
+ return false;
+ }
+ animation = animation === undefined ? this.settings.core.animation : animation;
+ if(!this.is_closed(obj)) {
+ if(callback) {
+ callback.call(this, obj, false);
+ }
+ return false;
+ }
+ if(!this.is_loaded(obj)) {
+ if(this.is_loading(obj)) {
+ return setTimeout($.proxy(function () {
+ this.open_node(obj, callback, animation);
+ }, this), 500);
+ }
+ this.load_node(obj, function (o, ok) {
+ return ok ? this.open_node(o, callback, animation) : (callback ? callback.call(this, o, false) : false);
+ });
+ }
+ else {
+ d = this.get_node(obj, true);
+ t = this;
+ if(d.length) {
+ if(obj.children.length && !this._firstChild(d.children('ul')[0])) {
+ obj.state.opened = true;
+ this.redraw_node(obj, true);
+ d = this.get_node(obj, true);
+ }
+ if(!animation) {
+ d[0].className = d[0].className.replace('jstree-closed', 'jstree-open');
+ }
+ else {
+ d
+ .children("ul").css("display","none").end()
+ .removeClass("jstree-closed").addClass("jstree-open")
+ .children("ul").stop(true, true)
+ .slideDown(animation, function () {
+ this.style.display = "";
+ t.trigger("after_open", { "node" : obj });
+ });
+ }
+ }
+ obj.state.opened = true;
+ if(callback) {
+ callback.call(this, obj, true);
+ }
+ /**
+ * triggered when a node is opened (if there is an animation it will not be completed yet)
+ * @event
+ * @name open_node.jstree
+ * @param {Object} node the opened node
+ */
+ this.trigger('open_node', { "node" : obj });
+ if(!animation || !d.length) {
+ /**
+ * triggered when a node is opened and the animation is complete
+ * @event
+ * @name after_open.jstree
+ * @param {Object} node the opened node
+ */
+ this.trigger("after_open", { "node" : obj });
+ }
+ }
+ },
+ /**
+ * opens every parent of a node (node should be loaded)
+ * @name _open_to(obj)
+ * @param {mixed} obj the node to reveal
+ * @private
+ */
+ _open_to : function (obj) {
+ obj = this.get_node(obj);
+ if(!obj || obj.id === '#') {
+ return false;
+ }
+ var i, j, p = obj.parents;
+ for(i = 0, j = p.length; i < j; i+=1) {
+ if(i !== '#') {
+ this.open_node(p[i], false, 0);
+ }
+ }
+ return $(document.getElementById(obj.id));
+ },
+ /**
+ * closes a node, hiding its children
+ * @name close_node(obj [, animation])
+ * @param {mixed} obj the node to close
+ * @param {Number} animation the animation duration in milliseconds when closing the node (overrides the `core.animation` setting). Use `false` for no animation.
+ * @trigger close_node.jstree, after_close.jstree
+ */
+ close_node : function (obj, animation) {
+ var t1, t2, t, d;
+ if($.isArray(obj)) {
+ obj = obj.slice();
+ for(t1 = 0, t2 = obj.length; t1 < t2; t1++) {
+ this.close_node(obj[t1], animation);
+ }
+ return true;
+ }
+ obj = this.get_node(obj);
+ if(!obj || obj.id === '#') {
+ return false;
+ }
+ animation = animation === undefined ? this.settings.core.animation : animation;
+ t = this;
+ d = this.get_node(obj, true);
+ if(d.length) {
+ if(!animation) {
+ d[0].className = d[0].className.replace('jstree-open', 'jstree-closed');
+ d.children('ul').remove();
+ }
+ else {
+ d
+ .children("ul").attr("style","display:block !important").end()
+ .removeClass("jstree-open").addClass("jstree-closed")
+ .children("ul").stop(true, true).slideUp(animation, function () {
+ this.style.display = "";
+ d.children('ul').remove();
+ t.trigger("after_close", { "node" : obj });
+ });
+ }
+ }
+ obj.state.opened = false;
+ /**
+ * triggered when a node is closed (if there is an animation it will not be complete yet)
+ * @event
+ * @name close_node.jstree
+ * @param {Object} node the closed node
+ */
+ this.trigger('close_node',{ "node" : obj });
+ if(!animation || !d.length) {
+ /**
+ * triggered when a node is closed and the animation is complete
+ * @event
+ * @name after_close.jstree
+ * @param {Object} node the closed node
+ */
+ this.trigger("after_close", { "node" : obj });
+ }
+ },
+ /**
+ * toggles a node - closing it if it is open, opening it if it is closed
+ * @name toggle_node(obj)
+ * @param {mixed} obj the node to toggle
+ */
+ toggle_node : function (obj) {
+ var t1, t2;
+ if($.isArray(obj)) {
+ obj = obj.slice();
+ for(t1 = 0, t2 = obj.length; t1 < t2; t1++) {
+ this.toggle_node(obj[t1]);
+ }
+ return true;
+ }
+ if(this.is_closed(obj)) {
+ return this.open_node(obj);
+ }
+ if(this.is_open(obj)) {
+ return this.close_node(obj);
+ }
+ },
+ /**
+ * opens all nodes within a node (or the tree), revaling their children. If the node is not loaded it will be loaded and opened once ready.
+ * @name open_all([obj, animation, original_obj])
+ * @param {mixed} obj the node to open recursively, omit to open all nodes in the tree
+ * @param {Number} animation the animation duration in milliseconds when opening the nodes, the default is no animation
+ * @param {jQuery} reference to the node that started the process (internal use)
+ * @trigger open_all.jstree
+ */
+ open_all : function (obj, animation, original_obj) {
+ if(!obj) { obj = '#'; }
+ obj = this.get_node(obj);
+ if(!obj) { return false; }
+ var dom = obj.id === '#' ? this.get_container_ul() : this.get_node(obj, true), i, j, _this;
+ if(!dom.length) {
+ for(i = 0, j = obj.children_d.length; i < j; i++) {
+ if(this.is_closed(this._model.data[obj.children_d[i]])) {
+ this._model.data[obj.children_d[i]].state.opened = true;
+ }
+ }
+ return this.trigger('open_all', { "node" : obj });
+ }
+ original_obj = original_obj || dom;
+ _this = this;
+ dom = this.is_closed(obj) ? dom.find('li.jstree-closed').addBack() : dom.find('li.jstree-closed');
+ dom.each(function () {
+ _this.open_node(
+ this,
+ function(node, status) { if(status && this.is_parent(node)) { this.open_all(node, animation, original_obj); } },
+ animation || 0
+ );
+ });
+ if(original_obj.find('li.jstree-closed').length === 0) {
+ /**
+ * triggered when an `open_all` call completes
+ * @event
+ * @name open_all.jstree
+ * @param {Object} node the opened node
+ */
+ this.trigger('open_all', { "node" : this.get_node(original_obj) });
+ }
+ },
+ /**
+ * closes all nodes within a node (or the tree), revaling their children
+ * @name close_all([obj, animation])
+ * @param {mixed} obj the node to close recursively, omit to close all nodes in the tree
+ * @param {Number} animation the animation duration in milliseconds when closing the nodes, the default is no animation
+ * @trigger close_all.jstree
+ */
+ close_all : function (obj, animation) {
+ if(!obj) { obj = '#'; }
+ obj = this.get_node(obj);
+ if(!obj) { return false; }
+ var dom = obj.id === '#' ? this.get_container_ul() : this.get_node(obj, true),
+ _this = this, i, j;
+ if(!dom.length) {
+ for(i = 0, j = obj.children_d.length; i < j; i++) {
+ this._model.data[obj.children_d[i]].state.opened = false;
+ }
+ return this.trigger('close_all', { "node" : obj });
+ }
+ dom = this.is_open(obj) ? dom.find('li.jstree-open').addBack() : dom.find('li.jstree-open');
+ dom.vakata_reverse().each(function () { _this.close_node(this, animation || 0); });
+ /**
+ * triggered when an `close_all` call completes
+ * @event
+ * @name close_all.jstree
+ * @param {Object} node the closed node
+ */
+ this.trigger('close_all', { "node" : obj });
+ },
+ /**
+ * checks if a node is disabled (not selectable)
+ * @name is_disabled(obj)
+ * @param {mixed} obj
+ * @return {Boolean}
+ */
+ is_disabled : function (obj) {
+ obj = this.get_node(obj);
+ return obj && obj.state && obj.state.disabled;
+ },
+ /**
+ * enables a node - so that it can be selected
+ * @name enable_node(obj)
+ * @param {mixed} obj the node to enable
+ * @trigger enable_node.jstree
+ */
+ enable_node : function (obj) {
+ var t1, t2;
+ if($.isArray(obj)) {
+ obj = obj.slice();
+ for(t1 = 0, t2 = obj.length; t1 < t2; t1++) {
+ this.enable_node(obj[t1]);
+ }
+ return true;
+ }
+ obj = this.get_node(obj);
+ if(!obj || obj.id === '#') {
+ return false;
+ }
+ obj.state.disabled = false;
+ this.get_node(obj,true).children('.jstree-anchor').removeClass('jstree-disabled');
+ /**
+ * triggered when an node is enabled
+ * @event
+ * @name enable_node.jstree
+ * @param {Object} node the enabled node
+ */
+ this.trigger('enable_node', { 'node' : obj });
+ },
+ /**
+ * disables a node - so that it can not be selected
+ * @name disable_node(obj)
+ * @param {mixed} obj the node to disable
+ * @trigger disable_node.jstree
+ */
+ disable_node : function (obj) {
+ var t1, t2;
+ if($.isArray(obj)) {
+ obj = obj.slice();
+ for(t1 = 0, t2 = obj.length; t1 < t2; t1++) {
+ this.disable_node(obj[t1]);
+ }
+ return true;
+ }
+ obj = this.get_node(obj);
+ if(!obj || obj.id === '#') {
+ return false;
+ }
+ obj.state.disabled = true;
+ this.get_node(obj,true).children('.jstree-anchor').addClass('jstree-disabled');
+ /**
+ * triggered when an node is disabled
+ * @event
+ * @name disable_node.jstree
+ * @param {Object} node the disabled node
+ */
+ this.trigger('disable_node', { 'node' : obj });
+ },
+ /**
+ * called when a node is selected by the user. Used internally.
+ * @private
+ * @name activate_node(obj, e)
+ * @param {mixed} obj the node
+ * @param {Object} e the related event
+ * @trigger activate_node.jstree
+ */
+ activate_node : function (obj, e) {
+ if(this.is_disabled(obj)) {
+ return false;
+ }
+ if(!this.settings.core.multiple || (!e.metaKey && !e.ctrlKey && !e.shiftKey) || (e.shiftKey && (!this._data.core.last_clicked || !this.get_parent(obj) || this.get_parent(obj) !== this._data.core.last_clicked.parent ) )) {
+ this.deselect_all(true);
+ this.select_node(obj);
+ this._data.core.last_clicked = this.get_node(obj);
+ }
+ else {
+ if(e.shiftKey) {
+ var o = this.get_node(obj).id,
+ l = this._data.core.last_clicked.id,
+ p = this.get_node(this._data.core.last_clicked.parent).children,
+ c = false,
+ i, j;
+ for(i = 0, j = p.length; i < j; i += 1) {
+ // separate IFs work whem o and l are the same
+ if(p[i] === o) {
+ c = !c;
+ }
+ if(p[i] === l) {
+ c = !c;
+ }
+ if(c || p[i] === o || p[i] === l) {
+ this.select_node(p[i]);
+ }
+ else {
+ this.deselect_node(p[i]);
+ }
+ }
+ }
+ else {
+ if(!this.is_selected(obj)) {
+ this.select_node(obj);
+ }
+ else {
+ this.deselect_node(obj);
+ }
+ }
+ }
+ /**
+ * triggered when an node is clicked or intercated with by the user
+ * @event
+ * @name activate_node.jstree
+ * @param {Object} node
+ */
+ this.trigger('activate_node', { 'node' : this.get_node(obj) });
+ },
+ /**
+ * applies the hover state on a node, called when a node is hovered by the user. Used internally.
+ * @private
+ * @name hover_node(obj)
+ * @param {mixed} obj
+ * @trigger hover_node.jstree
+ */
+ hover_node : function (obj) {
+ obj = this.get_node(obj, true);
+ if(!obj || !obj.length || obj.children('.jstree-hovered').length) {
+ return false;
+ }
+ var o = this.element.find('.jstree-hovered');
+ if(o && o.length) { this.dehover_node(o); }
+
+ obj.children('.jstree-anchor').addClass('jstree-hovered');
+ /**
+ * triggered when an node is hovered
+ * @event
+ * @name hover_node.jstree
+ * @param {Object} node
+ */
+ this.trigger('hover_node', { 'node' : this.get_node(obj) });
+ },
+ /**
+ * removes the hover state from a nodecalled when a node is no longer hovered by the user. Used internally.
+ * @private
+ * @name dehover_node(obj)
+ * @param {mixed} obj
+ * @trigger dehover_node.jstree
+ */
+ dehover_node : function (obj) {
+ obj = this.get_node(obj, true);
+ if(!obj || !obj.length || !obj.children('.jstree-hovered').length) {
+ return false;
+ }
+ obj.children('.jstree-anchor').removeClass('jstree-hovered');
+ /**
+ * triggered when an node is no longer hovered
+ * @event
+ * @name dehover_node.jstree
+ * @param {Object} node
+ */
+ this.trigger('dehover_node', { 'node' : this.get_node(obj) });
+ },
+ /**
+ * select a node
+ * @name select_node(obj [, supress_event, prevent_open])
+ * @param {mixed} obj an array can be used to select multiple nodes
+ * @param {Boolean} supress_event if set to `true` the `changed.jstree` event won't be triggered
+ * @param {Boolean} prevent_open if set to `true` parents of the selected node won't be opened
+ * @trigger select_node.jstree, changed.jstree
+ */
+ select_node : function (obj, supress_event, prevent_open) {
+ var dom, t1, t2, th;
+ if($.isArray(obj)) {
+ obj = obj.slice();
+ for(t1 = 0, t2 = obj.length; t1 < t2; t1++) {
+ this.select_node(obj[t1], supress_event, prevent_open);
+ }
+ return true;
+ }
+ obj = this.get_node(obj);
+ if(!obj || obj.id === '#') {
+ return false;
+ }
+ dom = this.get_node(obj, true);
+ if(!obj.state.selected) {
+ obj.state.selected = true;
+ this._data.core.selected.push(obj.id);
+ if(!prevent_open) {
+ dom = this._open_to(obj);
+ }
+ if(dom && dom.length) {
+ dom.children('.jstree-anchor').addClass('jstree-clicked');
+ }
+ /**
+ * triggered when an node is selected
+ * @event
+ * @name select_node.jstree
+ * @param {Object} node
+ * @param {Array} selected the current selection
+ */
+ this.trigger('select_node', { 'node' : obj, 'selected' : this._data.core.selected });
+ if(!supress_event) {
+ /**
+ * triggered when selection changes
+ * @event
+ * @name changed.jstree
+ * @param {Object} node
+ * @param {Object} action the action that caused the selection to change
+ * @param {Array} selected the current selection
+ */
+ this.trigger('changed', { 'action' : 'select_node', 'node' : obj, 'selected' : this._data.core.selected });
+ }
+ }
+ },
+ /**
+ * deselect a node
+ * @name deselect_node(obj [, supress_event])
+ * @param {mixed} obj an array can be used to deselect multiple nodes
+ * @param {Boolean} supress_event if set to `true` the `changed.jstree` event won't be triggered
+ * @trigger deselect_node.jstree, changed.jstree
+ */
+ deselect_node : function (obj, supress_event) {
+ var t1, t2, dom;
+ if($.isArray(obj)) {
+ obj = obj.slice();
+ for(t1 = 0, t2 = obj.length; t1 < t2; t1++) {
+ this.deselect_node(obj[t1], supress_event);
+ }
+ return true;
+ }
+ obj = this.get_node(obj);
+ if(!obj || obj.id === '#') {
+ return false;
+ }
+ dom = this.get_node(obj, true);
+ if(obj.state.selected) {
+ obj.state.selected = false;
+ this._data.core.selected = $.vakata.array_remove_item(this._data.core.selected, obj.id);
+ if(dom.length) {
+ dom.children('.jstree-anchor').removeClass('jstree-clicked');
+ }
+ /**
+ * triggered when an node is deselected
+ * @event
+ * @name deselect_node.jstree
+ * @param {Object} node
+ * @param {Array} selected the current selection
+ */
+ this.trigger('deselect_node', { 'node' : obj, 'selected' : this._data.core.selected });
+ if(!supress_event) {
+ this.trigger('changed', { 'action' : 'deselect_node', 'node' : obj, 'selected' : this._data.core.selected });
+ }
+ }
+ },
+ /**
+ * select all nodes in the tree
+ * @name select_all([supress_event])
+ * @param {Boolean} supress_event if set to `true` the `changed.jstree` event won't be triggered
+ * @trigger select_all.jstree, changed.jstree
+ */
+ select_all : function (supress_event) {
+ var tmp = this._data.core.selected.concat([]), i, j;
+ this._data.core.selected = this._model.data['#'].children_d.concat();
+ for(i = 0, j = this._data.core.selected.length; i < j; i++) {
+ if(this._model.data[this._data.core.selected[i]]) {
+ this._model.data[this._data.core.selected[i]].state.selected = true;
+ }
+ }
+ this.redraw(true);
+ /**
+ * triggered when all nodes are selected
+ * @event
+ * @name select_all.jstree
+ * @param {Array} selected the current selection
+ */
+ this.trigger('select_all', { 'selected' : this._data.core.selected });
+ if(!supress_event) {
+ this.trigger('changed', { 'action' : 'select_all', 'selected' : this._data.core.selected, 'old_selection' : tmp });
+ }
+ },
+ /**
+ * deselect all selected nodes
+ * @name deselect_all([supress_event])
+ * @param {Boolean} supress_event if set to `true` the `changed.jstree` event won't be triggered
+ * @trigger deselect_all.jstree, changed.jstree
+ */
+ deselect_all : function (supress_event) {
+ var tmp = this._data.core.selected.concat([]), i, j;
+ for(i = 0, j = this._data.core.selected.length; i < j; i++) {
+ if(this._model.data[this._data.core.selected[i]]) {
+ this._model.data[this._data.core.selected[i]].state.selected = false;
+ }
+ }
+ this._data.core.selected = [];
+ this.element.find('.jstree-clicked').removeClass('jstree-clicked');
+ /**
+ * triggered when all nodes are deselected
+ * @event
+ * @name deselect_all.jstree
+ * @param {Object} node the previous selection
+ * @param {Array} selected the current selection
+ */
+ this.trigger('deselect_all', { 'selected' : this._data.core.selected, 'node' : tmp });
+ if(!supress_event) {
+ this.trigger('changed', { 'action' : 'deselect_all', 'selected' : this._data.core.selected, 'old_selection' : tmp });
+ }
+ },
+ /**
+ * checks if a node is selected
+ * @name is_selected(obj)
+ * @param {mixed} obj
+ * @return {Boolean}
+ */
+ is_selected : function (obj) {
+ obj = this.get_node(obj);
+ if(!obj || obj.id === '#') {
+ return false;
+ }
+ return obj.state.selected;
+ },
+ /**
+ * get an array of all selected node IDs
+ * @name get_selected([full])
+ * @param {mixed} full if set to `true` the returned array will consist of the full node objects, otherwise - only IDs will be returned
+ * @return {Array}
+ */
+ get_selected : function (full) {
+ return full ? $.map(this._data.core.selected, $.proxy(function (i) { return this.get_node(i); }, this)) : this._data.core.selected;
+ },
+ /**
+ * gets the current state of the tree so that it can be restored later with `set_state(state)`. Used internally.
+ * @name get_state()
+ * @private
+ * @return {Object}
+ */
+ get_state : function () {
+ var state = {
+ 'core' : {
+ 'open' : [],
+ 'scroll' : {
+ 'left' : this.element.scrollLeft(),
+ 'top' : this.element.scrollTop()
+ },
+ /*!
+ 'themes' : {
+ 'name' : this.get_theme(),
+ 'icons' : this._data.core.themes.icons,
+ 'dots' : this._data.core.themes.dots
+ },
+ */
+ 'selected' : []
+ }
+ }, i;
+ for(i in this._model.data) {
+ if(this._model.data.hasOwnProperty(i)) {
+ if(i !== '#') {
+ if(this._model.data[i].state.opened) {
+ state.core.open.push(i);
+ }
+ if(this._model.data[i].state.selected) {
+ state.core.selected.push(i);
+ }
+ }
+ }
+ }
+ return state;
+ },
+ /**
+ * sets the state of the tree. Used internally.
+ * @name set_state(state [, callback])
+ * @private
+ * @param {Object} state the state to restore
+ * @param {Function} callback an optional function to execute once the state is restored.
+ * @trigger set_state.jstree
+ */
+ set_state : function (state, callback) {
+ if(state) {
+ if(state.core) {
+ var res, n, t, _this;
+ if(state.core.open) {
+ if(!$.isArray(state.core.open)) {
+ delete state.core.open;
+ this.set_state(state, callback);
+ return false;
+ }
+ res = true;
+ n = false;
+ t = this;
+ $.each(state.core.open.concat([]), function (i, v) {
+ n = t.get_node(v);
+ if(n) {
+ if(t.is_loaded(v)) {
+ if(t.is_closed(v)) {
+ t.open_node(v, false, 0);
+ }
+ $.vakata.array_remove_item(state.core.open, v);
+ }
+ else {
+ if(!t.is_loading(v)) {
+ t.open_node(v, $.proxy(function () { this.set_state(state); }, t), 0);
+ }
+ // there will be some async activity - so wait for it
+ res = false;
+ }
+ }
+ });
+ if(res) {
+ delete state.core.open;
+ this.set_state(state, callback);
+ }
+ return false;
+ }
+ if(state.core.scroll) {
+ if(state.core.scroll && state.core.scroll.left !== undefined) {
+ this.element.scrollLeft(state.core.scroll.left);
+ }
+ if(state.core.scroll && state.core.scroll.top !== undefined) {
+ this.element.scrollTop(state.core.scroll.top);
+ }
+ delete state.core.scroll;
+ this.set_state(state, callback);
+ return false;
+ }
+ /*!
+ if(state.core.themes) {
+ if(state.core.themes.name) {
+ this.set_theme(state.core.themes.name);
+ }
+ if(typeof state.core.themes.dots !== 'undefined') {
+ this[ state.core.themes.dots ? "show_dots" : "hide_dots" ]();
+ }
+ if(typeof state.core.themes.icons !== 'undefined') {
+ this[ state.core.themes.icons ? "show_icons" : "hide_icons" ]();
+ }
+ delete state.core.themes;
+ delete state.core.open;
+ this.set_state(state, callback);
+ return false;
+ }
+ */
+ if(state.core.selected) {
+ _this = this;
+ this.deselect_all();
+ $.each(state.core.selected, function (i, v) {
+ _this.select_node(v);
+ });
+ delete state.core.selected;
+ this.set_state(state, callback);
+ return false;
+ }
+ if($.isEmptyObject(state.core)) {
+ delete state.core;
+ this.set_state(state, callback);
+ return false;
+ }
+ }
+ if($.isEmptyObject(state)) {
+ if(callback) { callback.call(this); }
+ /**
+ * triggered when a `set_state` call completes
+ * @event
+ * @name set_state.jstree
+ */
+ this.trigger('set_state');
+ return false;
+ }
+ return true;
+ }
+ return false;
+ },
+ /**
+ * refreshes the tree - all nodes are reloaded with calls to `load_node`.
+ * @name refresh()
+ * @trigger refresh.jstree
+ */
+ refresh : function () {
+ this._data.core.state = this.get_state();
+ this.load_node('#', function (o, s) {
+ if(s) {
+ this.set_state($.extend(true, {}, this._data.core.state), function () {
+ /**
+ * triggered when a `refresh` call completes
+ * @event
+ * @name refresh.jstree
+ */
+ this.trigger('refresh');
+ });
+ }
+ this._data.core.state = null;
+ });
+ },
+ /**
+ * set (change) the ID of a node
+ * @name set_id(obj, id)
+ * @param {mixed} obj the node
+ * @param {String} id the new ID
+ * @return {Boolean}
+ */
+ set_id : function (obj, id) {
+ obj = this.get_node(obj);
+ if(!obj || obj.id === '#') { return false; }
+ var i, j, m = this._model.data;
+ // update parents (replace current ID with new one in children and children_d)
+ m[obj.parent].children[$.inArray(obj.id, m[obj.parent].children)] = id;
+ for(i = 0, j = obj.parents.length; i < j; i++) {
+ m[obj.parents[i]].children_d[$.inArray(obj.id, m[obj.parents[i]].children_d)] = id;
+ }
+ // update children (replace current ID with new one in parent and parents)
+ for(i = 0, j = obj.children.length; i < j; i++) {
+ m[obj.children[i]].parent = id;
+ }
+ for(i = 0, j = obj.children_d.length; i < j; i++) {
+ m[obj.children_d[i]].parents[$.inArray(obj.id, m[obj.children_d[i]].parents)] = id;
+ }
+ // update model and obj itself (obj.id, this._model.data[KEY])
+ i = this.get_node(obj.id, true);
+ if(i) {
+ i.attr('id', id);
+ }
+ delete m[obj.id];
+ obj.id = id;
+ m[id] = obj;
+ return true;
+ },
+ /**
+ * get the text value of a node
+ * @name get_text(obj)
+ * @param {mixed} obj the node
+ * @return {String}
+ */
+ get_text : function (obj) {
+ obj = this.get_node(obj);
+ return (!obj || obj.id === '#') ? false : obj.text;
+ },
+ /**
+ * set the text value of a node. Used internally, please use `rename_node(obj, val)`.
+ * @private
+ * @name set_text(obj, val)
+ * @param {mixed} obj the node, you can pass an array to set the text on multiple nodes
+ * @param {String} val the new text value
+ * @return {Boolean}
+ * @trigger set_text.jstree
+ */
+ set_text : function (obj, val) {
+ var t1, t2, dom, tmp;
+ if($.isArray(obj)) {
+ obj = obj.slice();
+ for(t1 = 0, t2 = obj.length; t1 < t2; t1++) {
+ this.set_text(obj[t1], val);
+ }
+ return true;
+ }
+ obj = this.get_node(obj);
+ if(!obj || obj.id === '#') { return false; }
+ obj.text = val;
+ dom = this.get_node(obj, true);
+ if(dom.length) {
+ dom = dom.children(".jstree-anchor:eq(0)");
+ tmp = dom.children("I").clone();
+ dom.html(val).prepend(tmp);
+ /**
+ * triggered when a node text value is changed
+ * @event
+ * @name set_text.jstree
+ * @param {Object} obj
+ * @param {String} text the new value
+ */
+ this.trigger('set_text',{ "obj" : obj, "text" : val });
+ }
+ return true;
+ },
+ /**
+ * gets a JSON representation of a node (or the whole tree)
+ * @name get_json([obj, options])
+ * @param {mixed} obj
+ * @param {Object} options
+ * @param {Boolean} options.no_state do not return state information
+ * @param {Boolean} options.no_id do not return ID
+ * @param {Boolean} options.no_children do not include children
+ * @param {Boolean} options.no_data do not include node data
+ * @param {Boolean} options.flat return flat JSON instead of nested
+ * @return {Object}
+ */
+ get_json : function (obj, options, flat) {
+ obj = this.get_node(obj || '#');
+ if(!obj) { return false; }
+ if(options.flat && !flat) { flat = []; }
+ var tmp = {
+ 'id' : obj.id,
+ 'text' : obj.text,
+ 'icon' : this.get_icon(obj),
+ 'li_attr' : obj.li_attr,
+ 'a_attr' : obj.a_attr,
+ 'state' : {},
+ 'data' : options && options.no_data ? false : obj.data
+ //( this.get_node(obj, true).length ? this.get_node(obj, true).data() : obj.data ),
+ }, i, j;
+ if(options.flat) {
+ tmp.parent = obj.parent;
+ }
+ else {
+ tmp.children = [];
+ }
+ if(!options || !options.no_state) {
+ for(i in obj.state) {
+ if(obj.state.hasOwnProperty(i)) {
+ tmp.state[i] = obj.state[i];
+ }
+ }
+ }
+ if(options && options.no_id) {
+ delete tmp.id;
+ if(tmp.li_attr && tmp.li_attr.id) {
+ delete tmp.li_attr.id;
+ }
+ }
+ if(options.flat && obj.id !== '#') {
+ flat.push(tmp);
+ }
+ if(!options || !options.no_children) {
+ for(i = 0, j = obj.children.length; i < j; i++) {
+ if(options.flat) {
+ this.get_json(obj.children[i], options, flat);
+ }
+ else {
+ tmp.children.push(this.get_json(obj.children[i], options));
+ }
+ }
+ }
+ return options.flat ? flat : (obj.id === '#' ? tmp.children : tmp);
+ },
+ /**
+ * create a new node (do not confuse with load_node)
+ * @name create_node([obj, node, pos, callback, is_loaded])
+ * @param {mixed} par the parent node
+ * @param {mixed} node the data for the new node (a valid JSON object, or a simple string with the name)
+ * @param {mixed} pos the index at which to insert the node, "first" and "last" are also supported, default is "last"
+ * @param {Function} callback a function to be called once the node is created
+ * @param {Boolean} is_loaded internal argument indicating if the parent node was succesfully loaded
+ * @return {String} the ID of the newly create node
+ * @trigger model.jstree, create_node.jstree
+ */
+ create_node : function (par, node, pos, callback, is_loaded) {
+ par = this.get_node(par);
+ if(!par) { return false; }
+ pos = pos === undefined ? "last" : pos;
+ if(!pos.match(/^(before|after)$/) && !is_loaded && !this.is_loaded(par)) {
+ return this.load_node(par, function () { this.create_node(par, node, pos, callback, true); });
+ }
+ if(!node) { node = { "text" : this.get_string('New node') }; }
+ if(node.text === undefined) { node.text = this.get_string('New node'); }
+ var tmp, dpc, i, j;
+
+ if(par.id === '#') {
+ if(pos === "before") { pos = "first"; }
+ if(pos === "after") { pos = "last"; }
+ }
+ switch(pos) {
+ case "before":
+ tmp = this.get_node(par.parent);
+ pos = $.inArray(par.id, tmp.children);
+ par = tmp;
+ break;
+ case "after" :
+ tmp = this.get_node(par.parent);
+ pos = $.inArray(par.id, tmp.children) + 1;
+ par = tmp;
+ break;
+ case "inside":
+ case "first":
+ pos = 0;
+ break;
+ case "last":
+ pos = par.children.length;
+ break;
+ default:
+ if(!pos) { pos = 0; }
+ break;
+ }
+ if(pos > par.children.length) { pos = par.children.length; }
+ if(!node.id) { node.id = true; }
+ if(!this.check("create_node", node, par, pos)) { return false; }
+ if(node.id === true) { delete node.id; }
+ node = this._parse_model_from_json(node, par.id, par.parents.concat());
+ if(!node) { return false; }
+ tmp = this.get_node(node);
+ dpc = [];
+ dpc.push(node);
+ dpc = dpc.concat(tmp.children_d);
+ this.trigger('model', { "nodes" : dpc, "parent" : par.id });
+
+ par.children_d = par.children_d.concat(dpc);
+ for(i = 0, j = par.parents.length; i < j; i++) {
+ this._model.data[par.parents[i]].children_d = this._model.data[par.parents[i]].children_d.concat(dpc);
+ }
+ node = tmp;
+ tmp = [];
+ for(i = 0, j = par.children.length; i < j; i++) {
+ tmp[i >= pos ? i+1 : i] = par.children[i];
+ }
+ tmp[pos] = node.id;
+ par.children = tmp;
+
+ this.redraw_node(par, true);
+ if(callback) { callback.call(this, this.get_node(node)); }
+ /**
+ * triggered when a node is created
+ * @event
+ * @name create_node.jstree
+ * @param {Object} node
+ * @param {String} parent the parent's ID
+ * @param {Number} position the position of the new node among the parent's children
+ */
+ this.trigger('create_node', { "node" : this.get_node(node), "parent" : par.id, "position" : pos });
+ return node.id;
+ },
+ /**
+ * set the text value of a node
+ * @name rename_node(obj, val)
+ * @param {mixed} obj the node, you can pass an array to rename multiple nodes to the same name
+ * @param {String} val the new text value
+ * @return {Boolean}
+ * @trigger rename_node.jstree
+ */
+ rename_node : function (obj, val) {
+ var t1, t2, old;
+ if($.isArray(obj)) {
+ obj = obj.slice();
+ for(t1 = 0, t2 = obj.length; t1 < t2; t1++) {
+ this.rename_node(obj[t1], val);
+ }
+ return true;
+ }
+ obj = this.get_node(obj);
+ if(!obj || obj.id === '#') { return false; }
+ old = obj.text;
+ if(!this.check("rename_node", obj, this.get_parent(obj), val)) { return false; }
+ this.set_text(obj, val); // .apply(this, Array.prototype.slice.call(arguments))
+ /**
+ * triggered when a node is renamed
+ * @event
+ * @name rename_node.jstree
+ * @param {Object} node
+ * @param {String} text the new value
+ * @param {String} old the old value
+ */
+ this.trigger('rename_node', { "node" : obj, "text" : val, "old" : old });
+ return true;
+ },
+ /**
+ * remove a node
+ * @name delete_node(obj)
+ * @param {mixed} obj the node, you can pass an array to delete multiple nodes
+ * @return {Boolean}
+ * @trigger delete_node.jstree, changed.jstree
+ */
+ delete_node : function (obj) {
+ var t1, t2, par, pos, tmp, i, j, k, l, c;
+ if($.isArray(obj)) {
+ obj = obj.slice();
+ for(t1 = 0, t2 = obj.length; t1 < t2; t1++) {
+ this.delete_node(obj[t1]);
+ }
+ return true;
+ }
+ obj = this.get_node(obj);
+ if(!obj || obj.id === '#') { return false; }
+ par = this.get_node(obj.parent);
+ pos = $.inArray(obj.id, par.children);
+ c = false;
+ if(!this.check("delete_node", obj, par, pos)) { return false; }
+ if(pos !== -1) {
+ par.children = $.vakata.array_remove(par.children, pos);
+ }
+ tmp = obj.children_d.concat([]);
+ tmp.push(obj.id);
+ for(k = 0, l = tmp.length; k < l; k++) {
+ for(i = 0, j = obj.parents.length; i < j; i++) {
+ pos = $.inArray(tmp[k], this._model.data[obj.parents[i]].children_d);
+ if(pos !== -1) {
+ this._model.data[obj.parents[i]].children_d = $.vakata.array_remove(this._model.data[obj.parents[i]].children_d, pos);
+ }
+ }
+ if(this._model.data[tmp[k]].state.selected) {
+ c = true;
+ pos = $.inArray(tmp[k], this._data.core.selected);
+ if(pos !== -1) {
+ this._data.core.selected = $.vakata.array_remove(this._data.core.selected, pos);
+ }
+ }
+ }
+ /**
+ * triggered when a node is deleted
+ * @event
+ * @name delete_node.jstree
+ * @param {Object} node
+ * @param {String} parent the parent's ID
+ */
+ this.trigger('delete_node', { "node" : obj, "parent" : par.id });
+ if(c) {
+ this.trigger('changed', { 'action' : 'delete_node', 'node' : obj, 'selected' : this._data.core.selected, 'parent' : par.id });
+ }
+ for(k = 0, l = tmp.length; k < l; k++) {
+ delete this._model.data[tmp[k]];
+ }
+ this.redraw_node(par, true);
+ return true;
+ },
+ /**
+ * check if an operation is premitted on the tree. Used internally.
+ * @private
+ * @name check(chk, obj, par, pos)
+ * @param {String} chk the operation to check, can be "create_node", "rename_node", "delete_node", "copy_node" or "move_node"
+ * @param {mixed} obj the node
+ * @param {mixed} par the parent
+ * @param {mixed} pos the position to insert at, or if "rename_node" - the new name
+ * @return {Boolean}
+ */
+ check : function (chk, obj, par, pos) {
+ obj = obj && obj.id ? obj : this.get_node(obj);
+ par = par && par.id ? par : this.get_node(par);
+ var tmp = chk.match(/^move_node|copy_node|create_node$/i) ? par : obj,
+ chc = this.settings.core.check_callback;
+ if(chk === "move_node") {
+ if(obj.id === par.id || $.inArray(obj.id, par.children) === pos || $.inArray(par.id, obj.children_d) !== -1) {
+ return false;
+ }
+ }
+ tmp = this.get_node(tmp, true);
+ if(tmp.length) { tmp = tmp.data('jstree'); }
+ if(tmp && tmp.functions && (tmp.functions[chk] === false || tmp.functions[chk] === true)) {
+ return tmp.functions[chk];
+ }
+ if(chc === false || ($.isFunction(chc) && chc.call(this, chk, obj, par, pos) === false) || (chc && chc[chk] === false)) {
+ return false;
+ }
+ return true;
+ },
+ /**
+ * move a node to a new parent
+ * @name move_node(obj, par [, pos, callback, is_loaded])
+ * @param {mixed} obj the node to move, pass an array to move multiple nodes
+ * @param {mixed} par the new parent
+ * @param {mixed} pos the position to insert at ("first" and "last" are supported, as well as "before" and "after"), defaults to `0`
+ * @param {function} callback a function to call once the move is completed, receives 3 arguments - the node, the new parent and the position
+ * @param {Boolean} internal parameter indicating if the parent node has been loaded
+ * @trigger move_node.jstree
+ */
+ move_node : function (obj, par, pos, callback, is_loaded) {
+ var t1, t2, old_par, new_par, old_ins, is_multi, dpc, tmp, i, j, k, l, p;
+ if($.isArray(obj)) {
+ obj = obj.reverse().slice();
+ for(t1 = 0, t2 = obj.length; t1 < t2; t1++) {
+ this.move_node(obj[t1], par, pos, callback, is_loaded);
+ }
+ return true;
+ }
+ obj = obj && obj.id ? obj : this.get_node(obj);
+ par = this.get_node(par);
+ pos = pos === undefined ? 0 : pos;
+
+ if(!par || !obj || obj.id === '#') { return false; }
+ if(!pos.toString().match(/^(before|after)$/) && !is_loaded && !this.is_loaded(par)) {
+ return this.load_node(par, function () { this.move_node(obj, par, pos, callback, true); });
+ }
+
+ old_par = (obj.parent || '#').toString();
+ new_par = (!pos.toString().match(/^(before|after)$/) || par.id === '#') ? par : this.get_node(par.parent);
+ old_ins = this._model.data[obj.id] ? this : $.jstree.reference(obj.id);
+ is_multi = !old_ins || !old_ins._id || (this._id !== old_ins._id);
+ if(is_multi) {
+ if(this.copy_node(obj, par, pos, callback, is_loaded)) {
+ if(old_ins) { old_ins.delete_node(obj); }
+ return true;
+ }
+ return false;
+ }
+ //var m = this._model.data;
+ if(new_par.id === '#') {
+ if(pos === "before") { pos = "first"; }
+ if(pos === "after") { pos = "last"; }
+ }
+ switch(pos) {
+ case "before":
+ pos = $.inArray(par.id, new_par.children);
+ break;
+ case "after" :
+ pos = $.inArray(par.id, new_par.children) + 1;
+ break;
+ case "inside":
+ case "first":
+ pos = 0;
+ break;
+ case "last":
+ pos = new_par.children.length;
+ break;
+ default:
+ if(!pos) { pos = 0; }
+ break;
+ }
+ if(pos > new_par.children.length) { pos = new_par.children.length; }
+ if(!this.check("move_node", obj, new_par, pos)) { return false; }
+ if(obj.parent === new_par.id) {
+ dpc = new_par.children.concat();
+ tmp = $.inArray(obj.id, dpc);
+ if(tmp !== -1) {
+ dpc = $.vakata.array_remove(dpc, tmp);
+ if(pos > tmp) { pos--; }
+ }
+ tmp = [];
+ for(i = 0, j = dpc.length; i < j; i++) {
+ tmp[i >= pos ? i+1 : i] = dpc[i];
+ }
+ tmp[pos] = obj.id;
+ new_par.children = tmp;
+ this._node_changed(new_par.id);
+ this.redraw(new_par.id === '#');
+ }
+ else {
+ // clean old parent and up
+ tmp = obj.children_d.concat();
+ tmp.push(obj.id);
+ for(i = 0, j = obj.parents.length; i < j; i++) {
+ dpc = [];
+ p = old_ins._model.data[obj.parents[i]].children_d;
+ for(k = 0, l = p.length; k < l; k++) {
+ if($.inArray(p[k], tmp) === -1) {
+ dpc.push(p[k]);
+ }
+ }
+ old_ins._model.data[obj.parents[i]].children_d = dpc;
+ }
+ old_ins._model.data[old_par].children = $.vakata.array_remove_item(old_ins._model.data[old_par].children, obj.id);
+
+ // insert into new parent and up
+ for(i = 0, j = new_par.parents.length; i < j; i++) {
+ this._model.data[new_par.parents[i]].children_d = this._model.data[new_par.parents[i]].children_d.concat(tmp);
+ }
+ dpc = [];
+ for(i = 0, j = new_par.children.length; i < j; i++) {
+ dpc[i >= pos ? i+1 : i] = new_par.children[i];
+ }
+ dpc[pos] = obj.id;
+ new_par.children = dpc;
+ new_par.children_d.push(obj.id);
+ new_par.children_d = new_par.children_d.concat(obj.children_d);
+
+ // update object
+ obj.parent = new_par.id;
+ tmp = new_par.parents.concat();
+ tmp.unshift(new_par.id);
+ p = obj.parents.length;
+ obj.parents = tmp;
+
+ // update object children
+ tmp = tmp.concat();
+ for(i = 0, j = obj.children_d.length; i < j; i++) {
+ this._model.data[obj.children_d[i]].parents = this._model.data[obj.children_d[i]].parents.slice(0,p*-1);
+ Array.prototype.push.apply(this._model.data[obj.children_d[i]].parents, tmp);
+ }
+
+ this._node_changed(old_par);
+ this._node_changed(new_par.id);
+ this.redraw(old_par === '#' || new_par.id === '#');
+ }
+ if(callback) { callback.call(this, obj, new_par, pos); }
+ /**
+ * triggered when a node is moved
+ * @event
+ * @name move_node.jstree
+ * @param {Object} node
+ * @param {String} parent the parent's ID
+ * @param {Number} position the position of the node among the parent's children
+ * @param {String} old_parent the old parent of the node
+ * @param {Boolean} is_multi do the node and new parent belong to different instances
+ * @param {jsTree} old_instance the instance the node came from
+ * @param {jsTree} new_instance the instance of the new parent
+ */
+ this.trigger('move_node', { "node" : obj, "parent" : new_par.id, "position" : pos, "old_parent" : old_par, "is_multi" : is_multi, 'old_instance' : old_ins, 'new_instance' : this });
+ return true;
+ },
+ /**
+ * copy a node to a new parent
+ * @name copy_node(obj, par [, pos, callback, is_loaded])
+ * @param {mixed} obj the node to copy, pass an array to copy multiple nodes
+ * @param {mixed} par the new parent
+ * @param {mixed} pos the position to insert at ("first" and "last" are supported, as well as "before" and "after"), defaults to `0`
+ * @param {function} callback a function to call once the move is completed, receives 3 arguments - the node, the new parent and the position
+ * @param {Boolean} internal parameter indicating if the parent node has been loaded
+ * @trigger model.jstree copy_node.jstree
+ */
+ copy_node : function (obj, par, pos, callback, is_loaded) {
+ var t1, t2, dpc, tmp, i, j, node, old_par, new_par, old_ins, is_multi;
+ if($.isArray(obj)) {
+ obj = obj.reverse().slice();
+ for(t1 = 0, t2 = obj.length; t1 < t2; t1++) {
+ this.copy_node(obj[t1], par, pos, callback, is_loaded);
+ }
+ return true;
+ }
+ obj = obj && obj.id ? obj : this.get_node(obj);
+ par = this.get_node(par);
+ pos = pos === undefined ? 0 : pos;
+
+ if(!par || !obj || obj.id === '#') { return false; }
+ if(!pos.toString().match(/^(before|after)$/) && !is_loaded && !this.is_loaded(par)) {
+ return this.load_node(par, function () { this.copy_node(obj, par, pos, callback, true); });
+ }
+
+ old_par = (obj.parent || '#').toString();
+ new_par = (!pos.toString().match(/^(before|after)$/) || par.id === '#') ? par : this.get_node(par.parent);
+ old_ins = this._model.data[obj.id] ? this : $.jstree.reference(obj.id);
+ is_multi = !old_ins || !old_ins._id || (this._id !== old_ins._id);
+ if(new_par.id === '#') {
+ if(pos === "before") { pos = "first"; }
+ if(pos === "after") { pos = "last"; }
+ }
+ switch(pos) {
+ case "before":
+ pos = $.inArray(par.id, new_par.children);
+ break;
+ case "after" :
+ pos = $.inArray(par.id, new_par.children) + 1;
+ break;
+ case "inside":
+ case "first":
+ pos = 0;
+ break;
+ case "last":
+ pos = new_par.children.length;
+ break;
+ default:
+ if(!pos) { pos = 0; }
+ break;
+ }
+ if(pos > new_par.children.length) { pos = new_par.children.length; }
+ if(!this.check("copy_node", obj, new_par, pos)) { return false; }
+ node = old_ins ? old_ins.get_json(obj, { no_id : true, no_data : true, no_state : true }) : obj;
+ if(!node) { return false; }
+ if(node.id === true) { delete node.id; }
+ node = this._parse_model_from_json(node, new_par.id, new_par.parents.concat());
+ if(!node) { return false; }
+ tmp = this.get_node(node);
+ dpc = [];
+ dpc.push(node);
+ dpc = dpc.concat(tmp.children_d);
+ this.trigger('model', { "nodes" : dpc, "parent" : new_par.id });
+
+ // insert into new parent and up
+ for(i = 0, j = new_par.parents.length; i < j; i++) {
+ this._model.data[new_par.parents[i]].children_d = this._model.data[new_par.parents[i]].children_d.concat(dpc);
+ }
+ dpc = [];
+ for(i = 0, j = new_par.children.length; i < j; i++) {
+ dpc[i >= pos ? i+1 : i] = new_par.children[i];
+ }
+ dpc[pos] = tmp.id;
+ new_par.children = dpc;
+ new_par.children_d.push(tmp.id);
+ new_par.children_d = new_par.children_d.concat(tmp.children_d);
+
+ this._node_changed(new_par.id);
+ this.redraw(new_par.id === '#');
+ if(callback) { callback.call(this, tmp, new_par, pos); }
+ /**
+ * triggered when a node is copied
+ * @event
+ * @name copy_node.jstree
+ * @param {Object} node the copied node
+ * @param {Object} original the original node
+ * @param {String} parent the parent's ID
+ * @param {Number} position the position of the node among the parent's children
+ * @param {String} old_parent the old parent of the node
+ * @param {Boolean} is_multi do the node and new parent belong to different instances
+ * @param {jsTree} old_instance the instance the node came from
+ * @param {jsTree} new_instance the instance of the new parent
+ */
+ this.trigger('copy_node', { "node" : tmp, "original" : obj, "parent" : new_par.id, "position" : pos, "old_parent" : old_par, "is_multi" : is_multi, 'old_instance' : old_ins, 'new_instance' : this });
+ return tmp.id;
+ },
+ /**
+ * cut a node (a later call to `paste(obj)` would move the node)
+ * @name cut(obj)
+ * @param {mixed} obj multiple objects can be passed using an array
+ * @trigger cut.jstree
+ */
+ cut : function (obj) {
+ if(!obj) { obj = this._data.core.selected.concat(); }
+ if(!$.isArray(obj)) { obj = [obj]; }
+ if(!obj.length) { return false; }
+ var tmp = [], o, t1, t2;
+ for(t1 = 0, t2 = obj.length; t1 < t2; t1++) {
+ o = this.get_node(obj[t1]);
+ if(o && o.id && o.id !== '#') { tmp.push(o); }
+ }
+ if(!tmp.length) { return false; }
+ ccp_node = tmp;
+ ccp_inst = this;
+ ccp_mode = 'move_node';
+ /**
+ * triggered when nodes are added to the buffer for moving
+ * @event
+ * @name cut.jstree
+ * @param {Array} node
+ */
+ this.trigger('cut', { "node" : obj });
+ },
+ /**
+ * copy a node (a later call to `paste(obj)` would copy the node)
+ * @name copy(obj)
+ * @param {mixed} obj multiple objects can be passed using an array
+ * @trigger copy.jstre
+ */
+ copy : function (obj) {
+ if(!obj) { obj = this._data.core.selected.concat(); }
+ if(!$.isArray(obj)) { obj = [obj]; }
+ if(!obj.length) { return false; }
+ var tmp = [], o, t1, t2;
+ for(t1 = 0, t2 = obj.length; t1 < t2; t1++) {
+ o = this.get_node(obj[t1]);
+ if(o && o.id && o.id !== '#') { tmp.push(o); }
+ }
+ if(!tmp.length) { return false; }
+ ccp_node = tmp;
+ ccp_inst = this;
+ ccp_mode = 'copy_node';
+ /**
+ * triggered when nodes are added to the buffer for copying
+ * @event
+ * @name copy.jstree
+ * @param {Array} node
+ */
+ this.trigger('copy', { "node" : obj });
+ },
+ /**
+ * get the current buffer (any nodes that are waiting for a paste operation)
+ * @name get_buffer()
+ * @return {Object} an object consisting of `mode` ("copy_node" or "move_node"), `node` (an array of objects) and `inst` (the instance)
+ */
+ get_buffer : function () {
+ return { 'mode' : ccp_mode, 'node' : ccp_node, 'inst' : ccp_inst };
+ },
+ /**
+ * check if there is something in the buffer to paste
+ * @name can_paste()
+ * @return {Boolean}
+ */
+ can_paste : function () {
+ return ccp_mode !== false && ccp_node !== false; // && ccp_inst._model.data[ccp_node];
+ },
+ /**
+ * copy or move the previously cut or copied nodes to a new parent
+ * @name paste(obj)
+ * @param {mixed} obj the new parent
+ * @trigger paste.jstree
+ */
+ paste : function (obj) {
+ obj = this.get_node(obj);
+ if(!obj || !ccp_mode || !ccp_mode.match(/^(copy_node|move_node)$/) || !ccp_node) { return false; }
+ if(this[ccp_mode](ccp_node, obj)) {
+ /**
+ * triggered when paste is invoked
+ * @event
+ * @name paste.jstree
+ * @param {String} parent the ID of the receiving node
+ * @param {Array} node the nodes in the buffer
+ * @param {String} mode the performed operation - "copy_node" or "move_node"
+ */
+ this.trigger('paste', { "parent" : obj.id, "node" : ccp_node, "mode" : ccp_mode });
+ }
+ ccp_node = false;
+ ccp_mode = false;
+ ccp_inst = false;
+ },
+ /**
+ * put a node in edit mode (input field to rename the node)
+ * @name edit(obj [, default_text])
+ * @param {mixed} obj
+ * @param {String} default_text the text to populate the input with (if omitted the node text value is used)
+ */
+ edit : function (obj, default_text) {
+ obj = this._open_to(obj);
+ if(!obj || !obj.length) { return false; }
+ var rtl = this._data.core.rtl,
+ w = this.element.width(),
+ a = obj.children('.jstree-anchor'),
+ s = $('<span>'),
+ /*!
+ oi = obj.children("i:visible"),
+ ai = a.children("i:visible"),
+ w1 = oi.width() * oi.length,
+ w2 = ai.width() * ai.length,
+ */
+ t = typeof default_text === 'string' ? default_text : this.get_text(obj),
+ h1 = $("<"+"div />", { css : { "position" : "absolute", "top" : "-200px", "left" : (rtl ? "0px" : "-1000px"), "visibility" : "hidden" } }).appendTo("body"),
+ h2 = $("<"+"input />", {
+ "value" : t,
+ "class" : "jstree-rename-input",
+ // "size" : t.length,
+ "css" : {
+ "padding" : "0",
+ "border" : "1px solid silver",
+ "box-sizing" : "border-box",
+ "display" : "inline-block",
+ "height" : (this._data.core.li_height) + "px",
+ "lineHeight" : (this._data.core.li_height) + "px",
+ "width" : "150px" // will be set a bit further down
+ },
+ "blur" : $.proxy(function () {
+ var i = s.children(".jstree-rename-input"),
+ v = i.val();
+ if(v === "") { v = t; }
+ h1.remove();
+ s.replaceWith(a);
+ s.remove();
+ this.set_text(obj, t);
+ if(this.rename_node(obj, v) === false) {
+ this.set_text(obj, t); // move this up? and fix #483
+ }
+ }, this),
+ "keydown" : function (event) {
+ var key = event.which;
+ if(key === 27) {
+ this.value = t;
+ }
+ if(key === 27 || key === 13 || key === 37 || key === 38 || key === 39 || key === 40 || key === 32) {
+ event.stopImmediatePropagation();
+ }
+ if(key === 27 || key === 13) {
+ event.preventDefault();
+ this.blur();
+ }
+ },
+ "click" : function (e) { e.stopImmediatePropagation(); },
+ "mousedown" : function (e) { e.stopImmediatePropagation(); },
+ "keyup" : function (event) {
+ h2.width(Math.min(h1.text("pW" + this.value).width(),w));
+ },
+ "keypress" : function(event) {
+ if(event.which === 13) { return false; }
+ }
+ }),
+ fn = {
+ fontFamily : a.css('fontFamily') || '',
+ fontSize : a.css('fontSize') || '',
+ fontWeight : a.css('fontWeight') || '',
+ fontStyle : a.css('fontStyle') || '',
+ fontStretch : a.css('fontStretch') || '',
+ fontVariant : a.css('fontVariant') || '',
+ letterSpacing : a.css('letterSpacing') || '',
+ wordSpacing : a.css('wordSpacing') || ''
+ };
+ this.set_text(obj, "");
+ s.attr('class', a.attr('class')).append(a.contents().clone()).append(h2);
+ a.replaceWith(s);
+ h1.css(fn);
+ h2.css(fn).width(Math.min(h1.text("pW" + h2[0].value).width(),w))[0].select();
+ },
+
+
+ /**
+ * changes the theme
+ * @name set_theme(theme_name [, theme_url])
+ * @param {String} theme_name the name of the new theme to apply
+ * @param {mixed} theme_url the location of the CSS file for this theme. Omit or set to `false` if you manually included the file. Set to `true` to autoload from the `core.themes.dir` directory.
+ * @trigger set_theme.jstree
+ */
+ set_theme : function (theme_name, theme_url) {
+ if(!theme_name) { return false; }
+ if(theme_url === true) {
+ var dir = this.settings.core.themes.dir;
+ if(!dir) { dir = $.jstree.path + '/themes'; }
+ theme_url = dir + '/' + theme_name + '/style.css';
+ }
+ if(theme_url && $.inArray(theme_url, themes_loaded) === -1) {
+ $('head').append('<'+'link rel="stylesheet" href="' + theme_url + '" type="text/css" />');
+ themes_loaded.push(theme_url);
+ }
+ if(this._data.core.themes.name) {
+ this.element.removeClass('jstree-' + this._data.core.themes.name);
+ }
+ this._data.core.themes.name = theme_name;
+ this.element.addClass('jstree-' + theme_name);
+ this.element[this.settings.core.themes.responsive ? 'addClass' : 'removeClass' ]('jstree-' + theme_name + '-responsive');
+ /**
+ * triggered when a theme is set
+ * @event
+ * @name set_theme.jstree
+ * @param {String} theme the new theme
+ */
+ this.trigger('set_theme', { 'theme' : theme_name });
+ },
+ /**
+ * gets the name of the currently applied theme name
+ * @name get_theme()
+ * @return {String}
+ */
+ get_theme : function () { return this._data.core.themes.name; },
+ /**
+ * changes the theme variant (if the theme has variants)
+ * @name set_theme_variant(variant_name)
+ * @param {String|Boolean} variant_name the variant to apply (if `false` is used the current variant is removed)
+ */
+ set_theme_variant : function (variant_name) {
+ if(this._data.core.themes.variant) {
+ this.element.removeClass('jstree-' + this._data.core.themes.name + '-' + this._data.core.themes.variant);
+ }
+ this._data.core.themes.variant = variant_name;
+ if(variant_name) {
+ this.element.addClass('jstree-' + this._data.core.themes.name + '-' + this._data.core.themes.variant);
+ }
+ },
+ /**
+ * gets the name of the currently applied theme variant
+ * @name get_theme()
+ * @return {String}
+ */
+ get_theme_variant : function () { return this._data.core.themes.variant; },
+ /**
+ * shows a striped background on the container (if the theme supports it)
+ * @name show_stripes()
+ */
+ show_stripes : function () { this._data.core.themes.stripes = true; this.get_container_ul().addClass("jstree-striped"); },
+ /**
+ * hides the striped background on the container
+ * @name hide_stripes()
+ */
+ hide_stripes : function () { this._data.core.themes.stripes = false; this.get_container_ul().removeClass("jstree-striped"); },
+ /**
+ * toggles the striped background on the container
+ * @name toggle_stripes()
+ */
+ toggle_stripes : function () { if(this._data.core.themes.stripes) { this.hide_stripes(); } else { this.show_stripes(); } },
+ /**
+ * shows the connecting dots (if the theme supports it)
+ * @name show_dots()
+ */
+ show_dots : function () { this._data.core.themes.dots = true; this.get_container_ul().removeClass("jstree-no-dots"); },
+ /**
+ * hides the connecting dots
+ * @name hide_dots()
+ */
+ hide_dots : function () { this._data.core.themes.dots = false; this.get_container_ul().addClass("jstree-no-dots"); },
+ /**
+ * toggles the connecting dots
+ * @name toggle_dots()
+ */
+ toggle_dots : function () { if(this._data.core.themes.dots) { this.hide_dots(); } else { this.show_dots(); } },
+ /**
+ * show the node icons
+ * @name show_icons()
+ */
+ show_icons : function () { this._data.core.themes.icons = true; this.get_container_ul().removeClass("jstree-no-icons"); },
+ /**
+ * hide the node icons
+ * @name hide_icons()
+ */
+ hide_icons : function () { this._data.core.themes.icons = false; this.get_container_ul().addClass("jstree-no-icons"); },
+ /**
+ * toggle the node icons
+ * @name toggle_icons()
+ */
+ toggle_icons : function () { if(this._data.core.themes.icons) { this.hide_icons(); } else { this.show_icons(); } },
+ /**
+ * set the node icon for a node
+ * @name set_icon(obj, icon)
+ * @param {mixed} obj
+ * @param {String} icon the new icon - can be a path to an icon or a className, if using an image that is in the current directory use a `./` prefix, otherwise it will be detected as a class
+ */
+ set_icon : function (obj, icon) {
+ var t1, t2, dom, old;
+ if($.isArray(obj)) {
+ obj = obj.slice();
+ for(t1 = 0, t2 = obj.length; t1 < t2; t1++) {
+ this.set_icon(obj[t1], icon);
+ }
+ return true;
+ }
+ obj = this.get_node(obj);
+ if(!obj || obj.id === '#') { return false; }
+ old = obj.icon;
+ obj.icon = icon;
+ dom = this.get_node(obj, true).children(".jstree-anchor").children(".jstree-themeicon");
+ if(icon === false) {
+ this.hide_icon(obj);
+ }
+ else if(icon === true) {
+ dom.removeClass('jstree-themeicon-custom ' + old).css("background","").removeAttr("rel");
+ }
+ else if(icon.indexOf("/") === -1 && icon.indexOf(".") === -1) {
+ dom.removeClass(old).css("background","");
+ dom.addClass(icon + ' jstree-themeicon-custom').attr("rel",icon);
+ }
+ else {
+ dom.removeClass(old).css("background","");
+ dom.addClass('jstree-themeicon-custom').css("background", "url('" + icon + "') center center no-repeat").attr("rel",icon);
+ }
+ return true;
+ },
+ /**
+ * get the node icon for a node
+ * @name get_icon(obj)
+ * @param {mixed} obj
+ * @return {String}
+ */
+ get_icon : function (obj) {
+ obj = this.get_node(obj);
+ return (!obj || obj.id === '#') ? false : obj.icon;
+ },
+ /**
+ * hide the icon on an individual node
+ * @name hide_icon(obj)
+ * @param {mixed} obj
+ */
+ hide_icon : function (obj) {
+ var t1, t2;
+ if($.isArray(obj)) {
+ obj = obj.slice();
+ for(t1 = 0, t2 = obj.length; t1 < t2; t1++) {
+ this.hide_icon(obj[t1]);
+ }
+ return true;
+ }
+ obj = this.get_node(obj);
+ if(!obj || obj === '#') { return false; }
+ obj.icon = false;
+ this.get_node(obj, true).children("a").children(".jstree-themeicon").addClass('jstree-themeicon-hidden');
+ return true;
+ },
+ /**
+ * show the icon on an individual node
+ * @name show_icon(obj)
+ * @param {mixed} obj
+ */
+ show_icon : function (obj) {
+ var t1, t2, dom;
+ if($.isArray(obj)) {
+ obj = obj.slice();
+ for(t1 = 0, t2 = obj.length; t1 < t2; t1++) {
+ this.show_icon(obj[t1]);
+ }
+ return true;
+ }
+ obj = this.get_node(obj);
+ if(!obj || obj === '#') { return false; }
+ dom = this.get_node(obj, true);
+ obj.icon = dom.length ? dom.children("a").children(".jstree-themeicon").attr('rel') : true;
+ if(!obj.icon) { obj.icon = true; }
+ dom.children("a").children(".jstree-themeicon").removeClass('jstree-themeicon-hidden');
+ return true;
+ }
+ };
+
+ // helpers
+ $.vakata = {};
+ // reverse
+ $.fn.vakata_reverse = [].reverse;
+ // collect attributes
+ $.vakata.attributes = function(node, with_values) {
+ node = $(node)[0];
+ var attr = with_values ? {} : [];
+ if(node && node.attributes) {
+ $.each(node.attributes, function (i, v) {
+ if($.inArray(v.nodeName.toLowerCase(),['style','contenteditable','hasfocus','tabindex']) !== -1) { return; }
+ if(v.nodeValue !== null && $.trim(v.nodeValue) !== '') {
+ if(with_values) { attr[v.nodeName] = v.nodeValue; }
+ else { attr.push(v.nodeName); }
+ }
+ });
+ }
+ return attr;
+ };
+ $.vakata.array_unique = function(array) {
+ var a = [], i, j, l;
+ for(i = 0, l = array.length; i < l; i++) {
+ for(j = 0; j <= i; j++) {
+ if(array[i] === array[j]) {
+ break;
+ }
+ }
+ if(j === i) { a.push(array[i]); }
+ }
+ return a;
+ };
+ // remove item from array
+ $.vakata.array_remove = function(array, from, to) {
+ var rest = array.slice((to || from) + 1 || array.length);
+ array.length = from < 0 ? array.length + from : from;
+ array.push.apply(array, rest);
+ return array;
+ };
+ // remove item from array
+ $.vakata.array_remove_item = function(array, item) {
+ var tmp = $.inArray(item, array);
+ return tmp !== -1 ? $.vakata.array_remove(array, tmp) : array;
+ };
+ // browser sniffing
+ (function () {
+ var browser = {},
+ b_match = function(ua) {
+ ua = ua.toLowerCase();
+
+ var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
+ /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
+ /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
+ /(msie) ([\w.]+)/.exec( ua ) ||
+ (ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua )) ||
+ [];
+ return {
+ browser: match[1] || "",
+ version: match[2] || "0"
+ };
+ },
+ matched = b_match(window.navigator.userAgent);
+ if(matched.browser) {
+ browser[ matched.browser ] = true;
+ browser.version = matched.version;
+ }
+ if(browser.chrome) {
+ browser.webkit = true;
+ }
+ else if(browser.webkit) {
+ browser.safari = true;
+ }
+ $.vakata.browser = browser;
+ }());
+ if($.vakata.browser.msie && $.vakata.browser.version < 8) {
+ $.jstree.defaults.core.animation = 0;
+ }
+ (function ($, undefined) {
+ // private function for json quoting strings
+ var _quote = function (str) {
+ var escapeable = /["\\\x00-\x1f\x7f-\x9f]/g,
+ meta = { '\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"' :'\\"','\\':'\\\\' };
+ if(str.match(escapeable)) {
+ return '"' + str.replace(escapeable, function (a) {
+ var c = meta[a];
+ if(typeof c === 'string') { return c; }
+ c = a.charCodeAt();
+ return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
+ }) + '"';
+ }
+ return '"' + str + '"';
+ };
+ $.vakata.json = {
+ encode : (JSON && JSON.stringify ? JSON.stringify : function (o) {
+ if (o === null) { return "null"; }
+
+ var tmp = [], i;
+ switch(typeof o) {
+ case "undefined":
+ return undefined;
+ case "number":
+ case "boolean":
+ return o.toString();
+ case "string":
+ return _quote(o);
+ case "object":
+ if($.isFunction(o.toJSON)) {
+ return $.vakata.json.encode(o.toJSON());
+ }
+ if(o.constructor === Date) {
+ return '"' +
+ o.getUTCFullYear() + '-' +
+ String("0" + (o.getUTCMonth() + 1)).slice(-2) + '-' +
+ String("0" + o.getUTCDate()).slice(-2) + 'T' +
+ String("0" + o.getUTCHours()).slice(-2) + ':' +
+ String("0" + o.getUTCMinutes()).slice(-2) + ':' +
+ String("0" + o.getUTCSeconds()).slice(-2) + '.' +
+ String("00" + o.getUTCMilliseconds()).slice(-3) + 'Z"';
+ }
+ if(o.constructor === Array) {
+ for(i = 0; i < o.length; i++) {
+ tmp.push( $.vakata.json.encode(o[i]) || "null" );
+ }
+ return "[" + tmp.join(",") + "]";
+ }
+
+ $.each(o, function (i, v) {
+ if($.isFunction(v)) { return true; }
+ i = typeof i === "number" ? '"' + i + '"' : _quote(i);
+ v = $.vakata.json.encode(v);
+ tmp.push(i + ":" + v);
+ });
+ return "{" + tmp.join(", ") + "}";
+ }
+ }),
+ decode : (JSON && JSON.parse ? JSON.parse : function (json) {
+ return $.parseJSON(json);
+ })
+ };
+ }(jQuery));
+
+/**
+ * ### Checkbox plugin
+ *
+ * This plugin renders checkbox icons in front of each node, making multiple selection much easier.
+ * It also supports tri-state behavior, meaning that if a node has a few of its children checked it will be rendered as undetermined, and state will be propagated up.
+ */
+
+ var _i = document.createElement('I');
+ _i.className = 'jstree-icon jstree-checkbox';
+ /**
+ * stores all defaults for the checkbox plugin
+ * @name $.jstree.defaults.checkbox
+ * @plugin checkbox
+ */
+ $.jstree.defaults.checkbox = {
+ /**
+ * a boolean indicating if checkboxes should be visible (can be changed at a later time using `show_checkboxes()` and `hide_checkboxes`). Defaults to `true`.
+ * @name $.jstree.defaults.checkbox.visible
+ * @plugin checkbox
+ */
+ visible : true,
+ /**
+ * a boolean indicating if checkboxes should cascade down and have an undetermined state. Defaults to `true`.
+ * @name $.jstree.defaults.checkbox.three_state
+ * @plugin checkbox
+ */
+ three_state : true,
+ /**
+ * a boolean indicating if clicking anywhere on the node should act as clicking on the checkbox. Defaults to `true`.
+ * @name $.jstree.defaults.checkbox.whole_node
+ * @plugin checkbox
+ */
+ whole_node : true,
+ /**
+ * a boolean indicating if the selected style of a node should be kept, or removed. Defaults to `true`.
+ * @name $.jstree.defaults.checkbox.keep_selected_style
+ * @plugin checkbox
+ */
+ keep_selected_style : true
+ };
+ $.jstree.plugins.checkbox = function (options, parent) {
+ this.bind = function () {
+ parent.bind.call(this);
+ this._data.checkbox.uto = false;
+ this.element
+ .on("init.jstree", $.proxy(function () {
+ this._data.checkbox.visible = this.settings.checkbox.visible;
+ if(!this.settings.checkbox.keep_selected_style) {
+ this.element.addClass('jstree-checkbox-no-clicked');
+ }
+ }, this))
+ .on("loading.jstree", $.proxy(function () {
+ this[ this._data.checkbox.visible ? 'show_checkboxes' : 'hide_checkboxes' ]();
+ }, this));
+ if(this.settings.checkbox.three_state) {
+ this.element
+ .on('changed.jstree move_node.jstree copy_node.jstree redraw.jstree open_node.jstree', $.proxy(function () {
+ if(this._data.checkbox.uto) { clearTimeout(this._data.checkbox.uto); }
+ this._data.checkbox.uto = setTimeout($.proxy(this._undetermined, this), 50);
+ }, this))
+ .on('model.jstree', $.proxy(function (e, data) {
+ var m = this._model.data,
+ p = m[data.parent],
+ dpc = data.nodes,
+ chd = [],
+ c, i, j, k, l, tmp;
+
+ // apply down
+ if(p.state.selected) {
+ for(i = 0, j = dpc.length; i < j; i++) {
+ m[dpc[i]].state.selected = true;
+ }
+ this._data.core.selected = this._data.core.selected.concat(dpc);
+ }
+ else {
+ for(i = 0, j = dpc.length; i < j; i++) {
+ if(m[dpc[i]].state.selected) {
+ for(k = 0, l = m[dpc[i]].children_d.length; k < l; k++) {
+ m[m[dpc[i]].children_d[k]].state.selected = true;
+ }
+ this._data.core.selected = this._data.core.selected.concat(m[dpc[i]].children_d);
+ }
+ }
+ }
+
+ // apply up
+ for(i = 0, j = p.children_d.length; i < j; i++) {
+ if(!m[p.children_d[i]].children.length) {
+ chd.push(m[p.children_d[i]].parent);
+ }
+ }
+ chd = $.vakata.array_unique(chd);
+ for(k = 0, l = chd.length; k < l; k++) {
+ p = m[chd[k]];
+ while(p && p.id !== '#') {
+ c = 0;
+ for(i = 0, j = p.children.length; i < j; i++) {
+ c += m[p.children[i]].state.selected;
+ }
+ if(c === j) {
+ p.state.selected = true;
+ this._data.core.selected.push(p.id);
+ tmp = this.get_node(p, true);
+ if(tmp && tmp.length) {
+ tmp.children('.jstree-anchor').addClass('jstree-clicked');
+ }
+ }
+ else {
+ break;
+ }
+ p = this.get_node(p.parent);
+ }
+ }
+ this._data.core.selected = $.vakata.array_unique(this._data.core.selected);
+ }, this))
+ .on('select_node.jstree', $.proxy(function (e, data) {
+ var obj = data.node,
+ m = this._model.data,
+ par = this.get_node(obj.parent),
+ dom = this.get_node(obj, true),
+ i, j, c, tmp;
+ this._data.core.selected = $.vakata.array_unique(this._data.core.selected.concat(obj.children_d));
+ for(i = 0, j = obj.children_d.length; i < j; i++) {
+ m[obj.children_d[i]].state.selected = true;
+ }
+ while(par && par.id !== '#') {
+ c = 0;
+ for(i = 0, j = par.children.length; i < j; i++) {
+ c += m[par.children[i]].state.selected;
+ }
+ if(c === j) {
+ par.state.selected = true;
+ this._data.core.selected.push(par.id);
+ tmp = this.get_node(par, true);
+ if(tmp && tmp.length) {
+ tmp.children('.jstree-anchor').addClass('jstree-clicked');
+ }
+ }
+ else {
+ break;
+ }
+ par = this.get_node(par.parent);
+ }
+ if(dom.length) {
+ dom.find('.jstree-anchor').addClass('jstree-clicked');
+ }
+ }, this))
+ .on('deselect_node.jstree', $.proxy(function (e, data) {
+ var obj = data.node,
+ dom = this.get_node(obj, true),
+ i, j, tmp;
+ for(i = 0, j = obj.children_d.length; i < j; i++) {
+ this._model.data[obj.children_d[i]].state.selected = false;
+ }
+ for(i = 0, j = obj.parents.length; i < j; i++) {
+ this._model.data[obj.parents[i]].state.selected = false;
+ tmp = this.get_node(obj.parents[i], true);
+ if(tmp && tmp.length) {
+ tmp.children('.jstree-anchor').removeClass('jstree-clicked');
+ }
+ }
+ tmp = [];
+ for(i = 0, j = this._data.core.selected.length; i < j; i++) {
+ if($.inArray(this._data.core.selected[i], obj.children_d) === -1 && $.inArray(this._data.core.selected[i], obj.parents) === -1) {
+ tmp.push(this._data.core.selected[i]);
+ }
+ }
+ this._data.core.selected = $.vakata.array_unique(tmp);
+ if(dom.length) {
+ dom.find('.jstree-anchor').removeClass('jstree-clicked');
+ }
+ }, this))
+ .on('delete_node.jstree', $.proxy(function (e, data) {
+ var p = this.get_node(data.parent),
+ m = this._model.data,
+ i, j, c, tmp;
+ while(p && p.id !== '#') {
+ c = 0;
+ for(i = 0, j = p.children.length; i < j; i++) {
+ c += m[p.children[i]].state.selected;
+ }
+ if(c === j) {
+ p.state.selected = true;
+ this._data.core.selected.push(p.id);
+ tmp = this.get_node(p, true);
+ if(tmp && tmp.length) {
+ tmp.children('.jstree-anchor').addClass('jstree-clicked');
+ }
+ }
+ else {
+ break;
+ }
+ p = this.get_node(p.parent);
+ }
+ }, this))
+ .on('move_node.jstree', $.proxy(function (e, data) {
+ var is_multi = data.is_multi,
+ old_par = data.old_parent,
+ new_par = this.get_node(data.parent),
+ m = this._model.data,
+ p, c, i, j, tmp;
+ if(!is_multi) {
+ p = this.get_node(old_par);
+ while(p && p.id !== '#') {
+ c = 0;
+ for(i = 0, j = p.children.length; i < j; i++) {
+ c += m[p.children[i]].state.selected;
+ }
+ if(c === j) {
+ p.state.selected = true;
+ this._data.core.selected.push(p.id);
+ tmp = this.get_node(p, true);
+ if(tmp && tmp.length) {
+ tmp.children('.jstree-anchor').addClass('jstree-clicked');
+ }
+ }
+ else {
+ break;
+ }
+ p = this.get_node(p.parent);
+ }
+ }
+ p = new_par;
+ while(p && p.id !== '#') {
+ c = 0;
+ for(i = 0, j = p.children.length; i < j; i++) {
+ c += m[p.children[i]].state.selected;
+ }
+ if(c === j) {
+ if(!p.state.selected) {
+ p.state.selected = true;
+ this._data.core.selected.push(p.id);
+ tmp = this.get_node(p, true);
+ if(tmp && tmp.length) {
+ tmp.children('.jstree-anchor').addClass('jstree-clicked');
+ }
+ }
+ }
+ else {
+ if(p.state.selected) {
+ p.state.selected = false;
+ this._data.core.selected = $.vakata.array_remove_item(this._data.core.selected, p.id);
+ tmp = this.get_node(p, true);
+ if(tmp && tmp.length) {
+ tmp.children('.jstree-anchor').removeClass('jstree-clicked');
+ }
+ }
+ else {
+ break;
+ }
+ }
+ p = this.get_node(p.parent);
+ }
+ }, this));
+ }
+ };
+ /**
+ * set the undetermined state where and if necessary. Used internally.
+ * @private
+ * @name _undetermined()
+ * @plugin checkbox
+ */
+ this._undetermined = function () {
+ var i, j, m = this._model.data, s = this._data.core.selected, p = [], t = this;
+ for(i = 0, j = s.length; i < j; i++) {
+ if(m[s[i]] && m[s[i]].parents) {
+ p = p.concat(m[s[i]].parents);
+ }
+ }
+ // attempt for server side undetermined state
+ this.element.find('.jstree-closed').not(':has(ul)')
+ .each(function () {
+ var tmp = t.get_node(this);
+ if(!tmp.state.loaded && tmp.original && tmp.original.state && tmp.original.state.undetermined && tmp.original.state.undetermined === true) {
+ p.push(tmp.id);
+ p = p.concat(tmp.parents);
+ }
+ });
+ p = $.vakata.array_unique(p);
+ i = $.inArray('#', p);
+ if(i !== -1) {
+ p = $.vakata.array_remove(p, i);
+ }
+
+ this.element.find('.jstree-undetermined').removeClass('jstree-undetermined');
+ for(i = 0, j = p.length; i < j; i++) {
+ if(!m[p[i]].state.selected) {
+ s = this.get_node(p[i], true);
+ if(s && s.length) {
+ s.children('a').children('.jstree-checkbox').addClass('jstree-undetermined');
+ }
+ }
+ }
+ };
+ this.redraw_node = function(obj, deep, is_callback) {
+ obj = parent.redraw_node.call(this, obj, deep, is_callback);
+ if(obj) {
+ var tmp = obj.getElementsByTagName('A')[0];
+ tmp.insertBefore(_i.cloneNode(), tmp.childNodes[0]);
+ }
+ if(!is_callback && this.settings.checkbox.three_state) {
+ if(this._data.checkbox.uto) { clearTimeout(this._data.checkbox.uto); }
+ this._data.checkbox.uto = setTimeout($.proxy(this._undetermined, this), 50);
+ }
+ return obj;
+ };
+ this.activate_node = function (obj, e) {
+ if(this.settings.checkbox.whole_node || $(e.target).hasClass('jstree-checkbox')) {
+ e.ctrlKey = true;
+ }
+ return parent.activate_node.call(this, obj, e);
+ };
+ /**
+ * show the node checkbox icons
+ * @name show_checkboxes()
+ * @plugin checkbox
+ */
+ this.show_checkboxes = function () { this._data.core.themes.checkboxes = true; this.element.children("ul").removeClass("jstree-no-checkboxes"); };
+ /**
+ * hide the node checkbox icons
+ * @name hide_checkboxes()
+ * @plugin checkbox
+ */
+ this.hide_checkboxes = function () { this._data.core.themes.checkboxes = false; this.element.children("ul").addClass("jstree-no-checkboxes"); };
+ /**
+ * toggle the node icons
+ * @name toggle_checkboxes()
+ * @plugin checkbox
+ */
+ this.toggle_checkboxes = function () { if(this._data.core.themes.checkboxes) { this.hide_checkboxes(); } else { this.show_checkboxes(); } };
+ };
+
+ // include the checkbox plugin by default
+ // $.jstree.defaults.plugins.push("checkbox");
+
+/**
+ * ### Contextmenu plugin
+ *
+ * Shows a context menu when a node is right-clicked.
+ */
+// TODO: move logic outside of function + check multiple move
+
+ /**
+ * stores all defaults for the contextmenu plugin
+ * @name $.jstree.defaults.contextmenu
+ * @plugin contextmenu
+ */
+ $.jstree.defaults.contextmenu = {
+ /**
+ * a boolean indicating if the node should be selected when the context menu is invoked on it. Defaults to `true`.
+ * @name $.jstree.defaults.contextmenu.select_node
+ * @plugin contextmenu
+ */
+ select_node : true,
+ /**
+ * a boolean indicating if the menu should be shown aligned with the node. Defaults to `true`, otherwise the mouse coordinates are used.
+ * @name $.jstree.defaults.contextmenu.show_at_node
+ * @plugin contextmenu
+ */
+ show_at_node : true,
+ /**
+ * an object of actions, or a function that accepts a node and a callback function and calls the callback function with an object of actions available for that node (you can also return the items too).
+ *
+ * Each action consists of a key (a unique name) and a value which is an object with the following properties (only label and action are required):
+ *
+ * * `separator_before` - a boolean indicating if there should be a separator before this item
+ * * `separator_after` - a boolean indicating if there should be a separator after this item
+ * * `_disabled` - a boolean indicating if this action should be disabled
+ * * `label` - a string - the name of the action
+ * * `action` - a function to be executed if this item is chosen
+ * * `icon` - a string, can be a path to an icon or a className, if using an image that is in the current directory use a `./` prefix, otherwise it will be detected as a class
+ * * `shortcut` - keyCode which will trigger the action if the menu is open (for example `113` for rename, which equals F2)
+ * * `shortcut_label` - shortcut label (like for example `F2` for rename)
+ *
+ * @name $.jstree.defaults.contextmenu.items
+ * @plugin contextmenu
+ */
+ items : function (o, cb) { // Could be an object directly
+ cb({
+ "create" : {
+ "separator_before" : false,
+ "separator_after" : true,
+ "_disabled" : false, //(this.check("create_node", data.reference, {}, "last")),
+ "label" : "Create",
+ "action" : function (data) {
+ var inst = $.jstree.reference(data.reference),
+ obj = inst.get_node(data.reference);
+ inst.create_node(obj, {}, "last", function (new_node) {
+ setTimeout(function () { inst.edit(new_node); },0);
+ });
+ }
+ },
+ "rename" : {
+ "separator_before" : false,
+ "separator_after" : false,
+ "_disabled" : false, //(this.check("rename_node", data.reference, this.get_parent(data.reference), "")),
+ "label" : "Rename",
+ /*
+ "shortcut" : 113,
+ "shortcut_label" : 'F2',
+ "icon" : "glyphicon glyphicon-leaf",
+ */
+ "action" : function (data) {
+ var inst = $.jstree.reference(data.reference),
+ obj = inst.get_node(data.reference);
+ inst.edit(obj);
+ }
+ },
+ "remove" : {
+ "separator_before" : false,
+ "icon" : false,
+ "separator_after" : false,
+ "_disabled" : false, //(this.check("delete_node", data.reference, this.get_parent(data.reference), "")),
+ "label" : "Delete",
+ "action" : function (data) {
+ var inst = $.jstree.reference(data.reference),
+ obj = inst.get_node(data.reference);
+ if(inst.is_selected(obj)) {
+ inst.delete_node(inst.get_selected());
+ }
+ else {
+ inst.delete_node(obj);
+ }
+ }
+ },
+ "ccp" : {
+ "separator_before" : true,
+ "icon" : false,
+ "separator_after" : false,
+ "label" : "Edit",
+ "action" : false,
+ "submenu" : {
+ "cut" : {
+ "separator_before" : false,
+ "separator_after" : false,
+ "label" : "Cut",
+ "action" : function (data) {
+ var inst = $.jstree.reference(data.reference),
+ obj = inst.get_node(data.reference);
+ if(inst.is_selected(obj)) {
+ inst.cut(inst.get_selected());
+ }
+ else {
+ inst.cut(obj);
+ }
+ }
+ },
+ "copy" : {
+ "separator_before" : false,
+ "icon" : false,
+ "separator_after" : false,
+ "label" : "Copy",
+ "action" : function (data) {
+ var inst = $.jstree.reference(data.reference),
+ obj = inst.get_node(data.reference);
+ if(inst.is_selected(obj)) {
+ inst.copy(inst.get_selected());
+ }
+ else {
+ inst.copy(obj);
+ }
+ }
+ },
+ "paste" : {
+ "separator_before" : false,
+ "icon" : false,
+ "_disabled" : !(this.can_paste()),
+ "separator_after" : false,
+ "label" : "Paste",
+ "action" : function (data) {
+ var inst = $.jstree.reference(data.reference),
+ obj = inst.get_node(data.reference);
+ inst.paste(obj);
+ }
+ }
+ }
+ }
+ });
+ }
+ };
+
+ $.jstree.plugins.contextmenu = function (options, parent) {
+ this.bind = function () {
+ parent.bind.call(this);
+
+ this.element
+ .on("contextmenu.jstree", "a", $.proxy(function (e) {
+ e.preventDefault();
+ if(!this.is_loading(e.currentTarget)) {
+ this.show_contextmenu(e.currentTarget, e.pageX, e.pageY);
+ }
+ }, this))
+ .on("click.jstree", "a", $.proxy(function (e) {
+ if(this._data.contextmenu.visible) {
+ $.vakata.context.hide();
+ }
+ }, this));
+ $(document).on("context_hide.vakata", $.proxy(function () { this._data.contextmenu.visible = false; }, this));
+ };
+ this.teardown = function () {
+ if(this._data.contextmenu.visible) {
+ $.vakata.context.hide();
+ }
+ parent.teardown.call(this);
+ };
+
+ /**
+ * prepare and show the context menu for a node
+ * @name show_contextmenu(obj [, x, y])
+ * @param {mixed} obj the node
+ * @param {Number} x the x-coordinate relative to the document to show the menu at
+ * @param {Number} y the y-coordinate relative to the document to show the menu at
+ * @plugin contextmenu
+ * @trigger show_contextmenu.jstree
+ */
+ this.show_contextmenu = function (obj, x, y) {
+ obj = this.get_node(obj);
+ if(!obj || obj.id === '#') { return false; }
+ var s = this.settings.contextmenu,
+ d = this.get_node(obj, true),
+ a = d.children(".jstree-anchor"),
+ o = false,
+ i = false;
+ if(s.show_at_node || x === undefined || y === undefined) {
+ o = a.offset();
+ x = o.left;
+ y = o.top + this._data.core.li_height;
+ }
+ if(this.settings.contextmenu.select_node && !this.is_selected(obj)) {
+ this.deselect_all();
+ this.select_node(obj);
+ }
+
+ i = s.items;
+ if($.isFunction(i)) {
+ i = i.call(this, obj, $.proxy(function (i) {
+ this._show_contextmenu(obj, x, y, i);
+ }, this));
+ }
+ if($.isPlainObject(i)) {
+ this._show_contextmenu(obj, x, y, i);
+ }
+ };
+ /**
+ * show the prepared context menu for a node
+ * @name _show_contextmenu(obj, x, y, i)
+ * @param {mixed} obj the node
+ * @param {Number} x the x-coordinate relative to the document to show the menu at
+ * @param {Number} y the y-coordinate relative to the document to show the menu at
+ * @param {Number} i the object of items to show
+ * @plugin contextmenu
+ * @trigger show_contextmenu.jstree
+ * @private
+ */
+ this._show_contextmenu = function (obj, x, y, i) {
+ var d = this.get_node(obj, true),
+ a = d.children(".jstree-anchor");
+ $(document).one("context_show.vakata", $.proxy(function (e, data) {
+ var cls = 'jstree-contextmenu jstree-' + this.get_theme() + '-contextmenu';
+ $(data.element).addClass(cls);
+ }, this));
+ this._data.contextmenu.visible = true;
+ $.vakata.context.show(a, { 'x' : x, 'y' : y }, i);
+ /**
+ * triggered when the contextmenu is shown for a node
+ * @event
+ * @name show_contextmenu.jstree
+ * @param {Object} node the node
+ * @param {Number} x the x-coordinate of the menu relative to the document
+ * @param {Number} y the y-coordinate of the menu relative to the document
+ * @plugin contextmenu
+ */
+ this.trigger('show_contextmenu', { "node" : obj, "x" : x, "y" : y });
+ };
+ };
+
+ // contextmenu helper
+ (function ($) {
+ var right_to_left = false,
+ vakata_context = {
+ element : false,
+ reference : false,
+ position_x : 0,
+ position_y : 0,
+ items : [],
+ html : "",
+ is_visible : false
+ };
+
+ $.vakata.context = {
+ settings : {
+ hide_onmouseleave : 0,
+ icons : true
+ },
+ _trigger : function (event_name) {
+ $(document).triggerHandler("context_" + event_name + ".vakata", {
+ "reference" : vakata_context.reference,
+ "element" : vakata_context.element,
+ "position" : {
+ "x" : vakata_context.position_x,
+ "y" : vakata_context.position_y
+ }
+ });
+ },
+ _execute : function (i) {
+ i = vakata_context.items[i];
+ return i && !i._disabled && i.action ? i.action.call(null, {
+ "item" : i,
+ "reference" : vakata_context.reference,
+ "element" : vakata_context.element,
+ "position" : {
+ "x" : vakata_context.position_x,
+ "y" : vakata_context.position_y
+ }
+ }) : false;
+ },
+ _parse : function (o, is_callback) {
+ if(!o) { return false; }
+ if(!is_callback) {
+ vakata_context.html = "";
+ vakata_context.items = [];
+ }
+ var str = "",
+ sep = false,
+ tmp;
+
+ if(is_callback) { str += "<"+"ul>"; }
+ $.each(o, function (i, val) {
+ if(!val) { return true; }
+ vakata_context.items.push(val);
+ if(!sep && val.separator_before) {
+ str += "<"+"li class='vakata-context-separator'><"+"a href='#' " + ($.vakata.context.settings.icons ? '' : 'style="margin-left:0px;"') + "> <"+"/a><"+"/li>";
+ }
+ sep = false;
+ str += "<"+"li class='" + (val._class || "") + (val._disabled ? " vakata-contextmenu-disabled " : "") + "' "+(val.shortcut?" data-shortcut='"+val.shortcut+"' ":'')+">";
+ str += "<"+"a href='#' rel='" + (vakata_context.items.length - 1) + "'>";
+ if($.vakata.context.settings.icons) {
+ str += "<"+"i ";
+ if(val.icon) {
+ if(val.icon.indexOf("/") !== -1 || val.icon.indexOf(".") !== -1) { str += " style='background:url(\"" + val.icon + "\") center center no-repeat' "; }
+ else { str += " class='" + val.icon + "' "; }
+ }
+ str += "><"+"/i><"+"span class='vakata-contextmenu-sep'> <"+"/span>";
+ }
+ str += val.label + (val.shortcut?' <span class="vakata-contextmenu-shortcut vakata-contextmenu-shortcut-'+val.shortcut+'">'+ (val.shortcut_label || '') +'</span>':'') + "<"+"/a>";
+ if(val.submenu) {
+ tmp = $.vakata.context._parse(val.submenu, true);
+ if(tmp) { str += tmp; }
+ }
+ str += "<"+"/li>";
+ if(val.separator_after) {
+ str += "<"+"li class='vakata-context-separator'><"+"a href='#' " + ($.vakata.context.settings.icons ? '' : 'style="margin-left:0px;"') + "> <"+"/a><"+"/li>";
+ sep = true;
+ }
+ });
+ str = str.replace(/<li class\='vakata-context-separator'\><\/li\>$/,"");
+ if(is_callback) { str += "</ul>"; }
+ if(!is_callback) { vakata_context.html = str; $.vakata.context._trigger("parse"); }
+ return str.length > 10 ? str : false;
+ },
+ _show_submenu : function (o) {
+ o = $(o);
+ if(!o.length || !o.children("ul").length) { return; }
+ var e = o.children("ul"),
+ x = o.offset().left + o.outerWidth(),
+ y = o.offset().top,
+ w = e.width(),
+ h = e.height(),
+ dw = $(window).width() + $(window).scrollLeft(),
+ dh = $(window).height() + $(window).scrollTop();
+ // може да се спести е една проверка - дали няма някой от класовете вече нагоре
+ if(right_to_left) {
+ o[x - (w + 10 + o.outerWidth()) < 0 ? "addClass" : "removeClass"]("vakata-context-left");
+ }
+ else {
+ o[x + w + 10 > dw ? "addClass" : "removeClass"]("vakata-context-right");
+ }
+ if(y + h + 10 > dh) {
+ e.css("bottom","-1px");
+ }
+ e.show();
+ },
+ show : function (reference, position, data) {
+ var o, e, x, y, w, h, dw, dh, cond = true;
+ if(vakata_context.element && vakata_context.element.length) {
+ vakata_context.element.width('');
+ }
+ switch(cond) {
+ case (!position && !reference):
+ return false;
+ case (!!position && !!reference):
+ vakata_context.reference = reference;
+ vakata_context.position_x = position.x;
+ vakata_context.position_y = position.y;
+ break;
+ case (!position && !!reference):
+ vakata_context.reference = reference;
+ o = reference.offset();
+ vakata_context.position_x = o.left + reference.outerHeight();
+ vakata_context.position_y = o.top;
+ break;
+ case (!!position && !reference):
+ vakata_context.position_x = position.x;
+ vakata_context.position_y = position.y;
+ break;
+ }
+ if(!!reference && !data && $(reference).data('vakata_contextmenu')) {
+ data = $(reference).data('vakata_contextmenu');
+ }
+ if($.vakata.context._parse(data)) {
+ vakata_context.element.html(vakata_context.html);
+ }
+ if(vakata_context.items.length) {
+ e = vakata_context.element;
+ x = vakata_context.position_x;
+ y = vakata_context.position_y;
+ w = e.width();
+ h = e.height();
+ dw = $(window).width() + $(window).scrollLeft();
+ dh = $(window).height() + $(window).scrollTop();
+ if(right_to_left) {
+ x -= e.outerWidth();
+ if(x < $(window).scrollLeft() + 20) {
+ x = $(window).scrollLeft() + 20;
+ }
+ }
+ if(x + w + 20 > dw) {
+ x = dw - (w + 20);
+ }
+ if(y + h + 20 > dh) {
+ y = dh - (h + 20);
+ }
+
+ vakata_context.element
+ .css({ "left" : x, "top" : y })
+ .show()
+ .find('a:eq(0)').focus().parent().addClass("vakata-context-hover");
+ vakata_context.is_visible = true;
+ $.vakata.context._trigger("show");
+ }
+ },
+ hide : function () {
+ if(vakata_context.is_visible) {
+ vakata_context.element.hide().find("ul").hide().end().find(':focus').blur();
+ vakata_context.is_visible = false;
+ $.vakata.context._trigger("hide");
+ }
+ }
+ };
+ $(function () {
+ right_to_left = $("body").css("direction") === "rtl";
+ var to = false;
+
+ vakata_context.element = $("<ul class='vakata-context'></ul>");
+ vakata_context.element
+ .on("mouseenter", "li", function (e) {
+ e.stopImmediatePropagation();
+
+ if($.contains(this, e.relatedTarget)) {
+ // премахнато заради delegate mouseleave по-долу
+ // $(this).find(".vakata-context-hover").removeClass("vakata-context-hover");
+ return;
+ }
+
+ if(to) { clearTimeout(to); }
+ vakata_context.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end();
+
+ $(this)
+ .siblings().find("ul").hide().end().end()
+ .parentsUntil(".vakata-context", "li").addBack().addClass("vakata-context-hover");
+ $.vakata.context._show_submenu(this);
+ })
+ // тестово - дали не натоварва?
+ .on("mouseleave", "li", function (e) {
+ if($.contains(this, e.relatedTarget)) { return; }
+ $(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover");
+ })
+ .on("mouseleave", function (e) {
+ $(this).find(".vakata-context-hover").removeClass("vakata-context-hover");
+ if($.vakata.context.settings.hide_onmouseleave) {
+ to = setTimeout(
+ (function (t) {
+ return function () { $.vakata.context.hide(); };
+ }(this)), $.vakata.context.settings.hide_onmouseleave);
+ }
+ })
+ .on("click", "a", function (e) {
+ e.preventDefault();
+ })
+ .on("mouseup", "a", function (e) {
+ if(!$(this).blur().parent().hasClass("vakata-context-disabled") && $.vakata.context._execute($(this).attr("rel")) !== false) {
+ $.vakata.context.hide();
+ }
+ })
+ .on('keydown', 'a', function (e) {
+ var o = null;
+ switch(e.which) {
+ case 13:
+ case 32:
+ e.type = "mouseup";
+ e.preventDefault();
+ $(e.currentTarget).trigger(e);
+ break;
+ case 37:
+ if(vakata_context.is_visible) {
+ vakata_context.element.find(".vakata-context-hover").last().parents("li:eq(0)").find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children('a').focus();
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ }
+ break;
+ case 38:
+ if(vakata_context.is_visible) {
+ o = vakata_context.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first();
+ if(!o.length) { o = vakata_context.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last(); }
+ o.addClass("vakata-context-hover").children('a').focus();
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ }
+ break;
+ case 39:
+ if(vakata_context.is_visible) {
+ vakata_context.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children('a').focus();
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ }
+ break;
+ case 40:
+ if(vakata_context.is_visible) {
+ o = vakata_context.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first();
+ if(!o.length) { o = vakata_context.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first(); }
+ o.addClass("vakata-context-hover").children('a').focus();
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ }
+ break;
+ case 27:
+ $.vakata.context.hide();
+ e.preventDefault();
+ break;
+ default:
+ //console.log(e.which);
+ break;
+ }
+ })
+ .on('keydown', function (e) {
+ e.preventDefault();
+ var a = vakata_context.element.find('.vakata-contextmenu-shortcut-' + e.which).parent();
+ if(a.parent().not('.vakata-context-disabled')) {
+ a.mouseup();
+ }
+ })
+ .appendTo("body");
+
+ $(document)
+ .on("mousedown", function (e) {
+ if(vakata_context.is_visible && !$.contains(vakata_context.element[0], e.target)) { $.vakata.context.hide(); }
+ })
+ .on("context_show.vakata", function (e, data) {
+ vakata_context.element.find("li:has(ul)").children("a").addClass("vakata-context-parent");
+ if(right_to_left) {
+ vakata_context.element.addClass("vakata-context-rtl").css("direction", "rtl");
+ }
+ // also apply a RTL class?
+ vakata_context.element.find("ul").hide().end();
+ });
+ });
+ }($));
+ // $.jstree.defaults.plugins.push("contextmenu");
+
+/**
+ * ### Drag'n'drop plugin
+ *
+ * Enables dragging and dropping of nodes in the tree, resulting in a move or copy operations.
+ */
+
+ /**
+ * stores all defaults for the drag'n'drop plugin
+ * @name $.jstree.defaults.dnd
+ * @plugin dnd
+ */
+ $.jstree.defaults.dnd = {
+ /**
+ * a boolean indicating if a copy should be possible while dragging (by pressint the meta key or Ctrl). Defaults to `true`.
+ * @name $.jstree.defaults.dnd.copy
+ * @plugin dnd
+ */
+ copy : true,
+ /**
+ * a number indicating how long a node should remain hovered while dragging to be opened. Defaults to `500`.
+ * @name $.jstree.defaults.dnd.open_timeout
+ * @plugin dnd
+ */
+ open_timeout : 500,
+ /**
+ * a function invoked each time a node is about to be dragged, invoked in the tree's scope and receives the node as an argument - return `false` to prevent dragging
+ * @name $.jstree.defaults.dnd.is_draggable
+ * @plugin dnd
+ */
+ is_draggable : true
+ };
+ // TODO: now check works by checking for each node individually, how about max_children, unique, etc?
+ // TODO: drop somewhere else - maybe demo only?
+ $.jstree.plugins.dnd = function (options, parent) {
+ this.bind = function () {
+ parent.bind.call(this);
+
+ this.element
+ .on('mousedown', 'a', $.proxy(function (e) {
+ var obj = this.get_node(e.target),
+ mlt = this.is_selected(obj) ? this.get_selected().length : 1;
+ if(obj && obj.id && obj.id !== "#" && e.which === 1 &&
+ (this.settings.dnd.is_draggable === true || ($.isFunction(this.settings.dnd.is_draggable) && this.settings.dnd.is_draggable.call(this, obj)))
+ ) {
+ this.element.trigger('mousedown.jstree');
+ return $.vakata.dnd.start(e, { 'jstree' : true, 'origin' : this, 'obj' : this.get_node(obj,true), 'nodes' : mlt > 1 ? this.get_selected() : [obj.id] }, '<div id="jstree-dnd" class="jstree-' + this.get_theme() + '"><i class="jstree-icon jstree-er"></i>' + (mlt > 1 ? mlt + ' ' + this.get_string('nodes') : this.get_text(e.currentTarget, true)) + '<ins class="jstree-copy" style="display:none;">+</ins></div>');
+ }
+ }, this));
+ };
+ };
+
+ $(function() {
+ // bind only once for all instances
+ var lastmv = false,
+ opento = false,
+ marker = $('<div id="jstree-marker"> </div>').hide().appendTo('body');
+
+ $(document)
+ .bind('dnd_start.vakata', function (e, data) {
+ lastmv = false;
+ })
+ .bind('dnd_move.vakata', function (e, data) {
+ if(opento) { clearTimeout(opento); }
+ if(!data.data.jstree) { return; }
+
+ // if we are hovering the marker image do nothing (can happen on "inside" drags)
+ if(data.event.target.id && data.event.target.id === 'jstree-marker') {
+ return;
+ }
+
+ var ins = $.jstree.reference(data.event.target),
+ ref = false,
+ off = false,
+ rel = false,
+ l, t, h, p, i, o, ok, t1, t2, op, ps, pr;
+ // if we are over an instance
+ if(ins && ins._data && ins._data.dnd) {
+ marker.attr('class', 'jstree-' + ins.get_theme());
+ data.helper
+ .children().attr('class', 'jstree-' + ins.get_theme())
+ .find('.jstree-copy:eq(0)')[ data.data.origin && data.data.origin.settings.dnd.copy && (data.event.metaKey || data.event.ctrlKey) ? 'show' : 'hide' ]();
+
+
+ // if are hovering the container itself add a new root node
+ if( (data.event.target === ins.element[0] || data.event.target === ins.get_container_ul()[0]) && ins.get_container_ul().children().length === 0) {
+ ok = true;
+ for(t1 = 0, t2 = data.data.nodes.length; t1 < t2; t1++) {
+ ok = ok && ins.check( (data.data.origin && data.data.origin.settings.dnd.copy && (data.event.metaKey || data.event.ctrlKey) ? "copy_node" : "move_node"), data.data.nodes[t1], '#', 'last');
+ if(!ok) { break; }
+ }
+ if(ok) {
+ lastmv = { 'ins' : ins, 'par' : '#', 'pos' : 'last' };
+ marker.hide();
+ data.helper.find('.jstree-icon:eq(0)').removeClass('jstree-er').addClass('jstree-ok');
+ return;
+ }
+ }
+ else {
+ // if we are hovering a tree node
+ ref = $(data.event.target).closest('a');
+ if(ref && ref.length && ref.parent().is('.jstree-closed, .jstree-open, .jstree-leaf')) {
+ off = ref.offset();
+ rel = data.event.pageY - off.top;
+ h = ref.height();
+ if(rel < h / 3) {
+ o = ['b', 'i', 'a'];
+ }
+ else if(rel > h - h / 3) {
+ o = ['a', 'i', 'b'];
+ }
+ else {
+ o = rel > h / 2 ? ['i', 'a', 'b'] : ['i', 'b', 'a'];
+ }
+ $.each(o, function (j, v) {
+ switch(v) {
+ case 'b':
+ l = off.left - 6;
+ t = off.top - 5;
+ p = ins.get_parent(ref);
+ i = ref.parent().index();
+ break;
+ case 'i':
+ l = off.left - 2;
+ t = off.top - 5 + h / 2 + 1;
+ p = ref.parent();
+ i = 0;
+ break;
+ case 'a':
+ l = off.left - 6;
+ t = off.top - 5 + h;
+ p = ins.get_parent(ref);
+ i = ref.parent().index() + 1;
+ break;
+ }
+ /*!
+ // TODO: moving inside, but the node is not yet loaded?
+ // the check will work anyway, as when moving the node will be loaded first and checked again
+ if(v === 'i' && !ins.is_loaded(p)) { }
+ */
+ ok = true;
+ for(t1 = 0, t2 = data.data.nodes.length; t1 < t2; t1++) {
+ op = data.data.origin && data.data.origin.settings.dnd.copy && (data.event.metaKey || data.event.ctrlKey) ? "copy_node" : "move_node";
+ ps = i;
+ if(op === "move_node" && v === 'a' && (data.data.origin && data.data.origin === ins) && p === ins.get_parent(data.data.nodes[t1])) {
+ pr = ins.get_node(p);
+ if(ps > $.inArray(data.data.nodes[t1], pr.children)) {
+ ps -= 1;
+ }
+ }
+ ok = ok && ins.check(op, data.data.nodes[t1], p, ps);
+ if(!ok) { break; }
+ }
+ if(ok) {
+ if(v === 'i' && ref.parent().is('.jstree-closed') && ins.settings.dnd.open_timeout) {
+ opento = setTimeout((function (x, z) { return function () { x.open_node(z); }; }(ins, ref)), ins.settings.dnd.open_timeout);
+ }
+ lastmv = { 'ins' : ins, 'par' : p, 'pos' : i };
+ marker.css({ 'left' : l + 'px', 'top' : t + 'px' }).show();
+ data.helper.find('.jstree-icon:eq(0)').removeClass('jstree-er').addClass('jstree-ok');
+ o = true;
+ return false;
+ }
+ });
+ if(o === true) { return; }
+ }
+ }
+ }
+ lastmv = false;
+ data.helper.find('.jstree-icon').removeClass('jstree-ok').addClass('jstree-er');
+ marker.hide();
+ })
+ .bind('dnd_scroll.vakata', function (e, data) {
+ if(!data.data.jstree) { return; }
+ marker.hide();
+ lastmv = false;
+ data.helper.find('.jstree-icon:eq(0)').removeClass('jstree-ok').addClass('jstree-er');
+ })
+ .bind('dnd_stop.vakata', function (e, data) {
+ if(opento) { clearTimeout(opento); }
+ if(!data.data.jstree) { return; }
+ marker.hide();
+ if(lastmv) {
+ var i, j, nodes = [];
+ for(i = 0, j = data.data.nodes.length; i < j; i++) {
+ nodes[i] = data.data.origin ? data.data.origin.get_node(data.data.nodes[i]) : data.data.nodes[i];
+ }
+ lastmv.ins[ data.data.origin && data.data.origin.settings.dnd.copy && (data.event.metaKey || data.event.ctrlKey) ? 'copy_node' : 'move_node' ](nodes, lastmv.par, lastmv.pos);
+ }
+ })
+ .bind('keyup keydown', function (e, data) {
+ data = $.vakata.dnd._get();
+ if(data.data && data.data.jstree) {
+ data.helper.find('.jstree-copy:eq(0)')[ data.data.origin && data.data.origin.settings.dnd.copy && (e.metaKey || e.ctrlKey) ? 'show' : 'hide' ]();
+ }
+ });
+ });
+
+ // helpers
+ (function ($) {
+ $.fn.vakata_reverse = [].reverse;
+ // private variable
+ var vakata_dnd = {
+ element : false,
+ is_down : false,
+ is_drag : false,
+ helper : false,
+ helper_w: 0,
+ data : false,
+ init_x : 0,
+ init_y : 0,
+ scroll_l: 0,
+ scroll_t: 0,
+ scroll_e: false,
+ scroll_i: false
+ };
+ $.vakata.dnd = {
+ settings : {
+ scroll_speed : 10,
+ scroll_proximity : 20,
+ helper_left : 5,
+ helper_top : 10,
+ threshold : 5
+ },
+ _trigger : function (event_name, e) {
+ var data = $.vakata.dnd._get();
+ data.event = e;
+ $(document).triggerHandler("dnd_" + event_name + ".vakata", data);
+ },
+ _get : function () {
+ return {
+ "data" : vakata_dnd.data,
+ "element" : vakata_dnd.element,
+ "helper" : vakata_dnd.helper
+ };
+ },
+ _clean : function () {
+ if(vakata_dnd.helper) { vakata_dnd.helper.remove(); }
+ if(vakata_dnd.scroll_i) { clearInterval(vakata_dnd.scroll_i); vakata_dnd.scroll_i = false; }
+ vakata_dnd = {
+ element : false,
+ is_down : false,
+ is_drag : false,
+ helper : false,
+ helper_w: 0,
+ data : false,
+ init_x : 0,
+ init_y : 0,
+ scroll_l: 0,
+ scroll_t: 0,
+ scroll_e: false,
+ scroll_i: false
+ };
+ $(document).unbind("mousemove", $.vakata.dnd.drag);
+ $(document).unbind("mouseup", $.vakata.dnd.stop);
+ },
+ _scroll : function (init_only) {
+ if(!vakata_dnd.scroll_e || (!vakata_dnd.scroll_l && !vakata_dnd.scroll_t)) {
+ if(vakata_dnd.scroll_i) { clearInterval(vakata_dnd.scroll_i); vakata_dnd.scroll_i = false; }
+ return false;
+ }
+ if(!vakata_dnd.scroll_i) {
+ vakata_dnd.scroll_i = setInterval($.vakata.dnd._scroll, 100);
+ return false;
+ }
+ if(init_only === true) { return false; }
+
+ var i = vakata_dnd.scroll_e.scrollTop(),
+ j = vakata_dnd.scroll_e.scrollLeft();
+ vakata_dnd.scroll_e.scrollTop(i + vakata_dnd.scroll_t * $.vakata.dnd.settings.scroll_speed);
+ vakata_dnd.scroll_e.scrollLeft(j + vakata_dnd.scroll_l * $.vakata.dnd.settings.scroll_speed);
+ if(i !== vakata_dnd.scroll_e.scrollTop() || j !== vakata_dnd.scroll_e.scrollLeft()) {
+ $.vakata.dnd._trigger("scroll", vakata_dnd.scroll_e);
+ }
+ },
+ start : function (e, data, html) {
+ if(vakata_dnd.is_drag) { $.vakata.dnd.stop({}); }
+ try {
+ e.currentTarget.unselectable = "on";
+ e.currentTarget.onselectstart = function() { return false; };
+ if(e.currentTarget.style) { e.currentTarget.style.MozUserSelect = "none"; }
+ } catch(ignore) { }
+ vakata_dnd.init_x = e.pageX;
+ vakata_dnd.init_y = e.pageY;
+ vakata_dnd.data = data;
+ vakata_dnd.is_down = true;
+ vakata_dnd.element = e.currentTarget;
+ if(html !== false) {
+ vakata_dnd.helper = $("<div id='vakata-dnd'></div>").html(html).css({
+ "display" : "block",
+ "margin" : "0",
+ "padding" : "0",
+ "position" : "absolute",
+ "top" : "-2000px",
+ "lineHeight" : "16px",
+ "zIndex" : "10000"
+ });
+ }
+ $(document).bind("mousemove", $.vakata.dnd.drag);
+ $(document).bind("mouseup", $.vakata.dnd.stop);
+ return false;
+ },
+ drag : function (e) {
+ if(!vakata_dnd.is_down) { return; }
+ if(!vakata_dnd.is_drag) {
+ if(
+ Math.abs(e.pageX - vakata_dnd.init_x) > $.vakata.dnd.settings.threshold ||
+ Math.abs(e.pageY - vakata_dnd.init_y) > $.vakata.dnd.settings.threshold
+ ) {
+ if(vakata_dnd.helper) {
+ vakata_dnd.helper.appendTo("body");
+ vakata_dnd.helper_w = vakata_dnd.helper.outerWidth();
+ }
+ vakata_dnd.is_drag = true;
+ $.vakata.dnd._trigger("start", e);
+ }
+ else { return; }
+ }
+
+ var d = false, w = false,
+ dh = false, wh = false,
+ dw = false, ww = false,
+ dt = false, dl = false,
+ ht = false, hl = false;
+
+ vakata_dnd.scroll_t = 0;
+ vakata_dnd.scroll_l = 0;
+ vakata_dnd.scroll_e = false;
+ $(e.target)
+ .parentsUntil("body").addBack().vakata_reverse()
+ .filter(function () {
+ return (/^auto|scroll$/).test($(this).css("overflow")) &&
+ (this.scrollHeight > this.offsetHeight || this.scrollWidth > this.offsetWidth);
+ })
+ .each(function () {
+ var t = $(this), o = t.offset();
+ if(this.scrollHeight > this.offsetHeight) {
+ if(o.top + t.height() - e.pageY < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_t = 1; }
+ if(e.pageY - o.top < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_t = -1; }
+ }
+ if(this.scrollWidth > this.offsetWidth) {
+ if(o.left + t.width() - e.pageX < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_l = 1; }
+ if(e.pageX - o.left < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_l = -1; }
+ }
+ if(vakata_dnd.scroll_t || vakata_dnd.scroll_l) {
+ vakata_dnd.scroll_e = $(this);
+ return false;
+ }
+ });
+
+ if(!vakata_dnd.scroll_e) {
+ d = $(document); w = $(window);
+ dh = d.height(); wh = w.height();
+ dw = d.width(); ww = w.width();
+ dt = d.scrollTop(); dl = d.scrollLeft();
+ if(dh > wh && e.pageY - dt < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_t = -1; }
+ if(dh > wh && wh - (e.pageY - dt) < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_t = 1; }
+ if(dw > ww && e.pageX - dl < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_l = -1; }
+ if(dw > ww && ww - (e.pageX - dl) < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_l = 1; }
+ if(vakata_dnd.scroll_t || vakata_dnd.scroll_l) {
+ vakata_dnd.scroll_e = d;
+ }
+ }
+ if(vakata_dnd.scroll_e) { $.vakata.dnd._scroll(true); }
+
+ if(vakata_dnd.helper) {
+ ht = parseInt(e.pageY + $.vakata.dnd.settings.helper_top, 10);
+ hl = parseInt(e.pageX + $.vakata.dnd.settings.helper_left, 10);
+ if(dh && ht + 25 > dh) { ht = dh - 50; }
+ if(dw && hl + vakata_dnd.helper_w > dw) { hl = dw - (vakata_dnd.helper_w + 2); }
+ vakata_dnd.helper.css({
+ left : hl + "px",
+ top : ht + "px"
+ });
+ }
+ $.vakata.dnd._trigger("move", e);
+ },
+ stop : function (e) {
+ if(vakata_dnd.is_drag) {
+ $.vakata.dnd._trigger("stop", e);
+ }
+ $.vakata.dnd._clean();
+ }
+ };
+ }(jQuery));
+
+ // include the dnd plugin by default
+ // $.jstree.defaults.plugins.push("dnd");
+
+
+/**
+ * ### Search plugin
+ *
+ * Adds search functionality to jsTree.
+ */
+
+ /**
+ * stores all defaults for the search plugin
+ * @name $.jstree.defaults.search
+ * @plugin search
+ */
+ $.jstree.defaults.search = {
+ /**
+ * a jQuery-like AJAX config, which jstree uses if a server should be queried for results.
+ *
+ * A `str` (which is the search string) parameter will be added with the request. The expected result is a JSON array with nodes that need to be opened so that matching nodes will be revealed.
+ * Leave this setting as `false` to not query the server.
+ * @name $.jstree.defaults.search.ajax
+ * @plugin search
+ */
+ ajax : false,
+ /**
+ * Indicates if the search should be fuzzy or not (should `chnd3` match `child node 3`). Default is `true`.
+ * @name $.jstree.defaults.search.fuzzy
+ * @plugin search
+ */
+ fuzzy : true,
+ /**
+ * Indicates if the search should be case sensitive. Default is `false`.
+ * @name $.jstree.defaults.search.case_sensitive
+ * @plugin search
+ */
+ case_sensitive : false,
+ /**
+ * Indicates if the tree should be filtered to show only matching nodes (keep in mind this can be a heavy on large trees in old browsers). Default is `false`.
+ * @name $.jstree.defaults.search.show_only_matches
+ * @plugin search
+ */
+ show_only_matches : false,
+ /**
+ * Indicates if all nodes opened to reveal the search result, should be closed when the search is cleared or a new search is performed. Default is `true`.
+ * @name $.jstree.defaults.search.close_opened_onclear
+ * @plugin search
+ */
+ close_opened_onclear : true
+ };
+
+ $.jstree.plugins.search = function (options, parent) {
+ this.bind = function () {
+ parent.bind.call(this);
+
+ this._data.search.str = "";
+ this._data.search.dom = $();
+ this._data.search.res = [];
+ this._data.search.opn = [];
+
+ if(this.settings.search.show_only_matches) {
+ this.element
+ .on("search.jstree", function (e, data) {
+ if(data.nodes.length) {
+ $(this).find("li").hide().filter('.jstree-last').filter(function() { return this.nextSibling; }).removeClass('jstree-last');
+ data.nodes.parentsUntil(".jstree").addBack().show()
+ .filter("ul").each(function () { $(this).children("li:visible").eq(-1).addClass("jstree-last"); });
+ }
+ })
+ .on("clear_search.jstree", function (e, data) {
+ if(data.nodes.length) {
+ $(this).find("li").css("display","").filter('.jstree-last').filter(function() { return this.nextSibling; }).removeClass('jstree-last');
+ }
+ });
+ }
+ };
+ /**
+ * used to search the tree nodes for a given string
+ * @name search(str [, skip_async])
+ * @param {String} str the search string
+ * @param {Boolean} skip_async if set to true server will not be queried even if configured
+ * @plugin search
+ * @trigger search.jstree
+ */
+ this.search = function (str, skip_async) {
+ if(str === false || $.trim(str) === "") {
+ return this.clear_search();
+ }
+ var s = this.settings.search,
+ a = s.ajax ? $.extend({}, s.ajax) : false,
+ f = null,
+ r = [],
+ p = [], i, j;
+ if(this._data.search.res.length) {
+ this.clear_search();
+ }
+ if(!skip_async && a !== false) {
+ if(!a.data) { a.data = {}; }
+ a.data.str = str;
+ return $.ajax(s.ajax).done($.proxy(function (d) {
+ this._search_load(d, str);
+ }, this));
+ }
+ this._data.search.str = str;
+ this._data.search.dom = $();
+ this._data.search.res = [];
+ this._data.search.opn = [];
+
+ f = new $.vakata.search(str, true, { caseSensitive : s.case_sensitive, fuzzy : s.fuzzy });
+
+ $.each(this._model.data, function (i, v) {
+ if(v.text && f.search(v.text).isMatch) {
+ r.push(i);
+ p = p.concat(v.parents);
+ }
+ });
+ if(r.length) {
+ p = $.vakata.array_unique(p);
+ this._search_open(p);
+ for(i = 0, j = r.length; i < j; i++) {
+ f = this.get_node(r[i], true);
+ if(f) {
+ this._data.search.dom = this._data.search.dom.add(f);
+ }
+ }
+ this._data.search.res = r;
+ this._data.search.dom.children(".jstree-anchor").addClass('jstree-search');
+ }
+ /**
+ * triggered after search is complete
+ * @event
+ * @name search.jstree
+ * @param {jQuery} nodes a jQuery collection of matching nodes
+ * @param {String} str the search string
+ * @param {Array} res a collection of objects represeing the matching nodes
+ * @plugin search
+ */
+ this.trigger('search', { nodes : this._data.search.dom, str : str, res : this._data.search.res });
+ };
+ /**
+ * used to clear the last search (removes classes and shows all nodes if filtering is on)
+ * @name clear_search()
+ * @plugin search
+ * @trigger clear_search.jstree
+ */
+ this.clear_search = function () {
+ this._data.search.dom.children(".jstree-anchor").removeClass("jstree-search");
+ if(this.settings.search.close_opened_onclear) {
+ this.close_node(this._data.search.opn, 0);
+ }
+ /**
+ * triggered after search is complete
+ * @event
+ * @name clear_search.jstree
+ * @param {jQuery} nodes a jQuery collection of matching nodes (the result from the last search)
+ * @param {String} str the search string (the last search string)
+ * @param {Array} res a collection of objects represeing the matching nodes (the result from the last search)
+ * @plugin search
+ */
+ this.trigger('clear_search', { 'nodes' : this._data.search.dom, str : this._data.search.str, res : this._data.search.res });
+ this._data.search.str = "";
+ this._data.search.res = [];
+ this._data.search.opn = [];
+ this._data.search.dom = $();
+ };
+ /**
+ * opens nodes that need to be opened to reveal the search results. Used only internally.
+ * @private
+ * @name _search_open(d)
+ * @param {Array} d an array of node IDs
+ * @plugin search
+ */
+ this._search_open = function (d) {
+ var t = this;
+ $.each(d.concat([]), function (i, v) {
+ v = document.getElementById(v);
+ if(v) {
+ if(t.is_closed(v)) {
+ t._data.search.opn.push(v.id);
+ t.open_node(v, function () { t._search_open(d); }, 0);
+ }
+ }
+ });
+ };
+ /**
+ * loads nodes that need to be opened to reveal the search results. Used only internally.
+ * @private
+ * @name _search_load(d, str)
+ * @param {Array} d an array of node IDs
+ * @param {String} str the search string
+ * @plugin search
+ */
+ this._search_load = function (d, str) {
+ var res = true,
+ t = this,
+ m = t._model.data;
+ $.each(d.concat([]), function (i, v) {
+ if(m[v]) {
+ if(!m[v].state.loaded) {
+ t.load_node(v, function () { t._search_load(d, str); });
+ res = false;
+ }
+ }
+ });
+ if(res) {
+ this.search(str, true);
+ }
+ };
+ };
+
+ // helpers
+ (function ($) {
+ // from http://kiro.me/projects/fuse.html
+ $.vakata.search = function(pattern, txt, options) {
+ options = options || {};
+ if(options.fuzzy !== false) {
+ options.fuzzy = true;
+ }
+ pattern = options.caseSensitive ? pattern : pattern.toLowerCase();
+ var MATCH_LOCATION = options.location || 0,
+ MATCH_DISTANCE = options.distance || 100,
+ MATCH_THRESHOLD = options.threshold || 0.6,
+ patternLen = pattern.length,
+ matchmask, pattern_alphabet, match_bitapScore, search;
+ if(patternLen > 32) {
+ options.fuzzy = false;
+ }
+ if(options.fuzzy) {
+ matchmask = 1 << (patternLen - 1);
+ pattern_alphabet = (function () {
+ var mask = {},
+ i = 0;
+ for (i = 0; i < patternLen; i++) {
+ mask[pattern.charAt(i)] = 0;
+ }
+ for (i = 0; i < patternLen; i++) {
+ mask[pattern.charAt(i)] |= 1 << (patternLen - i - 1);
+ }
+ return mask;
+ }());
+ match_bitapScore = function (e, x) {
+ var accuracy = e / patternLen,
+ proximity = Math.abs(MATCH_LOCATION - x);
+ if(!MATCH_DISTANCE) {
+ return proximity ? 1.0 : accuracy;
+ }
+ return accuracy + (proximity / MATCH_DISTANCE);
+ };
+ }
+ search = function (text) {
+ text = options.caseSensitive ? text : text.toLowerCase();
+ if(pattern === text || text.indexOf(pattern) !== -1) {
+ return {
+ isMatch: true,
+ score: 0
+ };
+ }
+ if(!options.fuzzy) {
+ return {
+ isMatch: false,
+ score: 1
+ };
+ }
+ var i, j,
+ textLen = text.length,
+ scoreThreshold = MATCH_THRESHOLD,
+ bestLoc = text.indexOf(pattern, MATCH_LOCATION),
+ binMin, binMid,
+ binMax = patternLen + textLen,
+ lastRd, start, finish, rd, charMatch,
+ score = 1,
+ locations = [];
+ if (bestLoc !== -1) {
+ scoreThreshold = Math.min(match_bitapScore(0, bestLoc), scoreThreshold);
+ bestLoc = text.lastIndexOf(pattern, MATCH_LOCATION + patternLen);
+ if (bestLoc !== -1) {
+ scoreThreshold = Math.min(match_bitapScore(0, bestLoc), scoreThreshold);
+ }
+ }
+ bestLoc = -1;
+ for (i = 0; i < patternLen; i++) {
+ binMin = 0;
+ binMid = binMax;
+ while (binMin < binMid) {
+ if (match_bitapScore(i, MATCH_LOCATION + binMid) <= scoreThreshold) {
+ binMin = binMid;
+ } else {
+ binMax = binMid;
+ }
+ binMid = Math.floor((binMax - binMin) / 2 + binMin);
+ }
+ binMax = binMid;
+ start = Math.max(1, MATCH_LOCATION - binMid + 1);
+ finish = Math.min(MATCH_LOCATION + binMid, textLen) + patternLen;
+ rd = new Array(finish + 2);
+ rd[finish + 1] = (1 << i) - 1;
+ for (j = finish; j >= start; j--) {
+ charMatch = pattern_alphabet[text.charAt(j - 1)];
+ if (i === 0) {
+ rd[j] = ((rd[j + 1] << 1) | 1) & charMatch;
+ } else {
+ rd[j] = ((rd[j + 1] << 1) | 1) & charMatch | (((lastRd[j + 1] | lastRd[j]) << 1) | 1) | lastRd[j + 1];
+ }
+ if (rd[j] & matchmask) {
+ score = match_bitapScore(i, j - 1);
+ if (score <= scoreThreshold) {
+ scoreThreshold = score;
+ bestLoc = j - 1;
+ locations.push(bestLoc);
+ if (bestLoc > MATCH_LOCATION) {
+ start = Math.max(1, 2 * MATCH_LOCATION - bestLoc);
+ } else {
+ break;
+ }
+ }
+ }
+ }
+ if (match_bitapScore(i + 1, MATCH_LOCATION) > scoreThreshold) {
+ break;
+ }
+ lastRd = rd;
+ }
+ return {
+ isMatch: bestLoc >= 0,
+ score: score
+ };
+ };
+ return txt === true ? { 'search' : search } : search(txt);
+ };
+ }(jQuery));
+
+ // include the search plugin by default
+ // $.jstree.defaults.plugins.push("search");
+
+/**
+ * ### Sort plugin
+ *
+ * Autmatically sorts all siblings in the tree according to a sorting function.
+ */
+
+ /**
+ * the settings function used to sort the nodes.
+ * It is executed in the tree's context, accepts two nodes as arguments and should return `1` or `-1`.
+ * @name $.jstree.defaults.sort
+ * @plugin sort
+ */
+ $.jstree.defaults.sort = function (a, b) {
+ //return this.get_type(a) === this.get_type(b) ? (this.get_text(a) > this.get_text(b) ? 1 : -1) : this.get_type(a) >= this.get_type(b);
+ return this.get_text(a) > this.get_text(b) ? 1 : -1;
+ };
+ $.jstree.plugins.sort = function (options, parent) {
+ this.bind = function () {
+ parent.bind.call(this);
+ this.element
+ .on("model.jstree", $.proxy(function (e, data) {
+ this.sort(data.parent, true);
+ }, this))
+ .on("rename_node.jstree create_node.jstree", $.proxy(function (e, data) {
+ this.sort(data.parent || data.node.parent, false);
+ this.redraw_node(data.parent || data.node.parent, true);
+ }, this))
+ .on("move_node.jstree copy_node.jstree", $.proxy(function (e, data) {
+ this.sort(data.parent, false);
+ this.redraw_node(data.parent, true);
+ }, this));
+ };
+ /**
+ * used to sort a node's children
+ * @private
+ * @name sort(obj [, deep])
+ * @param {mixed} obj the node
+ * @param {Boolean} deep if set to `true` nodes are sorted recursively.
+ * @plugin sort
+ * @trigger search.jstree
+ */
+ this.sort = function (obj, deep) {
+ var i, j;
+ obj = this.get_node(obj);
+ if(obj && obj.children && obj.children.length) {
+ obj.children.sort($.proxy(this.settings.sort, this));
+ if(deep) {
+ for(i = 0, j = obj.children_d.length; i < j; i++) {
+ this.sort(obj.children_d[i], false);
+ }
+ }
+ }
+ };
+ };
+
+ // include the sort plugin by default
+ // $.jstree.defaults.plugins.push("sort");
+
+/**
+ * ### State plugin
+ *
+ * Saves the state of the tree (selected nodes, opened nodes) on the user's computer using available options (localStorage, cookies, etc)
+ */
+
+ var to = false;
+ /**
+ * stores all defaults for the state plugin
+ * @name $.jstree.defaults.state
+ * @plugin state
+ */
+ $.jstree.defaults.state = {
+ /**
+ * A string for the key to use when saving the current tree (change if using multiple trees in your project). Defaults to `jstree`.
+ * @name $.jstree.defaults.state.key
+ * @plugin state
+ */
+ key : 'jstree',
+ /**
+ * A space separated list of events that trigger a state save. Defaults to `changed.jstree open_node.jstree close_node.jstree`.
+ * @name $.jstree.defaults.state.events
+ * @plugin state
+ */
+ events : 'changed.jstree open_node.jstree close_node.jstree',
+ ttl : false
+ };
+ $.jstree.plugins.state = function (options, parent) {
+ this.bind = function () {
+ parent.bind.call(this);
+
+ this.element
+ .on("ready.jstree", $.proxy(function (e, data) {
+ this.element.one("restore_state.jstree set_state.jstree", $.proxy(function () {
+ this.element.on(this.settings.state.events, $.proxy(function () {
+ if(to) { clearTimeout(to); }
+ to = setTimeout($.proxy(function () { this.save_state(); }, this), 100);
+ }, this));
+ }, this));
+ this.restore_state();
+ }, this));
+ };
+ /**
+ * save the state
+ * @name save_state()
+ * @plugin state
+ */
+ this.save_state = function () {
+ $.vakata.storage.set(this.settings.state.key, this.get_state(), this.settings.state.ttl);
+ };
+ /**
+ * restore the state from the user's computer
+ * @name restore_state()
+ * @plugin state
+ */
+ this.restore_state = function () {
+ var k = $.vakata.storage.get(this.settings.state.key);
+
+ if(!!k) { this.set_state(k); }
+ this.trigger('restore_state', { 'state' : k });
+ };
+ /**
+ * clear the state on the user's computer
+ * @name clear_state()
+ * @plugin state
+ */
+ this.clear_state = function () {
+ return $.vakata.storage.del(this.settings.state.key);
+ };
+ };
+
+ (function ($, document, undefined) {
+ var raw = function (s) { return s; },
+ decoded = function (s) { return decodeURIComponent(s.replace(/\+/g, ' ')); },
+ config = $.vakata.cookie = function (key, value, options) {
+ var days, t, decode, cookies, i, l, parts, cookie;
+ // write
+ if (value !== undefined) {
+ options = $.extend({}, config.defaults, options);
+
+ if (value === null) {
+ options.expires = -1;
+ }
+
+ if (typeof options.expires === 'number') {
+ days = options.expires;
+ t = options.expires = new Date();
+ t.setDate(t.getDate() + days);
+ }
+
+ value = config.json ? $.vakata.json.encode(value) : String(value);
+ value = [
+ encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value),
+ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
+ options.path ? '; path=' + options.path : '',
+ options.domain ? '; domain=' + options.domain : '',
+ options.secure ? '; secure' : ''
+ ].join('');
+ document.cookie = value;
+ return value;
+ }
+ // read
+ decode = config.raw ? raw : decoded;
+ cookies = document.cookie.split('; ');
+ for (i = 0, l = cookies.length; i < l; i++) {
+ parts = cookies[i].split('=');
+ if (decode(parts.shift()) === key) {
+ cookie = decode(parts.join('='));
+ return config.json ? $.vakata.json.decode(cookie) : cookie;
+ }
+ }
+ return null;
+ };
+ config.defaults = {};
+ $.vakata.removeCookie = function (key, options) {
+ if ($.vakata.cookie(key) !== null) {
+ $.vakata.cookie(key, null, options);
+ return true;
+ }
+ return false;
+ };
+ }(jQuery, document));
+
+ (function ($, undefined) {
+ var _storage = {},
+ _storage_service = {jStorage:"{}"},
+ _storage_elm = null,
+ _storage_size = 0,
+ json_encode = $.vakata.json.encode,
+ json_decode = $.vakata.json.decode,
+ _backend = false,
+ _ttl_timeout = false;
+
+ function _load_storage() {
+ if(_storage_service.jStorage) {
+ try {
+ _storage = json_decode(String(_storage_service.jStorage));
+ } catch(ex) { _storage_service.jStorage = "{}"; }
+ } else {
+ _storage_service.jStorage = "{}";
+ }
+ _storage_size = _storage_service.jStorage ? String(_storage_service.jStorage).length : 0;
+ }
+
+ function _save() {
+ try {
+ _storage_service.jStorage = json_encode(_storage);
+ if(_backend === 'userDataBehavior') {
+ _storage_elm.setAttribute("jStorage", _storage_service.jStorage);
+ _storage_elm.save("jStorage");
+ }
+ if(_backend === 'cookie') {
+ $.vakata.cookie('__vjstorage', _storage_service.jStorage, { 'expires' : 365 });
+ }
+ _storage_size = _storage_service.jStorage?String(_storage_service.jStorage).length:0;
+ } catch(ignore) { /*! probably cache is full, nothing is saved this way*/ }
+ }
+
+ function _checkKey(key) {
+ if(!key || (typeof key !== "string" && typeof key !== "number")){
+ throw new TypeError('Key name must be string or numeric');
+ }
+ if(key === "__jstorage_meta") {
+ throw new TypeError('Reserved key name');
+ }
+ return true;
+ }
+
+ function _handleTTL() {
+ var curtime = +new Date(),
+ i,
+ TTL,
+ nextExpire = Infinity,
+ changed = false;
+
+ if(_ttl_timeout !== false) {
+ clearTimeout(_ttl_timeout);
+ }
+ if(!_storage.__jstorage_meta || typeof _storage.__jstorage_meta.TTL !== "object"){
+ return;
+ }
+ TTL = _storage.__jstorage_meta.TTL;
+ for(i in TTL) {
+ if(TTL.hasOwnProperty(i)) {
+ if(TTL[i] <= curtime) {
+ delete TTL[i];
+ delete _storage[i];
+ changed = true;
+ }
+ else if(TTL[i] < nextExpire) {
+ nextExpire = TTL[i];
+ }
+ }
+ }
+
+ // set next check
+ if(nextExpire !== Infinity) {
+ _ttl_timeout = setTimeout(_handleTTL, nextExpire - curtime);
+ }
+ // save changes
+ if(changed) {
+ _save();
+ }
+ }
+
+ function _init() {
+ var localStorageReallyWorks = false, data;
+ //if(window.hasOwnProperty("localStorage")){
+ if(Object.prototype.hasOwnProperty.call(window, "localStorage")){
+ try {
+ window.localStorage.setItem('_tmptest', 'tmpval');
+ localStorageReallyWorks = true;
+ window.localStorage.removeItem('_tmptest');
+ } catch(ignore) {
+ // Thanks be to iOS5 Private Browsing mode which throws
+ // QUOTA_EXCEEDED_ERRROR DOM Exception 22.
+ }
+ }
+
+ if(localStorageReallyWorks){
+ try {
+ if(window.localStorage) {
+ _storage_service = window.localStorage;
+ _backend = "localStorage";
+ }
+ } catch(ignore) {/*! Firefox fails when touching localStorage and cookies are disabled */}
+ }
+ //else if(window.hasOwnProperty("globalStorage")) {
+ else if(Object.prototype.hasOwnProperty.call(window, "globalStorage")) {
+ try {
+ if(window.globalStorage) {
+ _storage_service = window.globalStorage[window.location.hostname];
+ _backend = "globalStorage";
+ }
+ } catch(ignore) {/*! Firefox fails when touching localStorage and cookies are disabled */}
+ }
+ else {
+ _storage_elm = document.createElement('link');
+ if(_storage_elm.addBehavior) {
+ _storage_elm.style.behavior = 'url(#default#userData)';
+ document.getElementsByTagName('head')[0].appendChild(_storage_elm);
+ try {
+ _storage_elm.load("jStorage");
+ data = "{}";
+ data = _storage_elm.getAttribute("jStorage");
+ _storage_service.jStorage = data;
+ _backend = "userDataBehavior";
+ } catch(ignore) {}
+ }
+ if(
+ !_backend && (
+ !!$.vakata.cookie('__vjstorage') ||
+ ($.vakata.cookie('__vjstorage', '{}', { 'expires' : 365 }) && $.vakata.cookie('__vjstorage') === '{}')
+ )
+ ) {
+ _storage_elm = null;
+ _storage_service.jStorage = $.vakata.cookie('__vjstorage');
+ _backend = "cookie";
+ }
+
+ if(!_backend) {
+ _storage_elm = null;
+ return;
+ }
+ }
+ _load_storage();
+ _handleTTL();
+ }
+
+ /*!
+ Variable: $.vakata.storage
+ *object* holds all storage related functions and properties.
+ */
+ $.vakata.storage = {
+ /*!
+ Variable: $.vakata.storage.version
+ *string* the version of jstorage used HEAVILY MODIFIED
+ */
+ version: "0.3.0",
+ /*!
+ Function: $.vakata.storage.set
+ Set a key to a value
+
+ Parameters:
+ key - the key
+ value - the value
+
+ Returns:
+ _value_
+ */
+ set : function (key, value, ttl) {
+ _checkKey(key);
+ if(typeof value === "object") {
+ value = json_decode(json_encode(value));
+ }
+ _storage[key] = value;
+ _save();
+ if(ttl && parseInt(ttl, 10)) {
+ $.vakata.storage.setTTL(key, parseInt(ttl, 10));
+ }
+ return value;
+ },
+ /*!
+ Function: $.vakata.storage.get
+ Get a value by key.
+
+ Parameters:
+ key - the key
+ def - the value to return if _key_ is not found
+
+ Returns:
+ The found value, _def_ if key not found or _null_ if _def_ is not supplied.
+ */
+ get : function (key, def) {
+ _checkKey(key);
+ if(_storage.hasOwnProperty(key)){
+ return _storage[key];
+ }
+ return def === undefined ? null : def;
+ },
+ /*!
+ Function: $.vakata.storage.del
+ Remove a key.
+
+ Parameters:
+ key - the key
+
+ Returns:
+ *boolean*
+ */
+ del : function (key) {
+ _checkKey(key);
+ if(_storage.hasOwnProperty(key)) {
+ delete _storage[key];
+
+ if(_storage.__jstorage_meta && typeof _storage.__jstorage_meta.TTL === "object" && _storage.__jstorage_meta.TTL.hasOwnProperty(key)) {
+ delete _storage.__jstorage_meta.TTL[key];
+ }
+ _save();
+ return true;
+ }
+ return false;
+ },
+
+ setTTL: function(key, ttl){
+ var curtime = +new Date();
+
+ _checkKey(key);
+ ttl = Number(ttl) || 0;
+ if(_storage.hasOwnProperty(key)){
+ if(!_storage.__jstorage_meta){
+ _storage.__jstorage_meta = {};
+ }
+ if(!_storage.__jstorage_meta.TTL) {
+ _storage.__jstorage_meta.TTL = {};
+ }
+ if(ttl > 0) {
+ _storage.__jstorage_meta.TTL[key] = curtime + ttl;
+ }
+ else {
+ delete _storage.__jstorage_meta.TTL[key];
+ }
+ _save();
+ _handleTTL();
+ return true;
+ }
+ return false;
+ },
+ getTTL: function(key){
+ var curtime = +new Date(), ttl;
+ _checkKey(key);
+ if(_storage.hasOwnProperty(key) && _storage.__jstorage_meta.TTL && _storage.__jstorage_meta.TTL[key]) {
+ ttl = _storage.__jstorage_meta.TTL[key] - curtime;
+ return ttl || 0;
+ }
+ return 0;
+ },
+
+ /*!
+ Function: $.vakata.storage.flush
+ Empty the storage.
+
+ Returns:
+ _true_
+ */
+ flush : function(){
+ _storage = {};
+ _save();
+ // try{ window.localStorage.clear(); } catch(E8) { }
+ return true;
+ },
+ /*!
+ Function: $.vakata.storage.storageObj
+ Get a read only copy of the whole storage.
+
+ Returns:
+ *object*
+ */
+ storageObj : function(){
+ return $.extend(true, {}, _storage);
+ },
+ /*!
+ Function: $.vakata.storage.index
+ Get an array of all the set keys in the storage.
+
+ Returns:
+ *array*
+ */
+ index : function(){
+ var index = [];
+ $.each(_storage, function (i, v) { if(i !== "__jstorage_meta") { index.push(i); } });
+ return index;
+ },
+ /*!
+ Function: $.vakata.storage.storageSize
+ Get the size of all items in the storage in bytes.
+
+ Returns:
+ *number*
+ */
+ storageSize : function(){
+ return _storage_size;
+ },
+ /*!
+ Function: $.vakata.storage.currentBackend
+ Get the current backend used.
+
+ Returns:
+ *string*
+ */
+ currentBackend : function(){
+ return _backend;
+ },
+ /*!
+ Function: $.vakata.storage.storageAvailable
+ See if storage functionality is available.
+
+ Returns:
+ *boolean*
+ */
+ storageAvailable : function(){
+ return !!_backend;
+ }
+ };
+ _init();
+ }(jQuery));
+
+ // include the state plugin by default
+ // $.jstree.defaults.plugins.push("state");
+
+/**
+ * ### Types plugin
+ *
+ * Makes it possible to add predefined types for groups of nodes, which make it possible to easily control nesting rules and icon for each group.
+ */
+
+ /**
+ * An object storing all types as key value pairs, where the key is the type name and the value is an object that could contain following keys (all optional).
+ *
+ * * `max_children` the maximum number of immediate children this node type can have. Do not specify or set to `-1` for unlimited.
+ * * `max_depth` the maximum number of nesting this node type can have. A value of `1` would mean that the node can have children, but no grandchildren. Do not specify or set to `-1` for unlimited.
+ * * `valid_children` an array of node type strings, that nodes of this type can have as children. Do not specify or set to `-1` for no limits.
+ * * `icon` a string - can be a path to an icon or a className, if using an image that is in the current directory use a `./` prefix, otherwise it will be detected as a class. Omit to use the default icon from your theme.
+ *
+ * There are two predefined types:
+ *
+ * * `#` represents the root of the tree, for example `max_children` would control the maximum number of root nodes.
+ * * `default` represents the default node - any settings here will be applied to all nodes that do not have a type specified.
+ *
+ * @name $.jstree.defaults.types
+ * @plugin types
+ */
+ $.jstree.defaults.types = {
+ '#' : {},
+ 'default' : {}
+ };
+
+ $.jstree.plugins.types = function (options, parent) {
+ this.init = function (el, options) {
+ parent.init.call(this, el, options);
+ this._model.data['#'].type = '#';
+ };
+ this.bind = function () {
+ parent.bind.call(this);
+ this.element
+ .on('model.jstree', $.proxy(function (e, data) {
+ var m = this._model.data,
+ dpc = data.nodes,
+ t = this.settings.types,
+ i, j, c = 'default';
+ for(i = 0, j = dpc.length; i < j; i++) {
+ c = 'default';
+ if(m[dpc[i]].original && m[dpc[i]].original.type && t[m[dpc[i]].original.type]) {
+ c = m[dpc[i]].original.type;
+ }
+ if(m[dpc[i]].data && m[dpc[i]].data.jstree && m[dpc[i]].data.jstree.type && t[m[dpc[i]].data.jstree.type]) {
+ c = m[dpc[i]].data.jstree.type;
+ }
+ m[dpc[i]].type = c;
+ if(m[dpc[i]].icon === true && t[c].icon) {
+ m[dpc[i]].icon = t[c].icon;
+ }
+ }
+ }, this));
+ };
+ this.get_json = function (obj, options) {
+ var i, j,
+ m = this._model.data,
+ opt = options ? $.extend(true, options, {no_id:true}) : {},
+ tmp = parent.get_json.call(this, obj, opt);
+ if(tmp === false) { return false; }
+ if($.isArray(tmp)) {
+ for(i = 0, j = tmp.length; i < j; i++) {
+ tmp[i].type = tmp[i].id && m[tmp[i].id] && m[tmp[i].id].type ? m[tmp[i].id].type : "default";
+ if(options && options.no_id) {
+ delete tmp[i].id;
+ if(tmp[i].li_attr && tmp[i].li_attr.id) {
+ delete tmp[i].li_attr.id;
+ }
+ }
+ }
+ }
+ else {
+ tmp.type = tmp.id && m[tmp.id] && m[tmp.id].type ? m[tmp.id].type : "default";
+ if(options && options.no_id) {
+ delete tmp.id;
+ if(tmp.li_attr && tmp.li_attr.id) {
+ delete tmp.li_attr.id;
+ }
+ }
+ }
+ return tmp;
+ };
+ this.check = function (chk, obj, par, pos) {
+ if(parent.check.call(this, chk, obj, par, pos) === false) { return false; }
+ obj = obj && obj.id ? obj : this.get_node(obj);
+ par = par && par.id ? par : this.get_node(par);
+ var m = this._model.data, tmp, d, i, j;
+ switch(chk) {
+ case "create_node":
+ case "move_node":
+ case "copy_node":
+ if(chk !== 'move_node' || $.inArray(obj.id, par.children) === -1) {
+ tmp = this.get_rules(par);
+ if(tmp.max_children !== undefined && tmp.max_children !== -1 && tmp.max_children === par.children.length) {
+ return false;
+ }
+ if(tmp.valid_children !== undefined && tmp.valid_children !== -1 && $.inArray(obj.type, tmp.valid_children) === -1) {
+ return false;
+ }
+ if(obj.children_d && obj.parents) {
+ d = 0;
+ for(i = 0, j = obj.children_d.length; i < j; i++) {
+ d = Math.max(d, m[obj.children_d[i]].parents.length);
+ }
+ d = d - obj.parents.length + 1;
+ }
+ if(d <= 0) { d = 1; }
+ do {
+ if(tmp.max_depth !== undefined && tmp.max_depth !== -1 && tmp.max_depth < d) {
+ return false;
+ }
+ par = this.get_node(par.parent);
+ tmp = this.get_rules(par);
+ d++;
+ } while(par);
+ }
+ break;
+ }
+ return true;
+ };
+ /**
+ * used to retrieve the type settings object for a node
+ * @name get_rules(obj)
+ * @param {mixed} obj the node to find the rules for
+ * @return {Object}
+ * @plugin types
+ */
+ this.get_rules = function (obj) {
+ obj = this.get_node(obj);
+ if(!obj) { return false; }
+ var tmp = this.get_type(obj, true);
+ if(tmp.max_depth === undefined) { tmp.max_depth = -1; }
+ if(tmp.max_children === undefined) { tmp.max_children = -1; }
+ if(tmp.valid_children === undefined) { tmp.valid_children = -1; }
+ return tmp;
+ };
+ /**
+ * used to retrieve the type string or settings object for a node
+ * @name get_type(obj [, rules])
+ * @param {mixed} obj the node to find the rules for
+ * @param {Boolean} rules if set to `true` instead of a string the settings object will be returned
+ * @return {String|Object}
+ * @plugin types
+ */
+ this.get_type = function (obj, rules) {
+ obj = this.get_node(obj);
+ return (!obj) ? false : ( rules ? $.extend({ 'type' : obj.type }, this.settings.types[obj.type]) : obj.type);
+ };
+ /**
+ * used to change a node's type
+ * @name set_type(obj, type)
+ * @param {mixed} obj the node to change
+ * @param {String} type the new type
+ * @plugin types
+ */
+ this.set_type = function (obj, type) {
+ var t, t1, t2, old_type, old_icon;
+ if($.isArray(obj)) {
+ obj = obj.slice();
+ for(t1 = 0, t2 = obj.length; t1 < t2; t1++) {
+ this.set_type(obj[t1], type);
+ }
+ return true;
+ }
+ t = this.settings.types;
+ obj = this.get_node(obj);
+ if(!t[type] || !obj) { return false; }
+ old_type = obj.type;
+ old_icon = this.get_icon(obj);
+ obj.type = type;
+ if(old_icon === true || (t[old_type] && t[old_type].icon && old_icon === t[old_type].icon)) {
+ this.set_icon(obj, t[type].icon || true);
+ }
+ return true;
+ };
+ };
+ // include the types plugin by default
+ // $.jstree.defaults.plugins.push("types");
+
+/**
+ * ### Unique plugin
+ *
+ * Enforces that no nodes with the same name can coexist as siblings.
+ */
+
+ $.jstree.plugins.unique = function (options, parent) {
+ this.check = function (chk, obj, par, pos) {
+ if(parent.check.call(this, chk, obj, par, pos) === false) { return false; }
+ obj = obj && obj.id ? obj : this.get_node(obj);
+ par = par && par.id ? par : this.get_node(par);
+ if(!par || !par.children) { return true; }
+ var n = chk === "rename_node" ? pos : obj.text,
+ c = [],
+ m = this._model.data, i, j;
+ for(i = 0, j = par.children.length; i < j; i++) {
+ c.push(m[par.children[i]].text);
+ }
+ switch(chk) {
+ case "delete_node":
+ return true;
+ case "rename_node":
+ case "copy_node":
+ return ($.inArray(n, c) === -1);
+ case "move_node":
+ return (obj.parent === par.id || $.inArray(n, c) === -1);
+ }
+ return true;
+ };
+ };
+
+ // include the unique plugin by default
+ // $.jstree.defaults.plugins.push("unique");
+
+
+/**
+ * ### Wholerow plugin
+ *
+ * Makes each node appear block level. Making selection easier. May cause slow down for large trees in old browsers.
+ */
+
+ var div = document.createElement('DIV');
+ div.setAttribute('unselectable','on');
+ div.className = 'jstree-wholerow';
+ div.innerHTML = ' ';
+ $.jstree.plugins.wholerow = function (options, parent) {
+ this.bind = function () {
+ parent.bind.call(this);
+
+ this.element
+ .on('loading', $.proxy(function () {
+ div.style.height = this._data.core.li_height + 'px';
+ }, this))
+ .on('ready.jstree set_state.jstree', $.proxy(function () {
+ this.hide_dots();
+ }, this))
+ .on("ready.jstree", $.proxy(function () {
+ this.get_container_ul().addClass('jstree-wholerow-ul');
+ }, this))
+ .on("deselect_all.jstree", $.proxy(function (e, data) {
+ this.element.find('.jstree-wholerow-clicked').removeClass('jstree-wholerow-clicked');
+ }, this))
+ .on("changed.jstree", $.proxy(function (e, data) {
+ this.element.find('.jstree-wholerow-clicked').removeClass('jstree-wholerow-clicked');
+ var tmp = false, i, j;
+ for(i = 0, j = data.selected.length; i < j; i++) {
+ tmp = this.get_node(data.selected[i], true);
+ if(tmp && tmp.length) {
+ tmp.children('.jstree-wholerow').addClass('jstree-wholerow-clicked');
+ }
+ }
+ }, this))
+ .on("open_node.jstree", $.proxy(function (e, data) {
+ this.get_node(data.node, true).find('.jstree-clicked').parent().children('.jstree-wholerow').addClass('jstree-wholerow-clicked');
+ }, this))
+ .on("hover_node.jstree dehover_node.jstree", $.proxy(function (e, data) {
+ this.get_node(data.node, true).children('.jstree-wholerow')[e.type === "hover_node"?"addClass":"removeClass"]('jstree-wholerow-hovered');
+ }, this))
+ .on("contextmenu.jstree", ".jstree-wholerow", $.proxy(function (e) {
+ e.preventDefault();
+ $(e.currentTarget).closest("li").children("a:eq(0)").trigger('contextmenu',e);
+ }, this))
+ .on("click.jstree", ".jstree-wholerow", function (e) {
+ e.stopImmediatePropagation();
+ var tmp = $.Event('click', { metaKey : e.metaKey, ctrlKey : e.ctrlKey, altKey : e.altKey, shiftKey : e.shiftKey });
+ $(e.currentTarget).closest("li").children("a:eq(0)").trigger(tmp).focus();
+ })
+ .on("click.jstree", ".jstree-leaf > .jstree-ocl", $.proxy(function (e) {
+ e.stopImmediatePropagation();
+ var tmp = $.Event('click', { metaKey : e.metaKey, ctrlKey : e.ctrlKey, altKey : e.altKey, shiftKey : e.shiftKey });
+ $(e.currentTarget).closest("li").children("a:eq(0)").trigger(tmp).focus();
+ }, this))
+ .on("mouseover.jstree", ".jstree-wholerow, .jstree-icon", $.proxy(function (e) {
+ e.stopImmediatePropagation();
+ this.hover_node(e.currentTarget);
+ return false;
+ }, this))
+ .on("mouseleave.jstree", ".jstree-node", $.proxy(function (e) {
+ this.dehover_node(e.currentTarget);
+ }, this));
+ };
+ this.teardown = function () {
+ if(this.settings.wholerow) {
+ this.element.find(".jstree-wholerow").remove();
+ }
+ parent.teardown.call(this);
+ };
+ this.redraw_node = function(obj, deep, callback) {
+ obj = parent.redraw_node.call(this, obj, deep, callback);
+ if(obj) {
+ var tmp = div.cloneNode(true);
+ //tmp.style.height = this._data.core.li_height + 'px';
+ if($.inArray(obj.id, this._data.core.selected) !== -1) { tmp.className += ' jstree-wholerow-clicked'; }
+ obj.insertBefore(tmp, obj.childNodes[0]);
+ }
+ return obj;
+ };
+ };
+ // include the wholerow plugin by default
+ // $.jstree.defaults.plugins.push("wholerow");
+
+}));
\ No newline at end of file
Added: trunk/faxtomail-ui-web/src/main/webapp/js/jstree/jstree.min.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/jstree/jstree.min.js (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/jstree/jstree.min.js 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,4 @@
+/*! jsTree - v3.0.0-beta5 - 2014-01-28 - (MIT) */
+(function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)})(function(e,t){"use strict";if(!e.jstree){var n=0,r=0,i=!1,s=!1,a=!1,o=[],d=e("script:last").attr("src"),l=document,c=l.createElement("LI"),h,_;c.setAttribute("role","treeitem"),h=l.createElement("I"),h.className="jstree-icon jstree-ocl",c.appendChild(h),h=l.createElement("A"),h.className="jstree-anchor",h.setAttribute("href","#"),_=l.createElement("I"),_.className="jstree-icon jstree-themeicon",h.appendChild(_),c.appendChild(h),h=_=null,e.jstree={version:"3.0.0-beta5",defaults:{plugins:[]},plugins:{},path:d&&-1!==d.indexOf("/")?d.replace(/\/[^\/]+$/,""):""},e.jstree.create=function(t,r){var i=new e.jstree.core(++n),s=r;return r=e.extend(!0,{},e.jstree.defaults,r),s&&s.plugins&&(r.plugins=s.plugins),e.each(r.plugins,function(e,t){"core"!==e&&(i=i.plugin(t,r[t]))}),i.init(t,r),i},e.jstree.core=function(e){this._id=e,this._data={core:{themes:{name:!1,dots:!1,icons:!1},selected:[]}}},e.jstree.reference=function(n){if(n&&!e(n).length){n.id&&(n=n.id);var r=null;return e(".jstree").each(function(){var i=e(this).data("jstree");return i&&i._model.data[n]?(r=i,!1):t}),r}return e(n).closest(".jstree").data("jstree")},e.fn.jstree=function(n){var r="string"==typeof n,i=Array.prototype.slice.call(arguments,1),s=null;return this.each(function(){var a=e.jstree.reference(this),o=r&&a?a[n]:null;return s=r&&o?o.apply(a,i):null,a||r||n!==t&&!e.isPlainObject(n)||e(this).data("jstree",new e.jstree.create(this,n)),a&&!r&&(s=a),null!==s&&s!==t?!1:t}),null!==s&&s!==t?s:this},e.expr[":"].jstree=e.expr.createPseudo(function(n){return function(n){return e(n).hasClass("jstree")&&e(n).data("jstree")!==t}}),e.jstree.defaults.core={data:!1,strings:!1,check_callback:!1,animation:200,multiple:!0,themes:{name:!1,url:!1,dir:!1,dots:!0,icons:!0,stripes:!1,variant:!1,responsive:!0},expand_selected_onload:!0},e.jstree.core.prototype={plugin:function(t,n){var r=e.jstree.plugins[t];return r?(this._data[t]={},r.prototype=this,new r(n,this)):this},init:function(t,n){this._model={data:{"#":{id:"#",parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}}},changed:[],force_full_redraw:!1,redraw_timeout:!1,default_state:{loaded:!0,opened:!1,selected:!1,disabled:!1}},this.element=e(t).addClass("jstree jstree-"+this._id),this.settings=n,this.element.bind("destroyed",e.proxy(this.teardown,this)),this._data.core.ready=!1,this._data.core.loaded=!1,this._data.core.rtl="rtl"===this.element.css("direction"),this.element[this._data.core.rtl?"addClass":"removeClass"]("jstree-rtl"),this.element.attr("role","tree"),this.bind(),this.trigger("init"),this._data.core.original_container_html=this.element.find(" > ul > li").clone(!0),this._data.core.original_container_html.find("li").addBack().contents().filter(function(){return 3===this.nodeType&&(!this.nodeValue||/^\s+$/.test(this.nodeValue))}).remove(),this.element.html("<ul class='jstree-container-ul'><li class='jstree-initial-node jstree-loading jstree-leaf jstree-last'><i class='jstree-icon jstree-ocl'></i><a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'></i>"+this.get_string("Loading ...")+"</a></li></ul>"),this._data.core.li_height=this.get_container_ul().children("li:eq(0)").height()||18,this.trigger("loading"),this.load_node("#")},destroy:function(){this.element.unbind("destroyed",this.teardown),this.teardown()},teardown:function(){this.unbind(),this.element.removeClass("jstree").removeData("jstree").find("[class^='jstree']").addBack().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/gi,"")}),this.element=null},bind:function(){e.support.touch&&this.element.addTouch(),this.element.on("dblclick.jstree",function(){if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){var e=window.getSelection();try{e.removeAllRanges(),e.collapse()}catch(t){}}}).on("click.jstree",".jstree-ocl",e.proxy(function(e){this.toggle_node(e.target)},this)).on("click.jstree",".jstree-anchor",e.proxy(function(t){t.preventDefault(),e(t.currentTarget).focus(),this.activate_node(t.currentTarget,t)},this)).on("keydown.jstree",".jstree-anchor",e.proxy(function(t){var n=null;switch(t.which){case 13:case 32:t.type="click",e(t.currentTarget).trigger(t);break;case 37:t.preventDefault(),this.is_open(t.currentTarget)?this.close_node(t.currentTarget):(n=this.get_prev_dom(t.currentTarget),n&&n.length&&n.children(".jstree-anchor").focus());break;case 38:t.preventDefault(),n=this.get_prev_dom(t.currentTarget),n&&n.length&&n.children(".jstree-anchor").focus();break;case 39:t.preventDefault(),this.is_closed(t.currentTarget)?this.open_node(t.currentTarget,function(e){this.get_node(e,!0).children(".jstree-anchor").focus()}):(n=this.get_next_dom(t.currentTarget),n&&n.length&&n.children(".jstree-anchor").focus());break;case 40:t.preventDefault(),n=this.get_next_dom(t.currentTarget),n&&n.length&&n.children(".jstree-anchor").focus();break;case 46:t.preventDefault(),n=this.get_node(t.currentTarget),n&&n.id&&"#"!==n.id&&(n=this.is_selected(n)?this.get_selected():n);break;case 113:t.preventDefault(),n=this.get_node(t.currentTarget);break;default:}},this)).on("load_node.jstree",e.proxy(function(t,n){if(n.status&&("#"!==n.node.id||this._data.core.loaded||(this._data.core.loaded=!0,this.trigger("loaded")),!this._data.core.ready&&!this.get_container_ul().find(".jstree-loading:eq(0)").length)){if(this._data.core.ready=!0,this._data.core.selected.length){if(this.settings.core.expand_selected_onload){var r=[],i,s;for(i=0,s=this._data.core.selected.length;s>i;i++)r=r.concat(this._model.data[this._data.core.selected[i]].parents);for(r=e.vakata.array_unique(r),i=0,s=r.length;s>i;i++)this.open_node(r[i],!1,0)}this.trigger("changed",{action:"ready",selected:this._data.core.selected})}this.trigger("ready")}},this)).on("init.jstree",e.proxy(function(){var e=this.settings.core.themes;this._data.core.themes.dots=e.dots,this._data.core.themes.stripes=e.stripes,this._data.core.themes.icons=e.icons,this.set_theme(e.name||"default",e.url),this.set_theme_variant(e.variant)},this)).on("loading.jstree",e.proxy(function(){this[this._data.core.themes.dots?"show_dots":"hide_dots"](),this[this._data.core.themes.icons?"show_icons":"hide_icons"](),this[this._data.core.themes.stripes?"show_stripes":"hide_stripes"]()},this)).on("focus.jstree",".jstree-anchor",e.proxy(function(t){this.element.find(".jstree-hovered").not(t.currentTarget).mouseleave(),e(t.currentTarget).mouseenter()},this)).on("mouseenter.jstree",".jstree-anchor",e.proxy(function(e){this.hover_node(e.currentTarget)},this)).on("mouseleave.jstree",".jstree-anchor",e.proxy(function(e){this.dehover_node(e.currentTarget)},this))},unbind:function(){this.element.off(".jstree"),e(document).off(".jstree-"+this._id)},trigger:function(e,t){t||(t={}),t.instance=this,this.element.triggerHandler(e.replace(".jstree","")+".jstree",t)},get_container:function(){return this.element},get_container_ul:function(){return this.element.children("ul:eq(0)")},get_string:function(t){var n=this.settings.core.strings;return e.isFunction(n)?n.call(this,t):n&&n[t]?n[t]:t},_firstChild:function(e){e=e?e.firstChild:null;while(null!==e&&1!==e.nodeType)e=e.nextSibling;return e},_nextSibling:function(e){e=e?e.nextSibling:null;while(null!==e&&1!==e.nodeType)e=e.nextSibling;return e},_previousSibling:function(e){e=e?e.previousSibling:null;while(null!==e&&1!==e.nodeType)e=e.previousSibling;return e},get_node:function(t,n){t&&t.id&&(t=t.id);var r;try{if(this._model.data[t])t=this._model.data[t];else if(((r=e(t,this.element)).length||(r=e("#"+t,this.element)).length)&&this._model.data[r.closest("li").attr("id")])t=this._model.data[r.closest("li").attr("id")];else{if(!(r=e(t,this.element)).length||!r.hasClass("jstree"))return!1;t=this._model.data["#"]}return n&&(t="#"===t.id?this.element:e(document.getElementById(t.id))),t}catch(i){return!1}},get_next_dom:function(t,n){var r;return t=this.get_node(t,!0),t[0]===this.element[0]?(r=this._firstChild(this.get_container_ul()[0]),r?e(r):!1):t&&t.length?n?(r=this._nextSibling(t[0]),r?e(r):!1):t.hasClass("jstree-open")?(r=this._firstChild(t.children("ul")[0]),r?e(r):!1):null!==(r=this._nextSibling(t[0]))?e(r):t.parentsUntil(".jstree","li").next("li").eq(0):!1},get_prev_dom:function(t,n){var r;if(t=this.get_node(t,!0),t[0]===this.element[0])return r=this.get_container_ul()[0].lastChild,r?e(r):!1;if(!t||!t.length)return!1;if(n)return r=this._previousSibling(t[0]),r?e(r):!1;if(null!==(r=this._previousSibling(t[0]))){t=e(r);while(t.hasClass("jstree-open"))t=t.children("ul:eq(0)").children("li:last");return t}return r=t[0].parentNode.parentNode,r&&"LI"===r.tagName?e(r):!1},get_parent:function(e){return e=this.get_node(e),e&&"#"!==e.id?e.parent:!1},get_children_dom:function(e){return e=this.get_node(e,!0),e[0]===this.element[0]?this.get_container_ul().children("li"):e&&e.length?e.children("ul").children("li"):!1},is_parent:function(e){return e=this.get_node(e),e&&(e.state.loaded===!1||e.children.length)},is_loaded:function(e){return e=this.get_node(e),e&&e.state.loaded},is_loading:function(e){return e=this.get_node(e,!0),e&&e.hasClass("jstree-loading")},is_open:function(e){return e=this.get_node(e),e&&e.state.opened},is_closed:function(e){return e=this.get_node(e),e&&this.is_parent(e)&&!e.state.opened},is_leaf:function(e){return!this.is_parent(e)},load_node:function(t,n){var r,i;if(e.isArray(t)){for(t=t.slice(),r=0,i=t.length;i>r;r++)this.load_node(t[r],n);return!0}return(t=this.get_node(t))?(this.get_node(t,!0).addClass("jstree-loading"),this._load_node(t,e.proxy(function(e){t.state.loaded=e,this.get_node(t,!0).removeClass("jstree-loading"),this.trigger("load_node",{node:t,status:e}),n&&n.call(this,t,e)},this)),!0):(n.call(this,t,!1),!1)},_load_node:function(n,r){var i=this.settings.core.data,s;return i?e.isFunction(i)?i.call(this,n,e.proxy(function(t){return r.call(this,this["string"==typeof t?"_append_html_data":"_append_json_data"](n,"string"==typeof t?e(t):t))},this)):"object"==typeof i?i.url?(i=e.extend(!0,{},i),e.isFunction(i.url)&&(i.url=i.url.call(this,n)),e.isFunction(i.data)&&(i.data=i.data.call(this,n)),e.ajax(i).done(e.proxy(function(i,s,a){var o=a.getResponseHeader("Content-Type");return-1!==o.indexOf("json")?r.call(this,this._append_json_data(n,i)):-1!==o.indexOf("html")?r.call(this,this._append_html_data(n,e(i))):t},this)).fail(e.proxy(function(){r.call(this,!1)},this))):(s=e.isArray(i)||e.isPlainObject(i)?e.vakata.json.decode(e.vakata.json.encode(i)):i,r.call(this,this._append_json_data(n,s))):"string"==typeof i?r.call(this,this._append_html_data(n,i)):r.call(this,!1):r.call(this,"#"===n.id?this._append_html_data(n,this._data.core.original_container_html.clone(!0)):!1)},_node_changed:function(e){e=this.get_node(e),e&&this._model.changed.push(e.id)},_append_html_data:function(t,n){t=this.get_node(t),t.children=[],t.children_d=[];var r=n.is("ul")?n.children():n,i=t.id,s=[],a=[],o=this._model.data,d=o[i],l=this._data.core.selected.length,c,h,_;for(r.each(e.proxy(function(t,n){c=this._parse_model_from_html(e(n),i,d.parents.concat()),c&&(s.push(c),a.push(c),o[c].children_d.length&&(a=a.concat(o[c].children_d)))},this)),d.children=s,d.children_d=a,h=0,_=d.parents.length;_>h;h++)o[d.parents[h]].children_d=o[d.parents[h]].children_d.concat(a);return this.trigger("model",{nodes:a,parent:i}),"#"!==i?(this._node_changed(i),this.redraw()):(this.get_container_ul().children(".jstree-initial-node").remove(),this.redraw(!0)),this._data.core.selected.length!==l&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),!0},_append_json_data:function(n,r){n=this.get_node(n),n.children=[],n.children_d=[];var i=r,s=n.id,a=[],o=[],d=this._model.data,l=d[s],c=this._data.core.selected.length,h,_,u;if(i.d&&(i=i.d,"string"==typeof i&&(i=e.vakata.json.decode(i))),e.isArray(i)||(i=[i]),i.length&&i[0].id!==t&&i[0].parent!==t){for(_=0,u=i.length;u>_;_++)i[_].children||(i[_].children=[]),d[i[_].id]=i[_];for(_=0,u=i.length;u>_;_++)d[i[_].parent].children.push(i[_].id),l.children_d.push(i[_].id);for(_=0,u=l.children.length;u>_;_++)h=this._parse_model_from_flat_json(d[l.children[_]],s,l.parents.concat()),o.push(h),d[h].children_d.length&&(o=o.concat(d[h].children_d))}else{for(_=0,u=i.length;u>_;_++)h=this._parse_model_from_json(i[_],s,l.parents.concat()),h&&(a.push(h),o.push(h),d[h].children_d.length&&(o=o.concat(d[h].children_d)));for(l.children=a,l.children_d=o,_=0,u=l.parents.length;u>_;_++)d[l.parents[_]].children_d=d[l.parents[_]].children_d.concat(o)}return this.trigger("model",{nodes:o,parent:s}),"#"!==s?(this._node_changed(s),this.redraw()):this.redraw(!0),this._data.core.selected.length!==c&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),!0},_parse_model_from_html:function(n,i,s){s=s?[].concat(s):[],i&&s.unshift(i);var a,o,d=this._model.data,l={id:!1,text:!1,icon:!0,parent:i,parents:s,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1},c,h,_;for(c in this._model.default_state)this._model.default_state.hasOwnProperty(c)&&(l.state[c]=this._model.default_state[c]);if(h=e.vakata.attributes(n,!0),e.each(h,function(n,r){return r=e.trim(r),r.length?(l.li_attr[n]=r,"id"===n&&(l.id=r),t):!0}),h=n.children("a").eq(0),h.length&&(h=e.vakata.attributes(h,!0),e.each(h,function(t,n){n=e.trim(n),n.length&&(l.a_attr[t]=n)})),h=n.children("a:eq(0)").length?n.children("a:eq(0)").clone():n.clone(),h.children("ins, i, ul").remove(),h=h.html(),h=e("<div />").html(h),l.text=h.html(),h=n.data(),l.data=h?e.extend(!0,{},h):null,l.state.opened=n.hasClass("jstree-open"),l.state.selected=n.children("a").hasClass("jstree-clicked"),l.state.disabled=n.children("a").hasClass("jstree-disabled"),l.data&&l.data.jstree)for(c in l.data.jstree)l.data.jstree.hasOwnProperty(c)&&(l.state[c]=l.data.jstree[c]);h=n.children("a").children(".jstree-themeicon"),h.length&&(l.icon=h.hasClass("jstree-themeicon-hidden")?!1:h.attr("rel")),l.state.icon&&(l.icon=l.state.icon),h=n.children("ul").children("li");do _="j"+this._id+"_"+ ++r;while(d[_]);return l.id=l.li_attr.id||_,h.length?(h.each(e.proxy(function(t,n){a=this._parse_model_from_html(e(n),l.id,s),o=this._model.data[a],l.children.push(a),o.children_d.length&&(l.children_d=l.children_d.concat(o.children_d))},this)),l.children_d=l.children_d.concat(l.children)):n.hasClass("jstree-closed")&&(l.state.loaded=!1),l.li_attr["class"]&&(l.li_attr["class"]=l.li_attr["class"].replace("jstree-closed","").replace("jstree-open","")),l.a_attr["class"]&&(l.a_attr["class"]=l.a_attr["class"].replace("jstree-clicked","").replace("jstree-disabled","")),d[l.id]=l,l.state.selected&&this._data.core.selected.push(l.id),l.id},_parse_model_from_flat_json:function(e,n,r){r=r?r.concat():[],n&&r.unshift(n);var i=e.id,s=this._model.data,a=this._model.default_state,o,d,l,c,h={id:i,text:e.text||"",icon:e.icon!==t?e.icon:!0,parent:n,parents:r,children:e.children||[],children_d:e.children_d||[],data:e.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(o in a)a.hasOwnProperty(o)&&(h.state[o]=a[o]);if(e&&e.data&&e.data.jstree&&e.data.jstree.icon&&(h.icon=e.data.jstree.icon),e&&e.data&&(h.data=e.data,e.data.jstree))for(o in e.data.jstree)e.data.jstree.hasOwnProperty(o)&&(h.state[o]=e.data.jstree[o]);if(e&&"object"==typeof e.state)for(o in e.state)e.state.hasOwnProperty(o)&&(h.state[o]=e.state[o]);if(e&&"object"==typeof e.li_attr)for(o in e.li_attr)e.li_attr.hasOwnProperty(o)&&(h.li_attr[o]=e.li_attr[o]);if(h.li_attr.id||(h.li_attr.id=i),e&&"object"==typeof e.a_attr)for(o in e.a_attr)e.a_attr.hasOwnProperty(o)&&(h.a_attr[o]=e.a_attr[o]);for(e&&e.children&&e.children===!0&&(h.state.loaded=!1,h.children=[],h.children_d=[]),s[h.id]=h,o=0,d=h.children.length;d>o;o++)l=this._parse_model_from_flat_json(s[h.children[o]],h.id,r),c=s[l],h.children_d.push(l),c.children_d.length&&(h.children_d=h.children_d.concat(c.children_d));return delete e.data,delete e.children,s[h.id].original=e,h.state.selected&&this._data.core.selected.push(h.id),h.id},_parse_model_from_json:function(e,n,i){i=i?i.concat():[],n&&i.unshift(n);var s=!1,a,o,d,l,c=this._model.data,h=this._model.default_state,_;do s="j"+this._id+"_"+ ++r;while(c[s]);_={id:!1,text:"string"==typeof e?e:"",icon:"object"==typeof e&&e.icon!==t?e.icon:!0,parent:n,parents:i,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(a in h)h.hasOwnProperty(a)&&(_.state[a]=h[a]);if(e&&e.id&&(_.id=e.id),e&&e.text&&(_.text=e.text),e&&e.data&&e.data.jstree&&e.data.jstree.icon&&(_.icon=e.data.jstree.icon),e&&e.data&&(_.data=e.data,e.data.jstree))for(a in e.data.jstree)e.data.jstree.hasOwnProperty(a)&&(_.state[a]=e.data.jstree[a]);if(e&&"object"==typeof e.state)for(a in e.state)e.state.hasOwnProperty(a)&&(_.state[a]=e.state[a]);if(e&&"object"==typeof e.li_attr)for(a in e.li_attr)e.li_attr.hasOwnProperty(a)&&(_.li_attr[a]=e.li_attr[a]);if(_.li_attr.id&&!_.id&&(_.id=_.li_attr.id),_.id||(_.id=s),_.li_attr.id||(_.li_attr.id=_.id),e&&"object"==typeof e.a_attr)for(a in e.a_attr)e.a_attr.hasOwnProperty(a)&&(_.a_attr[a]=e.a_attr[a]);if(e&&e.children&&e.children.length){for(a=0,o=e.children.length;o>a;a++)d=this._parse_model_from_json(e.children[a],_.id,i),l=c[d],_.children.push(d),l.children_d.length&&(_.children_d=_.children_d.concat(l.children_d));_.children_d=_.children_d.concat(_.children)}return e&&e.children&&e.children===!0&&(_.state.loaded=!1,_.children=[],_.children_d=[]),delete e.data,delete e.children,_.original=e,c[_.id]=_,_.state.selected&&this._data.core.selected.push(_.id),_.id},_redraw:function(){var e=this._model.force_full_redraw?this._model.data["#"].children.concat([]):this._model.changed.concat([]),t=document.createElement("UL"),n,r,i;for(r=0,i=e.length;i>r;r++)n=this.redraw_node(e[r],!0,this._model.force_full_redraw),n&&this._model.force_full_redraw&&t.appendChild(n);this._model.force_full_redraw&&(t.className=this.get_container_ul()[0].className,this.element.empty().append(t)),this._model.force_full_redraw=!1,this._model.changed=[],this.trigger("redraw",{nodes:e})},redraw:function(e){e&&(this._model.force_full_redraw=!0),this._redraw()},redraw_node:function(t,n,r){var i=this.get_node(t),s=!1,a=!1,o=!1,d=!1,l=!1,h=!1,_="",u=document,f=this._model.data;if(!i)return!1;if("#"===i.id)return this.redraw(!0);if(n=n||0===i.children.length,t=u.getElementById(i.id))t=e(t),r||(s=t.parent().parent()[0],s===this.element[0]&&(s=null),a=t.index()),n||!i.children.length||t.children("ul").length||(n=!0),n||(o=t.children("UL")[0]),t.remove();else if(n=!0,!r){if(s="#"!==i.parent?e("#"+i.parent,this.element)[0]:null,!(null===s||s&&f[i.parent].state.opened))return!1;a=e.inArray(i.id,null===s?f["#"].children:f[i.parent].children)}t=c.cloneNode(!0),_="jstree-node ";for(d in i.li_attr)if(i.li_attr.hasOwnProperty(d)){if("id"===d)continue;"class"!==d?t.setAttribute(d,i.li_attr[d]):_+=i.li_attr[d]}_+=!i.children.length&&i.state.loaded?" jstree-leaf":i.state.opened?" jstree-open":" jstree-closed",null!==i.parent&&f[i.parent].children[f[i.parent].children.length-1]===i.id&&(_+=" jstree-last"),t.id=i.id,t.className=_,_=(i.state.selected?" jstree-clicked":"")+(i.state.disabled?" jstree-disabled":"");for(l in i.a_attr)if(i.a_attr.hasOwnProperty(l)){if("href"===l&&"#"===i.a_attr[l])continue;"class"!==l?t.childNodes[1].setAttribute(l,i.a_attr[l]):_+=" "+i.a_attr[l]}if(_.length&&(t.childNodes[1].className="jstree-anchor "+_),(i.icon&&i.icon!==!0||i.icon===!1)&&(i.icon===!1?t.childNodes[1].childNodes[0].className+=" jstree-themeicon-hidden":-1===i.icon.indexOf("/")&&-1===i.icon.indexOf(".")?t.childNodes[1].childNodes[0].className+=" "+i.icon+" jstree-themeicon-custom":(t.childNodes[1].childNodes[0].style.backgroundImage="url("+i.icon+")",t.childNodes[1].childNodes[0].style.backgroundPosition="center center",t.childNodes[1].childNodes[0].style.backgroundSize="auto",t.childNodes[1].childNodes[0].className+=" jstree-themeicon-custom")),t.childNodes[1].innerHTML+=i.text,n&&i.children.length&&i.state.opened){for(h=u.createElement("UL"),h.setAttribute("role","group"),h.className="jstree-children",d=0,l=i.children.length;l>d;d++)h.appendChild(this.redraw_node(i.children[d],n,!0));t.appendChild(h)}return o&&t.appendChild(o),r||(s||(s=this.element[0]),s.getElementsByTagName("UL").length?s=s.getElementsByTagName("UL")[0]:(d=u.createElement("UL"),d.setAttribute("role","group"),d.className="jstree-children",s.appendChild(d),s=d),s.childNodes.length>a?s.insertBefore(t,s.childNodes[a]):s.appendChild(t)),t},open_node:function(n,r,i){var s,a,o,d;if(e.isArray(n)){for(n=n.slice(),s=0,a=n.length;a>s;s++)this.open_node(n[s],r,i);return!0}if(n=this.get_node(n),!n||"#"===n.id)return!1;if(i=i===t?this.settings.core.animation:i,!this.is_closed(n))return r&&r.call(this,n,!1),!1;if(this.is_loaded(n))o=this.get_node(n,!0),d=this,o.length&&(n.children.length&&!this._firstChild(o.children("ul")[0])&&(n.state.opened=!0,this.redraw_node(n,!0),o=this.get_node(n,!0)),i?o.children("ul").css("display","none").end().removeClass("jstree-closed").addClass("jstree-open").children("ul").stop(!0,!0).slideDown(i,function(){this.style.display="",d.trigger("after_open",{node:n})}):o[0].className=o[0].className.replace("jstree-closed","jstree-open")),n.state.opened=!0,r&&r.call(this,n,!0),this.trigger("open_node",{node:n}),i&&o.length||this.trigger("after_open",{node:n});else{if(this.is_loading(n))return setTimeout(e.proxy(function(){this.open_node(n,r,i)},this),500);this.load_node(n,function(e,t){return t?this.open_node(e,r,i):r?r.call(this,e,!1):!1})}},_open_to:function(t){if(t=this.get_node(t),!t||"#"===t.id)return!1;var n,r,i=t.parents;for(n=0,r=i.length;r>n;n+=1)"#"!==n&&this.open_node(i[n],!1,0);return e(document.getElementById(t.id))},close_node:function(n,r){var i,s,a,o;if(e.isArray(n)){for(n=n.slice(),i=0,s=n.length;s>i;i++)this.close_node(n[i],r);return!0}return n=this.get_node(n),n&&"#"!==n.id?(r=r===t?this.settings.core.animation:r,a=this,o=this.get_node(n,!0),o.length&&(r?o.children("ul").attr("style","display:block !important").end().removeClass("jstree-open").addClass("jstree-closed").children("ul").stop(!0,!0).slideUp(r,function(){this.style.display="",o.children("ul").remove(),a.trigger("after_close",{node:n})}):(o[0].className=o[0].className.replace("jstree-open","jstree-closed"),o.children("ul").remove())),n.state.opened=!1,this.trigger("close_node",{node:n}),r&&o.length||this.trigger("after_close",{node:n}),t):!1},toggle_node:function(n){var r,i;if(e.isArray(n)){for(n=n.slice(),r=0,i=n.length;i>r;r++)this.toggle_node(n[r]);return!0}return this.is_closed(n)?this.open_node(n):this.is_open(n)?this.close_node(n):t},open_all:function(e,t,n){if(e||(e="#"),e=this.get_node(e),!e)return!1;var r="#"===e.id?this.get_container_ul():this.get_node(e,!0),i,s,a;if(!r.length){for(i=0,s=e.children_d.length;s>i;i++)this.is_closed(this._model.data[e.children_d[i]])&&(this._model.data[e.children_d[i]].state.opened=!0);return this.trigger("open_all",{node:e})}n=n||r,a=this,r=this.is_closed(e)?r.find("li.jstree-closed").addBack():r.find("li.jstree-closed"),r.each(function(){a.open_node(this,function(e,r){r&&this.is_parent(e)&&this.open_all(e,t,n)},t||0)}),0===n.find("li.jstree-closed").length&&this.trigger("open_all",{node:this.get_node(n)})},close_all:function(e,t){if(e||(e="#"),e=this.get_node(e),!e)return!1;var n="#"===e.id?this.get_container_ul():this.get_node(e,!0),r=this,i,s;if(!n.length){for(i=0,s=e.children_d.length;s>i;i++)this._model.data[e.children_d[i]].state.opened=!1;return this.trigger("close_all",{node:e})}n=this.is_open(e)?n.find("li.jstree-open").addBack():n.find("li.jstree-open"),n.vakata_reverse().each(function(){r.close_node(this,t||0)}),this.trigger("close_all",{node:e})},is_disabled:function(e){return e=this.get_node(e),e&&e.state&&e.state.disabled},enable_node:function(n){var r,i;if(e.isArray(n)){for(n=n.slice(),r=0,i=n.length;i>r;r++)this.enable_node(n[r]);return!0}return n=this.get_node(n),n&&"#"!==n.id?(n.state.disabled=!1,this.get_node(n,!0).children(".jstree-anchor").removeClass("jstree-disabled"),this.trigger("enable_node",{node:n}),t):!1},disable_node:function(n){var r,i;if(e.isArray(n)){for(n=n.slice(),r=0,i=n.length;i>r;r++)this.disable_node(n[r]);return!0}return n=this.get_node(n),n&&"#"!==n.id?(n.state.disabled=!0,this.get_node(n,!0).children(".jstree-anchor").addClass("jstree-disabled"),this.trigger("disable_node",{node:n}),t):!1},activate_node:function(e,t){if(this.is_disabled(e))return!1;if(this.settings.core.multiple&&(t.metaKey||t.ctrlKey||t.shiftKey)&&(!t.shiftKey||this._data.core.last_clicked&&this.get_parent(e)&&this.get_parent(e)===this._data.core.last_clicked.parent))if(t.shiftKey){var n=this.get_node(e).id,r=this._data.core.last_clicked.id,i=this.get_node(this._data.core.last_clicked.parent).children,s=!1,a,o;for(a=0,o=i.length;o>a;a+=1)i[a]===n&&(s=!s),i[a]===r&&(s=!s),s||i[a]===n||i[a]===r?this.select_node(i[a]):this.deselect_node(i[a])}else this.is_selected(e)?this.deselect_node(e):this.select_node(e);else this.deselect_all(!0),this.select_node(e),this._data.core.last_clicked=this.get_node(e);this.trigger("activate_node",{node:this.get_node(e)})},hover_node:function(e){if(e=this.get_node(e,!0),!e||!e.length||e.children(".jstree-hovered").length)return!1;var t=this.element.find(".jstree-hovered");t&&t.length&&this.dehover_node(t),e.children(".jstree-anchor").addClass("jstree-hovered"),this.trigger("hover_node",{node:this.get_node(e)})},dehover_node:function(e){return e=this.get_node(e,!0),e&&e.length&&e.children(".jstree-hovered").length?(e.children(".jstree-anchor").removeClass("jstree-hovered"),this.trigger("dehover_node",{node:this.get_node(e)}),t):!1},select_node:function(n,r,i){var s,a,o,d;if(e.isArray(n)){for(n=n.slice(),a=0,o=n.length;o>a;a++)this.select_node(n[a],r,i);return!0}return n=this.get_node(n),n&&"#"!==n.id?(s=this.get_node(n,!0),n.state.selected||(n.state.selected=!0,this._data.core.selected.push(n.id),i||(s=this._open_to(n)),s&&s.length&&s.children(".jstree-anchor").addClass("jstree-clicked"),this.trigger("select_node",{node:n,selected:this._data.core.selected}),r||this.trigger("changed",{action:"select_node",node:n,selected:this._data.core.selected})),t):!1},deselect_node:function(n,r){var i,s,a;if(e.isArray(n)){for(n=n.slice(),i=0,s=n.length;s>i;i++)this.deselect_node(n[i],r);return!0}return n=this.get_node(n),n&&"#"!==n.id?(a=this.get_node(n,!0),n.state.selected&&(n.state.selected=!1,this._data.core.selected=e.vakata.array_remove_item(this._data.core.selected,n.id),a.length&&a.children(".jstree-anchor").removeClass("jstree-clicked"),this.trigger("deselect_node",{node:n,selected:this._data.core.selected}),r||this.trigger("changed",{action:"deselect_node",node:n,selected:this._data.core.selected})),t):!1},select_all:function(e){var t=this._data.core.selected.concat([]),n,r;for(this._data.core.selected=this._model.data["#"].children_d.concat(),n=0,r=this._data.core.selected.length;r>n;n++)this._model.data[this._data.core.selected[n]]&&(this._model.data[this._data.core.selected[n]].state.selected=!0);this.redraw(!0),this.trigger("select_all",{selected:this._data.core.selected}),e||this.trigger("changed",{action:"select_all",selected:this._data.core.selected,old_selection:t})},deselect_all:function(e){var t=this._data.core.selected.concat([]),n,r;for(n=0,r=this._data.core.selected.length;r>n;n++)this._model.data[this._data.core.selected[n]]&&(this._model.data[this._data.core.selected[n]].state.selected=!1);this._data.core.selected=[],this.element.find(".jstree-clicked").removeClass("jstree-clicked"),this.trigger("deselect_all",{selected:this._data.core.selected,node:t}),e||this.trigger("changed",{action:"deselect_all",selected:this._data.core.selected,old_selection:t})},is_selected:function(e){return e=this.get_node(e),e&&"#"!==e.id?e.state.selected:!1},get_selected:function(t){return t?e.map(this._data.core.selected,e.proxy(function(e){return this.get_node(e)},this)):this._data.core.selected},get_state:function(){var e={core:{open:[],scroll:{left:this.element.scrollLeft(),top:this.element.scrollTop()},selected:[]}},t;for(t in this._model.data)this._model.data.hasOwnProperty(t)&&"#"!==t&&(this._model.data[t].state.opened&&e.core.open.push(t),this._model.data[t].state.selected&&e.core.selected.push(t));return e},set_state:function(n,r){if(n){if(n.core){var i,s,a,o;if(n.core.open)return e.isArray(n.core.open)?(i=!0,s=!1,a=this,e.each(n.core.open.concat([]),function(t,r){s=a.get_node(r),s&&(a.is_loaded(r)?(a.is_closed(r)&&a.open_node(r,!1,0),e.vakata.array_remove_item(n.core.open,r)):(a.is_loading(r)||a.open_node(r,e.proxy(function(){this.set_state(n)},a),0),i=!1))}),i&&(delete n.core.open,this.set_state(n,r)),!1):(delete n.core.open,this.set_state(n,r),!1);if(n.core.scroll)return n.core.scroll&&n.core.scroll.left!==t&&this.element.scrollLeft(n.core.scroll.left),n.core.scroll&&n.core.scroll.top!==t&&this.element.scrollTop(n.core.scroll.top),delete n.core.scroll,this.set_state(n,r),!1;if(n.core.selected)return o=this,this.deselect_all(),e.each(n.core.selected,function(e,t){o.select_node(t)}),delete n.core.selected,this.set_state(n,r),!1;if(e.isEmptyObject(n.core))return delete n.core,this.set_state(n,r),!1}return e.isEmptyObject(n)?(r&&r.call(this),this.trigger("set_state"),!1):!0}return!1},refresh:function(){this._data.core.state=this.get_state(),this.load_node("#",function(t,n){n&&this.set_state(e.extend(!0,{},this._data.core.state),function(){this.trigger("refresh")}),this._data.core.state=null})},set_id:function(t,n){if(t=this.get_node(t),!t||"#"===t.id)return!1;var r,i,s=this._model.data;for(s[t.parent].children[e.inArray(t.id,s[t.parent].children)]=n,r=0,i=t.parents.length;i>r;r++)s[t.parents[r]].children_d[e.inArray(t.id,s[t.parents[r]].children_d)]=n;for(r=0,i=t.children.length;i>r;r++)s[t.children[r]].parent=n;for(r=0,i=t.children_d.length;i>r;r++)s[t.children_d[r]].parents[e.inArray(t.id,s[t.children_d[r]].parents)]=n;return r=this.get_node(t.id,!0),r&&r.attr("id",n),delete s[t.id],t.id=n,s[n]=t,!0},get_text:function(e){return e=this.get_node(e),e&&"#"!==e.id?e.text:!1},set_text:function(t,n){var r,i,s,a;if(e.isArray(t)){for(t=t.slice(),r=0,i=t.length;i>r;r++)this.set_text(t[r],n);return!0}return t=this.get_node(t),t&&"#"!==t.id?(t.text=n,s=this.get_node(t,!0),s.length&&(s=s.children(".jstree-anchor:eq(0)"),a=s.children("I").clone(),s.html(n).prepend(a),this.trigger("set_text",{obj:t,text:n})),!0):!1},get_json:function(e,t,n){if(e=this.get_node(e||"#"),!e)return!1;t.flat&&!n&&(n=[]);var r={id:e.id,text:e.text,icon:this.get_icon(e),li_attr:e.li_attr,a_attr:e.a_attr,state:{},data:t&&t.no_data?!1:e.data},i,s;if(t.flat?r.parent=e.parent:r.children=[],!t||!t.no_state)for(i in e.state)e.state.hasOwnProperty(i)&&(r.state[i]=e.state[i]);if(t&&t.no_id&&(delete r.id,r.li_attr&&r.li_attr.id&&delete r.li_attr.id),t.flat&&"#"!==e.id&&n.push(r),!t||!t.no_children)for(i=0,s=e.children.length;s>i;i++)t.flat?this.get_json(e.children[i],t,n):r.children.push(this.get_json(e.children[i],t));return t.flat?n:"#"===e.id?r.children:r},create_node:function(n,r,i,s,a){if(n=this.get_node(n),!n)return!1;if(i=i===t?"last":i,!i.match(/^(before|after)$/)&&!a&&!this.is_loaded(n))return this.load_node(n,function(){this.create_node(n,r,i,s,!0)});r||(r={text:this.get_string("New node")}),r.text===t&&(r.text=this.get_string("New node"));var o,d,l,c;switch("#"===n.id&&("before"===i&&(i="first"),"after"===i&&(i="last")),i){case"before":o=this.get_node(n.parent),i=e.inArray(n.id,o.children),n=o;break;case"after":o=this.get_node(n.parent),i=e.inArray(n.id,o.children)+1,n=o;break;case"inside":case"first":i=0;break;case"last":i=n.children.length;break;default:i||(i=0)}if(i>n.children.length&&(i=n.children.length),r.id||(r.id=!0),!this.check("create_node",r,n,i))return!1;if(r.id===!0&&delete r.id,r=this._parse_model_from_json(r,n.id,n.parents.concat()),!r)return!1;for(o=this.get_node(r),d=[],d.push(r),d=d.concat(o.children_d),this.trigger("model",{nodes:d,parent:n.id}),n.children_d=n.children_d.concat(d),l=0,c=n.parents.length;c>l;l++)this._model.data[n.parents[l]].children_d=this._model.data[n.parents[l]].children_d.concat(d);
+for(r=o,o=[],l=0,c=n.children.length;c>l;l++)o[l>=i?l+1:l]=n.children[l];return o[i]=r.id,n.children=o,this.redraw_node(n,!0),s&&s.call(this,this.get_node(r)),this.trigger("create_node",{node:this.get_node(r),parent:n.id,position:i}),r.id},rename_node:function(t,n){var r,i,s;if(e.isArray(t)){for(t=t.slice(),r=0,i=t.length;i>r;r++)this.rename_node(t[r],n);return!0}return t=this.get_node(t),t&&"#"!==t.id?(s=t.text,this.check("rename_node",t,this.get_parent(t),n)?(this.set_text(t,n),this.trigger("rename_node",{node:t,text:n,old:s}),!0):!1):!1},delete_node:function(t){var n,r,i,s,a,o,d,l,c,h;if(e.isArray(t)){for(t=t.slice(),n=0,r=t.length;r>n;n++)this.delete_node(t[n]);return!0}if(t=this.get_node(t),!t||"#"===t.id)return!1;if(i=this.get_node(t.parent),s=e.inArray(t.id,i.children),h=!1,!this.check("delete_node",t,i,s))return!1;for(-1!==s&&(i.children=e.vakata.array_remove(i.children,s)),a=t.children_d.concat([]),a.push(t.id),l=0,c=a.length;c>l;l++){for(o=0,d=t.parents.length;d>o;o++)s=e.inArray(a[l],this._model.data[t.parents[o]].children_d),-1!==s&&(this._model.data[t.parents[o]].children_d=e.vakata.array_remove(this._model.data[t.parents[o]].children_d,s));this._model.data[a[l]].state.selected&&(h=!0,s=e.inArray(a[l],this._data.core.selected),-1!==s&&(this._data.core.selected=e.vakata.array_remove(this._data.core.selected,s)))}for(this.trigger("delete_node",{node:t,parent:i.id}),h&&this.trigger("changed",{action:"delete_node",node:t,selected:this._data.core.selected,parent:i.id}),l=0,c=a.length;c>l;l++)delete this._model.data[a[l]];return this.redraw_node(i,!0),!0},check:function(t,n,r,i){n=n&&n.id?n:this.get_node(n),r=r&&r.id?r:this.get_node(r);var s=t.match(/^move_node|copy_node|create_node$/i)?r:n,a=this.settings.core.check_callback;return"move_node"!==t||n.id!==r.id&&e.inArray(n.id,r.children)!==i&&-1===e.inArray(r.id,n.children_d)?(s=this.get_node(s,!0),s.length&&(s=s.data("jstree")),s&&s.functions&&(s.functions[t]===!1||s.functions[t]===!0)?s.functions[t]:a===!1||e.isFunction(a)&&a.call(this,t,n,r,i)===!1||a&&a[t]===!1?!1:!0):!1},move_node:function(n,r,i,s,a){var o,d,l,c,h,_,u,f,g,p,m,v,j;if(e.isArray(n)){for(n=n.reverse().slice(),o=0,d=n.length;d>o;o++)this.move_node(n[o],r,i,s,a);return!0}if(n=n&&n.id?n:this.get_node(n),r=this.get_node(r),i=i===t?0:i,!r||!n||"#"===n.id)return!1;if(!(""+i).match(/^(before|after)$/)&&!a&&!this.is_loaded(r))return this.load_node(r,function(){this.move_node(n,r,i,s,!0)});if(l=""+(n.parent||"#"),c=(""+i).match(/^(before|after)$/)&&"#"!==r.id?this.get_node(r.parent):r,h=this._model.data[n.id]?this:e.jstree.reference(n.id),_=!h||!h._id||this._id!==h._id)return this.copy_node(n,r,i,s,a)?(h&&h.delete_node(n),!0):!1;switch("#"===c.id&&("before"===i&&(i="first"),"after"===i&&(i="last")),i){case"before":i=e.inArray(r.id,c.children);break;case"after":i=e.inArray(r.id,c.children)+1;break;case"inside":case"first":i=0;break;case"last":i=c.children.length;break;default:i||(i=0)}if(i>c.children.length&&(i=c.children.length),!this.check("move_node",n,c,i))return!1;if(n.parent===c.id){for(u=c.children.concat(),f=e.inArray(n.id,u),-1!==f&&(u=e.vakata.array_remove(u,f),i>f&&i--),f=[],g=0,p=u.length;p>g;g++)f[g>=i?g+1:g]=u[g];f[i]=n.id,c.children=f,this._node_changed(c.id),this.redraw("#"===c.id)}else{for(f=n.children_d.concat(),f.push(n.id),g=0,p=n.parents.length;p>g;g++){for(u=[],j=h._model.data[n.parents[g]].children_d,m=0,v=j.length;v>m;m++)-1===e.inArray(j[m],f)&&u.push(j[m]);h._model.data[n.parents[g]].children_d=u}for(h._model.data[l].children=e.vakata.array_remove_item(h._model.data[l].children,n.id),g=0,p=c.parents.length;p>g;g++)this._model.data[c.parents[g]].children_d=this._model.data[c.parents[g]].children_d.concat(f);for(u=[],g=0,p=c.children.length;p>g;g++)u[g>=i?g+1:g]=c.children[g];for(u[i]=n.id,c.children=u,c.children_d.push(n.id),c.children_d=c.children_d.concat(n.children_d),n.parent=c.id,f=c.parents.concat(),f.unshift(c.id),j=n.parents.length,n.parents=f,f=f.concat(),g=0,p=n.children_d.length;p>g;g++)this._model.data[n.children_d[g]].parents=this._model.data[n.children_d[g]].parents.slice(0,-1*j),Array.prototype.push.apply(this._model.data[n.children_d[g]].parents,f);this._node_changed(l),this._node_changed(c.id),this.redraw("#"===l||"#"===c.id)}return s&&s.call(this,n,c,i),this.trigger("move_node",{node:n,parent:c.id,position:i,old_parent:l,is_multi:_,old_instance:h,new_instance:this}),!0},copy_node:function(n,r,i,s,a){var o,d,l,c,h,_,u,f,g,p,m;if(e.isArray(n)){for(n=n.reverse().slice(),o=0,d=n.length;d>o;o++)this.copy_node(n[o],r,i,s,a);return!0}if(n=n&&n.id?n:this.get_node(n),r=this.get_node(r),i=i===t?0:i,!r||!n||"#"===n.id)return!1;if(!(""+i).match(/^(before|after)$/)&&!a&&!this.is_loaded(r))return this.load_node(r,function(){this.copy_node(n,r,i,s,!0)});switch(f=""+(n.parent||"#"),g=(""+i).match(/^(before|after)$/)&&"#"!==r.id?this.get_node(r.parent):r,p=this._model.data[n.id]?this:e.jstree.reference(n.id),m=!p||!p._id||this._id!==p._id,"#"===g.id&&("before"===i&&(i="first"),"after"===i&&(i="last")),i){case"before":i=e.inArray(r.id,g.children);break;case"after":i=e.inArray(r.id,g.children)+1;break;case"inside":case"first":i=0;break;case"last":i=g.children.length;break;default:i||(i=0)}if(i>g.children.length&&(i=g.children.length),!this.check("copy_node",n,g,i))return!1;if(u=p?p.get_json(n,{no_id:!0,no_data:!0,no_state:!0}):n,!u)return!1;if(u.id===!0&&delete u.id,u=this._parse_model_from_json(u,g.id,g.parents.concat()),!u)return!1;for(c=this.get_node(u),l=[],l.push(u),l=l.concat(c.children_d),this.trigger("model",{nodes:l,parent:g.id}),h=0,_=g.parents.length;_>h;h++)this._model.data[g.parents[h]].children_d=this._model.data[g.parents[h]].children_d.concat(l);for(l=[],h=0,_=g.children.length;_>h;h++)l[h>=i?h+1:h]=g.children[h];return l[i]=c.id,g.children=l,g.children_d.push(c.id),g.children_d=g.children_d.concat(c.children_d),this._node_changed(g.id),this.redraw("#"===g.id),s&&s.call(this,c,g,i),this.trigger("copy_node",{node:c,original:n,parent:g.id,position:i,old_parent:f,is_multi:m,old_instance:p,new_instance:this}),c.id},cut:function(n){if(n||(n=this._data.core.selected.concat()),e.isArray(n)||(n=[n]),!n.length)return!1;var r=[],o,d,l;for(d=0,l=n.length;l>d;d++)o=this.get_node(n[d]),o&&o.id&&"#"!==o.id&&r.push(o);return r.length?(i=r,a=this,s="move_node",this.trigger("cut",{node:n}),t):!1},copy:function(n){if(n||(n=this._data.core.selected.concat()),e.isArray(n)||(n=[n]),!n.length)return!1;var r=[],o,d,l;for(d=0,l=n.length;l>d;d++)o=this.get_node(n[d]),o&&o.id&&"#"!==o.id&&r.push(o);return r.length?(i=r,a=this,s="copy_node",this.trigger("copy",{node:n}),t):!1},get_buffer:function(){return{mode:s,node:i,inst:a}},can_paste:function(){return s!==!1&&i!==!1},paste:function(e){return e=this.get_node(e),e&&s&&s.match(/^(copy_node|move_node)$/)&&i?(this[s](i,e)&&this.trigger("paste",{parent:e.id,node:i,mode:s}),i=!1,s=!1,a=!1,t):!1},edit:function(n,r){if(n=this._open_to(n),!n||!n.length)return!1;var i=this._data.core.rtl,s=this.element.width(),a=n.children(".jstree-anchor"),o=e("<span>"),d="string"==typeof r?r:this.get_text(n),l=e("<div />",{css:{position:"absolute",top:"-200px",left:i?"0px":"-1000px",visibility:"hidden"}}).appendTo("body"),c=e("<input />",{value:d,"class":"jstree-rename-input",css:{padding:"0",border:"1px solid silver","box-sizing":"border-box",display:"inline-block",height:this._data.core.li_height+"px",lineHeight:this._data.core.li_height+"px",width:"150px"},blur:e.proxy(function(){var e=o.children(".jstree-rename-input"),t=e.val();""===t&&(t=d),l.remove(),o.replaceWith(a),o.remove(),this.set_text(n,d),this.rename_node(n,t)===!1&&this.set_text(n,d)},this),keydown:function(e){var t=e.which;27===t&&(this.value=d),(27===t||13===t||37===t||38===t||39===t||40===t||32===t)&&e.stopImmediatePropagation(),(27===t||13===t)&&(e.preventDefault(),this.blur())},click:function(e){e.stopImmediatePropagation()},mousedown:function(e){e.stopImmediatePropagation()},keyup:function(e){c.width(Math.min(l.text("pW"+this.value).width(),s))},keypress:function(e){return 13===e.which?!1:t}}),h={fontFamily:a.css("fontFamily")||"",fontSize:a.css("fontSize")||"",fontWeight:a.css("fontWeight")||"",fontStyle:a.css("fontStyle")||"",fontStretch:a.css("fontStretch")||"",fontVariant:a.css("fontVariant")||"",letterSpacing:a.css("letterSpacing")||"",wordSpacing:a.css("wordSpacing")||""};this.set_text(n,""),o.attr("class",a.attr("class")).append(a.contents().clone()).append(c),a.replaceWith(o),l.css(h),c.css(h).width(Math.min(l.text("pW"+c[0].value).width(),s))[0].select()},set_theme:function(t,n){if(!t)return!1;if(n===!0){var r=this.settings.core.themes.dir;r||(r=e.jstree.path+"/themes"),n=r+"/"+t+"/style.css"}n&&-1===e.inArray(n,o)&&(e("head").append('<link rel="stylesheet" href="'+n+'" type="text/css" />'),o.push(n)),this._data.core.themes.name&&this.element.removeClass("jstree-"+this._data.core.themes.name),this._data.core.themes.name=t,this.element.addClass("jstree-"+t),this.element[this.settings.core.themes.responsive?"addClass":"removeClass"]("jstree-"+t+"-responsive"),this.trigger("set_theme",{theme:t})},get_theme:function(){return this._data.core.themes.name},set_theme_variant:function(e){this._data.core.themes.variant&&this.element.removeClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant),this._data.core.themes.variant=e,e&&this.element.addClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant)},get_theme_variant:function(){return this._data.core.themes.variant},show_stripes:function(){this._data.core.themes.stripes=!0,this.get_container_ul().addClass("jstree-striped")},hide_stripes:function(){this._data.core.themes.stripes=!1,this.get_container_ul().removeClass("jstree-striped")},toggle_stripes:function(){this._data.core.themes.stripes?this.hide_stripes():this.show_stripes()},show_dots:function(){this._data.core.themes.dots=!0,this.get_container_ul().removeClass("jstree-no-dots")},hide_dots:function(){this._data.core.themes.dots=!1,this.get_container_ul().addClass("jstree-no-dots")},toggle_dots:function(){this._data.core.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this._data.core.themes.icons=!0,this.get_container_ul().removeClass("jstree-no-icons")},hide_icons:function(){this._data.core.themes.icons=!1,this.get_container_ul().addClass("jstree-no-icons")},toggle_icons:function(){this._data.core.themes.icons?this.hide_icons():this.show_icons()},set_icon:function(t,n){var r,i,s,a;if(e.isArray(t)){for(t=t.slice(),r=0,i=t.length;i>r;r++)this.set_icon(t[r],n);return!0}return t=this.get_node(t),t&&"#"!==t.id?(a=t.icon,t.icon=n,s=this.get_node(t,!0).children(".jstree-anchor").children(".jstree-themeicon"),n===!1?this.hide_icon(t):n===!0?s.removeClass("jstree-themeicon-custom "+a).css("background","").removeAttr("rel"):-1===n.indexOf("/")&&-1===n.indexOf(".")?(s.removeClass(a).css("background",""),s.addClass(n+" jstree-themeicon-custom").attr("rel",n)):(s.removeClass(a).css("background",""),s.addClass("jstree-themeicon-custom").css("background","url('"+n+"') center center no-repeat").attr("rel",n)),!0):!1},get_icon:function(e){return e=this.get_node(e),e&&"#"!==e.id?e.icon:!1},hide_icon:function(t){var n,r;if(e.isArray(t)){for(t=t.slice(),n=0,r=t.length;r>n;n++)this.hide_icon(t[n]);return!0}return t=this.get_node(t),t&&"#"!==t?(t.icon=!1,this.get_node(t,!0).children("a").children(".jstree-themeicon").addClass("jstree-themeicon-hidden"),!0):!1},show_icon:function(t){var n,r,i;if(e.isArray(t)){for(t=t.slice(),n=0,r=t.length;r>n;n++)this.show_icon(t[n]);return!0}return t=this.get_node(t),t&&"#"!==t?(i=this.get_node(t,!0),t.icon=i.length?i.children("a").children(".jstree-themeicon").attr("rel"):!0,t.icon||(t.icon=!0),i.children("a").children(".jstree-themeicon").removeClass("jstree-themeicon-hidden"),!0):!1}},e.vakata={},e.fn.vakata_reverse=[].reverse,e.vakata.attributes=function(t,n){t=e(t)[0];var r=n?{}:[];return t&&t.attributes&&e.each(t.attributes,function(t,i){-1===e.inArray(i.nodeName.toLowerCase(),["style","contenteditable","hasfocus","tabindex"])&&null!==i.nodeValue&&""!==e.trim(i.nodeValue)&&(n?r[i.nodeName]=i.nodeValue:r.push(i.nodeName))}),r},e.vakata.array_unique=function(e){var t=[],n,r,i;for(n=0,i=e.length;i>n;n++){for(r=0;n>=r;r++)if(e[n]===e[r])break;r===n&&t.push(e[n])}return t},e.vakata.array_remove=function(e,t,n){var r=e.slice((n||t)+1||e.length);return e.length=0>t?e.length+t:t,e.push.apply(e,r),e},e.vakata.array_remove_item=function(t,n){var r=e.inArray(n,t);return-1!==r?e.vakata.array_remove(t,r):t},function(){var t={},n=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},r=n(window.navigator.userAgent);r.browser&&(t[r.browser]=!0,t.version=r.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),e.vakata.browser=t}(),e.vakata.browser.msie&&8>e.vakata.browser.version&&(e.jstree.defaults.core.animation=0),function(e,t){var n=function(e){var t=/["\\\x00-\x1f\x7f-\x9f]/g,n={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return e.match(t)?'"'+e.replace(t,function(e){var t=n[e];return"string"==typeof t?t:(t=e.charCodeAt(),"\\u00"+Math.floor(t/16).toString(16)+(t%16).toString(16))})+'"':'"'+e+'"'};e.vakata.json={encode:JSON&&JSON.stringify?JSON.stringify:function(r){if(null===r)return"null";var i=[],s;switch(typeof r){case"undefined":return t;case"number":case"boolean":return""+r;case"string":return n(r);case"object":if(e.isFunction(r.toJSON))return e.vakata.json.encode(r.toJSON());if(r.constructor===Date)return'"'+r.getUTCFullYear()+"-"+("0"+(r.getUTCMonth()+1)+"").slice(-2)+"-"+("0"+r.getUTCDate()+"").slice(-2)+"T"+("0"+r.getUTCHours()+"").slice(-2)+":"+("0"+r.getUTCMinutes()+"").slice(-2)+":"+("0"+r.getUTCSeconds()+"").slice(-2)+"."+("00"+r.getUTCMilliseconds()+"").slice(-3)+'Z"';if(r.constructor===Array){for(s=0;r.length>s;s++)i.push(e.vakata.json.encode(r[s])||"null");return"["+i.join(",")+"]"}return e.each(r,function(r,s){return e.isFunction(s)?!0:(r="number"==typeof r?'"'+r+'"':n(r),s=e.vakata.json.encode(s),i.push(r+":"+s),t)}),"{"+i.join(", ")+"}"}},decode:JSON&&JSON.parse?JSON.parse:function(t){return e.parseJSON(t)}}}(jQuery);var u=document.createElement("I");u.className="jstree-icon jstree-checkbox",e.jstree.defaults.checkbox={visible:!0,three_state:!0,whole_node:!0,keep_selected_style:!0},e.jstree.plugins.checkbox=function(t,n){this.bind=function(){n.bind.call(this),this._data.checkbox.uto=!1,this.element.on("init.jstree",e.proxy(function(){this._data.checkbox.visible=this.settings.checkbox.visible,this.settings.checkbox.keep_selected_style||this.element.addClass("jstree-checkbox-no-clicked")},this)).on("loading.jstree",e.proxy(function(){this[this._data.checkbox.visible?"show_checkboxes":"hide_checkboxes"]()},this)),this.settings.checkbox.three_state&&this.element.on("changed.jstree move_node.jstree copy_node.jstree redraw.jstree open_node.jstree",e.proxy(function(){this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(e.proxy(this._undetermined,this),50)},this)).on("model.jstree",e.proxy(function(t,n){var r=this._model.data,i=r[n.parent],s=n.nodes,a=[],o,d,l,c,h,_;if(i.state.selected){for(d=0,l=s.length;l>d;d++)r[s[d]].state.selected=!0;this._data.core.selected=this._data.core.selected.concat(s)}else for(d=0,l=s.length;l>d;d++)if(r[s[d]].state.selected){for(c=0,h=r[s[d]].children_d.length;h>c;c++)r[r[s[d]].children_d[c]].state.selected=!0;this._data.core.selected=this._data.core.selected.concat(r[s[d]].children_d)}for(d=0,l=i.children_d.length;l>d;d++)r[i.children_d[d]].children.length||a.push(r[i.children_d[d]].parent);for(a=e.vakata.array_unique(a),c=0,h=a.length;h>c;c++){i=r[a[c]];while(i&&"#"!==i.id){for(o=0,d=0,l=i.children.length;l>d;d++)o+=r[i.children[d]].state.selected;if(o!==l)break;i.state.selected=!0,this._data.core.selected.push(i.id),_=this.get_node(i,!0),_&&_.length&&_.children(".jstree-anchor").addClass("jstree-clicked"),i=this.get_node(i.parent)}}this._data.core.selected=e.vakata.array_unique(this._data.core.selected)},this)).on("select_node.jstree",e.proxy(function(t,n){var r=n.node,i=this._model.data,s=this.get_node(r.parent),a=this.get_node(r,!0),o,d,l,c;for(this._data.core.selected=e.vakata.array_unique(this._data.core.selected.concat(r.children_d)),o=0,d=r.children_d.length;d>o;o++)i[r.children_d[o]].state.selected=!0;while(s&&"#"!==s.id){for(l=0,o=0,d=s.children.length;d>o;o++)l+=i[s.children[o]].state.selected;if(l!==d)break;s.state.selected=!0,this._data.core.selected.push(s.id),c=this.get_node(s,!0),c&&c.length&&c.children(".jstree-anchor").addClass("jstree-clicked"),s=this.get_node(s.parent)}a.length&&a.find(".jstree-anchor").addClass("jstree-clicked")},this)).on("deselect_node.jstree",e.proxy(function(t,n){var r=n.node,i=this.get_node(r,!0),s,a,o;for(s=0,a=r.children_d.length;a>s;s++)this._model.data[r.children_d[s]].state.selected=!1;for(s=0,a=r.parents.length;a>s;s++)this._model.data[r.parents[s]].state.selected=!1,o=this.get_node(r.parents[s],!0),o&&o.length&&o.children(".jstree-anchor").removeClass("jstree-clicked");for(o=[],s=0,a=this._data.core.selected.length;a>s;s++)-1===e.inArray(this._data.core.selected[s],r.children_d)&&-1===e.inArray(this._data.core.selected[s],r.parents)&&o.push(this._data.core.selected[s]);this._data.core.selected=e.vakata.array_unique(o),i.length&&i.find(".jstree-anchor").removeClass("jstree-clicked")},this)).on("delete_node.jstree",e.proxy(function(e,t){var n=this.get_node(t.parent),r=this._model.data,i,s,a,o;while(n&&"#"!==n.id){for(a=0,i=0,s=n.children.length;s>i;i++)a+=r[n.children[i]].state.selected;if(a!==s)break;n.state.selected=!0,this._data.core.selected.push(n.id),o=this.get_node(n,!0),o&&o.length&&o.children(".jstree-anchor").addClass("jstree-clicked"),n=this.get_node(n.parent)}},this)).on("move_node.jstree",e.proxy(function(t,n){var r=n.is_multi,i=n.old_parent,s=this.get_node(n.parent),a=this._model.data,o,d,l,c,h;if(!r){o=this.get_node(i);while(o&&"#"!==o.id){for(d=0,l=0,c=o.children.length;c>l;l++)d+=a[o.children[l]].state.selected;if(d!==c)break;o.state.selected=!0,this._data.core.selected.push(o.id),h=this.get_node(o,!0),h&&h.length&&h.children(".jstree-anchor").addClass("jstree-clicked"),o=this.get_node(o.parent)}}o=s;while(o&&"#"!==o.id){for(d=0,l=0,c=o.children.length;c>l;l++)d+=a[o.children[l]].state.selected;if(d===c)o.state.selected||(o.state.selected=!0,this._data.core.selected.push(o.id),h=this.get_node(o,!0),h&&h.length&&h.children(".jstree-anchor").addClass("jstree-clicked"));else{if(!o.state.selected)break;o.state.selected=!1,this._data.core.selected=e.vakata.array_remove_item(this._data.core.selected,o.id),h=this.get_node(o,!0),h&&h.length&&h.children(".jstree-anchor").removeClass("jstree-clicked")}o=this.get_node(o.parent)}},this))},this._undetermined=function(){var t,n,r=this._model.data,i=this._data.core.selected,s=[],a=this;for(t=0,n=i.length;n>t;t++)r[i[t]]&&r[i[t]].parents&&(s=s.concat(r[i[t]].parents));for(this.element.find(".jstree-closed").not(":has(ul)").each(function(){var e=a.get_node(this);!e.state.loaded&&e.original&&e.original.state&&e.original.state.undetermined&&e.original.state.undetermined===!0&&(s.push(e.id),s=s.concat(e.parents))}),s=e.vakata.array_unique(s),t=e.inArray("#",s),-1!==t&&(s=e.vakata.array_remove(s,t)),this.element.find(".jstree-undetermined").removeClass("jstree-undetermined"),t=0,n=s.length;n>t;t++)r[s[t]].state.selected||(i=this.get_node(s[t],!0),i&&i.length&&i.children("a").children(".jstree-checkbox").addClass("jstree-undetermined"))},this.redraw_node=function(t,r,i){if(t=n.redraw_node.call(this,t,r,i)){var s=t.getElementsByTagName("A")[0];s.insertBefore(u.cloneNode(),s.childNodes[0])}return!i&&this.settings.checkbox.three_state&&(this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(e.proxy(this._undetermined,this),50)),t},this.activate_node=function(t,r){return(this.settings.checkbox.whole_node||e(r.target).hasClass("jstree-checkbox"))&&(r.ctrlKey=!0),n.activate_node.call(this,t,r)},this.show_checkboxes=function(){this._data.core.themes.checkboxes=!0,this.element.children("ul").removeClass("jstree-no-checkboxes")},this.hide_checkboxes=function(){this._data.core.themes.checkboxes=!1,this.element.children("ul").addClass("jstree-no-checkboxes")},this.toggle_checkboxes=function(){this._data.core.themes.checkboxes?this.hide_checkboxes():this.show_checkboxes()}},e.jstree.defaults.contextmenu={select_node:!0,show_at_node:!0,items:function(t,n){n({create:{separator_before:!1,separator_after:!0,_disabled:!1,label:"Create",action:function(t){var n=e.jstree.reference(t.reference),r=n.get_node(t.reference);n.create_node(r,{},"last",function(e){setTimeout(function(){n.edit(e)},0)})}},rename:{separator_before:!1,separator_after:!1,_disabled:!1,label:"Rename",action:function(t){var n=e.jstree.reference(t.reference),r=n.get_node(t.reference);n.edit(r)}},remove:{separator_before:!1,icon:!1,separator_after:!1,_disabled:!1,label:"Delete",action:function(t){var n=e.jstree.reference(t.reference),r=n.get_node(t.reference);n.is_selected(r)?n.delete_node(n.get_selected()):n.delete_node(r)}},ccp:{separator_before:!0,icon:!1,separator_after:!1,label:"Edit",action:!1,submenu:{cut:{separator_before:!1,separator_after:!1,label:"Cut",action:function(t){var n=e.jstree.reference(t.reference),r=n.get_node(t.reference);n.is_selected(r)?n.cut(n.get_selected()):n.cut(r)}},copy:{separator_before:!1,icon:!1,separator_after:!1,label:"Copy",action:function(t){var n=e.jstree.reference(t.reference),r=n.get_node(t.reference);n.is_selected(r)?n.copy(n.get_selected()):n.copy(r)}},paste:{separator_before:!1,icon:!1,_disabled:!this.can_paste(),separator_after:!1,label:"Paste",action:function(t){var n=e.jstree.reference(t.reference),r=n.get_node(t.reference);n.paste(r)}}}}})}},e.jstree.plugins.contextmenu=function(n,r){this.bind=function(){r.bind.call(this),this.element.on("contextmenu.jstree","a",e.proxy(function(e){e.preventDefault(),this.is_loading(e.currentTarget)||this.show_contextmenu(e.currentTarget,e.pageX,e.pageY)},this)).on("click.jstree","a",e.proxy(function(t){this._data.contextmenu.visible&&e.vakata.context.hide()},this)),e(document).on("context_hide.vakata",e.proxy(function(){this._data.contextmenu.visible=!1},this))},this.teardown=function(){this._data.contextmenu.visible&&e.vakata.context.hide(),r.teardown.call(this)},this.show_contextmenu=function(n,r,i){if(n=this.get_node(n),!n||"#"===n.id)return!1;var s=this.settings.contextmenu,a=this.get_node(n,!0),o=a.children(".jstree-anchor"),d=!1,l=!1;(s.show_at_node||r===t||i===t)&&(d=o.offset(),r=d.left,i=d.top+this._data.core.li_height),this.settings.contextmenu.select_node&&!this.is_selected(n)&&(this.deselect_all(),this.select_node(n)),l=s.items,e.isFunction(l)&&(l=l.call(this,n,e.proxy(function(e){this._show_contextmenu(n,r,i,e)},this))),e.isPlainObject(l)&&this._show_contextmenu(n,r,i,l)},this._show_contextmenu=function(t,n,r,i){var s=this.get_node(t,!0),a=s.children(".jstree-anchor");e(document).one("context_show.vakata",e.proxy(function(t,n){var r="jstree-contextmenu jstree-"+this.get_theme()+"-contextmenu";e(n.element).addClass(r)},this)),this._data.contextmenu.visible=!0,e.vakata.context.show(a,{x:n,y:r},i),this.trigger("show_contextmenu",{node:t,x:n,y:r})}},function(e){var n=!1,r={element:!1,reference:!1,position_x:0,position_y:0,items:[],html:"",is_visible:!1};e.vakata.context={settings:{hide_onmouseleave:0,icons:!0},_trigger:function(t){e(document).triggerHandler("context_"+t+".vakata",{reference:r.reference,element:r.element,position:{x:r.position_x,y:r.position_y}})},_execute:function(e){return e=r.items[e],e&&!e._disabled&&e.action?e.action.call(null,{item:e,reference:r.reference,element:r.element,position:{x:r.position_x,y:r.position_y}}):!1},_parse:function(n,i){if(!n)return!1;i||(r.html="",r.items=[]);var s="",a=!1,o;return i&&(s+="<ul>"),e.each(n,function(n,i){return i?(r.items.push(i),!a&&i.separator_before&&(s+="<li class='vakata-context-separator'><a href='#' "+(e.vakata.context.settings.icons?"":'style="margin-left:0px;"')+"> <"+"/a><"+"/li>"),a=!1,s+="<li class='"+(i._class||"")+(i._disabled?" vakata-contextmenu-disabled ":"")+"' "+(i.shortcut?" data-shortcut='"+i.shortcut+"' ":"")+">",s+="<a href='#' rel='"+(r.items.length-1)+"'>",e.vakata.context.settings.icons&&(s+="<i ",i.icon&&(s+=-1!==i.icon.indexOf("/")||-1!==i.icon.indexOf(".")?" style='background:url(\""+i.icon+"\") center center no-repeat' ":" class='"+i.icon+"' "),s+="></i><span class='vakata-contextmenu-sep'> </span>"),s+=i.label+(i.shortcut?' <span class="vakata-contextmenu-shortcut vakata-contextmenu-shortcut-'+i.shortcut+'">'+(i.shortcut_label||"")+"</span>":"")+"<"+"/a>",i.submenu&&(o=e.vakata.context._parse(i.submenu,!0),o&&(s+=o)),s+="</li>",i.separator_after&&(s+="<li class='vakata-context-separator'><a href='#' "+(e.vakata.context.settings.icons?"":'style="margin-left:0px;"')+"> <"+"/a><"+"/li>",a=!0),t):!0}),s=s.replace(/<li class\='vakata-context-separator'\><\/li\>$/,""),i&&(s+="</ul>"),i||(r.html=s,e.vakata.context._trigger("parse")),s.length>10?s:!1},_show_submenu:function(t){if(t=e(t),t.length&&t.children("ul").length){var r=t.children("ul"),i=t.offset().left+t.outerWidth(),s=t.offset().top,a=r.width(),o=r.height(),d=e(window).width()+e(window).scrollLeft(),l=e(window).height()+e(window).scrollTop();n?t[0>i-(a+10+t.outerWidth())?"addClass":"removeClass"]("vakata-context-left"):t[i+a+10>d?"addClass":"removeClass"]("vakata-context-right"),s+o+10>l&&r.css("bottom","-1px"),r.show()}},show:function(t,i,s){var a,o,d,l,c,h,_,u,f=!0;switch(r.element&&r.element.length&&r.element.width(""),f){case!i&&!t:return!1;case!!i&&!!t:r.reference=t,r.position_x=i.x,r.position_y=i.y;break;case!i&&!!t:r.reference=t,a=t.offset(),r.position_x=a.left+t.outerHeight(),r.position_y=a.top;break;case!!i&&!t:r.position_x=i.x,r.position_y=i.y}t&&!s&&e(t).data("vakata_contextmenu")&&(s=e(t).data("vakata_contextmenu")),e.vakata.context._parse(s)&&r.element.html(r.html),r.items.length&&(o=r.element,d=r.position_x,l=r.position_y,c=o.width(),h=o.height(),_=e(window).width()+e(window).scrollLeft(),u=e(window).height()+e(window).scrollTop(),n&&(d-=o.outerWidth(),e(window).scrollLeft()+20>d&&(d=e(window).scrollLeft()+20)),d+c+20>_&&(d=_-(c+20)),l+h+20>u&&(l=u-(h+20)),r.element.css({left:d,top:l}).show().find("a:eq(0)").focus().parent().addClass("vakata-context-hover"),r.is_visible=!0,e.vakata.context._trigger("show"))},hide:function(){r.is_visible&&(r.element.hide().find("ul").hide().end().find(":focus").blur(),r.is_visible=!1,e.vakata.context._trigger("hide"))}},e(function(){n="rtl"===e("body").css("direction");var t=!1;r.element=e("<ul class='vakata-context'></ul>"),r.element.on("mouseenter","li",function(n){n.stopImmediatePropagation(),e.contains(this,n.relatedTarget)||(t&&clearTimeout(t),r.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(),e(this).siblings().find("ul").hide().end().end().parentsUntil(".vakata-context","li").addBack().addClass("vakata-context-hover"),e.vakata.context._show_submenu(this))}).on("mouseleave","li",function(t){e.contains(this,t.relatedTarget)||e(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover")}).on("mouseleave",function(n){e(this).find(".vakata-context-hover").removeClass("vakata-context-hover"),e.vakata.context.settings.hide_onmouseleave&&(t=setTimeout(function(t){return function(){e.vakata.context.hide()}}(this),e.vakata.context.settings.hide_onmouseleave))}).on("click","a",function(e){e.preventDefault()}).on("mouseup","a",function(t){e(this).blur().parent().hasClass("vakata-context-disabled")||e.vakata.context._execute(e(this).attr("rel"))===!1||e.vakata.context.hide()}).on("keydown","a",function(t){var n=null;switch(t.which){case 13:case 32:t.type="mouseup",t.preventDefault(),e(t.currentTarget).trigger(t);break;case 37:r.is_visible&&(r.element.find(".vakata-context-hover").last().parents("li:eq(0)").find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children("a").focus(),t.stopImmediatePropagation(),t.preventDefault());break;case 38:r.is_visible&&(n=r.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first(),n.length||(n=r.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last()),n.addClass("vakata-context-hover").children("a").focus(),t.stopImmediatePropagation(),t.preventDefault());break;case 39:r.is_visible&&(r.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children("a").focus(),t.stopImmediatePropagation(),t.preventDefault());break;case 40:r.is_visible&&(n=r.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first(),n.length||(n=r.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first()),n.addClass("vakata-context-hover").children("a").focus(),t.stopImmediatePropagation(),t.preventDefault());break;case 27:e.vakata.context.hide(),t.preventDefault();break;default:}}).on("keydown",function(e){e.preventDefault();var t=r.element.find(".vakata-contextmenu-shortcut-"+e.which).parent();t.parent().not(".vakata-context-disabled")&&t.mouseup()}).appendTo("body"),e(document).on("mousedown",function(t){r.is_visible&&!e.contains(r.element[0],t.target)&&e.vakata.context.hide()}).on("context_show.vakata",function(e,t){r.element.find("li:has(ul)").children("a").addClass("vakata-context-parent"),n&&r.element.addClass("vakata-context-rtl").css("direction","rtl"),r.element.find("ul").hide().end()})})}(e),e.jstree.defaults.dnd={copy:!0,open_timeout:500,is_draggable:!0},e.jstree.plugins.dnd=function(n,r){this.bind=function(){r.bind.call(this),this.element.on("mousedown","a",e.proxy(function(n){var r=this.get_node(n.target),i=this.is_selected(r)?this.get_selected().length:1;return r&&r.id&&"#"!==r.id&&1===n.which&&(this.settings.dnd.is_draggable===!0||e.isFunction(this.settings.dnd.is_draggable)&&this.settings.dnd.is_draggable.call(this,r))?(this.element.trigger("mousedown.jstree"),e.vakata.dnd.start(n,{jstree:!0,origin:this,obj:this.get_node(r,!0),nodes:i>1?this.get_selected():[r.id]},'<div id="jstree-dnd" class="jstree-'+this.get_theme()+'"><i class="jstree-icon jstree-er"></i>'+(i>1?i+" "+this.get_string("nodes"):this.get_text(n.currentTarget,!0))+'<ins class="jstree-copy" style="display:none;">+</ins></div>')):t},this))}},e(function(){var n=!1,r=!1,i=e('<div id="jstree-marker"> </div>').hide().appendTo("body");e(document).bind("dnd_start.vakata",function(e,t){n=!1}).bind("dnd_move.vakata",function(s,a){if(r&&clearTimeout(r),a.data.jstree&&(!a.event.target.id||"jstree-marker"!==a.event.target.id)){var o=e.jstree.reference(a.event.target),d=!1,l=!1,c=!1,h,_,u,f,g,p,m,v,j,y,k,x;if(o&&o._data&&o._data.dnd)if(i.attr("class","jstree-"+o.get_theme()),a.helper.children().attr("class","jstree-"+o.get_theme()).find(".jstree-copy:eq(0)")[a.data.origin&&a.data.origin.settings.dnd.copy&&(a.event.metaKey||a.event.ctrlKey)?"show":"hide"](),a.event.target!==o.element[0]&&a.event.target!==o.get_container_ul()[0]||0!==o.get_container_ul().children().length){if(d=e(a.event.target).closest("a"),d&&d.length&&d.parent().is(".jstree-closed, .jstree-open, .jstree-leaf")&&(l=d.offset(),c=a.event.pageY-l.top,u=d.height(),p=u/3>c?["b","i","a"]:c>u-u/3?["a","i","b"]:c>u/2?["i","a","b"]:["i","b","a"],e.each(p,function(s,c){switch(c){case"b":h=l.left-6,_=l.top-5,f=o.get_parent(d),g=d.parent().index();
+break;case"i":h=l.left-2,_=l.top-5+u/2+1,f=d.parent(),g=0;break;case"a":h=l.left-6,_=l.top-5+u,f=o.get_parent(d),g=d.parent().index()+1}for(m=!0,v=0,j=a.data.nodes.length;j>v;v++)if(y=a.data.origin&&a.data.origin.settings.dnd.copy&&(a.event.metaKey||a.event.ctrlKey)?"copy_node":"move_node",k=g,"move_node"===y&&"a"===c&&a.data.origin&&a.data.origin===o&&f===o.get_parent(a.data.nodes[v])&&(x=o.get_node(f),k>e.inArray(a.data.nodes[v],x.children)&&(k-=1)),m=m&&o.check(y,a.data.nodes[v],f,k),!m)break;return m?("i"===c&&d.parent().is(".jstree-closed")&&o.settings.dnd.open_timeout&&(r=setTimeout(function(e,t){return function(){e.open_node(t)}}(o,d),o.settings.dnd.open_timeout)),n={ins:o,par:f,pos:g},i.css({left:h+"px",top:_+"px"}).show(),a.helper.find(".jstree-icon:eq(0)").removeClass("jstree-er").addClass("jstree-ok"),p=!0,!1):t}),p===!0))return}else{for(m=!0,v=0,j=a.data.nodes.length;j>v;v++)if(m=m&&o.check(a.data.origin&&a.data.origin.settings.dnd.copy&&(a.event.metaKey||a.event.ctrlKey)?"copy_node":"move_node",a.data.nodes[v],"#","last"),!m)break;if(m)return n={ins:o,par:"#",pos:"last"},i.hide(),a.helper.find(".jstree-icon:eq(0)").removeClass("jstree-er").addClass("jstree-ok"),t}n=!1,a.helper.find(".jstree-icon").removeClass("jstree-ok").addClass("jstree-er"),i.hide()}}).bind("dnd_scroll.vakata",function(e,t){t.data.jstree&&(i.hide(),n=!1,t.helper.find(".jstree-icon:eq(0)").removeClass("jstree-ok").addClass("jstree-er"))}).bind("dnd_stop.vakata",function(e,t){if(r&&clearTimeout(r),t.data.jstree&&(i.hide(),n)){var s,a,o=[];for(s=0,a=t.data.nodes.length;a>s;s++)o[s]=t.data.origin?t.data.origin.get_node(t.data.nodes[s]):t.data.nodes[s];n.ins[t.data.origin&&t.data.origin.settings.dnd.copy&&(t.event.metaKey||t.event.ctrlKey)?"copy_node":"move_node"](o,n.par,n.pos)}}).bind("keyup keydown",function(t,n){n=e.vakata.dnd._get(),n.data&&n.data.jstree&&n.helper.find(".jstree-copy:eq(0)")[n.data.origin&&n.data.origin.settings.dnd.copy&&(t.metaKey||t.ctrlKey)?"show":"hide"]()})}),function(e){e.fn.vakata_reverse=[].reverse;var n={element:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1};e.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5},_trigger:function(t,n){var r=e.vakata.dnd._get();r.event=n,e(document).triggerHandler("dnd_"+t+".vakata",r)},_get:function(){return{data:n.data,element:n.element,helper:n.helper}},_clean:function(){n.helper&&n.helper.remove(),n.scroll_i&&(clearInterval(n.scroll_i),n.scroll_i=!1),n={element:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1},e(document).unbind("mousemove",e.vakata.dnd.drag),e(document).unbind("mouseup",e.vakata.dnd.stop)},_scroll:function(t){if(!n.scroll_e||!n.scroll_l&&!n.scroll_t)return n.scroll_i&&(clearInterval(n.scroll_i),n.scroll_i=!1),!1;if(!n.scroll_i)return n.scroll_i=setInterval(e.vakata.dnd._scroll,100),!1;if(t===!0)return!1;var r=n.scroll_e.scrollTop(),i=n.scroll_e.scrollLeft();n.scroll_e.scrollTop(r+n.scroll_t*e.vakata.dnd.settings.scroll_speed),n.scroll_e.scrollLeft(i+n.scroll_l*e.vakata.dnd.settings.scroll_speed),(r!==n.scroll_e.scrollTop()||i!==n.scroll_e.scrollLeft())&&e.vakata.dnd._trigger("scroll",n.scroll_e)},start:function(t,r,i){n.is_drag&&e.vakata.dnd.stop({});try{t.currentTarget.unselectable="on",t.currentTarget.onselectstart=function(){return!1},t.currentTarget.style&&(t.currentTarget.style.MozUserSelect="none")}catch(s){}return n.init_x=t.pageX,n.init_y=t.pageY,n.data=r,n.is_down=!0,n.element=t.currentTarget,i!==!1&&(n.helper=e("<div id='vakata-dnd'></div>").html(i).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),e(document).bind("mousemove",e.vakata.dnd.drag),e(document).bind("mouseup",e.vakata.dnd.stop),!1},drag:function(r){if(n.is_down){if(!n.is_drag){if(!(Math.abs(r.pageX-n.init_x)>e.vakata.dnd.settings.threshold||Math.abs(r.pageY-n.init_y)>e.vakata.dnd.settings.threshold))return;n.helper&&(n.helper.appendTo("body"),n.helper_w=n.helper.outerWidth()),n.is_drag=!0,e.vakata.dnd._trigger("start",r)}var i=!1,s=!1,a=!1,o=!1,d=!1,l=!1,c=!1,h=!1,_=!1,u=!1;n.scroll_t=0,n.scroll_l=0,n.scroll_e=!1,e(r.target).parentsUntil("body").addBack().vakata_reverse().filter(function(){return/^auto|scroll$/.test(e(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var i=e(this),s=i.offset();return this.scrollHeight>this.offsetHeight&&(s.top+i.height()-r.pageY<e.vakata.dnd.settings.scroll_proximity&&(n.scroll_t=1),r.pageY-s.top<e.vakata.dnd.settings.scroll_proximity&&(n.scroll_t=-1)),this.scrollWidth>this.offsetWidth&&(s.left+i.width()-r.pageX<e.vakata.dnd.settings.scroll_proximity&&(n.scroll_l=1),r.pageX-s.left<e.vakata.dnd.settings.scroll_proximity&&(n.scroll_l=-1)),n.scroll_t||n.scroll_l?(n.scroll_e=e(this),!1):t}),n.scroll_e||(i=e(document),s=e(window),a=i.height(),o=s.height(),d=i.width(),l=s.width(),c=i.scrollTop(),h=i.scrollLeft(),a>o&&r.pageY-c<e.vakata.dnd.settings.scroll_proximity&&(n.scroll_t=-1),a>o&&o-(r.pageY-c)<e.vakata.dnd.settings.scroll_proximity&&(n.scroll_t=1),d>l&&r.pageX-h<e.vakata.dnd.settings.scroll_proximity&&(n.scroll_l=-1),d>l&&l-(r.pageX-h)<e.vakata.dnd.settings.scroll_proximity&&(n.scroll_l=1),(n.scroll_t||n.scroll_l)&&(n.scroll_e=i)),n.scroll_e&&e.vakata.dnd._scroll(!0),n.helper&&(_=parseInt(r.pageY+e.vakata.dnd.settings.helper_top,10),u=parseInt(r.pageX+e.vakata.dnd.settings.helper_left,10),a&&_+25>a&&(_=a-50),d&&u+n.helper_w>d&&(u=d-(n.helper_w+2)),n.helper.css({left:u+"px",top:_+"px"})),e.vakata.dnd._trigger("move",r)}},stop:function(t){n.is_drag&&e.vakata.dnd._trigger("stop",t),e.vakata.dnd._clean()}}}(jQuery),e.jstree.defaults.search={ajax:!1,fuzzy:!0,case_sensitive:!1,show_only_matches:!1,close_opened_onclear:!0},e.jstree.plugins.search=function(t,n){this.bind=function(){n.bind.call(this),this._data.search.str="",this._data.search.dom=e(),this._data.search.res=[],this._data.search.opn=[],this.settings.search.show_only_matches&&this.element.on("search.jstree",function(t,n){n.nodes.length&&(e(this).find("li").hide().filter(".jstree-last").filter(function(){return this.nextSibling}).removeClass("jstree-last"),n.nodes.parentsUntil(".jstree").addBack().show().filter("ul").each(function(){e(this).children("li:visible").eq(-1).addClass("jstree-last")}))}).on("clear_search.jstree",function(t,n){n.nodes.length&&e(this).find("li").css("display","").filter(".jstree-last").filter(function(){return this.nextSibling}).removeClass("jstree-last")})},this.search=function(t,n){if(t===!1||""===e.trim(t))return this.clear_search();var r=this.settings.search,i=r.ajax?e.extend({},r.ajax):!1,s=null,a=[],o=[],d,l;if(this._data.search.res.length&&this.clear_search(),!n&&i!==!1)return i.data||(i.data={}),i.data.str=t,e.ajax(r.ajax).done(e.proxy(function(e){this._search_load(e,t)},this));if(this._data.search.str=t,this._data.search.dom=e(),this._data.search.res=[],this._data.search.opn=[],s=new e.vakata.search(t,!0,{caseSensitive:r.case_sensitive,fuzzy:r.fuzzy}),e.each(this._model.data,function(e,t){t.text&&s.search(t.text).isMatch&&(a.push(e),o=o.concat(t.parents))}),a.length){for(o=e.vakata.array_unique(o),this._search_open(o),d=0,l=a.length;l>d;d++)s=this.get_node(a[d],!0),s&&(this._data.search.dom=this._data.search.dom.add(s));this._data.search.res=a,this._data.search.dom.children(".jstree-anchor").addClass("jstree-search")}this.trigger("search",{nodes:this._data.search.dom,str:t,res:this._data.search.res})},this.clear_search=function(){this._data.search.dom.children(".jstree-anchor").removeClass("jstree-search"),this.settings.search.close_opened_onclear&&this.close_node(this._data.search.opn,0),this.trigger("clear_search",{nodes:this._data.search.dom,str:this._data.search.str,res:this._data.search.res}),this._data.search.str="",this._data.search.res=[],this._data.search.opn=[],this._data.search.dom=e()},this._search_open=function(t){var n=this;e.each(t.concat([]),function(e,r){r=document.getElementById(r),r&&n.is_closed(r)&&(n._data.search.opn.push(r.id),n.open_node(r,function(){n._search_open(t)},0))})},this._search_load=function(t,n){var r=!0,i=this,s=i._model.data;e.each(t.concat([]),function(e,a){s[a]&&(s[a].state.loaded||(i.load_node(a,function(){i._search_load(t,n)}),r=!1))}),r&&this.search(n,!0)}},function(e){e.vakata.search=function(e,t,n){n=n||{},n.fuzzy!==!1&&(n.fuzzy=!0),e=n.caseSensitive?e:e.toLowerCase();var r=n.location||0,i=n.distance||100,s=n.threshold||.6,a=e.length,o,d,l,c;return a>32&&(n.fuzzy=!1),n.fuzzy&&(o=1<<a-1,d=function(){var t={},n=0;for(n=0;a>n;n++)t[e.charAt(n)]=0;for(n=0;a>n;n++)t[e.charAt(n)]|=1<<a-n-1;return t}(),l=function(e,t){var n=e/a,s=Math.abs(r-t);return i?n+s/i:s?1:n}),c=function(t){if(t=n.caseSensitive?t:t.toLowerCase(),e===t||-1!==t.indexOf(e))return{isMatch:!0,score:0};if(!n.fuzzy)return{isMatch:!1,score:1};var i,c,h=t.length,_=s,u=t.indexOf(e,r),f,g,p=a+h,m,v,j,y,k,x=1,b=[];for(-1!==u&&(_=Math.min(l(0,u),_),u=t.lastIndexOf(e,r+a),-1!==u&&(_=Math.min(l(0,u),_))),u=-1,i=0;a>i;i++){f=0,g=p;while(g>f)_>=l(i,r+g)?f=g:p=g,g=Math.floor((p-f)/2+f);for(p=g,v=Math.max(1,r-g+1),j=Math.min(r+g,h)+a,y=Array(j+2),y[j+1]=(1<<i)-1,c=j;c>=v;c--)if(k=d[t.charAt(c-1)],y[c]=0===i?(1|y[c+1]<<1)&k:(1|y[c+1]<<1)&k|(1|(m[c+1]|m[c])<<1)|m[c+1],y[c]&o&&(x=l(i,c-1),_>=x)){if(_=x,u=c-1,b.push(u),!(u>r))break;v=Math.max(1,2*r-u)}if(l(i+1,r)>_)break;m=y}return{isMatch:u>=0,score:x}},t===!0?{search:c}:c(t)}}(jQuery),e.jstree.defaults.sort=function(e,t){return this.get_text(e)>this.get_text(t)?1:-1},e.jstree.plugins.sort=function(t,n){this.bind=function(){n.bind.call(this),this.element.on("model.jstree",e.proxy(function(e,t){this.sort(t.parent,!0)},this)).on("rename_node.jstree create_node.jstree",e.proxy(function(e,t){this.sort(t.parent||t.node.parent,!1),this.redraw_node(t.parent||t.node.parent,!0)},this)).on("move_node.jstree copy_node.jstree",e.proxy(function(e,t){this.sort(t.parent,!1),this.redraw_node(t.parent,!0)},this))},this.sort=function(t,n){var r,i;if(t=this.get_node(t),t&&t.children&&t.children.length&&(t.children.sort(e.proxy(this.settings.sort,this)),n))for(r=0,i=t.children_d.length;i>r;r++)this.sort(t.children_d[r],!1)}};var f=!1;e.jstree.defaults.state={key:"jstree",events:"changed.jstree open_node.jstree close_node.jstree",ttl:!1},e.jstree.plugins.state=function(t,n){this.bind=function(){n.bind.call(this),this.element.on("ready.jstree",e.proxy(function(t,n){this.element.one("restore_state.jstree set_state.jstree",e.proxy(function(){this.element.on(this.settings.state.events,e.proxy(function(){f&&clearTimeout(f),f=setTimeout(e.proxy(function(){this.save_state()},this),100)},this))},this)),this.restore_state()},this))},this.save_state=function(){e.vakata.storage.set(this.settings.state.key,this.get_state(),this.settings.state.ttl)},this.restore_state=function(){var t=e.vakata.storage.get(this.settings.state.key);t&&this.set_state(t),this.trigger("restore_state",{state:t})},this.clear_state=function(){return e.vakata.storage.del(this.settings.state.key)}},function(e,t,n){var r=function(e){return e},i=function(e){return decodeURIComponent(e.replace(/\+/g," "))},s=e.vakata.cookie=function(a,o,d){var l,c,h,_,u,f,g,p;if(o!==n)return d=e.extend({},s.defaults,d),null===o&&(d.expires=-1),"number"==typeof d.expires&&(l=d.expires,c=d.expires=new Date,c.setDate(c.getDate()+l)),o=s.json?e.vakata.json.encode(o):o+"",o=[encodeURIComponent(a),"=",s.raw?o:encodeURIComponent(o),d.expires?"; expires="+d.expires.toUTCString():"",d.path?"; path="+d.path:"",d.domain?"; domain="+d.domain:"",d.secure?"; secure":""].join(""),t.cookie=o,o;for(h=s.raw?r:i,_=t.cookie.split("; "),u=0,f=_.length;f>u;u++)if(g=_[u].split("="),h(g.shift())===a)return p=h(g.join("=")),s.json?e.vakata.json.decode(p):p;return null};s.defaults={},e.vakata.removeCookie=function(t,n){return null!==e.vakata.cookie(t)?(e.vakata.cookie(t,null,n),!0):!1}}(jQuery,document),function(e,t){var n={},r={jStorage:"{}"},i=null,s=0,a=e.vakata.json.encode,o=e.vakata.json.decode,d=!1,l=!1;function c(){if(r.jStorage)try{n=o(r.jStorage+"")}catch(e){r.jStorage="{}"}else r.jStorage="{}";s=r.jStorage?(r.jStorage+"").length:0}function h(){try{r.jStorage=a(n),"userDataBehavior"===d&&(i.setAttribute("jStorage",r.jStorage),i.save("jStorage")),"cookie"===d&&e.vakata.cookie("__vjstorage",r.jStorage,{expires:365}),s=r.jStorage?(r.jStorage+"").length:0}catch(t){}}function _(e){if(!e||"string"!=typeof e&&"number"!=typeof e)throw new TypeError("Key name must be string or numeric");if("__jstorage_meta"===e)throw new TypeError("Reserved key name");return!0}function u(){var e=+new Date,t,r,i=1/0,s=!1;if(l!==!1&&clearTimeout(l),n.__jstorage_meta&&"object"==typeof n.__jstorage_meta.TTL){r=n.__jstorage_meta.TTL;for(t in r)r.hasOwnProperty(t)&&(e>=r[t]?(delete r[t],delete n[t],s=!0):i>r[t]&&(i=r[t]));1/0!==i&&(l=setTimeout(u,i-e)),s&&h()}}function f(){var n=!1,s;if(Object.prototype.hasOwnProperty.call(window,"localStorage"))try{window.localStorage.setItem("_tmptest","tmpval"),n=!0,window.localStorage.removeItem("_tmptest")}catch(a){}if(n)try{window.localStorage&&(r=window.localStorage,d="localStorage")}catch(a){}else if(Object.prototype.hasOwnProperty.call(window,"globalStorage"))try{window.globalStorage&&(r=window.globalStorage[window.location.hostname],d="globalStorage")}catch(a){}else{if(i=document.createElement("link"),i.addBehavior){i.style.behavior="url(#default#userData)",document.getElementsByTagName("head")[0].appendChild(i);try{i.load("jStorage"),s="{}",s=i.getAttribute("jStorage"),r.jStorage=s,d="userDataBehavior"}catch(a){}}if(!d&&(e.vakata.cookie("__vjstorage")||e.vakata.cookie("__vjstorage","{}",{expires:365})&&"{}"===e.vakata.cookie("__vjstorage"))&&(i=null,r.jStorage=e.vakata.cookie("__vjstorage"),d="cookie"),!d)return i=null,t}c(),u()}e.vakata.storage={version:"0.3.0",set:function(t,r,i){return _(t),"object"==typeof r&&(r=o(a(r))),n[t]=r,h(),i&&parseInt(i,10)&&e.vakata.storage.setTTL(t,parseInt(i,10)),r},get:function(e,r){return _(e),n.hasOwnProperty(e)?n[e]:r===t?null:r},del:function(e){return _(e),n.hasOwnProperty(e)?(delete n[e],n.__jstorage_meta&&"object"==typeof n.__jstorage_meta.TTL&&n.__jstorage_meta.TTL.hasOwnProperty(e)&&delete n.__jstorage_meta.TTL[e],h(),!0):!1},setTTL:function(e,t){var r=+new Date;return _(e),t=Number(t)||0,n.hasOwnProperty(e)?(n.__jstorage_meta||(n.__jstorage_meta={}),n.__jstorage_meta.TTL||(n.__jstorage_meta.TTL={}),t>0?n.__jstorage_meta.TTL[e]=r+t:delete n.__jstorage_meta.TTL[e],h(),u(),!0):!1},getTTL:function(e){var t=+new Date,r;return _(e),n.hasOwnProperty(e)&&n.__jstorage_meta.TTL&&n.__jstorage_meta.TTL[e]?(r=n.__jstorage_meta.TTL[e]-t,r||0):0},flush:function(){return n={},h(),!0},storageObj:function(){return e.extend(!0,{},n)},index:function(){var t=[];return e.each(n,function(e,n){"__jstorage_meta"!==e&&t.push(e)}),t},storageSize:function(){return s},currentBackend:function(){return d},storageAvailable:function(){return!!d}},f()}(jQuery),e.jstree.defaults.types={"#":{},"default":{}},e.jstree.plugins.types=function(n,r){this.init=function(e,t){r.init.call(this,e,t),this._model.data["#"].type="#"},this.bind=function(){r.bind.call(this),this.element.on("model.jstree",e.proxy(function(e,t){var n=this._model.data,r=t.nodes,i=this.settings.types,s,a,o="default";for(s=0,a=r.length;a>s;s++)o="default",n[r[s]].original&&n[r[s]].original.type&&i[n[r[s]].original.type]&&(o=n[r[s]].original.type),n[r[s]].data&&n[r[s]].data.jstree&&n[r[s]].data.jstree.type&&i[n[r[s]].data.jstree.type]&&(o=n[r[s]].data.jstree.type),n[r[s]].type=o,n[r[s]].icon===!0&&i[o].icon&&(n[r[s]].icon=i[o].icon)},this))},this.get_json=function(t,n){var i,s,a=this._model.data,o=n?e.extend(!0,n,{no_id:!0}):{},d=r.get_json.call(this,t,o);if(d===!1)return!1;if(e.isArray(d))for(i=0,s=d.length;s>i;i++)d[i].type=d[i].id&&a[d[i].id]&&a[d[i].id].type?a[d[i].id].type:"default",n&&n.no_id&&(delete d[i].id,d[i].li_attr&&d[i].li_attr.id&&delete d[i].li_attr.id);else d.type=d.id&&a[d.id]&&a[d.id].type?a[d.id].type:"default",n&&n.no_id&&(delete d.id,d.li_attr&&d.li_attr.id&&delete d.li_attr.id);return d},this.check=function(n,i,s,a){if(r.check.call(this,n,i,s,a)===!1)return!1;i=i&&i.id?i:this.get_node(i),s=s&&s.id?s:this.get_node(s);var o=this._model.data,d,l,c,h;switch(n){case"create_node":case"move_node":case"copy_node":if("move_node"!==n||-1===e.inArray(i.id,s.children)){if(d=this.get_rules(s),d.max_children!==t&&-1!==d.max_children&&d.max_children===s.children.length)return!1;if(d.valid_children!==t&&-1!==d.valid_children&&-1===e.inArray(i.type,d.valid_children))return!1;if(i.children_d&&i.parents){for(l=0,c=0,h=i.children_d.length;h>c;c++)l=Math.max(l,o[i.children_d[c]].parents.length);l=l-i.parents.length+1}0>=l&&(l=1);do{if(d.max_depth!==t&&-1!==d.max_depth&&l>d.max_depth)return!1;s=this.get_node(s.parent),d=this.get_rules(s),l++}while(s)}}return!0},this.get_rules=function(e){if(e=this.get_node(e),!e)return!1;var n=this.get_type(e,!0);return n.max_depth===t&&(n.max_depth=-1),n.max_children===t&&(n.max_children=-1),n.valid_children===t&&(n.valid_children=-1),n},this.get_type=function(t,n){return t=this.get_node(t),t?n?e.extend({type:t.type},this.settings.types[t.type]):t.type:!1},this.set_type=function(t,n){var r,i,s,a,o;if(e.isArray(t)){for(t=t.slice(),i=0,s=t.length;s>i;i++)this.set_type(t[i],n);return!0}return r=this.settings.types,t=this.get_node(t),r[n]&&t?(a=t.type,o=this.get_icon(t),t.type=n,(o===!0||r[a]&&r[a].icon&&o===r[a].icon)&&this.set_icon(t,r[n].icon||!0),!0):!1}},e.jstree.plugins.unique=function(t,n){this.check=function(t,r,i,s){if(n.check.call(this,t,r,i,s)===!1)return!1;if(r=r&&r.id?r:this.get_node(r),i=i&&i.id?i:this.get_node(i),!i||!i.children)return!0;var a="rename_node"===t?s:r.text,o=[],d=this._model.data,l,c;for(l=0,c=i.children.length;c>l;l++)o.push(d[i.children[l]].text);switch(t){case"delete_node":return!0;case"rename_node":case"copy_node":return-1===e.inArray(a,o);case"move_node":return r.parent===i.id||-1===e.inArray(a,o)}return!0}};var g=document.createElement("DIV");g.setAttribute("unselectable","on"),g.className="jstree-wholerow",g.innerHTML=" ",e.jstree.plugins.wholerow=function(t,n){this.bind=function(){n.bind.call(this),this.element.on("loading",e.proxy(function(){g.style.height=this._data.core.li_height+"px"},this)).on("ready.jstree set_state.jstree",e.proxy(function(){this.hide_dots()},this)).on("ready.jstree",e.proxy(function(){this.get_container_ul().addClass("jstree-wholerow-ul")},this)).on("deselect_all.jstree",e.proxy(function(e,t){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked")},this)).on("changed.jstree",e.proxy(function(e,t){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked");var n=!1,r,i;for(r=0,i=t.selected.length;i>r;r++)n=this.get_node(t.selected[r],!0),n&&n.length&&n.children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("open_node.jstree",e.proxy(function(e,t){this.get_node(t.node,!0).find(".jstree-clicked").parent().children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("hover_node.jstree dehover_node.jstree",e.proxy(function(e,t){this.get_node(t.node,!0).children(".jstree-wholerow")["hover_node"===e.type?"addClass":"removeClass"]("jstree-wholerow-hovered")},this)).on("contextmenu.jstree",".jstree-wholerow",e.proxy(function(t){t.preventDefault(),e(t.currentTarget).closest("li").children("a:eq(0)").trigger("contextmenu",t)},this)).on("click.jstree",".jstree-wholerow",function(t){t.stopImmediatePropagation();var n=e.Event("click",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey});e(t.currentTarget).closest("li").children("a:eq(0)").trigger(n).focus()}).on("click.jstree",".jstree-leaf > .jstree-ocl",e.proxy(function(t){t.stopImmediatePropagation();var n=e.Event("click",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey});e(t.currentTarget).closest("li").children("a:eq(0)").trigger(n).focus()},this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",e.proxy(function(e){return e.stopImmediatePropagation(),this.hover_node(e.currentTarget),!1},this)).on("mouseleave.jstree",".jstree-node",e.proxy(function(e){this.dehover_node(e.currentTarget)},this))},this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove(),n.teardown.call(this)},this.redraw_node=function(t,r,i){if(t=n.redraw_node.call(this,t,r,i)){var s=g.cloneNode(!0);-1!==e.inArray(t.id,this._data.core.selected)&&(s.className+=" jstree-wholerow-clicked"),t.insertBefore(s,t.childNodes[0])}return t}}}});
\ No newline at end of file
Added: trunk/faxtomail-ui-web/src/main/webapp/js/require.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/require.js (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/require.js 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,36 @@
+/*
+ RequireJS 2.1.9 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
+ Available via the MIT or new BSD license.
+ see: http://github.com/jrburke/requirejs for details
+*/
+var requirejs,require,define;
+(function(Z){function H(b){return"[object Function]"===L.call(b)}function I(b){return"[object Array]"===L.call(b)}function y(b,c){if(b){var e;for(e=0;e<b.length&&(!b[e]||!c(b[e],e,b));e+=1);}}function M(b,c){if(b){var e;for(e=b.length-1;-1<e&&(!b[e]||!c(b[e],e,b));e-=1);}}function t(b,c){return ga.call(b,c)}function l(b,c){return t(b,c)&&b[c]}function F(b,c){for(var e in b)if(t(b,e)&&c(b[e],e))break}function Q(b,c,e,h){c&&F(c,function(c,j){if(e||!t(b,j))h&&"string"!==typeof c?(b[j]||(b[j]={}),Q(b[j],
+c,e,h)):b[j]=c});return b}function u(b,c){return function(){return c.apply(b,arguments)}}function aa(b){throw b;}function ba(b){if(!b)return b;var c=Z;y(b.split("."),function(b){c=c[b]});return c}function A(b,c,e,h){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.requireModules=h;e&&(c.originalError=e);return c}function ha(b){function c(a,f,b){var d,m,c,g,e,h,j,i=f&&f.split("/");d=i;var n=k.map,p=n&&n["*"];if(a&&"."===a.charAt(0))if(f){d=l(k.pkgs,f)?i=[f]:i.slice(0,i.length-
+1);f=a=d.concat(a.split("/"));for(d=0;f[d];d+=1)if(m=f[d],"."===m)f.splice(d,1),d-=1;else if(".."===m)if(1===d&&(".."===f[2]||".."===f[0]))break;else 0<d&&(f.splice(d-1,2),d-=2);d=l(k.pkgs,f=a[0]);a=a.join("/");d&&a===f+"/"+d.main&&(a=f)}else 0===a.indexOf("./")&&(a=a.substring(2));if(b&&n&&(i||p)){f=a.split("/");for(d=f.length;0<d;d-=1){c=f.slice(0,d).join("/");if(i)for(m=i.length;0<m;m-=1)if(b=l(n,i.slice(0,m).join("/")))if(b=l(b,c)){g=b;e=d;break}if(g)break;!h&&(p&&l(p,c))&&(h=l(p,c),j=d)}!g&&
+h&&(g=h,e=j);g&&(f.splice(0,e,g),a=f.join("/"))}return a}function e(a){z&&y(document.getElementsByTagName("script"),function(f){if(f.getAttribute("data-requiremodule")===a&&f.getAttribute("data-requirecontext")===i.contextName)return f.parentNode.removeChild(f),!0})}function h(a){var f=l(k.paths,a);if(f&&I(f)&&1<f.length)return f.shift(),i.require.undef(a),i.require([a]),!0}function $(a){var f,b=a?a.indexOf("!"):-1;-1<b&&(f=a.substring(0,b),a=a.substring(b+1,a.length));return[f,a]}function n(a,f,
+b,d){var m,B,g=null,e=f?f.name:null,h=a,j=!0,k="";a||(j=!1,a="_@r"+(L+=1));a=$(a);g=a[0];a=a[1];g&&(g=c(g,e,d),B=l(r,g));a&&(g?k=B&&B.normalize?B.normalize(a,function(a){return c(a,e,d)}):c(a,e,d):(k=c(a,e,d),a=$(k),g=a[0],k=a[1],b=!0,m=i.nameToUrl(k)));b=g&&!B&&!b?"_unnormalized"+(M+=1):"";return{prefix:g,name:k,parentMap:f,unnormalized:!!b,url:m,originalName:h,isDefine:j,id:(g?g+"!"+k:k)+b}}function q(a){var f=a.id,b=l(p,f);b||(b=p[f]=new i.Module(a));return b}function s(a,f,b){var d=a.id,m=l(p,
+d);if(t(r,d)&&(!m||m.defineEmitComplete))"defined"===f&&b(r[d]);else if(m=q(a),m.error&&"error"===f)b(m.error);else m.on(f,b)}function v(a,f){var b=a.requireModules,d=!1;if(f)f(a);else if(y(b,function(f){if(f=l(p,f))f.error=a,f.events.error&&(d=!0,f.emit("error",a))}),!d)j.onError(a)}function w(){R.length&&(ia.apply(G,[G.length-1,0].concat(R)),R=[])}function x(a){delete p[a];delete T[a]}function E(a,f,b){var d=a.map.id;a.error?a.emit("error",a.error):(f[d]=!0,y(a.depMaps,function(d,c){var g=d.id,
+e=l(p,g);e&&(!a.depMatched[c]&&!b[g])&&(l(f,g)?(a.defineDep(c,r[g]),a.check()):E(e,f,b))}),b[d]=!0)}function C(){var a,f,b,d,m=(b=1E3*k.waitSeconds)&&i.startTime+b<(new Date).getTime(),c=[],g=[],j=!1,l=!0;if(!U){U=!0;F(T,function(b){a=b.map;f=a.id;if(b.enabled&&(a.isDefine||g.push(b),!b.error))if(!b.inited&&m)h(f)?j=d=!0:(c.push(f),e(f));else if(!b.inited&&(b.fetched&&a.isDefine)&&(j=!0,!a.prefix))return l=!1});if(m&&c.length)return b=A("timeout","Load timeout for modules: "+c,null,c),b.contextName=
+i.contextName,v(b);l&&y(g,function(a){E(a,{},{})});if((!m||d)&&j)if((z||da)&&!V)V=setTimeout(function(){V=0;C()},50);U=!1}}function D(a){t(r,a[0])||q(n(a[0],null,!0)).init(a[1],a[2])}function J(a){var a=a.currentTarget||a.srcElement,b=i.onScriptLoad;a.detachEvent&&!W?a.detachEvent("onreadystatechange",b):a.removeEventListener("load",b,!1);b=i.onScriptError;(!a.detachEvent||W)&&a.removeEventListener("error",b,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}function K(){var a;for(w();G.length;){a=
+G.shift();if(null===a[0])return v(A("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));D(a)}}var U,X,i,N,V,k={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},shim:{},config:{}},p={},T={},Y={},G=[],r={},S={},L=1,M=1;N={require:function(a){return a.require?a.require:a.require=i.makeRequire(a.map)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports?a.exports:a.exports=r[a.map.id]={}},module:function(a){return a.module?a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){var b=
+l(k.pkgs,a.map.id);return(b?l(k.config,a.map.id+"/"+b.main):l(k.config,a.map.id))||{}},exports:r[a.map.id]}}};X=function(a){this.events=l(Y,a.id)||{};this.map=a;this.shim=l(k.shim,a.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};X.prototype={init:function(a,b,c,d){d=d||{};if(!this.inited){this.factory=b;if(c)this.on("error",c);else this.events.error&&(c=u(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.errback=c;this.inited=!0;
+this.ignore=d.ignore;d.enabled||this.enabled?this.enable():this.check()}},defineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=b)},fetch:function(){if(!this.fetched){this.fetched=!0;i.startTime=(new Date).getTime();var a=this.map;if(this.shim)i.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],u(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?this.callPlugin():this.load()}},load:function(){var a=
+this.map.url;S[a]||(S[a]=!0,i.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,b,c=this.map.id;b=this.depExports;var d=this.exports,m=this.factory;if(this.inited)if(this.error)this.emit("error",this.error);else{if(!this.defining){this.defining=!0;if(1>this.depCount&&!this.defined){if(H(m)){if(this.events.error&&this.map.isDefine||j.onError!==aa)try{d=i.execCb(c,m,b,d)}catch(e){a=e}else d=i.execCb(c,m,b,d);this.map.isDefine&&((b=this.module)&&void 0!==b.exports&&b.exports!==
+this.exports?d=b.exports:void 0===d&&this.usingExports&&(d=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",v(this.error=a)}else d=m;this.exports=d;if(this.map.isDefine&&!this.ignore&&(r[c]=d,j.onResourceLoad))j.onResourceLoad(i,this.map,this.depMaps);x(c);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=
+!0)}}else this.fetch()}},callPlugin:function(){var a=this.map,b=a.id,e=n(a.prefix);this.depMaps.push(e);s(e,"defined",u(this,function(d){var m,e;e=this.map.name;var g=this.map.parentMap?this.map.parentMap.name:null,h=i.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(d.normalize&&(e=d.normalize(e,function(a){return c(a,g,!0)})||""),d=n(a.prefix+"!"+e,this.map.parentMap),s(d,"defined",u(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),
+e=l(p,d.id)){this.depMaps.push(d);if(this.events.error)e.on("error",u(this,function(a){this.emit("error",a)}));e.enable()}}else m=u(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),m.error=u(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];F(p,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&x(a.map.id)});v(a)}),m.fromText=u(this,function(d,c){var e=a.name,g=n(e),B=O;c&&(d=c);B&&(O=!1);q(g);t(k.config,b)&&(k.config[e]=k.config[b]);try{j.exec(d)}catch(ca){return v(A("fromtexteval",
+"fromText eval for "+b+" failed: "+ca,ca,[b]))}B&&(O=!0);this.depMaps.push(g);i.completeLoad(e);h([e],m)}),d.load(a.name,h,m,k)}));i.enable(e,this);this.pluginMaps[e.id]=e},enable:function(){T[this.map.id]=this;this.enabling=this.enabled=!0;y(this.depMaps,u(this,function(a,b){var c,d;if("string"===typeof a){a=n(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=l(N,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;s(a,"defined",u(this,function(a){this.defineDep(b,
+a);this.check()}));this.errback&&s(a,"error",u(this,this.errback))}c=a.id;d=p[c];!t(N,c)&&(d&&!d.enabled)&&i.enable(a,this)}));F(this.pluginMaps,u(this,function(a){var b=l(p,a.id);b&&!b.enabled&&i.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){y(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};i={config:k,contextName:b,registry:p,defined:r,urlFetched:S,defQueue:G,Module:X,makeModuleMap:n,
+nextTick:j.nextTick,onError:v,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=k.pkgs,c=k.shim,d={paths:!0,config:!0,map:!0};F(a,function(a,b){d[b]?"map"===b?(k.map||(k.map={}),Q(k[b],a,!0,!0)):Q(k[b],a,!0):k[b]=a});a.shim&&(F(a.shim,function(a,b){I(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=i.makeShimExports(a);c[b]=a}),k.shim=c);a.packages&&(y(a.packages,function(a){a="string"===typeof a?{name:a}:a;b[a.name]={name:a.name,
+location:a.location||a.name,main:(a.main||"main").replace(ja,"").replace(ea,"")}}),k.pkgs=b);F(p,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=n(b))});if(a.deps||a.callback)i.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(Z,arguments));return b||a.exports&&ba(a.exports)}},makeRequire:function(a,f){function h(d,c,e){var g,k;f.enableBuildCallback&&(c&&H(c))&&(c.__requireJsBuild=!0);if("string"===typeof d){if(H(c))return v(A("requireargs",
+"Invalid require call"),e);if(a&&t(N,d))return N[d](p[a.id]);if(j.get)return j.get(i,d,a,h);g=n(d,a,!1,!0);g=g.id;return!t(r,g)?v(A("notloaded",'Module name "'+g+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):r[g]}K();i.nextTick(function(){K();k=q(n(null,a));k.skipMap=f.skipMap;k.init(d,c,e,{enabled:!0});C()});return h}f=f||{};Q(h,{isBrowser:z,toUrl:function(b){var f,e=b.lastIndexOf("."),g=b.split("/")[0];if(-1!==e&&(!("."===g||".."===g)||1<e))f=b.substring(e,b.length),b=
+b.substring(0,e);return i.nameToUrl(c(b,a&&a.id,!0),f,!0)},defined:function(b){return t(r,n(b,a,!1,!0).id)},specified:function(b){b=n(b,a,!1,!0).id;return t(r,b)||t(p,b)}});a||(h.undef=function(b){w();var c=n(b,a,!0),f=l(p,b);e(b);delete r[b];delete S[c.url];delete Y[b];f&&(f.events.defined&&(Y[b]=f.events),x(b))});return h},enable:function(a){l(p,a.id)&&q(a).enable()},completeLoad:function(a){var b,c,d=l(k.shim,a)||{},e=d.exports;for(w();G.length;){c=G.shift();if(null===c[0]){c[0]=a;if(b)break;b=
+!0}else c[0]===a&&(b=!0);D(c)}c=l(p,a);if(!b&&!t(r,a)&&c&&!c.inited){if(k.enforceDefine&&(!e||!ba(e)))return h(a)?void 0:v(A("nodefine","No define call for "+a,null,[a]));D([a,d.deps||[],d.exportsFn])}C()},nameToUrl:function(a,b,c){var d,e,h,g,i,n;if(j.jsExtRegExp.test(a))g=a+(b||"");else{d=k.paths;e=k.pkgs;g=a.split("/");for(i=g.length;0<i;i-=1)if(n=g.slice(0,i).join("/"),h=l(e,n),n=l(d,n)){I(n)&&(n=n[0]);g.splice(0,i,n);break}else if(h){a=a===h.name?h.location+"/"+h.main:h.location;g.splice(0,i,
+a);break}g=g.join("/");g+=b||(/^data\:|\?/.test(g)||c?"":".js");g=("/"===g.charAt(0)||g.match(/^[\w\+\.\-]+:/)?"":k.baseUrl)+g}return k.urlArgs?g+((-1===g.indexOf("?")?"?":"&")+k.urlArgs):g},load:function(a,b){j.load(i,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if("load"===a.type||ka.test((a.currentTarget||a.srcElement).readyState))P=null,a=J(a),i.completeLoad(a.id)},onScriptError:function(a){var b=J(a);if(!h(b.id))return v(A("scripterror","Script error for: "+b.id,
+a,[b.id]))}};i.require=i.makeRequire();return i}var j,w,x,C,J,D,P,K,q,fa,la=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,ma=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,ea=/\.js$/,ja=/^\.\//;w=Object.prototype;var L=w.toString,ga=w.hasOwnProperty,ia=Array.prototype.splice,z=!!("undefined"!==typeof window&&"undefined"!==typeof navigator&&window.document),da=!z&&"undefined"!==typeof importScripts,ka=z&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,W="undefined"!==typeof opera&&
+"[object Opera]"===opera.toString(),E={},s={},R=[],O=!1;if("undefined"===typeof define){if("undefined"!==typeof requirejs){if(H(requirejs))return;s=requirejs;requirejs=void 0}"undefined"!==typeof require&&!H(require)&&(s=require,require=void 0);j=requirejs=function(b,c,e,h){var q,n="_";!I(b)&&"string"!==typeof b&&(q=b,I(c)?(b=c,c=e,e=h):b=[]);q&&q.context&&(n=q.context);(h=l(E,n))||(h=E[n]=j.s.newContext(n));q&&h.configure(q);return h.require(b,c,e)};j.config=function(b){return j(b)};j.nextTick="undefined"!==
+typeof setTimeout?function(b){setTimeout(b,4)}:function(b){b()};require||(require=j);j.version="2.1.9";j.jsExtRegExp=/^\/|:|\?|\.js$/;j.isBrowser=z;w=j.s={contexts:E,newContext:ha};j({});y(["toUrl","undef","defined","specified"],function(b){j[b]=function(){var c=E._;return c.require[b].apply(c,arguments)}});if(z&&(x=w.head=document.getElementsByTagName("head")[0],C=document.getElementsByTagName("base")[0]))x=w.head=C.parentNode;j.onError=aa;j.createNode=function(b){var c=b.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml",
+"html:script"):document.createElement("script");c.type=b.scriptType||"text/javascript";c.charset="utf-8";c.async=!0;return c};j.load=function(b,c,e){var h=b&&b.config||{};if(z)return h=j.createNode(h,c,e),h.setAttribute("data-requirecontext",b.contextName),h.setAttribute("data-requiremodule",c),h.attachEvent&&!(h.attachEvent.toString&&0>h.attachEvent.toString().indexOf("[native code"))&&!W?(O=!0,h.attachEvent("onreadystatechange",b.onScriptLoad)):(h.addEventListener("load",b.onScriptLoad,!1),h.addEventListener("error",
+b.onScriptError,!1)),h.src=e,K=h,C?x.insertBefore(h,C):x.appendChild(h),K=null,h;if(da)try{importScripts(e),b.completeLoad(c)}catch(l){b.onError(A("importscripts","importScripts failed for "+c+" at "+e,l,[c]))}};z&&!s.skipDataMain&&M(document.getElementsByTagName("script"),function(b){x||(x=b.parentNode);if(J=b.getAttribute("data-main"))return q=J,s.baseUrl||(D=q.split("/"),q=D.pop(),fa=D.length?D.join("/")+"/":"./",s.baseUrl=fa),q=q.replace(ea,""),j.jsExtRegExp.test(q)&&(q=J),s.deps=s.deps?s.deps.concat(q):
+[q],!0});define=function(b,c,e){var h,j;"string"!==typeof b&&(e=c,c=b,b=null);I(c)||(e=c,c=null);!c&&H(e)&&(c=[],e.length&&(e.toString().replace(la,"").replace(ma,function(b,e){c.push(e)}),c=(1===e.length?["require"]:["require","exports","module"]).concat(c)));if(O){if(!(h=K))P&&"interactive"===P.readyState||M(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return P=b}),h=P;h&&(b||(b=h.getAttribute("data-requiremodule")),j=E[h.getAttribute("data-requirecontext")])}(j?
+j.defQueue:R).push([b,c,e])};define.amd={jQuery:!0};j.exec=function(b){return eval(b)};j(s)}})(this);
Added: trunk/faxtomail-ui-web/src/main/webapp/js/select2/LICENSE
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/select2/LICENSE (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/select2/LICENSE 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,18 @@
+select2Copyright 2012 Igor Vaynberg
+
+Version: @@ver@@ Timestamp: @@timestamp@@
+
+This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
+General Public License version 2 (the "GPL License"). You may choose either license to govern your
+use of this software only upon the condition that you accept all of the terms of either the Apache
+License or the GPL License.
+
+You may obtain a copy of the Apache License and the GPL License at:
+
+http://www.apache.org/licenses/LICENSE-2.0
+http://www.gnu.org/licenses/gpl-2.0.html
+
+Unless required by applicable law or agreed to in writing, software distributed under the Apache License
+or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+either express or implied. See the Apache License and the GPL License for the specific language governing
+permissions and limitations under the Apache License and the GPL License.
\ No newline at end of file
Added: trunk/faxtomail-ui-web/src/main/webapp/js/select2/select2.min.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/select2/select2.min.js (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/select2/select2.min.js 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,26 @@
+/*
+Copyright 2012 Igor Vaynberg
+
+Version: 3.4.3 Timestamp: Tue Sep 17 06:47:14 PDT 2013
+
+This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
+General Public License version 2 (the "GPL License"). You may choose either license to govern your
+use of this software only upon the condition that you accept all of the terms of either the Apache
+License or the GPL License.
+
+You may obtain a copy of the Apache License and the GPL License at:
+
+http://www.apache.org/licenses/LICENSE-2.0
+http://www.gnu.org/licenses/gpl-2.0.html
+
+Unless required by applicable law or agreed to in writing, software distributed under the Apache License
+or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+either express or implied. See the Apache License and the GPL License for the specific language governing
+permissions and limitations under the Apache License and the GPL License.
+
+
+
+%%Ignore-License
+*/
+!function(a){"undefined"==typeof a.fn.each2&&a.extend(a.fn,{each2:function(b){for(var c=a([0]),d=-1,e=this.length;++d<e&&(c.context=c[0]=this[d])&&b.call(c[0],d,c)!==!1;);return this}})}(jQuery),function(a,b){"use strict";function n(a){var b,c,d,e;if(!a||a.length<1)return a;for(b="",c=0,d=a.length;d>c;c++)e=a.charAt(c),b+=m[e]||e;return b}function o(a,b){for(var c=0,d=b.length;d>c;c+=1)if(q(a,b[c]))return c;return-1}function p(){var b=a(l);b.appendTo("body");var c={width:b.width()-b[0].clientWidth,height:b.height()-b[0].clientHeight};return b.remove(),c}function q(a,c){return a===c?!0:a===b||c===b?!1:null===a||null===c?!1:a.constructor===String?a+""==c+"":c.constructor===String?c+""==a+"":!1}function r(b,c){var d,e,f;if(null===b||b.length<1)return[];for(d=b.split(c),e=0,f=d.length;f>e;e+=1)d[e]=a.trim(d[e]);return d}function s(a){return a.outerWidth(!1)-a.width()}function t(c){var d="keyup-change-value";c.on("keydown",function(){a.data(c,d)===b&&a.data(c,d,c.val())}),c.on("keyup",function(){var e=a.data(c,d);e!==b&&c.val()!==e&&(a.removeData(c,d),c.trigger("keyup-change"))})}function u(c){c.on("mousemove",function(c){var d=i;(d===b||d.x!==c.pageX||d.y!==c.pageY)&&a(c.target).trigger("mousemove-filtered",c)})}function v(a,c,d){d=d||b;var e;return function(){var b=arguments;window.clearTimeout(e),e=window.setTimeout(function(){c.apply(d,b)},a)}}function w(a){var c,b=!1;return function(){return b===!1&&(c=a(),b=!0),c}}function x(a,b){var c=v(a,function(a){b.trigger("scroll-debounced",a)});b.on("scroll",function(a){o(a.target,b.get())>=0&&c(a)})}function y(a){a[0]!==document.activeElement&&window.setTimeout(function(){var d,b=a[0],c=a.val().length;a.focus(),a.is(":visible")&&b===document.activeElement&&(b.setSelectionRange?b.setSelectionRange(c,c):b.createTextRange&&(d=b.createTextRange(),d.collapse(!1),d.select()))},0)}function z(b){b=a(b)[0];var c=0,d=0;if("selectionStart"in b)c=b.selectionStart,d=b.selectionEnd-c;else if("selection"in document){b.focus();var e=document.selection.createRange();d=document.selection.createRange().text.length,e.moveStart("character",-b.value.length),c=e.text.length-d}return{offset:c,length:d}}function A(a){a.preventDefault(),a.stopPropagation()}function B(a){a.preventDefault(),a.stopImmediatePropagation()}function C(b){if(!h){var c=b[0].currentStyle||window.getComputedStyle(b[0],null);h=a(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:c.fontSize,fontFamily:c.fontFamily,fontStyle:c.fontStyle,fontWeight:c.fontWeight,letterSpacing:c.letterSpacing,textTransform:c.textTransform,whiteSpace:"nowrap"}),h.attr("class","select2-sizer"),a("body").append(h)}return h.text(b.val()),h.width()}function D(b,c,d){var e,g,f=[];e=b.attr("class"),e&&(e=""+e,a(e.split(" ")).each2(function(){0===this.indexOf("select2-")&&f.push(this)})),e=c.attr("class"),e&&(e=""+e,a(e.split(" ")).each2(function(){0!==this.indexOf("select2-")&&(g=d(this),g&&f.push(this))})),b.attr("class",f.join(" "))}function E(a,b,c,d){var e=n(a.toUpperCase()).indexOf(n(b.toUpperCase())),f=b.length;return 0>e?(c.push(d(a)),void 0):(c.push(d(a.substring(0,e))),c.push("<span class='select2-match'>"),c.push(d(a.substring(e,e+f))),c.push("</span>"),c.push(d(a.substring(e+f,a.length))),void 0)}function F(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})}function G(c){var d,e=null,f=c.quietMillis||100,g=c.url,h=this;return function(i){window.clearTimeout(d),d=window.setTimeout(function(){var d=c.data,f=g,j=c.transport||a.fn.select2.ajaxDefaults.transport,k={type:c.type||"GET",cache:c.cache||!1,jsonpCallback:c.jsonpCallback||b,dataType:c.dataType||"json"},l=a.extend({},a.fn.select2.ajaxDefaults.params,k);d=d?d.call(h,i.term,i.page,i.context):null,f="function"==typeof f?f.call(h,i.term,i.page,i.context):f,e&&e.abort(),c.params&&(a.isFunction(c.params)?a.extend(l,c.params.call(h)):a.extend(l,c.params)),a.extend(l,{url:f,dataType:c.dataType,data:d,success:function(a){var b=c.results(a,i.page);i.callback(b)}}),e=j.call(h,l)},f)}}function H(b){var d,e,c=b,f=function(a){return""+a.text};a.isArray(c)&&(e=c,c={results:e}),a.isFunction(c)===!1&&(e=c,c=function(){return e});var g=c();return g.text&&(f=g.text,a.isFunction(f)||(d=g.text,f=function(a){return a[d]})),function(b){var g,d=b.term,e={results:[]};return""===d?(b.callback(c()),void 0):(g=function(c,e){var h,i;if(c=c[0],c.children){h={};for(i in c)c.hasOwnProperty(i)&&(h[i]=c[i]);h.children=[],a(c.children).each2(function(a,b){g(b,h.children)}),(h.children.length||b.matcher(d,f(h),c))&&e.push(h)}else b.matcher(d,f(c),c)&&e.push(c)},a(c().results).each2(function(a,b){g(b,e.results)}),b.callback(e),void 0)}}function I(c){var d=a.isFunction(c);return function(e){var f=e.term,g={results:[]};a(d?c():c).each(function(){var a=this.text!==b,c=a?this.text:this;(""===f||e.matcher(f,c))&&g.results.push(a?this:{id:this,text:this})}),e.callback(g)}}function J(b,c){if(a.isFunction(b))return!0;if(!b)return!1;throw new Error(c+" must be a function or a falsy value")}function K(b){return a.isFunction(b)?b():b}function L(b){var c=0;return a.each(b,function(a,b){b.children?c+=L(b.children):c++}),c}function M(a,c,d,e){var h,i,j,k,l,f=a,g=!1;if(!e.createSearchChoice||!e.tokenSeparators||e.tokenSeparators.length<1)return b;for(;;){for(i=-1,j=0,k=e.tokenSeparators.length;k>j&&(l=e.tokenSeparators[j],i=a.indexOf(l),!(i>=0));j++);if(0>i)break;if(h=a.substring(0,i),a=a.substring(i+l.length),h.length>0&&(h=e.createSearchChoice.call(this,h,c),h!==b&&null!==h&&e.id(h)!==b&&null!==e.id(h))){for(g=!1,j=0,k=c.length;k>j;j++)if(q(e.id(h),e.id(c[j]))){g=!0;break}g||d(h)}}return f!==a?a:void 0}function N(b,c){var d=function(){};return d.prototype=new b,d.prototype.constructor=d,d.prototype.parent=b.prototype,d.prototype=a.extend(d.prototype,c),d}if(window.Select2===b){var c,d,e,f,g,h,j,k,i={x:0,y:0},c={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(a){switch(a=a.which?a.which:a){case c.LEFT:case c.RIGHT:case c.UP:case c.DOWN:return!0}return!1},isControl:function(a){var b=a.which;switch(b){case c.SHIFT:case c.CTRL:case c.ALT:return!0}return a.metaKey?!0:!1},isFunctionKey:function(a){return a=a.which?a.which:a,a>=112&&123>=a}},l="<div class='select2-measure-scrollbar'></div>",m={"\u24b6":"A","\uff21":"A","\xc0":"A","\xc1":"A","\xc2":"A","\u1ea6":"A","\u1ea4":"A","\u1eaa":"A","\u1ea8":"A","\xc3":"A","\u0100":"A","\u0102":"A","\u1eb0":"A","\u1eae":"A","\u1eb4":"A","\u1eb2":"A","\u0226":"A","\u01e0":"A","\xc4":"A","\u01de":"A","\u1ea2":"A","\xc5":"A","\u01fa":"A","\u01cd":"A","\u0200":"A","\u0202":"A","\u1ea0":"A","\u1eac":"A","\u1eb6":"A","\u1e00":"A","\u0104":"A","\u023a":"A","\u2c6f":"A","\ua732":"AA","\xc6":"AE","\u01fc":"AE","\u01e2":"AE","\ua734":"AO","\ua736":"AU","\ua738":"AV","\ua73a":"AV","\ua73c":"AY","\u24b7":"B","\uff22":"B","\u1e02":"B","\u1e04":"B","\u1e06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24b8":"C","\uff23":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\xc7":"C","\u1e08":"C","\u0187":"C","\u023b":"C","\ua73e":"C","\u24b9":"D","\uff24":"D","\u1e0a":"D","\u010e":"D","\u1e0c":"D","\u1e10":"D","\u1e12":"D","\u1e0e":"D","\u0110":"D","\u018b":"D","\u018a":"D","\u0189":"D","\ua779":"D","\u01f1":"DZ","\u01c4":"DZ","\u01f2":"Dz","\u01c5":"Dz","\u24ba":"E","\uff25":"E","\xc8":"E","\xc9":"E","\xca":"E","\u1ec0":"E","\u1ebe":"E","\u1ec4":"E","\u1ec2":"E","\u1ebc":"E","\u0112":"E","\u1e14":"E","\u1e16":"E","\u0114":"E","\u0116":"E","\xcb":"E","\u1eba":"E","\u011a":"E","\u0204":"E","\u0206":"E","\u1eb8":"E","\u1ec6":"E","\u0228":"E","\u1e1c":"E","\u0118":"E","\u1e18":"E","\u1e1a":"E","\u0190":"E","\u018e":"E","\u24bb":"F","\uff26":"F","\u1e1e":"F","\u0191":"F","\ua77b":"F","\u24bc":"G","\uff27":"G","\u01f4":"G","\u011c":"G","\u1e20":"G","\u011e":"G","\u0120":"G","\u01e6":"G","\u0122":"G","\u01e4":"G","\u0193":"G","\ua7a0":"G","\ua77d":"G","\ua77e":"G","\u24bd":"H","\uff28":"H","\u0124":"H","\u1e22":"H","\u1e26":"H","\u021e":"H","\u1e24":"H","\u1e28":"H","\u1e2a":"H","\u0126":"H","\u2c67":"H","\u2c75":"H","\ua78d":"H","\u24be":"I","\uff29":"I","\xcc":"I","\xcd":"I","\xce":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u0130":"I","\xcf":"I","\u1e2e":"I","\u1ec8":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1eca":"I","\u012e":"I","\u1e2c":"I","\u0197":"I","\u24bf":"J","\uff2a":"J","\u0134":"J","\u0248":"J","\u24c0":"K","\uff2b":"K","\u1e30":"K","\u01e8":"K","\u1e32":"K","\u0136":"K","\u1e34":"K","\u0198":"K","\u2c69":"K","\ua740":"K","\ua742":"K","\ua744":"K","\ua7a2":"K","\u24c1":"L","\uff2c":"L","\u013f":"L","\u0139":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u013b":"L","\u1e3c":"L","\u1e3a":"L","\u0141":"L","\u023d":"L","\u2c62":"L","\u2c60":"L","\ua748":"L","\ua746":"L","\ua780":"L","\u01c7":"LJ","\u01c8":"Lj","\u24c2":"M","\uff2d":"M","\u1e3e":"M","\u1e40":"M","\u1e42":"M","\u2c6e":"M","\u019c":"M","\u24c3":"N","\uff2e":"N","\u01f8":"N","\u0143":"N","\xd1":"N","\u1e44":"N","\u0147":"N","\u1e46":"N","\u0145":"N","\u1e4a":"N","\u1e48":"N","\u0220":"N","\u019d":"N","\ua790":"N","\ua7a4":"N","\u01ca":"NJ","\u01cb":"Nj","\u24c4":"O","\uff2f":"O","\xd2":"O","\xd3":"O","\xd4":"O","\u1ed2":"O","\u1ed0":"O","\u1ed6":"O","\u1ed4":"O","\xd5":"O","\u1e4c":"O","\u022c":"O","\u1e4e":"O","\u014c":"O","\u1e50":"O","\u1e52":"O","\u014e":"O","\u022e":"O","\u0230":"O","\xd6":"O","\u022a":"O","\u1ece":"O","\u0150":"O","\u01d1":"O","\u020c":"O","\u020e":"O","\u01a0":"O","\u1edc":"O","\u1eda":"O","\u1ee0":"O","\u1ede":"O","\u1ee2":"O","\u1ecc":"O","\u1ed8":"O","\u01ea":"O","\u01ec":"O","\xd8":"O","\u01fe":"O","\u0186":"O","\u019f":"O","\ua74a":"O","\ua74c":"O","\u01a2":"OI","\ua74e":"OO","\u0222":"OU","\u24c5":"P","\uff30":"P","\u1e54":"P","\u1e56":"P","\u01a4":"P","\u2c63":"P","\ua750":"P","\ua752":"P","\ua754":"P","\u24c6":"Q","\uff31":"Q","\ua756":"Q","\ua758":"Q","\u024a":"Q","\u24c7":"R","\uff32":"R","\u0154":"R","\u1e58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e5a":"R","\u1e5c":"R","\u0156":"R","\u1e5e":"R","\u024c":"R","\u2c64":"R","\ua75a":"R","\ua7a6":"R","\ua782":"R","\u24c8":"S","\uff33":"S","\u1e9e":"S","\u015a":"S","\u1e64":"S","\u015c":"S","\u1e60":"S","\u0160":"S","\u1e66":"S","\u1e62":"S","\u1e68":"S","\u0218":"S","\u015e":"S","\u2c7e":"S","\ua7a8":"S","\ua784":"S","\u24c9":"T","\uff34":"T","\u1e6a":"T","\u0164":"T","\u1e6c":"T","\u021a":"T","\u0162":"T","\u1e70":"T","\u1e6e":"T","\u0166":"T","\u01ac":"T","\u01ae":"T","\u023e":"T","\ua786":"T","\ua728":"TZ","\u24ca":"U","\uff35":"U","\xd9":"U","\xda":"U","\xdb":"U","\u0168":"U","\u1e78":"U","\u016a":"U","\u1e7a":"U","\u016c":"U","\xdc":"U","\u01db":"U","\u01d7":"U","\u01d5":"U","\u01d9":"U","\u1ee6":"U","\u016e":"U","\u0170":"U","\u01d3":"U","\u0214":"U","\u0216":"U","\u01af":"U","\u1eea":"U","\u1ee8":"U","\u1eee":"U","\u1eec":"U","\u1ef0":"U","\u1ee4":"U","\u1e72":"U","\u0172":"U","\u1e76":"U","\u1e74":"U","\u0244":"U","\u24cb":"V","\uff36":"V","\u1e7c":"V","\u1e7e":"V","\u01b2":"V","\ua75e":"V","\u0245":"V","\ua760":"VY","\u24cc":"W","\uff37":"W","\u1e80":"W","\u1e82":"W","\u0174":"W","\u1e86":"W","\u1e84":"W","\u1e88":"W","\u2c72":"W","\u24cd":"X","\uff38":"X","\u1e8a":"X","\u1e8c":"X","\u24ce":"Y","\uff39":"Y","\u1ef2":"Y","\xdd":"Y","\u0176":"Y","\u1ef8":"Y","\u0232":"Y","\u1e8e":"Y","\u0178":"Y","\u1ef6":"Y","\u1ef4":"Y","\u01b3":"Y","\u024e":"Y","\u1efe":"Y","\u24cf":"Z","\uff3a":"Z","\u0179":"Z","\u1e90":"Z","\u017b":"Z","\u017d":"Z","\u1e92":"Z","\u1e94":"Z","\u01b5":"Z","\u0224":"Z","\u2c7f":"Z","\u2c6b":"Z","\ua762":"Z","\u24d0":"a","\uff41":"a","\u1e9a":"a","\xe0":"a","\xe1":"a","\xe2":"a","\u1ea7":"a","\u1ea5":"a","\u1eab":"a","\u1ea9":"a","\xe3":"a","\u0101":"a","\u0103":"a","\u1eb1":"a","\u1eaf":"a","\u1eb5":"a","\u1eb3":"a","\u0227":"a","\u01e1":"a","\xe4":"a","\u01df":"a","\u1ea3":"a","\xe5":"a","\u01fb":"a","\u01ce":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1ead":"a","\u1eb7":"a","\u1e01":"a","\u0105":"a","\u2c65":"a","\u0250":"a","\ua733":"aa","\xe6":"ae","\u01fd":"ae","\u01e3":"ae","\ua735":"ao","\ua737":"au","\ua739":"av","\ua73b":"av","\ua73d":"ay","\u24d1":"b","\uff42":"b","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24d2":"c","\uff43":"c","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\xe7":"c","\u1e09":"c","\u0188":"c","\u023c":"c","\ua73f":"c","\u2184":"c","\u24d3":"d","\uff44":"d","\u1e0b":"d","\u010f":"d","\u1e0d":"d","\u1e11":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u018c":"d","\u0256":"d","\u0257":"d","\ua77a":"d","\u01f3":"dz","\u01c6":"dz","\u24d4":"e","\uff45":"e","\xe8":"e","\xe9":"e","\xea":"e","\u1ec1":"e","\u1ebf":"e","\u1ec5":"e","\u1ec3":"e","\u1ebd":"e","\u0113":"e","\u1e15":"e","\u1e17":"e","\u0115":"e","\u0117":"e","\xeb":"e","\u1ebb":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u1e19":"e","\u1e1b":"e","\u0247":"e","\u025b":"e","\u01dd":"e","\u24d5":"f","\uff46":"f","\u1e1f":"f","\u0192":"f","\ua77c":"f","\u24d6":"g","\uff47":"g","\u01f5":"g","\u011d":"g","\u1e21":"g","\u011f":"g","\u0121":"g","\u01e7":"g","\u0123":"g","\u01e5":"g","\u0260":"g","\ua7a1":"g","\u1d79":"g","\ua77f":"g","\u24d7":"h","\uff48":"h","\u0125":"h","\u1e23":"h","\u1e27":"h","\u021f":"h","\u1e25":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\u2c68":"h","\u2c76":"h","\u0265":"h","\u0195":"hv","\u24d8":"i","\uff49":"i","\xec":"i","\xed":"i","\xee":"i","\u0129":"i","\u012b":"i","\u012d":"i","\xef":"i","\u1e2f":"i","\u1ec9":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u012f":"i","\u1e2d":"i","\u0268":"i","\u0131":"i","\u24d9":"j","\uff4a":"j","\u0135":"j","\u01f0":"j","\u0249":"j","\u24da":"k","\uff4b":"k","\u1e31":"k","\u01e9":"k","\u1e33":"k","\u0137":"k","\u1e35":"k","\u0199":"k","\u2c6a":"k","\ua741":"k","\ua743":"k","\ua745":"k","\ua7a3":"k","\u24db":"l","\uff4c":"l","\u0140":"l","\u013a":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u013c":"l","\u1e3d":"l","\u1e3b":"l","\u017f":"l","\u0142":"l","\u019a":"l","\u026b":"l","\u2c61":"l","\ua749":"l","\ua781":"l","\ua747":"l","\u01c9":"lj","\u24dc":"m","\uff4d":"m","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0271":"m","\u026f":"m","\u24dd":"n","\uff4e":"n","\u01f9":"n","\u0144":"n","\xf1":"n","\u1e45":"n","\u0148":"n","\u1e47":"n","\u0146":"n","\u1e4b":"n","\u1e49":"n","\u019e":"n","\u0272":"n","\u0149":"n","\ua791":"n","\ua7a5":"n","\u01cc":"nj","\u24de":"o","\uff4f":"o","\xf2":"o","\xf3":"o","\xf4":"o","\u1ed3":"o","\u1ed1":"o","\u1ed7":"o","\u1ed5":"o","\xf5":"o","\u1e4d":"o","\u022d":"o","\u1e4f":"o","\u014d":"o","\u1e51":"o","\u1e53":"o","\u014f":"o","\u022f":"o","\u0231":"o","\xf6":"o","\u022b":"o","\u1ecf":"o","\u0151":"o","\u01d2":"o","\u020d":"o","\u020f":"o","\u01a1":"o","\u1edd":"o","\u1edb":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u01eb":"o","\u01ed":"o","\xf8":"o","\u01ff":"o","\u0254":"o","\ua74b":"o","\ua74d":"o","\u0275":"o","\u01a3":"oi","\u0223":"ou","\ua74f":"oo","\u24df":"p","\uff50":"p","\u1e55":"p","\u1e57":"p","\u01a5":"p","\u1d7d":"p","\ua751":"p","\ua753":"p","\ua755":"p","\u24e0":"q","\uff51":"q","\u024b":"q","\ua757":"q","\ua759":"q","\u24e1":"r","\uff52":"r","\u0155":"r","\u1e59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1e5b":"r","\u1e5d":"r","\u0157":"r","\u1e5f":"r","\u024d":"r","\u027d":"r","\ua75b":"r","\ua7a7":"r","\ua783":"r","\u24e2":"s","\uff53":"s","\xdf":"s","\u015b":"s","\u1e65":"s","\u015d":"s","\u1e61":"s","\u0161":"s","\u1e67":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u015f":"s","\u023f":"s","\ua7a9":"s","\ua785":"s","\u1e9b":"s","\u24e3":"t","\uff54":"t","\u1e6b":"t","\u1e97":"t","\u0165":"t","\u1e6d":"t","\u021b":"t","\u0163":"t","\u1e71":"t","\u1e6f":"t","\u0167":"t","\u01ad":"t","\u0288":"t","\u2c66":"t","\ua787":"t","\ua729":"tz","\u24e4":"u","\uff55":"u","\xf9":"u","\xfa":"u","\xfb":"u","\u0169":"u","\u1e79":"u","\u016b":"u","\u1e7b":"u","\u016d":"u","\xfc":"u","\u01dc":"u","\u01d8":"u","\u01d6":"u","\u01da":"u","\u1ee7":"u","\u016f":"u","\u0171":"u","\u01d4":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1eeb":"u","\u1ee9":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u0173":"u","\u1e77":"u","\u1e75":"u","\u0289":"u","\u24e5":"v","\uff56":"v","\u1e7d":"v","\u1e7f":"v","\u028b":"v","\ua75f":"v","\u028c":"v","\ua761":"vy","\u24e6":"w","\uff57":"w","\u1e81":"w","\u1e83":"w","\u0175":"w","\u1e87":"w","\u1e85":"w","\u1e98":"w","\u1e89":"w","\u2c73":"w","\u24e7":"x","\uff58":"x","\u1e8b":"x","\u1e8d":"x","\u24e8":"y","\uff59":"y","\u1ef3":"y","\xfd":"y","\u0177":"y","\u1ef9":"y","\u0233":"y","\u1e8f":"y","\xff":"y","\u1ef7":"y","\u1e99":"y","\u1ef5":"y","\u01b4":"y","\u024f":"y","\u1eff":"y","\u24e9":"z","\uff5a":"z","\u017a":"z","\u1e91":"z","\u017c":"z","\u017e":"z","\u1e93":"z","\u1e95":"z","\u01b6":"z","\u0225":"z","\u0240":"z","\u2c6c":"z","\ua763":"z"};j=a(document),g=function(){var a=1;return function(){return a++}}(),j.on("mousemove",function(a){i.x=a.pageX,i.y=a.pageY}),d=N(Object,{bind:function(a){var b=this;return function(){a.apply(b,arguments)}},init:function(c){var d,e,h,i,f=".select2-results";this.opts=c=this.prepareOpts(c),this.id=c.id,c.element.data("select2")!==b&&null!==c.element.data("select2")&&c.element.data("select2").destroy(),this.container=this.createContainer(),this.containerId="s2id_"+(c.element.attr("id")||"autogen"+g()),this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.body=w(function(){return c.element.closest("body")}),D(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",c.element.attr("style")),this.container.css(K(c.containerCss)),this.container.addClass(K(c.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",A),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),D(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(K(c.dropdownCssClass)),this.dropdown.data("select2",this),this.dropdown.on("click",A),this.results=d=this.container.find(f),this.search=e=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",A),u(this.results),this.dropdown.on("mousemove-filtered touchstart touchmove touchend",f,this.bind(this.highlightUnderEvent)),x(80,this.results),this.dropdown.on("scroll-debounced",f,this.bind(this.loadMoreIfNeeded)),a(this.container).on("change",".select2-input",function(a){a.stopPropagation()}),a(this.dropdown).on("change",".select2-input",function(a){a.stopPropagation()}),a.fn.mousewheel&&d.mousewheel(function(a,b,c,e){var f=d.scrollTop();e>0&&0>=f-e?(d.scrollTop(0),A(a)):0>e&&d.get(0).scrollHeight-d.scrollTop()+e<=d.height()&&(d.scrollTop(d.get(0).scrollHeight-d.height()),A(a))}),t(e),e.on("keyup-change input paste",this.bind(this.updateResults)),e.on("focus",function(){e.addClass("select2-focused")}),e.on("blur",function(){e.removeClass("select2-focused")}),this.dropdown.on("mouseup",f,this.bind(function(b){a(b.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(b),this.selectHighlighted(b))})),this.dropdown.on("click mouseup mousedown",function(a){a.stopPropagation()}),a.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==c.maximumInputLength&&this.search.attr("maxlength",c.maximumInputLength);var h=c.element.prop("disabled");h===b&&(h=!1),this.enable(!h);var i=c.element.prop("readonly");i===b&&(i=!1),this.readonly(i),k=k||p(),this.autofocus=c.element.prop("autofocus"),c.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.nextSearchTerm=b},destroy:function(){var a=this.opts.element,c=a.data("select2");this.close(),this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),c!==b&&(c.container.remove(),c.dropdown.remove(),a.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?a.attr({tabindex:this.elementTabIndex}):a.removeAttr("tabindex"),a.show())},optionToData:function(a){return a.is("option")?{id:a.prop("value"),text:a.text(),element:a.get(),css:a.attr("class"),disabled:a.prop("disabled"),locked:q(a.attr("locked"),"locked")||q(a.data("locked"),!0)}:a.is("optgroup")?{text:a.attr("label"),children:[],element:a.get(),css:a.attr("class")}:void 0},prepareOpts:function(c){var d,e,f,g,h=this;if(d=c.element,"select"===d.get(0).tagName.toLowerCase()&&(this.select=e=c.element),e&&a.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in c)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),c=a.extend({},{populateResults:function(d,e,f){var g,l=this.opts.id;g=function(d,e,i){var j,k,m,n,o,p,q,r,s,t;for(d=c.sortResults(d,e,f),j=0,k=d.length;k>j;j+=1)m=d[j],o=m.disabled===!0,n=!o&&l(m)!==b,p=m.children&&m.children.length>0,q=a("<li></li>"),q.addClass("select2-results-dept-"+i),q.addClass("select2-result"),q.addClass(n?"select2-result-selectable":"select2-result-unselectable"),o&&q.addClass("select2-disabled"),p&&q.addClass("select2-result-with-children"),q.addClass(h.opts.formatResultCssClass(m)),r=a(document.createElement("div")),r.addClass("select2-result-label"),t=c.formatResult(m,r,f,h.opts.escapeMarkup),t!==b&&r.html(t),q.append(r),p&&(s=a("<ul></ul>"),s.addClass("select2-result-sub"),g(m.children,s,i+1),q.append(s)),q.data("select2-data",m),e.append(q)},g(e,d,0)}},a.fn.select2.defaults,c),"function"!=typeof c.id&&(f=c.id,c.id=function(a){return a[f]}),a.isArray(c.element.data("select2Tags"))){if("tags"in c)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+c.element.attr("id");c.tags=c.element.data("select2Tags")}if(e?(c.query=this.bind(function(a){var f,g,i,c={results:[],more:!1},e=a.term;i=function(b,c){var d;b.is("option")?a.matcher(e,b.text(),b)&&c.push(h.optionToData(b)):b.is("optgroup")&&(d=h.optionToData(b),b.children().each2(function(a,b){i(b,d.children)}),d.children.length>0&&c.push(d))},f=d.children(),this.getPlaceholder()!==b&&f.length>0&&(g=this.getPlaceholderOption(),g&&(f=f.not(g))),f.each2(function(a,b){i(b,c.results)}),a.callback(c)}),c.id=function(a){return a.id},c.formatResultCssClass=function(a){return a.css}):"query"in c||("ajax"in c?(g=c.element.data("ajax-url"),g&&g.length>0&&(c.ajax.url=g),c.query=G.call(c.element,c.ajax)):"data"in c?c.query=H(c.data):"tags"in c&&(c.query=I(c.tags),c.createSearchChoice===b&&(c.createSearchChoice=function(b){return{id:a.trim(b),text:a.trim(b)}}),c.initSelection===b&&(c.initSelection=function(b,d){var e=[];a(r(b.val(),c.separator)).each(function(){var b={id:this,text:this},d=c.tags;a.isFunction(d)&&(d=d()),a(d).each(function(){return q(this.id,b.id)?(b=this,!1):void 0}),e.push(b)}),d(e)}))),"function"!=typeof c.query)throw"query function not defined for Select2 "+c.element.attr("id");return c},monitorSource:function(){var c,a=this.opts.element;a.on("change.select2",this.bind(function(){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),c=this.bind(function(){var d,f=a.prop("disabled");f===b&&(f=!1),this.enable(!f);var d=a.prop("readonly");d===b&&(d=!1),this.readonly(d),D(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(K(this.opts.containerCssClass)),D(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(K(this.opts.dropdownCssClass))}),a.on("propertychange.select2 DOMAttrModified.select2",c),this.mutationCallback===b&&(this.mutationCallback=function(a){a.forEach(c)}),"undefined"!=typeof WebKitMutationObserver&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new WebKitMutationObserver(this.mutationCallback),this.propertyObserver.observe(a.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(b){var c=a.Event("select2-selecting",{val:this.id(b),object:b});return this.opts.element.trigger(c),!c.isDefaultPrevented()},triggerChange:function(b){b=b||{},b=a.extend({},b,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(b),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return this.enabledInterface===!0},enableInterface:function(){var a=this._enabled&&!this._readonly,b=!a;return a===this.enabledInterface?!1:(this.container.toggleClass("select2-container-disabled",b),this.close(),this.enabledInterface=a,!0)},enable:function(a){a===b&&(a=!0),this._enabled!==a&&(this._enabled=a,this.opts.element.prop("disabled",!a),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(a){return a===b&&(a=!1),this._readonly===a?!1:(this._readonly=a,this.opts.element.prop("readonly",a),this.enableInterface(),!0)},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var q,r,s,t,b=this.dropdown,c=this.container.offset(),d=this.container.outerHeight(!1),e=this.container.outerWidth(!1),f=b.outerHeight(!1),g=a(window).scrollLeft()+a(window).width(),h=a(window).scrollTop()+a(window).height(),i=c.top+d,j=c.left,l=h>=i+f,m=c.top-f>=this.body().scrollTop(),n=b.outerWidth(!1),o=g>=j+n,p=b.hasClass("select2-drop-above");this.opts.dropdownAutoWidth?(t=a(".select2-results",b)[0],b.addClass("select2-drop-auto-width"),b.css("width",""),n=b.outerWidth(!1)+(t.scrollHeight===t.clientHeight?0:k.width),n>e?e=n:n=e,o=g>=j+n):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body().css("position")&&(q=this.body().offset(),i-=q.top,j-=q.left),p?(r=!0,!m&&l&&(r=!1)):(r=!1,!l&&m&&(r=!0)),o||(j=c.left+e-n),r?(i=c.top-f,this.container.addClass("select2-drop-above"),b.addClass("select2-drop-above")):(this.container.removeClass("select2-drop-above"),b.removeClass("select2-drop-above")),s=a.extend({top:i,left:j,width:e},K(this.opts.dropdownCss)),b.css(s)},shouldOpen:function(){var b;return this.opened()?!1:this._enabled===!1||this._readonly===!0?!1:(b=a.Event("select2-opening"),this.opts.element.trigger(b),!b.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(this.opening(),!0):!1},opening:function(){var f,b=this.containerId,c="scroll."+b,d="resize."+b,e="orientationchange."+b;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body()),f=a("#select2-drop-mask"),0==f.length&&(f=a(document.createElement("div")),f.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),f.hide(),f.appendTo(this.body()),f.on("mousedown touchstart click",function(b){var d,c=a("#select2-drop");c.length>0&&(d=c.data("select2"),d.opts.selectOnBlur&&d.selectHighlighted({noFocus:!0}),d.close({focus:!1}),b.preventDefault(),b.stopPropagation())})),this.dropdown.prev()[0]!==f[0]&&this.dropdown.before(f),a("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),f.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var h=this;this.container.parents().add(window).each(function(){a(this).on(d+" "+c+" "+e,function(){h.positionDropdown()})})},close:function(){if(this.opened()){var b=this.containerId,c="scroll."+b,d="resize."+b,e="orientationchange."+b;this.container.parents().add(window).each(function(){a(this).off(c).off(d).off(e)}),this.clearDropdownAlignmentPreference(),a("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger(a.Event("select2-close"))}},externalSearch:function(a){this.open(),this.search.val(a),this.updateResults(!1)},clearSearch:function(){},getMaximumSelectionSize:function(){return K(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var c,d,e,f,g,h,i,b=this.results;if(d=this.highlight(),!(0>d)){if(0==d)return b.scrollTop(0),void 0;c=this.findHighlightableChoices().find(".select2-result-label"),e=a(c[d]),f=e.offset().top+e.outerHeight(!0),d===c.length-1&&(i=b.find("li.select2-more-results"),i.length>0&&(f=i.offset().top+i.outerHeight(!0))),g=b.offset().top+b.outerHeight(!0),f>g&&b.scrollTop(b.scrollTop()+(f-g)),h=e.offset().top-b.offset().top,0>h&&"none"!=e.css("display")&&b.scrollTop(b.scrollTop()+h)}},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled)")},moveHighlight:function(b){for(var c=this.findHighlightableChoices(),d=this.highlight();d>-1&&d<c.length;){d+=b;var e=a(c[d]);if(e.hasClass("select2-result-selectable")&&!e.hasClass("select2-disabled")&&!e.hasClass("select2-selected")){this.highlight(d);break}}},highlight:function(b){var d,e,c=this.findHighlightableChoices();return 0===arguments.length?o(c.filter(".select2-highlighted")[0],c.get()):(b>=c.length&&(b=c.length-1),0>b&&(b=0),this.removeHighlight(),d=a(c[b]),d.addClass("select2-highlighted"),this.ensureHighlightVisible(),e=d.data("select2-data"),e&&this.opts.element.trigger({type:"select2-highlight",val:this.id(e),choice:e}),void 0)},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(b){var c=a(b.target).closest(".select2-result-selectable");if(c.length>0&&!c.is(".select2-highlighted")){var d=this.findHighlightableChoices();this.highlight(d.index(c))}else 0==c.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var c,a=this.results,b=a.find("li.select2-more-results"),e=this.resultsPage+1,f=this,g=this.search.val(),h=this.context;0!==b.length&&(c=b.offset().top-a.offset().top-a.height(),c<=this.opts.loadMorePadding&&(b.addClass("select2-active"),this.opts.query({element:this.opts.element,term:g,page:e,context:h,matcher:this.opts.matcher,callback:this.bind(function(c){f.opened()&&(f.opts.populateResults.call(this,a,c.results,{term:g,page:e,context:h}),f.postprocessResults(c,!1,!1),c.more===!0?(b.detach().appendTo(a).text(f.opts.formatLoadMore(e+1)),window.setTimeout(function(){f.loadMoreIfNeeded()},10)):b.remove(),f.positionDropdown(),f.resultsPage=e,f.context=c.context,this.opts.element.trigger({type:"select2-loaded",items:c}))})})))},tokenize:function(){},updateResults:function(c){function m(){d.removeClass("select2-active"),h.positionDropdown()}function n(a){e.html(a),m()}var g,i,l,d=this.search,e=this.results,f=this.opts,h=this,j=d.val(),k=a.data(this.container,"select2-last-term");if((c===!0||!k||!q(j,k))&&(a.data(this.container,"select2-last-term",j),c===!0||this.showSearchInput!==!1&&this.opened())){l=++this.queryCount;var o=this.getMaximumSelectionSize();if(o>=1&&(g=this.data(),a.isArray(g)&&g.length>=o&&J(f.formatSelectionTooBig,"formatSelectionTooBig")))return n("<li class='select2-selection-limit'>"+f.formatSelectionTooBig(o)+"</li>"),void 0;if(d.val().length<f.minimumInputLength)return J(f.formatInputTooShort,"formatInputTooShort")?n("<li class='select2-no-results'>"+f.formatInputTooShort(d.val(),f.minimumInputLength)+"</li>"):n(""),c&&this.showSearch&&this.showSearch(!0),void 0;if(f.maximumInputLength&&d.val().length>f.maximumInputLength)return J(f.formatInputTooLong,"formatInputTooLong")?n("<li class='select2-no-results'>"+f.formatInputTooLong(d.val(),f.maximumInputLength)+"</li>"):n(""),void 0;
+f.formatSearching&&0===this.findHighlightableChoices().length&&n("<li class='select2-searching'>"+f.formatSearching()+"</li>"),d.addClass("select2-active"),this.removeHighlight(),i=this.tokenize(),i!=b&&null!=i&&d.val(i),this.resultsPage=1,f.query({element:f.element,term:d.val(),page:this.resultsPage,context:null,matcher:f.matcher,callback:this.bind(function(g){var i;if(l==this.queryCount){if(!this.opened())return this.search.removeClass("select2-active"),void 0;if(this.context=g.context===b?null:g.context,this.opts.createSearchChoice&&""!==d.val()&&(i=this.opts.createSearchChoice.call(h,d.val(),g.results),i!==b&&null!==i&&h.id(i)!==b&&null!==h.id(i)&&0===a(g.results).filter(function(){return q(h.id(this),h.id(i))}).length&&g.results.unshift(i)),0===g.results.length&&J(f.formatNoMatches,"formatNoMatches"))return n("<li class='select2-no-results'>"+f.formatNoMatches(d.val())+"</li>"),void 0;e.empty(),h.opts.populateResults.call(this,e,g.results,{term:d.val(),page:this.resultsPage,context:null}),g.more===!0&&J(f.formatLoadMore,"formatLoadMore")&&(e.append("<li class='select2-more-results'>"+h.opts.escapeMarkup(f.formatLoadMore(this.resultsPage))+"</li>"),window.setTimeout(function(){h.loadMoreIfNeeded()},10)),this.postprocessResults(g,c),m(),this.opts.element.trigger({type:"select2-loaded",items:g})}})})}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){y(this.search)},selectHighlighted:function(a){var b=this.highlight(),c=this.results.find(".select2-highlighted"),d=c.closest(".select2-result").data("select2-data");d?(this.highlight(b),this.onSelect(d,a)):a&&a.noFocus&&this.close()},getPlaceholder:function(){var a;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((a=this.getPlaceholderOption())!==b?a.text():b)},getPlaceholderOption:function(){if(this.select){var a=this.select.children().first();if(this.opts.placeholderOption!==b)return"first"===this.opts.placeholderOption&&a||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===a.text()&&""===a.val())return a}},initContainerWidth:function(){function c(){var c,d,e,f,g;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if(c=this.opts.element.attr("style"),c!==b)for(d=c.split(";"),f=0,g=d.length;g>f;f+=1)if(e=d[f].replace(/\s/g,"").match(/[^-]width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i),null!==e&&e.length>=1)return e[1];return"resolve"===this.opts.width?(c=this.opts.element.css("width"),c.indexOf("%")>0?c:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px"):null}return a.isFunction(this.opts.width)?this.opts.width():this.opts.width}var d=c.call(this);null!==d&&this.container.css("width",d)}}),e=N(d,{createContainer:function(){var b=a(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>"," <span class='select2-chosen'> </span><abbr class='select2-search-choice-close'></abbr>"," <span class='select2-arrow'><b></b></span>","</a>","<input class='select2-focusser select2-offscreen' type='text'/>","<div class='select2-drop select2-display-none'>"," <div class='select2-search'>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'/>"," </div>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return b},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var c,d,e;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.search.focus(),c=this.search.get(0),c.createTextRange?(d=c.createTextRange(),d.collapse(!1),d.select()):c.setSelectionRange&&(e=this.search.val().length,c.setSelectionRange(e,e)),""===this.search.val()&&this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(a.Event("select2-open"))},close:function(a){this.opened()&&(this.parent.close.apply(this,arguments),a=a||{focus:!0},this.focusser.removeAttr("disabled"),a.focus&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.removeAttr("disabled"),this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.removeAttr("disabled"),this.focusser.focus()},destroy:function(){a("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments)},initContainer:function(){var b,d=this.container,e=this.dropdown;this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=b=d.find(".select2-choice"),this.focusser=d.find(".select2-focusser"),this.focusser.attr("id","s2id_autogen"+g()),a("label[for='"+this.opts.element.attr("id")+"']").attr("for",this.focusser.attr("id")),this.focusser.attr("tabindex",this.elementTabIndex),this.search.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()){if(a.which===c.PAGE_UP||a.which===c.PAGE_DOWN)return A(a),void 0;switch(a.which){case c.UP:case c.DOWN:return this.moveHighlight(a.which===c.UP?-1:1),A(a),void 0;case c.ENTER:return this.selectHighlighted(),A(a),void 0;case c.TAB:return this.selectHighlighted({noFocus:!0}),void 0;case c.ESC:return this.cancel(a),A(a),void 0}}})),this.search.on("blur",this.bind(function(){document.activeElement===this.body().get(0)&&window.setTimeout(this.bind(function(){this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()&&a.which!==c.TAB&&!c.isControl(a)&&!c.isFunctionKey(a)&&a.which!==c.ESC){if(this.opts.openOnEnter===!1&&a.which===c.ENTER)return A(a),void 0;if(a.which==c.DOWN||a.which==c.UP||a.which==c.ENTER&&this.opts.openOnEnter){if(a.altKey||a.ctrlKey||a.shiftKey||a.metaKey)return;return this.open(),A(a),void 0}return a.which==c.DELETE||a.which==c.BACKSPACE?(this.opts.allowClear&&this.clear(),A(a),void 0):void 0}})),t(this.focusser),this.focusser.on("keyup-change input",this.bind(function(a){if(this.opts.minimumResultsForSearch>=0){if(a.stopPropagation(),this.opened())return;this.open()}})),b.on("mousedown","abbr",this.bind(function(a){this.isInterfaceEnabled()&&(this.clear(),B(a),this.close(),this.selection.focus())})),b.on("mousedown",this.bind(function(b){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),A(b)})),e.on("mousedown",this.bind(function(){this.search.focus()})),b.on("focus",this.bind(function(a){A(a)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(a.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.setPlaceholder()},clear:function(b){var c=this.selection.data("select2-data");if(c){var d=a.Event("select2-clearing");if(this.opts.element.trigger(d),d.isDefaultPrevented())return;var e=this.getPlaceholderOption();this.opts.element.val(e?e.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),b!==!1&&(this.opts.element.trigger({type:"select2-removed",val:this.id(c),choice:c}),this.triggerChange({removed:c}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var c=this;this.opts.initSelection.call(null,this.opts.element,function(a){a!==b&&null!==a&&(c.updateSelection(a),c.close(),c.setPlaceholder())})}},isPlaceholderOptionSelected:function(){var a;return this.getPlaceholder()?(a=this.getPlaceholderOption())!==b&&a.is(":selected")||""===this.opts.element.val()||this.opts.element.val()===b||null===this.opts.element.val():!1},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=a.find(":selected");b(c.optionToData(d))}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=c.val(),f=null;b.query({matcher:function(a,c,d){var g=q(e,b.id(d));return g&&(f=d),g},callback:a.isFunction(d)?function(){d(f)}:a.noop})}),b},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===b?b:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var a=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&a!==b){if(this.select&&this.getPlaceholderOption()===b)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(a)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(a,b,c){var d=0,e=this;if(this.findHighlightableChoices().each2(function(a,b){return q(e.id(b.data("select2-data")),e.opts.element.val())?(d=a,!1):void 0}),c!==!1&&(b===!0&&d>=0?this.highlight(d):this.highlight(0)),b===!0){var g=this.opts.minimumResultsForSearch;g>=0&&this.showSearch(L(a.results)>=g)}},showSearch:function(b){this.showSearchInput!==b&&(this.showSearchInput=b,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!b),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!b),a(this.dropdown,this.container).toggleClass("select2-with-searchbox",b))},onSelect:function(a,b){if(this.triggerSelect(a)){var c=this.opts.element.val(),d=this.data();this.opts.element.val(this.id(a)),this.updateSelection(a),this.opts.element.trigger({type:"select2-selected",val:this.id(a),choice:a}),this.nextSearchTerm=this.opts.nextSearchTerm(a,this.search.val()),this.close(),b&&b.noFocus||this.focusser.focus(),q(c,this.id(a))||this.triggerChange({added:a,removed:d})}},updateSelection:function(a){var d,e,c=this.selection.find(".select2-chosen");this.selection.data("select2-data",a),c.empty(),null!==a&&(d=this.opts.formatSelection(a,c,this.opts.escapeMarkup)),d!==b&&c.append(d),e=this.opts.formatSelectionCssClass(a,c),e!==b&&c.addClass(e),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==b&&this.container.addClass("select2-allowclear")},val:function(){var a,c=!1,d=null,e=this,f=this.data();if(0===arguments.length)return this.opts.element.val();if(a=arguments[0],arguments.length>1&&(c=arguments[1]),this.select)this.select.val(a).find(":selected").each2(function(a,b){return d=e.optionToData(b),!1}),this.updateSelection(d),this.setPlaceholder(),c&&this.triggerChange({added:d,removed:f});else{if(!a&&0!==a)return this.clear(c),void 0;if(this.opts.initSelection===b)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(a),this.opts.initSelection(this.opts.element,function(a){e.opts.element.val(a?e.id(a):""),e.updateSelection(a),e.setPlaceholder(),c&&e.triggerChange({added:a,removed:f})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(a){var c,d=!1;return 0===arguments.length?(c=this.selection.data("select2-data"),c==b&&(c=null),c):(arguments.length>1&&(d=arguments[1]),a?(c=this.data(),this.opts.element.val(a?this.id(a):""),this.updateSelection(a),d&&this.triggerChange({added:a,removed:c})):this.clear(d),void 0)}}),f=N(d,{createContainer:function(){var b=a(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>"," <li class='select2-search-field'>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return b},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=[];a.find(":selected").each2(function(a,b){d.push(c.optionToData(b))}),b(d)}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=r(c.val(),b.separator),f=[];b.query({matcher:function(c,d,g){var h=a.grep(e,function(a){return q(a,b.id(g))}).length;return h&&f.push(g),h},callback:a.isFunction(d)?function(){for(var a=[],c=0;c<e.length;c++)for(var g=e[c],h=0;h<f.length;h++){var i=f[h];if(q(g,b.id(i))){a.push(i),f.splice(h,1);break}}d(a)}:a.noop})}),b},selectChoice:function(a){var b=this.container.find(".select2-search-choice-focus");b.length&&a&&a[0]==b[0]||(b.length&&this.opts.element.trigger("choice-deselected",b),b.removeClass("select2-search-choice-focus"),a&&a.length&&(this.close(),a.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",a)))},destroy:function(){a("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments)},initContainer:function(){var d,b=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=d=this.container.find(b);var e=this;this.selection.on("click",".select2-search-choice:not(.select2-locked)",function(){e.search[0].focus(),e.selectChoice(a(this))}),this.search.attr("id","s2id_autogen"+g()),a("label[for='"+this.opts.element.attr("id")+"']").attr("for",this.search.attr("id")),this.search.on("input paste",this.bind(function(){this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()){++this.keydowns;var b=d.find(".select2-search-choice-focus"),e=b.prev(".select2-search-choice:not(.select2-locked)"),f=b.next(".select2-search-choice:not(.select2-locked)"),g=z(this.search);if(b.length&&(a.which==c.LEFT||a.which==c.RIGHT||a.which==c.BACKSPACE||a.which==c.DELETE||a.which==c.ENTER)){var h=b;return a.which==c.LEFT&&e.length?h=e:a.which==c.RIGHT?h=f.length?f:null:a.which===c.BACKSPACE?(this.unselect(b.first()),this.search.width(10),h=e.length?e:f):a.which==c.DELETE?(this.unselect(b.first()),this.search.width(10),h=f.length?f:null):a.which==c.ENTER&&(h=null),this.selectChoice(h),A(a),h&&h.length||this.open(),void 0}if((a.which===c.BACKSPACE&&1==this.keydowns||a.which==c.LEFT)&&0==g.offset&&!g.length)return this.selectChoice(d.find(".select2-search-choice:not(.select2-locked)").last()),A(a),void 0;if(this.selectChoice(null),this.opened())switch(a.which){case c.UP:case c.DOWN:return this.moveHighlight(a.which===c.UP?-1:1),A(a),void 0;case c.ENTER:return this.selectHighlighted(),A(a),void 0;case c.TAB:return this.selectHighlighted({noFocus:!0}),this.close(),void 0;case c.ESC:return this.cancel(a),A(a),void 0}if(a.which!==c.TAB&&!c.isControl(a)&&!c.isFunctionKey(a)&&a.which!==c.BACKSPACE&&a.which!==c.ESC){if(a.which===c.ENTER){if(this.opts.openOnEnter===!1)return;if(a.altKey||a.ctrlKey||a.shiftKey||a.metaKey)return}this.open(),(a.which===c.PAGE_UP||a.which===c.PAGE_DOWN)&&A(a),a.which===c.ENTER&&A(a)}}})),this.search.on("keyup",this.bind(function(){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(b){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),b.stopImmediatePropagation(),this.opts.element.trigger(a.Event("select2-blur"))})),this.container.on("click",b,this.bind(function(b){this.isInterfaceEnabled()&&(a(b.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.open(),this.focusSearch(),b.preventDefault()))})),this.container.on("focus",b,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var c=this;this.opts.initSelection.call(null,this.opts.element,function(a){a!==b&&null!==a&&(c.updateSelection(a),c.close(),c.clearSearch())})}},clearSearch:function(){var a=this.getPlaceholder(),c=this.getMaxSearchWidth();a!==b&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(a).addClass("select2-default"),this.search.width(c>0?c:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),this.updateResults(!0),this.search.focus(),this.opts.element.trigger(a.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(b){var c=[],d=[],e=this;a(b).each(function(){o(e.id(this),c)<0&&(c.push(e.id(this)),d.push(this))}),b=d,this.selection.find(".select2-search-choice").remove(),a(b).each(function(){e.addSelectedChoice(this)}),e.postprocessResults()},tokenize:function(){var a=this.search.val();a=this.opts.tokenizer.call(this,a,this.data(),this.bind(this.onSelect),this.opts),null!=a&&a!=b&&(this.search.val(a),a.length>0&&this.open())},onSelect:function(a,b){this.triggerSelect(a)&&(this.addSelectedChoice(a),this.opts.element.trigger({type:"selected",val:this.id(a),choice:a}),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(a,!1,this.opts.closeOnSelect===!0),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()&&this.updateResults(!0),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:a}),b&&b.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(c){var j,k,d=!c.locked,e=a("<li class='select2-search-choice'> <div></div> <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),f=a("<li class='select2-search-choice select2-locked'><div></div></li>"),g=d?e:f,h=this.id(c),i=this.getVal();j=this.opts.formatSelection(c,g.find("div"),this.opts.escapeMarkup),j!=b&&g.find("div").replaceWith("<div>"+j+"</div>"),k=this.opts.formatSelectionCssClass(c,g.find("div")),k!=b&&g.addClass(k),d&&g.find(".select2-search-choice-close").on("mousedown",A).on("click dblclick",this.bind(function(b){this.isInterfaceEnabled()&&(a(b.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(a(b.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),this.close(),this.focusSearch()})).dequeue(),A(b))})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),g.data("select2-data",c),g.insertBefore(this.searchContainer),i.push(h),this.setVal(i)},unselect:function(a){var c,d,b=this.getVal();if(a=a.closest(".select2-search-choice"),0===a.length)throw"Invalid argument: "+a+". Must be .select2-search-choice";if(c=a.data("select2-data")){for(;(d=o(this.id(c),b))>=0;)b.splice(d,1),this.setVal(b),this.select&&this.postprocessResults();a.remove(),this.opts.element.trigger({type:"removed",val:this.id(c),choice:c}),this.triggerChange({removed:c})}},postprocessResults:function(a,b,c){var d=this.getVal(),e=this.results.find(".select2-result"),f=this.results.find(".select2-result-with-children"),g=this;e.each2(function(a,b){var c=g.id(b.data("select2-data"));o(c,d)>=0&&(b.addClass("select2-selected"),b.find(".select2-result-selectable").addClass("select2-selected"))}),f.each2(function(a,b){b.is(".select2-result-selectable")||0!==b.find(".select2-result-selectable:not(.select2-selected)").length||b.addClass("select2-selected")}),-1==this.highlight()&&c!==!1&&g.highlight(0),!this.opts.createSearchChoice&&!e.filter(".select2-result:not(.select2-selected)").length>0&&(!a||a&&!a.more&&0===this.results.find(".select2-no-results").length)&&J(g.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+g.opts.formatNoMatches(g.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-s(this.search)},resizeSearch:function(){var a,b,c,d,e,f=s(this.search);a=C(this.search)+10,b=this.search.offset().left,c=this.selection.width(),d=this.selection.offset().left,e=c-(b-d)-f,a>e&&(e=c-f),40>e&&(e=c-f),0>=e&&(e=a),this.search.width(Math.floor(e))},getVal:function(){var a;return this.select?(a=this.select.val(),null===a?[]:a):(a=this.opts.element.val(),r(a,this.opts.separator))},setVal:function(b){var c;this.select?this.select.val(b):(c=[],a(b).each(function(){o(this,c)<0&&c.push(this)}),this.opts.element.val(0===c.length?"":c.join(this.opts.separator)))},buildChangeDetails:function(a,b){for(var b=b.slice(0),a=a.slice(0),c=0;c<b.length;c++)for(var d=0;d<a.length;d++)q(this.opts.id(b[c]),this.opts.id(a[d]))&&(b.splice(c,1),c--,a.splice(d,1),d--);return{added:b,removed:a}},val:function(c,d){var e,f=this;if(0===arguments.length)return this.getVal();if(e=this.data(),e.length||(e=[]),!c&&0!==c)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),d&&this.triggerChange({added:this.data(),removed:e}),void 0;if(this.setVal(c),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),d&&this.triggerChange(this.buildChangeDetails(e,this.data()));else{if(this.opts.initSelection===b)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(b){var c=a.map(b,f.id);f.setVal(c),f.updateSelection(b),f.clearSearch(),d&&f.triggerChange(f.buildChangeDetails(e,this.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var b=[],c=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){b.push(c.opts.id(a(this).data("select2-data")))}),this.setVal(b),this.triggerChange()},data:function(b,c){var e,f,d=this;return 0===arguments.length?this.selection.find(".select2-search-choice").map(function(){return a(this).data("select2-data")}).get():(f=this.data(),b||(b=[]),e=a.map(b,function(a){return d.opts.id(a)}),this.setVal(e),this.updateSelection(b),this.clearSearch(),c&&this.triggerChange(this.buildChangeDetails(f,this.data())),void 0)}}),a.fn.select2=function(){var d,g,h,i,j,c=Array.prototype.slice.call(arguments,0),k=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],l=["opened","isFocused","container","dropdown"],m=["val","data"],n={search:"externalSearch"};return this.each(function(){if(0===c.length||"object"==typeof c[0])d=0===c.length?{}:a.extend({},c[0]),d.element=a(this),"select"===d.element.get(0).tagName.toLowerCase()?j=d.element.prop("multiple"):(j=d.multiple||!1,"tags"in d&&(d.multiple=j=!0)),g=j?new f:new e,g.init(d);else{if("string"!=typeof c[0])throw"Invalid arguments to select2 plugin: "+c;if(o(c[0],k)<0)throw"Unknown method: "+c[0];if(i=b,g=a(this).data("select2"),g===b)return;if(h=c[0],"container"===h?i=g.container:"dropdown"===h?i=g.dropdown:(n[h]&&(h=n[h]),i=g[h].apply(g,c.slice(1))),o(c[0],l)>=0||o(c[0],m)&&1==c.length)return!1}}),i===b?this:i},a.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(a,b,c,d){var e=[];return E(a.text,c.term,e,d),e.join("")},formatSelection:function(a,c,d){return a?d(a.text):b},sortResults:function(a){return a},formatResultCssClass:function(){return b},formatSelectionCssClass:function(){return b},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(a,b){var c=b-a.length;return"Please enter "+c+" more character"+(1==c?"":"s")},formatInputTooLong:function(a,b){var c=a.length-b;return"Please delete "+c+" character"+(1==c?"":"s")},formatSelectionTooBig:function(a){return"You can only select "+a+" item"+(1==a?"":"s")},formatLoadMore:function(){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(a){return a.id},matcher:function(a,b){return n(""+b).toUpperCase().indexOf(n(""+a).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:M,escapeMarkup:F,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(a){return a},adaptDropdownCssClass:function(){return null},nextSearchTerm:function(){return b}},a.fn.select2.ajaxDefaults={transport:a.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:G,local:H,tags:I},util:{debounce:v,markMatch:E,escapeMarkup:F,stripDiacritics:n},"class":{"abstract":d,single:e,multi:f}}}}(jQuery);
\ No newline at end of file
Added: trunk/faxtomail-ui-web/src/main/webapp/js/select2/select2_locale_fr.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/select2/select2_locale_fr.js (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/select2/select2_locale_fr.js 2014-02-05 18:34:13 UTC (rev 4)
@@ -0,0 +1,17 @@
+/**
+ * Select2 French translation
+ *
+ * %%Ignore-License
+ */
+(function ($) {
+ "use strict";
+
+ $.extend($.fn.select2.defaults, {
+ formatNoMatches: function () { return "Aucun résultat trouvé"; },
+ formatInputTooShort: function (input, min) { var n = min - input.length; return "Merci de saisir " + n + " caractère" + (n == 1? "" : "s") + " de plus"; },
+ formatInputTooLong: function (input, max) { var n = input.length - max; return "Merci de supprimer " + n + " caractère" + (n == 1? "" : "s"); },
+ formatSelectionTooBig: function (limit) { return "Vous pouvez seulement sélectionner " + limit + " élément" + (limit == 1 ? "" : "s"); },
+ formatLoadMore: function (pageNumber) { return "Chargement de résultats supplémentaires..."; },
+ formatSearching: function () { return "Recherche en cours..."; }
+ });
+})(jQuery);
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-01-15 16:25:56 UTC (rev 3)
+++ trunk/pom.xml 2014-02-05 18:34:13 UTC (rev 4)
@@ -6,7 +6,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>4.3</version>
+ <version>4.5</version>
</parent>
<groupId>com.franciaflex</groupId>
@@ -45,6 +45,7 @@
<modules>
<module>faxtomail-persistence</module>
<module>faxtomail-service</module>
+ <module>faxtomail-ui-web</module>
<module>faxtomail-ui-swing</module>
</modules>
@@ -83,16 +84,27 @@
<nuitonDecoratorVersion>3.0-alpha-2</nuitonDecoratorVersion>
<nuitonUpdaterVersion>3.0-alpha-1</nuitonUpdaterVersion>
<nuitonUtilsVersion>2.7.1</nuitonUtilsVersion>
- <nuitonValidatorVersion>3.0-alpha-1</nuitonValidatorVersion>
+ <nuitonValidatorVersion>3.0-alpha-2</nuitonValidatorVersion>
+ <nuitonWebVersion>1.14</nuitonWebVersion>
- <eugenePluginVersion>2.7.2</eugenePluginVersion>
- <hibernateVersion>3.6.10.Final</hibernateVersion>
+ <eugeneVersion>2.7.3</eugeneVersion>
+ <topiaVersion>3.0-SNAPSHOT</topiaVersion>
+ <hibernateVersion>4.2.8.Final</hibernateVersion>
+ <h2Version>1.3.174</h2Version>
- <jaxxVersion>2.5.30</jaxxVersion>
+ <jaxxVersion>2.8</jaxxVersion>
<swingXVersion>1.6.4</swingXVersion>
<xworkVersion>2.3.15.1</xworkVersion>
+ <struts2Version>2.3.15.3</struts2Version>
+ <jqueryPluginVersion>3.6.1</jqueryPluginVersion>
+ <bootstrapPluginVersion>1.6.1</bootstrapPluginVersion>
+ <shiroVersion>1.2.2</shiroVersion>
<slf4jVersion>1.7.5</slf4jVersion>
+ <hibernateVersion>4.2.8.Final</hibernateVersion>
+ <mockitoVersion>1.9.5</mockitoVersion>
+ <postgresqlDriverVersion>9.3-1100-jdbc41</postgresqlDriverVersion>
+ <commonsEmailVersion>1.3.2</commonsEmailVersion>
<i18n.bundles>fr_FR,en_GB</i18n.bundles>
<i18n.silent>true</i18n.silent>
@@ -101,6 +113,9 @@
<license.organizationName>Franciaflex</license.organizationName>
<license.licenseName>gpl_v3</license.licenseName>
+ <!-- Last JRE version to use -->
+ <jreVersion>1.7.45</jreVersion>
+
</properties>
<repositories>
@@ -135,9 +150,36 @@
<dependencyManagement>
<dependencies>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <version>${h2Version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>${postgresqlDriverVersion}</version>
+ <scope>runtime</scope>
+ </dependency>
+
<!-- librairies utils -->
<dependency>
+ <groupId>org.nuiton.topia</groupId>
+ <artifactId>topia-persistence</artifactId>
+ <version>${topiaVersion}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-c3p0</artifactId>
+ <version>${hibernateVersion}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.nuiton</groupId>
<artifactId>nuiton-profiling</artifactId>
<version>2.7</version>
@@ -199,11 +241,11 @@
<classifier>tests</classifier>
</dependency>
- <dependency>
- <groupId>org.apache.struts.xwork</groupId>
- <artifactId>xwork-core</artifactId>
- <version>${xworkVersion}</version>
- </dependency>
+ <!--<dependency>-->
+ <!--<groupId>org.apache.struts.xwork</groupId>-->
+ <!--<artifactId>xwork-core</artifactId>-->
+ <!--<version>${xworkVersion}</version>-->
+ <!--</dependency>-->
<!-- librairie Jaxx -->
<dependency>
@@ -232,6 +274,18 @@
<dependency>
<groupId>org.nuiton.jaxx</groupId>
+ <artifactId>jaxx-application-api</artifactId>
+ <version>${jaxxVersion}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.nuiton.jaxx</groupId>
+ <artifactId>jaxx-application-swing</artifactId>
+ <version>${jaxxVersion}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.nuiton.jaxx</groupId>
<artifactId>jaxx-runtime</artifactId>
<version>${jaxxVersion}</version>
<scope>test</scope>
@@ -300,6 +354,98 @@
<version>${commonsIoVersion}</version>
</dependency>
+ <!-- web module -->
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.nuiton.web</groupId>
+ <artifactId>nuiton-struts2</artifactId>
+ <version>${nuitonWebVersion}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-core</artifactId>
+ <version>${struts2Version}</version>
+ <exclusions>
+ <!-- prevent java.lang.ClassCastException: cannot be cast to javassist.util.proxy.Proxy -->
+ <exclusion>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>com.jgeppert.struts2.jquery</groupId>
+ <artifactId>struts2-jquery-plugin</artifactId>
+ <version>${jqueryPluginVersion}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.jgeppert.struts2.bootstrap</groupId>
+ <artifactId>struts2-bootstrap-plugin</artifactId>
+ <version>${bootstrapPluginVersion}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-json-plugin</artifactId>
+ <version>${struts2Version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-convention-plugin</artifactId>
+ <version>${struts2Version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-sitemesh-plugin</artifactId>
+ <version>${struts2Version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.struts.xwork</groupId>
+ <artifactId>xwork-core</artifactId>
+ <version>${struts2Version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ </exclusion>
+
+ <!-- prevent java.lang.ClassCastException: cannot be cast to javassist.util.proxy.Proxy -->
+ <exclusion>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.shiro</groupId>
+ <artifactId>shiro-web</artifactId>
+ <version>${shiroVersion}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.2.4</version>
+ <scope>compile</scope>
+ </dependency>
+
</dependencies>
</dependencyManagement>
@@ -334,7 +480,14 @@
<plugin>
<groupId>org.nuiton.eugene</groupId>
<artifactId>eugene-maven-plugin</artifactId>
- <version>${eugenePluginVersion}</version>
+ <version>${eugeneVersion}</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.nuiton.topia</groupId>
+ <artifactId>topia-templates</artifactId>
+ <version>${topiaVersion}</version>
+ </dependency>
+ </dependencies>
</plugin>
<plugin>
1
0