Salvatore La Manna 3 anni fa
parent
commit
7d71fa0d4d
  1. BIN
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/lib/sicilia-sue-connector-portlet-service.jar
  2. 21
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service.xml
  3. 40
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/ExpiredTokenException.java
  4. 40
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/InactiveSportelloException.java
  5. 40
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/InvalidTokenException.java
  6. 7
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/Sportello.java
  7. 487
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloClp.java
  8. 216
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloModel.java
  9. 112
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloSoap.java
  10. 370
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloWrapper.java
  11. 12
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ClpSerializer.java
  12. 5
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloLocalService.java
  13. 41
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloLocalServiceClp.java
  14. 7
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloLocalServiceUtil.java
  15. 8
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloLocalServiceWrapper.java
  16. 2
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloService.java
  17. 29
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloServiceClp.java
  18. 4
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloServiceUtil.java
  19. 5
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/SportelloServiceWrapper.java
  20. 58
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/SportelloPersistence.java
  21. 68
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/SportelloUtil.java
  22. 3
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/indexes.properties
  23. 3
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/indexes.sql
  24. 14
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/tables.sql
  25. 12
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-hbm.xml
  26. 16
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-model-hints.xml
  27. 20
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-orm.xml
  28. 3
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/content/Language.properties
  29. 99
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/AccessToken.java
  30. 46
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiServlet.java
  31. 7
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiUtil.java
  32. 56
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Command.java
  33. 3
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Commands.java
  34. 10
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Parameters.java
  35. 2
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Response.java
  36. 13
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Status.java
  37. 56
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/command/CommandLogin.java
  38. 22
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/command/CommandNop.java
  39. 142
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloCacheModel.java
  40. 42
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloImpl.java
  41. 460
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloModelImpl.java
  42. 27
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/portlet/SueAdministrationPortlet.java
  43. 11
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloLocalServiceClpInvoker.java
  44. 11
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloServiceClpInvoker.java
  45. 22
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/http/SportelloServiceSoap.java
  46. 3
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/ApiSettingLocalServiceImpl.java
  47. 21
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/SportelloLocalServiceImpl.java
  48. 43
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/SportelloServiceImpl.java
  49. 297
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/persistence/SportelloPersistenceImpl.java
  50. 2
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/startup/Startup.java
  51. 4
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/service.properties
  52. 37
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/administration/edit_sportello.jsp
  53. 25
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/administration/view.jsp

BIN
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/lib/sicilia-sue-connector-portlet-service.jar

File binario non mostrato.

21
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service.xml

@ -10,20 +10,30 @@
<column name="groupId" type="long" /> <column name="groupId" type="long" />
<!-- Audit fields --> <!-- Audit fields -->
<column name="companyId" type="long" /> <column name="companyId" type="long" />
<column name="userId" type="long" />
<column name="userName" type="String" />
<column name="createDate" type="Date" /> <column name="createDate" type="Date" />
<column name="createUserId" type="long" />
<column name="createUserName" type="String" />
<column name="modifiedDate" type="Date" /> <column name="modifiedDate" type="Date" />
<column name="modifiedUserId" type="long" />
<column name="modifiedUserName" type="String" />
<!-- Other fields --> <!-- Other fields -->
<column name="userName" type="String" />
<column name="email" type="String" /> <column name="email" type="String" />
<column name="comuneId" type="long" /> <column name="comuneId" type="long" />
<column name="apiKey" type="String" />
<column name="attivo" type="boolean" /> <column name="attivo" type="boolean" />
<!-- Password -->
<column name="password" type="String" />
<column name="passwordModifiedDate" type="Date" />
<column name="passwordModifiedUserId" type="long" />
<column name="passwordModifiedUserName" type="String" />
<!-- Order --> <!-- Order -->
<!-- Finder methods --> <!-- Finder methods -->
<finder return-type="Sportello" name="ComuneId" unique="true"> <finder return-type="Sportello" name="ComuneId" unique="true">
<finder-column name="comuneId" /> <finder-column name="comuneId" />
</finder> </finder>
<finder return-type="Sportello" name="UserName" unique="true">
<finder-column name="userName" />
</finder>
</entity> </entity>
<entity name="ApiSetting" local-service="true" remote-service="true"> <entity name="ApiSetting" local-service="true" remote-service="true">
<column name="id" type="long" primary="true" /> <column name="id" type="long" primary="true" />
@ -35,4 +45,9 @@
<finder-column name="key" /> <finder-column name="key" />
</finder> </finder>
</entity> </entity>
<exceptions>
<exception>ExpiredToken</exception>
<exception>InactiveSportello</exception>
<exception>InvalidToken</exception>
</exceptions>
</service-builder> </service-builder>

40
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);
}
}

40
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);
}
}

40
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);
}
}

7
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. * 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() public java.lang.String getCodiceProvincia()
throws com.liferay.portal.kernel.exception.PortalException, throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException; com.liferay.portal.kernel.exception.SystemException;

487
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<Sportello> implements Sportello
attributes.put("sportelloId", getSportelloId()); attributes.put("sportelloId", getSportelloId());
attributes.put("groupId", getGroupId()); attributes.put("groupId", getGroupId());
attributes.put("companyId", getCompanyId()); attributes.put("companyId", getCompanyId());
attributes.put("userId", getUserId());
attributes.put("userName", getUserName());
attributes.put("createDate", getCreateDate()); attributes.put("createDate", getCreateDate());
attributes.put("createUserId", getCreateUserId());
attributes.put("createUserName", getCreateUserName());
attributes.put("modifiedDate", getModifiedDate()); attributes.put("modifiedDate", getModifiedDate());
attributes.put("modifiedUserId", getModifiedUserId());
attributes.put("modifiedUserName", getModifiedUserName());
attributes.put("userName", getUserName());
attributes.put("email", getEmail()); attributes.put("email", getEmail());
attributes.put("comuneId", getComuneId()); attributes.put("comuneId", getComuneId());
attributes.put("apiKey", getApiKey());
attributes.put("attivo", getAttivo()); attributes.put("attivo", getAttivo());
attributes.put("password", getPassword());
attributes.put("passwordModifiedDate", getPasswordModifiedDate());
attributes.put("passwordModifiedUserId", getPasswordModifiedUserId());
attributes.put("passwordModifiedUserName", getPasswordModifiedUserName());
return attributes; return attributes;
} }
@ -109,22 +115,22 @@ public class SportelloClp extends BaseModelImpl<Sportello> implements Sportello
setCompanyId(companyId); setCompanyId(companyId);
} }
Long userId = (Long)attributes.get("userId"); Date createDate = (Date)attributes.get("createDate");
if (userId != null) { if (createDate != null) {
setUserId(userId); setCreateDate(createDate);
} }
String userName = (String)attributes.get("userName"); Long createUserId = (Long)attributes.get("createUserId");
if (userName != null) { if (createUserId != null) {
setUserName(userName); setCreateUserId(createUserId);
} }
Date createDate = (Date)attributes.get("createDate"); String createUserName = (String)attributes.get("createUserName");
if (createDate != null) { if (createUserName != null) {
setCreateDate(createDate); setCreateUserName(createUserName);
} }
Date modifiedDate = (Date)attributes.get("modifiedDate"); Date modifiedDate = (Date)attributes.get("modifiedDate");
@ -133,6 +139,24 @@ public class SportelloClp extends BaseModelImpl<Sportello> implements Sportello
setModifiedDate(modifiedDate); 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"); String email = (String)attributes.get("email");
if (email != null) { if (email != null) {
@ -145,17 +169,37 @@ public class SportelloClp extends BaseModelImpl<Sportello> implements Sportello
setComuneId(comuneId); setComuneId(comuneId);
} }
String apiKey = (String)attributes.get("apiKey");
if (apiKey != null) {
setApiKey(apiKey);
}
Boolean attivo = (Boolean)attributes.get("attivo"); Boolean attivo = (Boolean)attributes.get("attivo");
if (attivo != null) { if (attivo != null) {
setAttivo(attivo); 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 @Override
@ -228,21 +272,21 @@ public class SportelloClp extends BaseModelImpl<Sportello> implements Sportello
} }
@Override @Override
public long getUserId() { public Date getCreateDate() {
return _userId; return _createDate;
} }
@Override @Override
public void setUserId(long userId) { public void setCreateDate(Date createDate) {
_userId = userId; _createDate = createDate;
if (_sportelloRemoteModel != null) { if (_sportelloRemoteModel != null) {
try { try {
Class<?> clazz = _sportelloRemoteModel.getClass(); 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) { catch (Exception e) {
throw new UnsupportedOperationException(e); throw new UnsupportedOperationException(e);
@ -251,31 +295,21 @@ public class SportelloClp extends BaseModelImpl<Sportello> implements Sportello
} }
@Override @Override
public String getUserUuid() throws SystemException { public long getCreateUserId() {
return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid); return _createUserId;
}
@Override
public void setUserUuid(String userUuid) {
_userUuid = userUuid;
}
@Override
public String getUserName() {
return _userName;
} }
@Override @Override
public void setUserName(String userName) { public void setCreateUserId(long createUserId) {
_userName = userName; _createUserId = createUserId;
if (_sportelloRemoteModel != null) { if (_sportelloRemoteModel != null) {
try { try {
Class<?> clazz = _sportelloRemoteModel.getClass(); 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) { catch (Exception e) {
throw new UnsupportedOperationException(e); throw new UnsupportedOperationException(e);
@ -284,21 +318,33 @@ public class SportelloClp extends BaseModelImpl<Sportello> implements Sportello
} }
@Override @Override
public Date getCreateDate() { public String getCreateUserUuid() throws SystemException {
return _createDate; return PortalUtil.getUserValue(getCreateUserId(), "uuid",
_createUserUuid);
} }
@Override @Override
public void setCreateDate(Date createDate) { public void setCreateUserUuid(String createUserUuid) {
_createDate = createDate; _createUserUuid = createUserUuid;
}
@Override
public String getCreateUserName() {
return _createUserName;
}
@Override
public void setCreateUserName(String createUserName) {
_createUserName = createUserName;
if (_sportelloRemoteModel != null) { if (_sportelloRemoteModel != null) {
try { try {
Class<?> clazz = _sportelloRemoteModel.getClass(); 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) { catch (Exception e) {
throw new UnsupportedOperationException(e); throw new UnsupportedOperationException(e);
@ -329,6 +375,87 @@ public class SportelloClp extends BaseModelImpl<Sportello> 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 @Override
public String getEmail() { public String getEmail() {
return _email; return _email;
@ -376,21 +503,49 @@ public class SportelloClp extends BaseModelImpl<Sportello> implements Sportello
} }
@Override @Override
public String getApiKey() { public boolean getAttivo() {
return _apiKey; 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 @Override
public void setApiKey(String apiKey) { public void setPassword(String password) {
_apiKey = apiKey; _password = password;
if (_sportelloRemoteModel != null) { if (_sportelloRemoteModel != null) {
try { try {
Class<?> clazz = _sportelloRemoteModel.getClass(); 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) { catch (Exception e) {
throw new UnsupportedOperationException(e); throw new UnsupportedOperationException(e);
@ -399,26 +554,81 @@ public class SportelloClp extends BaseModelImpl<Sportello> implements Sportello
} }
@Override @Override
public boolean getAttivo() { public Date getPasswordModifiedDate() {
return _attivo; return _passwordModifiedDate;
} }
@Override @Override
public boolean isAttivo() { public void setPasswordModifiedDate(Date passwordModifiedDate) {
return _attivo; _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 @Override
public void setAttivo(boolean attivo) { public long getPasswordModifiedUserId() {
_attivo = attivo; return _passwordModifiedUserId;
}
@Override
public void setPasswordModifiedUserId(long passwordModifiedUserId) {
_passwordModifiedUserId = passwordModifiedUserId;
if (_sportelloRemoteModel != null) { if (_sportelloRemoteModel != null) {
try { try {
Class<?> clazz = _sportelloRemoteModel.getClass(); 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) { catch (Exception e) {
throw new UnsupportedOperationException(e); throw new UnsupportedOperationException(e);
@ -426,6 +636,25 @@ public class SportelloClp extends BaseModelImpl<Sportello> 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 @Override
public java.lang.String getNomeComune() { public java.lang.String getNomeComune() {
try { try {
@ -483,6 +712,44 @@ public class SportelloClp extends BaseModelImpl<Sportello> 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() { public BaseModel<?> getSportelloRemoteModel() {
return _sportelloRemoteModel; return _sportelloRemoteModel;
} }
@ -555,14 +822,20 @@ public class SportelloClp extends BaseModelImpl<Sportello> implements Sportello
clone.setSportelloId(getSportelloId()); clone.setSportelloId(getSportelloId());
clone.setGroupId(getGroupId()); clone.setGroupId(getGroupId());
clone.setCompanyId(getCompanyId()); clone.setCompanyId(getCompanyId());
clone.setUserId(getUserId());
clone.setUserName(getUserName());
clone.setCreateDate(getCreateDate()); clone.setCreateDate(getCreateDate());
clone.setCreateUserId(getCreateUserId());
clone.setCreateUserName(getCreateUserName());
clone.setModifiedDate(getModifiedDate()); clone.setModifiedDate(getModifiedDate());
clone.setModifiedUserId(getModifiedUserId());
clone.setModifiedUserName(getModifiedUserName());
clone.setUserName(getUserName());
clone.setEmail(getEmail()); clone.setEmail(getEmail());
clone.setComuneId(getComuneId()); clone.setComuneId(getComuneId());
clone.setApiKey(getApiKey());
clone.setAttivo(getAttivo()); clone.setAttivo(getAttivo());
clone.setPassword(getPassword());
clone.setPasswordModifiedDate(getPasswordModifiedDate());
clone.setPasswordModifiedUserId(getPasswordModifiedUserId());
clone.setPasswordModifiedUserName(getPasswordModifiedUserName());
return clone; return clone;
} }
@ -615,7 +888,7 @@ public class SportelloClp extends BaseModelImpl<Sportello> implements Sportello
@Override @Override
public String toString() { public String toString() {
StringBundler sb = new StringBundler(23); StringBundler sb = new StringBundler(35);
sb.append("{sportelloId="); sb.append("{sportelloId=");
sb.append(getSportelloId()); sb.append(getSportelloId());
@ -623,22 +896,34 @@ public class SportelloClp extends BaseModelImpl<Sportello> implements Sportello
sb.append(getGroupId()); sb.append(getGroupId());
sb.append(", companyId="); sb.append(", companyId=");
sb.append(getCompanyId()); sb.append(getCompanyId());
sb.append(", userId=");
sb.append(getUserId());
sb.append(", userName=");
sb.append(getUserName());
sb.append(", createDate="); sb.append(", createDate=");
sb.append(getCreateDate()); sb.append(getCreateDate());
sb.append(", createUserId=");
sb.append(getCreateUserId());
sb.append(", createUserName=");
sb.append(getCreateUserName());
sb.append(", modifiedDate="); sb.append(", modifiedDate=");
sb.append(getModifiedDate()); 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(", email=");
sb.append(getEmail()); sb.append(getEmail());
sb.append(", comuneId="); sb.append(", comuneId=");
sb.append(getComuneId()); sb.append(getComuneId());
sb.append(", apiKey=");
sb.append(getApiKey());
sb.append(", attivo="); sb.append(", attivo=");
sb.append(getAttivo()); 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("}"); sb.append("}");
return sb.toString(); return sb.toString();
@ -646,7 +931,7 @@ public class SportelloClp extends BaseModelImpl<Sportello> implements Sportello
@Override @Override
public String toXmlString() { public String toXmlString() {
StringBundler sb = new StringBundler(37); StringBundler sb = new StringBundler(55);
sb.append("<model><model-name>"); sb.append("<model><model-name>");
sb.append("it.mwg.sicilia.sue.model.Sportello"); sb.append("it.mwg.sicilia.sue.model.Sportello");
@ -665,21 +950,33 @@ public class SportelloClp extends BaseModelImpl<Sportello> implements Sportello
sb.append(getCompanyId()); sb.append(getCompanyId());
sb.append("]]></column-value></column>"); sb.append("]]></column-value></column>");
sb.append( sb.append(
"<column><column-name>userId</column-name><column-value><![CDATA["); "<column><column-name>createDate</column-name><column-value><![CDATA[");
sb.append(getUserId()); sb.append(getCreateDate());
sb.append("]]></column-value></column>"); sb.append("]]></column-value></column>");
sb.append( sb.append(
"<column><column-name>userName</column-name><column-value><![CDATA["); "<column><column-name>createUserId</column-name><column-value><![CDATA[");
sb.append(getUserName()); sb.append(getCreateUserId());
sb.append("]]></column-value></column>"); sb.append("]]></column-value></column>");
sb.append( sb.append(
"<column><column-name>createDate</column-name><column-value><![CDATA["); "<column><column-name>createUserName</column-name><column-value><![CDATA[");
sb.append(getCreateDate()); sb.append(getCreateUserName());
sb.append("]]></column-value></column>"); sb.append("]]></column-value></column>");
sb.append( sb.append(
"<column><column-name>modifiedDate</column-name><column-value><![CDATA["); "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
sb.append(getModifiedDate()); sb.append(getModifiedDate());
sb.append("]]></column-value></column>"); sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>modifiedUserId</column-name><column-value><![CDATA[");
sb.append(getModifiedUserId());
sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>modifiedUserName</column-name><column-value><![CDATA[");
sb.append(getModifiedUserName());
sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>userName</column-name><column-value><![CDATA[");
sb.append(getUserName());
sb.append("]]></column-value></column>");
sb.append( sb.append(
"<column><column-name>email</column-name><column-value><![CDATA["); "<column><column-name>email</column-name><column-value><![CDATA[");
sb.append(getEmail()); sb.append(getEmail());
@ -688,14 +985,26 @@ public class SportelloClp extends BaseModelImpl<Sportello> implements Sportello
"<column><column-name>comuneId</column-name><column-value><![CDATA["); "<column><column-name>comuneId</column-name><column-value><![CDATA[");
sb.append(getComuneId()); sb.append(getComuneId());
sb.append("]]></column-value></column>"); sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>apiKey</column-name><column-value><![CDATA[");
sb.append(getApiKey());
sb.append("]]></column-value></column>");
sb.append( sb.append(
"<column><column-name>attivo</column-name><column-value><![CDATA["); "<column><column-name>attivo</column-name><column-value><![CDATA[");
sb.append(getAttivo()); sb.append(getAttivo());
sb.append("]]></column-value></column>"); sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>password</column-name><column-value><![CDATA[");
sb.append(getPassword());
sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>passwordModifiedDate</column-name><column-value><![CDATA[");
sb.append(getPasswordModifiedDate());
sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>passwordModifiedUserId</column-name><column-value><![CDATA[");
sb.append(getPasswordModifiedUserId());
sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>passwordModifiedUserName</column-name><column-value><![CDATA[");
sb.append(getPasswordModifiedUserName());
sb.append("]]></column-value></column>");
sb.append("</model>"); sb.append("</model>");
@ -705,15 +1014,23 @@ public class SportelloClp extends BaseModelImpl<Sportello> implements Sportello
private long _sportelloId; private long _sportelloId;
private long _groupId; private long _groupId;
private long _companyId; private long _companyId;
private long _userId;
private String _userUuid;
private String _userName;
private Date _createDate; private Date _createDate;
private long _createUserId;
private String _createUserUuid;
private String _createUserName;
private Date _modifiedDate; private Date _modifiedDate;
private long _modifiedUserId;
private String _modifiedUserUuid;
private String _modifiedUserName;
private String _userName;
private String _email; private String _email;
private long _comuneId; private long _comuneId;
private String _apiKey;
private boolean _attivo; private boolean _attivo;
private String _password;
private Date _passwordModifiedDate;
private long _passwordModifiedUserId;
private String _passwordModifiedUserUuid;
private String _passwordModifiedUserName;
private BaseModel<?> _sportelloRemoteModel; private BaseModel<?> _sportelloRemoteModel;
private Class<?> _clpSerializerClass = it.mwg.sicilia.sue.service.ClpSerializer.class; private Class<?> _clpSerializerClass = it.mwg.sicilia.sue.service.ClpSerializer.class;
} }

216
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.kernel.exception.SystemException;
import com.liferay.portal.model.BaseModel; import com.liferay.portal.model.BaseModel;
import com.liferay.portal.model.CacheModel; import com.liferay.portal.model.CacheModel;
import com.liferay.portal.model.GroupedModel;
import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContext;
import com.liferay.portlet.expando.model.ExpandoBridge; import com.liferay.portlet.expando.model.ExpandoBridge;
@ -40,7 +39,7 @@ import java.util.Date;
* @see it.mwg.sicilia.sue.model.impl.SportelloModelImpl * @see it.mwg.sicilia.sue.model.impl.SportelloModelImpl
* @generated * @generated
*/ */
public interface SportelloModel extends BaseModel<Sportello>, GroupedModel { public interface SportelloModel extends BaseModel<Sportello> {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS:
* *
@ -80,7 +79,6 @@ public interface SportelloModel extends BaseModel<Sportello>, GroupedModel {
* *
* @return the group ID of this sportello * @return the group ID of this sportello
*/ */
@Override
public long getGroupId(); public long getGroupId();
/** /**
@ -88,7 +86,6 @@ public interface SportelloModel extends BaseModel<Sportello>, GroupedModel {
* *
* @param groupId the group ID of this sportello * @param groupId the group ID of this sportello
*/ */
@Override
public void setGroupId(long groupId); public void setGroupId(long groupId);
/** /**
@ -96,7 +93,6 @@ public interface SportelloModel extends BaseModel<Sportello>, GroupedModel {
* *
* @return the company ID of this sportello * @return the company ID of this sportello
*/ */
@Override
public long getCompanyId(); public long getCompanyId();
/** /**
@ -104,81 +100,71 @@ public interface SportelloModel extends BaseModel<Sportello>, GroupedModel {
* *
* @param companyId the company ID of this sportello * @param companyId the company ID of this sportello
*/ */
@Override
public void setCompanyId(long companyId); 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 Date getCreateDate();
public long getUserId();
/** /**
* 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 setCreateDate(Date createDate);
public void setUserId(long userId);
/** /**
* Returns the user uuid of this sportello. * Returns the create user ID of this sportello.
* *
* @return the user uuid of this sportello * @return the create user ID of this sportello
* @throws SystemException if a system exception occurred
*/ */
@Override public long getCreateUserId();
public String getUserUuid() throws SystemException;
/** /**
* 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 setCreateUserId(long createUserId);
public void setUserUuid(String userUuid);
/** /**
* 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 public String getCreateUserUuid() throws SystemException;
@Override
public String getUserName();
/** /**
* 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 setCreateUserUuid(String createUserUuid);
public void setUserName(String userName);
/** /**
* 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 @AutoEscape
public Date getCreateDate(); 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 setCreateUserName(String createUserName);
public void setCreateDate(Date createDate);
/** /**
* Returns the modified date of this sportello. * Returns the modified date of this sportello.
* *
* @return the modified date of this sportello * @return the modified date of this sportello
*/ */
@Override
public Date getModifiedDate(); public Date getModifiedDate();
/** /**
@ -186,9 +172,67 @@ public interface SportelloModel extends BaseModel<Sportello>, GroupedModel {
* *
* @param modifiedDate the modified date of this sportello * @param modifiedDate the modified date of this sportello
*/ */
@Override
public void setModifiedDate(Date modifiedDate); 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. * Returns the email of this sportello.
* *
@ -218,21 +262,6 @@ public interface SportelloModel extends BaseModel<Sportello>, GroupedModel {
*/ */
public void setComuneId(long comuneId); 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. * Returns the attivo of this sportello.
* *
@ -254,6 +283,79 @@ public interface SportelloModel extends BaseModel<Sportello>, GroupedModel {
*/ */
public void setAttivo(boolean attivo); 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 @Override
public boolean isNew(); public boolean isNew();

112
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.setSportelloId(model.getSportelloId());
soapModel.setGroupId(model.getGroupId()); soapModel.setGroupId(model.getGroupId());
soapModel.setCompanyId(model.getCompanyId()); soapModel.setCompanyId(model.getCompanyId());
soapModel.setUserId(model.getUserId());
soapModel.setUserName(model.getUserName());
soapModel.setCreateDate(model.getCreateDate()); soapModel.setCreateDate(model.getCreateDate());
soapModel.setCreateUserId(model.getCreateUserId());
soapModel.setCreateUserName(model.getCreateUserName());
soapModel.setModifiedDate(model.getModifiedDate()); soapModel.setModifiedDate(model.getModifiedDate());
soapModel.setModifiedUserId(model.getModifiedUserId());
soapModel.setModifiedUserName(model.getModifiedUserName());
soapModel.setUserName(model.getUserName());
soapModel.setEmail(model.getEmail()); soapModel.setEmail(model.getEmail());
soapModel.setComuneId(model.getComuneId()); soapModel.setComuneId(model.getComuneId());
soapModel.setApiKey(model.getApiKey());
soapModel.setAttivo(model.getAttivo()); soapModel.setAttivo(model.getAttivo());
soapModel.setPassword(model.getPassword());
soapModel.setPasswordModifiedDate(model.getPasswordModifiedDate());
soapModel.setPasswordModifiedUserId(model.getPasswordModifiedUserId());
soapModel.setPasswordModifiedUserName(model.getPasswordModifiedUserName());
return soapModel; return soapModel;
} }
@ -118,28 +124,28 @@ public class SportelloSoap implements Serializable {
_companyId = companyId; _companyId = companyId;
} }
public long getUserId() { public Date getCreateDate() {
return _userId; return _createDate;
} }
public void setUserId(long userId) { public void setCreateDate(Date createDate) {
_userId = userId; _createDate = createDate;
} }
public String getUserName() { public long getCreateUserId() {
return _userName; return _createUserId;
} }
public void setUserName(String userName) { public void setCreateUserId(long createUserId) {
_userName = userName; _createUserId = createUserId;
} }
public Date getCreateDate() { public String getCreateUserName() {
return _createDate; return _createUserName;
} }
public void setCreateDate(Date createDate) { public void setCreateUserName(String createUserName) {
_createDate = createDate; _createUserName = createUserName;
} }
public Date getModifiedDate() { public Date getModifiedDate() {
@ -150,6 +156,30 @@ public class SportelloSoap implements Serializable {
_modifiedDate = modifiedDate; _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() { public String getEmail() {
return _email; return _email;
} }
@ -166,14 +196,6 @@ public class SportelloSoap implements Serializable {
_comuneId = comuneId; _comuneId = comuneId;
} }
public String getApiKey() {
return _apiKey;
}
public void setApiKey(String apiKey) {
_apiKey = apiKey;
}
public boolean getAttivo() { public boolean getAttivo() {
return _attivo; return _attivo;
} }
@ -186,15 +208,53 @@ public class SportelloSoap implements Serializable {
_attivo = attivo; _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 _sportelloId;
private long _groupId; private long _groupId;
private long _companyId; private long _companyId;
private long _userId;
private String _userName;
private Date _createDate; private Date _createDate;
private long _createUserId;
private String _createUserName;
private Date _modifiedDate; private Date _modifiedDate;
private long _modifiedUserId;
private String _modifiedUserName;
private String _userName;
private String _email; private String _email;
private long _comuneId; private long _comuneId;
private String _apiKey;
private boolean _attivo; private boolean _attivo;
private String _password;
private Date _passwordModifiedDate;
private long _passwordModifiedUserId;
private String _passwordModifiedUserName;
} }

370
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<Sportello> {
attributes.put("sportelloId", getSportelloId()); attributes.put("sportelloId", getSportelloId());
attributes.put("groupId", getGroupId()); attributes.put("groupId", getGroupId());
attributes.put("companyId", getCompanyId()); attributes.put("companyId", getCompanyId());
attributes.put("userId", getUserId());
attributes.put("userName", getUserName());
attributes.put("createDate", getCreateDate()); attributes.put("createDate", getCreateDate());
attributes.put("createUserId", getCreateUserId());
attributes.put("createUserName", getCreateUserName());
attributes.put("modifiedDate", getModifiedDate()); attributes.put("modifiedDate", getModifiedDate());
attributes.put("modifiedUserId", getModifiedUserId());
attributes.put("modifiedUserName", getModifiedUserName());
attributes.put("userName", getUserName());
attributes.put("email", getEmail()); attributes.put("email", getEmail());
attributes.put("comuneId", getComuneId()); attributes.put("comuneId", getComuneId());
attributes.put("apiKey", getApiKey());
attributes.put("attivo", getAttivo()); attributes.put("attivo", getAttivo());
attributes.put("password", getPassword());
attributes.put("passwordModifiedDate", getPasswordModifiedDate());
attributes.put("passwordModifiedUserId", getPasswordModifiedUserId());
attributes.put("passwordModifiedUserName", getPasswordModifiedUserName());
return attributes; return attributes;
} }
@ -84,22 +90,22 @@ public class SportelloWrapper implements Sportello, ModelWrapper<Sportello> {
setCompanyId(companyId); setCompanyId(companyId);
} }
Long userId = (Long)attributes.get("userId"); Date createDate = (Date)attributes.get("createDate");
if (userId != null) { if (createDate != null) {
setUserId(userId); setCreateDate(createDate);
} }
String userName = (String)attributes.get("userName"); Long createUserId = (Long)attributes.get("createUserId");
if (userName != null) { if (createUserId != null) {
setUserName(userName); setCreateUserId(createUserId);
} }
Date createDate = (Date)attributes.get("createDate"); String createUserName = (String)attributes.get("createUserName");
if (createDate != null) { if (createUserName != null) {
setCreateDate(createDate); setCreateUserName(createUserName);
} }
Date modifiedDate = (Date)attributes.get("modifiedDate"); Date modifiedDate = (Date)attributes.get("modifiedDate");
@ -108,6 +114,24 @@ public class SportelloWrapper implements Sportello, ModelWrapper<Sportello> {
setModifiedDate(modifiedDate); 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"); String email = (String)attributes.get("email");
if (email != null) { if (email != null) {
@ -120,17 +144,37 @@ public class SportelloWrapper implements Sportello, ModelWrapper<Sportello> {
setComuneId(comuneId); setComuneId(comuneId);
} }
String apiKey = (String)attributes.get("apiKey");
if (apiKey != null) {
setApiKey(apiKey);
}
Boolean attivo = (Boolean)attributes.get("attivo"); Boolean attivo = (Boolean)attributes.get("attivo");
if (attivo != null) { if (attivo != null) {
setAttivo(attivo); 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<Sportello> {
} }
/** /**
* 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 @Override
public long getUserId() { public java.util.Date getCreateDate() {
return _sportello.getUserId(); 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 @Override
public void setUserId(long userId) { public void setCreateDate(java.util.Date createDate) {
_sportello.setUserId(userId); _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 * @return the create user ID of this sportello
* @throws SystemException if a system exception occurred
*/ */
@Override @Override
public java.lang.String getUserUuid() public long getCreateUserId() {
throws com.liferay.portal.kernel.exception.SystemException { return _sportello.getCreateUserId();
return _sportello.getUserUuid();
} }
/** /**
* 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 @Override
public void setUserUuid(java.lang.String userUuid) { public void setCreateUserId(long createUserId) {
_sportello.setUserUuid(userUuid); _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 @Override
public java.lang.String getUserName() { public java.lang.String getCreateUserUuid()
return _sportello.getUserName(); 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 @Override
public void setUserName(java.lang.String userName) { public void setCreateUserUuid(java.lang.String createUserUuid) {
_sportello.setUserName(userName); _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 @Override
public java.util.Date getCreateDate() { public java.lang.String getCreateUserName() {
return _sportello.getCreateDate(); 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 @Override
public void setCreateDate(java.util.Date createDate) { public void setCreateUserName(java.lang.String createUserName) {
_sportello.setCreateDate(createDate); _sportello.setCreateUserName(createUserName);
} }
/** /**
@ -315,6 +359,88 @@ public class SportelloWrapper implements Sportello, ModelWrapper<Sportello> {
_sportello.setModifiedDate(modifiedDate); _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. * Returns the email of this sportello.
* *
@ -355,26 +481,6 @@ public class SportelloWrapper implements Sportello, ModelWrapper<Sportello> {
_sportello.setComuneId(comuneId); _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. * Returns the attivo of this sportello.
* *
@ -405,6 +511,110 @@ public class SportelloWrapper implements Sportello, ModelWrapper<Sportello> {
_sportello.setAttivo(attivo); _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 @Override
public boolean isNew() { public boolean isNew() {
return _sportello.isNew(); return _sportello.isNew();
@ -509,6 +719,22 @@ public class SportelloWrapper implements Sportello, ModelWrapper<Sportello> {
_sportello.persist(); _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 @Override
public java.lang.String getCodiceProvincia() public java.lang.String getCodiceProvincia()
throws com.liferay.portal.kernel.exception.PortalException, throws com.liferay.portal.kernel.exception.PortalException,

12
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(); 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")) { if (className.equals("it.mwg.sicilia.sue.NoSuchApiSettingException")) {
return new it.mwg.sicilia.sue.NoSuchApiSettingException(); return new it.mwg.sicilia.sue.NoSuchApiSettingException();
} }

5
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, public java.lang.Object invokeMethod(java.lang.String name,
java.lang.String[] parameterTypes, java.lang.Object[] arguments) java.lang.String[] parameterTypes, java.lang.Object[] arguments)
throws java.lang.Throwable; 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;
} }

41
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"; _methodName17 = "setBeanIdentifier";
_methodParameterTypes17 = new String[] { "java.lang.String" }; _methodParameterTypes17 = new String[] { "java.lang.String" };
_methodName19 = "findByUserName";
_methodParameterTypes19 = new String[] { "java.lang.String" };
} }
@Override @Override
@ -661,6 +665,41 @@ public class SportelloLocalServiceClp implements SportelloLocalService {
throw new UnsupportedOperationException(); 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 InvokableLocalService _invokableLocalService;
private String _methodName0; private String _methodName0;
private String[] _methodParameterTypes0; private String[] _methodParameterTypes0;
@ -698,4 +737,6 @@ public class SportelloLocalServiceClp implements SportelloLocalService {
private String[] _methodParameterTypes16; private String[] _methodParameterTypes16;
private String _methodName17; private String _methodName17;
private String[] _methodParameterTypes17; private String[] _methodParameterTypes17;
private String _methodName19;
private String[] _methodParameterTypes19;
} }

7
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); 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() { public static void clearService() {
_service = null; _service = null;
} }

8
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); 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} * @deprecated As of 6.1.0, replaced by {@link #getWrappedService}
*/ */

2
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, public java.lang.Object invokeMethod(java.lang.String name,
java.lang.String[] parameterTypes, java.lang.Object[] arguments) java.lang.String[] parameterTypes, java.lang.Object[] arguments)
throws java.lang.Throwable; throws java.lang.Throwable;
public java.lang.String generaPassword(int lunghezza);
} }

29
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"; _methodName1 = "setBeanIdentifier";
_methodParameterTypes1 = new String[] { "java.lang.String" }; _methodParameterTypes1 = new String[] { "java.lang.String" };
_methodName3 = "generaPassword";
_methodParameterTypes3 = new String[] { "int" };
} }
@Override @Override
@ -83,9 +87,34 @@ public class SportelloServiceClp implements SportelloService {
throw new UnsupportedOperationException(); 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 InvokableService _invokableService;
private String _methodName0; private String _methodName0;
private String[] _methodParameterTypes0; private String[] _methodParameterTypes0;
private String _methodName1; private String _methodName1;
private String[] _methodParameterTypes1; private String[] _methodParameterTypes1;
private String _methodName3;
private String[] _methodParameterTypes3;
} }

4
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); return getService().invokeMethod(name, parameterTypes, arguments);
} }
public static java.lang.String generaPassword(int lunghezza) {
return getService().generaPassword(lunghezza);
}
public static void clearService() { public static void clearService() {
_service = null; _service = null;
} }

5
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); 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} * @deprecated As of 6.1.0, replaced by {@link #getWrappedService}
*/ */

58
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<Sportello> {
public int countByComuneId(long comuneId) public int countByComuneId(long comuneId)
throws com.liferay.portal.kernel.exception.SystemException; throws com.liferay.portal.kernel.exception.SystemException;
/**
* Returns the sportello where userName = &#63; 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 = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
*
* @param userName the user name
* @return the matching sportello, or <code>null</code> 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 = &#63; or returns <code>null</code> 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 <code>null</code> 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 = &#63; 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 = &#63;.
*
* @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. * Caches the sportello in the entity cache if it is enabled.
* *

68
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); return getPersistence().countByComuneId(comuneId);
} }
/**
* Returns the sportello where userName = &#63; 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 = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
*
* @param userName the user name
* @return the matching sportello, or <code>null</code> 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 = &#63; or returns <code>null</code> 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 <code>null</code> 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 = &#63; 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 = &#63;.
*
* @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. * Caches the sportello in the entity cache if it is enabled.
* *

3
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_7B780A8D=sicilia_sue_ApiSetting.CompanyIdKey
IX_8B2AB20B=sicilia_sue_Sportello.ComuneId IX_8B2AB20B=sicilia_sue_Sportello.ComuneId
IX_F4E738BB=sicilia_sue_Sportello.UserName

3
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_7B780A8D on sicilia_sue_ApiSetting (companyId, key_);
create unique index IX_8B2AB20B on sicilia_sue_Sportello (comuneId); create unique index IX_8B2AB20B on sicilia_sue_Sportello (comuneId);
create unique index IX_F4E738BB on sicilia_sue_Sportello (userName);

14
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, sportelloId LONG not null primary key,
groupId LONG, groupId LONG,
companyId LONG, companyId LONG,
userId LONG,
userName VARCHAR(240) null,
createDate DATE null, createDate DATE null,
createUserId LONG,
createUserName VARCHAR(75) null,
modifiedDate DATE null, modifiedDate DATE null,
modifiedUserId LONG,
modifiedUserName VARCHAR(75) null,
userName VARCHAR(75) null,
email VARCHAR(240) null, email VARCHAR(240) null,
comuneId LONG, comuneId LONG,
apiKey VARCHAR(240) null, attivo BOOLEAN,
attivo BOOLEAN password_ VARCHAR(75) null,
passwordModifiedDate DATE null,
passwordModifiedUserId LONG,
passwordModifiedUserName VARCHAR(240) null
); );

12
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-hbm.xml

@ -20,13 +20,19 @@
</id> </id>
<property name="groupId" type="com.liferay.portal.dao.orm.hibernate.LongType" /> <property name="groupId" type="com.liferay.portal.dao.orm.hibernate.LongType" />
<property name="companyId" type="com.liferay.portal.dao.orm.hibernate.LongType" /> <property name="companyId" type="com.liferay.portal.dao.orm.hibernate.LongType" />
<property name="userId" type="com.liferay.portal.dao.orm.hibernate.LongType" />
<property name="userName" type="com.liferay.portal.dao.orm.hibernate.StringType" />
<property name="createDate" type="org.hibernate.type.TimestampType" /> <property name="createDate" type="org.hibernate.type.TimestampType" />
<property name="createUserId" type="com.liferay.portal.dao.orm.hibernate.LongType" />
<property name="createUserName" type="com.liferay.portal.dao.orm.hibernate.StringType" />
<property name="modifiedDate" type="org.hibernate.type.TimestampType" /> <property name="modifiedDate" type="org.hibernate.type.TimestampType" />
<property name="modifiedUserId" type="com.liferay.portal.dao.orm.hibernate.LongType" />
<property name="modifiedUserName" type="com.liferay.portal.dao.orm.hibernate.StringType" />
<property name="userName" type="com.liferay.portal.dao.orm.hibernate.StringType" />
<property name="email" type="com.liferay.portal.dao.orm.hibernate.StringType" /> <property name="email" type="com.liferay.portal.dao.orm.hibernate.StringType" />
<property name="comuneId" type="com.liferay.portal.dao.orm.hibernate.LongType" /> <property name="comuneId" type="com.liferay.portal.dao.orm.hibernate.LongType" />
<property name="apiKey" type="com.liferay.portal.dao.orm.hibernate.StringType" />
<property name="attivo" type="com.liferay.portal.dao.orm.hibernate.BooleanType" /> <property name="attivo" type="com.liferay.portal.dao.orm.hibernate.BooleanType" />
<property name="password" type="com.liferay.portal.dao.orm.hibernate.StringType" column="password_" />
<property name="passwordModifiedDate" type="org.hibernate.type.TimestampType" />
<property name="passwordModifiedUserId" type="com.liferay.portal.dao.orm.hibernate.LongType" />
<property name="passwordModifiedUserName" type="com.liferay.portal.dao.orm.hibernate.StringType" />
</class> </class>
</hibernate-mapping> </hibernate-mapping>

16
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-model-hints.xml

@ -13,19 +13,23 @@
<field name="sportelloId" type="long" /> <field name="sportelloId" type="long" />
<field name="groupId" type="long" /> <field name="groupId" type="long" />
<field name="companyId" type="long" /> <field name="companyId" type="long" />
<field name="userId" type="long" />
<field name="userName" type="String">
<hint name="max-length">240</hint>
</field>
<field name="createDate" type="Date" /> <field name="createDate" type="Date" />
<field name="createUserId" type="long" />
<field name="createUserName" type="String" />
<field name="modifiedDate" type="Date" /> <field name="modifiedDate" type="Date" />
<field name="modifiedUserId" type="long" />
<field name="modifiedUserName" type="String" />
<field name="userName" type="String" />
<field name="email" type="String"> <field name="email" type="String">
<hint name="max-length">240</hint> <hint name="max-length">240</hint>
</field> </field>
<field name="comuneId" type="long" /> <field name="comuneId" type="long" />
<field name="apiKey" type="String"> <field name="attivo" type="boolean" />
<field name="password" type="String" />
<field name="passwordModifiedDate" type="Date" />
<field name="passwordModifiedUserId" type="long" />
<field name="passwordModifiedUserName" type="String">
<hint name="max-length">240</hint> <hint name="max-length">240</hint>
</field> </field>
<field name="attivo" type="boolean" />
</model> </model>
</model-hints> </model-hints>

20
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-orm.xml

@ -27,22 +27,34 @@
<id name="sportelloId" /> <id name="sportelloId" />
<basic name="groupId" /> <basic name="groupId" />
<basic name="companyId" /> <basic name="companyId" />
<basic name="userId" />
<basic name="userName" />
<basic name="createDate"> <basic name="createDate">
<temporal>TIMESTAMP</temporal> <temporal>TIMESTAMP</temporal>
</basic> </basic>
<basic name="createUserId" />
<basic name="createUserName" />
<basic name="modifiedDate"> <basic name="modifiedDate">
<temporal>TIMESTAMP</temporal> <temporal>TIMESTAMP</temporal>
</basic> </basic>
<basic name="modifiedUserId" />
<basic name="modifiedUserName" />
<basic name="userName" />
<basic name="email" /> <basic name="email" />
<basic name="comuneId" /> <basic name="comuneId" />
<basic name="apiKey" />
<basic name="attivo" /> <basic name="attivo" />
<basic name="password">
<column name="PASSWORD_" />
</basic>
<basic name="passwordModifiedDate">
<temporal>TIMESTAMP</temporal>
</basic>
<basic name="passwordModifiedUserId" />
<basic name="passwordModifiedUserName" />
<transient name="createUserUuid" />
<transient name="modelAttributes" /> <transient name="modelAttributes" />
<transient name="modifiedUserUuid" />
<transient name="passwordModifiedUserUuid" />
<transient name="primaryKey" /> <transient name="primaryKey" />
<transient name="primaryKeyObj" /> <transient name="primaryKeyObj" />
<transient name="userUuid" />
</attributes> </attributes>
</mapped-superclass> </mapped-superclass>
<entity class="it.mwg.sicilia.sue.model.impl.ApiSettingImpl" name="ApiSetting"> <entity class="it.mwg.sicilia.sue.model.impl.ApiSettingImpl" name="ApiSetting">

3
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/content/Language.properties

@ -1,3 +1,4 @@
email = Email email = Email
nomeComune = Comune nomeComune = Comune
nomeProvincia = Provincia nomeProvincia = Provincia
userName = Login

99
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;
}
}

46
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; package it.mwg.sicilia.sue.api.v1;
import it.mwg.sicilia.sue.model.Sportello;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Serializable;
import java.util.Map;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; 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.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.StringPool;
@ -26,8 +19,6 @@ import com.liferay.portal.kernel.util.Validator;
public class ApiServlet extends HttpServlet { public class ApiServlet extends HttpServlet {
private static final Log _log = LogFactoryUtil.getLog(ApiServlet.class); private static final Log _log = LogFactoryUtil.getLog(ApiServlet.class);
private static final JSONDeserializer<Map<String, Serializable>> deserializer = JSONFactoryUtil
.createJSONDeserializer();
@Override @Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 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 { private void process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String info = request.getPathInfo(); String pathInfo = request.getPathInfo();
if (Validator.isNull(info)) { if (Validator.isNull(pathInfo)) {
info = StringPool.BLANK; pathInfo = StringPool.BLANK;
} else { } 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)) { if (Validator.isNull(command)) {
response.sendError(HttpServletResponse.SC_NOT_FOUND); response.sendError(HttpServletResponse.SC_NOT_FOUND);
} else if (!command.getMethods().contains(request.getMethod())) {
response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
} else { } else {
Map<String, Serializable> parameters = deserializer.deserialize(new InputStreamReader(request
.getInputStream()));
long timestamp = 0;
String uuid = null;
String signature = null;
try { 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); command.run(request, response);
} catch (Exception e) {
_log.error(e.getMessage(), e);
} }
} }
} }
private boolean verifySignature(long timestamp, String signature) {
Sportello sportello;
return false;
}
} }

7
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.log.LogFactoryUtil;
import com.liferay.portal.kernel.security.SecureRandom; import com.liferay.portal.kernel.security.SecureRandom;
import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.security.auth.CompanyThreadLocal;
import com.sun.org.apache.xml.internal.security.utils.Base64; import com.sun.org.apache.xml.internal.security.utils.Base64;
public class ApiUtil { public class ApiUtil {
@ -57,10 +56,4 @@ public class ApiUtil {
String check = DigestUtils.sha256Hex(hash + secret); String check = DigestUtils.sha256Hex(hash + secret);
return hash + StringPool.PERIOD + check; return hash + StringPool.PERIOD + check;
} }
public static String getToken(long sportelloId) throws Exception {
long companyId = CompanyThreadLocal.getCompanyId();
return getToken(companyId, sportelloId);
}
} }

56
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; 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.IOException;
import java.io.InputStreamReader;
import java.io.Serializable;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; 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 { public abstract class Command {
protected static final Log _log = LogFactoryUtil.getLog(Command.class);
protected Map<String, Serializable> parameters = null;
private String verb; private String verb;
private List<String> methods; private List<String> methods;
private String description; private String description;
private static final JSONDeserializer<Map<String, Serializable>> deserializer = JSONFactoryUtil
.createJSONDeserializer();
public Command(String verb, String description, String... methods) { public Command(String verb, String description, String... methods) {
@ -36,6 +55,37 @@ public abstract class Command {
return description; return description;
} }
public abstract void run(HttpServletRequest request, HttpServletResponse response) throws ServletException, public abstract void run(HttpServletRequest request, HttpServletResponse response) throws Exception;
IOException;
protected Map<String, Serializable> 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;
}
}
} }

3
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; 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 it.mwg.sicilia.sue.api.v1.command.CommandNop;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
@ -14,6 +15,8 @@ public class Commands {
static { static {
addCommand(new CommandNop(StringPool.BLANK, "NOP verifica la connettività senza eseguire operazioni", addCommand(new CommandNop(StringPool.BLANK, "NOP verifica la connettività senza eseguire operazioni",
HttpMethods.GET, HttpMethods.POST)); 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) { private static void addCommand(Command command) {

10
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 class Parameters {
public static final String AUTH_TIMESTAMP = "timestamp"; public static final String PASSWORD = "password";
public static final String AUTH_USER_ID = "userId"; public static final String STATUS_CODE = "statusCode";
public static final String AUTH_SIGNATURE = "signature"; public static final String STATUS_MESSAGE = "statusMessage";
public static final String STATUS_CODE = "status"; public static final String TOKEN = "token";
public static final String STATUS_DESCRIPTION = "description"; public static final String USER_NAME = "userName";
} }

2
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<String, Serializable> map = new LinkedHashMap<>(); Map<String, Serializable> map = new LinkedHashMap<>();
map.put(Parameters.STATUS_CODE, statusCode); 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)) { if (Validator.isNotNull(extraData)) {
map.putAll(extraData); map.putAll(extraData);
} }

13
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 class Status {
public static final int OK = 0; 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") @SuppressWarnings("serial")
private static final Map<Integer, String> messages = new HashMap<Integer, String>() { private static final Map<Integer, String> messages = new HashMap<Integer, String>() {
{ {
put(OK, "OK"); 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(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) { public static String getStatusDescription(int statusCode) {
return messages.get(statusCode); return messages.get(statusCode);
} }
} }

56
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<String, Serializable> extraData = new HashMap<>();
extraData.put(Parameters.TOKEN, new AccessToken(sportello).getToken());
ServletResponseUtil.write(response, Response.get(Status.OK, extraData));
}
}
}
}

22
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; package it.mwg.sicilia.sue.api.v1.command;
import 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.Response;
import it.mwg.sicilia.sue.api.v1.Status; 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.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.liferay.portal.kernel.servlet.ServletResponseUtil; import com.liferay.portal.kernel.servlet.ServletResponseUtil;
import com.liferay.portal.kernel.util.ContentTypes; import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.util.StringPool;
public class CommandNop extends Command { public class CommandNop extends Command {
@ -22,10 +19,15 @@ public class CommandNop extends Command {
} }
@Override @Override
public void run(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { public void run(HttpServletRequest request, HttpServletResponse response) throws Exception {
response.setContentType(ContentTypes.APPLICATION_JSON); setJson(response);
response.setCharacterEncoding(StringPool.UTF8); readParameters(request);
ServletResponseUtil.write(response, Response.get(Status.OK)); 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));
}
} }
} }

142
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<Sportello>,
Externalizable { Externalizable {
@Override @Override
public String toString() { public String toString() {
StringBundler sb = new StringBundler(23); StringBundler sb = new StringBundler(35);
sb.append("{sportelloId="); sb.append("{sportelloId=");
sb.append(sportelloId); sb.append(sportelloId);
@ -46,22 +46,34 @@ public class SportelloCacheModel implements CacheModel<Sportello>,
sb.append(groupId); sb.append(groupId);
sb.append(", companyId="); sb.append(", companyId=");
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(createDate); sb.append(createDate);
sb.append(", createUserId=");
sb.append(createUserId);
sb.append(", createUserName=");
sb.append(createUserName);
sb.append(", modifiedDate="); sb.append(", modifiedDate=");
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(email); sb.append(email);
sb.append(", comuneId="); sb.append(", comuneId=");
sb.append(comuneId); sb.append(comuneId);
sb.append(", apiKey=");
sb.append(apiKey);
sb.append(", attivo="); sb.append(", attivo=");
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("}"); sb.append("}");
return sb.toString(); return sb.toString();
@ -74,20 +86,21 @@ public class SportelloCacheModel implements CacheModel<Sportello>,
sportelloImpl.setSportelloId(sportelloId); sportelloImpl.setSportelloId(sportelloId);
sportelloImpl.setGroupId(groupId); sportelloImpl.setGroupId(groupId);
sportelloImpl.setCompanyId(companyId); sportelloImpl.setCompanyId(companyId);
sportelloImpl.setUserId(userId);
if (userName == null) { if (createDate == Long.MIN_VALUE) {
sportelloImpl.setUserName(StringPool.BLANK); sportelloImpl.setCreateDate(null);
} }
else { else {
sportelloImpl.setUserName(userName); sportelloImpl.setCreateDate(new Date(createDate));
} }
if (createDate == Long.MIN_VALUE) { sportelloImpl.setCreateUserId(createUserId);
sportelloImpl.setCreateDate(null);
if (createUserName == null) {
sportelloImpl.setCreateUserName(StringPool.BLANK);
} }
else { else {
sportelloImpl.setCreateDate(new Date(createDate)); sportelloImpl.setCreateUserName(createUserName);
} }
if (modifiedDate == Long.MIN_VALUE) { if (modifiedDate == Long.MIN_VALUE) {
@ -97,6 +110,22 @@ public class SportelloCacheModel implements CacheModel<Sportello>,
sportelloImpl.setModifiedDate(new Date(modifiedDate)); 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) { if (email == null) {
sportelloImpl.setEmail(StringPool.BLANK); sportelloImpl.setEmail(StringPool.BLANK);
} }
@ -105,15 +134,30 @@ public class SportelloCacheModel implements CacheModel<Sportello>,
} }
sportelloImpl.setComuneId(comuneId); sportelloImpl.setComuneId(comuneId);
sportelloImpl.setAttivo(attivo);
if (apiKey == null) { if (password == null) {
sportelloImpl.setApiKey(StringPool.BLANK); sportelloImpl.setPassword(StringPool.BLANK);
} }
else { 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(); sportelloImpl.resetOriginalValues();
@ -125,14 +169,20 @@ public class SportelloCacheModel implements CacheModel<Sportello>,
sportelloId = objectInput.readLong(); sportelloId = objectInput.readLong();
groupId = objectInput.readLong(); groupId = objectInput.readLong();
companyId = objectInput.readLong(); companyId = objectInput.readLong();
userId = objectInput.readLong();
userName = objectInput.readUTF();
createDate = objectInput.readLong(); createDate = objectInput.readLong();
createUserId = objectInput.readLong();
createUserName = objectInput.readUTF();
modifiedDate = objectInput.readLong(); modifiedDate = objectInput.readLong();
modifiedUserId = objectInput.readLong();
modifiedUserName = objectInput.readUTF();
userName = objectInput.readUTF();
email = objectInput.readUTF(); email = objectInput.readUTF();
comuneId = objectInput.readLong(); comuneId = objectInput.readLong();
apiKey = objectInput.readUTF();
attivo = objectInput.readBoolean(); attivo = objectInput.readBoolean();
password = objectInput.readUTF();
passwordModifiedDate = objectInput.readLong();
passwordModifiedUserId = objectInput.readLong();
passwordModifiedUserName = objectInput.readUTF();
} }
@Override @Override
@ -141,17 +191,32 @@ public class SportelloCacheModel implements CacheModel<Sportello>,
objectOutput.writeLong(sportelloId); objectOutput.writeLong(sportelloId);
objectOutput.writeLong(groupId); objectOutput.writeLong(groupId);
objectOutput.writeLong(companyId); objectOutput.writeLong(companyId);
objectOutput.writeLong(userId); objectOutput.writeLong(createDate);
objectOutput.writeLong(createUserId);
if (userName == null) { if (createUserName == null) {
objectOutput.writeUTF(StringPool.BLANK); objectOutput.writeUTF(StringPool.BLANK);
} }
else { else {
objectOutput.writeUTF(userName); objectOutput.writeUTF(createUserName);
} }
objectOutput.writeLong(createDate);
objectOutput.writeLong(modifiedDate); 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) { if (email == null) {
objectOutput.writeUTF(StringPool.BLANK); objectOutput.writeUTF(StringPool.BLANK);
@ -161,26 +226,41 @@ public class SportelloCacheModel implements CacheModel<Sportello>,
} }
objectOutput.writeLong(comuneId); objectOutput.writeLong(comuneId);
objectOutput.writeBoolean(attivo);
if (apiKey == null) { if (password == null) {
objectOutput.writeUTF(StringPool.BLANK); objectOutput.writeUTF(StringPool.BLANK);
} }
else { 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 sportelloId;
public long groupId; public long groupId;
public long companyId; public long companyId;
public long userId;
public String userName;
public long createDate; public long createDate;
public long createUserId;
public String createUserName;
public long modifiedDate; public long modifiedDate;
public long modifiedUserId;
public String modifiedUserName;
public String userName;
public String email; public String email;
public long comuneId; public long comuneId;
public String apiKey;
public boolean attivo; public boolean attivo;
public String password;
public long passwordModifiedDate;
public long passwordModifiedUserId;
public String passwordModifiedUserName;
} }

42
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; 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.Comune;
import it.tref.liferay.portos.bo.model.Provincia; import it.tref.liferay.portos.bo.model.Provincia;
import it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil; import it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil;
import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil; 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.PortalException;
import com.liferay.portal.kernel.exception.SystemException; 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.kernel.util.Validator;
import com.liferay.portal.model.User;
/** /**
* The extended model implementation for the Sportello service. Represents a row in the * 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 Comune comune = null;
private Provincia provincia = null; private Provincia provincia = null;
private static final Log _log = LogFactoryUtil.getLog(SportelloImpl.class);
public SportelloImpl() { 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 @Override
public String getCodiceProvincia() throws PortalException, SystemException { public String getCodiceProvincia() throws PortalException, SystemException {

460
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<Sportello>
{ "sportelloId", Types.BIGINT }, { "sportelloId", Types.BIGINT },
{ "groupId", Types.BIGINT }, { "groupId", Types.BIGINT },
{ "companyId", Types.BIGINT }, { "companyId", Types.BIGINT },
{ "userId", Types.BIGINT },
{ "userName", Types.VARCHAR },
{ "createDate", Types.TIMESTAMP }, { "createDate", Types.TIMESTAMP },
{ "createUserId", Types.BIGINT },
{ "createUserName", Types.VARCHAR },
{ "modifiedDate", Types.TIMESTAMP }, { "modifiedDate", Types.TIMESTAMP },
{ "modifiedUserId", Types.BIGINT },
{ "modifiedUserName", Types.VARCHAR },
{ "userName", Types.VARCHAR },
{ "email", Types.VARCHAR }, { "email", Types.VARCHAR },
{ "comuneId", Types.BIGINT }, { "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 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_JPQL = " ORDER BY sportello.sportelloId ASC";
public static final String ORDER_BY_SQL = " ORDER BY sicilia_sue_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<Sportello>
"value.object.column.bitmask.enabled.it.mwg.sicilia.sue.model.Sportello"), "value.object.column.bitmask.enabled.it.mwg.sicilia.sue.model.Sportello"),
true); true);
public static long COMUNEID_COLUMN_BITMASK = 1L; 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. * Converts the soap model instance into a normal model instance.
@ -113,14 +120,20 @@ public class SportelloModelImpl extends BaseModelImpl<Sportello>
model.setSportelloId(soapModel.getSportelloId()); model.setSportelloId(soapModel.getSportelloId());
model.setGroupId(soapModel.getGroupId()); model.setGroupId(soapModel.getGroupId());
model.setCompanyId(soapModel.getCompanyId()); model.setCompanyId(soapModel.getCompanyId());
model.setUserId(soapModel.getUserId());
model.setUserName(soapModel.getUserName());
model.setCreateDate(soapModel.getCreateDate()); model.setCreateDate(soapModel.getCreateDate());
model.setCreateUserId(soapModel.getCreateUserId());
model.setCreateUserName(soapModel.getCreateUserName());
model.setModifiedDate(soapModel.getModifiedDate()); model.setModifiedDate(soapModel.getModifiedDate());
model.setModifiedUserId(soapModel.getModifiedUserId());
model.setModifiedUserName(soapModel.getModifiedUserName());
model.setUserName(soapModel.getUserName());
model.setEmail(soapModel.getEmail()); model.setEmail(soapModel.getEmail());
model.setComuneId(soapModel.getComuneId()); model.setComuneId(soapModel.getComuneId());
model.setApiKey(soapModel.getApiKey());
model.setAttivo(soapModel.getAttivo()); model.setAttivo(soapModel.getAttivo());
model.setPassword(soapModel.getPassword());
model.setPasswordModifiedDate(soapModel.getPasswordModifiedDate());
model.setPasswordModifiedUserId(soapModel.getPasswordModifiedUserId());
model.setPasswordModifiedUserName(soapModel.getPasswordModifiedUserName());
return model; return model;
} }
@ -188,14 +201,20 @@ public class SportelloModelImpl extends BaseModelImpl<Sportello>
attributes.put("sportelloId", getSportelloId()); attributes.put("sportelloId", getSportelloId());
attributes.put("groupId", getGroupId()); attributes.put("groupId", getGroupId());
attributes.put("companyId", getCompanyId()); attributes.put("companyId", getCompanyId());
attributes.put("userId", getUserId());
attributes.put("userName", getUserName());
attributes.put("createDate", getCreateDate()); attributes.put("createDate", getCreateDate());
attributes.put("createUserId", getCreateUserId());
attributes.put("createUserName", getCreateUserName());
attributes.put("modifiedDate", getModifiedDate()); attributes.put("modifiedDate", getModifiedDate());
attributes.put("modifiedUserId", getModifiedUserId());
attributes.put("modifiedUserName", getModifiedUserName());
attributes.put("userName", getUserName());
attributes.put("email", getEmail()); attributes.put("email", getEmail());
attributes.put("comuneId", getComuneId()); attributes.put("comuneId", getComuneId());
attributes.put("apiKey", getApiKey());
attributes.put("attivo", getAttivo()); attributes.put("attivo", getAttivo());
attributes.put("password", getPassword());
attributes.put("passwordModifiedDate", getPasswordModifiedDate());
attributes.put("passwordModifiedUserId", getPasswordModifiedUserId());
attributes.put("passwordModifiedUserName", getPasswordModifiedUserName());
return attributes; return attributes;
} }
@ -220,22 +239,22 @@ public class SportelloModelImpl extends BaseModelImpl<Sportello>
setCompanyId(companyId); setCompanyId(companyId);
} }
Long userId = (Long)attributes.get("userId"); Date createDate = (Date)attributes.get("createDate");
if (userId != null) { if (createDate != null) {
setUserId(userId); setCreateDate(createDate);
} }
String userName = (String)attributes.get("userName"); Long createUserId = (Long)attributes.get("createUserId");
if (userName != null) { if (createUserId != null) {
setUserName(userName); setCreateUserId(createUserId);
} }
Date createDate = (Date)attributes.get("createDate"); String createUserName = (String)attributes.get("createUserName");
if (createDate != null) { if (createUserName != null) {
setCreateDate(createDate); setCreateUserName(createUserName);
} }
Date modifiedDate = (Date)attributes.get("modifiedDate"); Date modifiedDate = (Date)attributes.get("modifiedDate");
@ -244,6 +263,24 @@ public class SportelloModelImpl extends BaseModelImpl<Sportello>
setModifiedDate(modifiedDate); 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"); String email = (String)attributes.get("email");
if (email != null) { if (email != null) {
@ -256,17 +293,37 @@ public class SportelloModelImpl extends BaseModelImpl<Sportello>
setComuneId(comuneId); setComuneId(comuneId);
} }
String apiKey = (String)attributes.get("apiKey");
if (apiKey != null) {
setApiKey(apiKey);
}
Boolean attivo = (Boolean)attributes.get("attivo"); Boolean attivo = (Boolean)attributes.get("attivo");
if (attivo != null) { if (attivo != null) {
setAttivo(attivo); 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 @JSON
@ -304,61 +361,126 @@ public class SportelloModelImpl extends BaseModelImpl<Sportello>
@JSON @JSON
@Override @Override
public long getUserId() { public Date getCreateDate() {
return _userId; return _createDate;
}
@Override
public void setCreateDate(Date createDate) {
_createDate = createDate;
}
@JSON
@Override
public long getCreateUserId() {
return _createUserId;
} }
@Override @Override
public void setUserId(long userId) { public void setCreateUserId(long createUserId) {
_userId = userId; _createUserId = createUserId;
} }
@Override @Override
public String getUserUuid() throws SystemException { public String getCreateUserUuid() throws SystemException {
return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid); return PortalUtil.getUserValue(getCreateUserId(), "uuid",
_createUserUuid);
} }
@Override @Override
public void setUserUuid(String userUuid) { public void setCreateUserUuid(String createUserUuid) {
_userUuid = userUuid; _createUserUuid = createUserUuid;
} }
@JSON @JSON
@Override @Override
public String getUserName() { public String getCreateUserName() {
if (_userName == null) { if (_createUserName == null) {
return StringPool.BLANK; return StringPool.BLANK;
} }
else { else {
return _userName; return _createUserName;
} }
} }
@Override @Override
public void setUserName(String userName) { public void setCreateUserName(String createUserName) {
_userName = userName; _createUserName = createUserName;
} }
@JSON @JSON
@Override @Override
public Date getCreateDate() { public Date getModifiedDate() {
return _createDate; return _modifiedDate;
} }
@Override @Override
public void setCreateDate(Date createDate) { public void setModifiedDate(Date modifiedDate) {
_createDate = createDate; _modifiedDate = modifiedDate;
} }
@JSON @JSON
@Override @Override
public Date getModifiedDate() { public long getModifiedUserId() {
return _modifiedDate; return _modifiedUserId;
} }
@Override @Override
public void setModifiedDate(Date modifiedDate) { public void setModifiedUserId(long modifiedUserId) {
_modifiedDate = modifiedDate; _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 @JSON
@ -402,34 +524,83 @@ public class SportelloModelImpl extends BaseModelImpl<Sportello>
@JSON @JSON
@Override @Override
public String getApiKey() { public boolean getAttivo() {
if (_apiKey == null) { 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; return StringPool.BLANK;
} }
else { else {
return _apiKey; return _password;
} }
} }
@Override @Override
public void setApiKey(String apiKey) { public void setPassword(String password) {
_apiKey = apiKey; _password = password;
} }
@JSON @JSON
@Override @Override
public boolean getAttivo() { public Date getPasswordModifiedDate() {
return _attivo; return _passwordModifiedDate;
} }
@Override @Override
public boolean isAttivo() { public void setPasswordModifiedDate(Date passwordModifiedDate) {
return _attivo; _passwordModifiedDate = passwordModifiedDate;
} }
@JSON
@Override @Override
public void setAttivo(boolean attivo) { public long getPasswordModifiedUserId() {
_attivo = attivo; 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() { public long getColumnBitmask() {
@ -466,14 +637,20 @@ public class SportelloModelImpl extends BaseModelImpl<Sportello>
sportelloImpl.setSportelloId(getSportelloId()); sportelloImpl.setSportelloId(getSportelloId());
sportelloImpl.setGroupId(getGroupId()); sportelloImpl.setGroupId(getGroupId());
sportelloImpl.setCompanyId(getCompanyId()); sportelloImpl.setCompanyId(getCompanyId());
sportelloImpl.setUserId(getUserId());
sportelloImpl.setUserName(getUserName());
sportelloImpl.setCreateDate(getCreateDate()); sportelloImpl.setCreateDate(getCreateDate());
sportelloImpl.setCreateUserId(getCreateUserId());
sportelloImpl.setCreateUserName(getCreateUserName());
sportelloImpl.setModifiedDate(getModifiedDate()); sportelloImpl.setModifiedDate(getModifiedDate());
sportelloImpl.setModifiedUserId(getModifiedUserId());
sportelloImpl.setModifiedUserName(getModifiedUserName());
sportelloImpl.setUserName(getUserName());
sportelloImpl.setEmail(getEmail()); sportelloImpl.setEmail(getEmail());
sportelloImpl.setComuneId(getComuneId()); sportelloImpl.setComuneId(getComuneId());
sportelloImpl.setApiKey(getApiKey());
sportelloImpl.setAttivo(getAttivo()); sportelloImpl.setAttivo(getAttivo());
sportelloImpl.setPassword(getPassword());
sportelloImpl.setPasswordModifiedDate(getPasswordModifiedDate());
sportelloImpl.setPasswordModifiedUserId(getPasswordModifiedUserId());
sportelloImpl.setPasswordModifiedUserName(getPasswordModifiedUserName());
sportelloImpl.resetOriginalValues(); sportelloImpl.resetOriginalValues();
@ -526,6 +703,8 @@ public class SportelloModelImpl extends BaseModelImpl<Sportello>
public void resetOriginalValues() { public void resetOriginalValues() {
SportelloModelImpl sportelloModelImpl = this; SportelloModelImpl sportelloModelImpl = this;
sportelloModelImpl._originalUserName = sportelloModelImpl._userName;
sportelloModelImpl._originalComuneId = sportelloModelImpl._comuneId; sportelloModelImpl._originalComuneId = sportelloModelImpl._comuneId;
sportelloModelImpl._setOriginalComuneId = false; sportelloModelImpl._setOriginalComuneId = false;
@ -543,16 +722,6 @@ public class SportelloModelImpl extends BaseModelImpl<Sportello>
sportelloCacheModel.companyId = getCompanyId(); 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(); Date createDate = getCreateDate();
if (createDate != null) { if (createDate != null) {
@ -562,6 +731,16 @@ public class SportelloModelImpl extends BaseModelImpl<Sportello>
sportelloCacheModel.createDate = Long.MIN_VALUE; 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(); Date modifiedDate = getModifiedDate();
if (modifiedDate != null) { if (modifiedDate != null) {
@ -571,6 +750,24 @@ public class SportelloModelImpl extends BaseModelImpl<Sportello>
sportelloCacheModel.modifiedDate = Long.MIN_VALUE; 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(); sportelloCacheModel.email = getEmail();
String email = sportelloCacheModel.email; String email = sportelloCacheModel.email;
@ -581,22 +778,42 @@ public class SportelloModelImpl extends BaseModelImpl<Sportello>
sportelloCacheModel.comuneId = getComuneId(); 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)) { if ((password != null) && (password.length() == 0)) {
sportelloCacheModel.apiKey = null; 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; return sportelloCacheModel;
} }
@Override @Override
public String toString() { public String toString() {
StringBundler sb = new StringBundler(23); StringBundler sb = new StringBundler(35);
sb.append("{sportelloId="); sb.append("{sportelloId=");
sb.append(getSportelloId()); sb.append(getSportelloId());
@ -604,22 +821,34 @@ public class SportelloModelImpl extends BaseModelImpl<Sportello>
sb.append(getGroupId()); sb.append(getGroupId());
sb.append(", companyId="); sb.append(", companyId=");
sb.append(getCompanyId()); sb.append(getCompanyId());
sb.append(", userId=");
sb.append(getUserId());
sb.append(", userName=");
sb.append(getUserName());
sb.append(", createDate="); sb.append(", createDate=");
sb.append(getCreateDate()); sb.append(getCreateDate());
sb.append(", createUserId=");
sb.append(getCreateUserId());
sb.append(", createUserName=");
sb.append(getCreateUserName());
sb.append(", modifiedDate="); sb.append(", modifiedDate=");
sb.append(getModifiedDate()); 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(", email=");
sb.append(getEmail()); sb.append(getEmail());
sb.append(", comuneId="); sb.append(", comuneId=");
sb.append(getComuneId()); sb.append(getComuneId());
sb.append(", apiKey=");
sb.append(getApiKey());
sb.append(", attivo="); sb.append(", attivo=");
sb.append(getAttivo()); 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("}"); sb.append("}");
return sb.toString(); return sb.toString();
@ -627,7 +856,7 @@ public class SportelloModelImpl extends BaseModelImpl<Sportello>
@Override @Override
public String toXmlString() { public String toXmlString() {
StringBundler sb = new StringBundler(37); StringBundler sb = new StringBundler(55);
sb.append("<model><model-name>"); sb.append("<model><model-name>");
sb.append("it.mwg.sicilia.sue.model.Sportello"); sb.append("it.mwg.sicilia.sue.model.Sportello");
@ -646,21 +875,33 @@ public class SportelloModelImpl extends BaseModelImpl<Sportello>
sb.append(getCompanyId()); sb.append(getCompanyId());
sb.append("]]></column-value></column>"); sb.append("]]></column-value></column>");
sb.append( sb.append(
"<column><column-name>userId</column-name><column-value><![CDATA["); "<column><column-name>createDate</column-name><column-value><![CDATA[");
sb.append(getUserId()); sb.append(getCreateDate());
sb.append("]]></column-value></column>"); sb.append("]]></column-value></column>");
sb.append( sb.append(
"<column><column-name>userName</column-name><column-value><![CDATA["); "<column><column-name>createUserId</column-name><column-value><![CDATA[");
sb.append(getUserName()); sb.append(getCreateUserId());
sb.append("]]></column-value></column>"); sb.append("]]></column-value></column>");
sb.append( sb.append(
"<column><column-name>createDate</column-name><column-value><![CDATA["); "<column><column-name>createUserName</column-name><column-value><![CDATA[");
sb.append(getCreateDate()); sb.append(getCreateUserName());
sb.append("]]></column-value></column>"); sb.append("]]></column-value></column>");
sb.append( sb.append(
"<column><column-name>modifiedDate</column-name><column-value><![CDATA["); "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
sb.append(getModifiedDate()); sb.append(getModifiedDate());
sb.append("]]></column-value></column>"); sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>modifiedUserId</column-name><column-value><![CDATA[");
sb.append(getModifiedUserId());
sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>modifiedUserName</column-name><column-value><![CDATA[");
sb.append(getModifiedUserName());
sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>userName</column-name><column-value><![CDATA[");
sb.append(getUserName());
sb.append("]]></column-value></column>");
sb.append( sb.append(
"<column><column-name>email</column-name><column-value><![CDATA["); "<column><column-name>email</column-name><column-value><![CDATA[");
sb.append(getEmail()); sb.append(getEmail());
@ -669,14 +910,26 @@ public class SportelloModelImpl extends BaseModelImpl<Sportello>
"<column><column-name>comuneId</column-name><column-value><![CDATA["); "<column><column-name>comuneId</column-name><column-value><![CDATA[");
sb.append(getComuneId()); sb.append(getComuneId());
sb.append("]]></column-value></column>"); sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>apiKey</column-name><column-value><![CDATA[");
sb.append(getApiKey());
sb.append("]]></column-value></column>");
sb.append( sb.append(
"<column><column-name>attivo</column-name><column-value><![CDATA["); "<column><column-name>attivo</column-name><column-value><![CDATA[");
sb.append(getAttivo()); sb.append(getAttivo());
sb.append("]]></column-value></column>"); sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>password</column-name><column-value><![CDATA[");
sb.append(getPassword());
sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>passwordModifiedDate</column-name><column-value><![CDATA[");
sb.append(getPasswordModifiedDate());
sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>passwordModifiedUserId</column-name><column-value><![CDATA[");
sb.append(getPasswordModifiedUserId());
sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>passwordModifiedUserName</column-name><column-value><![CDATA[");
sb.append(getPasswordModifiedUserName());
sb.append("]]></column-value></column>");
sb.append("</model>"); sb.append("</model>");
@ -690,17 +943,26 @@ public class SportelloModelImpl extends BaseModelImpl<Sportello>
private long _sportelloId; private long _sportelloId;
private long _groupId; private long _groupId;
private long _companyId; private long _companyId;
private long _userId;
private String _userUuid;
private String _userName;
private Date _createDate; private Date _createDate;
private long _createUserId;
private String _createUserUuid;
private String _createUserName;
private Date _modifiedDate; private Date _modifiedDate;
private long _modifiedUserId;
private String _modifiedUserUuid;
private String _modifiedUserName;
private String _userName;
private String _originalUserName;
private String _email; private String _email;
private long _comuneId; private long _comuneId;
private long _originalComuneId; private long _originalComuneId;
private boolean _setOriginalComuneId; private boolean _setOriginalComuneId;
private String _apiKey;
private boolean _attivo; private boolean _attivo;
private String _password;
private Date _passwordModifiedDate;
private long _passwordModifiedUserId;
private String _passwordModifiedUserUuid;
private String _passwordModifiedUserName;
private long _columnBitmask; private long _columnBitmask;
private Sportello _escapedModel; private Sportello _escapedModel;
} }

27
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 sportelloId = ParamUtil.getLong(actionRequest, "sportelloId", 0);
long comuneId = ParamUtil.getLong(actionRequest, "comune", 0); long comuneId = ParamUtil.getLong(actionRequest, "comune", 0);
Territorio territorio = TerritorioLocalServiceUtil.findByComuneId(comuneId, 0, 1).get(0); Territorio territorio = TerritorioLocalServiceUtil.findByComuneId(comuneId, 0, 1).get(0);
String userName = ParamUtil.getString(actionRequest, "userName");
String email = ParamUtil.getString(actionRequest, "email"); String email = ParamUtil.getString(actionRequest, "email");
String apiKey = ParamUtil.getString(actionRequest, "apiKey"); String password = ParamUtil.getString(actionRequest, "password");
_log.info("apiKey = " + apiKey); boolean attivo = ParamUtil.getBoolean(actionRequest, "attivo", false);
Sportello sportello = null; Sportello sportello = null;
if (sportelloId != 0) { if (sportelloId != 0) {
try { try {
@ -70,13 +71,29 @@ public class SueAdministrationPortlet extends MVCPortlet {
sportello.setGroupId(territorio.getGroupId()); sportello.setGroupId(territorio.getGroupId());
sportello.setCompanyId(territorio.getCompanyId()); sportello.setCompanyId(territorio.getCompanyId());
sportello.setCreateDate(data); sportello.setCreateDate(data);
sportello.setCreateUserId(user.getUserId());
sportello.setCreateUserName(user.getFullName());
} }
sportello.setUserId(user.getUserId()); sportello.setUserName(userName);
sportello.setUserName(user.getFullName());
sportello.setModifiedDate(data); sportello.setModifiedDate(data);
sportello.setModifiedUserId(user.getUserId());
sportello.setModifiedUserName(user.getFullName());
sportello.setComuneId(comuneId); sportello.setComuneId(comuneId);
sportello.setEmail(email); 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); SportelloLocalServiceUtil.updateSportello(sportello);
} }

11
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"; _methodName41 = "setBeanIdentifier";
_methodParameterTypes41 = new String[] { "java.lang.String" }; _methodParameterTypes41 = new String[] { "java.lang.String" };
_methodName46 = "findByUserName";
_methodParameterTypes46 = new String[] { "java.lang.String" };
} }
public Object invokeMethod(String name, String[] parameterTypes, public Object invokeMethod(String name, String[] parameterTypes,
@ -216,6 +220,11 @@ public class SportelloLocalServiceClpInvoker {
return null; return null;
} }
if (_methodName46.equals(name) &&
Arrays.deepEquals(_methodParameterTypes46, parameterTypes)) {
return SportelloLocalServiceUtil.findByUserName((java.lang.String)arguments[0]);
}
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@ -255,4 +264,6 @@ public class SportelloLocalServiceClpInvoker {
private String[] _methodParameterTypes40; private String[] _methodParameterTypes40;
private String _methodName41; private String _methodName41;
private String[] _methodParameterTypes41; private String[] _methodParameterTypes41;
private String _methodName46;
private String[] _methodParameterTypes46;
} }

11
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"; _methodName25 = "setBeanIdentifier";
_methodParameterTypes25 = new String[] { "java.lang.String" }; _methodParameterTypes25 = new String[] { "java.lang.String" };
_methodName30 = "generaPassword";
_methodParameterTypes30 = new String[] { "int" };
} }
public Object invokeMethod(String name, String[] parameterTypes, public Object invokeMethod(String name, String[] parameterTypes,
@ -47,6 +51,11 @@ public class SportelloServiceClpInvoker {
return null; return null;
} }
if (_methodName30.equals(name) &&
Arrays.deepEquals(_methodParameterTypes30, parameterTypes)) {
return SportelloServiceUtil.generaPassword(((Integer)arguments[0]).intValue());
}
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@ -54,4 +63,6 @@ public class SportelloServiceClpInvoker {
private String[] _methodParameterTypes24; private String[] _methodParameterTypes24;
private String _methodName25; private String _methodName25;
private String[] _methodParameterTypes25; private String[] _methodParameterTypes25;
private String _methodName30;
private String[] _methodParameterTypes30;
} }

22
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; 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 * Provides the SOAP utility for the
* {@link it.mwg.sicilia.sue.service.SportelloServiceUtil} service utility. The * {@link it.mwg.sicilia.sue.service.SportelloServiceUtil} service utility. The
@ -55,4 +62,19 @@ package it.mwg.sicilia.sue.service.http;
* @generated * @generated
*/ */
public class SportelloServiceSoap { 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);
} }

3
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.counter.service.CounterLocalServiceUtil;
import com.liferay.portal.kernel.exception.SystemException; 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; 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 * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* it.mwg.sicilia.sue.service.ApiSettingLocalServiceUtil} to access the api setting local service. * it.mwg.sicilia.sue.service.ApiSettingLocalServiceUtil} to access the api setting local service.
*/ */
private static final Log _log = LogFactoryUtil.getLog(ApiSettingLocalServiceImpl.class);
@Override @Override
public String get(long companyId, long key) throws SystemException { public String get(long companyId, long key) throws SystemException {

21
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; 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 it.mwg.sicilia.sue.service.base.SportelloLocalServiceBaseImpl;
import com.liferay.portal.kernel.exception.SystemException;
/** /**
* The implementation of the sportello local service. * The implementation of the sportello local service.
* *
* <p> * <p>
* 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.
* *
* <p> * <p>
* 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.
* </p> * </p>
* *
* @author Manifattura Web Group Srl * @author Manifattura Web Group Srl
@ -32,8 +38,13 @@ import it.mwg.sicilia.sue.service.base.SportelloLocalServiceBaseImpl;
*/ */
public class SportelloLocalServiceImpl extends SportelloLocalServiceBaseImpl { public class SportelloLocalServiceImpl extends SportelloLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* * it.mwg.sicilia.sue.service.SportelloLocalServiceUtil} to access the sportello local service.
* 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);
}
} }

43
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 it.mwg.sicilia.sue.service.base.SportelloServiceBaseImpl;
import java.security.SecureRandom;
/** /**
* The implementation of the sportello remote service. * The implementation of the sportello remote service.
* *
* <p> * <p>
* 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.
* *
* <p> * <p>
* 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.
* </p> * </p>
* *
* @author Manifattura Web Group Srl * @author Manifattura Web Group Srl
@ -32,8 +36,37 @@ import it.mwg.sicilia.sue.service.base.SportelloServiceBaseImpl;
*/ */
public class SportelloServiceImpl extends SportelloServiceBaseImpl { public class SportelloServiceImpl extends SportelloServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* * it.mwg.sicilia.sue.service.SportelloServiceUtil} to access the sportello remote service.
* 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();
}
} }

297
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.OrderByComparator;
import com.liferay.portal.kernel.util.PropsKeys; import com.liferay.portal.kernel.util.PropsKeys;
import com.liferay.portal.kernel.util.PropsUtil; 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.StringBundler;
import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.StringUtil; import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.UnmodifiableList; 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.CacheModel;
import com.liferay.portal.model.ModelListener; import com.liferay.portal.model.ModelListener;
import com.liferay.portal.service.persistence.impl.BasePersistenceImpl; import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
@ -49,6 +51,7 @@ import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Set;
/** /**
* The persistence implementation for the sportello service. * The persistence implementation for the sportello service.
@ -293,6 +296,247 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl<Sportello>
} }
private static final String _FINDER_COLUMN_COMUNEID_COMUNEID_2 = "sportello.comuneId = ?"; 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 = &#63; 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 = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
*
* @param userName the user name
* @return the matching sportello, or <code>null</code> 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 = &#63; or returns <code>null</code> 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 <code>null</code> 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<Sportello> 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 = &#63; 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 = &#63;.
*
* @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() { public SportelloPersistenceImpl() {
setModelClass(Sportello.class); setModelClass(Sportello.class);
@ -311,6 +555,9 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl<Sportello>
FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COMUNEID, FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COMUNEID,
new Object[] { sportello.getComuneId() }, sportello); new Object[] { sportello.getComuneId() }, sportello);
FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_USERNAME,
new Object[] { sportello.getUserName() }, sportello);
sportello.resetOriginalValues(); sportello.resetOriginalValues();
} }
@ -392,6 +639,13 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl<Sportello>
Long.valueOf(1)); Long.valueOf(1));
FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COMUNEID, args, FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COMUNEID, args,
sportello); 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 { else {
SportelloModelImpl sportelloModelImpl = (SportelloModelImpl)sportello; SportelloModelImpl sportelloModelImpl = (SportelloModelImpl)sportello;
@ -405,6 +659,16 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl<Sportello>
FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COMUNEID, args, FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COMUNEID, args,
sportello); 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<Sportello>
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_COMUNEID, args); FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_COMUNEID, args);
FinderCacheUtil.removeResult(FINDER_PATH_FETCH_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<Sportello>
sportelloImpl.setSportelloId(sportello.getSportelloId()); sportelloImpl.setSportelloId(sportello.getSportelloId());
sportelloImpl.setGroupId(sportello.getGroupId()); sportelloImpl.setGroupId(sportello.getGroupId());
sportelloImpl.setCompanyId(sportello.getCompanyId()); sportelloImpl.setCompanyId(sportello.getCompanyId());
sportelloImpl.setUserId(sportello.getUserId());
sportelloImpl.setUserName(sportello.getUserName());
sportelloImpl.setCreateDate(sportello.getCreateDate()); sportelloImpl.setCreateDate(sportello.getCreateDate());
sportelloImpl.setCreateUserId(sportello.getCreateUserId());
sportelloImpl.setCreateUserName(sportello.getCreateUserName());
sportelloImpl.setModifiedDate(sportello.getModifiedDate()); sportelloImpl.setModifiedDate(sportello.getModifiedDate());
sportelloImpl.setModifiedUserId(sportello.getModifiedUserId());
sportelloImpl.setModifiedUserName(sportello.getModifiedUserName());
sportelloImpl.setUserName(sportello.getUserName());
sportelloImpl.setEmail(sportello.getEmail()); sportelloImpl.setEmail(sportello.getEmail());
sportelloImpl.setComuneId(sportello.getComuneId()); sportelloImpl.setComuneId(sportello.getComuneId());
sportelloImpl.setApiKey(sportello.getApiKey());
sportelloImpl.setAttivo(sportello.isAttivo()); sportelloImpl.setAttivo(sportello.isAttivo());
sportelloImpl.setPassword(sportello.getPassword());
sportelloImpl.setPasswordModifiedDate(sportello.getPasswordModifiedDate());
sportelloImpl.setPasswordModifiedUserId(sportello.getPasswordModifiedUserId());
sportelloImpl.setPasswordModifiedUserName(sportello.getPasswordModifiedUserName());
return sportelloImpl; return sportelloImpl;
} }
@ -870,6 +1153,11 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl<Sportello>
return count.intValue(); return count.intValue();
} }
@Override
protected Set<String> getBadColumnNames() {
return _badColumnNames;
}
/** /**
* Initializes the sportello persistence. * Initializes the sportello persistence.
*/ */
@ -912,6 +1200,9 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl<Sportello>
private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = GetterUtil.getBoolean(PropsUtil.get( private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = GetterUtil.getBoolean(PropsUtil.get(
PropsKeys.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE)); PropsKeys.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE));
private static Log _log = LogFactoryUtil.getLog(SportelloPersistenceImpl.class); private static Log _log = LogFactoryUtil.getLog(SportelloPersistenceImpl.class);
private static Set<String> _badColumnNames = SetUtil.fromArray(new String[] {
"password"
});
private static Sportello _nullSportello = new SportelloImpl() { private static Sportello _nullSportello = new SportelloImpl() {
@Override @Override
public Object clone() { public Object clone() {

2
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) { } catch (NoSuchAlgorithmException e) {
} }
if (Validator.isNotNull(generator)) { if (Validator.isNotNull(generator)) {
generator.initialize(1024); generator.initialize(4096);
KeyPair pair = generator.generateKeyPair(); KeyPair pair = generator.generateKeyPair();
try { try {
ApiSettingLocalServiceUtil.set(companyId, ApiConstants.API_PRIVATE_KEY, ApiSettingLocalServiceUtil.set(companyId, ApiConstants.API_PRIVATE_KEY,

4
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.namespace=sicilia_sue
build.number=41 build.number=61
build.date=1623664988040 build.date=1623771128700
build.auto.upgrade=true build.auto.upgrade=true
## ##

37
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 contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.util.ParamUtil"%> <%@page import="com.liferay.portal.kernel.util.ParamUtil"%>
<%@page import="com.liferay.portal.kernel.util.StringPool"%> <%@page import="com.liferay.portal.kernel.util.StringPool"%>
<%@page import="com.liferay.portal.kernel.util.Validator"%> <%@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.model.Sportello"%>
<%@page import="it.mwg.sicilia.sue.portlet.SueAdministrationPortlet"%> <%@page import="it.mwg.sicilia.sue.portlet.SueAdministrationPortlet"%>
<%@page import="it.mwg.sicilia.sue.service.SportelloLocalServiceUtil"%> <%@page import="it.mwg.sicilia.sue.service.SportelloLocalServiceUtil"%>
@ -15,26 +15,43 @@ Sportello sportello = sportelloId == 0 ? null : SportelloLocalServiceUtil.getSpo
<aui:form method="post" action="<%= editSportelloURL %>" inlineLabels="false" name="edit" id="edit"> <aui:form method="post" action="<%= editSportelloURL %>" inlineLabels="false" name="edit" id="edit">
<aui:input name="sportelloId" type="hidden" value="<%= String.valueOf(sportelloId) %>" /> <aui:input name="sportelloId" type="hidden" value="<%= String.valueOf(sportelloId) %>" />
<aui:row> <aui:row>
<aui:col width="50"> <aui:col width="30">
<aui:select name="provincia" id="provincia" label="nomeProvincia" showEmptyOption="true" /> <aui:select name="provincia" id="provincia" label="nomeProvincia" showEmptyOption="true" cssClass="span10" />
<aui:select name="comune" id="comune" label="nomeComune" showEmptyOption="true" /> <aui:select name="comune" id="comune" label="nomeComune" showEmptyOption="true" cssClass="span10" />
<aui:input name="attivo" id="attivo" label="active" type="checkbox"
value="<%= Validator.isNull(sportello) ? false : sportello.getAttivo() %>" />
</aui:col> </aui:col>
<aui:col width="50"> <aui:col width="70">
<aui:input name="email" id="email" label="email" wrapperCssClass="lfr-input-text-container" <aui:input name="userName" id="userName" cssClass="span10"
value="<%= Validator.isNull(sportello) ? sportello.getNomeComune() : sportello.getUserName() %>">
<aui:validator name="required" />
</aui:input>
<aui:input name="email" id="email" label="email" cssClass="span10"
value="<%= Validator.isNull(sportello) ? StringPool.BLANK : sportello.getEmail() %>"> value="<%= Validator.isNull(sportello) ? StringPool.BLANK : sportello.getEmail() %>">
<aui:validator name="required" /> <aui:validator name="required" />
<aui:validator name="email" /> <aui:validator name="email" />
</aui:input> </aui:input>
<aui:input name="apiKey" id="apiKey" <aui:input name="password" id="password" cssClass="span10"
value="<%= Validator.isNull(sportello) ? ApiUtil.getToken(sportelloId) : value="<%= sportelloId == 0 ? SportelloServiceUtil.generaPassword(12) : StringPool.BLANK %>" />
sportello.getApiKey() %>" /> <aui:button id="generate" value="generate" />
</aui:col> </aui:col>
</aui:row> </aui:row>
<aui:button type="submit" value="save" /> <aui:button type="submit" value="save" />
</aui:form> </aui:form>
<liferay-portlet:resourceURL id="<%= SueAdministrationPortlet.RESOURCE_PROVINCE %>" var="getProvinceURL" /> <liferay-portlet:resourceURL id="<%= SueAdministrationPortlet.RESOURCE_PROVINCE %>" var="getProvinceURL" />
<liferay-portlet:resourceURL id="<%= SueAdministrationPortlet.RESOURCE_COMUNI %>" var="getComuniURL" /> <liferay-portlet:resourceURL id="<%= SueAdministrationPortlet.RESOURCE_COMUNI %>" var="getComuniURL" />
<aui:script use="aui-io-request,liferay-dynamic-select,aui-form-validator"> <aui:script use="aui-base,aui-io-request,liferay-dynamic-select,aui-form-validator">
A.one('#generate').on('click', function(event) {
Liferay.Service(
'/sicilia-sue-connector-portlet.sportello/genera-password',
{
lunghezza: 12,
},
function(obj) {
A.one('#<portlet:namespace/>password').set('value', obj);
}
);
});
A.mix( A.mix(
A.config.FormValidator.RULES, { A.config.FormValidator.RULES, {
requiredSelect: function(value, fieldNode, ruleValue) { requiredSelect: function(value, fieldNode, ruleValue) {

25
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 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.model.Sportello"%>
<%@page import="it.mwg.sicilia.sue.service.SportelloLocalServiceUtil"%> <%@page import="it.mwg.sicilia.sue.service.SportelloLocalServiceUtil"%>
<%@page import="java.util.List"%>
<%@include file="/html/init.jsp"%> <%@include file="/html/init.jsp"%>
<portlet:renderURL var="addSportelloURL"> <portlet:renderURL var="addSportelloURL">
<portlet:param name="mvcPath" value="/html/administration/edit_sportello.jsp" /> <portlet:param name="mvcPath" value="/html/administration/edit_sportello.jsp" />
@ -19,12 +20,15 @@
searchContainer.getEnd()) %>" /> searchContainer.getEnd()) %>" />
<% <%
NumberFormat format = NumberFormat.getInstance(); NumberFormat format = NumberFormat.getInstance();
String redirect = searchContainer.getIteratorURL().toString();
%> %>
<liferay-ui:search-container-row className="it.mwg.sicilia.sue.model.Sportello" modelVar="sportello"> <liferay-ui:search-container-row className="it.mwg.sicilia.sue.model.Sportello" modelVar="sportello">
<liferay-ui:search-container-column-text name="nomeProvincia" /> <liferay-ui:search-container-column-text name="nomeProvincia" />
<liferay-ui:search-container-column-text name="nomeComune" /> <liferay-ui:search-container-column-text name="nomeComune" />
<liferay-ui:search-container-column-text name="userName" />
<liferay-ui:search-container-column-text name="email" /> <liferay-ui:search-container-column-text name="email" />
<liferay-ui:search-container-column-text name="attivo" /> <liferay-ui:search-container-column-text name="attivo"
value='<%= LanguageUtil.get(pageContext, sportello.isAttivo() ? "yes" : "no") %>' />
<liferay-ui:search-container-column-text name="actions"> <liferay-ui:search-container-column-text name="actions">
<portlet:renderURL var="editSportelloURL"> <portlet:renderURL var="editSportelloURL">
<portlet:param name="mvcPath" value="/html/administration/edit_sportello.jsp" /> <portlet:param name="mvcPath" value="/html/administration/edit_sportello.jsp" />
@ -33,7 +37,20 @@
</portlet:renderURL> </portlet:renderURL>
<liferay-ui:icon-menu> <liferay-ui:icon-menu>
<liferay-ui:icon image="edit" url="<%= editSportelloURL %>"/> <liferay-ui:icon image="edit" url="<%= editSportelloURL %>"/>
<liferay-ui:icon image="delete" message="disable" url="<%= editSportelloURL %>"/> <c:if test="<%= sportello.isAttivo() %>">
<portlet:actionURL name="attivaSportello" var="disattivaSportelloURL">
<portlet:param name="sportelloId" value="<%= String.valueOf(sportello.getSportelloId()) %>" />
<portlet:param name="attivo" value="false" />
</portlet:actionURL>
<liferay-ui:icon image="deactivate" message="deactivate" url="<%= disattivaSportelloURL %>"/>
</c:if>
<c:if test="<%= !sportello.isAttivo() %>">
<portlet:actionURL name="attivaSportello" var="attivaSportelloURL">
<portlet:param name="sportelloId" value="<%= String.valueOf(sportello.getSportelloId()) %>" />
<portlet:param name="attivo" value="true" />
</portlet:actionURL>
<liferay-ui:icon image="activate" message="activate" url="<%= attivaSportelloURL %>"/>
</c:if>
</liferay-ui:icon-menu> </liferay-ui:icon-menu>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
</liferay-ui:search-container-row> </liferay-ui:search-container-row>

Caricamento…
Annulla
Salva