diff --git a/.github/workflows/build_publish.yml b/.github/workflows/build_publish.yml index d5b8d01c..22b3ddb9 100644 --- a/.github/workflows/build_publish.yml +++ b/.github/workflows/build_publish.yml @@ -4,6 +4,7 @@ on: branches: - master - 'release-*' + - 'velocity-issue-test' tags: - '[0-9]+.[0-9]+.[0-9]+' paths-ignore: diff --git a/openerp-atomfeed-service/src/main/java/org/bahmni/feed/openerp/client/AtomFeedClientHelper.java b/openerp-atomfeed-service/src/main/java/org/bahmni/feed/openerp/client/AtomFeedClientHelper.java index c887242f..84feddb0 100644 --- a/openerp-atomfeed-service/src/main/java/org/bahmni/feed/openerp/client/AtomFeedClientHelper.java +++ b/openerp-atomfeed-service/src/main/java/org/bahmni/feed/openerp/client/AtomFeedClientHelper.java @@ -51,6 +51,8 @@ FeedClient getAtomFeedClient(FeedURI jobName, FeedClientFactory feedClientFactor AllMarkers allMarkers = new AllMarkersJdbcImpl(transactionManager); AllFailedEvents allFailedEvents = new AllFailedEventsJdbcImpl(transactionManager); String isRestEnabled = environment.getProperty(AtomfeedServiceConstants.IS_REST_ENABLED.getAtomfeedServiceConstants()); + System.out.println("*******************************************************************"); + System.out.println("The Sync will start now for Odoo"+isRestEnabled?"16":"10"); boolean isRestEnabledValue = Boolean.parseBoolean(isRestEnabled); OpenERPContext openERPContext = isRestEnabledValue ? new OpenERPContext(odooRESTClient) : new OpenERPContext(openERPXMLClient); return feedClientFactory.getFeedClient(atomFeedProperties, transactionManager, openERPContext, allFeeds, allMarkers, allFailedEvents, jobName, isRestEnabledValue); diff --git a/openerp-client/src/main/java/org/bahmni/openerp/web/client/strategy/implementation/OdooRESTClient.java b/openerp-client/src/main/java/org/bahmni/openerp/web/client/strategy/implementation/OdooRESTClient.java index 07af23eb..99d5acf5 100644 --- a/openerp-client/src/main/java/org/bahmni/openerp/web/client/strategy/implementation/OdooRESTClient.java +++ b/openerp-client/src/main/java/org/bahmni/openerp/web/client/strategy/implementation/OdooRESTClient.java @@ -28,7 +28,10 @@ public OdooRESTClient(OpenERPProperties openERPProperties) { @Override public Object execute(OpenERPRequest openERPRequest, String URI) { + System.out.println("-------------REQUEST EXECUTION STARTED-----------------"); String requestBody = RequestBuilder.buildNewRestRequest(openERPRequest, UUID.randomUUID().toString()); + System.out.println("Request Body : "+requestBody); + System.out.println("-------------REQUEST EXECUTION ENDED-----------------"); return restClient.post(URI, requestBody); } } diff --git a/openerp-client/src/main/java/org/bahmni/openerp/web/client/strategy/implementation/OpenERPXMLClient.java b/openerp-client/src/main/java/org/bahmni/openerp/web/client/strategy/implementation/OpenERPXMLClient.java index 81bf3659..779b80e9 100644 --- a/openerp-client/src/main/java/org/bahmni/openerp/web/client/strategy/implementation/OpenERPXMLClient.java +++ b/openerp-client/src/main/java/org/bahmni/openerp/web/client/strategy/implementation/OpenERPXMLClient.java @@ -52,26 +52,30 @@ public OpenERPXMLClient(XMLClient xmlClient, OpenERPProperties openERPProperties private void login() { if (id == null) { + System.out.println("-------------LOGIN STARTED-----------------"); XmlRpcClient loginRpcClient = xmlRpcClient(XML_RPC_COMMON_ENDPOINT); - Vector params = new Vector(); params.addElement(database); params.addElement(user); params.addElement(password); - Object loginId = executeRPC(loginRpcClient, params, "login"); if(loginId == null || loginId.getClass() != Integer.class) throw new OpenERPException(String.format("Failed to login. The login id is : %s", loginId)); id = loginId; + System.out.println("-------------LOGIN ENDED-----------------"); } } @Override public Object execute(OpenERPRequest openERPRequest, String URI) { login(); + System.out.println("-------------REQUEST EXECUTION STARTED-----------------"); String request = RequestBuilder.buildNewXMLRequest(openERPRequest, id, database, password); + System.out.println("Request Body : "+request); String response = httpClient().post("http://" + host + ":" + port + XML_RPC_OBJECT_ENDPOINT, request); new OpenERPResponseErrorValidator().checkForError(response); + System.out.println("Response Body : "+response); + System.out.println("-------------REQUEST EXECUTION ENDED-----------------"); return response; } diff --git a/openerp-client/src/main/java/org/bahmni/openerp/web/request/builder/RequestBuilder.java b/openerp-client/src/main/java/org/bahmni/openerp/web/request/builder/RequestBuilder.java index e6004c44..beda6257 100644 --- a/openerp-client/src/main/java/org/bahmni/openerp/web/request/builder/RequestBuilder.java +++ b/openerp-client/src/main/java/org/bahmni/openerp/web/request/builder/RequestBuilder.java @@ -30,9 +30,18 @@ public static String buildNewXMLRequest(OpenERPRequest openERPRequest, Object id context.put("password", password); context.put("resource", openERPRequest.getResource()); context.put("operation", openERPRequest.getOperation()); - + System.out.println("------------------------------"); + System.out.println(template.getName()); + System.out.println("Context Parameters " + context.get("parametersList")); + System.out.println("Context id " + context.get("id")); + System.out.println("Context database " + context.get("database")); + System.out.println("Context password " + context.get("password")); + System.out.println("Context resource " + context.get("resource")); + System.out.println("Context operation " + context.get("operation")); StringWriter writer = new StringWriter(); template.merge(context, writer); + System.out.println("writer.toString() = \n" + writer); + System.out.println("------------------------------"); return writer.toString(); } catch (Exception e) { throw new OpenERPException(e); @@ -51,6 +60,9 @@ public static String buildNewRestRequest(OpenERPRequest openERPRequest, String i context.put("id", id); StringWriter writer = new StringWriter(); template.merge(context, writer); + System.out.println("------------------------------"); + System.out.println("writer.toString() = \n" + writer); + System.out.println("------------------------------"); return writer.toString(); } catch (Exception e) { throw new OpenERPException(e);