Sfoglia il codice sorgente

Setup preliminare web services

master
Salvatore La Manna 4 anni fa
parent
commit
e5948292f4
  1. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ParereGeologoLocalServiceImpl.java
  2. 2
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/.project
  3. 33
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/.settings/com.liferay.ide.project.core.prefs
  4. 2
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/.settings/com.liferay.ide.sdk.core.prefs
  5. 2
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/.settings/org.eclipse.ltk.core.refactoring.prefs
  6. 2
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/.settings/org.eclipse.wst.ws.service.policy.prefs
  7. 2
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/build.xml
  8. 1
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/.gitignore
  9. BIN
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/lib/sicilia-sue-connector-portlet-service.jar
  10. BIN
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/lib/util-java.jar
  11. 2
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/liferay-display.xml
  12. 5
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/liferay-hook.xml
  13. 2
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/liferay-plugin-package.properties
  14. 2
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/liferay-portlet.xml
  15. 1
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/service.xml
  16. 10
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/tables.sql
  17. 40
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/common/Action.java
  18. 39
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/common/ApiResponse.java
  19. 22
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Actions.java
  20. 21
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiServlet.java
  21. 1
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloImpl.java
  22. 1
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/portal.properties
  23. 1
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/service-ext.properties
  24. 4
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/service.properties
  25. 5
      liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/web.xml

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ParereGeologoLocalServiceImpl.java

@ -116,7 +116,7 @@ public class ParereGeologoLocalServiceImpl extends ParereGeologoLocalServiceBase
folder = dlAppLocalService.addFolder(serviceContext.getUserId(), defaultFolder.getRepositoryId(),
defaultFolder.getFolderId(), folderName, StringPool.BLANK, serviceContext);
}
String title = now.getTime() + "_parere_geologo_" + parereGeologoId + StringPool.UNDERLINE + fileName;
String title = now.getTime() + "_parere_" + parereGeologoId + StringPool.UNDERLINE + fileName;
String description = StringPool.BLANK;
String mimeType = MimeTypesUtil.getContentType(fileName);
String changeLog = StringPool.BLANK;

2
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/.project

@ -31,7 +31,7 @@
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.apache.ivyde.eclipse.ivynature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.apache.ivyde.eclipse.ivynature</nature>
</natures>
</projectDescription>

33
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/.settings/com.liferay.ide.project.core.prefs

@ -0,0 +1,33 @@
eclipse.preferences.version=1
liferay-display-xml-reference-not-found=2
liferay-display-xml-resource-not-found=2
liferay-display-xml-syntax-invalid=2
liferay-display-xml-type-hierarchy-incorrect=2
liferay-display-xml-type-not-found=2
liferay-hook-xml-reference-not-found=2
liferay-hook-xml-resource-not-found=2
liferay-hook-xml-syntax-invalid=2
liferay-hook-xml-type-hierarchy-incorrect=2
liferay-hook-xml-type-not-found=2
liferay-jsp-files-java-method-not-found=2
liferay-jsp-files-resource-property-not-found=2
liferay-layout-templates-xml-reference-not-found=2
liferay-layout-templates-xml-resource-not-found=2
liferay-layout-templates-xml-syntax-invalid=2
liferay-layout-templates-xml-type-hierarchy-incorrect=2
liferay-layout-templates-xml-type-not-found=2
liferay-portlet-xml-reference-not-found=2
liferay-portlet-xml-resource-not-found=2
liferay-portlet-xml-syntax-invalid=2
liferay-portlet-xml-type-hierarchy-incorrect=2
liferay-portlet-xml-type-not-found=2
portlet-xml-reference-not-found=2
portlet-xml-resource-not-found=2
portlet-xml-syntax-invalid=2
portlet-xml-type-hierarchy-incorrect=2
portlet-xml-type-not-found=2
service-xml-reference-not-found=2
service-xml-resource-not-found=2
service-xml-syntax-invalid=2
service-xml-type-hierarchy-incorrect=2
service-xml-type-not-found=2

2
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/.settings/com.liferay.ide.sdk.core.prefs

@ -0,0 +1,2 @@
eclipse.preferences.version=1
sdk-name=liferay-plugins-sdk-6.2

2
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/.settings/org.eclipse.ltk.core.refactoring.prefs

@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false

2
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/.settings/org.eclipse.wst.ws.service.policy.prefs

@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.wst.ws.service.policy.projectEnabled=false

2
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/build.xml

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE project>
<project name="sicilia-sue-connector-portlet" basedir="." default="deploy">
<property name="import.shared" value="portos-bo-shared" />
<import file="../build-common-portlet.xml" />
</project>

1
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/.gitignore vendored

@ -1 +0,0 @@
/classes/

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

File binario non mostrato.

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

File binario non mostrato.

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

@ -2,7 +2,7 @@
<!DOCTYPE display PUBLIC "-//Liferay//DTD Display 6.2.0//EN" "http://www.liferay.com/dtd/liferay-display_6_2_0.dtd">
<display>
<category name="category.sample">
<category name="category.tools">
<portlet id="sicilia-sue-connector" />
</category>
</display>

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

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd">
<hook>
<portal-properties>portal.properties</portal-properties>
</hook>

2
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/liferay-plugin-package.properties

@ -9,6 +9,4 @@ page-url=http://www.liferay.com
author=Liferay, Inc.
licenses=LGPL
liferay-versions=6.2.0+
#portal-dependency-jars=
#portal-dependency-tlds=c.tld
required-deployment-contexts=portos-bo-portlet

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

@ -7,7 +7,7 @@
<icon>/icon.png</icon>
<header-portlet-css>/css/main.css</header-portlet-css>
<footer-portlet-javascript>/js/main.js</footer-portlet-javascript>
<css-class-wrapper>sicilia-sue-connector-portlet</css-class-wrapper>
<css-class-wrapper>sicilia-sue-connector</css-class-wrapper>
</portlet>
<role-mapper>
<role-name>administrator</role-name>

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

@ -3,7 +3,6 @@
<service-builder package-path="it.mwg.sicilia.sue">
<author>Manifattura Web Group Srl</author>
<namespace>sicilia_sue</namespace>
<entity name="Sportello" local-service="true" remote-service="true">
<!-- PK fields -->
<column name="sportelloId" type="long" primary="true" />

10
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/sql/tables.sql

@ -1,13 +1,3 @@
create table sicilia_sue_SUE (
sueId LONG not null primary key,
groupId LONG,
companyId LONG,
userId LONG,
userName VARCHAR(75) null,
createDate DATE null,
modifiedDate DATE null
);
create table sicilia_sue_Sportello (
sportelloId LONG not null primary key,
groupId LONG,

40
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/common/Action.java

@ -0,0 +1,40 @@
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;
}
}

39
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/common/ApiResponse.java

@ -0,0 +1,39 @@
package it.mwg.sicilia.sue.api.common;
import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.json.JSONSerializer;
public class ApiResponse {
private int code;
private String message;
private static final JSONSerializer serializer = JSONFactoryUtil.createJSONSerializer().exclude("class");
public ApiResponse(int code, String message) {
this.setCode(code);
this.setMessage(message);
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public String toString() {
return serializer.serialize(this);
}
}

22
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/Actions.java

@ -0,0 +1,22 @@
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<Action> ACTIONS = new ArrayList<Action>() {
{
add(new Action("login", "Login", HttpMethods.POST));
}
};
public static List<Action> getActions() {
return ACTIONS;
}
}

21
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/api/v1/ApiServlet.java

@ -1,8 +1,7 @@
/**
*
*/
package it.mwg.sicilia.sue.api.v1;
import it.mwg.sicilia.sue.api.common.ApiResponse;
import java.io.IOException;
import javax.servlet.ServletException;
@ -20,11 +19,25 @@ public class ApiServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
ServletResponseUtil.write(response, "API V1 " + this.getServletContext().getContextPath());
String path = request.getPathInfo().substring(1);
switch (path) {
case "login":
ServletResponseUtil.write(response, new ApiResponse(0, "Ok").toString());
break;
default:
response.sendError(HttpServletResponse.SC_NOT_FOUND, request.getRequestURI());
}
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {
String path = request.getPathInfo().substring(1);
switch (path) {
default:
response.sendError(HttpServletResponse.SC_NOT_FOUND, request.getRequestURI());
}
}
}

1
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/it/mwg/sicilia/sue/model/impl/SportelloImpl.java

@ -23,6 +23,7 @@ package it.mwg.sicilia.sue.model.impl;
*
* @author Manifattura Web Group Srl
*/
@SuppressWarnings("serial")
public class SportelloImpl extends SportelloBaseImpl {
/*
* NOTE FOR DEVELOPERS:

1
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/portal.properties

@ -1 +0,0 @@
a=b

1
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/service-ext.properties

@ -1 +0,0 @@
build.auto.upgrade=false

4
liferay-plugins-sdk-6.2/portlets/sicilia-sue-connector-portlet/docroot/WEB-INF/src/service.properties

@ -13,8 +13,8 @@
##
build.namespace=sicilia_sue
build.number=3
build.date=1620398647281
build.number=4
build.date=1621344885196
build.auto.upgrade=true
##

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

@ -2,13 +2,12 @@
<web-app id="WebApp_ID" version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>ApiServlet</servlet-name>
<servlet-name>ApiServletV1</servlet-name>
<servlet-class>it.mwg.sicilia.sue.api.v1.ApiServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ApiServlet</servlet-name>
<servlet-name>ApiServletV1</servlet-name>
<url-pattern>/api/v1/*</url-pattern>
</servlet-mapping>
</web-app>
Caricamento…
Annulla
Salva