diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/lib/sicilia-sue-connector-portlet-service.jar b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/lib/sicilia-sue-connector-portlet-service.jar index e1968be5..1f0d9a1b 100644 Binary files a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/lib/sicilia-sue-connector-portlet-service.jar and b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/lib/sicilia-sue-connector-portlet-service.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service.xml b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service.xml index 393d2f60..daa57a57 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service.xml +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service.xml @@ -10,20 +10,30 @@ - - + + + + + - + + + + + + + + @@ -35,4 +45,9 @@ + + ExpiredToken + InactiveSportello + InvalidToken + \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/ExpiredTokenException.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/ExpiredTokenException.java new file mode 100644 index 00000000..934acce0 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/ExpiredTokenException.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) + * any later version. + * + * This library 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 Lesser General Public License for more + * details. + */ + +package it.mwg.sicilia.sue; + +import com.liferay.portal.kernel.exception.PortalException; + +/** + * @author Manifattura Web Group Srl + */ +public class ExpiredTokenException extends PortalException { + + public ExpiredTokenException() { + super(); + } + + public ExpiredTokenException(String msg) { + super(msg); + } + + public ExpiredTokenException(String msg, Throwable cause) { + super(msg, cause); + } + + public ExpiredTokenException(Throwable cause) { + super(cause); + } + +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/InactiveSportelloException.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/InactiveSportelloException.java new file mode 100644 index 00000000..ce3a97c0 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/InactiveSportelloException.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) + * any later version. + * + * This library 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 Lesser General Public License for more + * details. + */ + +package it.mwg.sicilia.sue; + +import com.liferay.portal.kernel.exception.PortalException; + +/** + * @author Manifattura Web Group Srl + */ +public class InactiveSportelloException extends PortalException { + + public InactiveSportelloException() { + super(); + } + + public InactiveSportelloException(String msg) { + super(msg); + } + + public InactiveSportelloException(String msg, Throwable cause) { + super(msg, cause); + } + + public InactiveSportelloException(Throwable cause) { + super(cause); + } + +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/InvalidTokenException.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/InvalidTokenException.java new file mode 100644 index 00000000..5bc738f3 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/InvalidTokenException.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) + * any later version. + * + * This library 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 Lesser General Public License for more + * details. + */ + +package it.mwg.sicilia.sue; + +import com.liferay.portal.kernel.exception.PortalException; + +/** + * @author Manifattura Web Group Srl + */ +public class InvalidTokenException extends PortalException { + + public InvalidTokenException() { + super(); + } + + public InvalidTokenException(String msg) { + super(msg); + } + + public InvalidTokenException(String msg, Throwable cause) { + super(msg, cause); + } + + public InvalidTokenException(Throwable cause) { + super(cause); + } + +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/Sportello.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/Sportello.java index 898c8f84..36771fc1 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/Sportello.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/Sportello.java @@ -31,6 +31,13 @@ public interface Sportello extends SportelloModel, PersistedModel { * * Never modify this interface directly. Add methods to {@link it.mwg.sicilia.sue.model.impl.SportelloImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. */ + public java.lang.String encryptPassword(java.lang.String password); + + public boolean checkPassword(java.lang.String password); + + public void setEncryptedPassword(java.lang.String password, + com.liferay.portal.model.User user); + public java.lang.String getCodiceProvincia() throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException; diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloClp.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloClp.java index 597e5b92..ba601ab2 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloClp.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloClp.java @@ -77,14 +77,20 @@ public class SportelloClp extends BaseModelImpl implements Sportello attributes.put("sportelloId", getSportelloId()); attributes.put("groupId", getGroupId()); attributes.put("companyId", getCompanyId()); - attributes.put("userId", getUserId()); - attributes.put("userName", getUserName()); attributes.put("createDate", getCreateDate()); + attributes.put("createUserId", getCreateUserId()); + attributes.put("createUserName", getCreateUserName()); attributes.put("modifiedDate", getModifiedDate()); + attributes.put("modifiedUserId", getModifiedUserId()); + attributes.put("modifiedUserName", getModifiedUserName()); + attributes.put("userName", getUserName()); attributes.put("email", getEmail()); attributes.put("comuneId", getComuneId()); - attributes.put("apiKey", getApiKey()); attributes.put("attivo", getAttivo()); + attributes.put("password", getPassword()); + attributes.put("passwordModifiedDate", getPasswordModifiedDate()); + attributes.put("passwordModifiedUserId", getPasswordModifiedUserId()); + attributes.put("passwordModifiedUserName", getPasswordModifiedUserName()); return attributes; } @@ -109,22 +115,22 @@ public class SportelloClp extends BaseModelImpl implements Sportello setCompanyId(companyId); } - Long userId = (Long)attributes.get("userId"); + Date createDate = (Date)attributes.get("createDate"); - if (userId != null) { - setUserId(userId); + if (createDate != null) { + setCreateDate(createDate); } - String userName = (String)attributes.get("userName"); + Long createUserId = (Long)attributes.get("createUserId"); - if (userName != null) { - setUserName(userName); + if (createUserId != null) { + setCreateUserId(createUserId); } - Date createDate = (Date)attributes.get("createDate"); + String createUserName = (String)attributes.get("createUserName"); - if (createDate != null) { - setCreateDate(createDate); + if (createUserName != null) { + setCreateUserName(createUserName); } Date modifiedDate = (Date)attributes.get("modifiedDate"); @@ -133,6 +139,24 @@ public class SportelloClp extends BaseModelImpl implements Sportello setModifiedDate(modifiedDate); } + Long modifiedUserId = (Long)attributes.get("modifiedUserId"); + + if (modifiedUserId != null) { + setModifiedUserId(modifiedUserId); + } + + String modifiedUserName = (String)attributes.get("modifiedUserName"); + + if (modifiedUserName != null) { + setModifiedUserName(modifiedUserName); + } + + String userName = (String)attributes.get("userName"); + + if (userName != null) { + setUserName(userName); + } + String email = (String)attributes.get("email"); if (email != null) { @@ -145,17 +169,37 @@ public class SportelloClp extends BaseModelImpl implements Sportello setComuneId(comuneId); } - String apiKey = (String)attributes.get("apiKey"); - - if (apiKey != null) { - setApiKey(apiKey); - } - Boolean attivo = (Boolean)attributes.get("attivo"); if (attivo != null) { setAttivo(attivo); } + + String password = (String)attributes.get("password"); + + if (password != null) { + setPassword(password); + } + + Date passwordModifiedDate = (Date)attributes.get("passwordModifiedDate"); + + if (passwordModifiedDate != null) { + setPasswordModifiedDate(passwordModifiedDate); + } + + Long passwordModifiedUserId = (Long)attributes.get( + "passwordModifiedUserId"); + + if (passwordModifiedUserId != null) { + setPasswordModifiedUserId(passwordModifiedUserId); + } + + String passwordModifiedUserName = (String)attributes.get( + "passwordModifiedUserName"); + + if (passwordModifiedUserName != null) { + setPasswordModifiedUserName(passwordModifiedUserName); + } } @Override @@ -228,21 +272,21 @@ public class SportelloClp extends BaseModelImpl implements Sportello } @Override - public long getUserId() { - return _userId; + public Date getCreateDate() { + return _createDate; } @Override - public void setUserId(long userId) { - _userId = userId; + public void setCreateDate(Date createDate) { + _createDate = createDate; if (_sportelloRemoteModel != null) { try { Class clazz = _sportelloRemoteModel.getClass(); - Method method = clazz.getMethod("setUserId", long.class); + Method method = clazz.getMethod("setCreateDate", Date.class); - method.invoke(_sportelloRemoteModel, userId); + method.invoke(_sportelloRemoteModel, createDate); } catch (Exception e) { throw new UnsupportedOperationException(e); @@ -251,31 +295,21 @@ public class SportelloClp extends BaseModelImpl implements Sportello } @Override - public String getUserUuid() throws SystemException { - return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid); - } - - @Override - public void setUserUuid(String userUuid) { - _userUuid = userUuid; - } - - @Override - public String getUserName() { - return _userName; + public long getCreateUserId() { + return _createUserId; } @Override - public void setUserName(String userName) { - _userName = userName; + public void setCreateUserId(long createUserId) { + _createUserId = createUserId; if (_sportelloRemoteModel != null) { try { Class clazz = _sportelloRemoteModel.getClass(); - Method method = clazz.getMethod("setUserName", String.class); + Method method = clazz.getMethod("setCreateUserId", long.class); - method.invoke(_sportelloRemoteModel, userName); + method.invoke(_sportelloRemoteModel, createUserId); } catch (Exception e) { throw new UnsupportedOperationException(e); @@ -284,21 +318,33 @@ public class SportelloClp extends BaseModelImpl implements Sportello } @Override - public Date getCreateDate() { - return _createDate; + public String getCreateUserUuid() throws SystemException { + return PortalUtil.getUserValue(getCreateUserId(), "uuid", + _createUserUuid); } @Override - public void setCreateDate(Date createDate) { - _createDate = createDate; + public void setCreateUserUuid(String createUserUuid) { + _createUserUuid = createUserUuid; + } + + @Override + public String getCreateUserName() { + return _createUserName; + } + + @Override + public void setCreateUserName(String createUserName) { + _createUserName = createUserName; if (_sportelloRemoteModel != null) { try { Class clazz = _sportelloRemoteModel.getClass(); - Method method = clazz.getMethod("setCreateDate", Date.class); + Method method = clazz.getMethod("setCreateUserName", + String.class); - method.invoke(_sportelloRemoteModel, createDate); + method.invoke(_sportelloRemoteModel, createUserName); } catch (Exception e) { throw new UnsupportedOperationException(e); @@ -329,6 +375,87 @@ public class SportelloClp extends BaseModelImpl implements Sportello } } + @Override + public long getModifiedUserId() { + return _modifiedUserId; + } + + @Override + public void setModifiedUserId(long modifiedUserId) { + _modifiedUserId = modifiedUserId; + + if (_sportelloRemoteModel != null) { + try { + Class clazz = _sportelloRemoteModel.getClass(); + + Method method = clazz.getMethod("setModifiedUserId", long.class); + + method.invoke(_sportelloRemoteModel, modifiedUserId); + } + catch (Exception e) { + throw new UnsupportedOperationException(e); + } + } + } + + @Override + public String getModifiedUserUuid() throws SystemException { + return PortalUtil.getUserValue(getModifiedUserId(), "uuid", + _modifiedUserUuid); + } + + @Override + public void setModifiedUserUuid(String modifiedUserUuid) { + _modifiedUserUuid = modifiedUserUuid; + } + + @Override + public String getModifiedUserName() { + return _modifiedUserName; + } + + @Override + public void setModifiedUserName(String modifiedUserName) { + _modifiedUserName = modifiedUserName; + + if (_sportelloRemoteModel != null) { + try { + Class clazz = _sportelloRemoteModel.getClass(); + + Method method = clazz.getMethod("setModifiedUserName", + String.class); + + method.invoke(_sportelloRemoteModel, modifiedUserName); + } + catch (Exception e) { + throw new UnsupportedOperationException(e); + } + } + } + + @Override + public String getUserName() { + return _userName; + } + + @Override + public void setUserName(String userName) { + _userName = userName; + + if (_sportelloRemoteModel != null) { + try { + Class clazz = _sportelloRemoteModel.getClass(); + + Method method = clazz.getMethod("setUserName", String.class); + + method.invoke(_sportelloRemoteModel, userName); + } + catch (Exception e) { + throw new UnsupportedOperationException(e); + } + } + } + @Override public String getEmail() { return _email; @@ -376,21 +503,49 @@ public class SportelloClp extends BaseModelImpl implements Sportello } @Override - public String getApiKey() { - return _apiKey; + public boolean getAttivo() { + return _attivo; + } + + @Override + public boolean isAttivo() { + return _attivo; + } + + @Override + public void setAttivo(boolean attivo) { + _attivo = attivo; + + if (_sportelloRemoteModel != null) { + try { + Class clazz = _sportelloRemoteModel.getClass(); + + Method method = clazz.getMethod("setAttivo", boolean.class); + + method.invoke(_sportelloRemoteModel, attivo); + } + catch (Exception e) { + throw new UnsupportedOperationException(e); + } + } + } + + @Override + public String getPassword() { + return _password; } @Override - public void setApiKey(String apiKey) { - _apiKey = apiKey; + public void setPassword(String password) { + _password = password; if (_sportelloRemoteModel != null) { try { Class clazz = _sportelloRemoteModel.getClass(); - Method method = clazz.getMethod("setApiKey", String.class); + Method method = clazz.getMethod("setPassword", String.class); - method.invoke(_sportelloRemoteModel, apiKey); + method.invoke(_sportelloRemoteModel, password); } catch (Exception e) { throw new UnsupportedOperationException(e); @@ -399,26 +554,81 @@ public class SportelloClp extends BaseModelImpl implements Sportello } @Override - public boolean getAttivo() { - return _attivo; + public Date getPasswordModifiedDate() { + return _passwordModifiedDate; } @Override - public boolean isAttivo() { - return _attivo; + public void setPasswordModifiedDate(Date passwordModifiedDate) { + _passwordModifiedDate = passwordModifiedDate; + + if (_sportelloRemoteModel != null) { + try { + Class clazz = _sportelloRemoteModel.getClass(); + + Method method = clazz.getMethod("setPasswordModifiedDate", + Date.class); + + method.invoke(_sportelloRemoteModel, passwordModifiedDate); + } + catch (Exception e) { + throw new UnsupportedOperationException(e); + } + } } @Override - public void setAttivo(boolean attivo) { - _attivo = attivo; + public long getPasswordModifiedUserId() { + return _passwordModifiedUserId; + } + + @Override + public void setPasswordModifiedUserId(long passwordModifiedUserId) { + _passwordModifiedUserId = passwordModifiedUserId; if (_sportelloRemoteModel != null) { try { Class clazz = _sportelloRemoteModel.getClass(); - Method method = clazz.getMethod("setAttivo", boolean.class); + Method method = clazz.getMethod("setPasswordModifiedUserId", + long.class); - method.invoke(_sportelloRemoteModel, attivo); + method.invoke(_sportelloRemoteModel, passwordModifiedUserId); + } + catch (Exception e) { + throw new UnsupportedOperationException(e); + } + } + } + + @Override + public String getPasswordModifiedUserUuid() throws SystemException { + return PortalUtil.getUserValue(getPasswordModifiedUserId(), "uuid", + _passwordModifiedUserUuid); + } + + @Override + public void setPasswordModifiedUserUuid(String passwordModifiedUserUuid) { + _passwordModifiedUserUuid = passwordModifiedUserUuid; + } + + @Override + public String getPasswordModifiedUserName() { + return _passwordModifiedUserName; + } + + @Override + public void setPasswordModifiedUserName(String passwordModifiedUserName) { + _passwordModifiedUserName = passwordModifiedUserName; + + if (_sportelloRemoteModel != null) { + try { + Class clazz = _sportelloRemoteModel.getClass(); + + Method method = clazz.getMethod("setPasswordModifiedUserName", + String.class); + + method.invoke(_sportelloRemoteModel, passwordModifiedUserName); } catch (Exception e) { throw new UnsupportedOperationException(e); @@ -426,6 +636,25 @@ public class SportelloClp extends BaseModelImpl implements Sportello } } + @Override + public java.lang.String encryptPassword(java.lang.String password) { + try { + String methodName = "encryptPassword"; + + Class[] parameterTypes = new Class[] { java.lang.String.class }; + + Object[] parameterValues = new Object[] { password }; + + java.lang.String returnObj = (java.lang.String)invokeOnRemoteModel(methodName, + parameterTypes, parameterValues); + + return returnObj; + } + catch (Exception e) { + throw new UnsupportedOperationException(e); + } + } + @Override public java.lang.String getNomeComune() { try { @@ -483,6 +712,44 @@ public class SportelloClp extends BaseModelImpl implements Sportello } } + @Override + public boolean checkPassword(java.lang.String password) { + try { + String methodName = "checkPassword"; + + Class[] parameterTypes = new Class[] { java.lang.String.class }; + + Object[] parameterValues = new Object[] { password }; + + Boolean returnObj = (Boolean)invokeOnRemoteModel(methodName, + parameterTypes, parameterValues); + + return returnObj; + } + catch (Exception e) { + throw new UnsupportedOperationException(e); + } + } + + @Override + public void setEncryptedPassword(java.lang.String password, + com.liferay.portal.model.User user) { + try { + String methodName = "setEncryptedPassword"; + + Class[] parameterTypes = new Class[] { + java.lang.String.class, com.liferay.portal.model.User.class + }; + + Object[] parameterValues = new Object[] { password, user }; + + invokeOnRemoteModel(methodName, parameterTypes, parameterValues); + } + catch (Exception e) { + throw new UnsupportedOperationException(e); + } + } + public BaseModel getSportelloRemoteModel() { return _sportelloRemoteModel; } @@ -555,14 +822,20 @@ public class SportelloClp extends BaseModelImpl implements Sportello clone.setSportelloId(getSportelloId()); clone.setGroupId(getGroupId()); clone.setCompanyId(getCompanyId()); - clone.setUserId(getUserId()); - clone.setUserName(getUserName()); clone.setCreateDate(getCreateDate()); + clone.setCreateUserId(getCreateUserId()); + clone.setCreateUserName(getCreateUserName()); clone.setModifiedDate(getModifiedDate()); + clone.setModifiedUserId(getModifiedUserId()); + clone.setModifiedUserName(getModifiedUserName()); + clone.setUserName(getUserName()); clone.setEmail(getEmail()); clone.setComuneId(getComuneId()); - clone.setApiKey(getApiKey()); clone.setAttivo(getAttivo()); + clone.setPassword(getPassword()); + clone.setPasswordModifiedDate(getPasswordModifiedDate()); + clone.setPasswordModifiedUserId(getPasswordModifiedUserId()); + clone.setPasswordModifiedUserName(getPasswordModifiedUserName()); return clone; } @@ -615,7 +888,7 @@ public class SportelloClp extends BaseModelImpl implements Sportello @Override public String toString() { - StringBundler sb = new StringBundler(23); + StringBundler sb = new StringBundler(35); sb.append("{sportelloId="); sb.append(getSportelloId()); @@ -623,22 +896,34 @@ public class SportelloClp extends BaseModelImpl implements Sportello sb.append(getGroupId()); sb.append(", companyId="); sb.append(getCompanyId()); - sb.append(", userId="); - sb.append(getUserId()); - sb.append(", userName="); - sb.append(getUserName()); sb.append(", createDate="); sb.append(getCreateDate()); + sb.append(", createUserId="); + sb.append(getCreateUserId()); + sb.append(", createUserName="); + sb.append(getCreateUserName()); sb.append(", modifiedDate="); sb.append(getModifiedDate()); + sb.append(", modifiedUserId="); + sb.append(getModifiedUserId()); + sb.append(", modifiedUserName="); + sb.append(getModifiedUserName()); + sb.append(", userName="); + sb.append(getUserName()); sb.append(", email="); sb.append(getEmail()); sb.append(", comuneId="); sb.append(getComuneId()); - sb.append(", apiKey="); - sb.append(getApiKey()); sb.append(", attivo="); sb.append(getAttivo()); + sb.append(", password="); + sb.append(getPassword()); + sb.append(", passwordModifiedDate="); + sb.append(getPasswordModifiedDate()); + sb.append(", passwordModifiedUserId="); + sb.append(getPasswordModifiedUserId()); + sb.append(", passwordModifiedUserName="); + sb.append(getPasswordModifiedUserName()); sb.append("}"); return sb.toString(); @@ -646,7 +931,7 @@ public class SportelloClp extends BaseModelImpl implements Sportello @Override public String toXmlString() { - StringBundler sb = new StringBundler(37); + StringBundler sb = new StringBundler(55); sb.append(""); sb.append("it.mwg.sicilia.sue.model.Sportello"); @@ -665,21 +950,33 @@ public class SportelloClp extends BaseModelImpl implements Sportello sb.append(getCompanyId()); sb.append("]]>"); sb.append( - "userIdcreateDate"); sb.append( - "userNamecreateUserId"); sb.append( - "createDatecreateUserName"); sb.append( "modifiedDate"); + sb.append( + "modifiedUserId"); + sb.append( + "modifiedUserName"); + sb.append( + "userName"); sb.append( "email implements Sportello "comuneId"); - sb.append( - "apiKey"); sb.append( "attivo"); + sb.append( + "password"); + sb.append( + "passwordModifiedDate"); + sb.append( + "passwordModifiedUserId"); + sb.append( + "passwordModifiedUserName"); sb.append(""); @@ -705,15 +1014,23 @@ public class SportelloClp extends BaseModelImpl implements Sportello 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 _email; private long _comuneId; - private String _apiKey; private boolean _attivo; + private String _password; + private Date _passwordModifiedDate; + private long _passwordModifiedUserId; + private String _passwordModifiedUserUuid; + private String _passwordModifiedUserName; private BaseModel _sportelloRemoteModel; private Class _clpSerializerClass = it.mwg.sicilia.sue.service.ClpSerializer.class; } \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloModel.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloModel.java index 3bdf8ef4..10b102b7 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloModel.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloModel.java @@ -18,7 +18,6 @@ import com.liferay.portal.kernel.bean.AutoEscape; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.model.BaseModel; import com.liferay.portal.model.CacheModel; -import com.liferay.portal.model.GroupedModel; import com.liferay.portal.service.ServiceContext; import com.liferay.portlet.expando.model.ExpandoBridge; @@ -40,7 +39,7 @@ import java.util.Date; * @see it.mwg.sicilia.sue.model.impl.SportelloModelImpl * @generated */ -public interface SportelloModel extends BaseModel, GroupedModel { +public interface SportelloModel extends BaseModel { /* * NOTE FOR DEVELOPERS: * @@ -80,7 +79,6 @@ public interface SportelloModel extends BaseModel, GroupedModel { * * @return the group ID of this sportello */ - @Override public long getGroupId(); /** @@ -88,7 +86,6 @@ public interface SportelloModel extends BaseModel, GroupedModel { * * @param groupId the group ID of this sportello */ - @Override public void setGroupId(long groupId); /** @@ -96,7 +93,6 @@ public interface SportelloModel extends BaseModel, GroupedModel { * * @return the company ID of this sportello */ - @Override public long getCompanyId(); /** @@ -104,81 +100,71 @@ public interface SportelloModel extends BaseModel, GroupedModel { * * @param companyId the company ID of this sportello */ - @Override public void setCompanyId(long companyId); /** - * Returns the user ID of this sportello. + * Returns the create date of this sportello. * - * @return the user ID of this sportello + * @return the create date of this sportello */ - @Override - public long getUserId(); + public Date getCreateDate(); /** - * Sets the user ID of this sportello. + * Sets the create date of this sportello. * - * @param userId the user ID of this sportello + * @param createDate the create date of this sportello */ - @Override - public void setUserId(long userId); + public void setCreateDate(Date createDate); /** - * Returns the user uuid of this sportello. + * Returns the create user ID of this sportello. * - * @return the user uuid of this sportello - * @throws SystemException if a system exception occurred + * @return the create user ID of this sportello */ - @Override - public String getUserUuid() throws SystemException; + public long getCreateUserId(); /** - * Sets the user uuid of this sportello. + * Sets the create user ID of this sportello. * - * @param userUuid the user uuid of this sportello + * @param createUserId the create user ID of this sportello */ - @Override - public void setUserUuid(String userUuid); + public void setCreateUserId(long createUserId); /** - * Returns the user name of this sportello. + * Returns the create user uuid of this sportello. * - * @return the user name of this sportello + * @return the create user uuid of this sportello + * @throws SystemException if a system exception occurred */ - @AutoEscape - @Override - public String getUserName(); + public String getCreateUserUuid() throws SystemException; /** - * Sets the user name of this sportello. + * Sets the create user uuid of this sportello. * - * @param userName the user name of this sportello + * @param createUserUuid the create user uuid of this sportello */ - @Override - public void setUserName(String userName); + public void setCreateUserUuid(String createUserUuid); /** - * Returns the create date of this sportello. + * Returns the create user name of this sportello. * - * @return the create date of this sportello + * @return the create user name of this sportello */ - @Override - public Date getCreateDate(); + @AutoEscape + public String getCreateUserName(); /** - * Sets the create date of this sportello. + * Sets the create user name of this sportello. * - * @param createDate the create date of this sportello + * @param createUserName the create user name of this sportello */ - @Override - public void setCreateDate(Date createDate); + public void setCreateUserName(String createUserName); /** * Returns the modified date of this sportello. * * @return the modified date of this sportello */ - @Override public Date getModifiedDate(); /** @@ -186,9 +172,67 @@ public interface SportelloModel extends BaseModel, GroupedModel { * * @param modifiedDate the modified date of this sportello */ - @Override public void setModifiedDate(Date modifiedDate); + /** + * Returns the modified user ID of this sportello. + * + * @return the modified user ID of this sportello + */ + public long getModifiedUserId(); + + /** + * Sets the modified user ID of this sportello. + * + * @param modifiedUserId the modified user ID of this sportello + */ + public void setModifiedUserId(long modifiedUserId); + + /** + * Returns the modified user uuid of this sportello. + * + * @return the modified user uuid of this sportello + * @throws SystemException if a system exception occurred + */ + public String getModifiedUserUuid() throws SystemException; + + /** + * Sets the modified user uuid of this sportello. + * + * @param modifiedUserUuid the modified user uuid of this sportello + */ + public void setModifiedUserUuid(String modifiedUserUuid); + + /** + * Returns the modified user name of this sportello. + * + * @return the modified user name of this sportello + */ + @AutoEscape + public String getModifiedUserName(); + + /** + * Sets the modified user name of this sportello. + * + * @param modifiedUserName the modified user name of this sportello + */ + public void setModifiedUserName(String modifiedUserName); + + /** + * Returns the user name of this sportello. + * + * @return the user name of this sportello + */ + @AutoEscape + public String getUserName(); + + /** + * Sets the user name of this sportello. + * + * @param userName the user name of this sportello + */ + public void setUserName(String userName); + /** * Returns the email of this sportello. * @@ -218,21 +262,6 @@ public interface SportelloModel extends BaseModel, GroupedModel { */ public void setComuneId(long comuneId); - /** - * Returns the api key of this sportello. - * - * @return the api key of this sportello - */ - @AutoEscape - public String getApiKey(); - - /** - * Sets the api key of this sportello. - * - * @param apiKey the api key of this sportello - */ - public void setApiKey(String apiKey); - /** * Returns the attivo of this sportello. * @@ -254,6 +283,79 @@ public interface SportelloModel extends BaseModel, GroupedModel { */ public void setAttivo(boolean attivo); + /** + * Returns the password of this sportello. + * + * @return the password of this sportello + */ + @AutoEscape + public String getPassword(); + + /** + * Sets the password of this sportello. + * + * @param password the password of this sportello + */ + public void setPassword(String password); + + /** + * Returns the password modified date of this sportello. + * + * @return the password modified date of this sportello + */ + public Date getPasswordModifiedDate(); + + /** + * Sets the password modified date of this sportello. + * + * @param passwordModifiedDate the password modified date of this sportello + */ + public void setPasswordModifiedDate(Date passwordModifiedDate); + + /** + * Returns the password modified user ID of this sportello. + * + * @return the password modified user ID of this sportello + */ + public long getPasswordModifiedUserId(); + + /** + * Sets the password modified user ID of this sportello. + * + * @param passwordModifiedUserId the password modified user ID of this sportello + */ + public void setPasswordModifiedUserId(long passwordModifiedUserId); + + /** + * Returns the password modified user uuid of this sportello. + * + * @return the password modified user uuid of this sportello + * @throws SystemException if a system exception occurred + */ + public String getPasswordModifiedUserUuid() throws SystemException; + + /** + * Sets the password modified user uuid of this sportello. + * + * @param passwordModifiedUserUuid the password modified user uuid of this sportello + */ + public void setPasswordModifiedUserUuid(String passwordModifiedUserUuid); + + /** + * Returns the password modified user name of this sportello. + * + * @return the password modified user name of this sportello + */ + @AutoEscape + public String getPasswordModifiedUserName(); + + /** + * Sets the password modified user name of this sportello. + * + * @param passwordModifiedUserName the password modified user name of this sportello + */ + public void setPasswordModifiedUserName(String passwordModifiedUserName); + @Override public boolean isNew(); diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloSoap.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloSoap.java index 7ec35dff..9ba70b01 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloSoap.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloSoap.java @@ -34,14 +34,20 @@ public class SportelloSoap implements Serializable { soapModel.setSportelloId(model.getSportelloId()); soapModel.setGroupId(model.getGroupId()); soapModel.setCompanyId(model.getCompanyId()); - soapModel.setUserId(model.getUserId()); - soapModel.setUserName(model.getUserName()); soapModel.setCreateDate(model.getCreateDate()); + soapModel.setCreateUserId(model.getCreateUserId()); + soapModel.setCreateUserName(model.getCreateUserName()); soapModel.setModifiedDate(model.getModifiedDate()); + soapModel.setModifiedUserId(model.getModifiedUserId()); + soapModel.setModifiedUserName(model.getModifiedUserName()); + soapModel.setUserName(model.getUserName()); soapModel.setEmail(model.getEmail()); soapModel.setComuneId(model.getComuneId()); - soapModel.setApiKey(model.getApiKey()); soapModel.setAttivo(model.getAttivo()); + soapModel.setPassword(model.getPassword()); + soapModel.setPasswordModifiedDate(model.getPasswordModifiedDate()); + soapModel.setPasswordModifiedUserId(model.getPasswordModifiedUserId()); + soapModel.setPasswordModifiedUserName(model.getPasswordModifiedUserName()); return soapModel; } @@ -118,28 +124,28 @@ public class SportelloSoap implements Serializable { _companyId = companyId; } - public long getUserId() { - return _userId; + public Date getCreateDate() { + return _createDate; } - public void setUserId(long userId) { - _userId = userId; + public void setCreateDate(Date createDate) { + _createDate = createDate; } - public String getUserName() { - return _userName; + public long getCreateUserId() { + return _createUserId; } - public void setUserName(String userName) { - _userName = userName; + public void setCreateUserId(long createUserId) { + _createUserId = createUserId; } - public Date getCreateDate() { - return _createDate; + public String getCreateUserName() { + return _createUserName; } - public void setCreateDate(Date createDate) { - _createDate = createDate; + public void setCreateUserName(String createUserName) { + _createUserName = createUserName; } public Date getModifiedDate() { @@ -150,6 +156,30 @@ public class SportelloSoap implements Serializable { _modifiedDate = modifiedDate; } + public long getModifiedUserId() { + return _modifiedUserId; + } + + public void setModifiedUserId(long modifiedUserId) { + _modifiedUserId = modifiedUserId; + } + + public String getModifiedUserName() { + return _modifiedUserName; + } + + public void setModifiedUserName(String modifiedUserName) { + _modifiedUserName = modifiedUserName; + } + + public String getUserName() { + return _userName; + } + + public void setUserName(String userName) { + _userName = userName; + } + public String getEmail() { return _email; } @@ -166,14 +196,6 @@ public class SportelloSoap implements Serializable { _comuneId = comuneId; } - public String getApiKey() { - return _apiKey; - } - - public void setApiKey(String apiKey) { - _apiKey = apiKey; - } - public boolean getAttivo() { return _attivo; } @@ -186,15 +208,53 @@ public class SportelloSoap implements Serializable { _attivo = attivo; } + public String getPassword() { + return _password; + } + + public void setPassword(String password) { + _password = password; + } + + public Date getPasswordModifiedDate() { + return _passwordModifiedDate; + } + + public void setPasswordModifiedDate(Date passwordModifiedDate) { + _passwordModifiedDate = passwordModifiedDate; + } + + public long getPasswordModifiedUserId() { + return _passwordModifiedUserId; + } + + public void setPasswordModifiedUserId(long passwordModifiedUserId) { + _passwordModifiedUserId = passwordModifiedUserId; + } + + public String getPasswordModifiedUserName() { + return _passwordModifiedUserName; + } + + public void setPasswordModifiedUserName(String passwordModifiedUserName) { + _passwordModifiedUserName = passwordModifiedUserName; + } + private long _sportelloId; private long _groupId; private long _companyId; - private long _userId; - private String _userName; private Date _createDate; + private long _createUserId; + private String _createUserName; private Date _modifiedDate; + private long _modifiedUserId; + private String _modifiedUserName; + private String _userName; private String _email; private long _comuneId; - private String _apiKey; private boolean _attivo; + private String _password; + private Date _passwordModifiedDate; + private long _passwordModifiedUserId; + private String _passwordModifiedUserName; } \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloWrapper.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloWrapper.java index 3c13c9de..01ba294e 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloWrapper.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloWrapper.java @@ -52,14 +52,20 @@ public class SportelloWrapper implements Sportello, ModelWrapper { attributes.put("sportelloId", getSportelloId()); attributes.put("groupId", getGroupId()); attributes.put("companyId", getCompanyId()); - attributes.put("userId", getUserId()); - attributes.put("userName", getUserName()); attributes.put("createDate", getCreateDate()); + attributes.put("createUserId", getCreateUserId()); + attributes.put("createUserName", getCreateUserName()); attributes.put("modifiedDate", getModifiedDate()); + attributes.put("modifiedUserId", getModifiedUserId()); + attributes.put("modifiedUserName", getModifiedUserName()); + attributes.put("userName", getUserName()); attributes.put("email", getEmail()); attributes.put("comuneId", getComuneId()); - attributes.put("apiKey", getApiKey()); attributes.put("attivo", getAttivo()); + attributes.put("password", getPassword()); + attributes.put("passwordModifiedDate", getPasswordModifiedDate()); + attributes.put("passwordModifiedUserId", getPasswordModifiedUserId()); + attributes.put("passwordModifiedUserName", getPasswordModifiedUserName()); return attributes; } @@ -84,22 +90,22 @@ public class SportelloWrapper implements Sportello, ModelWrapper { setCompanyId(companyId); } - Long userId = (Long)attributes.get("userId"); + Date createDate = (Date)attributes.get("createDate"); - if (userId != null) { - setUserId(userId); + if (createDate != null) { + setCreateDate(createDate); } - String userName = (String)attributes.get("userName"); + Long createUserId = (Long)attributes.get("createUserId"); - if (userName != null) { - setUserName(userName); + if (createUserId != null) { + setCreateUserId(createUserId); } - Date createDate = (Date)attributes.get("createDate"); + String createUserName = (String)attributes.get("createUserName"); - if (createDate != null) { - setCreateDate(createDate); + if (createUserName != null) { + setCreateUserName(createUserName); } Date modifiedDate = (Date)attributes.get("modifiedDate"); @@ -108,6 +114,24 @@ public class SportelloWrapper implements Sportello, ModelWrapper { setModifiedDate(modifiedDate); } + Long modifiedUserId = (Long)attributes.get("modifiedUserId"); + + if (modifiedUserId != null) { + setModifiedUserId(modifiedUserId); + } + + String modifiedUserName = (String)attributes.get("modifiedUserName"); + + if (modifiedUserName != null) { + setModifiedUserName(modifiedUserName); + } + + String userName = (String)attributes.get("userName"); + + if (userName != null) { + setUserName(userName); + } + String email = (String)attributes.get("email"); if (email != null) { @@ -120,17 +144,37 @@ public class SportelloWrapper implements Sportello, ModelWrapper { setComuneId(comuneId); } - String apiKey = (String)attributes.get("apiKey"); - - if (apiKey != null) { - setApiKey(apiKey); - } - Boolean attivo = (Boolean)attributes.get("attivo"); if (attivo != null) { setAttivo(attivo); } + + String password = (String)attributes.get("password"); + + if (password != null) { + setPassword(password); + } + + Date passwordModifiedDate = (Date)attributes.get("passwordModifiedDate"); + + if (passwordModifiedDate != null) { + setPasswordModifiedDate(passwordModifiedDate); + } + + Long passwordModifiedUserId = (Long)attributes.get( + "passwordModifiedUserId"); + + if (passwordModifiedUserId != null) { + setPasswordModifiedUserId(passwordModifiedUserId); + } + + String passwordModifiedUserName = (String)attributes.get( + "passwordModifiedUserName"); + + if (passwordModifiedUserName != null) { + setPasswordModifiedUserName(passwordModifiedUserName); + } } /** @@ -214,85 +258,85 @@ public class SportelloWrapper implements Sportello, ModelWrapper { } /** - * Returns the user ID of this sportello. + * Returns the create date of this sportello. * - * @return the user ID of this sportello + * @return the create date of this sportello */ @Override - public long getUserId() { - return _sportello.getUserId(); + public java.util.Date getCreateDate() { + return _sportello.getCreateDate(); } /** - * Sets the user ID of this sportello. + * Sets the create date of this sportello. * - * @param userId the user ID of this sportello + * @param createDate the create date of this sportello */ @Override - public void setUserId(long userId) { - _sportello.setUserId(userId); + public void setCreateDate(java.util.Date createDate) { + _sportello.setCreateDate(createDate); } /** - * Returns the user uuid of this sportello. + * Returns the create user ID of this sportello. * - * @return the user uuid of this sportello - * @throws SystemException if a system exception occurred + * @return the create user ID of this sportello */ @Override - public java.lang.String getUserUuid() - throws com.liferay.portal.kernel.exception.SystemException { - return _sportello.getUserUuid(); + public long getCreateUserId() { + return _sportello.getCreateUserId(); } /** - * Sets the user uuid of this sportello. + * Sets the create user ID of this sportello. * - * @param userUuid the user uuid of this sportello + * @param createUserId the create user ID of this sportello */ @Override - public void setUserUuid(java.lang.String userUuid) { - _sportello.setUserUuid(userUuid); + public void setCreateUserId(long createUserId) { + _sportello.setCreateUserId(createUserId); } /** - * Returns the user name of this sportello. + * Returns the create user uuid of this sportello. * - * @return the user name of this sportello + * @return the create user uuid of this sportello + * @throws SystemException if a system exception occurred */ @Override - public java.lang.String getUserName() { - return _sportello.getUserName(); + public java.lang.String getCreateUserUuid() + throws com.liferay.portal.kernel.exception.SystemException { + return _sportello.getCreateUserUuid(); } /** - * Sets the user name of this sportello. + * Sets the create user uuid of this sportello. * - * @param userName the user name of this sportello + * @param createUserUuid the create user uuid of this sportello */ @Override - public void setUserName(java.lang.String userName) { - _sportello.setUserName(userName); + public void setCreateUserUuid(java.lang.String createUserUuid) { + _sportello.setCreateUserUuid(createUserUuid); } /** - * Returns the create date of this sportello. + * Returns the create user name of this sportello. * - * @return the create date of this sportello + * @return the create user name of this sportello */ @Override - public java.util.Date getCreateDate() { - return _sportello.getCreateDate(); + public java.lang.String getCreateUserName() { + return _sportello.getCreateUserName(); } /** - * Sets the create date of this sportello. + * Sets the create user name of this sportello. * - * @param createDate the create date of this sportello + * @param createUserName the create user name of this sportello */ @Override - public void setCreateDate(java.util.Date createDate) { - _sportello.setCreateDate(createDate); + public void setCreateUserName(java.lang.String createUserName) { + _sportello.setCreateUserName(createUserName); } /** @@ -315,6 +359,88 @@ public class SportelloWrapper implements Sportello, ModelWrapper { _sportello.setModifiedDate(modifiedDate); } + /** + * Returns the modified user ID of this sportello. + * + * @return the modified user ID of this sportello + */ + @Override + public long getModifiedUserId() { + return _sportello.getModifiedUserId(); + } + + /** + * Sets the modified user ID of this sportello. + * + * @param modifiedUserId the modified user ID of this sportello + */ + @Override + public void setModifiedUserId(long modifiedUserId) { + _sportello.setModifiedUserId(modifiedUserId); + } + + /** + * Returns the modified user uuid of this sportello. + * + * @return the modified user uuid of this sportello + * @throws SystemException if a system exception occurred + */ + @Override + public java.lang.String getModifiedUserUuid() + throws com.liferay.portal.kernel.exception.SystemException { + return _sportello.getModifiedUserUuid(); + } + + /** + * Sets the modified user uuid of this sportello. + * + * @param modifiedUserUuid the modified user uuid of this sportello + */ + @Override + public void setModifiedUserUuid(java.lang.String modifiedUserUuid) { + _sportello.setModifiedUserUuid(modifiedUserUuid); + } + + /** + * Returns the modified user name of this sportello. + * + * @return the modified user name of this sportello + */ + @Override + public java.lang.String getModifiedUserName() { + return _sportello.getModifiedUserName(); + } + + /** + * Sets the modified user name of this sportello. + * + * @param modifiedUserName the modified user name of this sportello + */ + @Override + public void setModifiedUserName(java.lang.String modifiedUserName) { + _sportello.setModifiedUserName(modifiedUserName); + } + + /** + * Returns the user name of this sportello. + * + * @return the user name of this sportello + */ + @Override + public java.lang.String getUserName() { + return _sportello.getUserName(); + } + + /** + * Sets the user name of this sportello. + * + * @param userName the user name of this sportello + */ + @Override + public void setUserName(java.lang.String userName) { + _sportello.setUserName(userName); + } + /** * Returns the email of this sportello. * @@ -355,26 +481,6 @@ public class SportelloWrapper implements Sportello, ModelWrapper { _sportello.setComuneId(comuneId); } - /** - * Returns the api key of this sportello. - * - * @return the api key of this sportello - */ - @Override - public java.lang.String getApiKey() { - return _sportello.getApiKey(); - } - - /** - * Sets the api key of this sportello. - * - * @param apiKey the api key of this sportello - */ - @Override - public void setApiKey(java.lang.String apiKey) { - _sportello.setApiKey(apiKey); - } - /** * Returns the attivo of this sportello. * @@ -405,6 +511,110 @@ public class SportelloWrapper implements Sportello, ModelWrapper { _sportello.setAttivo(attivo); } + /** + * Returns the password of this sportello. + * + * @return the password of this sportello + */ + @Override + public java.lang.String getPassword() { + return _sportello.getPassword(); + } + + /** + * Sets the password of this sportello. + * + * @param password the password of this sportello + */ + @Override + public void setPassword(java.lang.String password) { + _sportello.setPassword(password); + } + + /** + * Returns the password modified date of this sportello. + * + * @return the password modified date of this sportello + */ + @Override + public java.util.Date getPasswordModifiedDate() { + return _sportello.getPasswordModifiedDate(); + } + + /** + * Sets the password modified date of this sportello. + * + * @param passwordModifiedDate the password modified date of this sportello + */ + @Override + public void setPasswordModifiedDate(java.util.Date passwordModifiedDate) { + _sportello.setPasswordModifiedDate(passwordModifiedDate); + } + + /** + * Returns the password modified user ID of this sportello. + * + * @return the password modified user ID of this sportello + */ + @Override + public long getPasswordModifiedUserId() { + return _sportello.getPasswordModifiedUserId(); + } + + /** + * Sets the password modified user ID of this sportello. + * + * @param passwordModifiedUserId the password modified user ID of this sportello + */ + @Override + public void setPasswordModifiedUserId(long passwordModifiedUserId) { + _sportello.setPasswordModifiedUserId(passwordModifiedUserId); + } + + /** + * Returns the password modified user uuid of this sportello. + * + * @return the password modified user uuid of this sportello + * @throws SystemException if a system exception occurred + */ + @Override + public java.lang.String getPasswordModifiedUserUuid() + throws com.liferay.portal.kernel.exception.SystemException { + return _sportello.getPasswordModifiedUserUuid(); + } + + /** + * Sets the password modified user uuid of this sportello. + * + * @param passwordModifiedUserUuid the password modified user uuid of this sportello + */ + @Override + public void setPasswordModifiedUserUuid( + java.lang.String passwordModifiedUserUuid) { + _sportello.setPasswordModifiedUserUuid(passwordModifiedUserUuid); + } + + /** + * Returns the password modified user name of this sportello. + * + * @return the password modified user name of this sportello + */ + @Override + public java.lang.String getPasswordModifiedUserName() { + return _sportello.getPasswordModifiedUserName(); + } + + /** + * Sets the password modified user name of this sportello. + * + * @param passwordModifiedUserName the password modified user name of this sportello + */ + @Override + public void setPasswordModifiedUserName( + java.lang.String passwordModifiedUserName) { + _sportello.setPasswordModifiedUserName(passwordModifiedUserName); + } + @Override public boolean isNew() { return _sportello.isNew(); @@ -509,6 +719,22 @@ public class SportelloWrapper implements Sportello, ModelWrapper { _sportello.persist(); } + @Override + public java.lang.String encryptPassword(java.lang.String password) { + return _sportello.encryptPassword(password); + } + + @Override + public boolean checkPassword(java.lang.String password) { + return _sportello.checkPassword(password); + } + + @Override + public void setEncryptedPassword(java.lang.String password, + com.liferay.portal.model.User user) { + _sportello.setEncryptedPassword(password, user); + } + @Override public java.lang.String getCodiceProvincia() throws com.liferay.portal.kernel.exception.PortalException, diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ClpSerializer.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ClpSerializer.java index 64bec69d..e92200c8 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ClpSerializer.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ClpSerializer.java @@ -317,6 +317,18 @@ public class ClpSerializer { return new SystemException(); } + if (className.equals("it.mwg.sicilia.sue.ExpiredTokenException")) { + return new it.mwg.sicilia.sue.ExpiredTokenException(); + } + + if (className.equals("it.mwg.sicilia.sue.InactiveSportelloException")) { + return new it.mwg.sicilia.sue.InactiveSportelloException(); + } + + if (className.equals("it.mwg.sicilia.sue.InvalidTokenException")) { + return new it.mwg.sicilia.sue.InvalidTokenException(); + } + if (className.equals("it.mwg.sicilia.sue.NoSuchApiSettingException")) { return new it.mwg.sicilia.sue.NoSuchApiSettingException(); } diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloLocalService.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloLocalService.java index 39793741..303dd528 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloLocalService.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloLocalService.java @@ -249,4 +249,9 @@ public interface SportelloLocalService extends BaseLocalService, public java.lang.Object invokeMethod(java.lang.String name, java.lang.String[] parameterTypes, java.lang.Object[] arguments) throws java.lang.Throwable; + + public it.mwg.sicilia.sue.model.Sportello findByUserName( + java.lang.String userName) + throws com.liferay.portal.kernel.exception.SystemException, + it.mwg.sicilia.sue.NoSuchSportelloException; } \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloLocalServiceClp.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloLocalServiceClp.java index 0ef97d83..052975a2 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloLocalServiceClp.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloLocalServiceClp.java @@ -113,6 +113,10 @@ public class SportelloLocalServiceClp implements SportelloLocalService { _methodName17 = "setBeanIdentifier"; _methodParameterTypes17 = new String[] { "java.lang.String" }; + + _methodName19 = "findByUserName"; + + _methodParameterTypes19 = new String[] { "java.lang.String" }; } @Override @@ -661,6 +665,41 @@ public class SportelloLocalServiceClp implements SportelloLocalService { throw new UnsupportedOperationException(); } + @Override + public it.mwg.sicilia.sue.model.Sportello findByUserName( + java.lang.String userName) + throws com.liferay.portal.kernel.exception.SystemException, + it.mwg.sicilia.sue.NoSuchSportelloException { + Object returnObj = null; + + try { + returnObj = _invokableLocalService.invokeMethod(_methodName19, + _methodParameterTypes19, + new Object[] { ClpSerializer.translateInput(userName) }); + } + catch (Throwable t) { + t = ClpSerializer.translateThrowable(t); + + if (t instanceof com.liferay.portal.kernel.exception.SystemException) { + throw (com.liferay.portal.kernel.exception.SystemException)t; + } + + if (t instanceof it.mwg.sicilia.sue.NoSuchSportelloException) { + throw (it.mwg.sicilia.sue.NoSuchSportelloException)t; + } + + if (t instanceof RuntimeException) { + throw (RuntimeException)t; + } + else { + throw new RuntimeException(t.getClass().getName() + + " is not a valid exception"); + } + } + + return (it.mwg.sicilia.sue.model.Sportello)ClpSerializer.translateOutput(returnObj); + } + private InvokableLocalService _invokableLocalService; private String _methodName0; private String[] _methodParameterTypes0; @@ -698,4 +737,6 @@ public class SportelloLocalServiceClp implements SportelloLocalService { private String[] _methodParameterTypes16; private String _methodName17; private String[] _methodParameterTypes17; + private String _methodName19; + private String[] _methodParameterTypes19; } \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloLocalServiceUtil.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloLocalServiceUtil.java index c2e5e6bb..ecb4c20c 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloLocalServiceUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloLocalServiceUtil.java @@ -275,6 +275,13 @@ public class SportelloLocalServiceUtil { return getService().invokeMethod(name, parameterTypes, arguments); } + public static it.mwg.sicilia.sue.model.Sportello findByUserName( + java.lang.String userName) + throws com.liferay.portal.kernel.exception.SystemException, + it.mwg.sicilia.sue.NoSuchSportelloException { + return getService().findByUserName(userName); + } + public static void clearService() { _service = null; } diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloLocalServiceWrapper.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloLocalServiceWrapper.java index de7ea4a3..bc6a5cbf 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloLocalServiceWrapper.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloLocalServiceWrapper.java @@ -282,6 +282,14 @@ public class SportelloLocalServiceWrapper implements SportelloLocalService, arguments); } + @Override + public it.mwg.sicilia.sue.model.Sportello findByUserName( + java.lang.String userName) + throws com.liferay.portal.kernel.exception.SystemException, + it.mwg.sicilia.sue.NoSuchSportelloException { + return _sportelloLocalService.findByUserName(userName); + } + /** * @deprecated As of 6.1.0, replaced by {@link #getWrappedService} */ diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloService.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloService.java index 69076277..43edace5 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloService.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloService.java @@ -63,4 +63,6 @@ public interface SportelloService extends BaseService, InvokableService { public java.lang.Object invokeMethod(java.lang.String name, java.lang.String[] parameterTypes, java.lang.Object[] arguments) throws java.lang.Throwable; + + public java.lang.String generaPassword(int lunghezza); } \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloServiceClp.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloServiceClp.java index ac2bdf86..3ca575ff 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloServiceClp.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloServiceClp.java @@ -31,6 +31,10 @@ public class SportelloServiceClp implements SportelloService { _methodName1 = "setBeanIdentifier"; _methodParameterTypes1 = new String[] { "java.lang.String" }; + + _methodName3 = "generaPassword"; + + _methodParameterTypes3 = new String[] { "int" }; } @Override @@ -83,9 +87,34 @@ public class SportelloServiceClp implements SportelloService { throw new UnsupportedOperationException(); } + @Override + public java.lang.String generaPassword(int lunghezza) { + Object returnObj = null; + + try { + returnObj = _invokableService.invokeMethod(_methodName3, + _methodParameterTypes3, new Object[] { lunghezza }); + } + catch (Throwable t) { + t = ClpSerializer.translateThrowable(t); + + if (t instanceof RuntimeException) { + throw (RuntimeException)t; + } + else { + throw new RuntimeException(t.getClass().getName() + + " is not a valid exception"); + } + } + + return (java.lang.String)ClpSerializer.translateOutput(returnObj); + } + private InvokableService _invokableService; private String _methodName0; private String[] _methodParameterTypes0; private String _methodName1; private String[] _methodParameterTypes1; + private String _methodName3; + private String[] _methodParameterTypes3; } \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloServiceUtil.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloServiceUtil.java index 695cdb78..d262f4df 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloServiceUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloServiceUtil.java @@ -63,6 +63,10 @@ public class SportelloServiceUtil { return getService().invokeMethod(name, parameterTypes, arguments); } + public static java.lang.String generaPassword(int lunghezza) { + return getService().generaPassword(lunghezza); + } + public static void clearService() { _service = null; } diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloServiceWrapper.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloServiceWrapper.java index 1c487d54..4a07e390 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloServiceWrapper.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloServiceWrapper.java @@ -56,6 +56,11 @@ public class SportelloServiceWrapper implements SportelloService, return _sportelloService.invokeMethod(name, parameterTypes, arguments); } + @Override + public java.lang.String generaPassword(int lunghezza) { + return _sportelloService.generaPassword(lunghezza); + } + /** * @deprecated As of 6.1.0, replaced by {@link #getWrappedService} */ diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/SportelloPersistence.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/SportelloPersistence.java index f5fbc933..69282a64 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/SportelloPersistence.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/SportelloPersistence.java @@ -92,6 +92,64 @@ public interface SportelloPersistence extends BasePersistence { public int countByComuneId(long comuneId) throws com.liferay.portal.kernel.exception.SystemException; + /** + * 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 + */ + public it.mwg.sicilia.sue.model.Sportello findByUserName( + java.lang.String userName) + throws com.liferay.portal.kernel.exception.SystemException, + it.mwg.sicilia.sue.NoSuchSportelloException; + + /** + * 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 + */ + public it.mwg.sicilia.sue.model.Sportello fetchByUserName( + java.lang.String userName) + throws com.liferay.portal.kernel.exception.SystemException; + + /** + * 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 + */ + public it.mwg.sicilia.sue.model.Sportello fetchByUserName( + java.lang.String userName, boolean retrieveFromCache) + throws com.liferay.portal.kernel.exception.SystemException; + + /** + * 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 + */ + public it.mwg.sicilia.sue.model.Sportello removeByUserName( + java.lang.String userName) + throws com.liferay.portal.kernel.exception.SystemException, + it.mwg.sicilia.sue.NoSuchSportelloException; + + /** + * 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 + */ + public int countByUserName(java.lang.String userName) + throws com.liferay.portal.kernel.exception.SystemException; + /** * Caches the sportello in the entity cache if it is enabled. * diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/SportelloUtil.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/SportelloUtil.java index 344db9c0..2d2afe73 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/SportelloUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/SportelloUtil.java @@ -178,6 +178,74 @@ public class SportelloUtil { return getPersistence().countByComuneId(comuneId); } + /** + * 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 + */ + public static it.mwg.sicilia.sue.model.Sportello findByUserName( + java.lang.String userName) + throws com.liferay.portal.kernel.exception.SystemException, + it.mwg.sicilia.sue.NoSuchSportelloException { + return getPersistence().findByUserName(userName); + } + + /** + * 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 + */ + public static it.mwg.sicilia.sue.model.Sportello fetchByUserName( + java.lang.String userName) + throws com.liferay.portal.kernel.exception.SystemException { + return getPersistence().fetchByUserName(userName); + } + + /** + * 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 + */ + public static it.mwg.sicilia.sue.model.Sportello fetchByUserName( + java.lang.String userName, boolean retrieveFromCache) + throws com.liferay.portal.kernel.exception.SystemException { + return getPersistence().fetchByUserName(userName, retrieveFromCache); + } + + /** + * 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 + */ + public static it.mwg.sicilia.sue.model.Sportello removeByUserName( + java.lang.String userName) + throws com.liferay.portal.kernel.exception.SystemException, + it.mwg.sicilia.sue.NoSuchSportelloException { + return getPersistence().removeByUserName(userName); + } + + /** + * 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 + */ + public static int countByUserName(java.lang.String userName) + throws com.liferay.portal.kernel.exception.SystemException { + return getPersistence().countByUserName(userName); + } + /** * Caches the sportello in the entity cache if it is enabled. * diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/indexes.properties b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/indexes.properties index 7f94ec66..6d9c3855 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/indexes.properties +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/indexes.properties @@ -1,3 +1,4 @@ IX_7B780A8D=sicilia_sue_ApiSetting.CompanyIdKey -IX_8B2AB20B=sicilia_sue_Sportello.ComuneId \ No newline at end of file +IX_8B2AB20B=sicilia_sue_Sportello.ComuneId +IX_F4E738BB=sicilia_sue_Sportello.UserName \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/indexes.sql b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/indexes.sql index c1afa6ba..125d6c6c 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/indexes.sql +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/indexes.sql @@ -1,3 +1,4 @@ create unique index IX_7B780A8D on sicilia_sue_ApiSetting (companyId, key_); -create unique index IX_8B2AB20B on sicilia_sue_Sportello (comuneId); \ No newline at end of file +create unique index IX_8B2AB20B on sicilia_sue_Sportello (comuneId); +create unique index IX_F4E738BB on sicilia_sue_Sportello (userName); \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/tables.sql b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/tables.sql index b98c487c..4dd0bee4 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/tables.sql +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/tables.sql @@ -9,12 +9,18 @@ create table sicilia_sue_Sportello ( sportelloId LONG not null primary key, groupId LONG, companyId LONG, - userId LONG, - userName VARCHAR(240) null, createDate DATE null, + createUserId LONG, + createUserName VARCHAR(75) null, modifiedDate DATE null, + modifiedUserId LONG, + modifiedUserName VARCHAR(75) null, + userName VARCHAR(75) null, email VARCHAR(240) null, comuneId LONG, - apiKey VARCHAR(240) null, - attivo BOOLEAN + attivo BOOLEAN, + password_ VARCHAR(75) null, + passwordModifiedDate DATE null, + passwordModifiedUserId LONG, + passwordModifiedUserName VARCHAR(240) null ); \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-hbm.xml b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-hbm.xml index c568aa50..f3590625 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-hbm.xml +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-hbm.xml @@ -20,13 +20,19 @@ - - + + + + + - + + + + \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-model-hints.xml b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-model-hints.xml index b69ced79..87e5cf33 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-model-hints.xml +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-model-hints.xml @@ -13,19 +13,23 @@ - - - 240 - + + + + + 240 - + + + + + 240 - \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-orm.xml b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-orm.xml index 94ff9bfe..3864ca2a 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-orm.xml +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-orm.xml @@ -27,22 +27,34 @@ - - TIMESTAMP + + TIMESTAMP + + + - + + + + + TIMESTAMP + + + + + + - diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/content/Language.properties b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/content/Language.properties index ff9528b9..8e710091 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/content/Language.properties +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/content/Language.properties @@ -1,3 +1,4 @@ email = Email nomeComune = Comune -nomeProvincia = Provincia \ No newline at end of file +nomeProvincia = Provincia +userName = Login diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/AccessToken.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/AccessToken.java new file mode 100644 index 00000000..8dcf7dd2 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/AccessToken.java @@ -0,0 +1,99 @@ +package it.mwg.sicilia.sue.api.v1; + +import it.mwg.sicilia.sue.ExpiredTokenException; +import it.mwg.sicilia.sue.InactiveSportelloException; +import it.mwg.sicilia.sue.InvalidTokenException; +import it.mwg.sicilia.sue.model.Sportello; +import it.mwg.sicilia.sue.service.ApiSettingLocalServiceUtil; +import it.mwg.sicilia.sue.service.SportelloLocalServiceUtil; + +import java.security.KeyFactory; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.spec.PKCS8EncodedKeySpec; +import java.security.spec.X509EncodedKeySpec; +import java.util.Date; + +import javax.crypto.Cipher; + +import com.liferay.portal.kernel.json.JSONFactoryUtil; +import com.liferay.portal.kernel.json.JSONObject; +import com.liferay.portal.kernel.security.SecureRandom; +import com.liferay.portal.kernel.util.Validator; +import com.sun.org.apache.xml.internal.security.utils.Base64; + +public class AccessToken { + + private long timestamp; + private long sportelloId; + private String token; + + private static final long MAX_AGE = 15 * 60 * 1000; + + private static final String TIMESTAMP = "timestamp"; + private static final String SPORTELLO_ID = "sportelloId"; + private static final String SALT = "salt"; + private static final String SECRET = "secret"; + + public AccessToken(Sportello sportello) throws Exception { + + timestamp = new Date().getTime(); + sportelloId = sportello.getSportelloId(); + JSONObject payload = JSONFactoryUtil.createJSONObject(); + payload.put(TIMESTAMP, timestamp); + payload.put(SPORTELLO_ID, sportelloId); + SecureRandom rnd = new SecureRandom(); + payload.put(SALT, rnd.nextLong()); + payload.put(SECRET, ApiSettingLocalServiceUtil.get(sportello.getCompanyId(), ApiConstants.API_SECRET)); + String key = ApiSettingLocalServiceUtil.get(sportello.getCompanyId(), ApiConstants.API_PUBLIC_KEY); + KeyFactory keyFactory = KeyFactory.getInstance("RSA"); + X509EncodedKeySpec pubKeySpec = new X509EncodedKeySpec(Base64.decode(key)); + PublicKey publicKey = keyFactory.generatePublic(pubKeySpec); + Cipher cipher = Cipher.getInstance("RSA"); + cipher.init(Cipher.ENCRYPT_MODE, publicKey); + token = Base64.encode(cipher.doFinal(payload.toString().getBytes())); + } + + public AccessToken(String token) throws Exception { + + KeyFactory keyFactory = KeyFactory.getInstance("RSA"); + String key = ApiSettingLocalServiceUtil.get(20155, ApiConstants.API_PRIVATE_KEY); + PKCS8EncodedKeySpec privKeySpec = new PKCS8EncodedKeySpec(Base64.decode(key)); + PrivateKey privateKey = keyFactory.generatePrivate(privKeySpec); + Cipher cipher = Cipher.getInstance("RSA"); + cipher.init(Cipher.DECRYPT_MODE, privateKey); + String json; + JSONObject payload; + try { + json = new String(cipher.doFinal(Base64.decode(token))); + payload = JSONFactoryUtil.createJSONObject(json); + } catch (Exception e) { + throw new InvalidTokenException(); + } + if (!ApiSettingLocalServiceUtil.get(20155, ApiConstants.API_SECRET).equals(payload.getString(SECRET))) { + throw new InvalidTokenException(); + } + timestamp = payload.getLong(TIMESTAMP); + long current = new Date().getTime(); + if ((current < timestamp) || (current - timestamp > MAX_AGE)) { + System.out.println("**** current = " + current + ", timestamp = " + timestamp); + throw new ExpiredTokenException(); + } + sportelloId = payload.getLong(SPORTELLO_ID); + Sportello sportello = SportelloLocalServiceUtil.getSportello(sportelloId); + if (Validator.isNull(sportello) || !sportello.isAttivo()) { + throw new InactiveSportelloException(); + } + this.token = token; + } + + public long getSportelloId() { + + return sportelloId; + } + + public String getToken() { + + return token; + } +} diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiServlet.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiServlet.java index 2eb22b51..f2668f58 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiServlet.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiServlet.java @@ -1,19 +1,12 @@ package it.mwg.sicilia.sue.api.v1; -import it.mwg.sicilia.sue.model.Sportello; - import java.io.IOException; -import java.io.InputStreamReader; -import java.io.Serializable; -import java.util.Map; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import com.liferay.portal.kernel.json.JSONDeserializer; -import com.liferay.portal.kernel.json.JSONFactoryUtil; import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.util.StringPool; @@ -26,8 +19,6 @@ import com.liferay.portal.kernel.util.Validator; public class ApiServlet extends HttpServlet { private static final Log _log = LogFactoryUtil.getLog(ApiServlet.class); - private static final JSONDeserializer> deserializer = JSONFactoryUtil - .createJSONDeserializer(); @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { @@ -50,42 +41,23 @@ public class ApiServlet extends HttpServlet { private void process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - String info = request.getPathInfo(); - if (Validator.isNull(info)) { - info = StringPool.BLANK; + String pathInfo = request.getPathInfo(); + if (Validator.isNull(pathInfo)) { + pathInfo = StringPool.BLANK; } else { - info = request.getPathInfo().substring(1); + pathInfo = request.getPathInfo().substring(1); } - Command command = Commands.get(info); + Command command = Commands.get(pathInfo); if (Validator.isNull(command)) { response.sendError(HttpServletResponse.SC_NOT_FOUND); + } else if (!command.getMethods().contains(request.getMethod())) { + response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED); } else { - Map parameters = deserializer.deserialize(new InputStreamReader(request - .getInputStream())); - long timestamp = 0; - String uuid = null; - String signature = null; try { - timestamp = (Long) parameters.get(Parameters.AUTH_TIMESTAMP); - uuid = (String) parameters.get(Parameters.AUTH_USER_ID); - signature = (String) parameters.get(Parameters.AUTH_SIGNATURE); - } catch (ClassCastException e) { - } - if ((0 == timestamp) || Validator.isNull(uuid) || Validator.isNull(signature)) { - response.sendError(HttpServletResponse.SC_BAD_REQUEST); - } else if (!verifySignature(timestamp, signature)) { - response.sendError(HttpServletResponse.SC_FORBIDDEN); - } else if (!command.getMethods().contains(request.getMethod())) { - response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED); - } else { command.run(request, response); + } catch (Exception e) { + _log.error(e.getMessage(), e); } } } - - private boolean verifySignature(long timestamp, String signature) { - - Sportello sportello; - return false; - } } diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiUtil.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiUtil.java index 98e01bd2..8eae6aae 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiUtil.java @@ -18,7 +18,6 @@ import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.security.SecureRandom; import com.liferay.portal.kernel.util.StringPool; -import com.liferay.portal.security.auth.CompanyThreadLocal; import com.sun.org.apache.xml.internal.security.utils.Base64; public class ApiUtil { @@ -57,10 +56,4 @@ public class ApiUtil { String check = DigestUtils.sha256Hex(hash + secret); return hash + StringPool.PERIOD + check; } - - public static String getToken(long sportelloId) throws Exception { - - long companyId = CompanyThreadLocal.getCompanyId(); - return getToken(companyId, sportelloId); - } } diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Command.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Command.java index f93ab401..ae2e6f6f 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Command.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Command.java @@ -1,18 +1,37 @@ package it.mwg.sicilia.sue.api.v1; +import it.mwg.sicilia.sue.ExpiredTokenException; +import it.mwg.sicilia.sue.InactiveSportelloException; +import it.mwg.sicilia.sue.InvalidTokenException; + import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Serializable; import java.util.Arrays; import java.util.List; +import java.util.Map; -import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import com.liferay.portal.kernel.json.JSONDeserializer; +import com.liferay.portal.kernel.json.JSONFactoryUtil; +import com.liferay.portal.kernel.log.Log; +import com.liferay.portal.kernel.log.LogFactoryUtil; +import com.liferay.portal.kernel.servlet.ServletResponseUtil; +import com.liferay.portal.kernel.util.ContentTypes; +import com.liferay.portal.kernel.util.StringPool; + public abstract class Command { + protected static final Log _log = LogFactoryUtil.getLog(Command.class); + protected Map parameters = null; + private String verb; private List methods; private String description; + private static final JSONDeserializer> deserializer = JSONFactoryUtil + .createJSONDeserializer(); public Command(String verb, String description, String... methods) { @@ -36,6 +55,37 @@ public abstract class Command { return description; } - public abstract void run(HttpServletRequest request, HttpServletResponse response) throws ServletException, - IOException; + public abstract void run(HttpServletRequest request, HttpServletResponse response) throws Exception; + + protected Map readParameters(HttpServletRequest request) throws IOException { + + parameters = deserializer.deserialize(new InputStreamReader(request.getInputStream())); + return parameters; + } + + protected void setJson(HttpServletResponse response) { + + response.setContentType(ContentTypes.APPLICATION_JSON); + response.setCharacterEncoding(StringPool.UTF8); + } + + protected boolean verifyAccessToken(HttpServletResponse response, String encodedToken) { + + try { + try { + new AccessToken(encodedToken); + } catch (InvalidTokenException e) { + ServletResponseUtil.write(response, Response.get(Status.INVALID_TOKEN)); + } catch (ExpiredTokenException e) { + ServletResponseUtil.write(response, Response.get(Status.EXPIRED_TOKEN)); + } catch (InactiveSportelloException e) { + ServletResponseUtil.write(response, Response.get(Status.INACTIVE_USER)); + } catch (Exception e) { + ServletResponseUtil.write(response, Response.get(Status.SERVER_ERROR)); + } + return true; + } catch (IOException e) { + return false; + } + } } diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Commands.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Commands.java index 73bacee6..4d5e1719 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Commands.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Commands.java @@ -1,5 +1,6 @@ package it.mwg.sicilia.sue.api.v1; +import it.mwg.sicilia.sue.api.v1.command.CommandLogin; import it.mwg.sicilia.sue.api.v1.command.CommandNop; import java.util.LinkedHashMap; @@ -14,6 +15,8 @@ public class Commands { static { addCommand(new CommandNop(StringPool.BLANK, "NOP verifica la connettività senza eseguire operazioni", HttpMethods.GET, HttpMethods.POST)); + addCommand(new CommandLogin("login", + "Esegue l'accesso con nome email e password e restituisce un token di accesso", HttpMethods.POST)); } private static void addCommand(Command command) { diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Parameters.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Parameters.java index bca814a7..0d14be04 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Parameters.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Parameters.java @@ -2,9 +2,9 @@ package it.mwg.sicilia.sue.api.v1; public class Parameters { - public static final String AUTH_TIMESTAMP = "timestamp"; - public static final String AUTH_USER_ID = "userId"; - public static final String AUTH_SIGNATURE = "signature"; - public static final String STATUS_CODE = "status"; - public static final String STATUS_DESCRIPTION = "description"; + public static final String PASSWORD = "password"; + public static final String STATUS_CODE = "statusCode"; + public static final String STATUS_MESSAGE = "statusMessage"; + public static final String TOKEN = "token"; + public static final String USER_NAME = "userName"; } diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Response.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Response.java index 8ab5294a..2cd31c72 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Response.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Response.java @@ -22,7 +22,7 @@ public class Response { Map map = new LinkedHashMap<>(); map.put(Parameters.STATUS_CODE, statusCode); - map.put(Parameters.STATUS_DESCRIPTION, Status.getStatusDescription(statusCode)); + map.put(Parameters.STATUS_MESSAGE, Status.getStatusDescription(statusCode)); if (Validator.isNotNull(extraData)) { map.putAll(extraData); } diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Status.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Status.java index e6435a06..dac16f84 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Status.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Status.java @@ -6,17 +6,28 @@ import java.util.Map; public class Status { public static final int OK = 0; - public static final int MALFORMED_REQUEST = 1; + public static final int EXPIRED_TOKEN = 1; + public static final int INACTIVE_USER = 2; + public static final int INVALID_TOKEN = 3; + public static final int MALFORMED_REQUEST = 4; + public static final int SERVER_ERROR = 5; + public static final int WRONG_USER_NAME_OR_PASSWORD = 6; @SuppressWarnings("serial") private static final Map messages = new HashMap() { { put(OK, "OK"); + put(EXPIRED_TOKEN, "This token has expired"); + put(INACTIVE_USER, "Inactive user"); + put(INVALID_TOKEN, "Invalid token"); put(MALFORMED_REQUEST, "Malformed request"); + put(SERVER_ERROR, "Internal server error"); + put(WRONG_USER_NAME_OR_PASSWORD, "Wrong user name or password"); } }; public static String getStatusDescription(int statusCode) { + return messages.get(statusCode); } } diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/command/CommandLogin.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/command/CommandLogin.java new file mode 100644 index 00000000..5954e5e6 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/command/CommandLogin.java @@ -0,0 +1,56 @@ +package it.mwg.sicilia.sue.api.v1.command; + +import it.mwg.sicilia.sue.NoSuchSportelloException; +import it.mwg.sicilia.sue.api.v1.AccessToken; +import it.mwg.sicilia.sue.api.v1.Command; +import it.mwg.sicilia.sue.api.v1.Parameters; +import it.mwg.sicilia.sue.api.v1.Response; +import it.mwg.sicilia.sue.api.v1.Status; +import it.mwg.sicilia.sue.model.Sportello; +import it.mwg.sicilia.sue.service.SportelloLocalServiceUtil; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.liferay.portal.kernel.exception.SystemException; +import com.liferay.portal.kernel.servlet.ServletResponseUtil; +import com.liferay.portal.kernel.util.Validator; + +public class CommandLogin extends Command { + + public CommandLogin(String verb, String description, String... methods) { + + super(verb, description, methods); + } + + @Override + public void run(HttpServletRequest request, HttpServletResponse response) throws Exception { + + setJson(response); + readParameters(request); + String userName = (String) parameters.get(Parameters.USER_NAME); + String password = (String) parameters.get(Parameters.PASSWORD); + if (Validator.isNull(userName) || Validator.isNull(password)) { + response.sendError(HttpServletResponse.SC_BAD_REQUEST); + } else { + Sportello sportello = null; + try { + sportello = SportelloLocalServiceUtil.findByUserName(userName); + } catch (NoSuchSportelloException | SystemException e) { + } + if (Validator.isNull(sportello) || !sportello.checkPassword(password)) { + ServletResponseUtil.write(response, Response.get(Status.WRONG_USER_NAME_OR_PASSWORD)); + } else if (!sportello.isAttivo()) { + ServletResponseUtil.write(response, Response.get(Status.INACTIVE_USER)); + } else { + Map extraData = new HashMap<>(); + extraData.put(Parameters.TOKEN, new AccessToken(sportello).getToken()); + ServletResponseUtil.write(response, Response.get(Status.OK, extraData)); + } + } + } +} diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/command/CommandNop.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/command/CommandNop.java index 8535142f..378cf20b 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/command/CommandNop.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/command/CommandNop.java @@ -1,18 +1,15 @@ package it.mwg.sicilia.sue.api.v1.command; import it.mwg.sicilia.sue.api.v1.Command; +import it.mwg.sicilia.sue.api.v1.Parameters; import it.mwg.sicilia.sue.api.v1.Response; import it.mwg.sicilia.sue.api.v1.Status; -import java.io.IOException; - -import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.liferay.portal.kernel.servlet.ServletResponseUtil; -import com.liferay.portal.kernel.util.ContentTypes; -import com.liferay.portal.kernel.util.StringPool; +import com.liferay.portal.kernel.util.Validator; public class CommandNop extends Command { @@ -22,10 +19,15 @@ public class CommandNop extends Command { } @Override - public void run(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - response.setContentType(ContentTypes.APPLICATION_JSON); - response.setCharacterEncoding(StringPool.UTF8); - ServletResponseUtil.write(response, Response.get(Status.OK)); + public void run(HttpServletRequest request, HttpServletResponse response) throws Exception { + + setJson(response); + readParameters(request); + String token = (String) parameters.get(Parameters.TOKEN); + if (Validator.isNull(token)) { + response.sendError(HttpServletResponse.SC_BAD_REQUEST); + } else if (verifyAccessToken(response, token)) { + ServletResponseUtil.write(response, Response.get(Status.OK)); + } } } diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloCacheModel.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloCacheModel.java index e8fcf146..f6b7deba 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloCacheModel.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloCacheModel.java @@ -38,7 +38,7 @@ public class SportelloCacheModel implements CacheModel, Externalizable { @Override public String toString() { - StringBundler sb = new StringBundler(23); + StringBundler sb = new StringBundler(35); sb.append("{sportelloId="); sb.append(sportelloId); @@ -46,22 +46,34 @@ public class SportelloCacheModel implements CacheModel, sb.append(groupId); sb.append(", companyId="); sb.append(companyId); - sb.append(", userId="); - sb.append(userId); - sb.append(", userName="); - sb.append(userName); sb.append(", createDate="); sb.append(createDate); + sb.append(", createUserId="); + sb.append(createUserId); + sb.append(", createUserName="); + sb.append(createUserName); sb.append(", modifiedDate="); sb.append(modifiedDate); + sb.append(", modifiedUserId="); + sb.append(modifiedUserId); + sb.append(", modifiedUserName="); + sb.append(modifiedUserName); + sb.append(", userName="); + sb.append(userName); sb.append(", email="); sb.append(email); sb.append(", comuneId="); sb.append(comuneId); - sb.append(", apiKey="); - sb.append(apiKey); sb.append(", attivo="); sb.append(attivo); + sb.append(", password="); + sb.append(password); + sb.append(", passwordModifiedDate="); + sb.append(passwordModifiedDate); + sb.append(", passwordModifiedUserId="); + sb.append(passwordModifiedUserId); + sb.append(", passwordModifiedUserName="); + sb.append(passwordModifiedUserName); sb.append("}"); return sb.toString(); @@ -74,20 +86,21 @@ public class SportelloCacheModel implements CacheModel, sportelloImpl.setSportelloId(sportelloId); sportelloImpl.setGroupId(groupId); sportelloImpl.setCompanyId(companyId); - sportelloImpl.setUserId(userId); - if (userName == null) { - sportelloImpl.setUserName(StringPool.BLANK); + if (createDate == Long.MIN_VALUE) { + sportelloImpl.setCreateDate(null); } else { - sportelloImpl.setUserName(userName); + sportelloImpl.setCreateDate(new Date(createDate)); } - if (createDate == Long.MIN_VALUE) { - sportelloImpl.setCreateDate(null); + sportelloImpl.setCreateUserId(createUserId); + + if (createUserName == null) { + sportelloImpl.setCreateUserName(StringPool.BLANK); } else { - sportelloImpl.setCreateDate(new Date(createDate)); + sportelloImpl.setCreateUserName(createUserName); } if (modifiedDate == Long.MIN_VALUE) { @@ -97,6 +110,22 @@ public class SportelloCacheModel implements CacheModel, sportelloImpl.setModifiedDate(new Date(modifiedDate)); } + sportelloImpl.setModifiedUserId(modifiedUserId); + + if (modifiedUserName == null) { + sportelloImpl.setModifiedUserName(StringPool.BLANK); + } + else { + sportelloImpl.setModifiedUserName(modifiedUserName); + } + + if (userName == null) { + sportelloImpl.setUserName(StringPool.BLANK); + } + else { + sportelloImpl.setUserName(userName); + } + if (email == null) { sportelloImpl.setEmail(StringPool.BLANK); } @@ -105,15 +134,30 @@ public class SportelloCacheModel implements CacheModel, } sportelloImpl.setComuneId(comuneId); + sportelloImpl.setAttivo(attivo); - if (apiKey == null) { - sportelloImpl.setApiKey(StringPool.BLANK); + if (password == null) { + sportelloImpl.setPassword(StringPool.BLANK); } else { - sportelloImpl.setApiKey(apiKey); + sportelloImpl.setPassword(password); } - sportelloImpl.setAttivo(attivo); + if (passwordModifiedDate == Long.MIN_VALUE) { + sportelloImpl.setPasswordModifiedDate(null); + } + else { + sportelloImpl.setPasswordModifiedDate(new Date(passwordModifiedDate)); + } + + sportelloImpl.setPasswordModifiedUserId(passwordModifiedUserId); + + if (passwordModifiedUserName == null) { + sportelloImpl.setPasswordModifiedUserName(StringPool.BLANK); + } + else { + sportelloImpl.setPasswordModifiedUserName(passwordModifiedUserName); + } sportelloImpl.resetOriginalValues(); @@ -125,14 +169,20 @@ public class SportelloCacheModel implements CacheModel, sportelloId = objectInput.readLong(); groupId = objectInput.readLong(); companyId = objectInput.readLong(); - userId = objectInput.readLong(); - userName = objectInput.readUTF(); createDate = objectInput.readLong(); + createUserId = objectInput.readLong(); + createUserName = objectInput.readUTF(); modifiedDate = objectInput.readLong(); + modifiedUserId = objectInput.readLong(); + modifiedUserName = objectInput.readUTF(); + userName = objectInput.readUTF(); email = objectInput.readUTF(); comuneId = objectInput.readLong(); - apiKey = objectInput.readUTF(); attivo = objectInput.readBoolean(); + password = objectInput.readUTF(); + passwordModifiedDate = objectInput.readLong(); + passwordModifiedUserId = objectInput.readLong(); + passwordModifiedUserName = objectInput.readUTF(); } @Override @@ -141,17 +191,32 @@ public class SportelloCacheModel implements CacheModel, objectOutput.writeLong(sportelloId); objectOutput.writeLong(groupId); objectOutput.writeLong(companyId); - objectOutput.writeLong(userId); + objectOutput.writeLong(createDate); + objectOutput.writeLong(createUserId); - if (userName == null) { + if (createUserName == null) { objectOutput.writeUTF(StringPool.BLANK); } else { - objectOutput.writeUTF(userName); + objectOutput.writeUTF(createUserName); } - objectOutput.writeLong(createDate); objectOutput.writeLong(modifiedDate); + objectOutput.writeLong(modifiedUserId); + + if (modifiedUserName == null) { + objectOutput.writeUTF(StringPool.BLANK); + } + else { + objectOutput.writeUTF(modifiedUserName); + } + + if (userName == null) { + objectOutput.writeUTF(StringPool.BLANK); + } + else { + objectOutput.writeUTF(userName); + } if (email == null) { objectOutput.writeUTF(StringPool.BLANK); @@ -161,26 +226,41 @@ public class SportelloCacheModel implements CacheModel, } objectOutput.writeLong(comuneId); + objectOutput.writeBoolean(attivo); - if (apiKey == null) { + if (password == null) { objectOutput.writeUTF(StringPool.BLANK); } else { - objectOutput.writeUTF(apiKey); + objectOutput.writeUTF(password); } - objectOutput.writeBoolean(attivo); + objectOutput.writeLong(passwordModifiedDate); + objectOutput.writeLong(passwordModifiedUserId); + + if (passwordModifiedUserName == null) { + objectOutput.writeUTF(StringPool.BLANK); + } + else { + objectOutput.writeUTF(passwordModifiedUserName); + } } public long sportelloId; public long groupId; public long companyId; - public long userId; - public String userName; public long createDate; + public long createUserId; + public String createUserName; public long modifiedDate; + public long modifiedUserId; + public String modifiedUserName; + public String userName; public String email; public long comuneId; - public String apiKey; public boolean attivo; + public String password; + public long passwordModifiedDate; + public long passwordModifiedUserId; + public String passwordModifiedUserName; } \ 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/model/impl/SportelloImpl.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloImpl.java index df7f8716..69fc9d1a 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloImpl.java @@ -14,14 +14,24 @@ package it.mwg.sicilia.sue.model.impl; +import it.mwg.sicilia.sue.api.v1.ApiConstants; +import it.mwg.sicilia.sue.service.ApiSettingLocalServiceUtil; import it.tref.liferay.portos.bo.model.Comune; import it.tref.liferay.portos.bo.model.Provincia; import it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil; import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil; +import java.util.Date; + +import org.apache.commons.codec.digest.DigestUtils; + import com.liferay.portal.kernel.exception.PortalException; 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.StringPool; import com.liferay.portal.kernel.util.Validator; +import com.liferay.portal.model.User; /** * The extended model implementation for the Sportello service. Represents a row in the @@ -43,9 +53,41 @@ public class SportelloImpl extends SportelloBaseImpl { private Comune comune = null; private Provincia provincia = null; + private static final Log _log = LogFactoryUtil.getLog(SportelloImpl.class); + public SportelloImpl() { } + @Override + public String encryptPassword(String password) { + + String encrypted = StringPool.BLANK; + try { + encrypted = DigestUtils.sha256Hex(getSportelloId() + + ApiSettingLocalServiceUtil.get(getCompanyId(), ApiConstants.API_SECRET) + password); + } catch (SystemException e) { + } + return encrypted; + } + + @Override + public boolean checkPassword(String password) { + + return encryptPassword(password).equals(getPassword()); + } + + @Override + public void setEncryptedPassword(String password, User user) { + + String encrypted = encryptPassword(password); + if (!encrypted.equals(getPassword())) { + setPassword(encrypted); + setPasswordModifiedDate(new Date()); + setPasswordModifiedUserId(user.getUserId()); + setPasswordModifiedUserName(user.getFullName()); + } + }; + @Override public String getCodiceProvincia() throws PortalException, SystemException { diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloModelImpl.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloModelImpl.java index 0d5ba76c..704d901b 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloModelImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloModelImpl.java @@ -69,16 +69,22 @@ public class SportelloModelImpl extends BaseModelImpl { "sportelloId", Types.BIGINT }, { "groupId", Types.BIGINT }, { "companyId", Types.BIGINT }, - { "userId", Types.BIGINT }, - { "userName", Types.VARCHAR }, { "createDate", Types.TIMESTAMP }, + { "createUserId", Types.BIGINT }, + { "createUserName", Types.VARCHAR }, { "modifiedDate", Types.TIMESTAMP }, + { "modifiedUserId", Types.BIGINT }, + { "modifiedUserName", Types.VARCHAR }, + { "userName", Types.VARCHAR }, { "email", Types.VARCHAR }, { "comuneId", Types.BIGINT }, - { "apiKey", Types.VARCHAR }, - { "attivo", Types.BOOLEAN } + { "attivo", Types.BOOLEAN }, + { "password_", Types.VARCHAR }, + { "passwordModifiedDate", Types.TIMESTAMP }, + { "passwordModifiedUserId", Types.BIGINT }, + { "passwordModifiedUserName", Types.VARCHAR } }; - public static final String TABLE_SQL_CREATE = "create table sicilia_sue_Sportello (sportelloId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(240) null,createDate DATE null,modifiedDate DATE null,email VARCHAR(240) null,comuneId LONG,apiKey VARCHAR(240) null,attivo BOOLEAN)"; + public static final String TABLE_SQL_CREATE = "create table sicilia_sue_Sportello (sportelloId LONG not null primary key,groupId LONG,companyId LONG,createDate DATE null,createUserId LONG,createUserName VARCHAR(75) null,modifiedDate DATE null,modifiedUserId LONG,modifiedUserName VARCHAR(75) null,userName VARCHAR(75) null,email VARCHAR(240) null,comuneId LONG,attivo BOOLEAN,password_ VARCHAR(75) null,passwordModifiedDate DATE null,passwordModifiedUserId LONG,passwordModifiedUserName VARCHAR(240) null)"; public static final String TABLE_SQL_DROP = "drop table sicilia_sue_Sportello"; public static final String ORDER_BY_JPQL = " ORDER BY sportello.sportelloId ASC"; public static final String ORDER_BY_SQL = " ORDER BY sicilia_sue_Sportello.sportelloId ASC"; @@ -95,7 +101,8 @@ public class SportelloModelImpl extends BaseModelImpl "value.object.column.bitmask.enabled.it.mwg.sicilia.sue.model.Sportello"), true); public static long COMUNEID_COLUMN_BITMASK = 1L; - public static long SPORTELLOID_COLUMN_BITMASK = 2L; + public static long USERNAME_COLUMN_BITMASK = 2L; + public static long SPORTELLOID_COLUMN_BITMASK = 4L; /** * Converts the soap model instance into a normal model instance. @@ -113,14 +120,20 @@ public class SportelloModelImpl extends BaseModelImpl model.setSportelloId(soapModel.getSportelloId()); model.setGroupId(soapModel.getGroupId()); model.setCompanyId(soapModel.getCompanyId()); - model.setUserId(soapModel.getUserId()); - model.setUserName(soapModel.getUserName()); model.setCreateDate(soapModel.getCreateDate()); + model.setCreateUserId(soapModel.getCreateUserId()); + model.setCreateUserName(soapModel.getCreateUserName()); model.setModifiedDate(soapModel.getModifiedDate()); + model.setModifiedUserId(soapModel.getModifiedUserId()); + model.setModifiedUserName(soapModel.getModifiedUserName()); + model.setUserName(soapModel.getUserName()); model.setEmail(soapModel.getEmail()); model.setComuneId(soapModel.getComuneId()); - model.setApiKey(soapModel.getApiKey()); model.setAttivo(soapModel.getAttivo()); + model.setPassword(soapModel.getPassword()); + model.setPasswordModifiedDate(soapModel.getPasswordModifiedDate()); + model.setPasswordModifiedUserId(soapModel.getPasswordModifiedUserId()); + model.setPasswordModifiedUserName(soapModel.getPasswordModifiedUserName()); return model; } @@ -188,14 +201,20 @@ public class SportelloModelImpl extends BaseModelImpl attributes.put("sportelloId", getSportelloId()); attributes.put("groupId", getGroupId()); attributes.put("companyId", getCompanyId()); - attributes.put("userId", getUserId()); - attributes.put("userName", getUserName()); attributes.put("createDate", getCreateDate()); + attributes.put("createUserId", getCreateUserId()); + attributes.put("createUserName", getCreateUserName()); attributes.put("modifiedDate", getModifiedDate()); + attributes.put("modifiedUserId", getModifiedUserId()); + attributes.put("modifiedUserName", getModifiedUserName()); + attributes.put("userName", getUserName()); attributes.put("email", getEmail()); attributes.put("comuneId", getComuneId()); - attributes.put("apiKey", getApiKey()); attributes.put("attivo", getAttivo()); + attributes.put("password", getPassword()); + attributes.put("passwordModifiedDate", getPasswordModifiedDate()); + attributes.put("passwordModifiedUserId", getPasswordModifiedUserId()); + attributes.put("passwordModifiedUserName", getPasswordModifiedUserName()); return attributes; } @@ -220,22 +239,22 @@ public class SportelloModelImpl extends BaseModelImpl setCompanyId(companyId); } - Long userId = (Long)attributes.get("userId"); + Date createDate = (Date)attributes.get("createDate"); - if (userId != null) { - setUserId(userId); + if (createDate != null) { + setCreateDate(createDate); } - String userName = (String)attributes.get("userName"); + Long createUserId = (Long)attributes.get("createUserId"); - if (userName != null) { - setUserName(userName); + if (createUserId != null) { + setCreateUserId(createUserId); } - Date createDate = (Date)attributes.get("createDate"); + String createUserName = (String)attributes.get("createUserName"); - if (createDate != null) { - setCreateDate(createDate); + if (createUserName != null) { + setCreateUserName(createUserName); } Date modifiedDate = (Date)attributes.get("modifiedDate"); @@ -244,6 +263,24 @@ public class SportelloModelImpl extends BaseModelImpl setModifiedDate(modifiedDate); } + Long modifiedUserId = (Long)attributes.get("modifiedUserId"); + + if (modifiedUserId != null) { + setModifiedUserId(modifiedUserId); + } + + String modifiedUserName = (String)attributes.get("modifiedUserName"); + + if (modifiedUserName != null) { + setModifiedUserName(modifiedUserName); + } + + String userName = (String)attributes.get("userName"); + + if (userName != null) { + setUserName(userName); + } + String email = (String)attributes.get("email"); if (email != null) { @@ -256,17 +293,37 @@ public class SportelloModelImpl extends BaseModelImpl setComuneId(comuneId); } - String apiKey = (String)attributes.get("apiKey"); - - if (apiKey != null) { - setApiKey(apiKey); - } - Boolean attivo = (Boolean)attributes.get("attivo"); if (attivo != null) { setAttivo(attivo); } + + String password = (String)attributes.get("password"); + + if (password != null) { + setPassword(password); + } + + Date passwordModifiedDate = (Date)attributes.get("passwordModifiedDate"); + + if (passwordModifiedDate != null) { + setPasswordModifiedDate(passwordModifiedDate); + } + + Long passwordModifiedUserId = (Long)attributes.get( + "passwordModifiedUserId"); + + if (passwordModifiedUserId != null) { + setPasswordModifiedUserId(passwordModifiedUserId); + } + + String passwordModifiedUserName = (String)attributes.get( + "passwordModifiedUserName"); + + if (passwordModifiedUserName != null) { + setPasswordModifiedUserName(passwordModifiedUserName); + } } @JSON @@ -304,61 +361,126 @@ public class SportelloModelImpl extends BaseModelImpl @JSON @Override - public long getUserId() { - return _userId; + public Date getCreateDate() { + return _createDate; + } + + @Override + public void setCreateDate(Date createDate) { + _createDate = createDate; + } + + @JSON + @Override + public long getCreateUserId() { + return _createUserId; } @Override - public void setUserId(long userId) { - _userId = userId; + public void setCreateUserId(long createUserId) { + _createUserId = createUserId; } @Override - public String getUserUuid() throws SystemException { - return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid); + public String getCreateUserUuid() throws SystemException { + return PortalUtil.getUserValue(getCreateUserId(), "uuid", + _createUserUuid); } @Override - public void setUserUuid(String userUuid) { - _userUuid = userUuid; + public void setCreateUserUuid(String createUserUuid) { + _createUserUuid = createUserUuid; } @JSON @Override - public String getUserName() { - if (_userName == null) { + public String getCreateUserName() { + if (_createUserName == null) { return StringPool.BLANK; } else { - return _userName; + return _createUserName; } } @Override - public void setUserName(String userName) { - _userName = userName; + public void setCreateUserName(String createUserName) { + _createUserName = createUserName; } @JSON @Override - public Date getCreateDate() { - return _createDate; + public Date getModifiedDate() { + return _modifiedDate; } @Override - public void setCreateDate(Date createDate) { - _createDate = createDate; + public void setModifiedDate(Date modifiedDate) { + _modifiedDate = modifiedDate; } @JSON @Override - public Date getModifiedDate() { - return _modifiedDate; + public long getModifiedUserId() { + return _modifiedUserId; } @Override - public void setModifiedDate(Date modifiedDate) { - _modifiedDate = modifiedDate; + public void setModifiedUserId(long modifiedUserId) { + _modifiedUserId = modifiedUserId; + } + + @Override + public String getModifiedUserUuid() throws SystemException { + return PortalUtil.getUserValue(getModifiedUserId(), "uuid", + _modifiedUserUuid); + } + + @Override + public void setModifiedUserUuid(String modifiedUserUuid) { + _modifiedUserUuid = modifiedUserUuid; + } + + @JSON + @Override + public String getModifiedUserName() { + if (_modifiedUserName == null) { + return StringPool.BLANK; + } + else { + return _modifiedUserName; + } + } + + @Override + public void setModifiedUserName(String modifiedUserName) { + _modifiedUserName = modifiedUserName; + } + + @JSON + @Override + public String getUserName() { + if (_userName == null) { + return StringPool.BLANK; + } + else { + return _userName; + } + } + + @Override + public void setUserName(String userName) { + _columnBitmask |= USERNAME_COLUMN_BITMASK; + + if (_originalUserName == null) { + _originalUserName = _userName; + } + + _userName = userName; + } + + public String getOriginalUserName() { + return GetterUtil.getString(_originalUserName); } @JSON @@ -402,34 +524,83 @@ public class SportelloModelImpl extends BaseModelImpl @JSON @Override - public String getApiKey() { - if (_apiKey == null) { + public boolean getAttivo() { + return _attivo; + } + + @Override + public boolean isAttivo() { + return _attivo; + } + + @Override + public void setAttivo(boolean attivo) { + _attivo = attivo; + } + + @JSON + @Override + public String getPassword() { + if (_password == null) { return StringPool.BLANK; } else { - return _apiKey; + return _password; } } @Override - public void setApiKey(String apiKey) { - _apiKey = apiKey; + public void setPassword(String password) { + _password = password; } @JSON @Override - public boolean getAttivo() { - return _attivo; + public Date getPasswordModifiedDate() { + return _passwordModifiedDate; } @Override - public boolean isAttivo() { - return _attivo; + public void setPasswordModifiedDate(Date passwordModifiedDate) { + _passwordModifiedDate = passwordModifiedDate; } + @JSON @Override - public void setAttivo(boolean attivo) { - _attivo = attivo; + public long getPasswordModifiedUserId() { + return _passwordModifiedUserId; + } + + @Override + public void setPasswordModifiedUserId(long passwordModifiedUserId) { + _passwordModifiedUserId = passwordModifiedUserId; + } + + @Override + public String getPasswordModifiedUserUuid() throws SystemException { + return PortalUtil.getUserValue(getPasswordModifiedUserId(), "uuid", + _passwordModifiedUserUuid); + } + + @Override + public void setPasswordModifiedUserUuid(String passwordModifiedUserUuid) { + _passwordModifiedUserUuid = passwordModifiedUserUuid; + } + + @JSON + @Override + public String getPasswordModifiedUserName() { + if (_passwordModifiedUserName == null) { + return StringPool.BLANK; + } + else { + return _passwordModifiedUserName; + } + } + + @Override + public void setPasswordModifiedUserName(String passwordModifiedUserName) { + _passwordModifiedUserName = passwordModifiedUserName; } public long getColumnBitmask() { @@ -466,14 +637,20 @@ public class SportelloModelImpl extends BaseModelImpl sportelloImpl.setSportelloId(getSportelloId()); sportelloImpl.setGroupId(getGroupId()); sportelloImpl.setCompanyId(getCompanyId()); - sportelloImpl.setUserId(getUserId()); - sportelloImpl.setUserName(getUserName()); sportelloImpl.setCreateDate(getCreateDate()); + sportelloImpl.setCreateUserId(getCreateUserId()); + sportelloImpl.setCreateUserName(getCreateUserName()); sportelloImpl.setModifiedDate(getModifiedDate()); + sportelloImpl.setModifiedUserId(getModifiedUserId()); + sportelloImpl.setModifiedUserName(getModifiedUserName()); + sportelloImpl.setUserName(getUserName()); sportelloImpl.setEmail(getEmail()); sportelloImpl.setComuneId(getComuneId()); - sportelloImpl.setApiKey(getApiKey()); sportelloImpl.setAttivo(getAttivo()); + sportelloImpl.setPassword(getPassword()); + sportelloImpl.setPasswordModifiedDate(getPasswordModifiedDate()); + sportelloImpl.setPasswordModifiedUserId(getPasswordModifiedUserId()); + sportelloImpl.setPasswordModifiedUserName(getPasswordModifiedUserName()); sportelloImpl.resetOriginalValues(); @@ -526,6 +703,8 @@ public class SportelloModelImpl extends BaseModelImpl public void resetOriginalValues() { SportelloModelImpl sportelloModelImpl = this; + sportelloModelImpl._originalUserName = sportelloModelImpl._userName; + sportelloModelImpl._originalComuneId = sportelloModelImpl._comuneId; sportelloModelImpl._setOriginalComuneId = false; @@ -543,16 +722,6 @@ public class SportelloModelImpl extends BaseModelImpl sportelloCacheModel.companyId = getCompanyId(); - sportelloCacheModel.userId = getUserId(); - - sportelloCacheModel.userName = getUserName(); - - String userName = sportelloCacheModel.userName; - - if ((userName != null) && (userName.length() == 0)) { - sportelloCacheModel.userName = null; - } - Date createDate = getCreateDate(); if (createDate != null) { @@ -562,6 +731,16 @@ public class SportelloModelImpl extends BaseModelImpl sportelloCacheModel.createDate = Long.MIN_VALUE; } + sportelloCacheModel.createUserId = getCreateUserId(); + + sportelloCacheModel.createUserName = getCreateUserName(); + + String createUserName = sportelloCacheModel.createUserName; + + if ((createUserName != null) && (createUserName.length() == 0)) { + sportelloCacheModel.createUserName = null; + } + Date modifiedDate = getModifiedDate(); if (modifiedDate != null) { @@ -571,6 +750,24 @@ public class SportelloModelImpl extends BaseModelImpl sportelloCacheModel.modifiedDate = Long.MIN_VALUE; } + sportelloCacheModel.modifiedUserId = getModifiedUserId(); + + sportelloCacheModel.modifiedUserName = getModifiedUserName(); + + String modifiedUserName = sportelloCacheModel.modifiedUserName; + + if ((modifiedUserName != null) && (modifiedUserName.length() == 0)) { + sportelloCacheModel.modifiedUserName = null; + } + + sportelloCacheModel.userName = getUserName(); + + String userName = sportelloCacheModel.userName; + + if ((userName != null) && (userName.length() == 0)) { + sportelloCacheModel.userName = null; + } + sportelloCacheModel.email = getEmail(); String email = sportelloCacheModel.email; @@ -581,22 +778,42 @@ public class SportelloModelImpl extends BaseModelImpl sportelloCacheModel.comuneId = getComuneId(); - sportelloCacheModel.apiKey = getApiKey(); + sportelloCacheModel.attivo = getAttivo(); + + sportelloCacheModel.password = getPassword(); - String apiKey = sportelloCacheModel.apiKey; + String password = sportelloCacheModel.password; - if ((apiKey != null) && (apiKey.length() == 0)) { - sportelloCacheModel.apiKey = null; + if ((password != null) && (password.length() == 0)) { + sportelloCacheModel.password = null; } - sportelloCacheModel.attivo = getAttivo(); + Date passwordModifiedDate = getPasswordModifiedDate(); + + if (passwordModifiedDate != null) { + sportelloCacheModel.passwordModifiedDate = passwordModifiedDate.getTime(); + } + else { + sportelloCacheModel.passwordModifiedDate = Long.MIN_VALUE; + } + + sportelloCacheModel.passwordModifiedUserId = getPasswordModifiedUserId(); + + sportelloCacheModel.passwordModifiedUserName = getPasswordModifiedUserName(); + + String passwordModifiedUserName = sportelloCacheModel.passwordModifiedUserName; + + if ((passwordModifiedUserName != null) && + (passwordModifiedUserName.length() == 0)) { + sportelloCacheModel.passwordModifiedUserName = null; + } return sportelloCacheModel; } @Override public String toString() { - StringBundler sb = new StringBundler(23); + StringBundler sb = new StringBundler(35); sb.append("{sportelloId="); sb.append(getSportelloId()); @@ -604,22 +821,34 @@ public class SportelloModelImpl extends BaseModelImpl sb.append(getGroupId()); sb.append(", companyId="); sb.append(getCompanyId()); - sb.append(", userId="); - sb.append(getUserId()); - sb.append(", userName="); - sb.append(getUserName()); sb.append(", createDate="); sb.append(getCreateDate()); + sb.append(", createUserId="); + sb.append(getCreateUserId()); + sb.append(", createUserName="); + sb.append(getCreateUserName()); sb.append(", modifiedDate="); sb.append(getModifiedDate()); + sb.append(", modifiedUserId="); + sb.append(getModifiedUserId()); + sb.append(", modifiedUserName="); + sb.append(getModifiedUserName()); + sb.append(", userName="); + sb.append(getUserName()); sb.append(", email="); sb.append(getEmail()); sb.append(", comuneId="); sb.append(getComuneId()); - sb.append(", apiKey="); - sb.append(getApiKey()); sb.append(", attivo="); sb.append(getAttivo()); + sb.append(", password="); + sb.append(getPassword()); + sb.append(", passwordModifiedDate="); + sb.append(getPasswordModifiedDate()); + sb.append(", passwordModifiedUserId="); + sb.append(getPasswordModifiedUserId()); + sb.append(", passwordModifiedUserName="); + sb.append(getPasswordModifiedUserName()); sb.append("}"); return sb.toString(); @@ -627,7 +856,7 @@ public class SportelloModelImpl extends BaseModelImpl @Override public String toXmlString() { - StringBundler sb = new StringBundler(37); + StringBundler sb = new StringBundler(55); sb.append(""); sb.append("it.mwg.sicilia.sue.model.Sportello"); @@ -646,21 +875,33 @@ public class SportelloModelImpl extends BaseModelImpl sb.append(getCompanyId()); sb.append("]]>"); sb.append( - "userIdcreateDate"); sb.append( - "userNamecreateUserId"); sb.append( - "createDatecreateUserName"); sb.append( "modifiedDate"); + sb.append( + "modifiedUserId"); + sb.append( + "modifiedUserName"); + sb.append( + "userName"); sb.append( "email "comuneId"); - sb.append( - "apiKey"); sb.append( "attivo"); + sb.append( + "password"); + sb.append( + "passwordModifiedDate"); + sb.append( + "passwordModifiedUserId"); + sb.append( + "passwordModifiedUserName"); sb.append(""); @@ -690,17 +943,26 @@ public class SportelloModelImpl extends BaseModelImpl 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 @@ - + + + + + + + + + + + + + +