gregmoser / entitysmartlist Goto Github PK
View Code? Open in Web Editor NEWColdfusion ORM entity listing function to automatically handle Weighted Search, Filters, Ranges & Orders
Coldfusion ORM entity listing function to automatically handle Weighted Search, Filters, Ranges & Orders
Add following options for caching:
Ajax Caching
Session Caching
Client Caching
Request Caching
The caching would not only save the entities but their keyword scores and any other filters, paging and ranges.
How does smartList handle many-to-many relationships when filtering. I have tried to filter on a many-to-many relationship like this....
rc.F_ScapeType_ScapeTypeName = "test";
for a link in scape.cfc
property name="ScapeType" fieldtype="many-to-many" cfc="pScapeType" type="array" singularname="scapeType" linktable="pLinkScapesToTypes";
however the error I get back is
{"TAGCONTEXT":"D:\wwwroot\flipscape\website\plugins\flipscape\com\utility\SmartList.cfc [Line 525]","DETAIL":"org.hibernate.hql.ast.QuerySyntaxException: unexpected token: . near line 1, column 29 [ from pScape apScape WHERE (.ScapeTypeName = :F_1_1) ORDER BY apScape.scapeName ASC]","ERROR":"Error while executing the Hibernate query."}
simply 1-to-many and many-to-1 works but I have not be able to many-to-many via a link tabke to work. this is a bug?
Ref below lines of code. Is this a bug?
I have to append my entity prefix pDashboardApp_ when filtering like this on relationships...
rc.F_widgetType_widgetTypeName = "test";
private string function getValidHQLProperty(required string rawProperty) {
var returnProperty = "";
var entityPropertyArray = ListToArray(arguments.rawProperty, "_");
var currentEntityName = getEntityName();
for(var i=1; i <= arrayLen(entityPropertyArray); i++){
var entityProperty = getValidEntityProperty(entityPropertyArray[i], currentEntityName);
if(entityProperty != ""){
if(i==1){
returnProperty &= "a#currentEntityName#.#entityProperty#";
} else {
returnProperty &= ".#entityProperty#";
}
currentEntityName = "pDashboardApp_#entityProperty#";
} else {
returnProperty = "";
}
}
return returnProperty;
}
private string function getValidHQLPropertyValue(required string rawProperty, required any value) {
var returnValue = "";
var entityPropertyArray = ListToArray(arguments.rawProperty, "_");
var currentEntityName = getEntityName();
for(var i=1; i <= arrayLen(entityPropertyArray); i++){
var entityProperty = getValidEntityProperty(entityPropertyArray[i], currentEntityName);
if(entityProperty != ""){
if(i == arrayLen(entityPropertyArray)) {
returnValue = getValidEntityPropertyValue(entityProperty, arguments.value, currentEntityName);
} else {
currentEntityName = "pDashboardApp_#entityProperty#";
}
}
}
return returnValue;
}
This feature would enable a smart list to have it's delimiters changed on the Init. The delimiters that would be able to be used are:
Filter & Range Value Seperator, currently is a carrot: ^
Order Direction assignment, current is a pipe: |
Sub Entity Designation, currently is a underscore: _
Greg:
With the Code Available in the Repo, I ran the Examples (and changed the entities for my Railo 4.2 Server, Win7 -64, IIS) and ran them to get the following Error:
component [SmartList] has no function with name [getEntityArray]
Ideas?
Create a small suite of custom tags that can utilize the smart list to generate paging navigation, or filter option lists or ajax enabled functionality.
Add methods like:
getFilterLink(filterProperty, filterValue);
that will take into account the current rc and generate a URL the preserve the old and new. This would also be for paging, ranges & orders.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.