diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/edit_modal_fascicolo.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/edit_modal_fascicolo.jsp index 4d7a70e3..e7f25572 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/edit_modal_fascicolo.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/edit_modal_fascicolo.jsp @@ -165,7 +165,6 @@ selectId: 'provinciaId', selectSort: true, selectVal: '0' - }, { select: 'comune', @@ -174,7 +173,6 @@ selectId: 'comuneId', selectSort: true, selectVal: '0' - }/*, { select: 'territorioId', diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/init.jsp index 51c865d9..f7a89418 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/init.jsp @@ -28,8 +28,6 @@ <%@page import="it.tref.liferay.portos.mailmanager.shared.util.MailManagerConstants"%> -<%@ page contentType="text/html; charset=UTF-8" %> - <%@page import="com.liferay.portal.kernel.util.GetterUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/.gitignore b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/.gitignore new file mode 100644 index 00000000..840e7d31 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/.gitignore @@ -0,0 +1 @@ +/classes/ diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/lib/sicilia-sue-connector-portlet-service.jar b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/lib/sicilia-sue-connector-portlet-service.jar index 985e89cf..e1968be5 100644 Binary files a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/lib/sicilia-sue-connector-portlet-service.jar and b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/lib/sicilia-sue-connector-portlet-service.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/liferay-hook.xml b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/liferay-hook.xml new file mode 100644 index 00000000..812685cb --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/liferay-hook.xml @@ -0,0 +1,5 @@ + + + + portal.properties + \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/portlet.xml b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/portlet.xml index 49ff4f07..438a7819 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/portlet.xml +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/portlet.xml @@ -13,6 +13,7 @@ text/html + content.Language Sicilia SUE Connector Sicilia SUE Connector @@ -44,6 +45,7 @@ text/html view + content.Language Amministrazione Connettore SUE Amministrazione Connettore SUE diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service.xml b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service.xml index 4a3af20e..393d2f60 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service.xml +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service.xml @@ -15,13 +15,24 @@ - - - + + + + - - + + + + + + + + + + + + \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/NoSuchApiSettingException.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/NoSuchApiSettingException.java new file mode 100644 index 00000000..4ef11342 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/NoSuchApiSettingException.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.NoSuchModelException; + +/** + * @author Manifattura Web Group Srl + */ +public class NoSuchApiSettingException extends NoSuchModelException { + + public NoSuchApiSettingException() { + super(); + } + + public NoSuchApiSettingException(String msg) { + super(msg); + } + + public NoSuchApiSettingException(String msg, Throwable cause) { + super(msg, cause); + } + + public NoSuchApiSettingException(Throwable cause) { + super(cause); + } + +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/ApiSetting.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/ApiSetting.java new file mode 100644 index 00000000..d4bc4913 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/ApiSetting.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2000-present 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.model; + +import com.liferay.portal.model.PersistedModel; + +/** + * The extended model interface for the ApiSetting service. Represents a row in the "sicilia_sue_ApiSetting" database table, with each column mapped to a property of this class. + * + * @author Manifattura Web Group Srl + * @see ApiSettingModel + * @see it.mwg.sicilia.sue.model.impl.ApiSettingImpl + * @see it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl + * @generated + */ +public interface ApiSetting extends ApiSettingModel, PersistedModel { + /* + * NOTE FOR DEVELOPERS: + * + * Never modify this interface directly. Add methods to {@link it.mwg.sicilia.sue.model.impl.ApiSettingImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. + */ +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/ApiSettingClp.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/ApiSettingClp.java new file mode 100644 index 00000000..ce7910b1 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/ApiSettingClp.java @@ -0,0 +1,379 @@ +/** + * Copyright (c) 2000-present 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.model; + +import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler; +import com.liferay.portal.kernel.exception.SystemException; +import com.liferay.portal.kernel.util.ProxyUtil; +import com.liferay.portal.kernel.util.StringBundler; +import com.liferay.portal.model.BaseModel; +import com.liferay.portal.model.impl.BaseModelImpl; + +import it.mwg.sicilia.sue.service.ApiSettingLocalServiceUtil; +import it.mwg.sicilia.sue.service.ClpSerializer; + +import java.io.Serializable; + +import java.lang.reflect.Method; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author Manifattura Web Group Srl + */ +public class ApiSettingClp extends BaseModelImpl + implements ApiSetting { + public ApiSettingClp() { + } + + @Override + public Class getModelClass() { + return ApiSetting.class; + } + + @Override + public String getModelClassName() { + return ApiSetting.class.getName(); + } + + @Override + public long getPrimaryKey() { + return _id; + } + + @Override + public void setPrimaryKey(long primaryKey) { + setId(primaryKey); + } + + @Override + public Serializable getPrimaryKeyObj() { + return _id; + } + + @Override + public void setPrimaryKeyObj(Serializable primaryKeyObj) { + setPrimaryKey(((Long)primaryKeyObj).longValue()); + } + + @Override + public Map getModelAttributes() { + Map attributes = new HashMap(); + + attributes.put("id", getId()); + attributes.put("companyId", getCompanyId()); + attributes.put("key", getKey()); + attributes.put("value", getValue()); + + return attributes; + } + + @Override + public void setModelAttributes(Map attributes) { + Long id = (Long)attributes.get("id"); + + if (id != null) { + setId(id); + } + + Long companyId = (Long)attributes.get("companyId"); + + if (companyId != null) { + setCompanyId(companyId); + } + + Long key = (Long)attributes.get("key"); + + if (key != null) { + setKey(key); + } + + String value = (String)attributes.get("value"); + + if (value != null) { + setValue(value); + } + } + + @Override + public long getId() { + return _id; + } + + @Override + public void setId(long id) { + _id = id; + + if (_apiSettingRemoteModel != null) { + try { + Class clazz = _apiSettingRemoteModel.getClass(); + + Method method = clazz.getMethod("setId", long.class); + + method.invoke(_apiSettingRemoteModel, id); + } + catch (Exception e) { + throw new UnsupportedOperationException(e); + } + } + } + + @Override + public long getCompanyId() { + return _companyId; + } + + @Override + public void setCompanyId(long companyId) { + _companyId = companyId; + + if (_apiSettingRemoteModel != null) { + try { + Class clazz = _apiSettingRemoteModel.getClass(); + + Method method = clazz.getMethod("setCompanyId", long.class); + + method.invoke(_apiSettingRemoteModel, companyId); + } + catch (Exception e) { + throw new UnsupportedOperationException(e); + } + } + } + + @Override + public long getKey() { + return _key; + } + + @Override + public void setKey(long key) { + _key = key; + + if (_apiSettingRemoteModel != null) { + try { + Class clazz = _apiSettingRemoteModel.getClass(); + + Method method = clazz.getMethod("setKey", long.class); + + method.invoke(_apiSettingRemoteModel, key); + } + catch (Exception e) { + throw new UnsupportedOperationException(e); + } + } + } + + @Override + public String getValue() { + return _value; + } + + @Override + public void setValue(String value) { + _value = value; + + if (_apiSettingRemoteModel != null) { + try { + Class clazz = _apiSettingRemoteModel.getClass(); + + Method method = clazz.getMethod("setValue", String.class); + + method.invoke(_apiSettingRemoteModel, value); + } + catch (Exception e) { + throw new UnsupportedOperationException(e); + } + } + } + + public BaseModel getApiSettingRemoteModel() { + return _apiSettingRemoteModel; + } + + public void setApiSettingRemoteModel(BaseModel apiSettingRemoteModel) { + _apiSettingRemoteModel = apiSettingRemoteModel; + } + + public Object invokeOnRemoteModel(String methodName, + Class[] parameterTypes, Object[] parameterValues) + throws Exception { + Object[] remoteParameterValues = new Object[parameterValues.length]; + + for (int i = 0; i < parameterValues.length; i++) { + if (parameterValues[i] != null) { + remoteParameterValues[i] = ClpSerializer.translateInput(parameterValues[i]); + } + } + + Class remoteModelClass = _apiSettingRemoteModel.getClass(); + + ClassLoader remoteModelClassLoader = remoteModelClass.getClassLoader(); + + Class[] remoteParameterTypes = new Class[parameterTypes.length]; + + for (int i = 0; i < parameterTypes.length; i++) { + if (parameterTypes[i].isPrimitive()) { + remoteParameterTypes[i] = parameterTypes[i]; + } + else { + String parameterTypeName = parameterTypes[i].getName(); + + remoteParameterTypes[i] = remoteModelClassLoader.loadClass(parameterTypeName); + } + } + + Method method = remoteModelClass.getMethod(methodName, + remoteParameterTypes); + + Object returnValue = method.invoke(_apiSettingRemoteModel, + remoteParameterValues); + + if (returnValue != null) { + returnValue = ClpSerializer.translateOutput(returnValue); + } + + return returnValue; + } + + @Override + public void persist() throws SystemException { + if (this.isNew()) { + ApiSettingLocalServiceUtil.addApiSetting(this); + } + else { + ApiSettingLocalServiceUtil.updateApiSetting(this); + } + } + + @Override + public ApiSetting toEscapedModel() { + return (ApiSetting)ProxyUtil.newProxyInstance(ApiSetting.class.getClassLoader(), + new Class[] { ApiSetting.class }, new AutoEscapeBeanHandler(this)); + } + + @Override + public Object clone() { + ApiSettingClp clone = new ApiSettingClp(); + + clone.setId(getId()); + clone.setCompanyId(getCompanyId()); + clone.setKey(getKey()); + clone.setValue(getValue()); + + return clone; + } + + @Override + public int compareTo(ApiSetting apiSetting) { + long primaryKey = apiSetting.getPrimaryKey(); + + if (getPrimaryKey() < primaryKey) { + return -1; + } + else if (getPrimaryKey() > primaryKey) { + return 1; + } + else { + return 0; + } + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + + if (!(obj instanceof ApiSettingClp)) { + return false; + } + + ApiSettingClp apiSetting = (ApiSettingClp)obj; + + long primaryKey = apiSetting.getPrimaryKey(); + + if (getPrimaryKey() == primaryKey) { + return true; + } + else { + return false; + } + } + + public Class getClpSerializerClass() { + return _clpSerializerClass; + } + + @Override + public int hashCode() { + return (int)getPrimaryKey(); + } + + @Override + public String toString() { + StringBundler sb = new StringBundler(9); + + sb.append("{id="); + sb.append(getId()); + sb.append(", companyId="); + sb.append(getCompanyId()); + sb.append(", key="); + sb.append(getKey()); + sb.append(", value="); + sb.append(getValue()); + sb.append("}"); + + return sb.toString(); + } + + @Override + public String toXmlString() { + StringBundler sb = new StringBundler(16); + + sb.append(""); + sb.append("it.mwg.sicilia.sue.model.ApiSetting"); + sb.append(""); + + sb.append( + "id"); + sb.append( + "companyId"); + sb.append( + "key"); + sb.append( + "value"); + + sb.append(""); + + return sb.toString(); + } + + private long _id; + private long _companyId; + private long _key; + private String _value; + private BaseModel _apiSettingRemoteModel; + private Class _clpSerializerClass = it.mwg.sicilia.sue.service.ClpSerializer.class; +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/ApiSettingModel.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/ApiSettingModel.java new file mode 100644 index 00000000..c6ea3753 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/ApiSettingModel.java @@ -0,0 +1,173 @@ +/** + * Copyright (c) 2000-present 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.model; + +import com.liferay.portal.kernel.bean.AutoEscape; +import com.liferay.portal.model.BaseModel; +import com.liferay.portal.model.CacheModel; +import com.liferay.portal.service.ServiceContext; + +import com.liferay.portlet.expando.model.ExpandoBridge; + +import java.io.Serializable; + +/** + * The base model interface for the ApiSetting service. Represents a row in the "sicilia_sue_ApiSetting" database table, with each column mapped to a property of this class. + * + *

+ * This interface and its corresponding implementation {@link it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link it.mwg.sicilia.sue.model.impl.ApiSettingImpl}. + *

+ * + * @author Manifattura Web Group Srl + * @see ApiSetting + * @see it.mwg.sicilia.sue.model.impl.ApiSettingImpl + * @see it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl + * @generated + */ +public interface ApiSettingModel extends BaseModel { + /* + * NOTE FOR DEVELOPERS: + * + * Never modify or reference this interface directly. All methods that expect a api setting model instance should use the {@link ApiSetting} interface instead. + */ + + /** + * Returns the primary key of this api setting. + * + * @return the primary key of this api setting + */ + public long getPrimaryKey(); + + /** + * Sets the primary key of this api setting. + * + * @param primaryKey the primary key of this api setting + */ + public void setPrimaryKey(long primaryKey); + + /** + * Returns the ID of this api setting. + * + * @return the ID of this api setting + */ + public long getId(); + + /** + * Sets the ID of this api setting. + * + * @param id the ID of this api setting + */ + public void setId(long id); + + /** + * Returns the company ID of this api setting. + * + * @return the company ID of this api setting + */ + public long getCompanyId(); + + /** + * Sets the company ID of this api setting. + * + * @param companyId the company ID of this api setting + */ + public void setCompanyId(long companyId); + + /** + * Returns the key of this api setting. + * + * @return the key of this api setting + */ + public long getKey(); + + /** + * Sets the key of this api setting. + * + * @param key the key of this api setting + */ + public void setKey(long key); + + /** + * Returns the value of this api setting. + * + * @return the value of this api setting + */ + @AutoEscape + public String getValue(); + + /** + * Sets the value of this api setting. + * + * @param value the value of this api setting + */ + public void setValue(String value); + + @Override + public boolean isNew(); + + @Override + public void setNew(boolean n); + + @Override + public boolean isCachedModel(); + + @Override + public void setCachedModel(boolean cachedModel); + + @Override + public boolean isEscapedModel(); + + @Override + public Serializable getPrimaryKeyObj(); + + @Override + public void setPrimaryKeyObj(Serializable primaryKeyObj); + + @Override + public ExpandoBridge getExpandoBridge(); + + @Override + public void setExpandoBridgeAttributes(BaseModel baseModel); + + @Override + public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge); + + @Override + public void setExpandoBridgeAttributes(ServiceContext serviceContext); + + @Override + public Object clone(); + + @Override + public int compareTo(it.mwg.sicilia.sue.model.ApiSetting apiSetting); + + @Override + public int hashCode(); + + @Override + public CacheModel toCacheModel(); + + @Override + public it.mwg.sicilia.sue.model.ApiSetting toEscapedModel(); + + @Override + public it.mwg.sicilia.sue.model.ApiSetting toUnescapedModel(); + + @Override + public String toString(); + + @Override + public String toXmlString(); +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/ApiSettingSoap.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/ApiSettingSoap.java new file mode 100644 index 00000000..43988596 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/ApiSettingSoap.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) 2000-present 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.model; + +import java.io.Serializable; + +import java.util.ArrayList; +import java.util.List; + +/** + * This class is used by SOAP remote services, specifically {@link it.mwg.sicilia.sue.service.http.ApiSettingServiceSoap}. + * + * @author Manifattura Web Group Srl + * @see it.mwg.sicilia.sue.service.http.ApiSettingServiceSoap + * @generated + */ +public class ApiSettingSoap implements Serializable { + public static ApiSettingSoap toSoapModel(ApiSetting model) { + ApiSettingSoap soapModel = new ApiSettingSoap(); + + soapModel.setId(model.getId()); + soapModel.setCompanyId(model.getCompanyId()); + soapModel.setKey(model.getKey()); + soapModel.setValue(model.getValue()); + + return soapModel; + } + + public static ApiSettingSoap[] toSoapModels(ApiSetting[] models) { + ApiSettingSoap[] soapModels = new ApiSettingSoap[models.length]; + + for (int i = 0; i < models.length; i++) { + soapModels[i] = toSoapModel(models[i]); + } + + return soapModels; + } + + public static ApiSettingSoap[][] toSoapModels(ApiSetting[][] models) { + ApiSettingSoap[][] soapModels = null; + + if (models.length > 0) { + soapModels = new ApiSettingSoap[models.length][models[0].length]; + } + else { + soapModels = new ApiSettingSoap[0][0]; + } + + for (int i = 0; i < models.length; i++) { + soapModels[i] = toSoapModels(models[i]); + } + + return soapModels; + } + + public static ApiSettingSoap[] toSoapModels(List models) { + List soapModels = new ArrayList(models.size()); + + for (ApiSetting model : models) { + soapModels.add(toSoapModel(model)); + } + + return soapModels.toArray(new ApiSettingSoap[soapModels.size()]); + } + + public ApiSettingSoap() { + } + + public long getPrimaryKey() { + return _id; + } + + public void setPrimaryKey(long pk) { + setId(pk); + } + + public long getId() { + return _id; + } + + public void setId(long id) { + _id = id; + } + + public long getCompanyId() { + return _companyId; + } + + public void setCompanyId(long companyId) { + _companyId = companyId; + } + + public long getKey() { + return _key; + } + + public void setKey(long key) { + _key = key; + } + + public String getValue() { + return _value; + } + + public void setValue(String value) { + _value = value; + } + + private long _id; + private long _companyId; + private long _key; + private String _value; +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/ApiSettingWrapper.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/ApiSettingWrapper.java new file mode 100644 index 00000000..e9bad735 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/ApiSettingWrapper.java @@ -0,0 +1,327 @@ +/** + * Copyright (c) 2000-present 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.model; + +import com.liferay.portal.kernel.util.Validator; +import com.liferay.portal.model.ModelWrapper; + +import java.util.HashMap; +import java.util.Map; + +/** + *

+ * This class is a wrapper for {@link ApiSetting}. + *

+ * + * @author Manifattura Web Group Srl + * @see ApiSetting + * @generated + */ +public class ApiSettingWrapper implements ApiSetting, ModelWrapper { + public ApiSettingWrapper(ApiSetting apiSetting) { + _apiSetting = apiSetting; + } + + @Override + public Class getModelClass() { + return ApiSetting.class; + } + + @Override + public String getModelClassName() { + return ApiSetting.class.getName(); + } + + @Override + public Map getModelAttributes() { + Map attributes = new HashMap(); + + attributes.put("id", getId()); + attributes.put("companyId", getCompanyId()); + attributes.put("key", getKey()); + attributes.put("value", getValue()); + + return attributes; + } + + @Override + public void setModelAttributes(Map attributes) { + Long id = (Long)attributes.get("id"); + + if (id != null) { + setId(id); + } + + Long companyId = (Long)attributes.get("companyId"); + + if (companyId != null) { + setCompanyId(companyId); + } + + Long key = (Long)attributes.get("key"); + + if (key != null) { + setKey(key); + } + + String value = (String)attributes.get("value"); + + if (value != null) { + setValue(value); + } + } + + /** + * Returns the primary key of this api setting. + * + * @return the primary key of this api setting + */ + @Override + public long getPrimaryKey() { + return _apiSetting.getPrimaryKey(); + } + + /** + * Sets the primary key of this api setting. + * + * @param primaryKey the primary key of this api setting + */ + @Override + public void setPrimaryKey(long primaryKey) { + _apiSetting.setPrimaryKey(primaryKey); + } + + /** + * Returns the ID of this api setting. + * + * @return the ID of this api setting + */ + @Override + public long getId() { + return _apiSetting.getId(); + } + + /** + * Sets the ID of this api setting. + * + * @param id the ID of this api setting + */ + @Override + public void setId(long id) { + _apiSetting.setId(id); + } + + /** + * Returns the company ID of this api setting. + * + * @return the company ID of this api setting + */ + @Override + public long getCompanyId() { + return _apiSetting.getCompanyId(); + } + + /** + * Sets the company ID of this api setting. + * + * @param companyId the company ID of this api setting + */ + @Override + public void setCompanyId(long companyId) { + _apiSetting.setCompanyId(companyId); + } + + /** + * Returns the key of this api setting. + * + * @return the key of this api setting + */ + @Override + public long getKey() { + return _apiSetting.getKey(); + } + + /** + * Sets the key of this api setting. + * + * @param key the key of this api setting + */ + @Override + public void setKey(long key) { + _apiSetting.setKey(key); + } + + /** + * Returns the value of this api setting. + * + * @return the value of this api setting + */ + @Override + public java.lang.String getValue() { + return _apiSetting.getValue(); + } + + /** + * Sets the value of this api setting. + * + * @param value the value of this api setting + */ + @Override + public void setValue(java.lang.String value) { + _apiSetting.setValue(value); + } + + @Override + public boolean isNew() { + return _apiSetting.isNew(); + } + + @Override + public void setNew(boolean n) { + _apiSetting.setNew(n); + } + + @Override + public boolean isCachedModel() { + return _apiSetting.isCachedModel(); + } + + @Override + public void setCachedModel(boolean cachedModel) { + _apiSetting.setCachedModel(cachedModel); + } + + @Override + public boolean isEscapedModel() { + return _apiSetting.isEscapedModel(); + } + + @Override + public java.io.Serializable getPrimaryKeyObj() { + return _apiSetting.getPrimaryKeyObj(); + } + + @Override + public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) { + _apiSetting.setPrimaryKeyObj(primaryKeyObj); + } + + @Override + public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() { + return _apiSetting.getExpandoBridge(); + } + + @Override + public void setExpandoBridgeAttributes( + com.liferay.portal.model.BaseModel baseModel) { + _apiSetting.setExpandoBridgeAttributes(baseModel); + } + + @Override + public void setExpandoBridgeAttributes( + com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) { + _apiSetting.setExpandoBridgeAttributes(expandoBridge); + } + + @Override + public void setExpandoBridgeAttributes( + com.liferay.portal.service.ServiceContext serviceContext) { + _apiSetting.setExpandoBridgeAttributes(serviceContext); + } + + @Override + public java.lang.Object clone() { + return new ApiSettingWrapper((ApiSetting)_apiSetting.clone()); + } + + @Override + public int compareTo(it.mwg.sicilia.sue.model.ApiSetting apiSetting) { + return _apiSetting.compareTo(apiSetting); + } + + @Override + public int hashCode() { + return _apiSetting.hashCode(); + } + + @Override + public com.liferay.portal.model.CacheModel toCacheModel() { + return _apiSetting.toCacheModel(); + } + + @Override + public it.mwg.sicilia.sue.model.ApiSetting toEscapedModel() { + return new ApiSettingWrapper(_apiSetting.toEscapedModel()); + } + + @Override + public it.mwg.sicilia.sue.model.ApiSetting toUnescapedModel() { + return new ApiSettingWrapper(_apiSetting.toUnescapedModel()); + } + + @Override + public java.lang.String toString() { + return _apiSetting.toString(); + } + + @Override + public java.lang.String toXmlString() { + return _apiSetting.toXmlString(); + } + + @Override + public void persist() + throws com.liferay.portal.kernel.exception.SystemException { + _apiSetting.persist(); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + + if (!(obj instanceof ApiSettingWrapper)) { + return false; + } + + ApiSettingWrapper apiSettingWrapper = (ApiSettingWrapper)obj; + + if (Validator.equals(_apiSetting, apiSettingWrapper._apiSetting)) { + return true; + } + + return false; + } + + /** + * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel} + */ + public ApiSetting getWrappedApiSetting() { + return _apiSetting; + } + + @Override + public ApiSetting getWrappedModel() { + return _apiSetting; + } + + @Override + public void resetOriginalValues() { + _apiSetting.resetOriginalValues(); + } + + private ApiSetting _apiSetting; +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/Sportello.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/Sportello.java index 9f52c59f..898c8f84 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/Sportello.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/Sportello.java @@ -31,4 +31,15 @@ public interface Sportello extends SportelloModel, PersistedModel { * * Never modify this interface directly. Add methods to {@link it.mwg.sicilia.sue.model.impl.SportelloImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. */ + public java.lang.String getCodiceProvincia() + throws com.liferay.portal.kernel.exception.PortalException, + com.liferay.portal.kernel.exception.SystemException; + + public java.lang.String getNomeComune() + throws com.liferay.portal.kernel.exception.PortalException, + com.liferay.portal.kernel.exception.SystemException; + + public java.lang.String getNomeProvincia() + throws com.liferay.portal.kernel.exception.PortalException, + com.liferay.portal.kernel.exception.SystemException; } \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloClp.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloClp.java index c4561e05..597e5b92 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloClp.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloClp.java @@ -81,9 +81,10 @@ public class SportelloClp extends BaseModelImpl implements Sportello attributes.put("userName", getUserName()); attributes.put("createDate", getCreateDate()); attributes.put("modifiedDate", getModifiedDate()); - attributes.put("loginName", getLoginName()); - attributes.put("password", getPassword()); - attributes.put("nonce", getNonce()); + attributes.put("email", getEmail()); + attributes.put("comuneId", getComuneId()); + attributes.put("apiKey", getApiKey()); + attributes.put("attivo", getAttivo()); return attributes; } @@ -132,22 +133,28 @@ public class SportelloClp extends BaseModelImpl implements Sportello setModifiedDate(modifiedDate); } - String loginName = (String)attributes.get("loginName"); + String email = (String)attributes.get("email"); - if (loginName != null) { - setLoginName(loginName); + if (email != null) { + setEmail(email); } - String password = (String)attributes.get("password"); + Long comuneId = (Long)attributes.get("comuneId"); - if (password != null) { - setPassword(password); + if (comuneId != null) { + setComuneId(comuneId); } - String nonce = (String)attributes.get("nonce"); + String apiKey = (String)attributes.get("apiKey"); - if (nonce != null) { - setNonce(nonce); + if (apiKey != null) { + setApiKey(apiKey); + } + + Boolean attivo = (Boolean)attributes.get("attivo"); + + if (attivo != null) { + setAttivo(attivo); } } @@ -323,21 +330,44 @@ public class SportelloClp extends BaseModelImpl implements Sportello } @Override - public String getLoginName() { - return _loginName; + public String getEmail() { + return _email; + } + + @Override + public void setEmail(String email) { + _email = email; + + if (_sportelloRemoteModel != null) { + try { + Class clazz = _sportelloRemoteModel.getClass(); + + Method method = clazz.getMethod("setEmail", String.class); + + method.invoke(_sportelloRemoteModel, email); + } + catch (Exception e) { + throw new UnsupportedOperationException(e); + } + } + } + + @Override + public long getComuneId() { + return _comuneId; } @Override - public void setLoginName(String loginName) { - _loginName = loginName; + public void setComuneId(long comuneId) { + _comuneId = comuneId; if (_sportelloRemoteModel != null) { try { Class clazz = _sportelloRemoteModel.getClass(); - Method method = clazz.getMethod("setLoginName", String.class); + Method method = clazz.getMethod("setComuneId", long.class); - method.invoke(_sportelloRemoteModel, loginName); + method.invoke(_sportelloRemoteModel, comuneId); } catch (Exception e) { throw new UnsupportedOperationException(e); @@ -346,21 +376,21 @@ public class SportelloClp extends BaseModelImpl implements Sportello } @Override - public String getPassword() { - return _password; + public String getApiKey() { + return _apiKey; } @Override - public void setPassword(String password) { - _password = password; + public void setApiKey(String apiKey) { + _apiKey = apiKey; if (_sportelloRemoteModel != null) { try { Class clazz = _sportelloRemoteModel.getClass(); - Method method = clazz.getMethod("setPassword", String.class); + Method method = clazz.getMethod("setApiKey", String.class); - method.invoke(_sportelloRemoteModel, password); + method.invoke(_sportelloRemoteModel, apiKey); } catch (Exception e) { throw new UnsupportedOperationException(e); @@ -369,21 +399,26 @@ public class SportelloClp extends BaseModelImpl implements Sportello } @Override - public String getNonce() { - return _nonce; + public boolean getAttivo() { + return _attivo; } @Override - public void setNonce(String nonce) { - _nonce = nonce; + 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("setNonce", String.class); + Method method = clazz.getMethod("setAttivo", boolean.class); - method.invoke(_sportelloRemoteModel, nonce); + method.invoke(_sportelloRemoteModel, attivo); } catch (Exception e) { throw new UnsupportedOperationException(e); @@ -391,6 +426,63 @@ public class SportelloClp extends BaseModelImpl implements Sportello } } + @Override + public java.lang.String getNomeComune() { + try { + String methodName = "getNomeComune"; + + Class[] parameterTypes = new Class[] { }; + + Object[] parameterValues = new Object[] { }; + + java.lang.String returnObj = (java.lang.String)invokeOnRemoteModel(methodName, + parameterTypes, parameterValues); + + return returnObj; + } + catch (Exception e) { + throw new UnsupportedOperationException(e); + } + } + + @Override + public java.lang.String getCodiceProvincia() { + try { + String methodName = "getCodiceProvincia"; + + Class[] parameterTypes = new Class[] { }; + + Object[] parameterValues = new Object[] { }; + + java.lang.String returnObj = (java.lang.String)invokeOnRemoteModel(methodName, + parameterTypes, parameterValues); + + return returnObj; + } + catch (Exception e) { + throw new UnsupportedOperationException(e); + } + } + + @Override + public java.lang.String getNomeProvincia() { + try { + String methodName = "getNomeProvincia"; + + Class[] parameterTypes = new Class[] { }; + + Object[] parameterValues = new Object[] { }; + + java.lang.String returnObj = (java.lang.String)invokeOnRemoteModel(methodName, + parameterTypes, parameterValues); + + return returnObj; + } + catch (Exception e) { + throw new UnsupportedOperationException(e); + } + } + public BaseModel getSportelloRemoteModel() { return _sportelloRemoteModel; } @@ -467,9 +559,10 @@ public class SportelloClp extends BaseModelImpl implements Sportello clone.setUserName(getUserName()); clone.setCreateDate(getCreateDate()); clone.setModifiedDate(getModifiedDate()); - clone.setLoginName(getLoginName()); - clone.setPassword(getPassword()); - clone.setNonce(getNonce()); + clone.setEmail(getEmail()); + clone.setComuneId(getComuneId()); + clone.setApiKey(getApiKey()); + clone.setAttivo(getAttivo()); return clone; } @@ -522,7 +615,7 @@ public class SportelloClp extends BaseModelImpl implements Sportello @Override public String toString() { - StringBundler sb = new StringBundler(21); + StringBundler sb = new StringBundler(23); sb.append("{sportelloId="); sb.append(getSportelloId()); @@ -538,12 +631,14 @@ public class SportelloClp extends BaseModelImpl implements Sportello sb.append(getCreateDate()); sb.append(", modifiedDate="); sb.append(getModifiedDate()); - sb.append(", loginName="); - sb.append(getLoginName()); - sb.append(", password="); - sb.append(getPassword()); - sb.append(", nonce="); - sb.append(getNonce()); + sb.append(", email="); + sb.append(getEmail()); + sb.append(", comuneId="); + sb.append(getComuneId()); + sb.append(", apiKey="); + sb.append(getApiKey()); + sb.append(", attivo="); + sb.append(getAttivo()); sb.append("}"); return sb.toString(); @@ -551,7 +646,7 @@ public class SportelloClp extends BaseModelImpl implements Sportello @Override public String toXmlString() { - StringBundler sb = new StringBundler(34); + StringBundler sb = new StringBundler(37); sb.append(""); sb.append("it.mwg.sicilia.sue.model.Sportello"); @@ -586,16 +681,20 @@ public class SportelloClp extends BaseModelImpl implements Sportello sb.append(getModifiedDate()); sb.append("]]>
"); sb.append( - "loginNameemail"); + sb.append( + "comuneId"); sb.append( - "passwordapiKey"); sb.append( - "nonceattivo"); sb.append(""); @@ -611,9 +710,10 @@ public class SportelloClp extends BaseModelImpl implements Sportello private String _userName; private Date _createDate; private Date _modifiedDate; - private String _loginName; - private String _password; - private String _nonce; + private String _email; + private long _comuneId; + private String _apiKey; + private boolean _attivo; private BaseModel _sportelloRemoteModel; private Class _clpSerializerClass = it.mwg.sicilia.sue.service.ClpSerializer.class; } \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloModel.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloModel.java index bbe670cf..3bdf8ef4 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloModel.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloModel.java @@ -190,49 +190,69 @@ public interface SportelloModel extends BaseModel, GroupedModel { public void setModifiedDate(Date modifiedDate); /** - * Returns the login name of this sportello. + * Returns the email of this sportello. * - * @return the login name of this sportello + * @return the email of this sportello */ @AutoEscape - public String getLoginName(); + public String getEmail(); /** - * Sets the login name of this sportello. + * Sets the email of this sportello. * - * @param loginName the login name of this sportello + * @param email the email of this sportello */ - public void setLoginName(String loginName); + public void setEmail(String email); /** - * Returns the password of this sportello. + * Returns the comune ID of this sportello. * - * @return the password of this sportello + * @return the comune ID of this sportello */ - @AutoEscape - public String getPassword(); + public long getComuneId(); /** - * Sets the password of this sportello. + * Sets the comune ID of this sportello. * - * @param password the password of this sportello + * @param comuneId the comune ID of this sportello */ - public void setPassword(String password); + public void setComuneId(long comuneId); /** - * Returns the nonce of this sportello. + * Returns the api key of this sportello. * - * @return the nonce of this sportello + * @return the api key of this sportello */ @AutoEscape - public String getNonce(); + 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. + * + * @return the attivo of this sportello + */ + public boolean getAttivo(); + + /** + * Returns true if this sportello is attivo. + * + * @return true if this sportello is attivo; false otherwise + */ + public boolean isAttivo(); /** - * Sets the nonce of this sportello. + * Sets whether this sportello is attivo. * - * @param nonce the nonce of this sportello + * @param attivo the attivo of this sportello */ - public void setNonce(String nonce); + public void setAttivo(boolean attivo); @Override public boolean isNew(); diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloSoap.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloSoap.java index 1dc57500..7ec35dff 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloSoap.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloSoap.java @@ -38,9 +38,10 @@ public class SportelloSoap implements Serializable { soapModel.setUserName(model.getUserName()); soapModel.setCreateDate(model.getCreateDate()); soapModel.setModifiedDate(model.getModifiedDate()); - soapModel.setLoginName(model.getLoginName()); - soapModel.setPassword(model.getPassword()); - soapModel.setNonce(model.getNonce()); + soapModel.setEmail(model.getEmail()); + soapModel.setComuneId(model.getComuneId()); + soapModel.setApiKey(model.getApiKey()); + soapModel.setAttivo(model.getAttivo()); return soapModel; } @@ -149,28 +150,40 @@ public class SportelloSoap implements Serializable { _modifiedDate = modifiedDate; } - public String getLoginName() { - return _loginName; + public String getEmail() { + return _email; } - public void setLoginName(String loginName) { - _loginName = loginName; + public void setEmail(String email) { + _email = email; } - public String getPassword() { - return _password; + public long getComuneId() { + return _comuneId; } - public void setPassword(String password) { - _password = password; + public void setComuneId(long comuneId) { + _comuneId = comuneId; } - public String getNonce() { - return _nonce; + public String getApiKey() { + return _apiKey; } - public void setNonce(String nonce) { - _nonce = nonce; + public void setApiKey(String apiKey) { + _apiKey = apiKey; + } + + public boolean getAttivo() { + return _attivo; + } + + public boolean isAttivo() { + return _attivo; + } + + public void setAttivo(boolean attivo) { + _attivo = attivo; } private long _sportelloId; @@ -180,7 +193,8 @@ public class SportelloSoap implements Serializable { private String _userName; private Date _createDate; private Date _modifiedDate; - private String _loginName; - private String _password; - private String _nonce; + private String _email; + private long _comuneId; + private String _apiKey; + private boolean _attivo; } \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloWrapper.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloWrapper.java index db1e12c2..3c13c9de 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloWrapper.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/model/SportelloWrapper.java @@ -56,9 +56,10 @@ public class SportelloWrapper implements Sportello, ModelWrapper { attributes.put("userName", getUserName()); attributes.put("createDate", getCreateDate()); attributes.put("modifiedDate", getModifiedDate()); - attributes.put("loginName", getLoginName()); - attributes.put("password", getPassword()); - attributes.put("nonce", getNonce()); + attributes.put("email", getEmail()); + attributes.put("comuneId", getComuneId()); + attributes.put("apiKey", getApiKey()); + attributes.put("attivo", getAttivo()); return attributes; } @@ -107,22 +108,28 @@ public class SportelloWrapper implements Sportello, ModelWrapper { setModifiedDate(modifiedDate); } - String loginName = (String)attributes.get("loginName"); + String email = (String)attributes.get("email"); - if (loginName != null) { - setLoginName(loginName); + if (email != null) { + setEmail(email); } - String password = (String)attributes.get("password"); + Long comuneId = (Long)attributes.get("comuneId"); - if (password != null) { - setPassword(password); + if (comuneId != null) { + setComuneId(comuneId); } - String nonce = (String)attributes.get("nonce"); + String apiKey = (String)attributes.get("apiKey"); - if (nonce != null) { - setNonce(nonce); + if (apiKey != null) { + setApiKey(apiKey); + } + + Boolean attivo = (Boolean)attributes.get("attivo"); + + if (attivo != null) { + setAttivo(attivo); } } @@ -309,63 +316,93 @@ public class SportelloWrapper implements Sportello, ModelWrapper { } /** - * Returns the login name of this sportello. + * Returns the email of this sportello. + * + * @return the email of this sportello + */ + @Override + public java.lang.String getEmail() { + return _sportello.getEmail(); + } + + /** + * Sets the email of this sportello. + * + * @param email the email of this sportello + */ + @Override + public void setEmail(java.lang.String email) { + _sportello.setEmail(email); + } + + /** + * Returns the comune ID of this sportello. * - * @return the login name of this sportello + * @return the comune ID of this sportello */ @Override - public java.lang.String getLoginName() { - return _sportello.getLoginName(); + public long getComuneId() { + return _sportello.getComuneId(); } /** - * Sets the login name of this sportello. + * Sets the comune ID of this sportello. * - * @param loginName the login name of this sportello + * @param comuneId the comune ID of this sportello */ @Override - public void setLoginName(java.lang.String loginName) { - _sportello.setLoginName(loginName); + public void setComuneId(long comuneId) { + _sportello.setComuneId(comuneId); } /** - * Returns the password of this sportello. + * Returns the api key of this sportello. * - * @return the password of this sportello + * @return the api key of this sportello */ @Override - public java.lang.String getPassword() { - return _sportello.getPassword(); + public java.lang.String getApiKey() { + return _sportello.getApiKey(); } /** - * Sets the password of this sportello. + * Sets the api key of this sportello. * - * @param password the password of this sportello + * @param apiKey the api key of this sportello */ @Override - public void setPassword(java.lang.String password) { - _sportello.setPassword(password); + public void setApiKey(java.lang.String apiKey) { + _sportello.setApiKey(apiKey); } /** - * Returns the nonce of this sportello. + * Returns the attivo of this sportello. * - * @return the nonce of this sportello + * @return the attivo of this sportello */ @Override - public java.lang.String getNonce() { - return _sportello.getNonce(); + public boolean getAttivo() { + return _sportello.getAttivo(); } /** - * Sets the nonce of this sportello. + * Returns true if this sportello is attivo. * - * @param nonce the nonce of this sportello + * @return true if this sportello is attivo; false otherwise */ @Override - public void setNonce(java.lang.String nonce) { - _sportello.setNonce(nonce); + public boolean isAttivo() { + return _sportello.isAttivo(); + } + + /** + * Sets whether this sportello is attivo. + * + * @param attivo the attivo of this sportello + */ + @Override + public void setAttivo(boolean attivo) { + _sportello.setAttivo(attivo); } @Override @@ -472,6 +509,27 @@ public class SportelloWrapper implements Sportello, ModelWrapper { _sportello.persist(); } + @Override + public java.lang.String getCodiceProvincia() + throws com.liferay.portal.kernel.exception.PortalException, + com.liferay.portal.kernel.exception.SystemException { + return _sportello.getCodiceProvincia(); + } + + @Override + public java.lang.String getNomeComune() + throws com.liferay.portal.kernel.exception.PortalException, + com.liferay.portal.kernel.exception.SystemException { + return _sportello.getNomeComune(); + } + + @Override + public java.lang.String getNomeProvincia() + throws com.liferay.portal.kernel.exception.PortalException, + com.liferay.portal.kernel.exception.SystemException { + return _sportello.getNomeProvincia(); + } + @Override public boolean equals(Object obj) { if (this == obj) { diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingLocalService.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingLocalService.java new file mode 100644 index 00000000..758870e9 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingLocalService.java @@ -0,0 +1,259 @@ +/** + * Copyright (c) 2000-present 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.service; + +import com.liferay.portal.kernel.exception.PortalException; +import com.liferay.portal.kernel.exception.SystemException; +import com.liferay.portal.kernel.search.IndexableType; +import com.liferay.portal.kernel.transaction.Isolation; +import com.liferay.portal.kernel.transaction.Propagation; +import com.liferay.portal.kernel.transaction.Transactional; +import com.liferay.portal.service.BaseLocalService; +import com.liferay.portal.service.InvokableLocalService; +import com.liferay.portal.service.PersistedModelLocalService; + +/** + * Provides the local service interface for ApiSetting. Methods of this + * service will not have security checks based on the propagated JAAS + * credentials because this service can only be accessed from within the same + * VM. + * + * @author Manifattura Web Group Srl + * @see ApiSettingLocalServiceUtil + * @see it.mwg.sicilia.sue.service.base.ApiSettingLocalServiceBaseImpl + * @see it.mwg.sicilia.sue.service.impl.ApiSettingLocalServiceImpl + * @generated + */ +@Transactional(isolation = Isolation.PORTAL, rollbackFor = { + PortalException.class, SystemException.class}) +public interface ApiSettingLocalService extends BaseLocalService, + InvokableLocalService, PersistedModelLocalService { + /* + * NOTE FOR DEVELOPERS: + * + * Never modify or reference this interface directly. Always use {@link ApiSettingLocalServiceUtil} to access the api setting local service. Add custom service methods to {@link it.mwg.sicilia.sue.service.impl.ApiSettingLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. + */ + + /** + * Adds the api setting to the database. Also notifies the appropriate model listeners. + * + * @param apiSetting the api setting + * @return the api setting that was added + * @throws SystemException if a system exception occurred + */ + @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX) + public it.mwg.sicilia.sue.model.ApiSetting addApiSetting( + it.mwg.sicilia.sue.model.ApiSetting apiSetting) + throws com.liferay.portal.kernel.exception.SystemException; + + /** + * Creates a new api setting with the primary key. Does not add the api setting to the database. + * + * @param id the primary key for the new api setting + * @return the new api setting + */ + public it.mwg.sicilia.sue.model.ApiSetting createApiSetting(long id); + + /** + * Deletes the api setting with the primary key from the database. Also notifies the appropriate model listeners. + * + * @param id the primary key of the api setting + * @return the api setting that was removed + * @throws PortalException if a api setting with the primary key could not be found + * @throws SystemException if a system exception occurred + */ + @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE) + public it.mwg.sicilia.sue.model.ApiSetting deleteApiSetting(long id) + throws com.liferay.portal.kernel.exception.PortalException, + com.liferay.portal.kernel.exception.SystemException; + + /** + * Deletes the api setting from the database. Also notifies the appropriate model listeners. + * + * @param apiSetting the api setting + * @return the api setting that was removed + * @throws SystemException if a system exception occurred + */ + @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE) + public it.mwg.sicilia.sue.model.ApiSetting deleteApiSetting( + it.mwg.sicilia.sue.model.ApiSetting apiSetting) + throws com.liferay.portal.kernel.exception.SystemException; + + public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery(); + + /** + * Performs a dynamic query on the database and returns the matching rows. + * + * @param dynamicQuery the dynamic query + * @return the matching rows + * @throws SystemException if a system exception occurred + */ + @SuppressWarnings("rawtypes") + public java.util.List dynamicQuery( + com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) + throws com.liferay.portal.kernel.exception.SystemException; + + /** + * Performs a dynamic query on the database and returns a range of the matching rows. + * + *

+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. + *

+ * + * @param dynamicQuery the dynamic query + * @param start the lower bound of the range of model instances + * @param end the upper bound of the range of model instances (not inclusive) + * @return the range of matching rows + * @throws SystemException if a system exception occurred + */ + @SuppressWarnings("rawtypes") + public java.util.List dynamicQuery( + com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, + int end) throws com.liferay.portal.kernel.exception.SystemException; + + /** + * Performs a dynamic query on the database and returns an ordered range of the matching rows. + * + *

+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. + *

+ * + * @param dynamicQuery the dynamic query + * @param start the lower bound of the range of model instances + * @param end the upper bound of the range of model instances (not inclusive) + * @param orderByComparator the comparator to order the results by (optionally null) + * @return the ordered range of matching rows + * @throws SystemException if a system exception occurred + */ + @SuppressWarnings("rawtypes") + public java.util.List dynamicQuery( + com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, + int end, + com.liferay.portal.kernel.util.OrderByComparator orderByComparator) + throws com.liferay.portal.kernel.exception.SystemException; + + /** + * Returns the number of rows that match the dynamic query. + * + * @param dynamicQuery the dynamic query + * @return the number of rows that match the dynamic query + * @throws SystemException if a system exception occurred + */ + public long dynamicQueryCount( + com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) + throws com.liferay.portal.kernel.exception.SystemException; + + /** + * Returns the number of rows that match the dynamic query. + * + * @param dynamicQuery the dynamic query + * @param projection the projection to apply to the query + * @return the number of rows that match the dynamic query + * @throws SystemException if a system exception occurred + */ + public long dynamicQueryCount( + com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, + com.liferay.portal.kernel.dao.orm.Projection projection) + throws com.liferay.portal.kernel.exception.SystemException; + + @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) + public it.mwg.sicilia.sue.model.ApiSetting fetchApiSetting(long id) + throws com.liferay.portal.kernel.exception.SystemException; + + /** + * Returns the api setting with the primary key. + * + * @param id the primary key of the api setting + * @return the api setting + * @throws PortalException if a api setting with the primary key could not be found + * @throws SystemException if a system exception occurred + */ + @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) + public it.mwg.sicilia.sue.model.ApiSetting getApiSetting(long id) + throws com.liferay.portal.kernel.exception.PortalException, + com.liferay.portal.kernel.exception.SystemException; + + @Override + @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) + public com.liferay.portal.model.PersistedModel getPersistedModel( + java.io.Serializable primaryKeyObj) + throws com.liferay.portal.kernel.exception.PortalException, + com.liferay.portal.kernel.exception.SystemException; + + /** + * Returns a range of all the api settings. + * + *

+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. + *

+ * + * @param start the lower bound of the range of api settings + * @param end the upper bound of the range of api settings (not inclusive) + * @return the range of api settings + * @throws SystemException if a system exception occurred + */ + @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) + public java.util.List getApiSettings( + int start, int end) + throws com.liferay.portal.kernel.exception.SystemException; + + /** + * Returns the number of api settings. + * + * @return the number of api settings + * @throws SystemException if a system exception occurred + */ + @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) + public int getApiSettingsCount() + throws com.liferay.portal.kernel.exception.SystemException; + + /** + * Updates the api setting in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. + * + * @param apiSetting the api setting + * @return the api setting that was updated + * @throws SystemException if a system exception occurred + */ + @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX) + public it.mwg.sicilia.sue.model.ApiSetting updateApiSetting( + it.mwg.sicilia.sue.model.ApiSetting apiSetting) + throws com.liferay.portal.kernel.exception.SystemException; + + /** + * Returns the Spring bean ID for this bean. + * + * @return the Spring bean ID for this bean + */ + public java.lang.String getBeanIdentifier(); + + /** + * Sets the Spring bean ID for this bean. + * + * @param beanIdentifier the Spring bean ID for this bean + */ + public void setBeanIdentifier(java.lang.String beanIdentifier); + + @Override + public java.lang.Object invokeMethod(java.lang.String name, + java.lang.String[] parameterTypes, java.lang.Object[] arguments) + throws java.lang.Throwable; + + @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) + public java.lang.String get(long companyId, long key) + throws com.liferay.portal.kernel.exception.SystemException; + + public void set(long companyId, long key, java.lang.String value) + throws com.liferay.portal.kernel.exception.SystemException; +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingLocalServiceClp.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingLocalServiceClp.java new file mode 100644 index 00000000..c4af2bcc --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingLocalServiceClp.java @@ -0,0 +1,770 @@ +/** + * Copyright (c) 2000-present 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.service; + +import com.liferay.portal.service.InvokableLocalService; + +/** + * @author Manifattura Web Group Srl + * @generated + */ +public class ApiSettingLocalServiceClp implements ApiSettingLocalService { + public ApiSettingLocalServiceClp( + InvokableLocalService invokableLocalService) { + _invokableLocalService = invokableLocalService; + + _methodName0 = "addApiSetting"; + + _methodParameterTypes0 = new String[] { + "it.mwg.sicilia.sue.model.ApiSetting" + }; + + _methodName1 = "createApiSetting"; + + _methodParameterTypes1 = new String[] { "long" }; + + _methodName2 = "deleteApiSetting"; + + _methodParameterTypes2 = new String[] { "long" }; + + _methodName3 = "deleteApiSetting"; + + _methodParameterTypes3 = new String[] { + "it.mwg.sicilia.sue.model.ApiSetting" + }; + + _methodName4 = "dynamicQuery"; + + _methodParameterTypes4 = new String[] { }; + + _methodName5 = "dynamicQuery"; + + _methodParameterTypes5 = new String[] { + "com.liferay.portal.kernel.dao.orm.DynamicQuery" + }; + + _methodName6 = "dynamicQuery"; + + _methodParameterTypes6 = new String[] { + "com.liferay.portal.kernel.dao.orm.DynamicQuery", "int", "int" + }; + + _methodName7 = "dynamicQuery"; + + _methodParameterTypes7 = new String[] { + "com.liferay.portal.kernel.dao.orm.DynamicQuery", "int", "int", + "com.liferay.portal.kernel.util.OrderByComparator" + }; + + _methodName8 = "dynamicQueryCount"; + + _methodParameterTypes8 = new String[] { + "com.liferay.portal.kernel.dao.orm.DynamicQuery" + }; + + _methodName9 = "dynamicQueryCount"; + + _methodParameterTypes9 = new String[] { + "com.liferay.portal.kernel.dao.orm.DynamicQuery", + "com.liferay.portal.kernel.dao.orm.Projection" + }; + + _methodName10 = "fetchApiSetting"; + + _methodParameterTypes10 = new String[] { "long" }; + + _methodName11 = "getApiSetting"; + + _methodParameterTypes11 = new String[] { "long" }; + + _methodName12 = "getPersistedModel"; + + _methodParameterTypes12 = new String[] { "java.io.Serializable" }; + + _methodName13 = "getApiSettings"; + + _methodParameterTypes13 = new String[] { "int", "int" }; + + _methodName14 = "getApiSettingsCount"; + + _methodParameterTypes14 = new String[] { }; + + _methodName15 = "updateApiSetting"; + + _methodParameterTypes15 = new String[] { + "it.mwg.sicilia.sue.model.ApiSetting" + }; + + _methodName16 = "getBeanIdentifier"; + + _methodParameterTypes16 = new String[] { }; + + _methodName17 = "setBeanIdentifier"; + + _methodParameterTypes17 = new String[] { "java.lang.String" }; + + _methodName19 = "get"; + + _methodParameterTypes19 = new String[] { "long", "long" }; + + _methodName20 = "set"; + + _methodParameterTypes20 = new String[] { + "long", "long", "java.lang.String" + }; + } + + @Override + public it.mwg.sicilia.sue.model.ApiSetting addApiSetting( + it.mwg.sicilia.sue.model.ApiSetting apiSetting) + throws com.liferay.portal.kernel.exception.SystemException { + Object returnObj = null; + + try { + returnObj = _invokableLocalService.invokeMethod(_methodName0, + _methodParameterTypes0, + new Object[] { ClpSerializer.translateInput(apiSetting) }); + } + 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 RuntimeException) { + throw (RuntimeException)t; + } + else { + throw new RuntimeException(t.getClass().getName() + + " is not a valid exception"); + } + } + + return (it.mwg.sicilia.sue.model.ApiSetting)ClpSerializer.translateOutput(returnObj); + } + + @Override + public it.mwg.sicilia.sue.model.ApiSetting createApiSetting(long id) { + Object returnObj = null; + + try { + returnObj = _invokableLocalService.invokeMethod(_methodName1, + _methodParameterTypes1, new Object[] { id }); + } + 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 (it.mwg.sicilia.sue.model.ApiSetting)ClpSerializer.translateOutput(returnObj); + } + + @Override + public it.mwg.sicilia.sue.model.ApiSetting deleteApiSetting(long id) + throws com.liferay.portal.kernel.exception.PortalException, + com.liferay.portal.kernel.exception.SystemException { + Object returnObj = null; + + try { + returnObj = _invokableLocalService.invokeMethod(_methodName2, + _methodParameterTypes2, new Object[] { id }); + } + catch (Throwable t) { + t = ClpSerializer.translateThrowable(t); + + if (t instanceof com.liferay.portal.kernel.exception.PortalException) { + throw (com.liferay.portal.kernel.exception.PortalException)t; + } + + if (t instanceof com.liferay.portal.kernel.exception.SystemException) { + throw (com.liferay.portal.kernel.exception.SystemException)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.ApiSetting)ClpSerializer.translateOutput(returnObj); + } + + @Override + public it.mwg.sicilia.sue.model.ApiSetting deleteApiSetting( + it.mwg.sicilia.sue.model.ApiSetting apiSetting) + throws com.liferay.portal.kernel.exception.SystemException { + Object returnObj = null; + + try { + returnObj = _invokableLocalService.invokeMethod(_methodName3, + _methodParameterTypes3, + new Object[] { ClpSerializer.translateInput(apiSetting) }); + } + 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 RuntimeException) { + throw (RuntimeException)t; + } + else { + throw new RuntimeException(t.getClass().getName() + + " is not a valid exception"); + } + } + + return (it.mwg.sicilia.sue.model.ApiSetting)ClpSerializer.translateOutput(returnObj); + } + + @Override + public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { + Object returnObj = null; + + try { + returnObj = _invokableLocalService.invokeMethod(_methodName4, + _methodParameterTypes4, new Object[] { }); + } + 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 (com.liferay.portal.kernel.dao.orm.DynamicQuery)ClpSerializer.translateOutput(returnObj); + } + + @Override + @SuppressWarnings("rawtypes") + public java.util.List dynamicQuery( + com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) + throws com.liferay.portal.kernel.exception.SystemException { + Object returnObj = null; + + try { + returnObj = _invokableLocalService.invokeMethod(_methodName5, + _methodParameterTypes5, + new Object[] { ClpSerializer.translateInput(dynamicQuery) }); + } + 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 RuntimeException) { + throw (RuntimeException)t; + } + else { + throw new RuntimeException(t.getClass().getName() + + " is not a valid exception"); + } + } + + return (java.util.List)ClpSerializer.translateOutput(returnObj); + } + + @Override + @SuppressWarnings("rawtypes") + public java.util.List dynamicQuery( + com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, + int end) throws com.liferay.portal.kernel.exception.SystemException { + Object returnObj = null; + + try { + returnObj = _invokableLocalService.invokeMethod(_methodName6, + _methodParameterTypes6, + new Object[] { + ClpSerializer.translateInput(dynamicQuery), + + start, + + end + }); + } + 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 RuntimeException) { + throw (RuntimeException)t; + } + else { + throw new RuntimeException(t.getClass().getName() + + " is not a valid exception"); + } + } + + return (java.util.List)ClpSerializer.translateOutput(returnObj); + } + + @Override + @SuppressWarnings("rawtypes") + public java.util.List dynamicQuery( + com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, + int end, + com.liferay.portal.kernel.util.OrderByComparator orderByComparator) + throws com.liferay.portal.kernel.exception.SystemException { + Object returnObj = null; + + try { + returnObj = _invokableLocalService.invokeMethod(_methodName7, + _methodParameterTypes7, + new Object[] { + ClpSerializer.translateInput(dynamicQuery), + + start, + + end, + + ClpSerializer.translateInput(orderByComparator) + }); + } + 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 RuntimeException) { + throw (RuntimeException)t; + } + else { + throw new RuntimeException(t.getClass().getName() + + " is not a valid exception"); + } + } + + return (java.util.List)ClpSerializer.translateOutput(returnObj); + } + + @Override + public long dynamicQueryCount( + com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) + throws com.liferay.portal.kernel.exception.SystemException { + Object returnObj = null; + + try { + returnObj = _invokableLocalService.invokeMethod(_methodName8, + _methodParameterTypes8, + new Object[] { ClpSerializer.translateInput(dynamicQuery) }); + } + 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 RuntimeException) { + throw (RuntimeException)t; + } + else { + throw new RuntimeException(t.getClass().getName() + + " is not a valid exception"); + } + } + + return ((Long)returnObj).longValue(); + } + + @Override + public long dynamicQueryCount( + com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, + com.liferay.portal.kernel.dao.orm.Projection projection) + throws com.liferay.portal.kernel.exception.SystemException { + Object returnObj = null; + + try { + returnObj = _invokableLocalService.invokeMethod(_methodName9, + _methodParameterTypes9, + new Object[] { + ClpSerializer.translateInput(dynamicQuery), + + ClpSerializer.translateInput(projection) + }); + } + 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 RuntimeException) { + throw (RuntimeException)t; + } + else { + throw new RuntimeException(t.getClass().getName() + + " is not a valid exception"); + } + } + + return ((Long)returnObj).longValue(); + } + + @Override + public it.mwg.sicilia.sue.model.ApiSetting fetchApiSetting(long id) + throws com.liferay.portal.kernel.exception.SystemException { + Object returnObj = null; + + try { + returnObj = _invokableLocalService.invokeMethod(_methodName10, + _methodParameterTypes10, new Object[] { id }); + } + 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 RuntimeException) { + throw (RuntimeException)t; + } + else { + throw new RuntimeException(t.getClass().getName() + + " is not a valid exception"); + } + } + + return (it.mwg.sicilia.sue.model.ApiSetting)ClpSerializer.translateOutput(returnObj); + } + + @Override + public it.mwg.sicilia.sue.model.ApiSetting getApiSetting(long id) + throws com.liferay.portal.kernel.exception.PortalException, + com.liferay.portal.kernel.exception.SystemException { + Object returnObj = null; + + try { + returnObj = _invokableLocalService.invokeMethod(_methodName11, + _methodParameterTypes11, new Object[] { id }); + } + catch (Throwable t) { + t = ClpSerializer.translateThrowable(t); + + if (t instanceof com.liferay.portal.kernel.exception.PortalException) { + throw (com.liferay.portal.kernel.exception.PortalException)t; + } + + if (t instanceof com.liferay.portal.kernel.exception.SystemException) { + throw (com.liferay.portal.kernel.exception.SystemException)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.ApiSetting)ClpSerializer.translateOutput(returnObj); + } + + @Override + public com.liferay.portal.model.PersistedModel getPersistedModel( + java.io.Serializable primaryKeyObj) + throws com.liferay.portal.kernel.exception.PortalException, + com.liferay.portal.kernel.exception.SystemException { + Object returnObj = null; + + try { + returnObj = _invokableLocalService.invokeMethod(_methodName12, + _methodParameterTypes12, + new Object[] { ClpSerializer.translateInput(primaryKeyObj) }); + } + catch (Throwable t) { + t = ClpSerializer.translateThrowable(t); + + if (t instanceof com.liferay.portal.kernel.exception.PortalException) { + throw (com.liferay.portal.kernel.exception.PortalException)t; + } + + if (t instanceof com.liferay.portal.kernel.exception.SystemException) { + throw (com.liferay.portal.kernel.exception.SystemException)t; + } + + if (t instanceof RuntimeException) { + throw (RuntimeException)t; + } + else { + throw new RuntimeException(t.getClass().getName() + + " is not a valid exception"); + } + } + + return (com.liferay.portal.model.PersistedModel)ClpSerializer.translateOutput(returnObj); + } + + @Override + public java.util.List getApiSettings( + int start, int end) + throws com.liferay.portal.kernel.exception.SystemException { + Object returnObj = null; + + try { + returnObj = _invokableLocalService.invokeMethod(_methodName13, + _methodParameterTypes13, new Object[] { start, end }); + } + 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 RuntimeException) { + throw (RuntimeException)t; + } + else { + throw new RuntimeException(t.getClass().getName() + + " is not a valid exception"); + } + } + + return (java.util.List)ClpSerializer.translateOutput(returnObj); + } + + @Override + public int getApiSettingsCount() + throws com.liferay.portal.kernel.exception.SystemException { + Object returnObj = null; + + try { + returnObj = _invokableLocalService.invokeMethod(_methodName14, + _methodParameterTypes14, new Object[] { }); + } + 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 RuntimeException) { + throw (RuntimeException)t; + } + else { + throw new RuntimeException(t.getClass().getName() + + " is not a valid exception"); + } + } + + return ((Integer)returnObj).intValue(); + } + + @Override + public it.mwg.sicilia.sue.model.ApiSetting updateApiSetting( + it.mwg.sicilia.sue.model.ApiSetting apiSetting) + throws com.liferay.portal.kernel.exception.SystemException { + Object returnObj = null; + + try { + returnObj = _invokableLocalService.invokeMethod(_methodName15, + _methodParameterTypes15, + new Object[] { ClpSerializer.translateInput(apiSetting) }); + } + 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 RuntimeException) { + throw (RuntimeException)t; + } + else { + throw new RuntimeException(t.getClass().getName() + + " is not a valid exception"); + } + } + + return (it.mwg.sicilia.sue.model.ApiSetting)ClpSerializer.translateOutput(returnObj); + } + + @Override + public java.lang.String getBeanIdentifier() { + Object returnObj = null; + + try { + returnObj = _invokableLocalService.invokeMethod(_methodName16, + _methodParameterTypes16, new Object[] { }); + } + 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); + } + + @Override + public void setBeanIdentifier(java.lang.String beanIdentifier) { + try { + _invokableLocalService.invokeMethod(_methodName17, + _methodParameterTypes17, + new Object[] { ClpSerializer.translateInput(beanIdentifier) }); + } + 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"); + } + } + } + + @Override + public java.lang.Object invokeMethod(java.lang.String name, + java.lang.String[] parameterTypes, java.lang.Object[] arguments) + throws java.lang.Throwable { + throw new UnsupportedOperationException(); + } + + @Override + public java.lang.String get(long companyId, long key) + throws com.liferay.portal.kernel.exception.SystemException { + Object returnObj = null; + + try { + returnObj = _invokableLocalService.invokeMethod(_methodName19, + _methodParameterTypes19, new Object[] { companyId, key }); + } + 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 RuntimeException) { + throw (RuntimeException)t; + } + else { + throw new RuntimeException(t.getClass().getName() + + " is not a valid exception"); + } + } + + return (java.lang.String)ClpSerializer.translateOutput(returnObj); + } + + @Override + public void set(long companyId, long key, java.lang.String value) + throws com.liferay.portal.kernel.exception.SystemException { + try { + _invokableLocalService.invokeMethod(_methodName20, + _methodParameterTypes20, + new Object[] { companyId, key, ClpSerializer.translateInput( + value) }); + } + 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 RuntimeException) { + throw (RuntimeException)t; + } + else { + throw new RuntimeException(t.getClass().getName() + + " is not a valid exception"); + } + } + } + + private InvokableLocalService _invokableLocalService; + private String _methodName0; + private String[] _methodParameterTypes0; + private String _methodName1; + private String[] _methodParameterTypes1; + private String _methodName2; + private String[] _methodParameterTypes2; + private String _methodName3; + private String[] _methodParameterTypes3; + private String _methodName4; + private String[] _methodParameterTypes4; + private String _methodName5; + private String[] _methodParameterTypes5; + private String _methodName6; + private String[] _methodParameterTypes6; + private String _methodName7; + private String[] _methodParameterTypes7; + private String _methodName8; + private String[] _methodParameterTypes8; + private String _methodName9; + private String[] _methodParameterTypes9; + private String _methodName10; + private String[] _methodParameterTypes10; + private String _methodName11; + private String[] _methodParameterTypes11; + private String _methodName12; + private String[] _methodParameterTypes12; + private String _methodName13; + private String[] _methodParameterTypes13; + private String _methodName14; + private String[] _methodParameterTypes14; + private String _methodName15; + private String[] _methodParameterTypes15; + private String _methodName16; + private String[] _methodParameterTypes16; + private String _methodName17; + private String[] _methodParameterTypes17; + private String _methodName19; + private String[] _methodParameterTypes19; + private String _methodName20; + private String[] _methodParameterTypes20; +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingLocalServiceUtil.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingLocalServiceUtil.java new file mode 100644 index 00000000..b650eed0 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingLocalServiceUtil.java @@ -0,0 +1,314 @@ +/** + * Copyright (c) 2000-present 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.service; + +import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil; +import com.liferay.portal.kernel.util.ReferenceRegistry; +import com.liferay.portal.service.InvokableLocalService; + +/** + * Provides the local service utility for ApiSetting. This utility wraps + * {@link it.mwg.sicilia.sue.service.impl.ApiSettingLocalServiceImpl} and is the + * primary access point for service operations in application layer code running + * on the local server. Methods of this service will not have security checks + * based on the propagated JAAS credentials because this service can only be + * accessed from within the same VM. + * + * @author Manifattura Web Group Srl + * @see ApiSettingLocalService + * @see it.mwg.sicilia.sue.service.base.ApiSettingLocalServiceBaseImpl + * @see it.mwg.sicilia.sue.service.impl.ApiSettingLocalServiceImpl + * @generated + */ +public class ApiSettingLocalServiceUtil { + /* + * NOTE FOR DEVELOPERS: + * + * Never modify this class directly. Add custom service methods to {@link it.mwg.sicilia.sue.service.impl.ApiSettingLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. + */ + + /** + * Adds the api setting to the database. Also notifies the appropriate model listeners. + * + * @param apiSetting the api setting + * @return the api setting that was added + * @throws SystemException if a system exception occurred + */ + public static it.mwg.sicilia.sue.model.ApiSetting addApiSetting( + it.mwg.sicilia.sue.model.ApiSetting apiSetting) + throws com.liferay.portal.kernel.exception.SystemException { + return getService().addApiSetting(apiSetting); + } + + /** + * Creates a new api setting with the primary key. Does not add the api setting to the database. + * + * @param id the primary key for the new api setting + * @return the new api setting + */ + public static it.mwg.sicilia.sue.model.ApiSetting createApiSetting(long id) { + return getService().createApiSetting(id); + } + + /** + * Deletes the api setting with the primary key from the database. Also notifies the appropriate model listeners. + * + * @param id the primary key of the api setting + * @return the api setting that was removed + * @throws PortalException if a api setting with the primary key could not be found + * @throws SystemException if a system exception occurred + */ + public static it.mwg.sicilia.sue.model.ApiSetting deleteApiSetting(long id) + throws com.liferay.portal.kernel.exception.PortalException, + com.liferay.portal.kernel.exception.SystemException { + return getService().deleteApiSetting(id); + } + + /** + * Deletes the api setting from the database. Also notifies the appropriate model listeners. + * + * @param apiSetting the api setting + * @return the api setting that was removed + * @throws SystemException if a system exception occurred + */ + public static it.mwg.sicilia.sue.model.ApiSetting deleteApiSetting( + it.mwg.sicilia.sue.model.ApiSetting apiSetting) + throws com.liferay.portal.kernel.exception.SystemException { + return getService().deleteApiSetting(apiSetting); + } + + public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { + return getService().dynamicQuery(); + } + + /** + * Performs a dynamic query on the database and returns the matching rows. + * + * @param dynamicQuery the dynamic query + * @return the matching rows + * @throws SystemException if a system exception occurred + */ + @SuppressWarnings("rawtypes") + public static java.util.List dynamicQuery( + com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) + throws com.liferay.portal.kernel.exception.SystemException { + return getService().dynamicQuery(dynamicQuery); + } + + /** + * Performs a dynamic query on the database and returns a range of the matching rows. + * + *

+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. + *

+ * + * @param dynamicQuery the dynamic query + * @param start the lower bound of the range of model instances + * @param end the upper bound of the range of model instances (not inclusive) + * @return the range of matching rows + * @throws SystemException if a system exception occurred + */ + @SuppressWarnings("rawtypes") + public static java.util.List dynamicQuery( + com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, + int end) throws com.liferay.portal.kernel.exception.SystemException { + return getService().dynamicQuery(dynamicQuery, start, end); + } + + /** + * Performs a dynamic query on the database and returns an ordered range of the matching rows. + * + *

+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. + *

+ * + * @param dynamicQuery the dynamic query + * @param start the lower bound of the range of model instances + * @param end the upper bound of the range of model instances (not inclusive) + * @param orderByComparator the comparator to order the results by (optionally null) + * @return the ordered range of matching rows + * @throws SystemException if a system exception occurred + */ + @SuppressWarnings("rawtypes") + public static java.util.List dynamicQuery( + com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, + int end, + com.liferay.portal.kernel.util.OrderByComparator orderByComparator) + throws com.liferay.portal.kernel.exception.SystemException { + return getService() + .dynamicQuery(dynamicQuery, start, end, orderByComparator); + } + + /** + * Returns the number of rows that match the dynamic query. + * + * @param dynamicQuery the dynamic query + * @return the number of rows that match the dynamic query + * @throws SystemException if a system exception occurred + */ + public static long dynamicQueryCount( + com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) + throws com.liferay.portal.kernel.exception.SystemException { + return getService().dynamicQueryCount(dynamicQuery); + } + + /** + * Returns the number of rows that match the dynamic query. + * + * @param dynamicQuery the dynamic query + * @param projection the projection to apply to the query + * @return the number of rows that match the dynamic query + * @throws SystemException if a system exception occurred + */ + public static long dynamicQueryCount( + com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, + com.liferay.portal.kernel.dao.orm.Projection projection) + throws com.liferay.portal.kernel.exception.SystemException { + return getService().dynamicQueryCount(dynamicQuery, projection); + } + + public static it.mwg.sicilia.sue.model.ApiSetting fetchApiSetting(long id) + throws com.liferay.portal.kernel.exception.SystemException { + return getService().fetchApiSetting(id); + } + + /** + * Returns the api setting with the primary key. + * + * @param id the primary key of the api setting + * @return the api setting + * @throws PortalException if a api setting with the primary key could not be found + * @throws SystemException if a system exception occurred + */ + public static it.mwg.sicilia.sue.model.ApiSetting getApiSetting(long id) + throws com.liferay.portal.kernel.exception.PortalException, + com.liferay.portal.kernel.exception.SystemException { + return getService().getApiSetting(id); + } + + public static com.liferay.portal.model.PersistedModel getPersistedModel( + java.io.Serializable primaryKeyObj) + throws com.liferay.portal.kernel.exception.PortalException, + com.liferay.portal.kernel.exception.SystemException { + return getService().getPersistedModel(primaryKeyObj); + } + + /** + * Returns a range of all the api settings. + * + *

+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. + *

+ * + * @param start the lower bound of the range of api settings + * @param end the upper bound of the range of api settings (not inclusive) + * @return the range of api settings + * @throws SystemException if a system exception occurred + */ + public static java.util.List getApiSettings( + int start, int end) + throws com.liferay.portal.kernel.exception.SystemException { + return getService().getApiSettings(start, end); + } + + /** + * Returns the number of api settings. + * + * @return the number of api settings + * @throws SystemException if a system exception occurred + */ + public static int getApiSettingsCount() + throws com.liferay.portal.kernel.exception.SystemException { + return getService().getApiSettingsCount(); + } + + /** + * Updates the api setting in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. + * + * @param apiSetting the api setting + * @return the api setting that was updated + * @throws SystemException if a system exception occurred + */ + public static it.mwg.sicilia.sue.model.ApiSetting updateApiSetting( + it.mwg.sicilia.sue.model.ApiSetting apiSetting) + throws com.liferay.portal.kernel.exception.SystemException { + return getService().updateApiSetting(apiSetting); + } + + /** + * Returns the Spring bean ID for this bean. + * + * @return the Spring bean ID for this bean + */ + public static java.lang.String getBeanIdentifier() { + return getService().getBeanIdentifier(); + } + + /** + * Sets the Spring bean ID for this bean. + * + * @param beanIdentifier the Spring bean ID for this bean + */ + public static void setBeanIdentifier(java.lang.String beanIdentifier) { + getService().setBeanIdentifier(beanIdentifier); + } + + public static java.lang.Object invokeMethod(java.lang.String name, + java.lang.String[] parameterTypes, java.lang.Object[] arguments) + throws java.lang.Throwable { + return getService().invokeMethod(name, parameterTypes, arguments); + } + + public static java.lang.String get(long companyId, long key) + throws com.liferay.portal.kernel.exception.SystemException { + return getService().get(companyId, key); + } + + public static void set(long companyId, long key, java.lang.String value) + throws com.liferay.portal.kernel.exception.SystemException { + getService().set(companyId, key, value); + } + + public static void clearService() { + _service = null; + } + + public static ApiSettingLocalService getService() { + if (_service == null) { + InvokableLocalService invokableLocalService = (InvokableLocalService)PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), + ApiSettingLocalService.class.getName()); + + if (invokableLocalService instanceof ApiSettingLocalService) { + _service = (ApiSettingLocalService)invokableLocalService; + } + else { + _service = new ApiSettingLocalServiceClp(invokableLocalService); + } + + ReferenceRegistry.registerReference(ApiSettingLocalServiceUtil.class, + "_service"); + } + + return _service; + } + + /** + * @deprecated As of 6.2.0 + */ + public void setService(ApiSettingLocalService service) { + } + + private static ApiSettingLocalService _service; +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingLocalServiceWrapper.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingLocalServiceWrapper.java new file mode 100644 index 00000000..3143fb5e --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingLocalServiceWrapper.java @@ -0,0 +1,324 @@ +/** + * Copyright (c) 2000-present 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.service; + +import com.liferay.portal.service.ServiceWrapper; + +/** + * Provides a wrapper for {@link ApiSettingLocalService}. + * + * @author Manifattura Web Group Srl + * @see ApiSettingLocalService + * @generated + */ +public class ApiSettingLocalServiceWrapper implements ApiSettingLocalService, + ServiceWrapper { + public ApiSettingLocalServiceWrapper( + ApiSettingLocalService apiSettingLocalService) { + _apiSettingLocalService = apiSettingLocalService; + } + + /** + * Adds the api setting to the database. Also notifies the appropriate model listeners. + * + * @param apiSetting the api setting + * @return the api setting that was added + * @throws SystemException if a system exception occurred + */ + @Override + public it.mwg.sicilia.sue.model.ApiSetting addApiSetting( + it.mwg.sicilia.sue.model.ApiSetting apiSetting) + throws com.liferay.portal.kernel.exception.SystemException { + return _apiSettingLocalService.addApiSetting(apiSetting); + } + + /** + * Creates a new api setting with the primary key. Does not add the api setting to the database. + * + * @param id the primary key for the new api setting + * @return the new api setting + */ + @Override + public it.mwg.sicilia.sue.model.ApiSetting createApiSetting(long id) { + return _apiSettingLocalService.createApiSetting(id); + } + + /** + * Deletes the api setting with the primary key from the database. Also notifies the appropriate model listeners. + * + * @param id the primary key of the api setting + * @return the api setting that was removed + * @throws PortalException if a api setting with the primary key could not be found + * @throws SystemException if a system exception occurred + */ + @Override + public it.mwg.sicilia.sue.model.ApiSetting deleteApiSetting(long id) + throws com.liferay.portal.kernel.exception.PortalException, + com.liferay.portal.kernel.exception.SystemException { + return _apiSettingLocalService.deleteApiSetting(id); + } + + /** + * Deletes the api setting from the database. Also notifies the appropriate model listeners. + * + * @param apiSetting the api setting + * @return the api setting that was removed + * @throws SystemException if a system exception occurred + */ + @Override + public it.mwg.sicilia.sue.model.ApiSetting deleteApiSetting( + it.mwg.sicilia.sue.model.ApiSetting apiSetting) + throws com.liferay.portal.kernel.exception.SystemException { + return _apiSettingLocalService.deleteApiSetting(apiSetting); + } + + @Override + public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { + return _apiSettingLocalService.dynamicQuery(); + } + + /** + * Performs a dynamic query on the database and returns the matching rows. + * + * @param dynamicQuery the dynamic query + * @return the matching rows + * @throws SystemException if a system exception occurred + */ + @Override + @SuppressWarnings("rawtypes") + public java.util.List dynamicQuery( + com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) + throws com.liferay.portal.kernel.exception.SystemException { + return _apiSettingLocalService.dynamicQuery(dynamicQuery); + } + + /** + * Performs a dynamic query on the database and returns a range of the matching rows. + * + *

+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. + *

+ * + * @param dynamicQuery the dynamic query + * @param start the lower bound of the range of model instances + * @param end the upper bound of the range of model instances (not inclusive) + * @return the range of matching rows + * @throws SystemException if a system exception occurred + */ + @Override + @SuppressWarnings("rawtypes") + public java.util.List dynamicQuery( + com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, + int end) throws com.liferay.portal.kernel.exception.SystemException { + return _apiSettingLocalService.dynamicQuery(dynamicQuery, start, end); + } + + /** + * Performs a dynamic query on the database and returns an ordered range of the matching rows. + * + *

+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. + *

+ * + * @param dynamicQuery the dynamic query + * @param start the lower bound of the range of model instances + * @param end the upper bound of the range of model instances (not inclusive) + * @param orderByComparator the comparator to order the results by (optionally null) + * @return the ordered range of matching rows + * @throws SystemException if a system exception occurred + */ + @Override + @SuppressWarnings("rawtypes") + public java.util.List dynamicQuery( + com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, + int end, + com.liferay.portal.kernel.util.OrderByComparator orderByComparator) + throws com.liferay.portal.kernel.exception.SystemException { + return _apiSettingLocalService.dynamicQuery(dynamicQuery, start, end, + orderByComparator); + } + + /** + * Returns the number of rows that match the dynamic query. + * + * @param dynamicQuery the dynamic query + * @return the number of rows that match the dynamic query + * @throws SystemException if a system exception occurred + */ + @Override + public long dynamicQueryCount( + com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) + throws com.liferay.portal.kernel.exception.SystemException { + return _apiSettingLocalService.dynamicQueryCount(dynamicQuery); + } + + /** + * Returns the number of rows that match the dynamic query. + * + * @param dynamicQuery the dynamic query + * @param projection the projection to apply to the query + * @return the number of rows that match the dynamic query + * @throws SystemException if a system exception occurred + */ + @Override + public long dynamicQueryCount( + com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, + com.liferay.portal.kernel.dao.orm.Projection projection) + throws com.liferay.portal.kernel.exception.SystemException { + return _apiSettingLocalService.dynamicQueryCount(dynamicQuery, + projection); + } + + @Override + public it.mwg.sicilia.sue.model.ApiSetting fetchApiSetting(long id) + throws com.liferay.portal.kernel.exception.SystemException { + return _apiSettingLocalService.fetchApiSetting(id); + } + + /** + * Returns the api setting with the primary key. + * + * @param id the primary key of the api setting + * @return the api setting + * @throws PortalException if a api setting with the primary key could not be found + * @throws SystemException if a system exception occurred + */ + @Override + public it.mwg.sicilia.sue.model.ApiSetting getApiSetting(long id) + throws com.liferay.portal.kernel.exception.PortalException, + com.liferay.portal.kernel.exception.SystemException { + return _apiSettingLocalService.getApiSetting(id); + } + + @Override + public com.liferay.portal.model.PersistedModel getPersistedModel( + java.io.Serializable primaryKeyObj) + throws com.liferay.portal.kernel.exception.PortalException, + com.liferay.portal.kernel.exception.SystemException { + return _apiSettingLocalService.getPersistedModel(primaryKeyObj); + } + + /** + * Returns a range of all the api settings. + * + *

+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. + *

+ * + * @param start the lower bound of the range of api settings + * @param end the upper bound of the range of api settings (not inclusive) + * @return the range of api settings + * @throws SystemException if a system exception occurred + */ + @Override + public java.util.List getApiSettings( + int start, int end) + throws com.liferay.portal.kernel.exception.SystemException { + return _apiSettingLocalService.getApiSettings(start, end); + } + + /** + * Returns the number of api settings. + * + * @return the number of api settings + * @throws SystemException if a system exception occurred + */ + @Override + public int getApiSettingsCount() + throws com.liferay.portal.kernel.exception.SystemException { + return _apiSettingLocalService.getApiSettingsCount(); + } + + /** + * Updates the api setting in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. + * + * @param apiSetting the api setting + * @return the api setting that was updated + * @throws SystemException if a system exception occurred + */ + @Override + public it.mwg.sicilia.sue.model.ApiSetting updateApiSetting( + it.mwg.sicilia.sue.model.ApiSetting apiSetting) + throws com.liferay.portal.kernel.exception.SystemException { + return _apiSettingLocalService.updateApiSetting(apiSetting); + } + + /** + * Returns the Spring bean ID for this bean. + * + * @return the Spring bean ID for this bean + */ + @Override + public java.lang.String getBeanIdentifier() { + return _apiSettingLocalService.getBeanIdentifier(); + } + + /** + * Sets the Spring bean ID for this bean. + * + * @param beanIdentifier the Spring bean ID for this bean + */ + @Override + public void setBeanIdentifier(java.lang.String beanIdentifier) { + _apiSettingLocalService.setBeanIdentifier(beanIdentifier); + } + + @Override + public java.lang.Object invokeMethod(java.lang.String name, + java.lang.String[] parameterTypes, java.lang.Object[] arguments) + throws java.lang.Throwable { + return _apiSettingLocalService.invokeMethod(name, parameterTypes, + arguments); + } + + @Override + public java.lang.String get(long companyId, long key) + throws com.liferay.portal.kernel.exception.SystemException { + return _apiSettingLocalService.get(companyId, key); + } + + @Override + public void set(long companyId, long key, java.lang.String value) + throws com.liferay.portal.kernel.exception.SystemException { + _apiSettingLocalService.set(companyId, key, value); + } + + /** + * @deprecated As of 6.1.0, replaced by {@link #getWrappedService} + */ + public ApiSettingLocalService getWrappedApiSettingLocalService() { + return _apiSettingLocalService; + } + + /** + * @deprecated As of 6.1.0, replaced by {@link #setWrappedService} + */ + public void setWrappedApiSettingLocalService( + ApiSettingLocalService apiSettingLocalService) { + _apiSettingLocalService = apiSettingLocalService; + } + + @Override + public ApiSettingLocalService getWrappedService() { + return _apiSettingLocalService; + } + + @Override + public void setWrappedService(ApiSettingLocalService apiSettingLocalService) { + _apiSettingLocalService = apiSettingLocalService; + } + + private ApiSettingLocalService _apiSettingLocalService; +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingService.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingService.java new file mode 100644 index 00000000..3d571148 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingService.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) 2000-present 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.service; + +import com.liferay.portal.kernel.exception.PortalException; +import com.liferay.portal.kernel.exception.SystemException; +import com.liferay.portal.kernel.jsonwebservice.JSONWebService; +import com.liferay.portal.kernel.transaction.Isolation; +import com.liferay.portal.kernel.transaction.Transactional; +import com.liferay.portal.security.ac.AccessControlled; +import com.liferay.portal.service.BaseService; +import com.liferay.portal.service.InvokableService; + +/** + * Provides the remote service interface for ApiSetting. Methods of this + * service are expected to have security checks based on the propagated JAAS + * credentials because this service can be accessed remotely. + * + * @author Manifattura Web Group Srl + * @see ApiSettingServiceUtil + * @see it.mwg.sicilia.sue.service.base.ApiSettingServiceBaseImpl + * @see it.mwg.sicilia.sue.service.impl.ApiSettingServiceImpl + * @generated + */ +@AccessControlled +@JSONWebService +@Transactional(isolation = Isolation.PORTAL, rollbackFor = { + PortalException.class, SystemException.class}) +public interface ApiSettingService extends BaseService, InvokableService { + /* + * NOTE FOR DEVELOPERS: + * + * Never modify or reference this interface directly. Always use {@link ApiSettingServiceUtil} to access the api setting remote service. Add custom service methods to {@link it.mwg.sicilia.sue.service.impl.ApiSettingServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. + */ + + /** + * Returns the Spring bean ID for this bean. + * + * @return the Spring bean ID for this bean + */ + public java.lang.String getBeanIdentifier(); + + /** + * Sets the Spring bean ID for this bean. + * + * @param beanIdentifier the Spring bean ID for this bean + */ + public void setBeanIdentifier(java.lang.String beanIdentifier); + + @Override + public java.lang.Object invokeMethod(java.lang.String name, + java.lang.String[] parameterTypes, java.lang.Object[] arguments) + throws java.lang.Throwable; +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingServiceClp.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingServiceClp.java new file mode 100644 index 00000000..600b99be --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingServiceClp.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) 2000-present 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.service; + +import com.liferay.portal.service.InvokableService; + +/** + * @author Manifattura Web Group Srl + * @generated + */ +public class ApiSettingServiceClp implements ApiSettingService { + public ApiSettingServiceClp(InvokableService invokableService) { + _invokableService = invokableService; + + _methodName0 = "getBeanIdentifier"; + + _methodParameterTypes0 = new String[] { }; + + _methodName1 = "setBeanIdentifier"; + + _methodParameterTypes1 = new String[] { "java.lang.String" }; + } + + @Override + public java.lang.String getBeanIdentifier() { + Object returnObj = null; + + try { + returnObj = _invokableService.invokeMethod(_methodName0, + _methodParameterTypes0, new Object[] { }); + } + 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); + } + + @Override + public void setBeanIdentifier(java.lang.String beanIdentifier) { + try { + _invokableService.invokeMethod(_methodName1, + _methodParameterTypes1, + new Object[] { ClpSerializer.translateInput(beanIdentifier) }); + } + 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"); + } + } + } + + @Override + public java.lang.Object invokeMethod(java.lang.String name, + java.lang.String[] parameterTypes, java.lang.Object[] arguments) + throws java.lang.Throwable { + throw new UnsupportedOperationException(); + } + + private InvokableService _invokableService; + private String _methodName0; + private String[] _methodParameterTypes0; + private String _methodName1; + private String[] _methodParameterTypes1; +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingServiceUtil.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingServiceUtil.java new file mode 100644 index 00000000..9fee48ea --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingServiceUtil.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) 2000-present 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.service; + +import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil; +import com.liferay.portal.kernel.util.ReferenceRegistry; +import com.liferay.portal.service.InvokableService; + +/** + * Provides the remote service utility for ApiSetting. This utility wraps + * {@link it.mwg.sicilia.sue.service.impl.ApiSettingServiceImpl} and is the + * primary access point for service operations in application layer code running + * on a remote server. Methods of this service are expected to have security + * checks based on the propagated JAAS credentials because this service can be + * accessed remotely. + * + * @author Manifattura Web Group Srl + * @see ApiSettingService + * @see it.mwg.sicilia.sue.service.base.ApiSettingServiceBaseImpl + * @see it.mwg.sicilia.sue.service.impl.ApiSettingServiceImpl + * @generated + */ +public class ApiSettingServiceUtil { + /* + * NOTE FOR DEVELOPERS: + * + * Never modify this class directly. Add custom service methods to {@link it.mwg.sicilia.sue.service.impl.ApiSettingServiceImpl} and rerun ServiceBuilder to regenerate this class. + */ + + /** + * Returns the Spring bean ID for this bean. + * + * @return the Spring bean ID for this bean + */ + public static java.lang.String getBeanIdentifier() { + return getService().getBeanIdentifier(); + } + + /** + * Sets the Spring bean ID for this bean. + * + * @param beanIdentifier the Spring bean ID for this bean + */ + public static void setBeanIdentifier(java.lang.String beanIdentifier) { + getService().setBeanIdentifier(beanIdentifier); + } + + public static java.lang.Object invokeMethod(java.lang.String name, + java.lang.String[] parameterTypes, java.lang.Object[] arguments) + throws java.lang.Throwable { + return getService().invokeMethod(name, parameterTypes, arguments); + } + + public static void clearService() { + _service = null; + } + + public static ApiSettingService getService() { + if (_service == null) { + InvokableService invokableService = (InvokableService)PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), + ApiSettingService.class.getName()); + + if (invokableService instanceof ApiSettingService) { + _service = (ApiSettingService)invokableService; + } + else { + _service = new ApiSettingServiceClp(invokableService); + } + + ReferenceRegistry.registerReference(ApiSettingServiceUtil.class, + "_service"); + } + + return _service; + } + + /** + * @deprecated As of 6.2.0 + */ + public void setService(ApiSettingService service) { + } + + private static ApiSettingService _service; +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingServiceWrapper.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingServiceWrapper.java new file mode 100644 index 00000000..afbe6285 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ApiSettingServiceWrapper.java @@ -0,0 +1,84 @@ +/** + * Copyright (c) 2000-present 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.service; + +import com.liferay.portal.service.ServiceWrapper; + +/** + * Provides a wrapper for {@link ApiSettingService}. + * + * @author Manifattura Web Group Srl + * @see ApiSettingService + * @generated + */ +public class ApiSettingServiceWrapper implements ApiSettingService, + ServiceWrapper { + public ApiSettingServiceWrapper(ApiSettingService apiSettingService) { + _apiSettingService = apiSettingService; + } + + /** + * Returns the Spring bean ID for this bean. + * + * @return the Spring bean ID for this bean + */ + @Override + public java.lang.String getBeanIdentifier() { + return _apiSettingService.getBeanIdentifier(); + } + + /** + * Sets the Spring bean ID for this bean. + * + * @param beanIdentifier the Spring bean ID for this bean + */ + @Override + public void setBeanIdentifier(java.lang.String beanIdentifier) { + _apiSettingService.setBeanIdentifier(beanIdentifier); + } + + @Override + public java.lang.Object invokeMethod(java.lang.String name, + java.lang.String[] parameterTypes, java.lang.Object[] arguments) + throws java.lang.Throwable { + return _apiSettingService.invokeMethod(name, parameterTypes, arguments); + } + + /** + * @deprecated As of 6.1.0, replaced by {@link #getWrappedService} + */ + public ApiSettingService getWrappedApiSettingService() { + return _apiSettingService; + } + + /** + * @deprecated As of 6.1.0, replaced by {@link #setWrappedService} + */ + public void setWrappedApiSettingService(ApiSettingService apiSettingService) { + _apiSettingService = apiSettingService; + } + + @Override + public ApiSettingService getWrappedService() { + return _apiSettingService; + } + + @Override + public void setWrappedService(ApiSettingService apiSettingService) { + _apiSettingService = apiSettingService; + } + + private ApiSettingService _apiSettingService; +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ClpSerializer.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ClpSerializer.java index 6b4b8f5d..64bec69d 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ClpSerializer.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/ClpSerializer.java @@ -25,6 +25,7 @@ import com.liferay.portal.kernel.util.PropsUtil; import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.model.BaseModel; +import it.mwg.sicilia.sue.model.ApiSettingClp; import it.mwg.sicilia.sue.model.SportelloClp; import java.io.ObjectInputStream; @@ -102,6 +103,10 @@ public class ClpSerializer { String oldModelClassName = oldModelClass.getName(); + if (oldModelClassName.equals(ApiSettingClp.class.getName())) { + return translateInputApiSetting(oldModel); + } + if (oldModelClassName.equals(SportelloClp.class.getName())) { return translateInputSportello(oldModel); } @@ -121,6 +126,16 @@ public class ClpSerializer { return newList; } + public static Object translateInputApiSetting(BaseModel oldModel) { + ApiSettingClp oldClpModel = (ApiSettingClp)oldModel; + + BaseModel newModel = oldClpModel.getApiSettingRemoteModel(); + + newModel.setModelAttributes(oldClpModel.getModelAttributes()); + + return newModel; + } + public static Object translateInputSportello(BaseModel oldModel) { SportelloClp oldClpModel = (SportelloClp)oldModel; @@ -148,6 +163,43 @@ public class ClpSerializer { String oldModelClassName = oldModelClass.getName(); + if (oldModelClassName.equals( + "it.mwg.sicilia.sue.model.impl.ApiSettingImpl")) { + return translateOutputApiSetting(oldModel); + } + else if (oldModelClassName.endsWith("Clp")) { + try { + ClassLoader classLoader = ClpSerializer.class.getClassLoader(); + + Method getClpSerializerClassMethod = oldModelClass.getMethod( + "getClpSerializerClass"); + + Class oldClpSerializerClass = (Class)getClpSerializerClassMethod.invoke(oldModel); + + Class newClpSerializerClass = classLoader.loadClass(oldClpSerializerClass.getName()); + + Method translateOutputMethod = newClpSerializerClass.getMethod("translateOutput", + BaseModel.class); + + Class oldModelModelClass = oldModel.getModelClass(); + + Method getRemoteModelMethod = oldModelClass.getMethod("get" + + oldModelModelClass.getSimpleName() + "RemoteModel"); + + Object oldRemoteModel = getRemoteModelMethod.invoke(oldModel); + + BaseModel newModel = (BaseModel)translateOutputMethod.invoke(null, + oldRemoteModel); + + return newModel; + } + catch (Throwable t) { + if (_log.isInfoEnabled()) { + _log.info("Unable to translate " + oldModelClassName, t); + } + } + } + if (oldModelClassName.equals( "it.mwg.sicilia.sue.model.impl.SportelloImpl")) { return translateOutputSportello(oldModel); @@ -265,6 +317,10 @@ public class ClpSerializer { return new SystemException(); } + if (className.equals("it.mwg.sicilia.sue.NoSuchApiSettingException")) { + return new it.mwg.sicilia.sue.NoSuchApiSettingException(); + } + if (className.equals("it.mwg.sicilia.sue.NoSuchSportelloException")) { return new it.mwg.sicilia.sue.NoSuchSportelloException(); } @@ -272,6 +328,16 @@ public class ClpSerializer { return throwable; } + public static Object translateOutputApiSetting(BaseModel oldModel) { + ApiSettingClp newModel = new ApiSettingClp(); + + newModel.setModelAttributes(oldModel.getModelAttributes()); + + newModel.setApiSettingRemoteModel(oldModel); + + return newModel; + } + public static Object translateOutputSportello(BaseModel oldModel) { SportelloClp newModel = new SportelloClp(); diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/messaging/ClpMessageListener.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/messaging/ClpMessageListener.java index 732ec594..553700ea 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/messaging/ClpMessageListener.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/messaging/ClpMessageListener.java @@ -17,6 +17,8 @@ package it.mwg.sicilia.sue.service.messaging; import com.liferay.portal.kernel.messaging.BaseMessageListener; import com.liferay.portal.kernel.messaging.Message; +import it.mwg.sicilia.sue.service.ApiSettingLocalServiceUtil; +import it.mwg.sicilia.sue.service.ApiSettingServiceUtil; import it.mwg.sicilia.sue.service.ClpSerializer; import it.mwg.sicilia.sue.service.SportelloLocalServiceUtil; import it.mwg.sicilia.sue.service.SportelloServiceUtil; @@ -36,6 +38,9 @@ public class ClpMessageListener extends BaseMessageListener { if (command.equals("undeploy") && servletContextName.equals(getServletContextName())) { + ApiSettingLocalServiceUtil.clearService(); + + ApiSettingServiceUtil.clearService(); SportelloLocalServiceUtil.clearService(); SportelloServiceUtil.clearService(); diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/ApiSettingActionableDynamicQuery.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/ApiSettingActionableDynamicQuery.java new file mode 100644 index 00000000..72d8ec57 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/ApiSettingActionableDynamicQuery.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2000-present 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.service.persistence; + +import com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery; +import com.liferay.portal.kernel.exception.SystemException; + +import it.mwg.sicilia.sue.model.ApiSetting; +import it.mwg.sicilia.sue.service.ApiSettingLocalServiceUtil; + +/** + * @author Manifattura Web Group Srl + * @generated + */ +public abstract class ApiSettingActionableDynamicQuery + extends BaseActionableDynamicQuery { + public ApiSettingActionableDynamicQuery() throws SystemException { + setBaseLocalService(ApiSettingLocalServiceUtil.getService()); + setClass(ApiSetting.class); + + setClassLoader(it.mwg.sicilia.sue.service.ClpSerializer.class.getClassLoader()); + + setPrimaryKeyPropertyName("id"); + } +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/ApiSettingPersistence.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/ApiSettingPersistence.java new file mode 100644 index 00000000..7f227b5a --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/ApiSettingPersistence.java @@ -0,0 +1,223 @@ +/** + * Copyright (c) 2000-present 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.service.persistence; + +import com.liferay.portal.service.persistence.BasePersistence; + +import it.mwg.sicilia.sue.model.ApiSetting; + +/** + * The persistence interface for the api setting service. + * + *

+ * Caching information and settings can be found in portal.properties + *

+ * + * @author Manifattura Web Group Srl + * @see ApiSettingPersistenceImpl + * @see ApiSettingUtil + * @generated + */ +public interface ApiSettingPersistence extends BasePersistence { + /* + * NOTE FOR DEVELOPERS: + * + * Never modify or reference this interface directly. Always use {@link ApiSettingUtil} to access the api setting persistence. Modify service.xml and rerun ServiceBuilder to regenerate this interface. + */ + + /** + * Returns the api setting where companyId = ? and key = ? or throws a {@link it.mwg.sicilia.sue.NoSuchApiSettingException} if it could not be found. + * + * @param companyId the company ID + * @param key the key + * @return the matching api setting + * @throws it.mwg.sicilia.sue.NoSuchApiSettingException if a matching api setting could not be found + * @throws SystemException if a system exception occurred + */ + public it.mwg.sicilia.sue.model.ApiSetting findByCompanyIdKey( + long companyId, long key) + throws com.liferay.portal.kernel.exception.SystemException, + it.mwg.sicilia.sue.NoSuchApiSettingException; + + /** + * Returns the api setting where companyId = ? and key = ? or returns null if it could not be found. Uses the finder cache. + * + * @param companyId the company ID + * @param key the key + * @return the matching api setting, or null if a matching api setting could not be found + * @throws SystemException if a system exception occurred + */ + public it.mwg.sicilia.sue.model.ApiSetting fetchByCompanyIdKey( + long companyId, long key) + throws com.liferay.portal.kernel.exception.SystemException; + + /** + * Returns the api setting where companyId = ? and key = ? or returns null if it could not be found, optionally using the finder cache. + * + * @param companyId the company ID + * @param key the key + * @param retrieveFromCache whether to use the finder cache + * @return the matching api setting, or null if a matching api setting could not be found + * @throws SystemException if a system exception occurred + */ + public it.mwg.sicilia.sue.model.ApiSetting fetchByCompanyIdKey( + long companyId, long key, boolean retrieveFromCache) + throws com.liferay.portal.kernel.exception.SystemException; + + /** + * Removes the api setting where companyId = ? and key = ? from the database. + * + * @param companyId the company ID + * @param key the key + * @return the api setting that was removed + * @throws SystemException if a system exception occurred + */ + public it.mwg.sicilia.sue.model.ApiSetting removeByCompanyIdKey( + long companyId, long key) + throws com.liferay.portal.kernel.exception.SystemException, + it.mwg.sicilia.sue.NoSuchApiSettingException; + + /** + * Returns the number of api settings where companyId = ? and key = ?. + * + * @param companyId the company ID + * @param key the key + * @return the number of matching api settings + * @throws SystemException if a system exception occurred + */ + public int countByCompanyIdKey(long companyId, long key) + throws com.liferay.portal.kernel.exception.SystemException; + + /** + * Caches the api setting in the entity cache if it is enabled. + * + * @param apiSetting the api setting + */ + public void cacheResult(it.mwg.sicilia.sue.model.ApiSetting apiSetting); + + /** + * Caches the api settings in the entity cache if it is enabled. + * + * @param apiSettings the api settings + */ + public void cacheResult( + java.util.List apiSettings); + + /** + * Creates a new api setting with the primary key. Does not add the api setting to the database. + * + * @param id the primary key for the new api setting + * @return the new api setting + */ + public it.mwg.sicilia.sue.model.ApiSetting create(long id); + + /** + * Removes the api setting with the primary key from the database. Also notifies the appropriate model listeners. + * + * @param id the primary key of the api setting + * @return the api setting that was removed + * @throws it.mwg.sicilia.sue.NoSuchApiSettingException if a api setting with the primary key could not be found + * @throws SystemException if a system exception occurred + */ + public it.mwg.sicilia.sue.model.ApiSetting remove(long id) + throws com.liferay.portal.kernel.exception.SystemException, + it.mwg.sicilia.sue.NoSuchApiSettingException; + + public it.mwg.sicilia.sue.model.ApiSetting updateImpl( + it.mwg.sicilia.sue.model.ApiSetting apiSetting) + throws com.liferay.portal.kernel.exception.SystemException; + + /** + * Returns the api setting with the primary key or throws a {@link it.mwg.sicilia.sue.NoSuchApiSettingException} if it could not be found. + * + * @param id the primary key of the api setting + * @return the api setting + * @throws it.mwg.sicilia.sue.NoSuchApiSettingException if a api setting with the primary key could not be found + * @throws SystemException if a system exception occurred + */ + public it.mwg.sicilia.sue.model.ApiSetting findByPrimaryKey(long id) + throws com.liferay.portal.kernel.exception.SystemException, + it.mwg.sicilia.sue.NoSuchApiSettingException; + + /** + * Returns the api setting with the primary key or returns null if it could not be found. + * + * @param id the primary key of the api setting + * @return the api setting, or null if a api setting with the primary key could not be found + * @throws SystemException if a system exception occurred + */ + public it.mwg.sicilia.sue.model.ApiSetting fetchByPrimaryKey(long id) + throws com.liferay.portal.kernel.exception.SystemException; + + /** + * Returns all the api settings. + * + * @return the api settings + * @throws SystemException if a system exception occurred + */ + public java.util.List findAll() + throws com.liferay.portal.kernel.exception.SystemException; + + /** + * Returns a range of all the api settings. + * + *

+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. + *

+ * + * @param start the lower bound of the range of api settings + * @param end the upper bound of the range of api settings (not inclusive) + * @return the range of api settings + * @throws SystemException if a system exception occurred + */ + public java.util.List findAll( + int start, int end) + throws com.liferay.portal.kernel.exception.SystemException; + + /** + * Returns an ordered range of all the api settings. + * + *

+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. + *

+ * + * @param start the lower bound of the range of api settings + * @param end the upper bound of the range of api settings (not inclusive) + * @param orderByComparator the comparator to order the results by (optionally null) + * @return the ordered range of api settings + * @throws SystemException if a system exception occurred + */ + public java.util.List findAll( + int start, int end, + com.liferay.portal.kernel.util.OrderByComparator orderByComparator) + throws com.liferay.portal.kernel.exception.SystemException; + + /** + * Removes all the api settings from the database. + * + * @throws SystemException if a system exception occurred + */ + public void removeAll() + throws com.liferay.portal.kernel.exception.SystemException; + + /** + * Returns the number of api settings. + * + * @return the number of api settings + * @throws SystemException if a system exception occurred + */ + public int countAll() + throws com.liferay.portal.kernel.exception.SystemException; +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/ApiSettingUtil.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/ApiSettingUtil.java new file mode 100644 index 00000000..9cf3f1da --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/ApiSettingUtil.java @@ -0,0 +1,352 @@ +/** + * Copyright (c) 2000-present 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.service.persistence; + +import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil; +import com.liferay.portal.kernel.dao.orm.DynamicQuery; +import com.liferay.portal.kernel.exception.SystemException; +import com.liferay.portal.kernel.util.OrderByComparator; +import com.liferay.portal.kernel.util.ReferenceRegistry; +import com.liferay.portal.service.ServiceContext; + +import it.mwg.sicilia.sue.model.ApiSetting; + +import java.util.List; + +/** + * The persistence utility for the api setting service. This utility wraps {@link ApiSettingPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class. + * + *

+ * Caching information and settings can be found in portal.properties + *

+ * + * @author Manifattura Web Group Srl + * @see ApiSettingPersistence + * @see ApiSettingPersistenceImpl + * @generated + */ +public class ApiSettingUtil { + /* + * NOTE FOR DEVELOPERS: + * + * Never modify this class directly. Modify service.xml and rerun ServiceBuilder to regenerate this class. + */ + + /** + * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() + */ + public static void clearCache() { + getPersistence().clearCache(); + } + + /** + * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) + */ + public static void clearCache(ApiSetting apiSetting) { + getPersistence().clearCache(apiSetting); + } + + /** + * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) + */ + public static long countWithDynamicQuery(DynamicQuery dynamicQuery) + throws SystemException { + return getPersistence().countWithDynamicQuery(dynamicQuery); + } + + /** + * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) + */ + public static List findWithDynamicQuery( + DynamicQuery dynamicQuery) throws SystemException { + return getPersistence().findWithDynamicQuery(dynamicQuery); + } + + /** + * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) + */ + public static List findWithDynamicQuery( + DynamicQuery dynamicQuery, int start, int end) + throws SystemException { + return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); + } + + /** + * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) + */ + public static List findWithDynamicQuery( + DynamicQuery dynamicQuery, int start, int end, + OrderByComparator orderByComparator) throws SystemException { + return getPersistence() + .findWithDynamicQuery(dynamicQuery, start, end, + orderByComparator); + } + + /** + * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel) + */ + public static ApiSetting update(ApiSetting apiSetting) + throws SystemException { + return getPersistence().update(apiSetting); + } + + /** + * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) + */ + public static ApiSetting update(ApiSetting apiSetting, + ServiceContext serviceContext) throws SystemException { + return getPersistence().update(apiSetting, serviceContext); + } + + /** + * Returns the api setting where companyId = ? and key = ? or throws a {@link it.mwg.sicilia.sue.NoSuchApiSettingException} if it could not be found. + * + * @param companyId the company ID + * @param key the key + * @return the matching api setting + * @throws it.mwg.sicilia.sue.NoSuchApiSettingException if a matching api setting could not be found + * @throws SystemException if a system exception occurred + */ + public static it.mwg.sicilia.sue.model.ApiSetting findByCompanyIdKey( + long companyId, long key) + throws com.liferay.portal.kernel.exception.SystemException, + it.mwg.sicilia.sue.NoSuchApiSettingException { + return getPersistence().findByCompanyIdKey(companyId, key); + } + + /** + * Returns the api setting where companyId = ? and key = ? or returns null if it could not be found. Uses the finder cache. + * + * @param companyId the company ID + * @param key the key + * @return the matching api setting, or null if a matching api setting could not be found + * @throws SystemException if a system exception occurred + */ + public static it.mwg.sicilia.sue.model.ApiSetting fetchByCompanyIdKey( + long companyId, long key) + throws com.liferay.portal.kernel.exception.SystemException { + return getPersistence().fetchByCompanyIdKey(companyId, key); + } + + /** + * Returns the api setting where companyId = ? and key = ? or returns null if it could not be found, optionally using the finder cache. + * + * @param companyId the company ID + * @param key the key + * @param retrieveFromCache whether to use the finder cache + * @return the matching api setting, or null if a matching api setting could not be found + * @throws SystemException if a system exception occurred + */ + public static it.mwg.sicilia.sue.model.ApiSetting fetchByCompanyIdKey( + long companyId, long key, boolean retrieveFromCache) + throws com.liferay.portal.kernel.exception.SystemException { + return getPersistence() + .fetchByCompanyIdKey(companyId, key, retrieveFromCache); + } + + /** + * Removes the api setting where companyId = ? and key = ? from the database. + * + * @param companyId the company ID + * @param key the key + * @return the api setting that was removed + * @throws SystemException if a system exception occurred + */ + public static it.mwg.sicilia.sue.model.ApiSetting removeByCompanyIdKey( + long companyId, long key) + throws com.liferay.portal.kernel.exception.SystemException, + it.mwg.sicilia.sue.NoSuchApiSettingException { + return getPersistence().removeByCompanyIdKey(companyId, key); + } + + /** + * Returns the number of api settings where companyId = ? and key = ?. + * + * @param companyId the company ID + * @param key the key + * @return the number of matching api settings + * @throws SystemException if a system exception occurred + */ + public static int countByCompanyIdKey(long companyId, long key) + throws com.liferay.portal.kernel.exception.SystemException { + return getPersistence().countByCompanyIdKey(companyId, key); + } + + /** + * Caches the api setting in the entity cache if it is enabled. + * + * @param apiSetting the api setting + */ + public static void cacheResult( + it.mwg.sicilia.sue.model.ApiSetting apiSetting) { + getPersistence().cacheResult(apiSetting); + } + + /** + * Caches the api settings in the entity cache if it is enabled. + * + * @param apiSettings the api settings + */ + public static void cacheResult( + java.util.List apiSettings) { + getPersistence().cacheResult(apiSettings); + } + + /** + * Creates a new api setting with the primary key. Does not add the api setting to the database. + * + * @param id the primary key for the new api setting + * @return the new api setting + */ + public static it.mwg.sicilia.sue.model.ApiSetting create(long id) { + return getPersistence().create(id); + } + + /** + * Removes the api setting with the primary key from the database. Also notifies the appropriate model listeners. + * + * @param id the primary key of the api setting + * @return the api setting that was removed + * @throws it.mwg.sicilia.sue.NoSuchApiSettingException if a api setting with the primary key could not be found + * @throws SystemException if a system exception occurred + */ + public static it.mwg.sicilia.sue.model.ApiSetting remove(long id) + throws com.liferay.portal.kernel.exception.SystemException, + it.mwg.sicilia.sue.NoSuchApiSettingException { + return getPersistence().remove(id); + } + + public static it.mwg.sicilia.sue.model.ApiSetting updateImpl( + it.mwg.sicilia.sue.model.ApiSetting apiSetting) + throws com.liferay.portal.kernel.exception.SystemException { + return getPersistence().updateImpl(apiSetting); + } + + /** + * Returns the api setting with the primary key or throws a {@link it.mwg.sicilia.sue.NoSuchApiSettingException} if it could not be found. + * + * @param id the primary key of the api setting + * @return the api setting + * @throws it.mwg.sicilia.sue.NoSuchApiSettingException if a api setting with the primary key could not be found + * @throws SystemException if a system exception occurred + */ + public static it.mwg.sicilia.sue.model.ApiSetting findByPrimaryKey(long id) + throws com.liferay.portal.kernel.exception.SystemException, + it.mwg.sicilia.sue.NoSuchApiSettingException { + return getPersistence().findByPrimaryKey(id); + } + + /** + * Returns the api setting with the primary key or returns null if it could not be found. + * + * @param id the primary key of the api setting + * @return the api setting, or null if a api setting with the primary key could not be found + * @throws SystemException if a system exception occurred + */ + public static it.mwg.sicilia.sue.model.ApiSetting fetchByPrimaryKey(long id) + throws com.liferay.portal.kernel.exception.SystemException { + return getPersistence().fetchByPrimaryKey(id); + } + + /** + * Returns all the api settings. + * + * @return the api settings + * @throws SystemException if a system exception occurred + */ + public static java.util.List findAll() + throws com.liferay.portal.kernel.exception.SystemException { + return getPersistence().findAll(); + } + + /** + * Returns a range of all the api settings. + * + *

+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. + *

+ * + * @param start the lower bound of the range of api settings + * @param end the upper bound of the range of api settings (not inclusive) + * @return the range of api settings + * @throws SystemException if a system exception occurred + */ + public static java.util.List findAll( + int start, int end) + throws com.liferay.portal.kernel.exception.SystemException { + return getPersistence().findAll(start, end); + } + + /** + * Returns an ordered range of all the api settings. + * + *

+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. + *

+ * + * @param start the lower bound of the range of api settings + * @param end the upper bound of the range of api settings (not inclusive) + * @param orderByComparator the comparator to order the results by (optionally null) + * @return the ordered range of api settings + * @throws SystemException if a system exception occurred + */ + public static java.util.List findAll( + int start, int end, + com.liferay.portal.kernel.util.OrderByComparator orderByComparator) + throws com.liferay.portal.kernel.exception.SystemException { + return getPersistence().findAll(start, end, orderByComparator); + } + + /** + * Removes all the api settings from the database. + * + * @throws SystemException if a system exception occurred + */ + public static void removeAll() + throws com.liferay.portal.kernel.exception.SystemException { + getPersistence().removeAll(); + } + + /** + * Returns the number of api settings. + * + * @return the number of api settings + * @throws SystemException if a system exception occurred + */ + public static int countAll() + throws com.liferay.portal.kernel.exception.SystemException { + return getPersistence().countAll(); + } + + public static ApiSettingPersistence getPersistence() { + if (_persistence == null) { + _persistence = (ApiSettingPersistence)PortletBeanLocatorUtil.locate(it.mwg.sicilia.sue.service.ClpSerializer.getServletContextName(), + ApiSettingPersistence.class.getName()); + + ReferenceRegistry.registerReference(ApiSettingUtil.class, + "_persistence"); + } + + return _persistence; + } + + /** + * @deprecated As of 6.2.0 + */ + public void setPersistence(ApiSettingPersistence persistence) { + } + + private static ApiSettingPersistence _persistence; +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/SportelloPersistence.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/SportelloPersistence.java index a30c21ec..f5fbc933 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/SportelloPersistence.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/SportelloPersistence.java @@ -38,61 +38,58 @@ public interface SportelloPersistence extends BasePersistence { */ /** - * Returns the sportello where loginName = ? or throws a {@link it.mwg.sicilia.sue.NoSuchSportelloException} if it could not be found. + * Returns the sportello where comuneId = ? or throws a {@link it.mwg.sicilia.sue.NoSuchSportelloException} if it could not be found. * - * @param loginName the login name + * @param comuneId the comune ID * @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 findByLoginName( - java.lang.String loginName) + public it.mwg.sicilia.sue.model.Sportello findByComuneId(long comuneId) throws com.liferay.portal.kernel.exception.SystemException, it.mwg.sicilia.sue.NoSuchSportelloException; /** - * Returns the sportello where loginName = ? or returns null if it could not be found. Uses the finder cache. + * Returns the sportello where comuneId = ? or returns null if it could not be found. Uses the finder cache. * - * @param loginName the login name + * @param comuneId the comune ID * @return the matching sportello, or null if a matching sportello could not be found * @throws SystemException if a system exception occurred */ - public it.mwg.sicilia.sue.model.Sportello fetchByLoginName( - java.lang.String loginName) + public it.mwg.sicilia.sue.model.Sportello fetchByComuneId(long comuneId) throws com.liferay.portal.kernel.exception.SystemException; /** - * Returns the sportello where loginName = ? or returns null if it could not be found, optionally using the finder cache. + * Returns the sportello where comuneId = ? or returns null if it could not be found, optionally using the finder cache. * - * @param loginName the login name + * @param comuneId the comune ID * @param retrieveFromCache whether to use the finder cache * @return the matching sportello, or null if a matching sportello could not be found * @throws SystemException if a system exception occurred */ - public it.mwg.sicilia.sue.model.Sportello fetchByLoginName( - java.lang.String loginName, boolean retrieveFromCache) + public it.mwg.sicilia.sue.model.Sportello fetchByComuneId(long comuneId, + boolean retrieveFromCache) throws com.liferay.portal.kernel.exception.SystemException; /** - * Removes the sportello where loginName = ? from the database. + * Removes the sportello where comuneId = ? from the database. * - * @param loginName the login name + * @param comuneId the comune ID * @return the sportello that was removed * @throws SystemException if a system exception occurred */ - public it.mwg.sicilia.sue.model.Sportello removeByLoginName( - java.lang.String loginName) + public it.mwg.sicilia.sue.model.Sportello removeByComuneId(long comuneId) throws com.liferay.portal.kernel.exception.SystemException, it.mwg.sicilia.sue.NoSuchSportelloException; /** - * Returns the number of sportellos where loginName = ?. + * Returns the number of sportellos where comuneId = ?. * - * @param loginName the login name + * @param comuneId the comune ID * @return the number of matching sportellos * @throws SystemException if a system exception occurred */ - public int countByLoginName(java.lang.String loginName) + public int countByComuneId(long comuneId) throws com.liferay.portal.kernel.exception.SystemException; /** diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/SportelloUtil.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/SportelloUtil.java index b0cc8a25..344db9c0 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/SportelloUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service/it/mwg/sicilia/sue/service/persistence/SportelloUtil.java @@ -111,71 +111,71 @@ public class SportelloUtil { } /** - * Returns the sportello where loginName = ? or throws a {@link it.mwg.sicilia.sue.NoSuchSportelloException} if it could not be found. + * Returns the sportello where comuneId = ? or throws a {@link it.mwg.sicilia.sue.NoSuchSportelloException} if it could not be found. * - * @param loginName the login name + * @param comuneId the comune ID * @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 findByLoginName( - java.lang.String loginName) + public static it.mwg.sicilia.sue.model.Sportello findByComuneId( + long comuneId) throws com.liferay.portal.kernel.exception.SystemException, it.mwg.sicilia.sue.NoSuchSportelloException { - return getPersistence().findByLoginName(loginName); + return getPersistence().findByComuneId(comuneId); } /** - * Returns the sportello where loginName = ? or returns null if it could not be found. Uses the finder cache. + * Returns the sportello where comuneId = ? or returns null if it could not be found. Uses the finder cache. * - * @param loginName the login name + * @param comuneId the comune ID * @return the matching sportello, or null if a matching sportello could not be found * @throws SystemException if a system exception occurred */ - public static it.mwg.sicilia.sue.model.Sportello fetchByLoginName( - java.lang.String loginName) + public static it.mwg.sicilia.sue.model.Sportello fetchByComuneId( + long comuneId) throws com.liferay.portal.kernel.exception.SystemException { - return getPersistence().fetchByLoginName(loginName); + return getPersistence().fetchByComuneId(comuneId); } /** - * Returns the sportello where loginName = ? or returns null if it could not be found, optionally using the finder cache. + * Returns the sportello where comuneId = ? or returns null if it could not be found, optionally using the finder cache. * - * @param loginName the login name + * @param comuneId the comune ID * @param retrieveFromCache whether to use the finder cache * @return the matching sportello, or null if a matching sportello could not be found * @throws SystemException if a system exception occurred */ - public static it.mwg.sicilia.sue.model.Sportello fetchByLoginName( - java.lang.String loginName, boolean retrieveFromCache) + public static it.mwg.sicilia.sue.model.Sportello fetchByComuneId( + long comuneId, boolean retrieveFromCache) throws com.liferay.portal.kernel.exception.SystemException { - return getPersistence().fetchByLoginName(loginName, retrieveFromCache); + return getPersistence().fetchByComuneId(comuneId, retrieveFromCache); } /** - * Removes the sportello where loginName = ? from the database. + * Removes the sportello where comuneId = ? from the database. * - * @param loginName the login name + * @param comuneId the comune ID * @return the sportello that was removed * @throws SystemException if a system exception occurred */ - public static it.mwg.sicilia.sue.model.Sportello removeByLoginName( - java.lang.String loginName) + public static it.mwg.sicilia.sue.model.Sportello removeByComuneId( + long comuneId) throws com.liferay.portal.kernel.exception.SystemException, it.mwg.sicilia.sue.NoSuchSportelloException { - return getPersistence().removeByLoginName(loginName); + return getPersistence().removeByComuneId(comuneId); } /** - * Returns the number of sportellos where loginName = ?. + * Returns the number of sportellos where comuneId = ?. * - * @param loginName the login name + * @param comuneId the comune ID * @return the number of matching sportellos * @throws SystemException if a system exception occurred */ - public static int countByLoginName(java.lang.String loginName) + public static int countByComuneId(long comuneId) throws com.liferay.portal.kernel.exception.SystemException { - return getPersistence().countByLoginName(loginName); + return getPersistence().countByComuneId(comuneId); } /** diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/indexes.properties b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/indexes.properties index fed69cef..7f94ec66 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/indexes.properties +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/indexes.properties @@ -1,3 +1,3 @@ -IX_9824D813=sicilia_sue_Sportello.LoginName -IX_9824D813=sicilia_sue_Sportello.loginName -IX_F4E738BB=sicilia_sue_Sportello.userName \ No newline at end of file +IX_7B780A8D=sicilia_sue_ApiSetting.CompanyIdKey + +IX_8B2AB20B=sicilia_sue_Sportello.ComuneId \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/indexes.sql b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/indexes.sql index 924eb0ad..c1afa6ba 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/indexes.sql +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/indexes.sql @@ -1,2 +1,3 @@ -create index IX_9824D813 on sicilia_sue_Sportello (loginName); -create index IX_F4E738BB on sicilia_sue_Sportello (userName); \ No newline at end of file +create unique index IX_7B780A8D on sicilia_sue_ApiSetting (companyId, key_); + +create unique index IX_8B2AB20B on sicilia_sue_Sportello (comuneId); \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/tables.sql b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/tables.sql index 7116a560..b98c487c 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/tables.sql +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/tables.sql @@ -1,12 +1,20 @@ +create table sicilia_sue_ApiSetting ( + id_ LONG not null primary key, + companyId LONG, + key_ LONG, + value STRING null +); + create table sicilia_sue_Sportello ( sportelloId LONG not null primary key, groupId LONG, companyId LONG, userId LONG, - userName VARCHAR(75) null, + userName VARCHAR(240) null, createDate DATE null, modifiedDate DATE null, - loginName VARCHAR(75) null, - password_ VARCHAR(75) null, - nonce VARCHAR(75) null + email VARCHAR(240) null, + comuneId LONG, + apiKey VARCHAR(240) null, + attivo BOOLEAN ); \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-hbm.xml b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-hbm.xml index a56874b8..c568aa50 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-hbm.xml +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-hbm.xml @@ -2,7 +2,17 @@ + + + + + + + + + + @@ -14,8 +24,9 @@ - - - + + + + \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-model-hints.xml b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-model-hints.xml index dbf41d21..b69ced79 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-model-hints.xml +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-model-hints.xml @@ -1,16 +1,31 @@ + + + + + + 4000 + + - + + 240 + - - - + + 240 + + + + 240 + + \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-orm.xml b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-orm.xml index 1c997821..94ff9bfe 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-orm.xml +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-orm.xml @@ -7,6 +7,21 @@ PROPERTY + + + + + + + + + + + + + + + @@ -20,17 +35,20 @@ TIMESTAMP - - - - - + + + + + + + +
diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-spring.xml b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-spring.xml index 04dd3545..2ff6d79a 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-spring.xml +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/META-INF/portlet-spring.xml @@ -1,6 +1,9 @@ + + + diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/content/Language.properties b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/content/Language.properties new file mode 100644 index 00000000..ff9528b9 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/content/Language.properties @@ -0,0 +1,3 @@ +email = Email +nomeComune = Comune +nomeProvincia = Provincia \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/common/Action.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/common/Action.java deleted file mode 100644 index 071e786b..00000000 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/common/Action.java +++ /dev/null @@ -1,46 +0,0 @@ -package it.mwg.sicilia.sue.api.common; - - -public class Action { - - private String name; - private String description; - private String method; - - public Action(String name, String description, String method) { - - this.name = name; - this.description = description; - this.method = method; - } - - public String getName() { - - return name; - } - - public void setName(String name) { - - this.name = name; - } - - public String getDescription() { - - return description; - } - - public void setDescription(String description) { - - this.description = description; - } - - public String getMethod() { - - return method; - } - - public void setMethod(String method) { - - this.method = method; - } -} diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Actions.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Actions.java deleted file mode 100644 index fcbfb4fc..00000000 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Actions.java +++ /dev/null @@ -1,22 +0,0 @@ -package it.mwg.sicilia.sue.api.v1; - -import it.mwg.sicilia.sue.api.common.Action; - -import java.util.ArrayList; -import java.util.List; - -import com.liferay.portal.kernel.servlet.HttpMethods; - -public class Actions { - - @SuppressWarnings("serial") - private static final List ACTIONS = new ArrayList() { - { - add(new Action("login", "Login", HttpMethods.POST)); - } - }; - - public static List getActions() { - return ACTIONS; - } -} diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiConstants.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiConstants.java new file mode 100644 index 00000000..4c2da7a5 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiConstants.java @@ -0,0 +1,8 @@ +package it.mwg.sicilia.sue.api.v1; + +public class ApiConstants { + + public static final long API_SECRET = 1; + public static final long API_PUBLIC_KEY = 2; + public static final long API_PRIVATE_KEY = 3; +} diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiServlet.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiServlet.java index 22753952..2eb22b51 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiServlet.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiServlet.java @@ -1,15 +1,10 @@ package it.mwg.sicilia.sue.api.v1; -import it.mwg.sicilia.sue.NoSuchSportelloException; import it.mwg.sicilia.sue.model.Sportello; -import it.mwg.sicilia.sue.service.SportelloLocalServiceUtil; -import it.mwg.sicilia.sue.service.persistence.SportelloUtil; import java.io.IOException; import java.io.InputStreamReader; import java.io.Serializable; -import java.security.SecureRandom; -import java.util.LinkedHashMap; import java.util.Map; import javax.servlet.ServletException; @@ -17,15 +12,10 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.commons.codec.digest.DigestUtils; - -import com.liferay.portal.kernel.exception.SystemException; 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; import com.liferay.portal.kernel.util.Validator; @@ -42,57 +32,60 @@ public class ApiServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED); + process(request, response); } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - String info = request.getPathInfo(); - if (Validator.isNotNull(info) && !info.equals(StringPool.FORWARD_SLASH)) { - response.sendError(HttpServletResponse.SC_NOT_FOUND); - return; - } - Map parameters = deserializer - .deserialize(new InputStreamReader(request.getInputStream())); - response.setContentType(ContentTypes.APPLICATION_JSON); - response.setCharacterEncoding(StringPool.UTF8); - ServletResponseUtil.write(response, process(parameters)); + process(request, response); } - private String process(Map parameters) throws IOException { - if (Validator.isNull(parameters)) { - return Response.get(Status.PARSE_ERROR); - } else if (!parameters.containsKey(Parameters.COMMAND)) { - return Response.get(Status.NO_COMMAND_GIVEN); + @Override + protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + process(request, response); + } + + private void process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + String info = request.getPathInfo(); + if (Validator.isNull(info)) { + info = StringPool.BLANK; + } else { + info = request.getPathInfo().substring(1); + } + Command command = Commands.get(info); + if (Validator.isNull(command)) { + response.sendError(HttpServletResponse.SC_NOT_FOUND); } else { - switch ((String) parameters.get(Parameters.COMMAND)) { - case Parameters.COMMAND_LOGIN: - return login(parameters); + Map parameters = deserializer.deserialize(new InputStreamReader(request + .getInputStream())); + long timestamp = 0; + String uuid = null; + String signature = null; + try { + timestamp = (Long) parameters.get(Parameters.AUTH_TIMESTAMP); + uuid = (String) parameters.get(Parameters.AUTH_USER_ID); + signature = (String) parameters.get(Parameters.AUTH_SIGNATURE); + } catch (ClassCastException e) { + } + if ((0 == timestamp) || Validator.isNull(uuid) || Validator.isNull(signature)) { + response.sendError(HttpServletResponse.SC_BAD_REQUEST); + } else if (!verifySignature(timestamp, signature)) { + response.sendError(HttpServletResponse.SC_FORBIDDEN); + } else if (!command.getMethods().contains(request.getMethod())) { + response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED); + } else { + command.run(request, response); } } - return Response.get(Status.INVALID_COMMAND); } - private String login(Map parameters) throws IOException { - if (!parameters.containsKey(Parameters.USERNAME)) { - return Response.get(Status.NO_USERNAME_GIVEN); - } - Map extraData = new LinkedHashMap<>(); - String loginName = (String) parameters.get(Parameters.USERNAME); - byte[] bytes = new byte[32]; - SecureRandom rnd = new SecureRandom(); - rnd.nextBytes(bytes); - String nonce = DigestUtils.sha256Hex(bytes); - extraData.put(Parameters.NONCE, nonce); - Sportello sportello = null; - try { - sportello = SportelloUtil.findByLoginName(loginName); - sportello.setNonce(nonce); - SportelloLocalServiceUtil.updateSportello(sportello); - } catch (NoSuchSportelloException | SystemException e) { - } - return Response.get(Status.OK, extraData); + private boolean verifySignature(long timestamp, String signature) { + + Sportello sportello; + return false; } } diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiUtil.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiUtil.java new file mode 100644 index 00000000..98e01bd2 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiUtil.java @@ -0,0 +1,66 @@ +package it.mwg.sicilia.sue.api.v1; + +import it.mwg.sicilia.sue.service.ApiSettingLocalServiceUtil; + +import java.security.KeyFactory; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.spec.PKCS8EncodedKeySpec; +import java.security.spec.X509EncodedKeySpec; + +import javax.crypto.Cipher; + +import org.apache.commons.codec.digest.DigestUtils; + +import com.liferay.portal.kernel.json.JSONFactoryUtil; +import com.liferay.portal.kernel.json.JSONObject; +import com.liferay.portal.kernel.log.Log; +import com.liferay.portal.kernel.log.LogFactoryUtil; +import com.liferay.portal.kernel.security.SecureRandom; +import com.liferay.portal.kernel.util.StringPool; +import com.liferay.portal.security.auth.CompanyThreadLocal; +import com.sun.org.apache.xml.internal.security.utils.Base64; + +public class ApiUtil { + + private static final Log _log = LogFactoryUtil.getLog(ApiUtil.class); + + public static String getToken(long companyId, long sportelloId) throws Exception { + + SecureRandom rnd = new SecureRandom(); + + JSONObject object = JSONFactoryUtil.createJSONObject(); + object.put("id", sportelloId); + object.put("rnd", rnd.nextLong()); + _log.info(object.toString()); + + KeyFactory keyFactory = KeyFactory.getInstance("RSA"); + String key = ApiSettingLocalServiceUtil.get(companyId, ApiConstants.API_PRIVATE_KEY); + PKCS8EncodedKeySpec privKeySpec = new PKCS8EncodedKeySpec(Base64.decode(key)); + PrivateKey privateKey = keyFactory.generatePrivate(privKeySpec); + key = ApiSettingLocalServiceUtil.get(companyId, ApiConstants.API_PUBLIC_KEY); + X509EncodedKeySpec pubKeySpec = new X509EncodedKeySpec(Base64.decode(key)); + PublicKey publicKey = keyFactory.generatePublic(pubKeySpec); + + Cipher cipher = Cipher.getInstance("RSA"); + cipher.init(Cipher.ENCRYPT_MODE, privateKey); + String enc = Base64.encode(cipher.doFinal(object.toString().getBytes())); + _log.info("Enc: " + enc); + cipher.init(Cipher.DECRYPT_MODE, publicKey); + String dec = new String(cipher.doFinal(Base64.decode(enc))); + _log.info("Dec: " + dec); + + byte[] bytes = new byte[512]; + rnd.nextBytes(bytes); + String hash = DigestUtils.sha256Hex(bytes); + String secret = ApiSettingLocalServiceUtil.get(companyId, ApiConstants.API_SECRET); + String check = DigestUtils.sha256Hex(hash + secret); + return hash + StringPool.PERIOD + check; + } + + public static String getToken(long sportelloId) throws Exception { + + long companyId = CompanyThreadLocal.getCompanyId(); + return getToken(companyId, sportelloId); + } +} diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Command.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Command.java new file mode 100644 index 00000000..f93ab401 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Command.java @@ -0,0 +1,41 @@ +package it.mwg.sicilia.sue.api.v1; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +public abstract class Command { + + private String verb; + private List methods; + private String description; + + public Command(String verb, String description, String... methods) { + + this.verb = verb; + this.methods = Arrays.asList(methods); + this.description = description; + } + + public String getVerb() { + + return verb; + } + + public List getMethods() { + + return methods; + } + + public String getDescription() { + + return description; + } + + public abstract void run(HttpServletRequest request, HttpServletResponse response) throws ServletException, + IOException; +} diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Commands.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Commands.java index b3e8f605..73bacee6 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Commands.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Commands.java @@ -1,5 +1,28 @@ package it.mwg.sicilia.sue.api.v1; +import it.mwg.sicilia.sue.api.v1.command.CommandNop; + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.liferay.portal.kernel.servlet.HttpMethods; +import com.liferay.portal.kernel.util.StringPool; + public class Commands { + private static final Map commands = new LinkedHashMap<>(); + static { + addCommand(new CommandNop(StringPool.BLANK, "NOP verifica la connettività senza eseguire operazioni", + HttpMethods.GET, HttpMethods.POST)); + } + + private static void addCommand(Command command) { + + commands.put(command.getVerb(), command); + } + + public static Command get(String verb) { + + return commands.get(verb); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Parameters.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Parameters.java index e7c23741..bca814a7 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Parameters.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Parameters.java @@ -2,6 +2,9 @@ package it.mwg.sicilia.sue.api.v1; public class Parameters { + public static final String AUTH_TIMESTAMP = "timestamp"; + public static final String AUTH_USER_ID = "userId"; + public static final String AUTH_SIGNATURE = "signature"; public static final String STATUS_CODE = "status"; public static final String STATUS_DESCRIPTION = "description"; } diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Status.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Status.java index f0f3ca4b..e6435a06 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Status.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Status.java @@ -6,19 +6,13 @@ import java.util.Map; public class Status { public static final int OK = 0; - public static final int INVALID_COMMAND = 1; - public static final int NO_COMMAND_GIVEN = 2; - public static final int NO_USERNAME_GIVEN = 3; - public static final int PARSE_ERROR = 4; + public static final int MALFORMED_REQUEST = 1; @SuppressWarnings("serial") private static final Map messages = new HashMap() { { put(OK, "OK"); - put(INVALID_COMMAND, "Invalid command"); - put(NO_COMMAND_GIVEN, "No command given"); - put(NO_USERNAME_GIVEN, "No username given"); - put(PARSE_ERROR, "Parse error"); + put(MALFORMED_REQUEST, "Malformed request"); } }; diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/command/CommandNop.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/command/CommandNop.java new file mode 100644 index 00000000..8535142f --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/command/CommandNop.java @@ -0,0 +1,31 @@ +package it.mwg.sicilia.sue.api.v1.command; + +import it.mwg.sicilia.sue.api.v1.Command; +import it.mwg.sicilia.sue.api.v1.Response; +import it.mwg.sicilia.sue.api.v1.Status; + +import java.io.IOException; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.liferay.portal.kernel.servlet.ServletResponseUtil; +import com.liferay.portal.kernel.util.ContentTypes; +import com.liferay.portal.kernel.util.StringPool; + +public class CommandNop extends Command { + + public CommandNop(String verb, String description, String... methods) { + + super(verb, description, methods); + } + + @Override + public void run(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + response.setContentType(ContentTypes.APPLICATION_JSON); + response.setCharacterEncoding(StringPool.UTF8); + ServletResponseUtil.write(response, Response.get(Status.OK)); + } +} diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/ApiSettingBaseImpl.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/ApiSettingBaseImpl.java new file mode 100644 index 00000000..89584fef --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/ApiSettingBaseImpl.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2000-present 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.model.impl; + +import com.liferay.portal.kernel.exception.SystemException; + +import it.mwg.sicilia.sue.model.ApiSetting; +import it.mwg.sicilia.sue.service.ApiSettingLocalServiceUtil; + +/** + * The extended model base implementation for the ApiSetting service. Represents a row in the "sicilia_sue_ApiSetting" database table, with each column mapped to a property of this class. + * + *

+ * This class exists only as a container for the default extended model level methods generated by ServiceBuilder. Helper methods and all application logic should be put in {@link ApiSettingImpl}. + *

+ * + * @author Manifattura Web Group Srl + * @see ApiSettingImpl + * @see it.mwg.sicilia.sue.model.ApiSetting + * @generated + */ +public abstract class ApiSettingBaseImpl extends ApiSettingModelImpl + implements ApiSetting { + /* + * NOTE FOR DEVELOPERS: + * + * Never modify or reference this class directly. All methods that expect a api setting model instance should use the {@link ApiSetting} interface instead. + */ + @Override + public void persist() throws SystemException { + if (this.isNew()) { + ApiSettingLocalServiceUtil.addApiSetting(this); + } + else { + ApiSettingLocalServiceUtil.updateApiSetting(this); + } + } +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/ApiSettingCacheModel.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/ApiSettingCacheModel.java new file mode 100644 index 00000000..1f3d3910 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/ApiSettingCacheModel.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) 2000-present 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.model.impl; + +import com.liferay.portal.kernel.util.StringBundler; +import com.liferay.portal.kernel.util.StringPool; +import com.liferay.portal.model.CacheModel; + +import it.mwg.sicilia.sue.model.ApiSetting; + +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; + +/** + * The cache model class for representing ApiSetting in entity cache. + * + * @author Manifattura Web Group Srl + * @see ApiSetting + * @generated + */ +public class ApiSettingCacheModel implements CacheModel, + Externalizable { + @Override + public String toString() { + StringBundler sb = new StringBundler(9); + + sb.append("{id="); + sb.append(id); + sb.append(", companyId="); + sb.append(companyId); + sb.append(", key="); + sb.append(key); + sb.append(", value="); + sb.append(value); + sb.append("}"); + + return sb.toString(); + } + + @Override + public ApiSetting toEntityModel() { + ApiSettingImpl apiSettingImpl = new ApiSettingImpl(); + + apiSettingImpl.setId(id); + apiSettingImpl.setCompanyId(companyId); + apiSettingImpl.setKey(key); + + if (value == null) { + apiSettingImpl.setValue(StringPool.BLANK); + } + else { + apiSettingImpl.setValue(value); + } + + apiSettingImpl.resetOriginalValues(); + + return apiSettingImpl; + } + + @Override + public void readExternal(ObjectInput objectInput) throws IOException { + id = objectInput.readLong(); + companyId = objectInput.readLong(); + key = objectInput.readLong(); + value = objectInput.readUTF(); + } + + @Override + public void writeExternal(ObjectOutput objectOutput) + throws IOException { + objectOutput.writeLong(id); + objectOutput.writeLong(companyId); + objectOutput.writeLong(key); + + if (value == null) { + objectOutput.writeUTF(StringPool.BLANK); + } + else { + objectOutput.writeUTF(value); + } + } + + public long id; + public long companyId; + public long key; + public String value; +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/ApiSettingImpl.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/ApiSettingImpl.java new file mode 100644 index 00000000..f85dec6c --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/ApiSettingImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2000-present 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.model.impl; + +/** + * The extended model implementation for the ApiSetting service. Represents a row in the + * "sicilia_sue_ApiSetting" database table, with each column mapped to a property of this class. + * + *

+ * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.mwg.sicilia.sue.model.ApiSetting} interface. + *

+ * + * @author Manifattura Web Group Srl + */ +@SuppressWarnings("serial") +public class ApiSettingImpl extends ApiSettingBaseImpl { + /* + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a api setting model instance + * should use the {@link it.mwg.sicilia.sue.model.ApiSetting} interface instead. + */ + public ApiSettingImpl() { + } +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/ApiSettingModelImpl.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/ApiSettingModelImpl.java new file mode 100644 index 00000000..fc4b84bd --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/ApiSettingModelImpl.java @@ -0,0 +1,460 @@ +/** + * Copyright (c) 2000-present 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.model.impl; + +import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler; +import com.liferay.portal.kernel.json.JSON; +import com.liferay.portal.kernel.util.GetterUtil; +import com.liferay.portal.kernel.util.ProxyUtil; +import com.liferay.portal.kernel.util.StringBundler; +import com.liferay.portal.kernel.util.StringPool; +import com.liferay.portal.model.CacheModel; +import com.liferay.portal.model.impl.BaseModelImpl; +import com.liferay.portal.service.ServiceContext; + +import com.liferay.portlet.expando.model.ExpandoBridge; +import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil; + +import it.mwg.sicilia.sue.model.ApiSetting; +import it.mwg.sicilia.sue.model.ApiSettingModel; +import it.mwg.sicilia.sue.model.ApiSettingSoap; + +import java.io.Serializable; + +import java.sql.Types; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * The base model implementation for the ApiSetting service. Represents a row in the "sicilia_sue_ApiSetting" database table, with each column mapped to a property of this class. + * + *

+ * This implementation and its corresponding interface {@link it.mwg.sicilia.sue.model.ApiSettingModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link ApiSettingImpl}. + *

+ * + * @author Manifattura Web Group Srl + * @see ApiSettingImpl + * @see it.mwg.sicilia.sue.model.ApiSetting + * @see it.mwg.sicilia.sue.model.ApiSettingModel + * @generated + */ +@JSON(strict = true) +public class ApiSettingModelImpl extends BaseModelImpl + implements ApiSettingModel { + /* + * NOTE FOR DEVELOPERS: + * + * Never modify or reference this class directly. All methods that expect a api setting model instance should use the {@link it.mwg.sicilia.sue.model.ApiSetting} interface instead. + */ + public static final String TABLE_NAME = "sicilia_sue_ApiSetting"; + public static final Object[][] TABLE_COLUMNS = { + { "id_", Types.BIGINT }, + { "companyId", Types.BIGINT }, + { "key_", Types.BIGINT }, + { "value", Types.VARCHAR } + }; + public static final String TABLE_SQL_CREATE = "create table sicilia_sue_ApiSetting (id_ LONG not null primary key,companyId LONG,key_ LONG,value STRING null)"; + public static final String TABLE_SQL_DROP = "drop table sicilia_sue_ApiSetting"; + public static final String ORDER_BY_JPQL = " ORDER BY apiSetting.id ASC"; + public static final String ORDER_BY_SQL = " ORDER BY sicilia_sue_ApiSetting.id_ ASC"; + public static final String DATA_SOURCE = "liferayDataSource"; + public static final String SESSION_FACTORY = "liferaySessionFactory"; + public static final String TX_MANAGER = "liferayTransactionManager"; + public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get( + "value.object.entity.cache.enabled.it.mwg.sicilia.sue.model.ApiSetting"), + true); + public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get( + "value.object.finder.cache.enabled.it.mwg.sicilia.sue.model.ApiSetting"), + true); + public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get( + "value.object.column.bitmask.enabled.it.mwg.sicilia.sue.model.ApiSetting"), + true); + public static long COMPANYID_COLUMN_BITMASK = 1L; + public static long KEY_COLUMN_BITMASK = 2L; + public static long ID_COLUMN_BITMASK = 4L; + + /** + * Converts the soap model instance into a normal model instance. + * + * @param soapModel the soap model instance to convert + * @return the normal model instance + */ + public static ApiSetting toModel(ApiSettingSoap soapModel) { + if (soapModel == null) { + return null; + } + + ApiSetting model = new ApiSettingImpl(); + + model.setId(soapModel.getId()); + model.setCompanyId(soapModel.getCompanyId()); + model.setKey(soapModel.getKey()); + model.setValue(soapModel.getValue()); + + return model; + } + + /** + * Converts the soap model instances into normal model instances. + * + * @param soapModels the soap model instances to convert + * @return the normal model instances + */ + public static List toModels(ApiSettingSoap[] soapModels) { + if (soapModels == null) { + return null; + } + + List models = new ArrayList(soapModels.length); + + for (ApiSettingSoap soapModel : soapModels) { + models.add(toModel(soapModel)); + } + + return models; + } + + public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get( + "lock.expiration.time.it.mwg.sicilia.sue.model.ApiSetting")); + + public ApiSettingModelImpl() { + } + + @Override + public long getPrimaryKey() { + return _id; + } + + @Override + public void setPrimaryKey(long primaryKey) { + setId(primaryKey); + } + + @Override + public Serializable getPrimaryKeyObj() { + return _id; + } + + @Override + public void setPrimaryKeyObj(Serializable primaryKeyObj) { + setPrimaryKey(((Long)primaryKeyObj).longValue()); + } + + @Override + public Class getModelClass() { + return ApiSetting.class; + } + + @Override + public String getModelClassName() { + return ApiSetting.class.getName(); + } + + @Override + public Map getModelAttributes() { + Map attributes = new HashMap(); + + attributes.put("id", getId()); + attributes.put("companyId", getCompanyId()); + attributes.put("key", getKey()); + attributes.put("value", getValue()); + + return attributes; + } + + @Override + public void setModelAttributes(Map attributes) { + Long id = (Long)attributes.get("id"); + + if (id != null) { + setId(id); + } + + Long companyId = (Long)attributes.get("companyId"); + + if (companyId != null) { + setCompanyId(companyId); + } + + Long key = (Long)attributes.get("key"); + + if (key != null) { + setKey(key); + } + + String value = (String)attributes.get("value"); + + if (value != null) { + setValue(value); + } + } + + @JSON + @Override + public long getId() { + return _id; + } + + @Override + public void setId(long id) { + _id = id; + } + + @JSON + @Override + public long getCompanyId() { + return _companyId; + } + + @Override + public void setCompanyId(long companyId) { + _columnBitmask |= COMPANYID_COLUMN_BITMASK; + + if (!_setOriginalCompanyId) { + _setOriginalCompanyId = true; + + _originalCompanyId = _companyId; + } + + _companyId = companyId; + } + + public long getOriginalCompanyId() { + return _originalCompanyId; + } + + @JSON + @Override + public long getKey() { + return _key; + } + + @Override + public void setKey(long key) { + _columnBitmask |= KEY_COLUMN_BITMASK; + + if (!_setOriginalKey) { + _setOriginalKey = true; + + _originalKey = _key; + } + + _key = key; + } + + public long getOriginalKey() { + return _originalKey; + } + + @JSON + @Override + public String getValue() { + if (_value == null) { + return StringPool.BLANK; + } + else { + return _value; + } + } + + @Override + public void setValue(String value) { + _value = value; + } + + public long getColumnBitmask() { + return _columnBitmask; + } + + @Override + public ExpandoBridge getExpandoBridge() { + return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(), + ApiSetting.class.getName(), getPrimaryKey()); + } + + @Override + public void setExpandoBridgeAttributes(ServiceContext serviceContext) { + ExpandoBridge expandoBridge = getExpandoBridge(); + + expandoBridge.setAttributes(serviceContext); + } + + @Override + public ApiSetting toEscapedModel() { + if (_escapedModel == null) { + _escapedModel = (ApiSetting)ProxyUtil.newProxyInstance(_classLoader, + _escapedModelInterfaces, new AutoEscapeBeanHandler(this)); + } + + return _escapedModel; + } + + @Override + public Object clone() { + ApiSettingImpl apiSettingImpl = new ApiSettingImpl(); + + apiSettingImpl.setId(getId()); + apiSettingImpl.setCompanyId(getCompanyId()); + apiSettingImpl.setKey(getKey()); + apiSettingImpl.setValue(getValue()); + + apiSettingImpl.resetOriginalValues(); + + return apiSettingImpl; + } + + @Override + public int compareTo(ApiSetting apiSetting) { + long primaryKey = apiSetting.getPrimaryKey(); + + if (getPrimaryKey() < primaryKey) { + return -1; + } + else if (getPrimaryKey() > primaryKey) { + return 1; + } + else { + return 0; + } + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + + if (!(obj instanceof ApiSetting)) { + return false; + } + + ApiSetting apiSetting = (ApiSetting)obj; + + long primaryKey = apiSetting.getPrimaryKey(); + + if (getPrimaryKey() == primaryKey) { + return true; + } + else { + return false; + } + } + + @Override + public int hashCode() { + return (int)getPrimaryKey(); + } + + @Override + public void resetOriginalValues() { + ApiSettingModelImpl apiSettingModelImpl = this; + + apiSettingModelImpl._originalCompanyId = apiSettingModelImpl._companyId; + + apiSettingModelImpl._setOriginalCompanyId = false; + + apiSettingModelImpl._originalKey = apiSettingModelImpl._key; + + apiSettingModelImpl._setOriginalKey = false; + + apiSettingModelImpl._columnBitmask = 0; + } + + @Override + public CacheModel toCacheModel() { + ApiSettingCacheModel apiSettingCacheModel = new ApiSettingCacheModel(); + + apiSettingCacheModel.id = getId(); + + apiSettingCacheModel.companyId = getCompanyId(); + + apiSettingCacheModel.key = getKey(); + + apiSettingCacheModel.value = getValue(); + + String value = apiSettingCacheModel.value; + + if ((value != null) && (value.length() == 0)) { + apiSettingCacheModel.value = null; + } + + return apiSettingCacheModel; + } + + @Override + public String toString() { + StringBundler sb = new StringBundler(9); + + sb.append("{id="); + sb.append(getId()); + sb.append(", companyId="); + sb.append(getCompanyId()); + sb.append(", key="); + sb.append(getKey()); + sb.append(", value="); + sb.append(getValue()); + sb.append("}"); + + return sb.toString(); + } + + @Override + public String toXmlString() { + StringBundler sb = new StringBundler(16); + + sb.append(""); + sb.append("it.mwg.sicilia.sue.model.ApiSetting"); + sb.append(""); + + sb.append( + "id"); + sb.append( + "companyId"); + sb.append( + "key"); + sb.append( + "value"); + + sb.append(""); + + return sb.toString(); + } + + private static ClassLoader _classLoader = ApiSetting.class.getClassLoader(); + private static Class[] _escapedModelInterfaces = new Class[] { + ApiSetting.class + }; + private long _id; + private long _companyId; + private long _originalCompanyId; + private boolean _setOriginalCompanyId; + private long _key; + private long _originalKey; + private boolean _setOriginalKey; + private String _value; + private long _columnBitmask; + private ApiSetting _escapedModel; +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloCacheModel.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloCacheModel.java index bf50585a..e8fcf146 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloCacheModel.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloCacheModel.java @@ -38,7 +38,7 @@ public class SportelloCacheModel implements CacheModel, Externalizable { @Override public String toString() { - StringBundler sb = new StringBundler(21); + StringBundler sb = new StringBundler(23); sb.append("{sportelloId="); sb.append(sportelloId); @@ -54,12 +54,14 @@ public class SportelloCacheModel implements CacheModel, sb.append(createDate); sb.append(", modifiedDate="); sb.append(modifiedDate); - sb.append(", loginName="); - sb.append(loginName); - sb.append(", password="); - sb.append(password); - sb.append(", nonce="); - sb.append(nonce); + sb.append(", email="); + sb.append(email); + sb.append(", comuneId="); + sb.append(comuneId); + sb.append(", apiKey="); + sb.append(apiKey); + sb.append(", attivo="); + sb.append(attivo); sb.append("}"); return sb.toString(); @@ -95,27 +97,24 @@ public class SportelloCacheModel implements CacheModel, sportelloImpl.setModifiedDate(new Date(modifiedDate)); } - if (loginName == null) { - sportelloImpl.setLoginName(StringPool.BLANK); + if (email == null) { + sportelloImpl.setEmail(StringPool.BLANK); } else { - sportelloImpl.setLoginName(loginName); + sportelloImpl.setEmail(email); } - if (password == null) { - sportelloImpl.setPassword(StringPool.BLANK); - } - else { - sportelloImpl.setPassword(password); - } + sportelloImpl.setComuneId(comuneId); - if (nonce == null) { - sportelloImpl.setNonce(StringPool.BLANK); + if (apiKey == null) { + sportelloImpl.setApiKey(StringPool.BLANK); } else { - sportelloImpl.setNonce(nonce); + sportelloImpl.setApiKey(apiKey); } + sportelloImpl.setAttivo(attivo); + sportelloImpl.resetOriginalValues(); return sportelloImpl; @@ -130,9 +129,10 @@ public class SportelloCacheModel implements CacheModel, userName = objectInput.readUTF(); createDate = objectInput.readLong(); modifiedDate = objectInput.readLong(); - loginName = objectInput.readUTF(); - password = objectInput.readUTF(); - nonce = objectInput.readUTF(); + email = objectInput.readUTF(); + comuneId = objectInput.readLong(); + apiKey = objectInput.readUTF(); + attivo = objectInput.readBoolean(); } @Override @@ -153,26 +153,23 @@ public class SportelloCacheModel implements CacheModel, objectOutput.writeLong(createDate); objectOutput.writeLong(modifiedDate); - if (loginName == null) { + if (email == null) { objectOutput.writeUTF(StringPool.BLANK); } else { - objectOutput.writeUTF(loginName); + objectOutput.writeUTF(email); } - if (password == null) { - objectOutput.writeUTF(StringPool.BLANK); - } - else { - objectOutput.writeUTF(password); - } + objectOutput.writeLong(comuneId); - if (nonce == null) { + if (apiKey == null) { objectOutput.writeUTF(StringPool.BLANK); } else { - objectOutput.writeUTF(nonce); + objectOutput.writeUTF(apiKey); } + + objectOutput.writeBoolean(attivo); } public long sportelloId; @@ -182,7 +179,8 @@ public class SportelloCacheModel implements CacheModel, public String userName; public long createDate; public long modifiedDate; - public String loginName; - public String password; - public String nonce; + public String email; + public long comuneId; + public String apiKey; + public boolean attivo; } \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloImpl.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloImpl.java index 395857db..df7f8716 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloImpl.java @@ -14,11 +14,22 @@ package it.mwg.sicilia.sue.model.impl; +import it.tref.liferay.portos.bo.model.Comune; +import it.tref.liferay.portos.bo.model.Provincia; +import it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil; +import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil; + +import com.liferay.portal.kernel.exception.PortalException; +import com.liferay.portal.kernel.exception.SystemException; +import com.liferay.portal.kernel.util.Validator; + /** - * The extended model implementation for the Sportello service. Represents a row in the "sicilia_sue_Sportello" database table, with each column mapped to a property of this class. + * The extended model implementation for the Sportello service. Represents a row in the + * "sicilia_sue_Sportello" database table, with each column mapped to a property of this class. * *

- * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link it.mwg.sicilia.sue.model.Sportello} interface. + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.mwg.sicilia.sue.model.Sportello} interface. *

* * @author Manifattura Web Group Srl @@ -26,10 +37,47 @@ package it.mwg.sicilia.sue.model.impl; @SuppressWarnings("serial") public class SportelloImpl extends SportelloBaseImpl { /* - * NOTE FOR DEVELOPERS: - * - * Never reference this class directly. All methods that expect a sportello model instance should use the {@link it.mwg.sicilia.sue.model.Sportello} interface instead. + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a sportello model instance + * should use the {@link it.mwg.sicilia.sue.model.Sportello} interface instead. */ + private Comune comune = null; + private Provincia provincia = null; + public SportelloImpl() { } + + @Override + public String getCodiceProvincia() throws PortalException, SystemException { + + return getComune().getCodiceProvincia(); + } + + @Override + public String getNomeComune() throws PortalException, SystemException { + + return getComune().getDenominazione(); + } + + @Override + public String getNomeProvincia() throws SystemException, PortalException { + + return getProvincia().getProvincia(); + } + + private synchronized Comune getComune() throws PortalException, SystemException { + + if (Validator.isNull(comune)) { + comune = ComuneLocalServiceUtil.getComune(getComuneId()); + } + return comune; + } + + private synchronized Provincia getProvincia() throws SystemException, PortalException { + + if (Validator.isNull(provincia)) { + provincia = ProvinciaLocalServiceUtil.fetchByC_C(getComune().getCompanyId(), getComune() + .getCodiceProvincia()); + } + return provincia; + } } \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloModelImpl.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloModelImpl.java index 75ef949f..0d5ba76c 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloModelImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloModelImpl.java @@ -73,11 +73,12 @@ public class SportelloModelImpl extends BaseModelImpl { "userName", Types.VARCHAR }, { "createDate", Types.TIMESTAMP }, { "modifiedDate", Types.TIMESTAMP }, - { "loginName", Types.VARCHAR }, - { "password_", Types.VARCHAR }, - { "nonce", Types.VARCHAR } + { "email", Types.VARCHAR }, + { "comuneId", Types.BIGINT }, + { "apiKey", Types.VARCHAR }, + { "attivo", Types.BOOLEAN } }; - 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(75) null,createDate DATE null,modifiedDate DATE null,loginName VARCHAR(75) null,password_ VARCHAR(75) null,nonce VARCHAR(75) null)"; + 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_DROP = "drop table sicilia_sue_Sportello"; public static final String ORDER_BY_JPQL = " ORDER BY sportello.sportelloId ASC"; public static final String ORDER_BY_SQL = " ORDER BY sicilia_sue_Sportello.sportelloId ASC"; @@ -93,7 +94,7 @@ public class SportelloModelImpl extends BaseModelImpl public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get( "value.object.column.bitmask.enabled.it.mwg.sicilia.sue.model.Sportello"), true); - public static long LOGINNAME_COLUMN_BITMASK = 1L; + public static long COMUNEID_COLUMN_BITMASK = 1L; public static long SPORTELLOID_COLUMN_BITMASK = 2L; /** @@ -116,9 +117,10 @@ public class SportelloModelImpl extends BaseModelImpl model.setUserName(soapModel.getUserName()); model.setCreateDate(soapModel.getCreateDate()); model.setModifiedDate(soapModel.getModifiedDate()); - model.setLoginName(soapModel.getLoginName()); - model.setPassword(soapModel.getPassword()); - model.setNonce(soapModel.getNonce()); + model.setEmail(soapModel.getEmail()); + model.setComuneId(soapModel.getComuneId()); + model.setApiKey(soapModel.getApiKey()); + model.setAttivo(soapModel.getAttivo()); return model; } @@ -190,9 +192,10 @@ public class SportelloModelImpl extends BaseModelImpl attributes.put("userName", getUserName()); attributes.put("createDate", getCreateDate()); attributes.put("modifiedDate", getModifiedDate()); - attributes.put("loginName", getLoginName()); - attributes.put("password", getPassword()); - attributes.put("nonce", getNonce()); + attributes.put("email", getEmail()); + attributes.put("comuneId", getComuneId()); + attributes.put("apiKey", getApiKey()); + attributes.put("attivo", getAttivo()); return attributes; } @@ -241,22 +244,28 @@ public class SportelloModelImpl extends BaseModelImpl setModifiedDate(modifiedDate); } - String loginName = (String)attributes.get("loginName"); + String email = (String)attributes.get("email"); - if (loginName != null) { - setLoginName(loginName); + if (email != null) { + setEmail(email); } - String password = (String)attributes.get("password"); + Long comuneId = (Long)attributes.get("comuneId"); - if (password != null) { - setPassword(password); + if (comuneId != null) { + setComuneId(comuneId); } - String nonce = (String)attributes.get("nonce"); + String apiKey = (String)attributes.get("apiKey"); - if (nonce != null) { - setNonce(nonce); + if (apiKey != null) { + setApiKey(apiKey); + } + + Boolean attivo = (Boolean)attributes.get("attivo"); + + if (attivo != null) { + setAttivo(attivo); } } @@ -354,60 +363,73 @@ public class SportelloModelImpl extends BaseModelImpl @JSON @Override - public String getLoginName() { - if (_loginName == null) { + public String getEmail() { + if (_email == null) { return StringPool.BLANK; } else { - return _loginName; + return _email; } } @Override - public void setLoginName(String loginName) { - _columnBitmask |= LOGINNAME_COLUMN_BITMASK; + public void setEmail(String email) { + _email = email; + } - if (_originalLoginName == null) { - _originalLoginName = _loginName; + @JSON + @Override + public long getComuneId() { + return _comuneId; + } + + @Override + public void setComuneId(long comuneId) { + _columnBitmask |= COMUNEID_COLUMN_BITMASK; + + if (!_setOriginalComuneId) { + _setOriginalComuneId = true; + + _originalComuneId = _comuneId; } - _loginName = loginName; + _comuneId = comuneId; } - public String getOriginalLoginName() { - return GetterUtil.getString(_originalLoginName); + public long getOriginalComuneId() { + return _originalComuneId; } @JSON @Override - public String getPassword() { - if (_password == null) { + public String getApiKey() { + if (_apiKey == null) { return StringPool.BLANK; } else { - return _password; + return _apiKey; } } @Override - public void setPassword(String password) { - _password = password; + public void setApiKey(String apiKey) { + _apiKey = apiKey; } @JSON @Override - public String getNonce() { - if (_nonce == null) { - return StringPool.BLANK; - } - else { - return _nonce; - } + public boolean getAttivo() { + return _attivo; + } + + @Override + public boolean isAttivo() { + return _attivo; } @Override - public void setNonce(String nonce) { - _nonce = nonce; + public void setAttivo(boolean attivo) { + _attivo = attivo; } public long getColumnBitmask() { @@ -448,9 +470,10 @@ public class SportelloModelImpl extends BaseModelImpl sportelloImpl.setUserName(getUserName()); sportelloImpl.setCreateDate(getCreateDate()); sportelloImpl.setModifiedDate(getModifiedDate()); - sportelloImpl.setLoginName(getLoginName()); - sportelloImpl.setPassword(getPassword()); - sportelloImpl.setNonce(getNonce()); + sportelloImpl.setEmail(getEmail()); + sportelloImpl.setComuneId(getComuneId()); + sportelloImpl.setApiKey(getApiKey()); + sportelloImpl.setAttivo(getAttivo()); sportelloImpl.resetOriginalValues(); @@ -503,7 +526,9 @@ public class SportelloModelImpl extends BaseModelImpl public void resetOriginalValues() { SportelloModelImpl sportelloModelImpl = this; - sportelloModelImpl._originalLoginName = sportelloModelImpl._loginName; + sportelloModelImpl._originalComuneId = sportelloModelImpl._comuneId; + + sportelloModelImpl._setOriginalComuneId = false; sportelloModelImpl._columnBitmask = 0; } @@ -546,36 +571,32 @@ public class SportelloModelImpl extends BaseModelImpl sportelloCacheModel.modifiedDate = Long.MIN_VALUE; } - sportelloCacheModel.loginName = getLoginName(); + sportelloCacheModel.email = getEmail(); - String loginName = sportelloCacheModel.loginName; + String email = sportelloCacheModel.email; - if ((loginName != null) && (loginName.length() == 0)) { - sportelloCacheModel.loginName = null; + if ((email != null) && (email.length() == 0)) { + sportelloCacheModel.email = null; } - sportelloCacheModel.password = getPassword(); + sportelloCacheModel.comuneId = getComuneId(); - String password = sportelloCacheModel.password; + sportelloCacheModel.apiKey = getApiKey(); - if ((password != null) && (password.length() == 0)) { - sportelloCacheModel.password = null; - } - - sportelloCacheModel.nonce = getNonce(); - - String nonce = sportelloCacheModel.nonce; + String apiKey = sportelloCacheModel.apiKey; - if ((nonce != null) && (nonce.length() == 0)) { - sportelloCacheModel.nonce = null; + if ((apiKey != null) && (apiKey.length() == 0)) { + sportelloCacheModel.apiKey = null; } + sportelloCacheModel.attivo = getAttivo(); + return sportelloCacheModel; } @Override public String toString() { - StringBundler sb = new StringBundler(21); + StringBundler sb = new StringBundler(23); sb.append("{sportelloId="); sb.append(getSportelloId()); @@ -591,12 +612,14 @@ public class SportelloModelImpl extends BaseModelImpl sb.append(getCreateDate()); sb.append(", modifiedDate="); sb.append(getModifiedDate()); - sb.append(", loginName="); - sb.append(getLoginName()); - sb.append(", password="); - sb.append(getPassword()); - sb.append(", nonce="); - sb.append(getNonce()); + sb.append(", email="); + sb.append(getEmail()); + sb.append(", comuneId="); + sb.append(getComuneId()); + sb.append(", apiKey="); + sb.append(getApiKey()); + sb.append(", attivo="); + sb.append(getAttivo()); sb.append("}"); return sb.toString(); @@ -604,7 +627,7 @@ public class SportelloModelImpl extends BaseModelImpl @Override public String toXmlString() { - StringBundler sb = new StringBundler(34); + StringBundler sb = new StringBundler(37); sb.append(""); sb.append("it.mwg.sicilia.sue.model.Sportello"); @@ -639,16 +662,20 @@ public class SportelloModelImpl extends BaseModelImpl sb.append(getModifiedDate()); sb.append("]]>"); sb.append( - "loginNameemail"); + sb.append( + "comuneId"); sb.append( - "passwordapiKey"); sb.append( - "nonceattivo"); sb.append(""); @@ -668,10 +695,12 @@ public class SportelloModelImpl extends BaseModelImpl private String _userName; private Date _createDate; private Date _modifiedDate; - private String _loginName; - private String _originalLoginName; - private String _password; - private String _nonce; + private String _email; + private long _comuneId; + private long _originalComuneId; + private boolean _setOriginalComuneId; + private String _apiKey; + private boolean _attivo; private long _columnBitmask; private Sportello _escapedModel; } \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/portlet/SueAdministrationPortlet.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/portlet/SueAdministrationPortlet.java index 3a4b43c8..ed19e566 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/portlet/SueAdministrationPortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/portlet/SueAdministrationPortlet.java @@ -1,7 +1,122 @@ package it.mwg.sicilia.sue.portlet; +import it.mwg.sicilia.sue.model.Sportello; +import it.mwg.sicilia.sue.service.SportelloLocalServiceUtil; +import it.tref.liferay.portos.bo.model.Comune; +import it.tref.liferay.portos.bo.model.Provincia; +import it.tref.liferay.portos.bo.model.Territorio; +import it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil; +import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil; +import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil; + +import java.io.IOException; +import java.util.Date; + +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.PortletException; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import javax.servlet.http.HttpServletResponse; + +import com.liferay.counter.service.CounterLocalServiceUtil; +import com.liferay.portal.kernel.exception.PortalException; +import com.liferay.portal.kernel.exception.SystemException; +import com.liferay.portal.kernel.json.JSONArray; +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.portlet.PortletResponseUtil; +import com.liferay.portal.kernel.util.ContentTypes; +import com.liferay.portal.kernel.util.ParamUtil; +import com.liferay.portal.kernel.util.StringPool; +import com.liferay.portal.kernel.util.Validator; +import com.liferay.portal.model.User; +import com.liferay.portal.service.ServiceContext; +import com.liferay.portal.service.ServiceContextFactory; +import com.liferay.portal.service.UserLocalServiceUtil; import com.liferay.util.bridges.mvc.MVCPortlet; public class SueAdministrationPortlet extends MVCPortlet { + public static final String RESOURCE_PROVINCE = "province"; + public static final String RESOURCE_COMUNI = "comuni"; + + private static final Log _log = LogFactoryUtil.getLog(SueAdministrationPortlet.class); + + public void editSportello(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException, + PortalException { + + Date data = new Date(); + ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); + User user = UserLocalServiceUtil.getUser(serviceContext.getUserId()); + long sportelloId = ParamUtil.getLong(actionRequest, "sportelloId", 0); + long comuneId = ParamUtil.getLong(actionRequest, "comune", 0); + Territorio territorio = TerritorioLocalServiceUtil.findByComuneId(comuneId, 0, 1).get(0); + String email = ParamUtil.getString(actionRequest, "email"); + String apiKey = ParamUtil.getString(actionRequest, "apiKey"); + _log.info("apiKey = " + apiKey); + Sportello sportello = null; + if (sportelloId != 0) { + try { + sportello = SportelloLocalServiceUtil.getSportello(sportelloId); + } catch (PortalException | SystemException e) { + + } + } + if (Validator.isNull(sportello)) { + sportello = SportelloLocalServiceUtil.createSportello(CounterLocalServiceUtil.increment(Sportello.class + .getName())); + sportello.setGroupId(territorio.getGroupId()); + sportello.setCompanyId(territorio.getCompanyId()); + sportello.setCreateDate(data); + } + sportello.setUserId(user.getUserId()); + sportello.setUserName(user.getFullName()); + sportello.setModifiedDate(data); + sportello.setComuneId(comuneId); + sportello.setEmail(email); + sportello.setApiKey(apiKey); + SportelloLocalServiceUtil.updateSportello(sportello); + } + + @Override + public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException, + PortletException { + + String id = resourceRequest.getResourceID(); + try { + ServiceContext serviceContext = ServiceContextFactory.getInstance(resourceRequest); + long companyId = serviceContext.getCompanyId(); + JSONArray array = JSONFactoryUtil.createJSONArray(); + switch (id) { + case RESOURCE_PROVINCE: + for (String codice : TerritorioLocalServiceUtil.getActiveProvince()) { + Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(companyId, codice); + array.put(JSONFactoryUtil.createJSONObject().put("id", codice) + .put("desc", provincia.getSigla() + " - " + provincia.getProvincia())); + } + resourceResponse.setContentType(ContentTypes.APPLICATION_JSON); + resourceResponse.setCharacterEncoding(StringPool.UTF8); + PortletResponseUtil.write(resourceResponse, array.toString()); + break; + case RESOURCE_COMUNI: + String codice = ParamUtil.getString(resourceRequest, "codice"); + for (long comuneId : TerritorioLocalServiceUtil.getActiveComuniByCodiceProvincia(codice)) { + Comune comune = ComuneLocalServiceUtil.getComune(comuneId); + array.put(JSONFactoryUtil.createJSONObject().put("id", comuneId) + .put("desc", comune.getDenominazione())); + } + resourceResponse.setContentType(ContentTypes.APPLICATION_JSON); + resourceResponse.setCharacterEncoding(StringPool.UTF8); + PortletResponseUtil.write(resourceResponse, array.toString()); + break; + default: + resourceResponse.setProperty(ResourceResponse.HTTP_STATUS_CODE, + String.valueOf(HttpServletResponse.SC_NOT_FOUND)); + } + } catch (PortalException | SystemException e) { + throw new IOException(e); + } + } } diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/ApiSettingLocalServiceBaseImpl.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/ApiSettingLocalServiceBaseImpl.java new file mode 100644 index 00000000..b3817a3d --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/ApiSettingLocalServiceBaseImpl.java @@ -0,0 +1,598 @@ +/** + * Copyright (c) 2000-present 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.service.base; + +import com.liferay.portal.kernel.bean.BeanReference; +import com.liferay.portal.kernel.bean.IdentifiableBean; +import com.liferay.portal.kernel.dao.jdbc.SqlUpdate; +import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil; +import com.liferay.portal.kernel.dao.orm.DynamicQuery; +import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil; +import com.liferay.portal.kernel.dao.orm.Projection; +import com.liferay.portal.kernel.exception.PortalException; +import com.liferay.portal.kernel.exception.SystemException; +import com.liferay.portal.kernel.search.Indexable; +import com.liferay.portal.kernel.search.IndexableType; +import com.liferay.portal.kernel.util.OrderByComparator; +import com.liferay.portal.model.PersistedModel; +import com.liferay.portal.service.BaseLocalServiceImpl; +import com.liferay.portal.service.PersistedModelLocalServiceRegistryUtil; +import com.liferay.portal.service.persistence.UserPersistence; + +import it.mwg.sicilia.sue.model.ApiSetting; +import it.mwg.sicilia.sue.service.ApiSettingLocalService; +import it.mwg.sicilia.sue.service.persistence.ApiSettingPersistence; +import it.mwg.sicilia.sue.service.persistence.SportelloPersistence; + +import java.io.Serializable; + +import java.util.List; + +import javax.sql.DataSource; + +/** + * Provides the base implementation for the api setting local service. + * + *

+ * This implementation exists only as a container for the default service methods generated by ServiceBuilder. All custom service methods should be put in {@link it.mwg.sicilia.sue.service.impl.ApiSettingLocalServiceImpl}. + *

+ * + * @author Manifattura Web Group Srl + * @see it.mwg.sicilia.sue.service.impl.ApiSettingLocalServiceImpl + * @see it.mwg.sicilia.sue.service.ApiSettingLocalServiceUtil + * @generated + */ +public abstract class ApiSettingLocalServiceBaseImpl + extends BaseLocalServiceImpl implements ApiSettingLocalService, + IdentifiableBean { + /* + * NOTE FOR DEVELOPERS: + * + * Never modify or reference this class directly. Always use {@link it.mwg.sicilia.sue.service.ApiSettingLocalServiceUtil} to access the api setting local service. + */ + + /** + * Adds the api setting to the database. Also notifies the appropriate model listeners. + * + * @param apiSetting the api setting + * @return the api setting that was added + * @throws SystemException if a system exception occurred + */ + @Indexable(type = IndexableType.REINDEX) + @Override + public ApiSetting addApiSetting(ApiSetting apiSetting) + throws SystemException { + apiSetting.setNew(true); + + return apiSettingPersistence.update(apiSetting); + } + + /** + * Creates a new api setting with the primary key. Does not add the api setting to the database. + * + * @param id the primary key for the new api setting + * @return the new api setting + */ + @Override + public ApiSetting createApiSetting(long id) { + return apiSettingPersistence.create(id); + } + + /** + * Deletes the api setting with the primary key from the database. Also notifies the appropriate model listeners. + * + * @param id the primary key of the api setting + * @return the api setting that was removed + * @throws PortalException if a api setting with the primary key could not be found + * @throws SystemException if a system exception occurred + */ + @Indexable(type = IndexableType.DELETE) + @Override + public ApiSetting deleteApiSetting(long id) + throws PortalException, SystemException { + return apiSettingPersistence.remove(id); + } + + /** + * Deletes the api setting from the database. Also notifies the appropriate model listeners. + * + * @param apiSetting the api setting + * @return the api setting that was removed + * @throws SystemException if a system exception occurred + */ + @Indexable(type = IndexableType.DELETE) + @Override + public ApiSetting deleteApiSetting(ApiSetting apiSetting) + throws SystemException { + return apiSettingPersistence.remove(apiSetting); + } + + @Override + public DynamicQuery dynamicQuery() { + Class clazz = getClass(); + + return DynamicQueryFactoryUtil.forClass(ApiSetting.class, + clazz.getClassLoader()); + } + + /** + * Performs a dynamic query on the database and returns the matching rows. + * + * @param dynamicQuery the dynamic query + * @return the matching rows + * @throws SystemException if a system exception occurred + */ + @Override + @SuppressWarnings("rawtypes") + public List dynamicQuery(DynamicQuery dynamicQuery) + throws SystemException { + return apiSettingPersistence.findWithDynamicQuery(dynamicQuery); + } + + /** + * Performs a dynamic query on the database and returns a range of the matching rows. + * + *

+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. + *

+ * + * @param dynamicQuery the dynamic query + * @param start the lower bound of the range of model instances + * @param end the upper bound of the range of model instances (not inclusive) + * @return the range of matching rows + * @throws SystemException if a system exception occurred + */ + @Override + @SuppressWarnings("rawtypes") + public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end) + throws SystemException { + return apiSettingPersistence.findWithDynamicQuery(dynamicQuery, start, + end); + } + + /** + * Performs a dynamic query on the database and returns an ordered range of the matching rows. + * + *

+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. + *

+ * + * @param dynamicQuery the dynamic query + * @param start the lower bound of the range of model instances + * @param end the upper bound of the range of model instances (not inclusive) + * @param orderByComparator the comparator to order the results by (optionally null) + * @return the ordered range of matching rows + * @throws SystemException if a system exception occurred + */ + @Override + @SuppressWarnings("rawtypes") + public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end, + OrderByComparator orderByComparator) throws SystemException { + return apiSettingPersistence.findWithDynamicQuery(dynamicQuery, start, + end, orderByComparator); + } + + /** + * Returns the number of rows that match the dynamic query. + * + * @param dynamicQuery the dynamic query + * @return the number of rows that match the dynamic query + * @throws SystemException if a system exception occurred + */ + @Override + public long dynamicQueryCount(DynamicQuery dynamicQuery) + throws SystemException { + return apiSettingPersistence.countWithDynamicQuery(dynamicQuery); + } + + /** + * Returns the number of rows that match the dynamic query. + * + * @param dynamicQuery the dynamic query + * @param projection the projection to apply to the query + * @return the number of rows that match the dynamic query + * @throws SystemException if a system exception occurred + */ + @Override + public long dynamicQueryCount(DynamicQuery dynamicQuery, + Projection projection) throws SystemException { + return apiSettingPersistence.countWithDynamicQuery(dynamicQuery, + projection); + } + + @Override + public ApiSetting fetchApiSetting(long id) throws SystemException { + return apiSettingPersistence.fetchByPrimaryKey(id); + } + + /** + * Returns the api setting with the primary key. + * + * @param id the primary key of the api setting + * @return the api setting + * @throws PortalException if a api setting with the primary key could not be found + * @throws SystemException if a system exception occurred + */ + @Override + public ApiSetting getApiSetting(long id) + throws PortalException, SystemException { + return apiSettingPersistence.findByPrimaryKey(id); + } + + @Override + public PersistedModel getPersistedModel(Serializable primaryKeyObj) + throws PortalException, SystemException { + return apiSettingPersistence.findByPrimaryKey(primaryKeyObj); + } + + /** + * Returns a range of all the api settings. + * + *

+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. + *

+ * + * @param start the lower bound of the range of api settings + * @param end the upper bound of the range of api settings (not inclusive) + * @return the range of api settings + * @throws SystemException if a system exception occurred + */ + @Override + public List getApiSettings(int start, int end) + throws SystemException { + return apiSettingPersistence.findAll(start, end); + } + + /** + * Returns the number of api settings. + * + * @return the number of api settings + * @throws SystemException if a system exception occurred + */ + @Override + public int getApiSettingsCount() throws SystemException { + return apiSettingPersistence.countAll(); + } + + /** + * Updates the api setting in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. + * + * @param apiSetting the api setting + * @return the api setting that was updated + * @throws SystemException if a system exception occurred + */ + @Indexable(type = IndexableType.REINDEX) + @Override + public ApiSetting updateApiSetting(ApiSetting apiSetting) + throws SystemException { + return apiSettingPersistence.update(apiSetting); + } + + /** + * Returns the api setting local service. + * + * @return the api setting local service + */ + public it.mwg.sicilia.sue.service.ApiSettingLocalService getApiSettingLocalService() { + return apiSettingLocalService; + } + + /** + * Sets the api setting local service. + * + * @param apiSettingLocalService the api setting local service + */ + public void setApiSettingLocalService( + it.mwg.sicilia.sue.service.ApiSettingLocalService apiSettingLocalService) { + this.apiSettingLocalService = apiSettingLocalService; + } + + /** + * Returns the api setting remote service. + * + * @return the api setting remote service + */ + public it.mwg.sicilia.sue.service.ApiSettingService getApiSettingService() { + return apiSettingService; + } + + /** + * Sets the api setting remote service. + * + * @param apiSettingService the api setting remote service + */ + public void setApiSettingService( + it.mwg.sicilia.sue.service.ApiSettingService apiSettingService) { + this.apiSettingService = apiSettingService; + } + + /** + * Returns the api setting persistence. + * + * @return the api setting persistence + */ + public ApiSettingPersistence getApiSettingPersistence() { + return apiSettingPersistence; + } + + /** + * Sets the api setting persistence. + * + * @param apiSettingPersistence the api setting persistence + */ + public void setApiSettingPersistence( + ApiSettingPersistence apiSettingPersistence) { + this.apiSettingPersistence = apiSettingPersistence; + } + + /** + * Returns the sportello local service. + * + * @return the sportello local service + */ + public it.mwg.sicilia.sue.service.SportelloLocalService getSportelloLocalService() { + return sportelloLocalService; + } + + /** + * Sets the sportello local service. + * + * @param sportelloLocalService the sportello local service + */ + public void setSportelloLocalService( + it.mwg.sicilia.sue.service.SportelloLocalService sportelloLocalService) { + this.sportelloLocalService = sportelloLocalService; + } + + /** + * Returns the sportello remote service. + * + * @return the sportello remote service + */ + public it.mwg.sicilia.sue.service.SportelloService getSportelloService() { + return sportelloService; + } + + /** + * Sets the sportello remote service. + * + * @param sportelloService the sportello remote service + */ + public void setSportelloService( + it.mwg.sicilia.sue.service.SportelloService sportelloService) { + this.sportelloService = sportelloService; + } + + /** + * Returns the sportello persistence. + * + * @return the sportello persistence + */ + public SportelloPersistence getSportelloPersistence() { + return sportelloPersistence; + } + + /** + * Sets the sportello persistence. + * + * @param sportelloPersistence the sportello persistence + */ + public void setSportelloPersistence( + SportelloPersistence sportelloPersistence) { + this.sportelloPersistence = sportelloPersistence; + } + + /** + * Returns the counter local service. + * + * @return the counter local service + */ + public com.liferay.counter.service.CounterLocalService getCounterLocalService() { + return counterLocalService; + } + + /** + * Sets the counter local service. + * + * @param counterLocalService the counter local service + */ + public void setCounterLocalService( + com.liferay.counter.service.CounterLocalService counterLocalService) { + this.counterLocalService = counterLocalService; + } + + /** + * Returns the resource local service. + * + * @return the resource local service + */ + public com.liferay.portal.service.ResourceLocalService getResourceLocalService() { + return resourceLocalService; + } + + /** + * Sets the resource local service. + * + * @param resourceLocalService the resource local service + */ + public void setResourceLocalService( + com.liferay.portal.service.ResourceLocalService resourceLocalService) { + this.resourceLocalService = resourceLocalService; + } + + /** + * Returns the user local service. + * + * @return the user local service + */ + public com.liferay.portal.service.UserLocalService getUserLocalService() { + return userLocalService; + } + + /** + * Sets the user local service. + * + * @param userLocalService the user local service + */ + public void setUserLocalService( + com.liferay.portal.service.UserLocalService userLocalService) { + this.userLocalService = userLocalService; + } + + /** + * Returns the user remote service. + * + * @return the user remote service + */ + public com.liferay.portal.service.UserService getUserService() { + return userService; + } + + /** + * Sets the user remote service. + * + * @param userService the user remote service + */ + public void setUserService( + com.liferay.portal.service.UserService userService) { + this.userService = userService; + } + + /** + * Returns the user persistence. + * + * @return the user persistence + */ + public UserPersistence getUserPersistence() { + return userPersistence; + } + + /** + * Sets the user persistence. + * + * @param userPersistence the user persistence + */ + public void setUserPersistence(UserPersistence userPersistence) { + this.userPersistence = userPersistence; + } + + public void afterPropertiesSet() { + Class clazz = getClass(); + + _classLoader = clazz.getClassLoader(); + + PersistedModelLocalServiceRegistryUtil.register("it.mwg.sicilia.sue.model.ApiSetting", + apiSettingLocalService); + } + + public void destroy() { + PersistedModelLocalServiceRegistryUtil.unregister( + "it.mwg.sicilia.sue.model.ApiSetting"); + } + + /** + * Returns the Spring bean ID for this bean. + * + * @return the Spring bean ID for this bean + */ + @Override + public String getBeanIdentifier() { + return _beanIdentifier; + } + + /** + * Sets the Spring bean ID for this bean. + * + * @param beanIdentifier the Spring bean ID for this bean + */ + @Override + public void setBeanIdentifier(String beanIdentifier) { + _beanIdentifier = beanIdentifier; + } + + @Override + public Object invokeMethod(String name, String[] parameterTypes, + Object[] arguments) throws Throwable { + Thread currentThread = Thread.currentThread(); + + ClassLoader contextClassLoader = currentThread.getContextClassLoader(); + + if (contextClassLoader != _classLoader) { + currentThread.setContextClassLoader(_classLoader); + } + + try { + return _clpInvoker.invokeMethod(name, parameterTypes, arguments); + } + finally { + if (contextClassLoader != _classLoader) { + currentThread.setContextClassLoader(contextClassLoader); + } + } + } + + protected Class getModelClass() { + return ApiSetting.class; + } + + protected String getModelClassName() { + return ApiSetting.class.getName(); + } + + /** + * Performs an SQL query. + * + * @param sql the sql query + */ + protected void runSQL(String sql) throws SystemException { + try { + DataSource dataSource = apiSettingPersistence.getDataSource(); + + SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource, + sql, new int[0]); + + sqlUpdate.update(); + } + catch (Exception e) { + throw new SystemException(e); + } + } + + @BeanReference(type = it.mwg.sicilia.sue.service.ApiSettingLocalService.class) + protected it.mwg.sicilia.sue.service.ApiSettingLocalService apiSettingLocalService; + @BeanReference(type = it.mwg.sicilia.sue.service.ApiSettingService.class) + protected it.mwg.sicilia.sue.service.ApiSettingService apiSettingService; + @BeanReference(type = ApiSettingPersistence.class) + protected ApiSettingPersistence apiSettingPersistence; + @BeanReference(type = it.mwg.sicilia.sue.service.SportelloLocalService.class) + protected it.mwg.sicilia.sue.service.SportelloLocalService sportelloLocalService; + @BeanReference(type = it.mwg.sicilia.sue.service.SportelloService.class) + protected it.mwg.sicilia.sue.service.SportelloService sportelloService; + @BeanReference(type = SportelloPersistence.class) + protected SportelloPersistence sportelloPersistence; + @BeanReference(type = com.liferay.counter.service.CounterLocalService.class) + protected com.liferay.counter.service.CounterLocalService counterLocalService; + @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class) + protected com.liferay.portal.service.ResourceLocalService resourceLocalService; + @BeanReference(type = com.liferay.portal.service.UserLocalService.class) + protected com.liferay.portal.service.UserLocalService userLocalService; + @BeanReference(type = com.liferay.portal.service.UserService.class) + protected com.liferay.portal.service.UserService userService; + @BeanReference(type = UserPersistence.class) + protected UserPersistence userPersistence; + private String _beanIdentifier; + private ClassLoader _classLoader; + private ApiSettingLocalServiceClpInvoker _clpInvoker = new ApiSettingLocalServiceClpInvoker(); +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/ApiSettingLocalServiceClpInvoker.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/ApiSettingLocalServiceClpInvoker.java new file mode 100644 index 00000000..ea185e7d --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/ApiSettingLocalServiceClpInvoker.java @@ -0,0 +1,286 @@ +/** + * Copyright (c) 2000-present 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.service.base; + +import it.mwg.sicilia.sue.service.ApiSettingLocalServiceUtil; + +import java.util.Arrays; + +/** + * @author Manifattura Web Group Srl + * @generated + */ +public class ApiSettingLocalServiceClpInvoker { + public ApiSettingLocalServiceClpInvoker() { + _methodName0 = "addApiSetting"; + + _methodParameterTypes0 = new String[] { + "it.mwg.sicilia.sue.model.ApiSetting" + }; + + _methodName1 = "createApiSetting"; + + _methodParameterTypes1 = new String[] { "long" }; + + _methodName2 = "deleteApiSetting"; + + _methodParameterTypes2 = new String[] { "long" }; + + _methodName3 = "deleteApiSetting"; + + _methodParameterTypes3 = new String[] { + "it.mwg.sicilia.sue.model.ApiSetting" + }; + + _methodName4 = "dynamicQuery"; + + _methodParameterTypes4 = new String[] { }; + + _methodName5 = "dynamicQuery"; + + _methodParameterTypes5 = new String[] { + "com.liferay.portal.kernel.dao.orm.DynamicQuery" + }; + + _methodName6 = "dynamicQuery"; + + _methodParameterTypes6 = new String[] { + "com.liferay.portal.kernel.dao.orm.DynamicQuery", "int", "int" + }; + + _methodName7 = "dynamicQuery"; + + _methodParameterTypes7 = new String[] { + "com.liferay.portal.kernel.dao.orm.DynamicQuery", "int", "int", + "com.liferay.portal.kernel.util.OrderByComparator" + }; + + _methodName8 = "dynamicQueryCount"; + + _methodParameterTypes8 = new String[] { + "com.liferay.portal.kernel.dao.orm.DynamicQuery" + }; + + _methodName9 = "dynamicQueryCount"; + + _methodParameterTypes9 = new String[] { + "com.liferay.portal.kernel.dao.orm.DynamicQuery", + "com.liferay.portal.kernel.dao.orm.Projection" + }; + + _methodName10 = "fetchApiSetting"; + + _methodParameterTypes10 = new String[] { "long" }; + + _methodName11 = "getApiSetting"; + + _methodParameterTypes11 = new String[] { "long" }; + + _methodName12 = "getPersistedModel"; + + _methodParameterTypes12 = new String[] { "java.io.Serializable" }; + + _methodName13 = "getApiSettings"; + + _methodParameterTypes13 = new String[] { "int", "int" }; + + _methodName14 = "getApiSettingsCount"; + + _methodParameterTypes14 = new String[] { }; + + _methodName15 = "updateApiSetting"; + + _methodParameterTypes15 = new String[] { + "it.mwg.sicilia.sue.model.ApiSetting" + }; + + _methodName40 = "getBeanIdentifier"; + + _methodParameterTypes40 = new String[] { }; + + _methodName41 = "setBeanIdentifier"; + + _methodParameterTypes41 = new String[] { "java.lang.String" }; + + _methodName46 = "get"; + + _methodParameterTypes46 = new String[] { "long", "long" }; + + _methodName47 = "set"; + + _methodParameterTypes47 = new String[] { + "long", "long", "java.lang.String" + }; + } + + public Object invokeMethod(String name, String[] parameterTypes, + Object[] arguments) throws Throwable { + if (_methodName0.equals(name) && + Arrays.deepEquals(_methodParameterTypes0, parameterTypes)) { + return ApiSettingLocalServiceUtil.addApiSetting((it.mwg.sicilia.sue.model.ApiSetting)arguments[0]); + } + + if (_methodName1.equals(name) && + Arrays.deepEquals(_methodParameterTypes1, parameterTypes)) { + return ApiSettingLocalServiceUtil.createApiSetting(((Long)arguments[0]).longValue()); + } + + if (_methodName2.equals(name) && + Arrays.deepEquals(_methodParameterTypes2, parameterTypes)) { + return ApiSettingLocalServiceUtil.deleteApiSetting(((Long)arguments[0]).longValue()); + } + + if (_methodName3.equals(name) && + Arrays.deepEquals(_methodParameterTypes3, parameterTypes)) { + return ApiSettingLocalServiceUtil.deleteApiSetting((it.mwg.sicilia.sue.model.ApiSetting)arguments[0]); + } + + if (_methodName4.equals(name) && + Arrays.deepEquals(_methodParameterTypes4, parameterTypes)) { + return ApiSettingLocalServiceUtil.dynamicQuery(); + } + + if (_methodName5.equals(name) && + Arrays.deepEquals(_methodParameterTypes5, parameterTypes)) { + return ApiSettingLocalServiceUtil.dynamicQuery((com.liferay.portal.kernel.dao.orm.DynamicQuery)arguments[0]); + } + + if (_methodName6.equals(name) && + Arrays.deepEquals(_methodParameterTypes6, parameterTypes)) { + return ApiSettingLocalServiceUtil.dynamicQuery((com.liferay.portal.kernel.dao.orm.DynamicQuery)arguments[0], + ((Integer)arguments[1]).intValue(), + ((Integer)arguments[2]).intValue()); + } + + if (_methodName7.equals(name) && + Arrays.deepEquals(_methodParameterTypes7, parameterTypes)) { + return ApiSettingLocalServiceUtil.dynamicQuery((com.liferay.portal.kernel.dao.orm.DynamicQuery)arguments[0], + ((Integer)arguments[1]).intValue(), + ((Integer)arguments[2]).intValue(), + (com.liferay.portal.kernel.util.OrderByComparator)arguments[3]); + } + + if (_methodName8.equals(name) && + Arrays.deepEquals(_methodParameterTypes8, parameterTypes)) { + return ApiSettingLocalServiceUtil.dynamicQueryCount((com.liferay.portal.kernel.dao.orm.DynamicQuery)arguments[0]); + } + + if (_methodName9.equals(name) && + Arrays.deepEquals(_methodParameterTypes9, parameterTypes)) { + return ApiSettingLocalServiceUtil.dynamicQueryCount((com.liferay.portal.kernel.dao.orm.DynamicQuery)arguments[0], + (com.liferay.portal.kernel.dao.orm.Projection)arguments[1]); + } + + if (_methodName10.equals(name) && + Arrays.deepEquals(_methodParameterTypes10, parameterTypes)) { + return ApiSettingLocalServiceUtil.fetchApiSetting(((Long)arguments[0]).longValue()); + } + + if (_methodName11.equals(name) && + Arrays.deepEquals(_methodParameterTypes11, parameterTypes)) { + return ApiSettingLocalServiceUtil.getApiSetting(((Long)arguments[0]).longValue()); + } + + if (_methodName12.equals(name) && + Arrays.deepEquals(_methodParameterTypes12, parameterTypes)) { + return ApiSettingLocalServiceUtil.getPersistedModel((java.io.Serializable)arguments[0]); + } + + if (_methodName13.equals(name) && + Arrays.deepEquals(_methodParameterTypes13, parameterTypes)) { + return ApiSettingLocalServiceUtil.getApiSettings(((Integer)arguments[0]).intValue(), + ((Integer)arguments[1]).intValue()); + } + + if (_methodName14.equals(name) && + Arrays.deepEquals(_methodParameterTypes14, parameterTypes)) { + return ApiSettingLocalServiceUtil.getApiSettingsCount(); + } + + if (_methodName15.equals(name) && + Arrays.deepEquals(_methodParameterTypes15, parameterTypes)) { + return ApiSettingLocalServiceUtil.updateApiSetting((it.mwg.sicilia.sue.model.ApiSetting)arguments[0]); + } + + if (_methodName40.equals(name) && + Arrays.deepEquals(_methodParameterTypes40, parameterTypes)) { + return ApiSettingLocalServiceUtil.getBeanIdentifier(); + } + + if (_methodName41.equals(name) && + Arrays.deepEquals(_methodParameterTypes41, parameterTypes)) { + ApiSettingLocalServiceUtil.setBeanIdentifier((java.lang.String)arguments[0]); + + return null; + } + + if (_methodName46.equals(name) && + Arrays.deepEquals(_methodParameterTypes46, parameterTypes)) { + return ApiSettingLocalServiceUtil.get(((Long)arguments[0]).longValue(), + ((Long)arguments[1]).longValue()); + } + + if (_methodName47.equals(name) && + Arrays.deepEquals(_methodParameterTypes47, parameterTypes)) { + ApiSettingLocalServiceUtil.set(((Long)arguments[0]).longValue(), + ((Long)arguments[1]).longValue(), (java.lang.String)arguments[2]); + + return null; + } + + throw new UnsupportedOperationException(); + } + + private String _methodName0; + private String[] _methodParameterTypes0; + private String _methodName1; + private String[] _methodParameterTypes1; + private String _methodName2; + private String[] _methodParameterTypes2; + private String _methodName3; + private String[] _methodParameterTypes3; + private String _methodName4; + private String[] _methodParameterTypes4; + private String _methodName5; + private String[] _methodParameterTypes5; + private String _methodName6; + private String[] _methodParameterTypes6; + private String _methodName7; + private String[] _methodParameterTypes7; + private String _methodName8; + private String[] _methodParameterTypes8; + private String _methodName9; + private String[] _methodParameterTypes9; + private String _methodName10; + private String[] _methodParameterTypes10; + private String _methodName11; + private String[] _methodParameterTypes11; + private String _methodName12; + private String[] _methodParameterTypes12; + private String _methodName13; + private String[] _methodParameterTypes13; + private String _methodName14; + private String[] _methodParameterTypes14; + private String _methodName15; + private String[] _methodParameterTypes15; + private String _methodName40; + private String[] _methodParameterTypes40; + private String _methodName41; + private String[] _methodParameterTypes41; + private String _methodName46; + private String[] _methodParameterTypes46; + private String _methodName47; + private String[] _methodParameterTypes47; +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/ApiSettingServiceBaseImpl.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/ApiSettingServiceBaseImpl.java new file mode 100644 index 00000000..ab303383 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/ApiSettingServiceBaseImpl.java @@ -0,0 +1,362 @@ +/** + * Copyright (c) 2000-present 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.service.base; + +import com.liferay.portal.kernel.bean.BeanReference; +import com.liferay.portal.kernel.bean.IdentifiableBean; +import com.liferay.portal.kernel.dao.jdbc.SqlUpdate; +import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil; +import com.liferay.portal.kernel.exception.SystemException; +import com.liferay.portal.service.BaseServiceImpl; +import com.liferay.portal.service.persistence.UserPersistence; + +import it.mwg.sicilia.sue.model.ApiSetting; +import it.mwg.sicilia.sue.service.ApiSettingService; +import it.mwg.sicilia.sue.service.persistence.ApiSettingPersistence; +import it.mwg.sicilia.sue.service.persistence.SportelloPersistence; + +import javax.sql.DataSource; + +/** + * Provides the base implementation for the api setting remote service. + * + *

+ * This implementation exists only as a container for the default service methods generated by ServiceBuilder. All custom service methods should be put in {@link it.mwg.sicilia.sue.service.impl.ApiSettingServiceImpl}. + *

+ * + * @author Manifattura Web Group Srl + * @see it.mwg.sicilia.sue.service.impl.ApiSettingServiceImpl + * @see it.mwg.sicilia.sue.service.ApiSettingServiceUtil + * @generated + */ +public abstract class ApiSettingServiceBaseImpl extends BaseServiceImpl + implements ApiSettingService, IdentifiableBean { + /* + * NOTE FOR DEVELOPERS: + * + * Never modify or reference this class directly. Always use {@link it.mwg.sicilia.sue.service.ApiSettingServiceUtil} to access the api setting remote service. + */ + + /** + * Returns the api setting local service. + * + * @return the api setting local service + */ + public it.mwg.sicilia.sue.service.ApiSettingLocalService getApiSettingLocalService() { + return apiSettingLocalService; + } + + /** + * Sets the api setting local service. + * + * @param apiSettingLocalService the api setting local service + */ + public void setApiSettingLocalService( + it.mwg.sicilia.sue.service.ApiSettingLocalService apiSettingLocalService) { + this.apiSettingLocalService = apiSettingLocalService; + } + + /** + * Returns the api setting remote service. + * + * @return the api setting remote service + */ + public it.mwg.sicilia.sue.service.ApiSettingService getApiSettingService() { + return apiSettingService; + } + + /** + * Sets the api setting remote service. + * + * @param apiSettingService the api setting remote service + */ + public void setApiSettingService( + it.mwg.sicilia.sue.service.ApiSettingService apiSettingService) { + this.apiSettingService = apiSettingService; + } + + /** + * Returns the api setting persistence. + * + * @return the api setting persistence + */ + public ApiSettingPersistence getApiSettingPersistence() { + return apiSettingPersistence; + } + + /** + * Sets the api setting persistence. + * + * @param apiSettingPersistence the api setting persistence + */ + public void setApiSettingPersistence( + ApiSettingPersistence apiSettingPersistence) { + this.apiSettingPersistence = apiSettingPersistence; + } + + /** + * Returns the sportello local service. + * + * @return the sportello local service + */ + public it.mwg.sicilia.sue.service.SportelloLocalService getSportelloLocalService() { + return sportelloLocalService; + } + + /** + * Sets the sportello local service. + * + * @param sportelloLocalService the sportello local service + */ + public void setSportelloLocalService( + it.mwg.sicilia.sue.service.SportelloLocalService sportelloLocalService) { + this.sportelloLocalService = sportelloLocalService; + } + + /** + * Returns the sportello remote service. + * + * @return the sportello remote service + */ + public it.mwg.sicilia.sue.service.SportelloService getSportelloService() { + return sportelloService; + } + + /** + * Sets the sportello remote service. + * + * @param sportelloService the sportello remote service + */ + public void setSportelloService( + it.mwg.sicilia.sue.service.SportelloService sportelloService) { + this.sportelloService = sportelloService; + } + + /** + * Returns the sportello persistence. + * + * @return the sportello persistence + */ + public SportelloPersistence getSportelloPersistence() { + return sportelloPersistence; + } + + /** + * Sets the sportello persistence. + * + * @param sportelloPersistence the sportello persistence + */ + public void setSportelloPersistence( + SportelloPersistence sportelloPersistence) { + this.sportelloPersistence = sportelloPersistence; + } + + /** + * Returns the counter local service. + * + * @return the counter local service + */ + public com.liferay.counter.service.CounterLocalService getCounterLocalService() { + return counterLocalService; + } + + /** + * Sets the counter local service. + * + * @param counterLocalService the counter local service + */ + public void setCounterLocalService( + com.liferay.counter.service.CounterLocalService counterLocalService) { + this.counterLocalService = counterLocalService; + } + + /** + * Returns the resource local service. + * + * @return the resource local service + */ + public com.liferay.portal.service.ResourceLocalService getResourceLocalService() { + return resourceLocalService; + } + + /** + * Sets the resource local service. + * + * @param resourceLocalService the resource local service + */ + public void setResourceLocalService( + com.liferay.portal.service.ResourceLocalService resourceLocalService) { + this.resourceLocalService = resourceLocalService; + } + + /** + * Returns the user local service. + * + * @return the user local service + */ + public com.liferay.portal.service.UserLocalService getUserLocalService() { + return userLocalService; + } + + /** + * Sets the user local service. + * + * @param userLocalService the user local service + */ + public void setUserLocalService( + com.liferay.portal.service.UserLocalService userLocalService) { + this.userLocalService = userLocalService; + } + + /** + * Returns the user remote service. + * + * @return the user remote service + */ + public com.liferay.portal.service.UserService getUserService() { + return userService; + } + + /** + * Sets the user remote service. + * + * @param userService the user remote service + */ + public void setUserService( + com.liferay.portal.service.UserService userService) { + this.userService = userService; + } + + /** + * Returns the user persistence. + * + * @return the user persistence + */ + public UserPersistence getUserPersistence() { + return userPersistence; + } + + /** + * Sets the user persistence. + * + * @param userPersistence the user persistence + */ + public void setUserPersistence(UserPersistence userPersistence) { + this.userPersistence = userPersistence; + } + + public void afterPropertiesSet() { + Class clazz = getClass(); + + _classLoader = clazz.getClassLoader(); + } + + public void destroy() { + } + + /** + * Returns the Spring bean ID for this bean. + * + * @return the Spring bean ID for this bean + */ + @Override + public String getBeanIdentifier() { + return _beanIdentifier; + } + + /** + * Sets the Spring bean ID for this bean. + * + * @param beanIdentifier the Spring bean ID for this bean + */ + @Override + public void setBeanIdentifier(String beanIdentifier) { + _beanIdentifier = beanIdentifier; + } + + @Override + public Object invokeMethod(String name, String[] parameterTypes, + Object[] arguments) throws Throwable { + Thread currentThread = Thread.currentThread(); + + ClassLoader contextClassLoader = currentThread.getContextClassLoader(); + + if (contextClassLoader != _classLoader) { + currentThread.setContextClassLoader(_classLoader); + } + + try { + return _clpInvoker.invokeMethod(name, parameterTypes, arguments); + } + finally { + if (contextClassLoader != _classLoader) { + currentThread.setContextClassLoader(contextClassLoader); + } + } + } + + protected Class getModelClass() { + return ApiSetting.class; + } + + protected String getModelClassName() { + return ApiSetting.class.getName(); + } + + /** + * Performs an SQL query. + * + * @param sql the sql query + */ + protected void runSQL(String sql) throws SystemException { + try { + DataSource dataSource = apiSettingPersistence.getDataSource(); + + SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource, + sql, new int[0]); + + sqlUpdate.update(); + } + catch (Exception e) { + throw new SystemException(e); + } + } + + @BeanReference(type = it.mwg.sicilia.sue.service.ApiSettingLocalService.class) + protected it.mwg.sicilia.sue.service.ApiSettingLocalService apiSettingLocalService; + @BeanReference(type = it.mwg.sicilia.sue.service.ApiSettingService.class) + protected it.mwg.sicilia.sue.service.ApiSettingService apiSettingService; + @BeanReference(type = ApiSettingPersistence.class) + protected ApiSettingPersistence apiSettingPersistence; + @BeanReference(type = it.mwg.sicilia.sue.service.SportelloLocalService.class) + protected it.mwg.sicilia.sue.service.SportelloLocalService sportelloLocalService; + @BeanReference(type = it.mwg.sicilia.sue.service.SportelloService.class) + protected it.mwg.sicilia.sue.service.SportelloService sportelloService; + @BeanReference(type = SportelloPersistence.class) + protected SportelloPersistence sportelloPersistence; + @BeanReference(type = com.liferay.counter.service.CounterLocalService.class) + protected com.liferay.counter.service.CounterLocalService counterLocalService; + @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class) + protected com.liferay.portal.service.ResourceLocalService resourceLocalService; + @BeanReference(type = com.liferay.portal.service.UserLocalService.class) + protected com.liferay.portal.service.UserLocalService userLocalService; + @BeanReference(type = com.liferay.portal.service.UserService.class) + protected com.liferay.portal.service.UserService userService; + @BeanReference(type = UserPersistence.class) + protected UserPersistence userPersistence; + private String _beanIdentifier; + private ClassLoader _classLoader; + private ApiSettingServiceClpInvoker _clpInvoker = new ApiSettingServiceClpInvoker(); +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/ApiSettingServiceClpInvoker.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/ApiSettingServiceClpInvoker.java new file mode 100644 index 00000000..8942d24d --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/ApiSettingServiceClpInvoker.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2000-present 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.service.base; + +import it.mwg.sicilia.sue.service.ApiSettingServiceUtil; + +import java.util.Arrays; + +/** + * @author Manifattura Web Group Srl + * @generated + */ +public class ApiSettingServiceClpInvoker { + public ApiSettingServiceClpInvoker() { + _methodName24 = "getBeanIdentifier"; + + _methodParameterTypes24 = new String[] { }; + + _methodName25 = "setBeanIdentifier"; + + _methodParameterTypes25 = new String[] { "java.lang.String" }; + } + + public Object invokeMethod(String name, String[] parameterTypes, + Object[] arguments) throws Throwable { + if (_methodName24.equals(name) && + Arrays.deepEquals(_methodParameterTypes24, parameterTypes)) { + return ApiSettingServiceUtil.getBeanIdentifier(); + } + + if (_methodName25.equals(name) && + Arrays.deepEquals(_methodParameterTypes25, parameterTypes)) { + ApiSettingServiceUtil.setBeanIdentifier((java.lang.String)arguments[0]); + + return null; + } + + throw new UnsupportedOperationException(); + } + + private String _methodName24; + private String[] _methodParameterTypes24; + private String _methodName25; + private String[] _methodParameterTypes25; +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloLocalServiceBaseImpl.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloLocalServiceBaseImpl.java index 737f1dfe..3c4bbce5 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloLocalServiceBaseImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloLocalServiceBaseImpl.java @@ -33,6 +33,7 @@ import com.liferay.portal.service.persistence.UserPersistence; import it.mwg.sicilia.sue.model.Sportello; import it.mwg.sicilia.sue.service.SportelloLocalService; +import it.mwg.sicilia.sue.service.persistence.ApiSettingPersistence; import it.mwg.sicilia.sue.service.persistence.SportelloPersistence; import java.io.Serializable; @@ -278,6 +279,63 @@ public abstract class SportelloLocalServiceBaseImpl extends BaseLocalServiceImpl return sportelloPersistence.update(sportello); } + /** + * Returns the api setting local service. + * + * @return the api setting local service + */ + public it.mwg.sicilia.sue.service.ApiSettingLocalService getApiSettingLocalService() { + return apiSettingLocalService; + } + + /** + * Sets the api setting local service. + * + * @param apiSettingLocalService the api setting local service + */ + public void setApiSettingLocalService( + it.mwg.sicilia.sue.service.ApiSettingLocalService apiSettingLocalService) { + this.apiSettingLocalService = apiSettingLocalService; + } + + /** + * Returns the api setting remote service. + * + * @return the api setting remote service + */ + public it.mwg.sicilia.sue.service.ApiSettingService getApiSettingService() { + return apiSettingService; + } + + /** + * Sets the api setting remote service. + * + * @param apiSettingService the api setting remote service + */ + public void setApiSettingService( + it.mwg.sicilia.sue.service.ApiSettingService apiSettingService) { + this.apiSettingService = apiSettingService; + } + + /** + * Returns the api setting persistence. + * + * @return the api setting persistence + */ + public ApiSettingPersistence getApiSettingPersistence() { + return apiSettingPersistence; + } + + /** + * Sets the api setting persistence. + * + * @param apiSettingPersistence the api setting persistence + */ + public void setApiSettingPersistence( + ApiSettingPersistence apiSettingPersistence) { + this.apiSettingPersistence = apiSettingPersistence; + } + /** * Returns the sportello local service. * @@ -511,6 +569,12 @@ public abstract class SportelloLocalServiceBaseImpl extends BaseLocalServiceImpl } } + @BeanReference(type = it.mwg.sicilia.sue.service.ApiSettingLocalService.class) + protected it.mwg.sicilia.sue.service.ApiSettingLocalService apiSettingLocalService; + @BeanReference(type = it.mwg.sicilia.sue.service.ApiSettingService.class) + protected it.mwg.sicilia.sue.service.ApiSettingService apiSettingService; + @BeanReference(type = ApiSettingPersistence.class) + protected ApiSettingPersistence apiSettingPersistence; @BeanReference(type = it.mwg.sicilia.sue.service.SportelloLocalService.class) protected it.mwg.sicilia.sue.service.SportelloLocalService sportelloLocalService; @BeanReference(type = it.mwg.sicilia.sue.service.SportelloService.class) diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloLocalServiceClpInvoker.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloLocalServiceClpInvoker.java index e064b6fa..250f23c4 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloLocalServiceClpInvoker.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloLocalServiceClpInvoker.java @@ -106,13 +106,13 @@ public class SportelloLocalServiceClpInvoker { "it.mwg.sicilia.sue.model.Sportello" }; - _methodName34 = "getBeanIdentifier"; + _methodName40 = "getBeanIdentifier"; - _methodParameterTypes34 = new String[] { }; + _methodParameterTypes40 = new String[] { }; - _methodName35 = "setBeanIdentifier"; + _methodName41 = "setBeanIdentifier"; - _methodParameterTypes35 = new String[] { "java.lang.String" }; + _methodParameterTypes41 = new String[] { "java.lang.String" }; } public Object invokeMethod(String name, String[] parameterTypes, @@ -204,13 +204,13 @@ public class SportelloLocalServiceClpInvoker { return SportelloLocalServiceUtil.updateSportello((it.mwg.sicilia.sue.model.Sportello)arguments[0]); } - if (_methodName34.equals(name) && - Arrays.deepEquals(_methodParameterTypes34, parameterTypes)) { + if (_methodName40.equals(name) && + Arrays.deepEquals(_methodParameterTypes40, parameterTypes)) { return SportelloLocalServiceUtil.getBeanIdentifier(); } - if (_methodName35.equals(name) && - Arrays.deepEquals(_methodParameterTypes35, parameterTypes)) { + if (_methodName41.equals(name) && + Arrays.deepEquals(_methodParameterTypes41, parameterTypes)) { SportelloLocalServiceUtil.setBeanIdentifier((java.lang.String)arguments[0]); return null; @@ -251,8 +251,8 @@ public class SportelloLocalServiceClpInvoker { private String[] _methodParameterTypes14; private String _methodName15; private String[] _methodParameterTypes15; - private String _methodName34; - private String[] _methodParameterTypes34; - private String _methodName35; - private String[] _methodParameterTypes35; + private String _methodName40; + private String[] _methodParameterTypes40; + private String _methodName41; + private String[] _methodParameterTypes41; } \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloServiceBaseImpl.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloServiceBaseImpl.java index 09bad918..c3471ced 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloServiceBaseImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloServiceBaseImpl.java @@ -24,6 +24,7 @@ import com.liferay.portal.service.persistence.UserPersistence; import it.mwg.sicilia.sue.model.Sportello; import it.mwg.sicilia.sue.service.SportelloService; +import it.mwg.sicilia.sue.service.persistence.ApiSettingPersistence; import it.mwg.sicilia.sue.service.persistence.SportelloPersistence; import javax.sql.DataSource; @@ -48,6 +49,63 @@ public abstract class SportelloServiceBaseImpl extends BaseServiceImpl * Never modify or reference this class directly. Always use {@link it.mwg.sicilia.sue.service.SportelloServiceUtil} to access the sportello remote service. */ + /** + * Returns the api setting local service. + * + * @return the api setting local service + */ + public it.mwg.sicilia.sue.service.ApiSettingLocalService getApiSettingLocalService() { + return apiSettingLocalService; + } + + /** + * Sets the api setting local service. + * + * @param apiSettingLocalService the api setting local service + */ + public void setApiSettingLocalService( + it.mwg.sicilia.sue.service.ApiSettingLocalService apiSettingLocalService) { + this.apiSettingLocalService = apiSettingLocalService; + } + + /** + * Returns the api setting remote service. + * + * @return the api setting remote service + */ + public it.mwg.sicilia.sue.service.ApiSettingService getApiSettingService() { + return apiSettingService; + } + + /** + * Sets the api setting remote service. + * + * @param apiSettingService the api setting remote service + */ + public void setApiSettingService( + it.mwg.sicilia.sue.service.ApiSettingService apiSettingService) { + this.apiSettingService = apiSettingService; + } + + /** + * Returns the api setting persistence. + * + * @return the api setting persistence + */ + public ApiSettingPersistence getApiSettingPersistence() { + return apiSettingPersistence; + } + + /** + * Sets the api setting persistence. + * + * @param apiSettingPersistence the api setting persistence + */ + public void setApiSettingPersistence( + ApiSettingPersistence apiSettingPersistence) { + this.apiSettingPersistence = apiSettingPersistence; + } + /** * Returns the sportello local service. * @@ -276,6 +334,12 @@ public abstract class SportelloServiceBaseImpl extends BaseServiceImpl } } + @BeanReference(type = it.mwg.sicilia.sue.service.ApiSettingLocalService.class) + protected it.mwg.sicilia.sue.service.ApiSettingLocalService apiSettingLocalService; + @BeanReference(type = it.mwg.sicilia.sue.service.ApiSettingService.class) + protected it.mwg.sicilia.sue.service.ApiSettingService apiSettingService; + @BeanReference(type = ApiSettingPersistence.class) + protected ApiSettingPersistence apiSettingPersistence; @BeanReference(type = it.mwg.sicilia.sue.service.SportelloLocalService.class) protected it.mwg.sicilia.sue.service.SportelloLocalService sportelloLocalService; @BeanReference(type = it.mwg.sicilia.sue.service.SportelloService.class) diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloServiceClpInvoker.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloServiceClpInvoker.java index 2c3d2b46..4b49ae20 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloServiceClpInvoker.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/base/SportelloServiceClpInvoker.java @@ -24,24 +24,24 @@ import java.util.Arrays; */ public class SportelloServiceClpInvoker { public SportelloServiceClpInvoker() { - _methodName18 = "getBeanIdentifier"; + _methodName24 = "getBeanIdentifier"; - _methodParameterTypes18 = new String[] { }; + _methodParameterTypes24 = new String[] { }; - _methodName19 = "setBeanIdentifier"; + _methodName25 = "setBeanIdentifier"; - _methodParameterTypes19 = new String[] { "java.lang.String" }; + _methodParameterTypes25 = new String[] { "java.lang.String" }; } public Object invokeMethod(String name, String[] parameterTypes, Object[] arguments) throws Throwable { - if (_methodName18.equals(name) && - Arrays.deepEquals(_methodParameterTypes18, parameterTypes)) { + if (_methodName24.equals(name) && + Arrays.deepEquals(_methodParameterTypes24, parameterTypes)) { return SportelloServiceUtil.getBeanIdentifier(); } - if (_methodName19.equals(name) && - Arrays.deepEquals(_methodParameterTypes19, parameterTypes)) { + if (_methodName25.equals(name) && + Arrays.deepEquals(_methodParameterTypes25, parameterTypes)) { SportelloServiceUtil.setBeanIdentifier((java.lang.String)arguments[0]); return null; @@ -50,8 +50,8 @@ public class SportelloServiceClpInvoker { throw new UnsupportedOperationException(); } - private String _methodName18; - private String[] _methodParameterTypes18; - private String _methodName19; - private String[] _methodParameterTypes19; + private String _methodName24; + private String[] _methodParameterTypes24; + private String _methodName25; + private String[] _methodParameterTypes25; } \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/http/ApiSettingServiceSoap.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/http/ApiSettingServiceSoap.java new file mode 100644 index 00000000..4078f7e1 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/http/ApiSettingServiceSoap.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) 2000-present 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.service.http; + +/** + * Provides the SOAP utility for the + * {@link it.mwg.sicilia.sue.service.ApiSettingServiceUtil} service utility. The + * static methods of this class calls the same methods of the service utility. + * However, the signatures are different because it is difficult for SOAP to + * support certain types. + * + *

+ * ServiceBuilder follows certain rules in translating the methods. For example, + * if the method in the service utility returns a {@link java.util.List}, that + * is translated to an array of {@link it.mwg.sicilia.sue.model.ApiSettingSoap}. + * If the method in the service utility returns a + * {@link it.mwg.sicilia.sue.model.ApiSetting}, that is translated to a + * {@link it.mwg.sicilia.sue.model.ApiSettingSoap}. Methods that SOAP cannot + * safely wire are skipped. + *

+ * + *

+ * The benefits of using the SOAP utility is that it is cross platform + * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and + * even Perl, to call the generated services. One drawback of SOAP is that it is + * slow because it needs to serialize all calls into a text format (XML). + *

+ * + *

+ * You can see a list of services at http://localhost:8080/api/axis. Set the + * property axis.servlet.hosts.allowed in portal.properties to configure + * security. + *

+ * + *

+ * The SOAP utility is only generated for remote services. + *

+ * + * @author Manifattura Web Group Srl + * @see ApiSettingServiceHttp + * @see it.mwg.sicilia.sue.model.ApiSettingSoap + * @see it.mwg.sicilia.sue.service.ApiSettingServiceUtil + * @generated + */ +public class ApiSettingServiceSoap { +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/ApiSettingLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/ApiSettingLocalServiceImpl.java new file mode 100644 index 00000000..44a98b5a --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/ApiSettingLocalServiceImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) 2000-present 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.service.impl; + +import it.mwg.sicilia.sue.model.ApiSetting; +import it.mwg.sicilia.sue.service.base.ApiSettingLocalServiceBaseImpl; + +import com.liferay.counter.service.CounterLocalServiceUtil; +import com.liferay.portal.kernel.exception.SystemException; +import com.liferay.portal.kernel.util.Validator; + +/** + * The implementation of the api setting local service. + * + *

+ * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.mwg.sicilia.sue.service.ApiSettingLocalService} interface. + * + *

+ * This is a local service. Methods of this service will not have security checks based on the propagated JAAS + * credentials because this service can only be accessed from within the same VM. + *

+ * + * @author Manifattura Web Group Srl + * @see it.mwg.sicilia.sue.service.base.ApiSettingLocalServiceBaseImpl + * @see it.mwg.sicilia.sue.service.ApiSettingLocalServiceUtil + */ +public class ApiSettingLocalServiceImpl extends ApiSettingLocalServiceBaseImpl { + /* + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.mwg.sicilia.sue.service.ApiSettingLocalServiceUtil} to access the api setting local service. + */ + + @Override + public String get(long companyId, long key) throws SystemException { + + ApiSetting apiSetting = apiSettingPersistence.fetchByCompanyIdKey(companyId, key); + return Validator.isNull(apiSetting) ? null : apiSetting.getValue(); + } + + @Override + public void set(long companyId, long key, String value) throws SystemException { + + ApiSetting apiSetting = apiSettingPersistence.fetchByCompanyIdKey(companyId, key); + if (Validator.isNull(apiSetting)) { + apiSetting = createApiSetting(CounterLocalServiceUtil.increment(ApiSetting.class.getName())); + apiSetting.setCompanyId(companyId); + apiSetting.setKey(key); + } + apiSetting.setValue(value); + updateApiSetting(apiSetting); + } +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/ApiSettingServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/ApiSettingServiceImpl.java new file mode 100644 index 00000000..0ac73253 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/impl/ApiSettingServiceImpl.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2000-present 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.service.impl; + +import it.mwg.sicilia.sue.service.base.ApiSettingServiceBaseImpl; + +/** + * The implementation of the api setting remote service. + * + *

+ * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link it.mwg.sicilia.sue.service.ApiSettingService} interface. + * + *

+ * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely. + *

+ * + * @author Manifattura Web Group Srl + * @see it.mwg.sicilia.sue.service.base.ApiSettingServiceBaseImpl + * @see it.mwg.sicilia.sue.service.ApiSettingServiceUtil + */ +public class ApiSettingServiceImpl extends ApiSettingServiceBaseImpl { + /* + * NOTE FOR DEVELOPERS: + * + * Never reference this interface directly. Always use {@link it.mwg.sicilia.sue.service.ApiSettingServiceUtil} to access the api setting remote service. + */ +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/persistence/ApiSettingPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/persistence/ApiSettingPersistenceImpl.java new file mode 100644 index 00000000..2d332caf --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/persistence/ApiSettingPersistenceImpl.java @@ -0,0 +1,967 @@ +/** + * Copyright (c) 2000-present 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.service.persistence; + +import com.liferay.portal.kernel.cache.CacheRegistryUtil; +import com.liferay.portal.kernel.dao.orm.EntityCacheUtil; +import com.liferay.portal.kernel.dao.orm.FinderCacheUtil; +import com.liferay.portal.kernel.dao.orm.FinderPath; +import com.liferay.portal.kernel.dao.orm.Query; +import com.liferay.portal.kernel.dao.orm.QueryPos; +import com.liferay.portal.kernel.dao.orm.QueryUtil; +import com.liferay.portal.kernel.dao.orm.Session; +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.GetterUtil; +import com.liferay.portal.kernel.util.InstanceFactory; +import com.liferay.portal.kernel.util.OrderByComparator; +import com.liferay.portal.kernel.util.PropsKeys; +import com.liferay.portal.kernel.util.PropsUtil; +import com.liferay.portal.kernel.util.SetUtil; +import com.liferay.portal.kernel.util.StringBundler; +import com.liferay.portal.kernel.util.StringPool; +import com.liferay.portal.kernel.util.StringUtil; +import com.liferay.portal.kernel.util.UnmodifiableList; +import com.liferay.portal.model.CacheModel; +import com.liferay.portal.model.ModelListener; +import com.liferay.portal.service.persistence.impl.BasePersistenceImpl; + +import it.mwg.sicilia.sue.NoSuchApiSettingException; +import it.mwg.sicilia.sue.model.ApiSetting; +import it.mwg.sicilia.sue.model.impl.ApiSettingImpl; +import it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl; +import it.mwg.sicilia.sue.service.persistence.ApiSettingPersistence; + +import java.io.Serializable; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Set; + +/** + * The persistence implementation for the api setting service. + * + *

+ * Caching information and settings can be found in portal.properties + *

+ * + * @author Manifattura Web Group Srl + * @see ApiSettingPersistence + * @see ApiSettingUtil + * @generated + */ +public class ApiSettingPersistenceImpl extends BasePersistenceImpl + implements ApiSettingPersistence { + /* + * NOTE FOR DEVELOPERS: + * + * Never modify or reference this class directly. Always use {@link ApiSettingUtil} to access the api setting persistence. Modify service.xml and rerun ServiceBuilder to regenerate this class. + */ + public static final String FINDER_CLASS_NAME_ENTITY = ApiSettingImpl.class.getName(); + public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION = FINDER_CLASS_NAME_ENTITY + + ".List1"; + public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION = FINDER_CLASS_NAME_ENTITY + + ".List2"; + public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(ApiSettingModelImpl.ENTITY_CACHE_ENABLED, + ApiSettingModelImpl.FINDER_CACHE_ENABLED, ApiSettingImpl.class, + FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]); + public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(ApiSettingModelImpl.ENTITY_CACHE_ENABLED, + ApiSettingModelImpl.FINDER_CACHE_ENABLED, ApiSettingImpl.class, + FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]); + public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(ApiSettingModelImpl.ENTITY_CACHE_ENABLED, + ApiSettingModelImpl.FINDER_CACHE_ENABLED, Long.class, + FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]); + public static final FinderPath FINDER_PATH_FETCH_BY_COMPANYIDKEY = new FinderPath(ApiSettingModelImpl.ENTITY_CACHE_ENABLED, + ApiSettingModelImpl.FINDER_CACHE_ENABLED, ApiSettingImpl.class, + FINDER_CLASS_NAME_ENTITY, "fetchByCompanyIdKey", + new String[] { Long.class.getName(), Long.class.getName() }, + ApiSettingModelImpl.COMPANYID_COLUMN_BITMASK | + ApiSettingModelImpl.KEY_COLUMN_BITMASK); + public static final FinderPath FINDER_PATH_COUNT_BY_COMPANYIDKEY = new FinderPath(ApiSettingModelImpl.ENTITY_CACHE_ENABLED, + ApiSettingModelImpl.FINDER_CACHE_ENABLED, Long.class, + FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByCompanyIdKey", + new String[] { Long.class.getName(), Long.class.getName() }); + + /** + * Returns the api setting where companyId = ? and key = ? or throws a {@link it.mwg.sicilia.sue.NoSuchApiSettingException} if it could not be found. + * + * @param companyId the company ID + * @param key the key + * @return the matching api setting + * @throws it.mwg.sicilia.sue.NoSuchApiSettingException if a matching api setting could not be found + * @throws SystemException if a system exception occurred + */ + @Override + public ApiSetting findByCompanyIdKey(long companyId, long key) + throws NoSuchApiSettingException, SystemException { + ApiSetting apiSetting = fetchByCompanyIdKey(companyId, key); + + if (apiSetting == null) { + StringBundler msg = new StringBundler(6); + + msg.append(_NO_SUCH_ENTITY_WITH_KEY); + + msg.append("companyId="); + msg.append(companyId); + + msg.append(", key="); + msg.append(key); + + msg.append(StringPool.CLOSE_CURLY_BRACE); + + if (_log.isWarnEnabled()) { + _log.warn(msg.toString()); + } + + throw new NoSuchApiSettingException(msg.toString()); + } + + return apiSetting; + } + + /** + * Returns the api setting where companyId = ? and key = ? or returns null if it could not be found. Uses the finder cache. + * + * @param companyId the company ID + * @param key the key + * @return the matching api setting, or null if a matching api setting could not be found + * @throws SystemException if a system exception occurred + */ + @Override + public ApiSetting fetchByCompanyIdKey(long companyId, long key) + throws SystemException { + return fetchByCompanyIdKey(companyId, key, true); + } + + /** + * Returns the api setting where companyId = ? and key = ? or returns null if it could not be found, optionally using the finder cache. + * + * @param companyId the company ID + * @param key the key + * @param retrieveFromCache whether to use the finder cache + * @return the matching api setting, or null if a matching api setting could not be found + * @throws SystemException if a system exception occurred + */ + @Override + public ApiSetting fetchByCompanyIdKey(long companyId, long key, + boolean retrieveFromCache) throws SystemException { + Object[] finderArgs = new Object[] { companyId, key }; + + Object result = null; + + if (retrieveFromCache) { + result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_COMPANYIDKEY, + finderArgs, this); + } + + if (result instanceof ApiSetting) { + ApiSetting apiSetting = (ApiSetting)result; + + if ((companyId != apiSetting.getCompanyId()) || + (key != apiSetting.getKey())) { + result = null; + } + } + + if (result == null) { + StringBundler query = new StringBundler(4); + + query.append(_SQL_SELECT_APISETTING_WHERE); + + query.append(_FINDER_COLUMN_COMPANYIDKEY_COMPANYID_2); + + query.append(_FINDER_COLUMN_COMPANYIDKEY_KEY_2); + + String sql = query.toString(); + + Session session = null; + + try { + session = openSession(); + + Query q = session.createQuery(sql); + + QueryPos qPos = QueryPos.getInstance(q); + + qPos.add(companyId); + + qPos.add(key); + + List list = q.list(); + + if (list.isEmpty()) { + FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COMPANYIDKEY, + finderArgs, list); + } + else { + ApiSetting apiSetting = list.get(0); + + result = apiSetting; + + cacheResult(apiSetting); + + if ((apiSetting.getCompanyId() != companyId) || + (apiSetting.getKey() != key)) { + FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COMPANYIDKEY, + finderArgs, apiSetting); + } + } + } + catch (Exception e) { + FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_COMPANYIDKEY, + finderArgs); + + throw processException(e); + } + finally { + closeSession(session); + } + } + + if (result instanceof List) { + return null; + } + else { + return (ApiSetting)result; + } + } + + /** + * Removes the api setting where companyId = ? and key = ? from the database. + * + * @param companyId the company ID + * @param key the key + * @return the api setting that was removed + * @throws SystemException if a system exception occurred + */ + @Override + public ApiSetting removeByCompanyIdKey(long companyId, long key) + throws NoSuchApiSettingException, SystemException { + ApiSetting apiSetting = findByCompanyIdKey(companyId, key); + + return remove(apiSetting); + } + + /** + * Returns the number of api settings where companyId = ? and key = ?. + * + * @param companyId the company ID + * @param key the key + * @return the number of matching api settings + * @throws SystemException if a system exception occurred + */ + @Override + public int countByCompanyIdKey(long companyId, long key) + throws SystemException { + FinderPath finderPath = FINDER_PATH_COUNT_BY_COMPANYIDKEY; + + Object[] finderArgs = new Object[] { companyId, key }; + + Long count = (Long)FinderCacheUtil.getResult(finderPath, finderArgs, + this); + + if (count == null) { + StringBundler query = new StringBundler(3); + + query.append(_SQL_COUNT_APISETTING_WHERE); + + query.append(_FINDER_COLUMN_COMPANYIDKEY_COMPANYID_2); + + query.append(_FINDER_COLUMN_COMPANYIDKEY_KEY_2); + + String sql = query.toString(); + + Session session = null; + + try { + session = openSession(); + + Query q = session.createQuery(sql); + + QueryPos qPos = QueryPos.getInstance(q); + + qPos.add(companyId); + + qPos.add(key); + + 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_COMPANYIDKEY_COMPANYID_2 = "apiSetting.companyId = ? AND "; + private static final String _FINDER_COLUMN_COMPANYIDKEY_KEY_2 = "apiSetting.key = ?"; + + public ApiSettingPersistenceImpl() { + setModelClass(ApiSetting.class); + } + + /** + * Caches the api setting in the entity cache if it is enabled. + * + * @param apiSetting the api setting + */ + @Override + public void cacheResult(ApiSetting apiSetting) { + EntityCacheUtil.putResult(ApiSettingModelImpl.ENTITY_CACHE_ENABLED, + ApiSettingImpl.class, apiSetting.getPrimaryKey(), apiSetting); + + FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COMPANYIDKEY, + new Object[] { apiSetting.getCompanyId(), apiSetting.getKey() }, + apiSetting); + + apiSetting.resetOriginalValues(); + } + + /** + * Caches the api settings in the entity cache if it is enabled. + * + * @param apiSettings the api settings + */ + @Override + public void cacheResult(List apiSettings) { + for (ApiSetting apiSetting : apiSettings) { + if (EntityCacheUtil.getResult( + ApiSettingModelImpl.ENTITY_CACHE_ENABLED, + ApiSettingImpl.class, apiSetting.getPrimaryKey()) == null) { + cacheResult(apiSetting); + } + else { + apiSetting.resetOriginalValues(); + } + } + } + + /** + * Clears the cache for all api settings. + * + *

+ * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method. + *

+ */ + @Override + public void clearCache() { + if (_HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) { + CacheRegistryUtil.clear(ApiSettingImpl.class.getName()); + } + + EntityCacheUtil.clearCache(ApiSettingImpl.class.getName()); + + FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY); + FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION); + FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); + } + + /** + * Clears the cache for the api setting. + * + *

+ * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method. + *

+ */ + @Override + public void clearCache(ApiSetting apiSetting) { + EntityCacheUtil.removeResult(ApiSettingModelImpl.ENTITY_CACHE_ENABLED, + ApiSettingImpl.class, apiSetting.getPrimaryKey()); + + FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION); + FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); + + clearUniqueFindersCache(apiSetting); + } + + @Override + public void clearCache(List apiSettings) { + FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION); + FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); + + for (ApiSetting apiSetting : apiSettings) { + EntityCacheUtil.removeResult(ApiSettingModelImpl.ENTITY_CACHE_ENABLED, + ApiSettingImpl.class, apiSetting.getPrimaryKey()); + + clearUniqueFindersCache(apiSetting); + } + } + + protected void cacheUniqueFindersCache(ApiSetting apiSetting) { + if (apiSetting.isNew()) { + Object[] args = new Object[] { + apiSetting.getCompanyId(), apiSetting.getKey() + }; + + FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_COMPANYIDKEY, args, + Long.valueOf(1)); + FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COMPANYIDKEY, args, + apiSetting); + } + else { + ApiSettingModelImpl apiSettingModelImpl = (ApiSettingModelImpl)apiSetting; + + if ((apiSettingModelImpl.getColumnBitmask() & + FINDER_PATH_FETCH_BY_COMPANYIDKEY.getColumnBitmask()) != 0) { + Object[] args = new Object[] { + apiSetting.getCompanyId(), apiSetting.getKey() + }; + + FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_COMPANYIDKEY, + args, Long.valueOf(1)); + FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COMPANYIDKEY, + args, apiSetting); + } + } + } + + protected void clearUniqueFindersCache(ApiSetting apiSetting) { + ApiSettingModelImpl apiSettingModelImpl = (ApiSettingModelImpl)apiSetting; + + Object[] args = new Object[] { + apiSetting.getCompanyId(), apiSetting.getKey() + }; + + FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_COMPANYIDKEY, args); + FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_COMPANYIDKEY, args); + + if ((apiSettingModelImpl.getColumnBitmask() & + FINDER_PATH_FETCH_BY_COMPANYIDKEY.getColumnBitmask()) != 0) { + args = new Object[] { + apiSettingModelImpl.getOriginalCompanyId(), + apiSettingModelImpl.getOriginalKey() + }; + + FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_COMPANYIDKEY, args); + FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_COMPANYIDKEY, args); + } + } + + /** + * Creates a new api setting with the primary key. Does not add the api setting to the database. + * + * @param id the primary key for the new api setting + * @return the new api setting + */ + @Override + public ApiSetting create(long id) { + ApiSetting apiSetting = new ApiSettingImpl(); + + apiSetting.setNew(true); + apiSetting.setPrimaryKey(id); + + return apiSetting; + } + + /** + * Removes the api setting with the primary key from the database. Also notifies the appropriate model listeners. + * + * @param id the primary key of the api setting + * @return the api setting that was removed + * @throws it.mwg.sicilia.sue.NoSuchApiSettingException if a api setting with the primary key could not be found + * @throws SystemException if a system exception occurred + */ + @Override + public ApiSetting remove(long id) + throws NoSuchApiSettingException, SystemException { + return remove((Serializable)id); + } + + /** + * Removes the api setting with the primary key from the database. Also notifies the appropriate model listeners. + * + * @param primaryKey the primary key of the api setting + * @return the api setting that was removed + * @throws it.mwg.sicilia.sue.NoSuchApiSettingException if a api setting with the primary key could not be found + * @throws SystemException if a system exception occurred + */ + @Override + public ApiSetting remove(Serializable primaryKey) + throws NoSuchApiSettingException, SystemException { + Session session = null; + + try { + session = openSession(); + + ApiSetting apiSetting = (ApiSetting)session.get(ApiSettingImpl.class, + primaryKey); + + if (apiSetting == null) { + if (_log.isWarnEnabled()) { + _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey); + } + + throw new NoSuchApiSettingException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + + primaryKey); + } + + return remove(apiSetting); + } + catch (NoSuchApiSettingException nsee) { + throw nsee; + } + catch (Exception e) { + throw processException(e); + } + finally { + closeSession(session); + } + } + + @Override + protected ApiSetting removeImpl(ApiSetting apiSetting) + throws SystemException { + apiSetting = toUnwrappedModel(apiSetting); + + Session session = null; + + try { + session = openSession(); + + if (!session.contains(apiSetting)) { + apiSetting = (ApiSetting)session.get(ApiSettingImpl.class, + apiSetting.getPrimaryKeyObj()); + } + + if (apiSetting != null) { + session.delete(apiSetting); + } + } + catch (Exception e) { + throw processException(e); + } + finally { + closeSession(session); + } + + if (apiSetting != null) { + clearCache(apiSetting); + } + + return apiSetting; + } + + @Override + public ApiSetting updateImpl(it.mwg.sicilia.sue.model.ApiSetting apiSetting) + throws SystemException { + apiSetting = toUnwrappedModel(apiSetting); + + boolean isNew = apiSetting.isNew(); + + Session session = null; + + try { + session = openSession(); + + if (apiSetting.isNew()) { + session.save(apiSetting); + + apiSetting.setNew(false); + } + else { + session.merge(apiSetting); + } + } + catch (Exception e) { + throw processException(e); + } + finally { + closeSession(session); + } + + FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION); + + if (isNew || !ApiSettingModelImpl.COLUMN_BITMASK_ENABLED) { + FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); + } + + EntityCacheUtil.putResult(ApiSettingModelImpl.ENTITY_CACHE_ENABLED, + ApiSettingImpl.class, apiSetting.getPrimaryKey(), apiSetting); + + clearUniqueFindersCache(apiSetting); + cacheUniqueFindersCache(apiSetting); + + return apiSetting; + } + + protected ApiSetting toUnwrappedModel(ApiSetting apiSetting) { + if (apiSetting instanceof ApiSettingImpl) { + return apiSetting; + } + + ApiSettingImpl apiSettingImpl = new ApiSettingImpl(); + + apiSettingImpl.setNew(apiSetting.isNew()); + apiSettingImpl.setPrimaryKey(apiSetting.getPrimaryKey()); + + apiSettingImpl.setId(apiSetting.getId()); + apiSettingImpl.setCompanyId(apiSetting.getCompanyId()); + apiSettingImpl.setKey(apiSetting.getKey()); + apiSettingImpl.setValue(apiSetting.getValue()); + + return apiSettingImpl; + } + + /** + * Returns the api setting with the primary key or throws a {@link com.liferay.portal.NoSuchModelException} if it could not be found. + * + * @param primaryKey the primary key of the api setting + * @return the api setting + * @throws it.mwg.sicilia.sue.NoSuchApiSettingException if a api setting with the primary key could not be found + * @throws SystemException if a system exception occurred + */ + @Override + public ApiSetting findByPrimaryKey(Serializable primaryKey) + throws NoSuchApiSettingException, SystemException { + ApiSetting apiSetting = fetchByPrimaryKey(primaryKey); + + if (apiSetting == null) { + if (_log.isWarnEnabled()) { + _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey); + } + + throw new NoSuchApiSettingException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + + primaryKey); + } + + return apiSetting; + } + + /** + * Returns the api setting with the primary key or throws a {@link it.mwg.sicilia.sue.NoSuchApiSettingException} if it could not be found. + * + * @param id the primary key of the api setting + * @return the api setting + * @throws it.mwg.sicilia.sue.NoSuchApiSettingException if a api setting with the primary key could not be found + * @throws SystemException if a system exception occurred + */ + @Override + public ApiSetting findByPrimaryKey(long id) + throws NoSuchApiSettingException, SystemException { + return findByPrimaryKey((Serializable)id); + } + + /** + * Returns the api setting with the primary key or returns null if it could not be found. + * + * @param primaryKey the primary key of the api setting + * @return the api setting, or null if a api setting with the primary key could not be found + * @throws SystemException if a system exception occurred + */ + @Override + public ApiSetting fetchByPrimaryKey(Serializable primaryKey) + throws SystemException { + ApiSetting apiSetting = (ApiSetting)EntityCacheUtil.getResult(ApiSettingModelImpl.ENTITY_CACHE_ENABLED, + ApiSettingImpl.class, primaryKey); + + if (apiSetting == _nullApiSetting) { + return null; + } + + if (apiSetting == null) { + Session session = null; + + try { + session = openSession(); + + apiSetting = (ApiSetting)session.get(ApiSettingImpl.class, + primaryKey); + + if (apiSetting != null) { + cacheResult(apiSetting); + } + else { + EntityCacheUtil.putResult(ApiSettingModelImpl.ENTITY_CACHE_ENABLED, + ApiSettingImpl.class, primaryKey, _nullApiSetting); + } + } + catch (Exception e) { + EntityCacheUtil.removeResult(ApiSettingModelImpl.ENTITY_CACHE_ENABLED, + ApiSettingImpl.class, primaryKey); + + throw processException(e); + } + finally { + closeSession(session); + } + } + + return apiSetting; + } + + /** + * Returns the api setting with the primary key or returns null if it could not be found. + * + * @param id the primary key of the api setting + * @return the api setting, or null if a api setting with the primary key could not be found + * @throws SystemException if a system exception occurred + */ + @Override + public ApiSetting fetchByPrimaryKey(long id) throws SystemException { + return fetchByPrimaryKey((Serializable)id); + } + + /** + * Returns all the api settings. + * + * @return the api settings + * @throws SystemException if a system exception occurred + */ + @Override + public List findAll() throws SystemException { + return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); + } + + /** + * Returns a range of all the api settings. + * + *

+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. + *

+ * + * @param start the lower bound of the range of api settings + * @param end the upper bound of the range of api settings (not inclusive) + * @return the range of api settings + * @throws SystemException if a system exception occurred + */ + @Override + public List findAll(int start, int end) + throws SystemException { + return findAll(start, end, null); + } + + /** + * Returns an ordered range of all the api settings. + * + *

+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.mwg.sicilia.sue.model.impl.ApiSettingModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. + *

+ * + * @param start the lower bound of the range of api settings + * @param end the upper bound of the range of api settings (not inclusive) + * @param orderByComparator the comparator to order the results by (optionally null) + * @return the ordered range of api settings + * @throws SystemException if a system exception occurred + */ + @Override + public List findAll(int start, int end, + OrderByComparator orderByComparator) throws SystemException { + boolean pagination = true; + FinderPath finderPath = null; + Object[] finderArgs = null; + + if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && + (orderByComparator == null)) { + pagination = false; + finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL; + finderArgs = FINDER_ARGS_EMPTY; + } + else { + finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL; + finderArgs = new Object[] { start, end, orderByComparator }; + } + + List list = (List)FinderCacheUtil.getResult(finderPath, + finderArgs, this); + + if (list == null) { + StringBundler query = null; + String sql = null; + + if (orderByComparator != null) { + query = new StringBundler(2 + + (orderByComparator.getOrderByFields().length * 3)); + + query.append(_SQL_SELECT_APISETTING); + + appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, + orderByComparator); + + sql = query.toString(); + } + else { + sql = _SQL_SELECT_APISETTING; + + if (pagination) { + sql = sql.concat(ApiSettingModelImpl.ORDER_BY_JPQL); + } + } + + Session session = null; + + try { + session = openSession(); + + Query q = session.createQuery(sql); + + if (!pagination) { + list = (List)QueryUtil.list(q, getDialect(), + start, end, false); + + Collections.sort(list); + + list = new UnmodifiableList(list); + } + else { + list = (List)QueryUtil.list(q, getDialect(), + start, end); + } + + cacheResult(list); + + FinderCacheUtil.putResult(finderPath, finderArgs, list); + } + catch (Exception e) { + FinderCacheUtil.removeResult(finderPath, finderArgs); + + throw processException(e); + } + finally { + closeSession(session); + } + } + + return list; + } + + /** + * Removes all the api settings from the database. + * + * @throws SystemException if a system exception occurred + */ + @Override + public void removeAll() throws SystemException { + for (ApiSetting apiSetting : findAll()) { + remove(apiSetting); + } + } + + /** + * Returns the number of api settings. + * + * @return the number of api settings + * @throws SystemException if a system exception occurred + */ + @Override + public int countAll() throws SystemException { + Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL, + FINDER_ARGS_EMPTY, this); + + if (count == null) { + Session session = null; + + try { + session = openSession(); + + Query q = session.createQuery(_SQL_COUNT_APISETTING); + + count = (Long)q.uniqueResult(); + + FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, + FINDER_ARGS_EMPTY, count); + } + catch (Exception e) { + FinderCacheUtil.removeResult(FINDER_PATH_COUNT_ALL, + FINDER_ARGS_EMPTY); + + throw processException(e); + } + finally { + closeSession(session); + } + } + + return count.intValue(); + } + + @Override + protected Set getBadColumnNames() { + return _badColumnNames; + } + + /** + * Initializes the api setting persistence. + */ + public void afterPropertiesSet() { + String[] listenerClassNames = StringUtil.split(GetterUtil.getString( + com.liferay.util.service.ServiceProps.get( + "value.object.listener.it.mwg.sicilia.sue.model.ApiSetting"))); + + if (listenerClassNames.length > 0) { + try { + List> listenersList = new ArrayList>(); + + for (String listenerClassName : listenerClassNames) { + listenersList.add((ModelListener)InstanceFactory.newInstance( + getClassLoader(), listenerClassName)); + } + + listeners = listenersList.toArray(new ModelListener[listenersList.size()]); + } + catch (Exception e) { + _log.error(e); + } + } + } + + public void destroy() { + EntityCacheUtil.removeCache(ApiSettingImpl.class.getName()); + FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY); + FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION); + FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); + } + + private static final String _SQL_SELECT_APISETTING = "SELECT apiSetting FROM ApiSetting apiSetting"; + private static final String _SQL_SELECT_APISETTING_WHERE = "SELECT apiSetting FROM ApiSetting apiSetting WHERE "; + private static final String _SQL_COUNT_APISETTING = "SELECT COUNT(apiSetting) FROM ApiSetting apiSetting"; + private static final String _SQL_COUNT_APISETTING_WHERE = "SELECT COUNT(apiSetting) FROM ApiSetting apiSetting WHERE "; + private static final String _ORDER_BY_ENTITY_ALIAS = "apiSetting."; + private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No ApiSetting exists with the primary key "; + private static final String _NO_SUCH_ENTITY_WITH_KEY = "No ApiSetting exists with the key {"; + private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = GetterUtil.getBoolean(PropsUtil.get( + PropsKeys.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE)); + private static Log _log = LogFactoryUtil.getLog(ApiSettingPersistenceImpl.class); + private static Set _badColumnNames = SetUtil.fromArray(new String[] { + "id", "key" + }); + private static ApiSetting _nullApiSetting = new ApiSettingImpl() { + @Override + public Object clone() { + return this; + } + + @Override + public CacheModel toCacheModel() { + return _nullApiSettingCacheModel; + } + }; + + private static CacheModel _nullApiSettingCacheModel = new CacheModel() { + @Override + public ApiSetting toEntityModel() { + return _nullApiSetting; + } + }; +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/persistence/SportelloPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/persistence/SportelloPersistenceImpl.java index 05b7183b..bf65e96e 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/persistence/SportelloPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/service/persistence/SportelloPersistenceImpl.java @@ -30,12 +30,10 @@ import com.liferay.portal.kernel.util.InstanceFactory; import com.liferay.portal.kernel.util.OrderByComparator; import com.liferay.portal.kernel.util.PropsKeys; import com.liferay.portal.kernel.util.PropsUtil; -import com.liferay.portal.kernel.util.SetUtil; import com.liferay.portal.kernel.util.StringBundler; import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.StringUtil; import com.liferay.portal.kernel.util.UnmodifiableList; -import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.model.CacheModel; import com.liferay.portal.model.ModelListener; import com.liferay.portal.service.persistence.impl.BasePersistenceImpl; @@ -51,7 +49,6 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.Set; /** * The persistence implementation for the sportello service. @@ -86,36 +83,36 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(SportelloModelImpl.ENTITY_CACHE_ENABLED, SportelloModelImpl.FINDER_CACHE_ENABLED, Long.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]); - public static final FinderPath FINDER_PATH_FETCH_BY_LOGINNAME = new FinderPath(SportelloModelImpl.ENTITY_CACHE_ENABLED, + public static final FinderPath FINDER_PATH_FETCH_BY_COMUNEID = new FinderPath(SportelloModelImpl.ENTITY_CACHE_ENABLED, SportelloModelImpl.FINDER_CACHE_ENABLED, SportelloImpl.class, - FINDER_CLASS_NAME_ENTITY, "fetchByLoginName", - new String[] { String.class.getName() }, - SportelloModelImpl.LOGINNAME_COLUMN_BITMASK); - public static final FinderPath FINDER_PATH_COUNT_BY_LOGINNAME = new FinderPath(SportelloModelImpl.ENTITY_CACHE_ENABLED, + FINDER_CLASS_NAME_ENTITY, "fetchByComuneId", + new String[] { Long.class.getName() }, + SportelloModelImpl.COMUNEID_COLUMN_BITMASK); + public static final FinderPath FINDER_PATH_COUNT_BY_COMUNEID = new FinderPath(SportelloModelImpl.ENTITY_CACHE_ENABLED, SportelloModelImpl.FINDER_CACHE_ENABLED, Long.class, - FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByLoginName", - new String[] { String.class.getName() }); + FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByComuneId", + new String[] { Long.class.getName() }); /** - * Returns the sportello where loginName = ? or throws a {@link it.mwg.sicilia.sue.NoSuchSportelloException} if it could not be found. + * Returns the sportello where comuneId = ? or throws a {@link it.mwg.sicilia.sue.NoSuchSportelloException} if it could not be found. * - * @param loginName the login name + * @param comuneId the comune ID * @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 findByLoginName(String loginName) + public Sportello findByComuneId(long comuneId) throws NoSuchSportelloException, SystemException { - Sportello sportello = fetchByLoginName(loginName); + Sportello sportello = fetchByComuneId(comuneId); if (sportello == null) { StringBundler msg = new StringBundler(4); msg.append(_NO_SUCH_ENTITY_WITH_KEY); - msg.append("loginName="); - msg.append(loginName); + msg.append("comuneId="); + msg.append(comuneId); msg.append(StringPool.CLOSE_CURLY_BRACE); @@ -130,42 +127,41 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl } /** - * Returns the sportello where loginName = ? or returns null if it could not be found. Uses the finder cache. + * Returns the sportello where comuneId = ? or returns null if it could not be found. Uses the finder cache. * - * @param loginName the login name + * @param comuneId the comune ID * @return the matching sportello, or null if a matching sportello could not be found * @throws SystemException if a system exception occurred */ @Override - public Sportello fetchByLoginName(String loginName) - throws SystemException { - return fetchByLoginName(loginName, true); + public Sportello fetchByComuneId(long comuneId) throws SystemException { + return fetchByComuneId(comuneId, true); } /** - * Returns the sportello where loginName = ? or returns null if it could not be found, optionally using the finder cache. + * Returns the sportello where comuneId = ? or returns null if it could not be found, optionally using the finder cache. * - * @param loginName the login name + * @param comuneId the comune ID * @param retrieveFromCache whether to use the finder cache * @return the matching sportello, or null if a matching sportello could not be found * @throws SystemException if a system exception occurred */ @Override - public Sportello fetchByLoginName(String loginName, - boolean retrieveFromCache) throws SystemException { - Object[] finderArgs = new Object[] { loginName }; + public Sportello fetchByComuneId(long comuneId, boolean retrieveFromCache) + throws SystemException { + Object[] finderArgs = new Object[] { comuneId }; Object result = null; if (retrieveFromCache) { - result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_LOGINNAME, + result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_COMUNEID, finderArgs, this); } if (result instanceof Sportello) { Sportello sportello = (Sportello)result; - if (!Validator.equals(loginName, sportello.getLoginName())) { + if ((comuneId != sportello.getComuneId())) { result = null; } } @@ -175,19 +171,7 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl query.append(_SQL_SELECT_SPORTELLO_WHERE); - boolean bindLoginName = false; - - if (loginName == null) { - query.append(_FINDER_COLUMN_LOGINNAME_LOGINNAME_1); - } - else if (loginName.equals(StringPool.BLANK)) { - query.append(_FINDER_COLUMN_LOGINNAME_LOGINNAME_3); - } - else { - bindLoginName = true; - - query.append(_FINDER_COLUMN_LOGINNAME_LOGINNAME_2); - } + query.append(_FINDER_COLUMN_COMUNEID_COMUNEID_2); String sql = query.toString(); @@ -200,39 +184,29 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl QueryPos qPos = QueryPos.getInstance(q); - if (bindLoginName) { - qPos.add(loginName); - } + qPos.add(comuneId); List list = q.list(); if (list.isEmpty()) { - FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_LOGINNAME, + FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COMUNEID, finderArgs, list); } else { - if ((list.size() > 1) && _log.isWarnEnabled()) { - _log.warn( - "SportelloPersistenceImpl.fetchByLoginName(String, boolean) with parameters (" + - StringUtil.merge(finderArgs) + - ") yields a result set with more than 1 result. This violates the logical unique restriction. There is no order guarantee on which result is returned by this finder."); - } - Sportello sportello = list.get(0); result = sportello; cacheResult(sportello); - if ((sportello.getLoginName() == null) || - !sportello.getLoginName().equals(loginName)) { - FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_LOGINNAME, + if ((sportello.getComuneId() != comuneId)) { + FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COMUNEID, finderArgs, sportello); } } } catch (Exception e) { - FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_LOGINNAME, + FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_COMUNEID, finderArgs); throw processException(e); @@ -251,32 +225,32 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl } /** - * Removes the sportello where loginName = ? from the database. + * Removes the sportello where comuneId = ? from the database. * - * @param loginName the login name + * @param comuneId the comune ID * @return the sportello that was removed * @throws SystemException if a system exception occurred */ @Override - public Sportello removeByLoginName(String loginName) + public Sportello removeByComuneId(long comuneId) throws NoSuchSportelloException, SystemException { - Sportello sportello = findByLoginName(loginName); + Sportello sportello = findByComuneId(comuneId); return remove(sportello); } /** - * Returns the number of sportellos where loginName = ?. + * Returns the number of sportellos where comuneId = ?. * - * @param loginName the login name + * @param comuneId the comune ID * @return the number of matching sportellos * @throws SystemException if a system exception occurred */ @Override - public int countByLoginName(String loginName) throws SystemException { - FinderPath finderPath = FINDER_PATH_COUNT_BY_LOGINNAME; + public int countByComuneId(long comuneId) throws SystemException { + FinderPath finderPath = FINDER_PATH_COUNT_BY_COMUNEID; - Object[] finderArgs = new Object[] { loginName }; + Object[] finderArgs = new Object[] { comuneId }; Long count = (Long)FinderCacheUtil.getResult(finderPath, finderArgs, this); @@ -286,19 +260,7 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl query.append(_SQL_COUNT_SPORTELLO_WHERE); - boolean bindLoginName = false; - - if (loginName == null) { - query.append(_FINDER_COLUMN_LOGINNAME_LOGINNAME_1); - } - else if (loginName.equals(StringPool.BLANK)) { - query.append(_FINDER_COLUMN_LOGINNAME_LOGINNAME_3); - } - else { - bindLoginName = true; - - query.append(_FINDER_COLUMN_LOGINNAME_LOGINNAME_2); - } + query.append(_FINDER_COLUMN_COMUNEID_COMUNEID_2); String sql = query.toString(); @@ -311,9 +273,7 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl QueryPos qPos = QueryPos.getInstance(q); - if (bindLoginName) { - qPos.add(loginName); - } + qPos.add(comuneId); count = (Long)q.uniqueResult(); @@ -332,9 +292,7 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl return count.intValue(); } - private static final String _FINDER_COLUMN_LOGINNAME_LOGINNAME_1 = "sportello.loginName IS NULL"; - private static final String _FINDER_COLUMN_LOGINNAME_LOGINNAME_2 = "sportello.loginName = ?"; - private static final String _FINDER_COLUMN_LOGINNAME_LOGINNAME_3 = "(sportello.loginName IS NULL OR sportello.loginName = '')"; + private static final String _FINDER_COLUMN_COMUNEID_COMUNEID_2 = "sportello.comuneId = ?"; public SportelloPersistenceImpl() { setModelClass(Sportello.class); @@ -350,8 +308,8 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl EntityCacheUtil.putResult(SportelloModelImpl.ENTITY_CACHE_ENABLED, SportelloImpl.class, sportello.getPrimaryKey(), sportello); - FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_LOGINNAME, - new Object[] { sportello.getLoginName() }, sportello); + FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COMUNEID, + new Object[] { sportello.getComuneId() }, sportello); sportello.resetOriginalValues(); } @@ -428,23 +386,23 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl protected void cacheUniqueFindersCache(Sportello sportello) { if (sportello.isNew()) { - Object[] args = new Object[] { sportello.getLoginName() }; + Object[] args = new Object[] { sportello.getComuneId() }; - FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_LOGINNAME, args, + FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_COMUNEID, args, Long.valueOf(1)); - FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_LOGINNAME, args, + FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COMUNEID, args, sportello); } else { SportelloModelImpl sportelloModelImpl = (SportelloModelImpl)sportello; if ((sportelloModelImpl.getColumnBitmask() & - FINDER_PATH_FETCH_BY_LOGINNAME.getColumnBitmask()) != 0) { - Object[] args = new Object[] { sportello.getLoginName() }; + FINDER_PATH_FETCH_BY_COMUNEID.getColumnBitmask()) != 0) { + Object[] args = new Object[] { sportello.getComuneId() }; - FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_LOGINNAME, args, + FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_COMUNEID, args, Long.valueOf(1)); - FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_LOGINNAME, args, + FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_COMUNEID, args, sportello); } } @@ -453,17 +411,17 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl protected void clearUniqueFindersCache(Sportello sportello) { SportelloModelImpl sportelloModelImpl = (SportelloModelImpl)sportello; - Object[] args = new Object[] { sportello.getLoginName() }; + Object[] args = new Object[] { sportello.getComuneId() }; - FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_LOGINNAME, args); - FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_LOGINNAME, args); + FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_COMUNEID, args); + FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_COMUNEID, args); if ((sportelloModelImpl.getColumnBitmask() & - FINDER_PATH_FETCH_BY_LOGINNAME.getColumnBitmask()) != 0) { - args = new Object[] { sportelloModelImpl.getOriginalLoginName() }; + FINDER_PATH_FETCH_BY_COMUNEID.getColumnBitmask()) != 0) { + args = new Object[] { sportelloModelImpl.getOriginalComuneId() }; - FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_LOGINNAME, args); - FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_LOGINNAME, args); + FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_COMUNEID, args); + FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_COMUNEID, args); } } @@ -631,9 +589,10 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl sportelloImpl.setUserName(sportello.getUserName()); sportelloImpl.setCreateDate(sportello.getCreateDate()); sportelloImpl.setModifiedDate(sportello.getModifiedDate()); - sportelloImpl.setLoginName(sportello.getLoginName()); - sportelloImpl.setPassword(sportello.getPassword()); - sportelloImpl.setNonce(sportello.getNonce()); + sportelloImpl.setEmail(sportello.getEmail()); + sportelloImpl.setComuneId(sportello.getComuneId()); + sportelloImpl.setApiKey(sportello.getApiKey()); + sportelloImpl.setAttivo(sportello.isAttivo()); return sportelloImpl; } @@ -911,11 +870,6 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl return count.intValue(); } - @Override - protected Set getBadColumnNames() { - return _badColumnNames; - } - /** * Initializes the sportello persistence. */ @@ -958,9 +912,6 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = GetterUtil.getBoolean(PropsUtil.get( PropsKeys.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE)); private static Log _log = LogFactoryUtil.getLog(SportelloPersistenceImpl.class); - private static Set _badColumnNames = SetUtil.fromArray(new String[] { - "password" - }); private static Sportello _nullSportello = new SportelloImpl() { @Override public Object clone() { diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/startup/Startup.java b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/startup/Startup.java new file mode 100644 index 00000000..ffbb0da3 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/startup/Startup.java @@ -0,0 +1,75 @@ +package it.mwg.sicilia.sue.startup; + +import it.mwg.sicilia.sue.api.v1.ApiConstants; +import it.mwg.sicilia.sue.service.ApiSettingLocalServiceUtil; + +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.NoSuchAlgorithmException; + +import org.apache.commons.codec.digest.DigestUtils; + +import com.liferay.portal.kernel.events.ActionException; +import com.liferay.portal.kernel.events.SimpleAction; +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.security.SecureRandom; +import com.liferay.portal.kernel.util.Base64; +import com.liferay.portal.kernel.util.Validator; + +public class Startup extends SimpleAction { + + private static final Log _log = LogFactoryUtil.getLog(Startup.class); + + @Override + public void run(String[] ids) throws ActionException { + for (String id : ids) { + long companyId = Long.parseLong(id); + String secret = null; + try { + secret = ApiSettingLocalServiceUtil.get(companyId, ApiConstants.API_SECRET); + _log.info("apiSetting = " + secret); + if (Validator.isNull(secret)) { + SecureRandom rnd = new SecureRandom(); + byte[] bytes = new byte[32]; + rnd.nextBytes(bytes); + ApiSettingLocalServiceUtil.set(companyId, ApiConstants.API_SECRET, DigestUtils.sha256Hex(bytes)); + } + } catch (SystemException e) { + _log.error(e, e); + } + chiavi(companyId); + } + } + + private void chiavi(long companyId) { + + String s1 = null; + String s2 = null; + try { + s1 = ApiSettingLocalServiceUtil.get(companyId, ApiConstants.API_PRIVATE_KEY); + s2 = ApiSettingLocalServiceUtil.get(companyId, ApiConstants.API_PUBLIC_KEY); + } catch (SystemException e1) { + } + if (Validator.isNull(s1) || Validator.isNull(s2)) { + KeyPairGenerator generator = null; + try { + generator = KeyPairGenerator.getInstance("RSA"); + } catch (NoSuchAlgorithmException e) { + } + if (Validator.isNotNull(generator)) { + generator.initialize(1024); + KeyPair pair = generator.generateKeyPair(); + try { + ApiSettingLocalServiceUtil.set(companyId, ApiConstants.API_PRIVATE_KEY, + Base64.encode(pair.getPrivate().getEncoded())); + ApiSettingLocalServiceUtil.set(companyId, ApiConstants.API_PUBLIC_KEY, + Base64.encode(pair.getPublic().getEncoded())); + } catch (SystemException e) { + e.printStackTrace(); + } + } + } + } +} diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/portal.properties b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/portal.properties new file mode 100644 index 00000000..5d5ae049 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/portal.properties @@ -0,0 +1 @@ +application.startup.events=it.mwg.sicilia.sue.startup.Startup diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/service.properties index c0e63051..a9d58c54 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/service.properties +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/service.properties @@ -13,8 +13,8 @@ ## build.namespace=sicilia_sue - build.number=8 - build.date=1622735407837 + build.number=41 + build.date=1623664988040 build.auto.upgrade=true ## diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/administration/edit_sportello.jsp b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/administration/edit_sportello.jsp index a515b324..bdc5727b 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/administration/edit_sportello.jsp +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/administration/edit_sportello.jsp @@ -1,3 +1,98 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="com.liferay.portal.kernel.util.ParamUtil"%> +<%@page import="com.liferay.portal.kernel.util.StringPool"%> +<%@page import="com.liferay.portal.kernel.util.Validator"%> +<%@page import="it.mwg.sicilia.sue.api.v1.ApiUtil"%> <%@page import="it.mwg.sicilia.sue.model.Sportello"%> -

Edit

\ No newline at end of file +<%@page import="it.mwg.sicilia.sue.portlet.SueAdministrationPortlet"%> +<%@page import="it.mwg.sicilia.sue.service.SportelloLocalServiceUtil"%> +<%@include file="/html/init.jsp"%> + +<% +long sportelloId = ParamUtil.getLong(request, "sportelloId", 0); +Sportello sportello = sportelloId == 0 ? null : SportelloLocalServiceUtil.getSportello(sportelloId); +%> + + + + + + + + + + + + + + + + + + + + +A.mix( + A.config.FormValidator.RULES, { + requiredSelect: function(value, fieldNode, ruleValue) { + return value !== '0' && value !== '' && value !== undefined; + }, + }, + true +); +new A.FormValidator({ + boundingBox: document.edit, + rules: { + provincia:{ + requiredSelect:'provincia' + }, + comune:{ + requiredSelect:'comune' + }, + }, +}); +var getProvince = function(callback) { + A.io.request('<%= getProvinceURL %>', { + dataType: 'json', + on: { + success: function() { + callback(this.get('responseData')); + }, + }, + }); +}; +var getComuni = function(callback, codice) { + A.io.request('<%= getComuniURL %>', { + data: { + codice: codice, + }, + dataType: 'json', + on: { + success: function() { + callback(this.get('responseData')); + }, + }, + }); +}; +new Liferay.DynamicSelect([ + { + select: 'provincia', + selectData: getProvince, + selectDesc: 'desc', + selectId: 'id', + selectSort: true, + selectVal: '<%= Validator.isNull(sportello) ? "0" : sportello.getCodiceProvincia() %>', + }, + { + select: 'comune', + selectData: getComuni, + selectDesc: 'desc', + selectId: 'id', + selectSort: true, + selectVal: '<%= Validator.isNull(sportello) ? 0 : sportello.getComuneId() %>', + }, +]); + \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/administration/view.jsp b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/administration/view.jsp index ffe03a28..66a03fb0 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/administration/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/administration/view.jsp @@ -1,11 +1,9 @@ +<%@page import="java.text.NumberFormat"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="it.mwg.sicilia.sue.model.Sportello"%> <%@page import="it.mwg.sicilia.sue.service.SportelloLocalServiceUtil"%> <%@page import="java.util.List"%> <%@include file="/html/init.jsp"%> -<% -%> -

Amministrazione

@@ -19,7 +17,25 @@ + <% + NumberFormat format = NumberFormat.getInstance(); + %> + + + + + + + + + + + + + + + diff --git a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/init.jsp b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/init.jsp index 1497071d..4fc16bf4 100644 --- a/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/html/init.jsp @@ -6,6 +6,7 @@ <%@taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet"%> <%@taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme"%> <%@taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui"%> +<%@taglib uri="http://liferay.com/tld/util" prefix="liferay-util"%> <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> <%@page import="com.liferay.portlet.PortletURLUtil"%>