Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Headless Commerce Plugin Implementation #45

Open
wants to merge 43 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
8a80cfc
Implemented: Added the basic directory structure of the headless comm…
lodhiravi Oct 22, 2020
bc64894
Implemented: Added password-hint api.
lodhiravi Oct 22, 2020
7bd7d0f
Implemented: Adding the xml based REST DSL file for headless commerce…
lodhiravi Oct 22, 2020
12bdf69
Implemented: Added rest api for sending reset password mail.
lodhiravi Oct 23, 2020
52803db
Implemented: Added rest api for the user registration. Also did some …
lodhiravi Oct 24, 2020
61defea
Merge branch 'trunk' of https://github.com/apache/ofbiz-plugins into …
lodhiravi Oct 26, 2020
aec4fbb
Improved: Removed log statement committed accidentally.
lodhiravi Oct 26, 2020
285aa4a
Implemented: Added api to change password.
lodhiravi Oct 26, 2020
11ee733
Improved: Corrected field types in create customer api..
lodhiravi Oct 27, 2020
38c72d2
Implemented: Added service to get the customer profile data.
lodhiravi Oct 27, 2020
8725b25
Merge branch 'trunk' of https://github.com/apache/ofbiz-plugins into …
lodhiravi Oct 27, 2020
a8f8776
Improved: Remove unnecessary code.
lodhiravi Oct 27, 2020
f000c7c
Improved: Formatting changes.
lodhiravi Oct 27, 2020
15f2b4e
Implementred: Restructured information to return the contact informat…
lodhiravi Oct 28, 2020
6e1ae26
Implemented: Added logic to fetch the payment methods for the custome…
lodhiravi Oct 28, 2020
fd4a766
Implemented: Added user's contact lists and communications to the cus…
lodhiravi Oct 29, 2020
21338e7
Implemented: Added support to filter out the customer profile detail.…
lodhiravi Oct 29, 2020
70d15a5
Improved: Formatting changes only.
lodhiravi Oct 29, 2020
8caed70
Implemented: Added endpoint to update the customer personal information.
lodhiravi Oct 30, 2020
ae87d9b
Implemented: Added endPoints to create, update and delete postal addr…
lodhiravi Oct 30, 2020
491e3e7
Implemented: Added endPoints to create/update telecom number. Also mo…
lodhiravi Nov 2, 2020
5eaba8c
Implemented: Modified code to combine create/update postal address lo…
lodhiravi Nov 2, 2020
a5b3ec0
Improved: Formatting changes only.
lodhiravi Nov 2, 2020
1c9debe
Implemented: Added endpoints to remove a contact purpose.
lodhiravi Nov 2, 2020
92e583b
Fixed: corrected syntax.
lodhiravi Nov 2, 2020
54a8ce6
Implemented: Added endPoints to create/update email address.
lodhiravi Nov 3, 2020
33387e9
Implemented: Added endpoints to create/update customer contact inform…
lodhiravi Nov 3, 2020
e99ae43
Implemented: Added endpoints to create/update credit card, gift card …
lodhiravi Nov 4, 2020
99bd192
Improved: Added permisson service to check if the requesting user is …
lodhiravi Nov 4, 2020
e9e63d7
Improved: Removed unused variables and did some minor improvement.
lodhiravi Nov 6, 2020
11c18bf
Improved: Done some code optimization.
lodhiravi Nov 6, 2020
f0643d8
Implemented: Added endpoints to delete payment methods.
lodhiravi Nov 6, 2020
7e00dc2
Merge branch 'trunk' of https://github.com/apache/ofbiz-plugins into …
lodhiravi Nov 23, 2020
ae178d0
Implemented: Removed home phone, work phone, fax number from create c…
lodhiravi Nov 23, 2020
76b898e
Improved: Removed filter parameter from get customer profile endpoint…
lodhiravi Nov 23, 2020
27a6fc9
Improved: Formatting changes only
lodhiravi Nov 23, 2020
6ef3649
Improved: Combined credit card, gift card and eft account creation th…
lodhiravi Nov 23, 2020
7a99ba6
Improved: Retruned only personal information and loyalty points infor…
lodhiravi Nov 28, 2020
eeb4045
Implemented: Added endpoint to get the shipping addresses.
lodhiravi Nov 28, 2020
825ad33
Merge branch 'trunk' of https://github.com/apache/ofbiz-plugins into …
lodhiravi Dec 8, 2020
d717f7c
Merge branch 'trunk' of https://github.com/apache/ofbiz-plugins into …
ravilodhi Apr 10, 2021
8366df5
Improved: Imported specific classes only. (HEADLESS-COMMERCE)
ravilodhi Apr 10, 2021
ecd8c03
Improved: Fixed some checkstyle warnings/errors.(HEADLESS-COMMERCE)
ravilodhi Apr 10, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions headless-commerce/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

The files in this directory are used as templates for the ant create-component target, +
please do not modify them without understanding the effect that it will have on that build target.
43 changes: 43 additions & 0 deletions headless-commerce/api/headless-commerce.rest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<api description="Customers API" displayName="Customers API" name="CustomersAPI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="rest-api.xsd">
<resource description="" displayName="" enabled="true" name="Customers Resource" path="/hcv1/customers">
<operation verb="post" description="Creates Customer">
<service name="createCustomer"/>
</operation>
<operation verb="get" path="/{customerPartyId}/" description="Retrieves customer profile">
<service name="getCustomer"/>
</operation>
<operation verb="put" path="/{customerPartyId}" description="Updates customer's personal information">
<service name="updatePerson"/>
</operation>
<operation verb="get" path="/{customerPartyId}/shipping-addresses" description="Retrieves shipping addresses">
<service name="getCustomerPostalAddress"/>
</operation>
<operation verb="post" path="/{customerPartyId}/shipping-addresses" description="Creates shipping address">
<service name="createCustomerPostalAddress"/>
</operation>
<operation verb="put" path="/{customerPartyId}/shipping-addresses/{contactMechId}" description="Updates shipping address">
<service name="updateCustomerPostalAddress"/>
</operation>
<operation verb="post" path="/{customerPartyId}/change-password" description="Changes customer's account password">
<service name="changePassword"/>
</operation>
<operation verb="post" path="/reset-password" description="Sends reset password mail">
<service name="sendResetPasswordEmail"/>
</operation>
<operation verb="delete" path="/{customerPartyId}/shipping-addresses/{contactMechId}" description="Expires shipping address">
<service name="removeCustomerContactMech"/>
</operation>
<operation verb="get" path="/{customerPartyId}/payment-methods" description="Get payment methods(credit card, gift card, eft account)">
<service name="getPartyPaymentMethods"/>
</operation>
<operation verb="post" path="/{customerPartyId}/payment-methods" description="Creates payment method(credit card, gift card, eft account)">
<service name="createCustomerPaymentMethod"/>
</operation>
<operation verb="put" path="/{customerPartyId}/payment-methods/{paymentMethodId}" description="Updates payment method(credit card, gift card, eft account)">
<service name="updateCustomerPaymentMethod"/>
</operation>
<operation verb="delete" path="/{customerPartyId}/payment-methods/{paymentMethodId}" description="Deletes payment method(credit card, gift card, eft account)">
<service name="deleteCustomerPaymentMethod"/>
</operation>
</resource>
</api>
37 changes: 37 additions & 0 deletions headless-commerce/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

dependencies {
//Examples of compile-time and runtime dependencies

//pluginLibsCompile 'junit:junit-dep:4.10'
//pluginLibsRuntime 'junit:junit-dep:4.10'
}

task install {
doLast {
// Install logic for this plugin
}
}

task uninstall {
doLast {
// uninstall logic for this plugin
}
}
52 changes: 52 additions & 0 deletions headless-commerce/config/HeadlessCommerceUiLabels.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<property key="HeadlessCommerceApplication">
<value xml:lang="en">HeadlessCommerce Application</value>
<value xml:lang="zh">HeadlessCommerce应用程序</value>
<value xml:lang="zh-TW">HeadlessCommerce應用程式</value>
</property>
<property key="HeadlessCommerceCompanyName">
<value xml:lang="en">OFBiz: HeadlessCommerce</value>
<value xml:lang="zh-TW">OFBiz: HeadlessCommerce</value>
</property>
<property key="HeadlessCommerceCompanySubtitle">
<value xml:lang="en">Part of the Apache OFBiz Family of Open Source Software</value>
<value xml:lang="it">Un modulo della famiglia di software open source Apache OFBiz</value>
<value xml:lang="zh">开源软件OFBiz的组成部分</value>
<value xml:lang="zh-TW">開源軟體OFBiz的組成部分</value>
</property>
<property key="HeadlessCommerceViewPermissionError">
<value xml:lang="en">You are not allowed to view this page.</value>
<value xml:lang="zh">不允许你浏览这个页面。</value>
<value xml:lang="zh-TW">不允許您檢視這個頁面.</value>
</property>
<property key="HCCountrysStateIsNotValid">
<value xml:lang="en">State [${stateCode}] does not in country [${countryCode}]</value>
</property>
<property key="HCInvalidCountryCode">
<value xml:lang="en">Invalid country [${countryCode}]</value>
</property>
<property key="HCAccessDeniedInvalidUser">
<value xml:lang="en">Access denied. Invalid user.</value>
</property>
</resource>

23 changes: 23 additions & 0 deletions headless-commerce/data/HeadlessCommerceDemoData.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

<entity-engine-xml>

</entity-engine-xml>
29 changes: 29 additions & 0 deletions headless-commerce/data/HeadlessCommerceSecurityGroupDemoData.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

<entity-engine-xml>
<SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="FULLADMIN" permissionId="HEADLESS_COMMERCE_ADMIN"/>
<SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="FLEXADMIN" permissionId="HEADLESS_COMMERCE_CREATE"/>
<SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="FLEXADMIN" permissionId="HEADLESS_COMMERCE_DELETE"/>
<SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="FLEXADMIN" permissionId="HEADLESS_COMMERCE_UPDATE"/>
<SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="FLEXADMIN" permissionId="HEADLESS_COMMERCE_VIEW"/>
<SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="VIEWADMIN" permissionId="HEADLESS_COMMERCE_VIEW"/>
<SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="BIZADMIN" permissionId="HEADLESS_COMMERCE_ADMIN"/>
</entity-engine-xml>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

<entity-engine-xml>
<SecurityPermission description="View operations in the HeadlessCommerce Component." permissionId="HEADLESS_COMMERCE_VIEW"/>
<SecurityPermission description="Create operations in the HeadlessCommerce Component." permissionId="HEADLESS_COMMERCE_CREATE"/>
<SecurityPermission description="Update operations in the HeadlessCommerce Component." permissionId="HEADLESS_COMMERCE_UPDATE"/>
<SecurityPermission description="Delete operations in the HeadlessCommerce Component." permissionId="HEADLESS_COMMERCE_DELETE"/>
<SecurityPermission description="ALL operations in the HeadlessCommerce Component." permissionId="HEADLESS_COMMERCE_ADMIN"/>

<SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="SUPER" permissionId="HEADLESS_COMMERCE_ADMIN"/>

</entity-engine-xml>
23 changes: 23 additions & 0 deletions headless-commerce/data/HeadlessCommerceTypeData.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

<entity-engine-xml>

</entity-engine-xml>
31 changes: 31 additions & 0 deletions headless-commerce/entitydef/entitymodel.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
<!-- ========================================================= -->
<!-- ======================== Defaults ======================= -->
<!-- ========================================================= -->
<title>Entity of HeadlessCommerce Component</title>
<description>None</description>
<copyright></copyright>
<version></version>

</entitymodel>
53 changes: 53 additions & 0 deletions headless-commerce/ofbiz-component.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

<ofbiz-component name="headless-commerce"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<!-- define resource loaders; most common is to use the component resource loader -->
<resource-loader name="main" type="component"/>

<!-- place the config directory on the classpath to access configuration files -->
<classpath type="dir" location="config"/>
<!-- entity resources: model(s), eca(s), group, and data definitions -->
<entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/>
<!-- <entity-resource type="eca" reader-name="main" loader="main" location="entitydef/eecas.xml"/> -->
<entity-resource type="data" reader-name="seed" loader="main" location="data/HeadlessCommerceTypeData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/HeadlessCommerceSecurityPermissionSeedData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/HeadlessCommerceSecurityGroupDemoData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/HeadlessCommerceDemoData.xml"/>

<!-- service resources: model(s), eca(s) and group definitions -->
<service-resource type="model" loader="main" location="servicedef/services.xml"/>
<!--
<service-resource type="eca" loader="main" location="servicedef/secas.xml"/>
<service-resource type="group" loader="main" location="servicedef/groups.xml"/>
-->

<test-suite loader="main" location="testdef/HeadlessCommerceTests.xml"/>

<!-- web applications; will be mounted when using the embedded container -->
<webapp name="headless-commerce"
title="HeadlessCommerce"
server="default-server"
location="webapp/headless-commerce"
base-permission="OFBTOOLS,HEADLESS_COMMERCE"
mount-point="/headless-commerce"/>
</ofbiz-component>
Loading