public interface ISandboxAPI
api
That api variable or binding is merely an instance of this interface to expose certain "safe" methods and functionalityModifier and Type | Method and Description |
---|---|
void |
abortCalculation()
Aborts the current item's calculation.
|
Object |
add(String typeCode,
Map<String,Object> values)
Adds a new object to collection of objects of given type.
|
Object |
addOrUpdate(String typeCode,
Map<String,Object> values)
Adds or updates object in collection of objects of given type.
|
net.pricefx.server.dto.calculation.AttributedResult |
attributedResult(Object result) |
Object |
bom()
Equivalent of the standard syntax' "BoM" function.
|
Object |
bom(String lookupTableName)
Equivalent of the standard syntax' "BoM" function.
|
Object |
bom(String lookupTableName,
String categoryName)
Equivalent of the standard syntax' "BoM" function.
|
Object |
bom(String lookupTableName,
String categoryName,
String materialName)
Equivalent of the standard syntax' "BoM" function.
|
Object |
bomList()
Equivalent of the standard syntax' "BoMList" function.
|
Object |
booleanUserEntry(String entryName)
Equivalent of the standard syntax' "BooleanUserEntry" function.
|
Object |
boundCall(String uniqueName,
String relativeUrl,
String body,
Boolean... responseBodyAsAString)
Issues HTTP/S call to price fx server.
|
net.pricefx.server.dto.calculation.ResultFlexChart |
buildFlexChart(Object definition)
|
net.pricefx.server.dto.calculation.ResultFlexChart |
buildFlexChart(String baseTemplateToUse,
Object definition)
Creates a
FlexChart from the passed definition by
merging it with options defined within the
baseTemplateToUse template. |
Calendar |
calendar()
Gets a calendar object intialized with the current targetDate (or now if no target date is given)
|
Calendar |
calendar(Date date)
Gets a calendar object intialized with
date |
Object |
configurator(String configuratorName,
String formulaName)
Equivalent of the standard syntax' "Configurator" function.
|
String |
contextName()
The name of the current context.
|
Set<Object> |
contextSkuSet(int startRow)
Returns a set of skus which comprise so-called 'sku context' of
the current formula execution.
|
String |
contextType()
The type (type code string) of the current context
|
int |
count(String typeCode,
Filter... filters)
Similar to the
find(java.lang.String, com.googlecode.genericdao.search.Filter...) methods this method querys an arbitrary object type. |
net.pricefx.server.dto.calculation.ConfiguratorEntry |
createConfiguratorEntry()
Creates an empty configurator entry object.
|
net.pricefx.server.dto.calculation.ConfiguratorEntry |
createConfiguratorEntry(net.pricefx.common.api.InputType type,
String name)
Creates a cofigurator entry object and adds the specified input parameter as first parameter to the configurator entry
If the parameter had a value in the previous round trip, that value is set automatically
|
net.pricefx.server.dto.calculation.ConfiguratorEntry |
createConfiguratorEntry(net.pricefx.common.api.InputType type,
String name,
Date targetDate)
Creates a cofigurator entry object and adds the specified input parameter as first parameter to the configurator entry
If the parameter had a value in the previous round trip, that value is set automatically
|
Filter |
createElementNameFilter(String elementName,
Object fieldValue,
String... listTypedIds)
Creates a cross-list filter expression based on meta data.
|
void |
criticalAlert(String msg)
Marks the current formula element with a critical alert and the given message
|
Map<String,Object> |
currentContext(String sku)
In case of list processing (such as a price list or a price grid) this method allows easy access to values from the same list.
|
Map<String,Object> |
currentContext(String sku,
String key2)
In case of list processing (such as a price list or a price grid) this method allows easy access to values from the same list.
|
Object |
currentItem()
In case of a list processing operation this method gets the currently worked on record (e.g.
|
Object |
currentItem(String attributeName)
Same as
currentItem() but just returns the specified attribute |
Object |
currentItemByElementName(String elementName)
In case of a list processing operation this method gets the currently worked on record's property by elementName
|
Object |
customer(String attributeName)
Equivalent of the standard syntax' "Customer" function.
|
Object |
customer(String attributeName,
boolean defaultFromParent)
Equivalent of the standard syntax' "Customer" function.
|
Object |
customer(String attributeName,
String customerId)
Equivalent of the standard syntax' "Customer" function.
|
Object |
customer(String attributeName,
String customerId,
boolean defaultFromParent)
Equivalent of the standard syntax' "Customer" function.
|
Object |
customerExtension(String extensionName)
Equivalent of the standard syntax' "CXLookup" function.
|
Object |
customerExtension(String extensionName,
Filter... filters)
Equivalent of the standard syntax' "CXLookup" function.
|
Object |
customerGroupEntry(String... entryName)
Equivalent of the standard syntax' "CustomerGroup" function.
|
void |
customEvent(Object object)
Sends an event of type "CUSTOM".
|
void |
customEvent(Object object,
String customEventType)
Sends an event of type "CUSTOM".
|
void |
customEvent(Object object,
String customEventType,
String operation)
Sends an event of type "CUSTOM".
|
net.pricefx.server.dto.calculation.dashboard.DashboardApi |
dashboard(String dashboardName) |
String |
dashboardWideEvent(String eventName) |
Object |
datamartCalendar()
Returns a datamart calendar object
|
Filter |
datamartFilter(net.pricefx.domain.CustomerGroup customerGroup)
Translates a CustomerGroup to its equivalent Filter representation, mapping domain level field names to the corresponding
Datamart field names in the process
|
Filter |
datamartFilter(net.pricefx.domain.DMDataSlice slice)
Translates a DMDataSlice to its equivalent Filter representation, mapping domain level field names to the corresponding
Datamart field names in the process
|
Filter |
datamartFilter(net.pricefx.domain.ProductGroup productGroup)
Translates a ProductGroup to its equivalent Filter representation, mapping domain level field names to the corresponding
Datamart field names in the process
|
Object |
datamartFilterBuilderUserEntry(String entryName,
String datamart)
Equivalent of the standard syntax' "DatamartFilterBuilderUserEntry" function.
|
Object |
datamartLookup(Object... queryAndProjectionsAndFilters) |
Object |
datamartQuery(Object... queryAndDatamartAndProjectionsAndFilters) |
Object |
dateTimeUserEntry(String entryName)
Equivalent of the standard syntax' "DateTimeUserEntry" function.
|
Object |
dateUserEntry(String entryName)
Equivalent of the standard syntax' "DateUserEntry" function.
|
Object |
delete(String typeCode,
Map<String,Object> values)
Deletes object in collection of objects of given type.
|
boolean |
emit(Object obj)
Emits an object to be consumed by an external thread.
|
void |
emitRebateRecords(String sortBy,
Filter... filters) |
Object |
filter(String property,
Object value)
Creates a filter object that can be used in other API functions.
|
Object |
filter(String property,
Object lowerBound,
Object upperBound) |
Object |
filter(String property,
String opString,
Object value)
Creates a filter object that can be used in other API functions.
|
Object |
filterBuilderUserEntry(String entryName,
String typeCode)
Equivalent of the standard syntax' "FilterBuilderUserEntry" function.
|
Filter |
filterFromMap(Map<String,Object> filterMap)
Constructs a Filter object from a map representation of that filter (from the "wire format")
The map representation is the way the filter is described in the JSON requests between UI and server
|
List<Object> |
find(String typeCode,
Filter... filters)
The swiss army knife method of the API.
|
List<Object> |
find(String typeCode,
int startRow,
Filter... filters)
The swiss army knife method of the API.
|
List<Object> |
find(String typeCode,
int startRow,
int maxRows,
String sortBy,
Filter... filters)
The swiss army knife method of the API.
|
List<Object> |
find(String typeCode,
int startRow,
int maxRows,
String sortBy,
List<String> fields,
boolean distinctValuesOnly,
Filter... filters)
The swiss army knife method of the API.
|
List<Object> |
find(String typeCode,
int startRow,
int maxRows,
String sortBy,
List<String> fields,
Filter... filters)
The swiss army knife method of the API.
|
List<Object> |
find(String typeCode,
int startRow,
String sortBy,
Filter... filters)
The swiss army knife method of the API.
|
List<net.pricefx.server.dto.SummaryCalculableObjectItem> |
findApprovedPricelistItems(String sku)
Returns a list of summary items.
|
List<net.pricefx.domain.CalculatedFieldSet> |
findCalculatedFieldSets(Date targetDate,
String cfsName)
Returns a list of calculated field sets that match the targetDate
|
List<net.pricefx.domain.CustomerAssignment> |
findCustomerAssignments(String customerId)
Finds all assignement rcords for a given customerId
Also matches by CustomerGroup definitions
|
List<net.pricefx.domain.Customer> |
findCustomersInGroup(net.pricefx.domain.CustomerGroup group)
Retrieves a list of customers that match a given CustomerGroup (returns first 200 entries)
|
List<net.pricefx.domain.Customer> |
findCustomersInGroup(net.pricefx.domain.CustomerGroup group,
int startRow,
String sortBy)
Retrieves a list of customers that match a given CustomerGroup with custom paging and sorting
|
Object |
findDataLoad(String dataLoadLabel,
String dataLoadType,
String target) |
net.pricefx.domain.LookupTable |
findLookupTable(String tableName)
Finds a LookupTbale / price parameter table base don the table name.
|
List<Object> |
findLookupTableValues(String tableName,
Filter... filters)
Searches and returns values of a named lookup table.
|
List<net.pricefx.domain.ManualPricelist> |
findManualPricelists(Date targetDate,
String listName)
Returns a list of manual pricelists that match the targetDate (i.e.
|
List<net.pricefx.domain.PriceGrid> |
findPriceGrids(Date targetDate,
String priceGridName)
Returns a list of price grids that match the targetDate (i.e.
|
List<net.pricefx.domain.Pricelist> |
findPricelists(Date targetDate,
String listName)
Returns a list of pricelists that match the targetDate (i.e.
|
Object |
findRebateRecords(String rebateTypeUN,
Date startDate,
Date endDate,
net.pricefx.domain.CustomerGroup customerGroup,
net.pricefx.domain.ProductGroup productGroup,
Filter... filters) |
List<net.pricefx.domain.Simulation> |
findSimulations(Date targetDate,
String simulationName)
Returns a list of simulations that match the targetDate (i.e.
|
net.pricefx.workflowengine.WorkflowInfo |
findWorkflowInfo(String approvableTypeCode,
Object approvableId)
Finds active workflow for given approvable.
|
String |
formatNumber(String pattern,
BigDecimal n)
Formats a number into a string.
|
String |
formatNumber(String pattern,
Integer n)
Formats a number into a string.
|
String |
formatNumber(String locale,
String pattern,
BigDecimal n)
Formats a number into a string.
|
String |
formatNumber(String locale,
String pattern,
Integer n)
Formats a number into a string.
|
String |
formatString(String locale,
String format,
Object... args)
Formats a string like
String.format(java.lang.String, java.lang.Object...) |
Object |
getBinding(String name)
Gets a named binding variable from a library function.
|
Object |
getBoundPartitionNames()
Returns bound partition list
|
<T extends net.pricefx.domain.CalculableLineItem> |
getCalculableLineItem(Object clic,
String lineId)
Returns a line item of a given calculable line item collection (a.k.a.
|
Object |
getCalculableLineItemResult(Object cli,
String... resultNamesOrLabels)
Returns result(s) of given name(s) (or label(s)) from a line item object (its map representation to be exact).
|
Object |
getClusterNodes() |
net.pricefx.domain.Customer |
getCustomer(String customerId) |
net.pricefx.domain.Customer |
getCustomerParent(String customerId) |
net.pricefx.formulaengine.DatamartContext |
getDatamartContext() |
net.pricefx.formulaengine.DatamartRowSet |
getDatamartRowSet() |
net.pricefx.formulaengine.DatamartRowSet |
getDatamartRowSet(String name) |
Object |
getElement(String name)
Gets the result of a previous formula element.
|
Map<String,Object> |
getGlobal()
A publicly available hashmap to store and share values accross formula elements
If
api.retainGlobal is set to true this map will also be available with an entire list calculation,
i.e accross item boundaries. |
Long |
getId(Object obj)
Returns the id part of an object.
|
Map<String,Object> |
getItemCompleteCalculationResults(String typedId)
Gets current complete calculation results of the given item (e.g.
|
int |
getIterationNumber()
Returns the number of iterations this list has been calculated during this cycle
0 means: initial calculation (non-dirty)
1 means: first dirty pass
and so on
|
Object |
getManualOverride(String elementName)
In certain scenarios (e.g.
|
ContextParameter |
getParameter(String parameterName)
Retrieves an already generated (i.e.
|
net.pricefx.service.ItemSummaryQuery<net.pricefx.domain.PriceGrid> |
getPriceGridSummaryQuery()
Creates a summary query object that can be parameterized and is then subsequently used in
runSummaryQuery(ItemSummaryQuery)
This query runs against price grid(s) |
Map<String,Object> |
getPricelistItem(String listName)
Similar to the standard syntax' "Pricelist" function.
|
net.pricefx.service.ItemSummaryQuery<net.pricefx.domain.Pricelist> |
getPricelistSummaryQuery()
Creates a summary query object that can be parameterized and is then subsequently used in
runSummaryQuery(ItemSummaryQuery)
This query runs against pricelist(s) |
net.pricefx.domain.Product |
getProduct(String sku) |
Object |
getProperty(Object object,
String path)
This method serves as an optimized way to get to certain object attributes.
|
Object |
getPropertyByElementName(Object object,
String elementName)
This method gets object attributes by elementName.
|
net.pricefx.service.ItemSummaryQuery<net.pricefx.domain.RebateRecordSet> |
getRebateRecordSummaryQuery()
Creates a summary query object that can be parameterized and is then subsequently used in
runSummaryQuery(ItemSummaryQuery)
This query runs against rebate records |
Object |
getSecondaryKey()
Gets the secondary key in case a matrix pricelist or matrix simulation is processed
|
net.pricefx.service.ItemSummaryQuery<net.pricefx.domain.Simulation> |
getSimulationSummaryQuery()
Creates a summary query object that can be parameterized and is then subsequently used in
runSummaryQuery(ItemSummaryQuery)
This query runs against simulation(s) |
net.pricefx.formulaengine.TableContext |
getTableContext() |
Object |
httpCall(String url,
String body)
Issues HTTP call to external entity.
|
Object |
httpCall(String url,
String body,
String methodType,
String contentType,
Map... properties)
Issues HTTP call to external entity.
|
Object |
input(String inputName)
Retrives an input parameter - without triggering a user input
|
Object |
inputMatrix(String inputMatrixName,
String... columnNames)
Equivalent of the standard "InputMatrix" function.
|
Object |
integerUserEntry(String entryName)
Equivalent of the standard syntax' "IntegerUserEntry" function.
|
boolean |
isDebugMode()
Returns true if formula is called via UI debug/test exec mode
|
boolean |
isSecondPass()
Method to determine if the calculation is in 2nd pass calculation.
|
boolean |
isSyntaxCheck() |
boolean |
isUserInGroup(String userGroupName,
String loginUserName)
Checks if the current user is member of a given user group
|
Object |
jsonDecode(String json)
A utility method to decode a JSON string into a Map representation
|
Object |
jsonDecodeList(String json)
A utility method to decode a JSON string into a List representation
|
Object |
jsonEncode(Object input)
A utility method to encode Object to JSON string
|
void |
log(String msg,
Object arg1)
Generates a system log entry.
|
void |
logInfo(String msg,
Object arg1)
Generates a system log entry at INFO level.
|
void |
logWarn(String msg,
Object arg1)
Generates a system log entry at WARN level.
|
void |
markItemClean()
Removes a "dirty marker" from the current item
|
void |
markItemDirty()
Marks the current item dirty.
|
void |
markItemDirty(String sku)
Marks the specfied item dirty.
|
void |
markItemDirty(String sku,
String key2)
Marks the specfied item dirty.
|
Object |
multiTierEntry(String entryName,
String... valueHints)
Equivalent of the standard syntax' "MultiTierEntry" function.
|
net.pricefx.common.apibuilder.chart.ChartBuilder |
newChartBuilder() |
net.pricefx.server.dto.calculation.DashboardController |
newController()
Creates a new dashboard controller object that can be further customized
|
Object |
newDatamartSlice()
Creates a new Datamart Slice, which allows for setting filter criteria along the Time, CustomerGroup, ProductGroup
any any other dimensions in a Datamart.
|
Object |
newDatamartSlice(String dateFieldName,
Object... timePeriodsAndProductAndCustomerGroups)
Creates a new Datamart Slice, which allows for setting filter criteria along the Time, CustomerGroup, ProductGroup
any any other dimensions in a Datamart, intiialized with the name of the time dimension field, and an optional set
filter criteria.
|
net.pricefx.server.dto.calculation.ResultGauge |
newGauge()
Creates a new gauge object that can be further customized.
|
ResultMatrix |
newMatrix()
Creates a new result matrix DTO object that can be further customized and filled with calculated data
|
ResultMatrix |
newMatrix(String... columns)
Creates a new result matrix DTO object that can be further customized and filled with calculated data.
|
Object |
option(String entryName,
Object... options)
Equivalent of the standard syntax' "Options" function.
|
Object |
otherCustomer(String parameterName)
A method to trigger a custom-named customer picker input parameter
|
Object |
otherCustomer(String parameterName,
String attributeName)
A method to trigger a custom-named customer picker input parameter
|
Object |
otherCustomer(String parameterName,
String attributeName,
boolean defaultFromParent)
A method to trigger a custom-named customer picker input parameter
|
Object |
otherProduct(String parameterName)
A method to trigger a custom-named product picker input parameter
|
Object |
otherProduct(String parameterName,
String attributeName)
A method to trigger a custom-named product picker input parameter
|
Date |
parseDate(String pattern,
String date)
Parses a date (entered in as string) according to a given pattern.
|
org.joda.time.DateTime |
parseDateTime(String pattern,
String datetime)
Parses a datetime (entered in as string) according to a given pattern.
|
org.joda.time.DateTime |
parseDateTime(String pattern,
String datetime,
int tzHoursOffset,
int tzMinutesOffset)
Parses a datetime (entered in as string) according to a given pattern and time zone.
|
Map<String,Object> |
previousContext(String sku)
In case of (chained) price lists, this method allows for easy retrieval of records from the previous list.
|
Map<String,Object> |
previousContext(String sku,
String key2)
In case of (chained) price lists, this method allows for easy retrieval of records from the previous list.
|
Object |
pricelist(String listName)
Equivalent of the standard syntax' "Pricelist" function.
|
Object |
pricelist(String listName,
String attributeName)
Equivalent of the standard syntax' "Pricelist" function.
|
Object |
pricelist(String listName,
String attributeName,
String sku)
Equivalent of the standard syntax' "Pricelist" function.
|
Object |
pricelist(String listName,
String attributeName,
String sku,
String key2)
Equivalent of the standard syntax' "Pricelist" function.
|
Object |
pricelistItem(String listName)
Equivalent of the standard syntax' "Pricelist" function - with the difference that the full item is returned
|
Object |
pricelistItem(String listName,
String sku)
Equivalent of the standard syntax' "Pricelist" function - with the difference that the full item is returned.
|
Object |
pricelistItem(String listName,
String sku,
String key2)
Equivalent of the standard syntax' "Pricelist" function - with the difference that the full item is returned.
|
Object |
product(String attributeName)
Equivalent of the standard syntax' "Product" function.
|
Object |
product(String attributeName,
String sku)
Equivalent of the standard syntax' "Product" function.
|
Object |
productCompetition()
Equivalent of the standard syntax' "Competition" function.
|
Object |
productCompetition(Filter... filters)
Equivalent of the standard syntax' "Competition" function.
|
Object |
productExtension(String extensionName)
Equivalent of the standard syntax' "PXLookup" function.
|
Object |
productExtension(String extensionName,
Filter... filters)
Equivalent of the standard syntax' "PXLookup" function.
|
Object |
productGroupEntry(String... entryName)
Equivalent of the standard syntax' "ProductGroup" function.
|
Object |
productXRef()
Equivalent of the standard syntax' "XRefLookup" function.
|
Object |
productXRef(Filter... filters)
Equivalent of the standard syntax' "XRefLookup" function.
|
void |
putGlobal(Map<String,Object> globalVars)
Puts an entire map of variables into the global cache
|
void |
redAlert(String msg)
Marks the current formula element with a red alert and the given message
|
void |
removeManualOverride(String elementName)
Removes a manual result override.
|
void |
resetSKUContextSwitch()
Resets a sku context switch to the origionally specified sku
|
List<Map<String,Object>> |
runSummaryQuery(net.pricefx.service.ItemSummaryQuery<? extends net.pricefx.domain.CalculableObject> query)
Runs (executes) a summary query defined by the parameterized query object which was created by one of the getXXXSummaryQuery calls
|
void |
sendEmail(String to,
String subject,
String message)
Sends email.
|
org.hibernate.ScrollableResults |
stream(String typeCode,
String sortBy,
Filter... filters)
Search for all types of objects with a freestyle query, and iterate over the result set.
|
org.hibernate.ScrollableResults |
stream(String typeCode,
String sortBy,
List<String> fields,
boolean distinctValuesOnly,
Filter... filters)
Search for all types of objects with a freestyle query, and iterate over the result set.
|
org.hibernate.ScrollableResults |
stream(String typeCode,
String sortBy,
List<String> fields,
Filter... filters)
Search for all types of objects with a freestyle query, and iterate over the result set.
|
Object |
stringUserEntry(String entryName)
Equivalent of the standard syntax' "StringUserEntry" function.
|
Object |
stringUserEntry(String entryName,
String textMask)
Equivalent of the standard syntax' "StringUserEntry" function.
|
void |
switchSKUContext(String newSKU)
Temporarily switches the current sku context to another sku.
|
Date |
targetDate()
Gets the current execution context's target date
|
void |
throwException(String errorMessage)
Throws a calculation exception with a specified message and aborts the calculation
|
Object |
timeUserEntry(String entryName)
Equivalent of the standard syntax' "TimUserEntry" function.
|
void |
trace(String functionName,
String parameters,
Object result)
Generates a trace message that can be used in the formula test drive.
|
Object |
update(String typeCode,
Map<String,Object> values)
Updates object in collection of objects of given type.
|
Object |
updateCalculableObjectHeader(String calcObjTypeCode,
String calcObjName)
Updates the header information of a CalculableObject (e.g.
|
Object |
user()
Returns the entire master data object of the current user
|
Object |
user(String attributeName)
Returns a value from the current user's master data
|
Object |
userEntry(String entryName)
Equivalent of the standard syntax' "UserEntry" function.
|
Object |
vLookup(String parameterName)
Equivalent of the standard syntax' "VLookup" function.
|
Object |
vLookup(String parameterName,
Number rangeValue)
Equivalent of the standard syntax' "VLookup" function.
|
Object |
vLookup(String parameterName,
String attributeNameOrKey)
Equivalent of the standard syntax' "VLookup" function.
|
Object |
vLookup(String parameterName,
String attributeName,
String key)
Equivalent of the standard syntax' "VLookup" function.
|
Object |
vLookup(String parameterName,
String attributeName,
String key1,
String key2)
Equivalent of the standard syntax' "VLookup" function.
|
Object |
vLookup(String parameterName,
String attributeName,
String key1,
String key2,
String key3)
Equivalent of the standard syntax' "VLookup" function.
|
Object |
vLookup(String parameterName,
String attributeName,
String key1,
String key2,
String key3,
String key4)
Equivalent of the standard syntax' "VLookup" function.
|
Object |
vLookup(String parameterName,
String attributeName,
String key1,
String key2,
String key3,
String key4,
String key5)
Equivalent of the standard syntax' "VLookup" function.
|
Object |
vLookup(String parameterName,
String attributeName,
String key1,
String key2,
String key3,
String key4,
String key5,
String key6)
Equivalent of the standard syntax' "VLookup" function.
|
Filter |
walkFilter(Filter filter,
groovy.lang.Closure visitBefore,
groovy.lang.Closure visitAfter,
boolean removeNulls)
Walks a filter and all its sub filters, visiting each filter in the tree.
|
void |
yellowAlert(String msg)
Marks the current formula element with a yellow alert and the given message
|
boolean isSyntaxCheck()
boolean isDebugMode()
Map<String,Object> getGlobal()
api.retainGlobal
is set to true this map will also be available with an entire list calculation,
i.e accross item boundaries. Can be also accessed directly as api.global
void putGlobal(Map<String,Object> globalVars)
globalVars
- The map of variables to put into the global cacheLong getId(Object obj)
obj
- Object getElement(String name)
name
- Name of the formula elementnull
if the element is not foundObject getSecondaryKey()
Object getBinding(String name)
name
- Date targetDate()
Calendar calendar()
Calendar calendar(Date date)
date
date
- The date to initialize the calendar withObject datamartCalendar()
Object newDatamartSlice()
Object newDatamartSlice(String dateFieldName, Object... timePeriodsAndProductAndCustomerGroups)
dateFieldName
- Name of the time dimension fieldtimePeriodsAndProductAndCustomerGroups
- TimePeriod, CustomerGroup, ProductGroup filtersFilter datamartFilter(net.pricefx.domain.CustomerGroup customerGroup)
customerGroup
- The CustomerGroup to translate into Datamart level filter criteriaFilter datamartFilter(net.pricefx.domain.ProductGroup productGroup)
productGroup
- The CustomerGroup to translate into Datamart level filter criteriaFilter datamartFilter(net.pricefx.domain.DMDataSlice slice)
slice
- A DMDataSlice object instantiated by api.newDatamartSlice, or in a Rebate calculation context, referenced by the 'calulationBase' binding.void switchSKUContext(String newSKU)
resetSKUContextSwitch()
or automaticallynewSKU
- The new sku to switch to.void resetSKUContextSwitch()
Object product(String attributeName)
attributeName
- The attribute whose value to returnObject product(String attributeName, String sku)
attributeName
- The attribute whose value to returnsku
- The productnull
if product not found)Object otherProduct(String parameterName, String attributeName)
parameterName
- The name of the parameterattributeName
- The attribute which value to return (null
for the entire object)Object otherProduct(String parameterName)
parameterName
- The name of the parameterObject productExtension(String extensionName)
extensionName
- The name of the extensionObject productExtension(String extensionName, Filter... filters)
extensionName
- The name of the extensionfilters
- One or more filter(java.lang.String, java.lang.Object)
objects that narrow down the PX searchObject productCompetition()
Object productCompetition(Filter... filters)
filter(java.lang.String,java.lang.Object)
objects that narrow down the competition searchObject productXRef()
Object productXRef(Filter... filters)
filters
- One or more filter(java.lang.String,java.lang.Object)
objects that narrow down the PXREF searchObject customer(String attributeName)
attributeName
- The attribute whose value to returnObject customer(String attributeName, boolean defaultFromParent)
null
and defaultFromParent is true
, retrieves (and returns) the value from
the customer's parent no matter if that value is null
as well or not. In case there's no parent customer set,
null
will be returned)attributeName
- The attribute whose value to returndefaultFromParent
- Tells whether to lookup the value from the parent customer (if any) in case it's null
in the customerObject customer(String attributeName, String customerId)
attributeName
- The attribute whose value to returncustomerId
- The customerId value for the customer searchnull
if no customer found)Object customer(String attributeName, String customerId, boolean defaultFromParent)
null
and defaultFromParent is true
, retrieves (and returns) the value from the customer's
parent no matter if that value is null
as well or not. In case there's no parent customer set, null
will be returned)attributeName
- The attribute whose value to returncustomerId
- The customerId value for the customer searchdefaultFromParent
- Tells whether to lookup the value from the parent customer (if any) in case it's null
in the customernull
if no customer found)Object otherCustomer(String parameterName)
parameterName
- The name of the parameterObject otherCustomer(String parameterName, String attributeName)
parameterName
- The name of the parameterattributeName
- The attribute which value to return (null
for the entire object)Object otherCustomer(String parameterName, String attributeName, boolean defaultFromParent)
parameterName
- The name of the parameterattributeName
- The attribute which value to return (null
for the entire object)defaultFromParent
- Tells whether to lookup the attribute's value from the parent customer (if any) in case it's null
in the customerObject customerExtension(String extensionName)
extensionName
- The name of the extensionObject customerExtension(String extensionName, Filter... filters)
extensionName
- The name of the extensionfilters
- One or more filter(java.lang.String,java.lang.Object)
objects that narrow down the CX searchnet.pricefx.domain.Product getProduct(String sku)
net.pricefx.domain.Customer getCustomer(String customerId)
net.pricefx.domain.Customer getCustomerParent(String customerId)
<T extends net.pricefx.domain.CalculableLineItem> T getCalculableLineItem(Object clic, String lineId)
clic
- the clic to which the line item belongs. it may either be the clic object as such (its map representation to be exact), or typedId or a uniqueNamelineId
- the lineId of the line itemObject getCalculableLineItemResult(Object cli, String... resultNamesOrLabels)
Note: the line item object will typically be fetched via getCalculableLineItem(Object, String)
Object vLookup(String parameterName)
parameterName
- The name of the price parameter tableObject vLookup(String parameterName, Number rangeValue)
parameterName
- The name of the price parameter tablerangeValue
- The value to match a range of parameterObject vLookup(String parameterName, String attributeNameOrKey)
parameterName
- The name of the price parameter tableattributeNameOrKey
- A predefined key (hence no user input required) - or in case of a matrix lookup the attribute name => user entry required.Object vLookup(String parameterName, String attributeName, String key)
parameterName
- The name of the price parameter tableattributeName
- The name of the attribute to retrievekey
- The key of the parameter tableObject vLookup(String parameterName, String attributeName, String key1, String key2)
parameterName
- The name of the price parameter tableattributeName
- The name of the attribute to retrievekey1
- The key1 of the parameter tablekey2
- The key2 of the parameter tableObject vLookup(String parameterName, String attributeName, String key1, String key2, String key3)
parameterName
- The name of the price parameter tableattributeName
- The name of the attribute to retrievekey1
- The key1 of the parameter tablekey2
- The key2 of the parameter tablekey3
- The key3 of the parameter tableObject vLookup(String parameterName, String attributeName, String key1, String key2, String key3, String key4)
parameterName
- The name of the price parameter tableattributeName
- The name of the attribute to retrievekey1
- The key1 of the parameter tablekey2
- The key2 of the parameter tablekey3
- The key3 of the parameter tablekey4
- The key4 of the parameter tableObject vLookup(String parameterName, String attributeName, String key1, String key2, String key3, String key4, String key5)
parameterName
- The name of the price parameter tableattributeName
- The name of the attribute to retrievekey1
- The key1 of the parameter tablekey2
- The key2 of the parameter tablekey3
- The key3 of the parameter tablekey4
- The key4 of the parameter tablekey5
- The key5 of the parameter tableObject vLookup(String parameterName, String attributeName, String key1, String key2, String key3, String key4, String key5, String key6)
parameterName
- The name of the price parameter tableattributeName
- The name of the attribute to retrievekey1
- The key1 of the parameter tablekey2
- The key2 of the parameter tablekey3
- The key3 of the parameter tablekey4
- The key4 of the parameter tablekey5
- The key5 of the parameter tablekey6
- The key6 of the parameter tableObject userEntry(String entryName)
entryName
- The name of the user entry parameterObject integerUserEntry(String entryName)
entryName
- The name of the user entry parameterObject stringUserEntry(String entryName)
entryName
- The name of the user entry parameterObject stringUserEntry(String entryName, String textMask)
entryName
- The name of the user entry parametertextMask
- Optional text mask that is displayed in the UIObject booleanUserEntry(String entryName)
entryName
- The name of the user entry parameterObject dateUserEntry(String entryName)
entryName
- The name of the user entry parameter#parseDate(String, String)}
Object timeUserEntry(String entryName)
entryName
- The name of the user entry parameter#parseDate(String, String)}
Object dateTimeUserEntry(String entryName)
entryName
- The name of the user entry parameter#parseDate(String, String)}
Object productGroupEntry(String... entryName)
entryName
- The name of the user entry parameterObject customerGroupEntry(String... entryName)
entryName
- The name of the user entry parameterObject multiTierEntry(String entryName, String... valueHints)
entryName
- The name of the user entry parametervalueHints
- Object option(String entryName, Object... options)
entryName
- The name of the user entry parameteroptions
- An arbitrary number of parameters that make up the drop downObject filterBuilderUserEntry(String entryName, String typeCode)
Will trigger a FilterBuilder widget allowing to construct a filter object filtering upon the object type represented by the passed
typeCode
(e.g. to filter upon Products, the typeCode
will be P
).
The filter object will typically be used in other API functions, like find(String, Filter...)
.
entryName
- The name of the user entry parametertypeCode
- A type code string of the type of the object to filter upon. Supported type codes are P (i.e. Product data) and C (i.e. Customer data), at the momentObject datamartFilterBuilderUserEntry(String entryName, String datamart)
Will trigger a FilterBuilder widget allowing to construct a filter object filtering upon the specified datamart.
The filter object will typically be used in other API functions, like datamartQuery(Object...)
.
entryName
- The name of the user entry parameterdatamart
- the datamart to filter uponObject pricelist(String listName)
listName
- The name of the pricelist. Target date matching and sku context applies.resultPrice
of the pricelist record for the skuObject pricelist(String listName, String attributeName)
listName
- The name of the pricelist. Target date matching and sku context applies.attributeName
- The name of the attribute to retrieveattributeName
column of the pricelist recordObject pricelist(String listName, String attributeName, String sku)
listName
- The name of the pricelist. Target date matching applies.attributeName
- The name of the attribute to retrievesku
- The sku to useattributeName
column of the pricelist recordObject pricelist(String listName, String attributeName, String sku, String key2)
listName
- The name of the pricelist. Target date matching applies.attributeName
- The name of the attribute to retrievesku
- The sku to usekey2
- The key2 to use *attributeName
column of the matrix pricelist recordObject pricelistItem(String listName)
listName
- The name of the pricelist. Target date matching and sku context applies.Object pricelistItem(String listName, String sku)
listName
- The name of the pricelist. Target date matching applies.sku
- The sku to useObject pricelistItem(String listName, String sku, String key2)
listName
- The name of the pricelist. Target date matching applies.sku
- The sku to usekey2
- The key2 to useMap<String,Object> getPricelistItem(String listName)
listName
- The name of the pricelist. Target date and sku matching applies.Object bom()
Object bom(String lookupTableName)
lookupTableName
- The parameter table nameObject bom(String lookupTableName, String categoryName)
lookupTableName
- The parameter table namecategoryName
- The category name to filter onObject bom(String lookupTableName, String categoryName, String materialName)
lookupTableName
- The parameter table namecategoryName
- The categroy name to filter onmaterialName
- The material to filter onObject bomList()
Object user(String attributeName)
attributeName
- The attribute to returnObject user()
Object input(String inputName)
inputName
- The parameter nameObject inputMatrix(String inputMatrixName, String... columnNames)
inputMatrixName
- The name of the parametercolumnNames
- The column names/labelsObject filter(String property, Object value)
property
- The property's name to filter onvalue
- The specified valueFilter filterFromMap(Map<String,Object> filterMap)
filterMap
- The filter in form of nested mapsObject filter(String property, String opString, Object value)
property
- The property's name to filter onvalue
- The specified valueopString
- One out of : "=", "<", "<=", ">", ">=", "<>", "~"net.pricefx.formulaengine.DatamartRowSet getDatamartRowSet()
net.pricefx.formulaengine.DatamartRowSet getDatamartRowSet(String name)
net.pricefx.formulaengine.DatamartContext getDatamartContext()
net.pricefx.formulaengine.TableContext getTableContext() throws SQLException
SQLException
Object findRebateRecords(String rebateTypeUN, Date startDate, Date endDate, net.pricefx.domain.CustomerGroup customerGroup, net.pricefx.domain.ProductGroup productGroup, Filter... filters)
boolean isUserInGroup(String userGroupName, String loginUserName)
userGroupName
- The group nameloginUserName
- The login name of the uservoid trace(String functionName, String parameters, Object result)
functionName
- A free to choose function nameparameters
- Parameters to traceresult
- The result of the tracevoid log(String msg, Object arg1)
msg
- The log message to printarg1
- The arguments for the log message.void logInfo(String msg, Object arg1)
msg
- The log message to printarg1
- The arguments for the log message.void logWarn(String msg, Object arg1)
msg
- The log message to printarg1
- The arguments for the log message.ContextParameter getParameter(String parameterName)
ContextParameter
object.
This can then be further modified as required.parameterName
- The named parameter to retrievenull
Map<String,Object> currentContext(String sku)
sku
- The sku to look forMap<String,Object> currentContext(String sku, String key2)
sku
- The sku to look forkey2
- The key2 to look forMap<String,Object> previousContext(String sku)
sku
- The sku to look forMap<String,Object> previousContext(String sku, String key2)
sku
- The sku to look forkey2
- The key2 to look forString contextName()
String contextType()
Object getProperty(Object object, String path)
object
- The object whose value to retrievepath
- The attribute nameObject getPropertyByElementName(Object object, String elementName)
object
- The object whose value to retrieveelementName
- The elementName valuenull
if invalid object or no matching meta foundObject currentItem()
Object currentItemByElementName(String elementName)
elementName
- Object currentItem(String attributeName)
currentItem()
but just returns the specified attributeattributeName
- The attribute to retrieveSet<Object> contextSkuSet(int startRow)
The form of the sku context differs, e.g. in case of product detail formula executed via price grid details, the resulting set will contain all skus of the left-pane's grid.
Note: if sku context isn't supported by the current formula
execution, null
is returned.
Note #2: A maximum of 200 skus get returned per one call. If there's more,
startRow
must be used to get all skus in the set.
startRow
- The starting row of the result setnull
if sku context isn't
available for the current formula executionList<Object> find(String typeCode, Filter... filters)
typeCode
- A type code string of the type of the object to search for. All available type codes can be retrieved by calling <hostname>/pricefx/<partition name>/fetch
filters
- a list of filter objects that are AND'ed togetherList<Object> find(String typeCode, int startRow, Filter... filters)
typeCode
- A type code string of the type of the object to search for. All available type codes can be retrieved by calling <hostname>/pricefx/<partition name>/fetch
filters
- A list of filter(java.lang.String,java.lang.Object)
objects that are AND'ed togetherstartRow
- The starting row of the result setList<Object> find(String typeCode, int startRow, String sortBy, Filter... filters)
typeCode
- A type code string of the type of the object to search for. All available type codes can be retrieved by calling <hostname>/pricefx/<partition name>/fetch
filters
- A list of filter objects that are AND'ed togetherstartRow
- The starting row of the result setsortBy
- Sort the results by an attribute. Prefix with - for descending sort orderList<Object> find(String typeCode, int startRow, int maxRows, String sortBy, Filter... filters)
typeCode
- A type code string of the type of the object to search for. All available type codes can be retrieved by calling <hostname>/pricefx/<partition name>/fetch
filters
- A list of filter objects that are AND'ed togetherstartRow
- The starting row of the result setmaxRows
- The maximum number of rows to retreive. If set to 0 it will default to 200sortBy
- Sort the results by an attribute. Prefix with - for descending sort orderList<Object> find(String typeCode, int startRow, int maxRows, String sortBy, List<String> fields, Filter... filters)
typeCode
- A type code string of the type of the object to search for. All available type codes can be retrieved by calling <hostname>/pricefx/<partition name>/fetch
filters
- A list of filter objects that are AND'ed togetherstartRow
- The starting row of the result setmaxRows
- The maximum number of rows to retreive. If set to 0 it will default to 200sortBy
- Sort the results by an attribute. Prefix with - for descending sort orderfields
- A list of fields. If null the entire object will be returnedList<Object> find(String typeCode, int startRow, int maxRows, String sortBy, List<String> fields, boolean distinctValuesOnly, Filter... filters)
typeCode
- A type code string of the type of the object to search for. All available type codes can be retrieved by calling <hostname>/pricefx/<partition name>/fetch
filters
- A list of filter objects that are AND'ed togetherstartRow
- The starting row of the result setmaxRows
- The maximum number of rows to retreive. If set to 0 it will default to 200sortBy
- Sort the results by an attribute. Prefix with - for descending sort orderfields
- A list of fields. If null the entire object will be returneddistinctValuesOnly
- fetches distinct/all values, use case is fetching distinct single column valuesorg.hibernate.ScrollableResults stream(String typeCode, String sortBy, Filter... filters)
typeCode
- A type code string of the type of the object to search for. All available type codes can be retrieved by calling /pricefx//fetch
filters
- A list of filter objects that are AND'ed togetherstartRow
- The starting row of the result setsortBy
- Sort the results by an attribute. Prefix with - for descending sort orderorg.hibernate.ScrollableResults stream(String typeCode, String sortBy, List<String> fields, Filter... filters)
typeCode
- A type code string of the type of the object to search for. All available type codes can be retrieved by calling /pricefx//fetch
filters
- A list of filter objects that are AND'ed togetherstartRow
- The starting row of the result setsortBy
- Sort the results by an attribute. Prefix with - for descending sort orderfields
- A list of attributes we only want to return in the result, i.e. skip all attributes not contained in the list the search would return otherwiseRemoteException
org.hibernate.ScrollableResults stream(String typeCode, String sortBy, List<String> fields, boolean distinctValuesOnly, Filter... filters)
typeCode
- A type code string of the type of the object to search for. All available type codes can be retrieved by calling /pricefx//fetch
filters
- A list of filter objects that are AND'ed togetherstartRow
- The starting row of the result setsortBy
- Sort the results by an attribute. Prefix with - for descending sort orderfields
- A list of attributes we only want to return in the result, i.e. skip all attributes not contained in the list the search would return otherwisedistinctValuesOnly
- fetches distinct/all values, use case is fetching distinct single column valuesRemoteException
boolean emit(Object obj)
obj
- The object to be emitted/inserted in the emit queueint count(String typeCode, Filter... filters)
find(java.lang.String, com.googlecode.genericdao.search.Filter...)
methods this method querys an arbitrary object type. It does not return the objects itself but the count.typeCode
- A type code string of the type of the object to search for. All available type codes can be retrieved by calling <hostname>/pricefx/<partition name>/fetch
filters
- A list of filter(java.lang.String,java.lang.Object)
objects that are AND'ed togethernet.pricefx.domain.LookupTable findLookupTable(String tableName)
tableName
- The name of the lookup tablenull
List<Object> findLookupTableValues(String tableName, Filter... filters)
tableName
- The name of the lookup tablefilters
- Optional extra filter(java.lang.String,java.lang.Object)
null
net.pricefx.workflowengine.WorkflowInfo findWorkflowInfo(String approvableTypeCode, Object approvableId)
approvableTypeCode
- type code of approvable. Approvables are for instances quotes, rebate agreements, data change requests etc.approvableId
- id of the approvablenull
if non foundList<net.pricefx.domain.CustomerAssignment> findCustomerAssignments(String customerId)
customerId
- The customer to search an assignment forList<net.pricefx.domain.Pricelist> findPricelists(Date targetDate, String listName)
targetDate
- The targetDate to uselistName
- Filter on list name. If null
the list name is not included in searchList<net.pricefx.domain.Simulation> findSimulations(Date targetDate, String simulationName)
targetDate
- The targetDate to usesimulationName
- Filter on simulation name. If null
the simulation name is not included in searchList<net.pricefx.domain.PriceGrid> findPriceGrids(Date targetDate, String priceGridName)
targetDate
- The targetDate to usepriceGridName
- Filter on price grid name. If null
the price grid name is not included in searchList<net.pricefx.domain.CalculatedFieldSet> findCalculatedFieldSets(Date targetDate, String cfsName)
targetDate
- Target date for the cfscfsName
- Filter on cfs name. If null
the cfs name is not included in searchList<net.pricefx.domain.ManualPricelist> findManualPricelists(Date targetDate, String listName)
targetDate
- The targetDate to uselistName
- Filter on list name. If null
the list name is not included in searchList<net.pricefx.server.dto.SummaryCalculableObjectItem> findApprovedPricelistItems(String sku)
sku
- The sku to filter onList<net.pricefx.domain.Customer> findCustomersInGroup(net.pricefx.domain.CustomerGroup group)
group
- The group to matchList<net.pricefx.domain.Customer> findCustomersInGroup(net.pricefx.domain.CustomerGroup group, int startRow, String sortBy)
group
- startRow
- The starting row number (only max 200 rows returned at once)sortBy
- A sort key. null
if no sorting is requiredRemoteException
Object getManualOverride(String elementName)
elementName
- The formula/result element that is overriddennull
if not overriddenvoid removeManualOverride(String elementName)
elementName
- The formula/result element that is overriddenvoid abortCalculation()
void throwException(String errorMessage) throws net.pricefx.formulaengine.XExpression
errorMessage
- The error message that is then also displayednet.pricefx.formulaengine.XExpression
void markItemDirty(String sku) throws net.pricefx.formulaengine.XExpression
sku
- The item to mark dirtynet.pricefx.formulaengine.XExpression
void markItemDirty(String sku, String key2) throws net.pricefx.formulaengine.XExpression
sku
- key2
- net.pricefx.formulaengine.XExpression
void markItemDirty() throws net.pricefx.formulaengine.XExpression
net.pricefx.formulaengine.XExpression
void markItemClean() throws net.pricefx.formulaengine.XExpression
net.pricefx.formulaengine.XExpression
boolean isSecondPass() throws net.pricefx.formulaengine.XExpression
net.pricefx.formulaengine.XExpression
int getIterationNumber() throws net.pricefx.formulaengine.XExpression
net.pricefx.formulaengine.XExpression
String formatString(String locale, String format, Object... args)
String.format(java.lang.String, java.lang.Object...)
locale
- The locale (as string)format
- The format stringargs
- The arguments to pass onString formatNumber(String pattern, BigDecimal n)
NumberFormat
and DecimalFormat.applyPattern(java.lang.String)
pattern
- The pattern stringn
- The number to formatString formatNumber(String pattern, Integer n)
NumberFormat
and DecimalFormat.applyPattern(java.lang.String)
pattern
- The pattern stringn
- The number to formatString formatNumber(String locale, String pattern, BigDecimal n)
NumberFormat
and DecimalFormat.applyPattern(java.lang.String)
pattern
- The pattern stringn
- The number to formatlocale
- The locae to use for formattingString formatNumber(String locale, String pattern, Integer n)
NumberFormat
and DecimalFormat.applyPattern(java.lang.String)
pattern
- The pattern stringn
- The number to formatlocale
- The locale to use for formattingObject jsonDecode(String json)
json
- The input JSON stringObject jsonDecodeList(String json)
json
- The input JSON stringObject jsonEncode(Object input)
json
- The input object, usually mapvoid criticalAlert(String msg)
msg
- The alert messagevoid redAlert(String msg)
msg
- The alert messagevoid yellowAlert(String msg)
msg
- The alert messagenet.pricefx.server.dto.calculation.ResultFlexChart buildFlexChart(Object definition) throws RemoteException
RemoteException
net.pricefx.server.dto.calculation.ResultFlexChart buildFlexChart(String baseTemplateToUse, Object definition)
FlexChart
from the passed definition
by
merging it with options
defined within the
baseTemplateToUse
template.
Although it may change in future releases, for now, a
FlexChart
is nothing else than a Highcharts
chart. Therefore the passed definition
(also applies to the
baseTemplateToUse
template) must denote
Highcharts options
- please consult Highcharts
documentation for more details on this.
Since Highcharts options
normally get specified by using a
JavaScript object literal
, the passed
definition
must be either a JSON
string
representing such object literal
, or any object
which can be mapped to such JSON
representation. Therefore,
typically the definiton
will be passed as a
map of maps
. Example:
Please note that not alldef definition = [ chart: [ type: "bar" ], title: [ text: "A common FlexChart" ], series: [ [ data: [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] ] ] ] api.buildFlexChart(definition)
Highcharts options
are supported!
Moreover, usage of some options is prohibited deliberately. These are
currently global
, events
and every
JavaScript function
-based options.
Note: FlexChart
templates get defined by an administrator in
the 'Configuration
' section.
baseTemplateToUse
- the name of the template to use as a basis for merging with
the passed definition
; if null
, the
predefined Default template gets useddefinition
- the definition of the FlexChart
; currently, this
will typically be a string or map of maps containing
Highcharts options
FlexChart
,
baseTemplateToUse
and type of the result - which
will always be 'FLEXCHART', herenet.pricefx.service.ItemSummaryQuery<net.pricefx.domain.Pricelist> getPricelistSummaryQuery()
runSummaryQuery(ItemSummaryQuery)
This query runs against pricelist(s)net.pricefx.service.ItemSummaryQuery<net.pricefx.domain.Simulation> getSimulationSummaryQuery()
runSummaryQuery(ItemSummaryQuery)
This query runs against simulation(s)net.pricefx.service.ItemSummaryQuery<net.pricefx.domain.PriceGrid> getPriceGridSummaryQuery()
runSummaryQuery(ItemSummaryQuery)
This query runs against price grid(s)net.pricefx.service.ItemSummaryQuery<net.pricefx.domain.RebateRecordSet> getRebateRecordSummaryQuery()
runSummaryQuery(ItemSummaryQuery)
This query runs against rebate recordsList<Map<String,Object>> runSummaryQuery(net.pricefx.service.ItemSummaryQuery<? extends net.pricefx.domain.CalculableObject> query)
query
- The query to executenet.pricefx.server.dto.calculation.ConfiguratorEntry createConfiguratorEntry(net.pricefx.common.api.InputType type, String name)
type
- Input type of the parametername
- name of the parameternet.pricefx.server.dto.calculation.ConfiguratorEntry createConfiguratorEntry(net.pricefx.common.api.InputType type, String name, Date targetDate)
type
- Input type of the parametername
- name of the parametertargetDate
- Target date for the input parameter (not applicable to all input types)net.pricefx.server.dto.calculation.ConfiguratorEntry createConfiguratorEntry()
Object configurator(String configuratorName, String formulaName)
configuratorName
- The name of the configurator. Similar to other options' namesformulaName
- The name of the configurator's formula which is used to drive the input selectionsDate parseDate(String pattern, String date)
Hint: for parsing datetimes (i.e. dates also including information about the time of a day), use the parseDateTime(String, String)
method instead.
pattern
- pattern for parsing (see DateTimeFormat for pattern format specification)date
- date as string in format specified by the pattern
org.joda.time.DateTime parseDateTime(String pattern, String datetime)
Important note: this method will use the UTC time zone for parsing (unless the provided pattern
make use of syntax explicitly
specifying a time zone). If a different time zone is required, please use the parseDateTime(String, String, int, int)
method which allows to
set a time zone by providing an offset to UTC in hours and minutes.
pattern
- pattern for parsing (see DateTimeFormat for pattern format specification)datetime
- datetime as string in format specified by the pattern
org.joda.time.DateTime parseDateTime(String pattern, String datetime, int tzHoursOffset, int tzMinutesOffset)
Important note: this method will always use the provided time zone no matter on the possible time zone set explicitly in datetime
pattern
- pattern for parsing (see DateTimeFormat for pattern format specification)datetime
- datetime as string in format specified by the pattern
tzHoursOffset
- the offset in hours from UTC, from -23 to +23tzMinutesOffset
- the offset in minutes from UTC, from -59 to +59Filter createElementNameFilter(String elementName, Object fieldValue, String... listTypedIds)
elementName
- The element name (originates from formula element name or MPL integration tag)fieldValue
- The value (= oprtator applied) of that attributelistTypedIds
- A list of typedId of the "header" objects. E.g. 34.PL. Supported type codes are PL, MPL, PG and SIMMap<String,Object> getItemCompleteCalculationResults(String typedId)
Note: these are not returned when using other methods (e.g. pricelistItem(String, String)
)
typedId
- typedId of the item, e.g. 34.PLI. Supported type codes are PLI, XPLI, SIMI, XSIMI, PGI and RRObject httpCall(String url, String body) throws net.pricefx.formulaengine.XExpression
url
- - full url to the endpoint (https or http)body
- body of the requestnet.pricefx.formulaengine.XExpression
Object boundCall(String uniqueName, String relativeUrl, String body, Boolean... responseBodyAsAString) throws net.pricefx.formulaengine.XExpression
uniqueName
- - unique name of bound partition. See Configuration/Bound PartitionsrelativeUrl
- - relative URL to Price f(x) server command. First slash excluded.body
- body of the requestresponseBodyAsAStrings
- - if first param is true, than the body is not converted to json but returned as a stringnet.pricefx.formulaengine.XExpression
Object getBoundPartitionNames()
Object httpCall(String url, String body, String methodType, String contentType, Map... properties) throws net.pricefx.formulaengine.XExpression
url
- - full url to the endpoint (https or http)body
- body of the requestmethodType
- "Get"
or "Post"
contentType
- "JSON"
"XML"
or any full content type for instance "text/plain"
properties
- map of properties. Following are allowed:
String
value - user name for basic authenticationString
value - user password for basic authenticationboolean
value - Ignores invalid certificates. Use for testing https connections only. Not for production use.String
value - user name for proxy (if any)String
value - user password for proxy (if any)String
value - full url to proxynet.pricefx.formulaengine.XExpression
Object add(String typeCode, Map<String,Object> values)
typeCode
- A type code string of the type of the object to search for. All available type codes can be retrieved by calling <hostname>/pricefx/<partition name>/fetch
values
- key-value pairs representing fields of object we want to add. Note that all significant fields has to be present.Object addOrUpdate(String typeCode, Map<String,Object> values)
typeCode
- A type code string of the type of the object to search for. All available type codes can be retrieved by calling <hostname>/pricefx/<partition name>/fetch
values
- key-value pairs representing fields of object we want to add or update. Note that all significant fields has to be present.Object update(String typeCode, Map<String,Object> values)
typeCode
- A type code string of the type of the object to search for. All available type codes can be retrieved by calling <hostname>/pricefx/<partition name>/fetch
values
- key-value pairs representing fields of object we want to update. Note that all significant fields has to be present.null
if error occuredObject delete(String typeCode, Map<String,Object> values)
typeCode
- A type code string of the type of the object to search for. All available type codes can be retrieved by calling <hostname>/pricefx/<partition name>/fetch
values
- key-value pairs representing significant fields of object we want to delete. Note that all significant fields has to be present, if not the id has to be presentnull
if error occuredvoid sendEmail(String to, String subject, String message)
to
- email address the email is sent tosubject
- email subjectmessage
- email bodyvoid customEvent(Object object)
object
- The object to pass alon with the eventvoid customEvent(Object object, String customEventType)
object
- The object to pass alon with the eventcustomEventType
- A custom string to classify the event type (as the general event type is always CUSTOMvoid customEvent(Object object, String customEventType, String operation)
object
- The object to pass alon with the eventcustomEventType
- A custom string to classify the event type (as the general event type is always CUSTOMoperation
- One of these strings: UPDATE,DELETE,ADD,ITEMCHANGEObject updateCalculableObjectHeader(String calcObjTypeCode, String calcObjName)
calcObjTypeCode
- Type code of object to updatecalcObjName
- (Numeric) Id of object to updateObject getClusterNodes()
net.pricefx.server.dto.calculation.dashboard.DashboardApi dashboard(String dashboardName)
net.pricefx.server.dto.calculation.AttributedResult attributedResult(Object result)
ResultMatrix newMatrix()
ResultMatrix newMatrix(String... columns)
The individual cells can be styled via the use of - linkCell(Object value,String targetPage, String targetPageState) - imageCell(Object imageUrl) - styledCell(Object value, String textColor,String bgColor, String weight, String alignment) - styledCell(Object value, String textColor,String bgColor, String weight) - styledCell(Object value, String textColor,String bgColor) - setColumnFormat(String column, FieldFormatType fft) Valid FieldFormatTypes are: NUMERIC, NUMERIC_LONG, MONEY, PERCENT, TEXT, MONEY_EUR, MONEY_USD, MONEY_GBP, MONEY_JPY, MONEY_CHF, MONEY_PLN, DATETIME, DATE, INTEGERSample code:
def resultMatrix = api.newMatrix("Margin Status","Customer Id","Name","Net Margin %") def i=0 for(entry in rawValues.getEntries()) { def row =[:] row.put("Customer Id",resultMatrix.linkCell(entry.get("CustomerID"),"customersPage",entry.get("CustomerID"))) row.put("Name",entry.get("CustomerName")) def margin = entry.get("NetMargin%")/100 row.put("Net Margin %",resultMatrix.styledCell(margin,"#FF0000",null,"bold")) if(margin <= 0) row.put("Margin Status",resultMatrix.imageCell("/images/small_trafficlight_red.png")) if(margin <0.1 && margin > 0) row.put("Margin Status",resultMatrix.imageCell("/images/small_trafficlight_yellow.png")) if(margin >=0.1 ) row.put("Margin Status",resultMatrix.imageCell("/images/small_trafficlight_green.png")) resultMatrix.addRow(row) i++ if(i>10) break; } resultMatrix.setColumnFormat("Net Margin %",FieldFormatType.PERCENT) return resultMatrix
columns
- The initial set of columns for the result matrixnet.pricefx.server.dto.calculation.ResultGauge newGauge()
def g = api.newGauge() g.addSector(5,"#FF0000") g.addSector(25,"#FFFF00") g.addSector(null,"#00FF00") g.setValue(10)
net.pricefx.common.apibuilder.chart.ChartBuilder newChartBuilder()
net.pricefx.server.dto.calculation.DashboardController newController()
def controller = api.newController() controller.addButton(label,targetPage,targetPageState) controller.addHTML(label,someValidHTML)
Filter walkFilter(Filter filter, groovy.lang.Closure visitBefore, groovy.lang.Closure visitAfter, boolean removeNulls)
removeNulls
is consulted only in case of
(sub)filters which take a list of sub filters.
Hence, this method may be used in many cases. For instance, you could use it for mapping the current property set to another one, e.g. to convert a PB filter to a PA one. Somehow like this:
def propertyMappings = ["sku": "ProductID"] api.walkFilter(pbFilter, null, { filter -> if (filter != null && propertyMappings[filter.property] != null) filter.property = propertyMappings[filter.property] filter }, false);
Object findDataLoad(String dataLoadLabel, String dataLoadType, String target)
dataLoadLabel
- Label of DMDataLoad as seen in Data load UIdataLoadType
- Load Type of DMDataLoad as seen in Data load UI. Namely :
target
- Target of DMDataLoad as seen in Data load UICopyright © 2015. All rights reserved.