private long _sportelloId;
private long _groupId;
private long _companyId;
- private long _userId;
- private String _userUuid;
- private String _userName;
private Date _createDate;
+ private long _createUserId;
+ private String _createUserUuid;
+ private String _createUserName;
private Date _modifiedDate;
+ private long _modifiedUserId;
+ private String _modifiedUserUuid;
+ private String _modifiedUserName;
+ private String _userName;
+ private String _originalUserName;
private String _email;
private long _comuneId;
private long _originalComuneId;
private boolean _setOriginalComuneId;
- private String _apiKey;
private boolean _attivo;
+ private String _password;
+ private Date _passwordModifiedDate;
+ private long _passwordModifiedUserId;
+ private String _passwordModifiedUserUuid;
+ private String _passwordModifiedUserName;
private long _columnBitmask;
private Sportello _escapedModel;
}
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/portlet/SueAdministrationPortlet.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/portlet/SueAdministrationPortlet.java
index ed19e566..eaa2f12d 100644
--- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/portlet/SueAdministrationPortlet.java
+++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/portlet/SueAdministrationPortlet.java
@@ -53,9 +53,10 @@ public class SueAdministrationPortlet extends MVCPortlet {
long sportelloId = ParamUtil.getLong(actionRequest, "sportelloId", 0);
long comuneId = ParamUtil.getLong(actionRequest, "comune", 0);
Territorio territorio = TerritorioLocalServiceUtil.findByComuneId(comuneId, 0, 1).get(0);
+ String userName = ParamUtil.getString(actionRequest, "userName");
String email = ParamUtil.getString(actionRequest, "email");
- String apiKey = ParamUtil.getString(actionRequest, "apiKey");
- _log.info("apiKey = " + apiKey);
+ String password = ParamUtil.getString(actionRequest, "password");
+ boolean attivo = ParamUtil.getBoolean(actionRequest, "attivo", false);
Sportello sportello = null;
if (sportelloId != 0) {
try {
@@ -70,13 +71,29 @@ public class SueAdministrationPortlet extends MVCPortlet {
sportello.setGroupId(territorio.getGroupId());
sportello.setCompanyId(territorio.getCompanyId());
sportello.setCreateDate(data);
+ sportello.setCreateUserId(user.getUserId());
+ sportello.setCreateUserName(user.getFullName());
}
- sportello.setUserId(user.getUserId());
- sportello.setUserName(user.getFullName());
+ sportello.setUserName(userName);
sportello.setModifiedDate(data);
+ sportello.setModifiedUserId(user.getUserId());
+ sportello.setModifiedUserName(user.getFullName());
sportello.setComuneId(comuneId);
sportello.setEmail(email);
- sportello.setApiKey(apiKey);
+ sportello.setAttivo(attivo);
+ if (Validator.isNotNull(password)) {
+ sportello.setEncryptedPassword(password, user);
+ }
+ SportelloLocalServiceUtil.updateSportello(sportello);
+ }
+
+ public void attivaSportello(ActionRequest actionRequest, ActionResponse actionResponse) throws PortalException,
+ SystemException {
+
+ long sportelloId = ParamUtil.get(actionRequest, "sportelloId", 0L);
+ boolean attivo = ParamUtil.get(actionRequest, "attivo", false);
+ Sportello sportello = SportelloLocalServiceUtil.getSportello(sportelloId);
+ sportello.setAttivo(attivo);
SportelloLocalServiceUtil.updateSportello(sportello);
}
diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloLocalServiceClpInvoker.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloLocalServiceClpInvoker.java
index 250f23c4..60188a09 100644
--- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloLocalServiceClpInvoker.java
+++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloLocalServiceClpInvoker.java
@@ -113,6 +113,10 @@ public class SportelloLocalServiceClpInvoker {
_methodName41 = "setBeanIdentifier";
_methodParameterTypes41 = new String[] { "java.lang.String" };
+
+ _methodName46 = "findByUserName";
+
+ _methodParameterTypes46 = new String[] { "java.lang.String" };
}
public Object invokeMethod(String name, String[] parameterTypes,
@@ -216,6 +220,11 @@ public class SportelloLocalServiceClpInvoker {
return null;
}
+ if (_methodName46.equals(name) &&
+ Arrays.deepEquals(_methodParameterTypes46, parameterTypes)) {
+ return SportelloLocalServiceUtil.findByUserName((java.lang.String)arguments[0]);
+ }
+
throw new UnsupportedOperationException();
}
@@ -255,4 +264,6 @@ public class SportelloLocalServiceClpInvoker {
private String[] _methodParameterTypes40;
private String _methodName41;
private String[] _methodParameterTypes41;
+ private String _methodName46;
+ private String[] _methodParameterTypes46;
}
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloServiceClpInvoker.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloServiceClpInvoker.java
index 4b49ae20..178a4ae3 100644
--- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloServiceClpInvoker.java
+++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloServiceClpInvoker.java
@@ -31,6 +31,10 @@ public class SportelloServiceClpInvoker {
_methodName25 = "setBeanIdentifier";
_methodParameterTypes25 = new String[] { "java.lang.String" };
+
+ _methodName30 = "generaPassword";
+
+ _methodParameterTypes30 = new String[] { "int" };
}
public Object invokeMethod(String name, String[] parameterTypes,
@@ -47,6 +51,11 @@ public class SportelloServiceClpInvoker {
return null;
}
+ if (_methodName30.equals(name) &&
+ Arrays.deepEquals(_methodParameterTypes30, parameterTypes)) {
+ return SportelloServiceUtil.generaPassword(((Integer)arguments[0]).intValue());
+ }
+
throw new UnsupportedOperationException();
}
@@ -54,4 +63,6 @@ public class SportelloServiceClpInvoker {
private String[] _methodParameterTypes24;
private String _methodName25;
private String[] _methodParameterTypes25;
+ private String _methodName30;
+ private String[] _methodParameterTypes30;
}
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/http/SportelloServiceSoap.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/http/SportelloServiceSoap.java
index adc3fec7..fcd7a131 100644
--- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/http/SportelloServiceSoap.java
+++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/http/SportelloServiceSoap.java
@@ -14,6 +14,13 @@
package it.mwg.sicilia.sue.service.http;
+import com.liferay.portal.kernel.log.Log;
+import com.liferay.portal.kernel.log.LogFactoryUtil;
+
+import it.mwg.sicilia.sue.service.SportelloServiceUtil;
+
+import java.rmi.RemoteException;
+
/**
* Provides the SOAP utility for the
* {@link it.mwg.sicilia.sue.service.SportelloServiceUtil} service utility. The
@@ -55,4 +62,19 @@ package it.mwg.sicilia.sue.service.http;
* @generated
*/
public class SportelloServiceSoap {
+ public static java.lang.String generaPassword(int lunghezza)
+ throws RemoteException {
+ try {
+ java.lang.String returnValue = SportelloServiceUtil.generaPassword(lunghezza);
+
+ return returnValue;
+ }
+ catch (Exception e) {
+ _log.error(e, e);
+
+ throw new RemoteException(e.getMessage());
+ }
+ }
+
+ private static Log _log = LogFactoryUtil.getLog(SportelloServiceSoap.class);
}
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/ApiSettingLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/ApiSettingLocalServiceImpl.java
index 44a98b5a..74f41c1a 100644
--- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/ApiSettingLocalServiceImpl.java
+++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/ApiSettingLocalServiceImpl.java
@@ -19,6 +19,8 @@ import it.mwg.sicilia.sue.service.base.ApiSettingLocalServiceBaseImpl;
import com.liferay.counter.service.CounterLocalServiceUtil;
import com.liferay.portal.kernel.exception.SystemException;
+import com.liferay.portal.kernel.log.Log;
+import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.Validator;
/**
@@ -42,6 +44,7 @@ public class ApiSettingLocalServiceImpl extends ApiSettingLocalServiceBaseImpl {
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* it.mwg.sicilia.sue.service.ApiSettingLocalServiceUtil} to access the api setting local service.
*/
+ private static final Log _log = LogFactoryUtil.getLog(ApiSettingLocalServiceImpl.class);
@Override
public String get(long companyId, long key) throws SystemException {
diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/SportelloLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/SportelloLocalServiceImpl.java
index 995af4d1..ccb02f69 100644
--- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/SportelloLocalServiceImpl.java
+++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/SportelloLocalServiceImpl.java
@@ -14,16 +14,22 @@
package it.mwg.sicilia.sue.service.impl;
+import it.mwg.sicilia.sue.NoSuchSportelloException;
+import it.mwg.sicilia.sue.model.Sportello;
import it.mwg.sicilia.sue.service.base.SportelloLocalServiceBaseImpl;
+import com.liferay.portal.kernel.exception.SystemException;
+
/**
* The implementation of the sportello local service.
*
*
- * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link it.mwg.sicilia.sue.service.SportelloLocalService} interface.
+ * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy
+ * their definitions into the {@link it.mwg.sicilia.sue.service.SportelloLocalService} interface.
*
*
- * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
+ * This is a local service. Methods of this service will not have security checks based on the propagated JAAS
+ * credentials because this service can only be accessed from within the same VM.
*
*
* @author Manifattura Web Group Srl
@@ -32,8 +38,13 @@ import it.mwg.sicilia.sue.service.base.SportelloLocalServiceBaseImpl;
*/
public class SportelloLocalServiceImpl extends SportelloLocalServiceBaseImpl {
/*
- * NOTE FOR DEVELOPERS:
- *
- * Never reference this interface directly. Always use {@link it.mwg.sicilia.sue.service.SportelloLocalServiceUtil} to access the sportello local service.
+ * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
+ * it.mwg.sicilia.sue.service.SportelloLocalServiceUtil} to access the sportello local service.
*/
+
+ @Override
+ public Sportello findByUserName(String userName) throws NoSuchSportelloException, SystemException {
+
+ return sportelloPersistence.findByUserName(userName);
+ }
}
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/SportelloServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/SportelloServiceImpl.java
index 7fa2d07a..5bb51a9d 100644
--- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/SportelloServiceImpl.java
+++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/SportelloServiceImpl.java
@@ -16,14 +16,18 @@ package it.mwg.sicilia.sue.service.impl;
import it.mwg.sicilia.sue.service.base.SportelloServiceBaseImpl;
+import java.security.SecureRandom;
+
/**
* The implementation of the sportello remote service.
*
*
- * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link it.mwg.sicilia.sue.service.SportelloService} interface.
+ * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy
+ * their definitions into the {@link it.mwg.sicilia.sue.service.SportelloService} interface.
*
*
- * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
+ * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS
+ * credentials because this service can be accessed remotely.
*
*
* @author Manifattura Web Group Srl
@@ -32,8 +36,37 @@ import it.mwg.sicilia.sue.service.base.SportelloServiceBaseImpl;
*/
public class SportelloServiceImpl extends SportelloServiceBaseImpl {
/*
- * NOTE FOR DEVELOPERS:
- *
- * Never reference this interface directly. Always use {@link it.mwg.sicilia.sue.service.SportelloServiceUtil} to access the sportello remote service.
+ * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
+ * it.mwg.sicilia.sue.service.SportelloServiceUtil} to access the sportello remote service.
*/
+
+ private static final char[] consonanti = { 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'r', 's',
+ 't', 'v', 'w', 'x', 'y', 'z' };
+ private static final char[] vocali = { 'a', 'e', 'i', 'o', 'u' };
+ private static final char[] speciali = { '!', '@', '#', '$', '%', '^', '*', '&', '*', '-', '+', '?' };
+
+ @Override
+ public String generaPassword(int lunghezza) {
+
+ if (lunghezza < 8) {
+ lunghezza = 8;
+ } else if (1 == lunghezza % 2) {
+ lunghezza++;
+ }
+ int max = (lunghezza - 4) / 2;
+ StringBuilder password = new StringBuilder();
+ SecureRandom rnd = new SecureRandom();
+ if (rnd.nextInt(2) == 1) {
+ password.append(consonanti[rnd.nextInt(consonanti.length)]);
+ } else {
+ password.append(Character.toUpperCase(consonanti[rnd.nextInt(consonanti.length)]));
+ }
+ for (int i = 0; i < max; i++) {
+ password.append(vocali[rnd.nextInt(vocali.length)]);
+ password.append(consonanti[rnd.nextInt(consonanti.length)]);
+ }
+ password.append(speciali[rnd.nextInt(speciali.length)]);
+ password.append(rnd.nextInt(90) + 10);
+ return password.toString();
+ }
}
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/persistence/SportelloPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/persistence/SportelloPersistenceImpl.java
index bf65e96e..5d8bbd46 100644
--- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/persistence/SportelloPersistenceImpl.java
+++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/persistence/SportelloPersistenceImpl.java
@@ -30,10 +30,12 @@ import com.liferay.portal.kernel.util.InstanceFactory;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.PropsKeys;
import com.liferay.portal.kernel.util.PropsUtil;
+import com.liferay.portal.kernel.util.SetUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.UnmodifiableList;
+import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.CacheModel;
import com.liferay.portal.model.ModelListener;
import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
@@ -49,6 +51,7 @@ import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.Set;
/**
* The persistence implementation for the sportello service.
@@ -293,6 +296,247 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl
}
private static final String _FINDER_COLUMN_COMUNEID_COMUNEID_2 = "sportello.comuneId = ?";
+ public static final FinderPath FINDER_PATH_FETCH_BY_USERNAME = new FinderPath(SportelloModelImpl.ENTITY_CACHE_ENABLED,
+ SportelloModelImpl.FINDER_CACHE_ENABLED, SportelloImpl.class,
+ FINDER_CLASS_NAME_ENTITY, "fetchByUserName",
+ new String[] { String.class.getName() },
+ SportelloModelImpl.USERNAME_COLUMN_BITMASK);
+ public static final FinderPath FINDER_PATH_COUNT_BY_USERNAME = new FinderPath(SportelloModelImpl.ENTITY_CACHE_ENABLED,
+ SportelloModelImpl.FINDER_CACHE_ENABLED, Long.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByUserName",
+ new String[] { String.class.getName() });
+
+ /**
+ * Returns the sportello where userName = ? or throws a {@link it.mwg.sicilia.sue.NoSuchSportelloException} if it could not be found.
+ *
+ * @param userName the user name
+ * @return the matching sportello
+ * @throws it.mwg.sicilia.sue.NoSuchSportelloException if a matching sportello could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public Sportello findByUserName(String userName)
+ throws NoSuchSportelloException, SystemException {
+ Sportello sportello = fetchByUserName(userName);
+
+ if (sportello == null) {
+ StringBundler msg = new StringBundler(4);
+
+ msg.append(_NO_SUCH_ENTITY_WITH_KEY);
+
+ msg.append("userName=");
+ msg.append(userName);
+
+ msg.append(StringPool.CLOSE_CURLY_BRACE);
+
+ if (_log.isWarnEnabled()) {
+ _log.warn(msg.toString());
+ }
+
+ throw new NoSuchSportelloException(msg.toString());
+ }
+
+ return sportello;
+ }
+
+ /**
+ * Returns the sportello where userName = ? or returns null
if it could not be found. Uses the finder cache.
+ *
+ * @param userName the user name
+ * @return the matching sportello, or null
if a matching sportello could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public Sportello fetchByUserName(String userName) throws SystemException {
+ return fetchByUserName(userName, true);
+ }
+
+ /**
+ * Returns the sportello where userName = ? or returns null
if it could not be found, optionally using the finder cache.
+ *
+ * @param userName the user name
+ * @param retrieveFromCache whether to use the finder cache
+ * @return the matching sportello, or null
if a matching sportello could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public Sportello fetchByUserName(String userName, boolean retrieveFromCache)
+ throws SystemException {
+ Object[] finderArgs = new Object[] { userName };
+
+ Object result = null;
+
+ if (retrieveFromCache) {
+ result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_USERNAME,
+ finderArgs, this);
+ }
+
+ if (result instanceof Sportello) {
+ Sportello sportello = (Sportello)result;
+
+ if (!Validator.equals(userName, sportello.getUserName())) {
+ result = null;
+ }
+ }
+
+ if (result == null) {
+ StringBundler query = new StringBundler(3);
+
+ query.append(_SQL_SELECT_SPORTELLO_WHERE);
+
+ boolean bindUserName = false;
+
+ if (userName == null) {
+ query.append(_FINDER_COLUMN_USERNAME_USERNAME_1);
+ }
+ else if (userName.equals(StringPool.BLANK)) {
+ query.append(_FINDER_COLUMN_USERNAME_USERNAME_3);
+ }
+ else {
+ bindUserName = true;
+
+ query.append(_FINDER_COLUMN_USERNAME_USERNAME_2);
+ }
+
+ String sql = query.toString();
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(sql);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ if (bindUserName) {
+ qPos.add(userName);
+ }
+
+ List list = q.list();
+
+ if (list.isEmpty()) {
+ FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_USERNAME,
+ finderArgs, list);
+ }
+ else {
+ Sportello sportello = list.get(0);
+
+ result = sportello;
+
+ cacheResult(sportello);
+
+ if ((sportello.getUserName() == null) ||
+ !sportello.getUserName().equals(userName)) {
+ FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_USERNAME,
+ finderArgs, sportello);
+ }
+ }
+ }
+ catch (Exception e) {
+ FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_USERNAME,
+ finderArgs);
+
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ if (result instanceof List>) {
+ return null;
+ }
+ else {
+ return (Sportello)result;
+ }
+ }
+
+ /**
+ * Removes the sportello where userName = ? from the database.
+ *
+ * @param userName the user name
+ * @return the sportello that was removed
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public Sportello removeByUserName(String userName)
+ throws NoSuchSportelloException, SystemException {
+ Sportello sportello = findByUserName(userName);
+
+ return remove(sportello);
+ }
+
+ /**
+ * Returns the number of sportellos where userName = ?.
+ *
+ * @param userName the user name
+ * @return the number of matching sportellos
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public int countByUserName(String userName) throws SystemException {
+ FinderPath finderPath = FINDER_PATH_COUNT_BY_USERNAME;
+
+ Object[] finderArgs = new Object[] { userName };
+
+ Long count = (Long)FinderCacheUtil.getResult(finderPath, finderArgs,
+ this);
+
+ if (count == null) {
+ StringBundler query = new StringBundler(2);
+
+ query.append(_SQL_COUNT_SPORTELLO_WHERE);
+
+ boolean bindUserName = false;
+
+ if (userName == null) {
+ query.append(_FINDER_COLUMN_USERNAME_USERNAME_1);
+ }
+ else if (userName.equals(StringPool.BLANK)) {
+ query.append(_FINDER_COLUMN_USERNAME_USERNAME_3);
+ }
+ else {
+ bindUserName = true;
+
+ query.append(_FINDER_COLUMN_USERNAME_USERNAME_2);
+ }
+
+ String sql = query.toString();
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(sql);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ if (bindUserName) {
+ qPos.add(userName);
+ }
+
+ count = (Long)q.uniqueResult();
+
+ FinderCacheUtil.putResult(finderPath, finderArgs, count);
+ }
+ catch (Exception e) {
+ FinderCacheUtil.removeResult(finderPath, finderArgs);
+
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ return count.intValue();
+ }
+
+ private static final String _FINDER_COLUMN_USERNAME_USERNAME_1 = "sportello.userName IS NULL";
+ private static final String _FINDER_COLUMN_USERNAME_USERNAME_2 = "sportello.userName = ?";
+ private static final String _FINDER_COLUMN_USERNAME_USERNAME_3 = "(sportello.userName IS NULL OR sportello.userName = '')";
public SportelloPersistenceImpl() {
setModelClass(Sportello.class);
@@ -311,6 +555,9 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl
FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COMUNEID,
new Object[] { sportello.getComuneId() }, sportello);
+ FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_USERNAME,
+ new Object[] { sportello.getUserName() }, sportello);
+
sportello.resetOriginalValues();
}
@@ -392,6 +639,13 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl
Long.valueOf(1));
FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COMUNEID, args,
sportello);
+
+ args = new Object[] { sportello.getUserName() };
+
+ FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_USERNAME, args,
+ Long.valueOf(1));
+ FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_USERNAME, args,
+ sportello);
}
else {
SportelloModelImpl sportelloModelImpl = (SportelloModelImpl)sportello;
@@ -405,6 +659,16 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl
FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COMUNEID, args,
sportello);
}
+
+ if ((sportelloModelImpl.getColumnBitmask() &
+ FINDER_PATH_FETCH_BY_USERNAME.getColumnBitmask()) != 0) {
+ Object[] args = new Object[] { sportello.getUserName() };
+
+ FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_USERNAME, args,
+ Long.valueOf(1));
+ FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_USERNAME, args,
+ sportello);
+ }
}
}
@@ -423,6 +687,19 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_COMUNEID, args);
FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_COMUNEID, args);
}
+
+ args = new Object[] { sportello.getUserName() };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_USERNAME, args);
+ FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_USERNAME, args);
+
+ if ((sportelloModelImpl.getColumnBitmask() &
+ FINDER_PATH_FETCH_BY_USERNAME.getColumnBitmask()) != 0) {
+ args = new Object[] { sportelloModelImpl.getOriginalUserName() };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_USERNAME, args);
+ FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_USERNAME, args);
+ }
}
/**
@@ -585,14 +862,20 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl
sportelloImpl.setSportelloId(sportello.getSportelloId());
sportelloImpl.setGroupId(sportello.getGroupId());
sportelloImpl.setCompanyId(sportello.getCompanyId());
- sportelloImpl.setUserId(sportello.getUserId());
- sportelloImpl.setUserName(sportello.getUserName());
sportelloImpl.setCreateDate(sportello.getCreateDate());
+ sportelloImpl.setCreateUserId(sportello.getCreateUserId());
+ sportelloImpl.setCreateUserName(sportello.getCreateUserName());
sportelloImpl.setModifiedDate(sportello.getModifiedDate());
+ sportelloImpl.setModifiedUserId(sportello.getModifiedUserId());
+ sportelloImpl.setModifiedUserName(sportello.getModifiedUserName());
+ sportelloImpl.setUserName(sportello.getUserName());
sportelloImpl.setEmail(sportello.getEmail());
sportelloImpl.setComuneId(sportello.getComuneId());
- sportelloImpl.setApiKey(sportello.getApiKey());
sportelloImpl.setAttivo(sportello.isAttivo());
+ sportelloImpl.setPassword(sportello.getPassword());
+ sportelloImpl.setPasswordModifiedDate(sportello.getPasswordModifiedDate());
+ sportelloImpl.setPasswordModifiedUserId(sportello.getPasswordModifiedUserId());
+ sportelloImpl.setPasswordModifiedUserName(sportello.getPasswordModifiedUserName());
return sportelloImpl;
}
@@ -870,6 +1153,11 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl
return count.intValue();
}
+ @Override
+ protected Set getBadColumnNames() {
+ return _badColumnNames;
+ }
+
/**
* Initializes the sportello persistence.
*/
@@ -912,6 +1200,9 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl
private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = GetterUtil.getBoolean(PropsUtil.get(
PropsKeys.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE));
private static Log _log = LogFactoryUtil.getLog(SportelloPersistenceImpl.class);
+ private static Set _badColumnNames = SetUtil.fromArray(new String[] {
+ "password"
+ });
private static Sportello _nullSportello = new SportelloImpl() {
@Override
public Object clone() {
diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/startup/Startup.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/startup/Startup.java
index ffbb0da3..cae82332 100644
--- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/startup/Startup.java
+++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/startup/Startup.java
@@ -59,7 +59,7 @@ public class Startup extends SimpleAction {
} catch (NoSuchAlgorithmException e) {
}
if (Validator.isNotNull(generator)) {
- generator.initialize(1024);
+ generator.initialize(4096);
KeyPair pair = generator.generateKeyPair();
try {
ApiSettingLocalServiceUtil.set(companyId, ApiConstants.API_PRIVATE_KEY,
diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/service.properties
index a9d58c54..c22d2279 100644
--- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/service.properties
+++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/service.properties
@@ -13,8 +13,8 @@
##
build.namespace=sicilia_sue
- build.number=41
- build.date=1623664988040
+ build.number=61
+ build.date=1623771128700
build.auto.upgrade=true
##
diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/administration/edit_sportello.jsp b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/administration/edit_sportello.jsp
index bdc5727b..49d0d3b9 100644
--- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/administration/edit_sportello.jsp
+++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/administration/edit_sportello.jsp
@@ -1,8 +1,8 @@
+<%@page import="it.mwg.sicilia.sue.service.SportelloServiceUtil"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.util.ParamUtil"%>
<%@page import="com.liferay.portal.kernel.util.StringPool"%>
<%@page import="com.liferay.portal.kernel.util.Validator"%>
-<%@page import="it.mwg.sicilia.sue.api.v1.ApiUtil"%>
<%@page import="it.mwg.sicilia.sue.model.Sportello"%>
<%@page import="it.mwg.sicilia.sue.portlet.SueAdministrationPortlet"%>
<%@page import="it.mwg.sicilia.sue.service.SportelloLocalServiceUtil"%>
@@ -15,26 +15,43 @@ Sportello sportello = sportelloId == 0 ? null : SportelloLocalServiceUtil.getSpo
-
-
-
+
+
+
+
-
-
+
+
+
+
-
+
+
-
+
+A.one('#generate').on('click', function(event) {
+ Liferay.Service(
+ '/sicilia-sue-connector-portlet.sportello/genera-password',
+ {
+ lunghezza: 12,
+ },
+ function(obj) {
+ A.one('#password').set('value', obj);
+ }
+ );
+});
A.mix(
A.config.FormValidator.RULES, {
requiredSelect: function(value, fieldNode, ruleValue) {
diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/administration/view.jsp b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/administration/view.jsp
index 66a03fb0..f66b0005 100644
--- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/administration/view.jsp
+++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/administration/view.jsp
@@ -1,8 +1,9 @@
-<%@page import="java.text.NumberFormat"%>
+<%@page import="com.liferay.portal.kernel.util.Constants"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%>
+<%@page import="java.text.NumberFormat"%>
<%@page import="it.mwg.sicilia.sue.model.Sportello"%>
<%@page import="it.mwg.sicilia.sue.service.SportelloLocalServiceUtil"%>
-<%@page import="java.util.List"%>
<%@include file="/html/init.jsp"%>
@@ -19,12 +20,15 @@
searchContainer.getEnd()) %>" />
<%
NumberFormat format = NumberFormat.getInstance();
+ String redirect = searchContainer.getIteratorURL().toString();
%>
+
-
+
@@ -33,7 +37,20 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+