You are on page 1of 19

CWS and PageBuilder

Copyright © 2021 Blue Yonder Group, Inc.


Legal Notice

COPYRIGHT @ 2020 BLUE YONDER, INC. ALL RIGHTS RESERVED. BLUE YONDER RESERVES THE RIGHT AT ANY TIME AND WITHOUT
NOTICE TO CHANGE THESE MATERIALS OR ANY OF THE FUNCTIONS, FEATURES OR SPECIFICATIONS OF ANY OF THE SOFTWARE
DESCRIBED HEREIN. BLUE YONDER PROVIDES NO WARRANTY NOR INDEMNIFICATION WITH RESPECT TO THESE MATERIALS
AND/OR THE SOFTWARE DESCRIBED HEREIN, EXCEPT AS APPROVED IN BLUE YONDER’S AGREEMENT WITH AN AUTHORIZED
LICENSEE. BLUE YONDER, INC. GRANTS PARTNER AND/OR CUSTOMER REVOKABLE PERMISSION TO USE THE BLUE YONDER
MATERIALS AND IMAGES AS PART OF INTERNAL TRAINING ACCESS SOLELY FOR PRIVATE, NON-COMMERCIAL AND EDUCATION
PURPOSES ONLY, AND NOT FOR RESALE, REPRINT, CLIENT EDUCATION, DOWNLOAD, OR OTHER SHARING.

Copyright © 2021 Blue Yonder Group, Inc. 2


Agenda

• Page Builder
• CWS
• Action Argument Location
• Grids
• Charts
• Advanced CRUD actions
• Filtering
• Sorting
• Paging

Copyright © 2021 Blue Yonder Group, Inc. 3


What is Page Builder

Page Builder is an application, which allows users to create UI pages [forms, grids, charts, dashboards] on top of CWS
or IdentifiableWebResources.
Page Builder allows these pages to be configured further for layout, filtering, loading, labels, context-navigation using
customization features.

Copyright © 2021 Blue Yonder Group, Inc. 4


Page Builder Workflow

Copyright © 2021 Blue Yonder Group, Inc.


What is CWS?

Configurable Web Services


• Allows users to expose MOCA commands without writing or compiling code.
• Consist of Actions and Resources as .action and .resource files.
Action
• Representative of the work carried out by a web service.
• Synonymous with Web Service.
Resource
• Models a real-world object as data.
• Maintains a list of actions.

Copyright © 2021 Blue Yonder Group, Inc. Copyright


© 2017
How is CWS configured?

A Configurable Web Service is comprised of .action and .resource files


• Always located in a product’s %prod%/data/ws
• A product is defined in the MOCA Registry
• [SERVER]
prod-dirs=%prod%;%MOCA%;…etc.
• We will be using LESDIR (env)

Copyright © 2021 Blue Yonder Group, Inc. Copyright


© 2017
CWS .resource file

Resource
A resource is configured to handle primary keys in web service calls and allow for the associating the resource to
one or more actions. The configurations are specified in XML format and saved in a .resource file.
Following is .resource file content:

Copyright © 2021 Blue Yonder Group, Inc. 8


CWS .action File:

Actions
Actions are configured to associate URLs (href) and methods to MOCA commands. The configurations are
specified in XML format and saved in an .action file. Following is .action file content:

Copyright © 2021 Blue Yonder Group, Inc. 9


Action Argument Locations

<argument name="wh_id" type="string" required="true" location="path“ />

PATH
• Href : <href>/orders/{id}</href>
• This can be anything. It is recommended that for compound primary keys, it is specified as pk.
• localhost:4800/ws/cws/orders/unique_id
• localhost:4800/ws/cws/orders/client*!order*!wh
• The above would be in the form client_id, ordnum, wh_id – alphabetically by argument.
QUERY
• Href : <href>/orders</href>
• localhost:4800/ws/cws/orders?id=unique&arg=something

HEADER and BODY


• Href : <href>/orders</href>
• { "client_id":“client", "ordnum":“order", "wh_id":“wh"}
• JSON data specified in the header or body of the request
Copyright © 2021 Blue Yonder Group, Inc. Copyri
Grid

Copyright © 2021 Blue Yonder Group, Inc. 11


Charts

Copyright © 2021 Blue Yonder Group, Inc. 12


Advanced CRUD Actions

Filtering, sorting, and paging


• Apply to LIST actions.
• Requires configurations on both the MOCA command and Action as well as a JSON column configuration file.
• Requires a listConfig element

• <listConfig>
• <columnConfig> orderConfig </columnConfig>
• <filterable/>
• <pageable/>
• <sortable/>
• </listConfig>

Copyright © 2021 Blue Yonder Group, Inc. Copyri


Column Configuration

<columnConfig> orderConfig </columnConfig>

%PRODDIR%/data/rpuxQueryColumnMappings/orderConfig.json

"columns": {

“wh_id": {

"type": "java.lang.String",

"alias": “ord.name"

},

“entdte": {

"type": "java.lang.Date",

"alias": “ord.entdte"

},

……

Copyright © 2021 Blue Yonder Group, Inc. Copyright


© 2017
Filtering

<filterable/>
publish data where filterByClause = nvl(@filterByClause, [1=1])
|
[select * from ord where @filterByClause:raw]
Operators: EQ, NE, GT, LT
http:localhost:4800/ws/cws/orders?query=[{
"AND" : [{
"column" : “wh_id",
"value" : “WMD1",
"operator" : "EQ"
}, {
"column" : “entdte",
"value" : “"2012-10-23T00:00:00"”,
"operator" : “GT"
}
]
}]

Copyright © 2021 Blue Yonder Group, Inc. Copyright


© 2017
Sorting

<sortable/>
publish data where sortOrderClause = nvl(@sortOrderClause, ‘ord.ordnum’)
|
[select * from ord order by @sortOrderClause]

http:localhost:4800/ws/cws/orders?sort=-ordnum,+entdte

Uses (+) and (-) to sort ASC or DESC.


• These sometimes need to be replaced by their URL encoding value
• (+) : %2B
• (-) : %2D

Copyright © 2021 Blue Yonder Group, Inc. Copyright


© 2017
Paging

<pageable default-limit="10" max-limit="100"/>

[
/*#limit=@offset,@limit,true */
select * from ord
]

http:localhost:4800/ws/cws/orders?offset=2&limit=10

Copyright © 2021 Blue Yonder Group, Inc. Copyri


Pagebuilder and CWS Import/Export

Copyright © 2021 Blue Yonder Group, Inc. 18

You might also like