Renders the order-detail page for a single cart or order, appearing as a child of ShoppingCartsFolder at a URL such as /shopping-carts/{cartId}. Wraps one Cart entity and exposes its line items, totals, vouchers and fulfilment state so the order template can render a full breakdown of the order. It also implements LeadManResource and ProductResource so the order can be surfaced in the CRM lead history and product-related admin views. One instance is created per cart by ShoppingCartsFolder.
Group: Resources
Extends: AbstractResource
Implements: GetableResource, TitledPage, CollectionResource, LeadManResource, ProductResource
Properties
| Property | Returns | Description |
|---|---|---|
| breadCrumbs | Map<String,String> | Breadcrumb entries for this order's page, linking back to the Carts and Orders listing. |
| cart | Cart | Returns the shopping cart object |
| children | List<? extends Resource> | Children of this order's page. Orders have no child resources, so this is always empty. |
| description | String | Builds a comma-separated summary of the products in this order, prefixing each with its quantity where more than one was ordered. |
| leadManObject | Object | CRM lead object this order is the detail page for. |
| leadTeams | List<Organisation> | Team(s) responsible for this order. Orders are not currently assigned to a specific team. |
| name | String | Path segment this folder is addressed by, which is the cart's database id as a string. |
| parent | CommonCollectionResource | Folder this order sits under. |
| productOrders | List<ProductOrder> | Get all products orders for this cart |
| restrictSupplier | boolean | Whether this order is restricted to suppliers with a matching supplier organisation. Orders are not currently supplier-restricted. |
| supplierOrg | Organisation | Supplier organisation for this order, if it is restricted to one. |
| title | String | Page title for the order, made up of the order reference (or database id if no reference is set) and, when known, the customer's name. |
| totalCost | BigDecimal | Total cost of the order, calculated by summing the grand total of each product order in the cart, with trailing zeros stripped. |
| totalItems | BigDecimal | Total number of items in the order, calculated by summing the quantity of each product order in the cart. |
| vouchers | List<Voucher> | Vouchers that have been redeemed against this cart. |
Inherited from AbstractResource
Properties
| Property | Returns | Description |
|---|---|---|
| accessControlList | Map<Principal,List<Priviledge>> | The access control list of allowed privileges per principal for this resource. This implementation is not populated; access is instead resolved dynamically via the security manager, so this always returns null. |
| asList | ResourceList | This resource wrapped as a single-element ResourceList, convenient for scripts that want to treat a single resource the same way as a list of resources. |
| attributes | Map<String,Object> | A mutable, request-scoped map of arbitrary attributes attached to this resource instance, for passing values between code that shares a reference to the same resource. |
| createDate | Date | The date this resource was created. This base implementation always returns null; subclasses that track creation dates override it. |
| dir | boolean | Whether this resource is a collection (folder-like) resource rather than a single item. |
| href | String | The URL-encoded path to this resource, suitable for use as a browser or WebDAV href. Collection resources get a trailing slash. |
| link | String | A ready-to-use HTML anchor tag linking to this resource's href, using its name as the link text. |
| modifiedDate | Date | The date this resource was last modified. This base implementation always returns null; subclasses that track modification dates override it. |
| oAuth2Providers | Map<String,OAuth2Provider> | The OAuth2 login providers available for this resource, combining the providers configured on the social login app with the platform's built-in social posting services mapped onto their OAuth2 provider templates. |
| path | Path | The path of this resource within its resource tree, built by appending this resource's name to its parent's path, as a Path object with convenient path manipulation methods. |
| principalCollectionHrefs | HrefList | The hrefs of the collections that contain principals, so a WebDAV client can discover where to list users. This base implementation always returns the single href "/users/". |
| principalURL | String | The href of the owning principal resource for this resource, found by walking up the parent chain to the nearest principal resource. |
| public | boolean | Whether this resource is readable by anonymous, unauthenticated users. This base implementation always returns false; subclasses override it where public content is allowed. |
| readable | boolean | Whether the current user, who may be null for an anonymous request, has READ_CONTENT permission on this resource. |
| realm | String | The HTTP authentication realm used for digest and basic authentication challenges on this resource. |
| uniqueId | String | A unique identifier for this resource. This base implementation always returns null; resource types that need a stable id (for example content resources) override it. |
| writable | boolean | Whether the current user, who may be null for an anonymous request, has WRITE_CONTENT permission on this resource. |
Methods
getUniqueId() · getRealm() · getPrincipalURL() · getPrincipalCollectionHrefs() · getPath() · getHref() · getLink() · isPublic() · find(String path) · find(Path p) · isDir() · getContentType(String accepts) · getModifiedDate() · getCreateDate() · getAccessControlList() · closest(String type) · closest(Class<T> c) · isReadable() · isWritable() · getAsList() · getOAuth2Providers() · getAttributes()
getUniqueId()
Returns: String
A unique identifier for this resource. This base implementation always returns null; resource types that need a stable id (for example content resources) override it.
getRealm()
Returns: String
The HTTP authentication realm used for digest and basic authentication challenges on this resource.
getPrincipalURL()
Returns: String
The href of the owning principal resource for this resource, found by walking up the parent chain to the nearest principal resource.
getPrincipalCollectionHrefs()
Returns: HrefList
The hrefs of the collections that contain principals, so a WebDAV client can discover where to list users. This base implementation always returns the single href "/users/".
getPath()
Returns: Path
The path of this resource within its resource tree, built by appending this resource's name to its parent's path, as a Path object with convenient path manipulation methods.
getHref()
Returns: String
The URL-encoded path to this resource, suitable for use as a browser or WebDAV href. Collection resources get a trailing slash.
getLink()
Returns: String
A ready-to-use HTML anchor tag linking to this resource's href, using its name as the link text.
isPublic()
Returns: boolean
Whether this resource is readable by anonymous, unauthenticated users. This base implementation always returns false; subclasses override it where public content is allowed.
find(String path)
Returns: Resource
Finds a resource within the website by its path. A relative path is evaluated relative to this resource; an absolute path is evaluated from the website root. For example find("/programs/p1") looks up the program p1 from the root, and find("../p1") looks up p1 in the folder above this resource.
| Parameter | Description |
|---|---|
path | the relative or absolute path to resolve |
find(Path p)
Returns: Resource
Finds a resource by walking a Path object one part at a time, following "." and ".." segments and looking up each remaining part as a child of the current resource.
| Parameter | Description |
|---|---|
p | the path to resolve, relative to this resource or absolute |
isDir()
Returns: boolean
Whether this resource is a collection (folder-like) resource rather than a single item.
getContentType(String accepts)
Returns: String
The content type this resource should be served as. This base implementation always returns "text/html; charset=UTF-8" for getable resources (regardless of the accepts header, since XHTML is not used because of CKEditor compatibility) and an empty string otherwise. Subclasses override this where a different content type is needed.
| Parameter | Description |
|---|---|
accepts | the client's Accept header value, currently not used to vary the result |
getModifiedDate()
Returns: Date
The date this resource was last modified. This base implementation always returns null; subclasses that track modification dates override it.
getCreateDate()
Returns: Date
The date this resource was created. This base implementation always returns null; subclasses that track creation dates override it.
getAccessControlList()
Returns: Map<Principal,List<Priviledge>>
The access control list of allowed privileges per principal for this resource. This implementation is not populated; access is instead resolved dynamically via the security manager, so this always returns null.
closest(String type)
Returns: CommonResource
Finds the closest resource, starting from this one and walking up through its parents, whose is(type) returns true.
| Parameter | Description |
|---|---|
type | the type name to match, as used by is(String) |
closest(Class<T> c)
Returns: T
Finds the closest resource, starting from this one and walking up through its parents, that is an instance of the given class.
| Parameter | Description |
|---|---|
c | the class to match against |
isReadable()
Returns: boolean
Whether the current user, who may be null for an anonymous request, has READ_CONTENT permission on this resource.
isWritable()
Returns: boolean
Whether the current user, who may be null for an anonymous request, has WRITE_CONTENT permission on this resource.
getAsList()
Returns: ResourceList
This resource wrapped as a single-element ResourceList, convenient for scripts that want to treat a single resource the same way as a list of resources.
getOAuth2Providers()
Returns: Map<String,OAuth2Provider>
The OAuth2 login providers available for this resource, combining the providers configured on the social login app with the platform's built-in social posting services mapped onto their OAuth2 provider templates.
getAttributes()
Returns: Map<String,Object>
A mutable, request-scoped map of arbitrary attributes attached to this resource instance, for passing values between code that shares a reference to the same resource.
Methods
getChildren() · getCart() · getTotalCost() · getTotalItems() · getProductOrders() · orderHistory(long productOrderId) · getDescription() · getTitle() · getName() · is(String type) · getParent() · getVouchers() · getLeadTeams() · isRestrictSupplier() · getSupplierOrg() · getLeadManObject() · getBreadCrumbs()
getChildren()
Returns: List<? extends Resource>
Children of this order's page. Orders have no child resources, so this is always empty.
getCart()
Returns: Cart
Returns the shopping cart object
getTotalCost()
Returns: BigDecimal
Total cost of the order, calculated by summing the grand total of each product order in the cart, with trailing zeros stripped.
getTotalItems()
Returns: BigDecimal
Total number of items in the order, calculated by summing the quantity of each product order in the cart.
getProductOrders()
Returns: List<ProductOrder>
Get all products orders for this cart
orderHistory(long productOrderId)
Returns: List<ProductOrderStatus>
Looks up the fulfilment status history recorded for one of this cart's product orders.
| Parameter | Description |
|---|---|
productOrderId | the database identifier of the product order to look up |
getDescription()
Returns: String
Builds a comma-separated summary of the products in this order, prefixing each with its quantity where more than one was ordered.
getTitle()
Returns: String
Page title for the order, made up of the order reference (or database id if no reference is set) and, when known, the customer's name.
getName()
Returns: String
Path segment this folder is addressed by, which is the cart's database id as a string.
is(String type)
Returns: boolean
Checks to see if this resource is type of "cart" or the fulfillment state: eg. C = Fulfilled, N = Not Fulfilled, D = Deleted
| Parameter | Description |
|---|---|
type | the type to check against, eg "cart" or a fulfilment state code |
getParent()
Returns: CommonCollectionResource
Folder this order sits under.
getVouchers()
Returns: List<Voucher>
Vouchers that have been redeemed against this cart.
getLeadTeams()
Returns: List<Organisation>
Team(s) responsible for this order. Orders are not currently assigned to a specific team.
isRestrictSupplier()
Returns: boolean
Whether this order is restricted to suppliers with a matching supplier organisation. Orders are not currently supplier-restricted.
getSupplierOrg()
Returns: Organisation
Supplier organisation for this order, if it is restricted to one.
getLeadManObject()
Returns: Object
CRM lead object this order is the detail page for.
getBreadCrumbs()
Returns: Map<String,String>
Breadcrumb entries for this order's page, linking back to the Carts and Orders listing.