├── _config.yml
├── examples
└── breezejs
│ ├── api
│ ├── taffy
│ │ ├── tests
│ │ │ ├── index.cfm
│ │ │ ├── someFolder
│ │ │ │ └── someOtherFile.cfm
│ │ │ ├── tests
│ │ │ │ ├── RemoteFacade.cfc
│ │ │ │ ├── upload.png
│ │ │ │ ├── index.cfm
│ │ │ │ ├── Application.cfc
│ │ │ │ ├── list.cfm
│ │ │ │ ├── TestRepresentations.cfc
│ │ │ │ ├── TestLoggers.cfc
│ │ │ │ ├── TestResource.cfc
│ │ │ │ ├── base.cfc
│ │ │ │ └── TestFactory.cfc
│ │ │ ├── resourcesError
│ │ │ │ └── ErrorMember.cfc
│ │ │ ├── resources
│ │ │ │ ├── EmptyRepresentationClass.cfc
│ │ │ │ ├── uriConflict.cfc
│ │ │ │ ├── exceptionMember.cfc
│ │ │ │ ├── BasicAuth.cfc
│ │ │ │ ├── customJsonRepresentation.cfc
│ │ │ │ ├── acceptFileUpload.cfc
│ │ │ │ ├── EchoRegexMember.cfc
│ │ │ │ ├── EchoMethodTunnelMember.cfc
│ │ │ │ └── EchoMember.cfc
│ │ │ └── Application.cfc
│ │ ├── examples
│ │ │ ├── api_DI1
│ │ │ │ ├── index.cfm
│ │ │ │ ├── model
│ │ │ │ │ └── foo.cfc
│ │ │ │ └── Application.cfc
│ │ │ ├── api_empty
│ │ │ │ ├── index.cfm
│ │ │ │ └── Application.cfc
│ │ │ ├── api_BugLogHQ
│ │ │ │ ├── index.cfm
│ │ │ │ ├── resources
│ │ │ │ │ └── throwsException.cfc
│ │ │ │ └── Application.cfc
│ │ │ ├── api_Hoth
│ │ │ │ ├── hoth
│ │ │ │ │ ├── logs
│ │ │ │ │ │ └── .empty
│ │ │ │ │ └── exceptions
│ │ │ │ │ │ ├── exceptions
│ │ │ │ │ │ └── _readme.txt
│ │ │ │ │ │ └── incidents
│ │ │ │ │ │ └── _readme.txt
│ │ │ │ ├── index.cfm
│ │ │ │ ├── resources
│ │ │ │ │ ├── throwsException.cfc
│ │ │ │ │ └── HothConfig.cfc
│ │ │ │ └── Application.cfc
│ │ │ ├── api_LogToEmail
│ │ │ │ ├── index.cfm
│ │ │ │ ├── resources
│ │ │ │ │ └── savesLog.cfc
│ │ │ │ └── Application.cfc
│ │ │ ├── api_uploadImg
│ │ │ │ ├── index.cfm
│ │ │ │ ├── _scratch
│ │ │ │ │ └── headshot_silly_square200.jpg
│ │ │ │ ├── client
│ │ │ │ │ └── index.html
│ │ │ │ ├── Application.cfc
│ │ │ │ └── resources
│ │ │ │ │ └── imageCollection.cfc
│ │ │ ├── api_img
│ │ │ │ ├── images
│ │ │ │ │ ├── kittens.jpg
│ │ │ │ │ ├── kittens_2.jpg
│ │ │ │ │ ├── kittens_3.jpg
│ │ │ │ │ ├── Kitten_cups.jpg
│ │ │ │ │ ├── cute-kitten.bmp
│ │ │ │ │ ├── kitten_in_bed.jpg
│ │ │ │ │ ├── shoot_kitten.jpg
│ │ │ │ │ ├── PETA_sea_kitten.jpg
│ │ │ │ │ ├── cute-kittens-pic51.jpg
│ │ │ │ │ └── kitten_in_dogs_ear.gif
│ │ │ │ ├── .htaccess
│ │ │ │ ├── index.cfm
│ │ │ │ ├── resources
│ │ │ │ │ ├── pdf.cfc
│ │ │ │ │ ├── random.cfc
│ │ │ │ │ └── randomScaled.cfc
│ │ │ │ └── Application.cfc
│ │ │ ├── ParentApplication
│ │ │ │ ├── index.cfm
│ │ │ │ ├── api
│ │ │ │ │ ├── .htaccess
│ │ │ │ │ ├── index.cfm
│ │ │ │ │ └── Application.cfc
│ │ │ │ ├── mixin
│ │ │ │ │ └── appInit.cfm
│ │ │ │ ├── config
│ │ │ │ │ └── coldspring.xml
│ │ │ │ ├── model
│ │ │ │ │ └── fooCollection.cfc
│ │ │ │ └── Application.cfc
│ │ │ ├── api_twoFactories
│ │ │ │ ├── config
│ │ │ │ │ └── coldspring.xml
│ │ │ │ ├── index.cfm
│ │ │ │ ├── resources
│ │ │ │ │ └── artfartCollection.cfc
│ │ │ │ └── Application.cfc
│ │ │ ├── api
│ │ │ │ ├── .htaccess
│ │ │ │ ├── index.cfm
│ │ │ │ ├── resources
│ │ │ │ │ ├── foo
│ │ │ │ │ │ ├── artCollection.cfc
│ │ │ │ │ │ └── bar
│ │ │ │ │ │ │ └── artistCollection.cfc
│ │ │ │ │ ├── artMember.cfc
│ │ │ │ │ └── artistMember.cfc
│ │ │ │ └── Application.cfc
│ │ │ ├── api_jsonutil
│ │ │ │ ├── .htaccess
│ │ │ │ ├── index.cfm
│ │ │ │ ├── Application.cfc
│ │ │ │ └── resources
│ │ │ │ │ ├── JsonUtilRepresentation.cfc
│ │ │ │ │ ├── artCollection.cfc
│ │ │ │ │ ├── artMember.cfc
│ │ │ │ │ ├── artistMember.cfc
│ │ │ │ │ └── artistCollection.cfc
│ │ │ ├── api_anythingtoxml
│ │ │ │ ├── .htaccess
│ │ │ │ ├── index.cfm
│ │ │ │ ├── Application.cfc
│ │ │ │ ├── resources
│ │ │ │ │ ├── artCollection.cfc
│ │ │ │ │ ├── artMember.cfc
│ │ │ │ │ ├── artistCollection.cfc
│ │ │ │ │ └── artistMember.cfc
│ │ │ │ └── anythingtoxml
│ │ │ │ │ ├── TabUtils.cfc
│ │ │ │ │ ├── XMLutils.cfc
│ │ │ │ │ ├── ArrayToXML.cfc
│ │ │ │ │ └── AnythingToXML.cfc
│ │ │ ├── api_configVar
│ │ │ │ ├── index.cfm
│ │ │ │ ├── resources
│ │ │ │ │ ├── artCollection.cfc
│ │ │ │ │ ├── artMember.cfc
│ │ │ │ │ ├── artistCollection.cfc
│ │ │ │ │ └── artistMember.cfc
│ │ │ │ └── Application.cfc
│ │ │ ├── api_coldspring
│ │ │ │ ├── index.cfm
│ │ │ │ ├── config
│ │ │ │ │ └── coldspring.xml
│ │ │ │ ├── stuff
│ │ │ │ │ └── artfartCollection.cfc
│ │ │ │ └── Application.cfc
│ │ │ ├── api_rateLimited
│ │ │ │ ├── index.cfm
│ │ │ │ ├── Application.cfc
│ │ │ │ └── resources
│ │ │ │ │ └── artistMember.cfc
│ │ │ ├── api_requireApiKey
│ │ │ │ ├── index.cfm
│ │ │ │ ├── Application.cfc
│ │ │ │ └── resources
│ │ │ │ │ └── artistMember.cfc
│ │ │ ├── api_twoFormats
│ │ │ │ ├── index.cfm
│ │ │ │ ├── Application.cfc
│ │ │ │ └── resources
│ │ │ │ │ ├── CustomRepresentationClass.cfc
│ │ │ │ │ ├── artCollection.cfc
│ │ │ │ │ ├── artMember.cfc
│ │ │ │ │ ├── AnythingToXML
│ │ │ │ │ ├── TabUtils.cfc
│ │ │ │ │ ├── XMLutils.cfc
│ │ │ │ │ ├── ArrayToXML.cfc
│ │ │ │ │ └── AnythingToXML.cfc
│ │ │ │ │ ├── artistCollection.cfc
│ │ │ │ │ └── artistMember.cfc
│ │ │ ├── coldspring_aop
│ │ │ │ ├── index.cfm
│ │ │ │ ├── endpoints
│ │ │ │ │ ├── SamplesFormatting.cfc
│ │ │ │ │ └── SamplesCaching.cfc
│ │ │ │ ├── Application.cfc
│ │ │ │ ├── com
│ │ │ │ │ └── aspects
│ │ │ │ │ │ └── FormattingAroundAdvice.cfc
│ │ │ │ └── config
│ │ │ │ │ └── coldspring.xml
│ │ │ ├── index.cfm
│ │ │ ├── shared
│ │ │ │ └── fakeData.cfc
│ │ │ └── consumer
│ │ │ │ └── Application.cfc
│ │ ├── lib
│ │ │ ├── mxunit-ant.jar
│ │ │ ├── ant-contrib-1.0b3.jar
│ │ │ └── README.TXT
│ │ ├── dashboard
│ │ │ ├── logo-lg.png
│ │ │ ├── asset.cfm
│ │ │ └── dash.less
│ │ ├── core
│ │ │ ├── genericRepresentation.cfc
│ │ │ ├── nativeJsonRepresentation.cfc
│ │ │ └── resource.cfc
│ │ ├── .gitignore
│ │ ├── bonus
│ │ │ ├── LogToDevNull.cfc
│ │ │ ├── ILogAdapter.cfc
│ │ │ ├── AnythingToXmlRepresentation.cfc
│ │ │ ├── JsonUtilRepresentation.cfc
│ │ │ ├── LogToScreen.cfc
│ │ │ ├── LogToHoth.cfc
│ │ │ ├── LogToBugLogHQ.cfc
│ │ │ └── LogToEmail.cfc
│ │ ├── INSTALL.TXT
│ │ ├── snippets
│ │ │ └── Taffy
│ │ │ │ ├── Representation-script.xml
│ │ │ │ ├── Representation-tag.xml
│ │ │ │ ├── Resource-script.xml
│ │ │ │ ├── Resource-tag.xml
│ │ │ │ ├── Application cfc-script.xml
│ │ │ │ └── Application cfc-tag.xml
│ │ ├── LICENSE.TXT
│ │ └── CONTRIBUTING.md
│ ├── index.cfm
│ ├── resources
│ │ ├── breezeMetaData.cfc
│ │ ├── todoMember.cfc
│ │ └── todosCollection.cfc
│ └── Application.cfc
│ ├── scripts
│ ├── _references.js
│ └── app
│ │ ├── main.js
│ │ └── logger.js
│ ├── model
│ └── TodoItem.cfc
│ ├── assets
│ └── css
│ │ └── reset.css
│ └── index.html
├── .gitignore
├── server.json
├── model
├── TodoItem.cfc
├── User.cfc
├── Pet.cfc
└── EventLog.cfc
├── tests
├── Company.cfc
├── CompanyArray.cfc
├── runner.cfm
└── testNormWithEntityDefinitions.cfc
├── box.json
├── database
├── railoHacks.cfc
└── IDAOConnector.cfc
└── README.md
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-modernist
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/index.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_DI1/index.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_empty/index.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_BugLogHQ/index.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_Hoth/hoth/logs/.empty:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_LogToEmail/index.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_uploadImg/index.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/someFolder/someOtherFile.cfm:
--------------------------------------------------------------------------------
1 | I am some non-framework-related file. woot.
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_empty/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/tests/RemoteFacade.cfc:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /.settings
2 | /settings.xml
3 | /WEB-INF/
4 | *.sublime-project
5 | *.sublime-workspace
6 | /.history/
7 | /testbox
8 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/resourcesError/ErrorMember.cfc:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/examples/breezejs/scripts/_references.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abramadams/dao/HEAD/examples/breezejs/scripts/_references.js
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/lib/mxunit-ant.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abramadams/dao/HEAD/examples/breezejs/api/taffy/lib/mxunit-ant.jar
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/dashboard/logo-lg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abramadams/dao/HEAD/examples/breezejs/api/taffy/dashboard/logo-lg.png
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/tests/upload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abramadams/dao/HEAD/examples/breezejs/api/taffy/tests/tests/upload.png
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/lib/ant-contrib-1.0b3.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abramadams/dao/HEAD/examples/breezejs/api/taffy/lib/ant-contrib-1.0b3.jar
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_Hoth/hoth/exceptions/exceptions/_readme.txt:
--------------------------------------------------------------------------------
1 | Hoth: The files within this directory contain the complete details for each unique exception.
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_img/images/kittens.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abramadams/dao/HEAD/examples/breezejs/api/taffy/examples/api_img/images/kittens.jpg
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_img/images/kittens_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abramadams/dao/HEAD/examples/breezejs/api/taffy/examples/api_img/images/kittens_2.jpg
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_img/images/kittens_3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abramadams/dao/HEAD/examples/breezejs/api/taffy/examples/api_img/images/kittens_3.jpg
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_img/images/Kitten_cups.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abramadams/dao/HEAD/examples/breezejs/api/taffy/examples/api_img/images/Kitten_cups.jpg
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_img/images/cute-kitten.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abramadams/dao/HEAD/examples/breezejs/api/taffy/examples/api_img/images/cute-kitten.bmp
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_img/images/kitten_in_bed.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abramadams/dao/HEAD/examples/breezejs/api/taffy/examples/api_img/images/kitten_in_bed.jpg
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_img/images/shoot_kitten.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abramadams/dao/HEAD/examples/breezejs/api/taffy/examples/api_img/images/shoot_kitten.jpg
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_img/images/PETA_sea_kitten.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abramadams/dao/HEAD/examples/breezejs/api/taffy/examples/api_img/images/PETA_sea_kitten.jpg
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_Hoth/hoth/exceptions/incidents/_readme.txt:
--------------------------------------------------------------------------------
1 | Hoth: The files within this directory contain the details about the volume of errors for each unique exception.
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_img/images/cute-kittens-pic51.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abramadams/dao/HEAD/examples/breezejs/api/taffy/examples/api_img/images/cute-kittens-pic51.jpg
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_img/images/kitten_in_dogs_ear.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abramadams/dao/HEAD/examples/breezejs/api/taffy/examples/api_img/images/kitten_in_dogs_ear.gif
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/ParentApplication/index.cfm:
--------------------------------------------------------------------------------
1 |
Parent Application
2 |
3 | Hi there. I'm the parent application. Want to see what's under the hood?
4 |
5 |
--------------------------------------------------------------------------------
/server.json:
--------------------------------------------------------------------------------
1 | {
2 | "app":{
3 | "cfengine":"lucee@5"
4 | },
5 | "web":{
6 | "http":{
7 | "port":"8500"
8 | }
9 | },
10 | "openbrowser":"false"
11 | }
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_uploadImg/_scratch/headshot_silly_square200.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abramadams/dao/HEAD/examples/breezejs/api/taffy/examples/api_uploadImg/_scratch/headshot_silly_square200.jpg
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_twoFactories/config/coldspring.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/core/genericRepresentation.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api/.htaccess:
--------------------------------------------------------------------------------
1 | RewriteEngine On
2 |
3 | #if we've already been rewritten to use index.cfm/* format, don't make a circular request
4 | RewriteRule index\.cfm/* - [L]
5 |
6 | RewriteRule ^(.*)$ index.cfm/$1
7 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_DI1/model/foo.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_jsonutil/.htaccess:
--------------------------------------------------------------------------------
1 | RewriteEngine On
2 |
3 | #if we've already been rewritten to use index.cfm/* format, don't make a circular request
4 | RewriteRule index\.cfm/* - [L]
5 |
6 | RewriteRule ^(.*)$ index.cfm/$1
7 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/resources/EmptyRepresentationClass.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_anythingtoxml/.htaccess:
--------------------------------------------------------------------------------
1 | RewriteEngine On
2 |
3 | #if we've already been rewritten to use index.cfm/* format, don't make a circular request
4 | RewriteRule index\.cfm/* - [L]
5 |
6 | RewriteRule ^(.*)$ index.cfm/$1
7 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/ParentApplication/api/.htaccess:
--------------------------------------------------------------------------------
1 | RewriteEngine On
2 |
3 | #if we've already been rewritten to use index.cfm/* format, don't make a circular request
4 | RewriteRule index\.cfm/* - [L]
5 |
6 | RewriteRule ^(.*)$ index.cfm/$1
7 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_img/.htaccess:
--------------------------------------------------------------------------------
1 | RewriteEngine On
2 |
3 | #if we've already been rewritten to use index.cfm/* format, don't make a circular request
4 | RewriteRule ^(index\.cfm[/.]?+|images/.*) - [L]
5 |
6 | RewriteRule ^(.*)$ index.cfm/$1
7 |
--------------------------------------------------------------------------------
/examples/breezejs/api/index.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/resources/uriConflict.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/lib/README.TXT:
--------------------------------------------------------------------------------
1 | Files in the /lib folder exist solely for the purpose of running the tests.
2 | You do not need to keep them for your installation. You can delete everything
3 | except /core and /bonus, but I would recommend you keep /examples around too.
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/ParentApplication/mixin/appInit.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api/index.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_Hoth/index.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_img/index.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_configVar/index.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_jsonutil/index.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_anythingtoxml/index.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_coldspring/index.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_rateLimited/index.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_requireApiKey/index.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_twoFactories/index.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_twoFormats/index.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/ParentApplication/api/index.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/coldspring_aop/index.cfm:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/resources/exceptionMember.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_BugLogHQ/resources/throwsException.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_Hoth/resources/throwsException.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_uploadImg/client/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_coldspring/config/coldspring.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_jsonutil/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | this.name = hash(getCurrentTemplatePath());
5 |
6 | variables.framework = {};
7 | variables.framework.representationClass = "JsonUtilRepresentation";
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/resources/BasicAuth.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_uploadImg/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | this.name = hash(getCurrentTemplatePath());
5 |
6 | variables.framework = {};
7 | variables.framework.unhandledPaths = "/Taffy/examples/api_uploadImg/client";
8 |
9 |
10 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/.gitignore:
--------------------------------------------------------------------------------
1 | .project
2 | .settings
3 | settings.xml
4 | examples/api/jquery.min.js
5 | WEB-INF
6 | tests/tests/output
7 | examples/api_hoth/hoth/exceptions/exceptions/*.log
8 | examples/api_hoth/hoth/exceptions/incidents/*.log
9 | examples/api_hoth/hoth/logs/*.hoth
10 | examples/api_hoth/hoth/logs/*.log
11 | css/*
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/tests/index.cfm:
--------------------------------------------------------------------------------
1 |
7 |
8 | #results.getResultsOutput('extjs')#
--------------------------------------------------------------------------------
/examples/breezejs/api/resources/breezeMetaData.cfc:
--------------------------------------------------------------------------------
1 | component extends="taffy.core.resource" taffy_uri="breeze/todos/Metadata" {
2 |
3 | remote function get(){
4 |
5 | var todo = new com.database.Norm( dao = application.dao, table = "TodoItem");
6 |
7 | return representationOf( todo.getoDataMetaData( excludeKeys = [ "_id" ] ) ).withStatus(200);
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/bonus/LogToDevNull.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/ParentApplication/config/coldspring.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/bonus/ILogAdapter.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_Hoth/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 | this.name = hash(getCurrentTemplatePath());
4 |
5 | variables.framework = {};
6 | variables.framework.exceptionLogAdapter = "taffy.bonus.LogToHoth";
7 | variables.framework.exceptionLogAdapterConfig = "taffy.examples.api_hoth.resources.HothConfig";
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/bonus/AnythingToXmlRepresentation.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/breezejs/api/resources/todoMember.cfc:
--------------------------------------------------------------------------------
1 | component extends="taffy.core.resource" taffy_uri="breeze/todos/SaveChanges" {
2 |
3 | remote function post(){
4 |
5 | //var todo = new model.TodoItem( dao = dao );
6 | var todo = new com.database.Norm( dao = application.dao, table = "TodoItem");
7 |
8 | var ret = todo.oDataSave( arguments.entities );
9 |
10 | return representationOf( ret ).withStatus(200);
11 |
12 | }
13 | }
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/bonus/JsonUtilRepresentation.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/INSTALL.TXT:
--------------------------------------------------------------------------------
1 | Unfortunately, to keep things simple, I had to sacrifice a little bit of cleanliness.
2 |
3 | To install Taffy, all you need to do is either create a Taffy folder in your web root, or create a /taffy mapping;
4 | and in it, place the /core and /bonus folders from this archive.
5 |
6 | Everything else is for purposes of development, testing, and examples.
7 |
8 | Enjoy!
9 | -Adam
10 | http://fusiongrokker.com
11 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_LogToEmail/resources/savesLog.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/coldspring_aop/endpoints/SamplesFormatting.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | local.resourceData = StructNew();
6 | local.resourceData["foo"] = "bar";
7 | return local.resourceData;
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/core/nativeJsonRepresentation.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/ParentApplication/api/Application.cfc:
--------------------------------------------------------------------------------
1 | component extends="taffy.core.api" {
2 |
3 | this.name = "taffy_ParentAppExample";//same name as api folder application.cfc
4 |
5 | variables.framework = {};
6 | variables.framework.beanFactory = "";
7 |
8 | function onApplicationStart(){
9 | include "../mixin/appInit.cfm";
10 |
11 | variables.framework.beanFactory = application.beanFactory;
12 |
13 | return super.onApplicationStart();
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/resources/customJsonRepresentation.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/index.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_DI1/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | this.name = hash(getCurrentTemplatePath());
5 |
6 | variables.framework = {};
7 |
8 | function onApplicationStart(){
9 | application.beanFactory = createObject("component", "di1.ioc").init( "/taffy/examples/api_DI1/model" );
10 |
11 | variables.framework.beanFactory = application.beanFactory;
12 |
13 | return super.onApplicationStart();
14 | }
15 |
16 |
17 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/shared/fakeData.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_anythingtoxml/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | this.name = hash(getCurrentTemplatePath());
5 |
6 | variables.framework = {};
7 | variables.framework.representationClass = "taffy.bonus.AnythingToXmlRepresentation";
8 |
9 | function onApplicationStart(){
10 | application.anythingToXml = createObject("component", "anythingtoxml.AnythingToXML").init();
11 |
12 | return super.onApplicationStart();
13 | }
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_jsonutil/resources/JsonUtilRepresentation.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_img/resources/pdf.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Mew mew mew mew
7 | 
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/coldspring_aop/endpoints/SamplesCaching.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | local.resourceData = StructNew();
6 | local.resourceData["foo"] = "bar";
7 | sleep(5000);
8 | return representationOf(local.resourceData).withStatus(200);
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_jsonutil/resources/artCollection.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_anythingtoxml/resources/artCollection.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/snippets/Taffy/Representation-script.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Representation-script
4 | Creates a Taffy Custom Representation CFC using cfscript syntax
5 |
9 |
18 |
--------------------------------------------------------------------------------
/model/TodoItem.cfc:
--------------------------------------------------------------------------------
1 | component norm_persistent="true" table="TodoItem" extends="com.database.Norm" accessors="true" {
2 |
3 | property name="ID" type="numeric" fieldtype="id" generator="increment";
4 | property name="description" type="string" length="30";
5 | property name="isDone" type="boolean";
6 | property name="isArchived" type="boolean";
7 | property name="createdAt" type="date";
8 |
9 | /* Relationships */
10 | //property name="userID" type="numeric";
11 | //property name="user" inverseJoinColumn="ID" cascade="save-update" fieldType="one-to-one" fkcolumn="userID" cfc="model.User";
12 |
13 | }
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/snippets/Taffy/Representation-tag.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Representation-tag
4 | Creates a Taffy Custom Representation CFC using cfml tags
5 |
6 |
7 |
13 |
14 |
15 |
16 | ]]>
17 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/resources/acceptFileUpload.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/tests/Company.cfc:
--------------------------------------------------------------------------------
1 | component norm_persistent="true" accessors="true" table="companies" extends="com.database.Norm" {
2 |
3 | public function init( ){
4 | super.init();
5 | }
6 |
7 | public any function load( id ){
8 |
9 | // Now load the entity, passing any args that we were given
10 | super.load( argumentCollection = arguments );
11 |
12 | // Now that the entity is loaded, we can identify any many-to-one relationships with the hasMany function
13 | this.hasMany( table = "call_notes", fkColumn = "companies_ID", property = "CallNotes" );
14 |
15 |
16 | return this;
17 | }
18 | }
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/bonus/LogToScreen.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_img/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | this.name = hash(getCurrentTemplatePath());
5 |
6 | variables.framework = {};
7 | variables.framework.debugKey = "debug";
8 | variables.framework.reloadKey = "reload";
9 | variables.framework.reloadPassword = "true";
10 | variables.framework.representationClass = "taffy.core.nativeJsonRepresentation";
11 |
12 | function onApplicationStart(){
13 | application.lastReset = now();
14 |
15 | return super.onApplicationStart();
16 | }
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/consumer/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | //this application is entirely separate from the api;
5 | //essentially, it might as well be running on another server.
6 | this.name = hash(getCurrentTemplatePath());
7 |
8 | function onApplicationStart(){
9 | application.wsLoc = "http://#cgi.server_name#:#cgi.server_port#/taffy/examples/api/index.cfm";
10 | }
11 |
12 | function onRequestStart(){
13 | if (structKeyExists(url, "reload") && url.reload == true){
14 | onApplicationStart();
15 | }
16 | }
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_twoFormats/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | this.name = hash(getCurrentTemplatePath());
5 |
6 | variables.framework = {};
7 | variables.framework.representationClass = "resources.CustomRepresentationClass";
8 |
9 | function onApplicationStart(){
10 | application.JsonUtil = createObject("component", "resources.JSONUtil.JSONUtil");
11 | application.AnythingToXML = createObject("component", "resources.AnythingToXML.AnythingToXML");
12 |
13 | return super.onApplicationStart();
14 | }
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/tests/CompanyArray.cfc:
--------------------------------------------------------------------------------
1 | component norm_persistent="true" accessors="true" table="companies" extends="com.database.Norm" {
2 |
3 | public function init( ){
4 | super.init();
5 | }
6 |
7 | public any function load( id ){
8 |
9 | // Now load the entity, passing any args that we were given
10 | super.load( argumentCollection = arguments );
11 |
12 | // Now that the entity is loaded, we can identify any many-to-one relationships with the hasMany function
13 | this.hasMany( table = "call_notes", fkColumn = "companies_ID", property = "CallNotes", returnType = "array" );
14 |
15 |
16 | return this;
17 | }
18 | }
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_uploadImg/resources/imageCollection.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_twoFormats/resources/CustomRepresentationClass.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/ParentApplication/model/fooCollection.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_requireApiKey/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | this.name = hash(getCurrentTemplatePath());
5 |
6 | // this function is called after the request has been parsed and all request details are known
7 | function onTaffyRequest(verb, cfc, requestArguments, mimeExt){
8 |
9 | if(not structKeyExists(arguments.requestArguments, "apiKey")){
10 | //unauthorized because they haven't included their API key
11 | return newRepresentation().noData().withStatus(401);
12 | }
13 |
14 | //api key found
15 | return true;
16 | }
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_twoFactories/resources/artfartCollection.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_coldspring/stuff/artfartCollection.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/tests/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/breezejs/model/TodoItem.cfc:
--------------------------------------------------------------------------------
1 | component norm_persistent="true" table="TodoItem" extends="com.database.Norm" accessors="true" {
2 |
3 | property name="_id" type="string" fieldtype="id" generator="uuid";
4 | property name="ID" type="numeric" fieldtype="id" generator="increment";
5 | property name="description" type="string" length="30";
6 | property name="isDone" type="boolean";
7 | property name="isArchived" type="boolean";
8 | property name="createdAt" type="date";
9 |
10 | /* Relationships */
11 | //property name="userID" type="numeric";
12 | //property name="user" inverseJoinColumn="ID" cascade="save-update" fieldType="one-to-one" fkcolumn="userID" cfc="model.User";
13 |
14 | }
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/tests/list.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | testsDir = expandPath('/Taffy/tests/tests');
4 | componentPath = 'Taffy.tests.tests';
5 |
6 | suite = createObject('mxunit.framework.TestSuite');
7 | files = createObject('mxunit.runner.DirectoryTestSuite').getTests(directory=testsDir, componentPath=componentPath);
8 |
9 | for (i = 1; i <= arrayLen(files); i++){
10 | suite.addAll(files[i]);
11 | }
12 |
13 | tests = suite.suites();
14 |
15 | for (t in tests){
16 | tests[t] = tests[t].methods;
17 | }
18 |
19 | #serializeJson(tests)#
20 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/snippets/Taffy/Resource-script.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Resource-script
4 | Creates a Taffy Resource CFC using cfscript syntax
5 |
6 |
26 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/bonus/LogToHoth.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_img/resources/random.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/snippets/Taffy/Resource-tag.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Resource-tag
4 | Creates a Taffy Resource CFC using cfml tags
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | ]]>
21 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_LogToEmail/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | this.name = hash(getCurrentTemplatePath());
5 |
6 | variables.framework = {};
7 |
8 | variables.framework.exceptionLogAdapter = "taffy.bonus.LogToEmail";
9 |
10 | variables.framework.exceptionLogAdapterConfig = StructNew();
11 | variables.framework.exceptionLogAdapterConfig.emailFrom = "api-error@yourdomain.com";
12 | variables.framework.exceptionLogAdapterConfig.emailTo = "you@yourdomain.com";
13 | variables.framework.exceptionLogAdapterConfig.emailSubj = "Exception Trapped in API";
14 | variables.framework.exceptionLogAdapterConfig.emailType = "html";
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/model/User.cfc:
--------------------------------------------------------------------------------
1 | component norm_persistent="true" table="users" singularName="User" extends="com.database.Norm" accessors="true" {
2 |
3 | property name="ID" type="numeric" fieldtype="id" generator="increment";
4 | property name="_id" fieldtype="id" generator="uuid" type="string" length="45";
5 | property name="firstName" type="string" column="first_name";
6 | property name="lastName" type="string" column="last_name";
7 | property name="email" type="string";
8 | property name="createdDate" type="date" column="created_datetime";
9 | property name="modifiedDate" type="date" column="modified_datetime" formula="now()";
10 |
11 |
12 | public string function getFullName(){
13 | return variables.firstName & " " & variables.lastName;
14 | }
15 | }
--------------------------------------------------------------------------------
/tests/runner.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api/resources/foo/artCollection.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_configVar/resources/artCollection.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_BugLogHQ/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | this.name = hash(getCurrentTemplatePath());
5 |
6 | variables.framework = {};
7 |
8 | variables.framework.exceptionLogAdapter = "taffy.bonus.LogToBugLogHQ";
9 |
10 | variables.framework.exceptionLogAdapterConfig = StructNew();
11 | variables.framework.exceptionLogAdapterConfig.bugLogListener = "bugLog.listeners.bugLogListenerWS";
12 | variables.framework.exceptionLogAdapterConfig.bugEmailRecipients = "you@yourdomain.com";
13 | variables.framework.exceptionLogAdapterConfig.bugEmailSender = "errors@yourdomain.com";
14 | variables.framework.exceptionLogAdapterConfig.hostname = "Taffy_DEV_Examples";
15 | variables.framework.exceptionLogAdapterConfig.apikey = "";
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_twoFormats/resources/artCollection.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/resources/EchoRegexMember.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/ParentApplication/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | this.name = "taffy_ParentAppExample";//same name as parent folder application.cfc
5 | this.applicationTimeout = createTimeSpan(0,2,0,0);
6 | this.sessionManagement = false;
7 | this.setClientCookies = false;
8 | this.scriptProtect = false;
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/model/Pet.cfc:
--------------------------------------------------------------------------------
1 | component norm_persistent="true" table="pets" extends="com.database.Norm" accessors="true" {
2 |
3 | property name="ID" type="numeric" fieldtype="id" generator="increment";
4 | property name="_id" fieldtype="id" generator="uuid" type="string" length="45";
5 | property name="userID" type="string";
6 | property name="firstName" type="string" column="first_name";
7 | property name="lastName" type="string" column="last_name";
8 | property name="createdDate" type="date" column="created_datetime";
9 | property name="modifiedDate" type="date" column="modified_datetime" formula="now()";
10 |
11 | /* Relationships */
12 | property name="user" inverseJoinColumn="ID" cascade="save-update" fieldType="one-to-one" fkcolumn="userID" cfc="model.User";
13 |
14 | public string function getFullName(){
15 | return variables.firstName & " " & variables.lastName;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/testNormWithEntityDefinitions.cfc:
--------------------------------------------------------------------------------
1 | component displayName="My test suite" extends="testbox.system.BaseSpec"{
2 |
3 | // executes before all tests
4 | function beforeTests(){
5 | request.dao = new com.database.dao( dsn = "dao" );
6 |
7 | }
8 |
9 |
10 | function loadExistingEntityWithChildrenToStruct() test{
11 | var testEntity = new model.Pet( dao = request.dao );
12 |
13 | // change event to 'test'
14 | testEntity.load(93);
15 | var testStruct = testEntity.toStruct( top = 2);
16 | $assert.typeOf( "struct", testStruct );
17 | $assert.isTrue( structKeyExists( testStruct, 'user' ) );
18 | $assert.typeOf( "struct", testStruct.user );
19 |
20 | }
21 | // executes after all tests
22 | function afterTests(){
23 |
24 | //structClear( application );
25 |
26 | }
27 |
28 | }
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api/resources/artMember.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_configVar/resources/artMember.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_jsonutil/resources/artMember.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_anythingtoxml/resources/artMember.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_twoFormats/resources/artMember.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_coldspring/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | this.name = hash(getCurrentTemplatePath());
5 |
6 | variables.framework = {};
7 | variables.framework.debugKey = "debug";
8 | variables.framework.reloadKey = "reload";
9 | variables.framework.reloadPassword = "true";
10 | variables.framework.representationClass = "taffy.core.nativeJsonRepresentation";
11 |
12 | function onApplicationStart(){
13 | application.beanFactory = createObject("component", "coldspring.beans.DefaultXMLBeanFactory");
14 | application.beanFactory.loadBeans('/taffy/examples/api_coldspring/config/coldspring.xml');
15 |
16 | //note that we're modifying variables.framework here, after the application variable has been set
17 | variables.framework.beanFactory = application.beanFactory;
18 |
19 | return super.onApplicationStart();
20 | }
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/coldspring_aop/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | this.name = hash(getCurrentTemplatePath());
5 | this.applicationTimeout = createTimeSpan(0,0,0,1);
6 | this.mappings = structNew();
7 | //this.mappings["/coldspring"] = ExpandPath("{your-path-here}");
8 |
9 | variables.framework = {};
10 | variables.framework.debugKey = "debug";
11 | variables.framework.reloadKey = "reload";
12 | variables.framework.reloadPassword = "true";
13 | variables.framework.representationClass = "taffy.core.genericRepresentation";
14 |
15 | function onApplicationStart(){
16 | initColdSpring();
17 |
18 | return super.onApplicationStart();
19 | }
20 |
21 | function initColdSpring() {
22 | application.oBeanFactory = CreateObject("component","coldspring.beans.DefaultXmlBeanFactory").init();
23 | application.oBeanFactory.loadBeansFromXMLFile("/config/coldspring.xml");
24 | }
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/bonus/LogToBugLogHQ.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | this.name = hash(getCurrentTemplatePath());
5 |
6 | variables.framework = {};
7 | variables.framework.debugKey = "debug";
8 | variables.framework.reloadKey = "reload";
9 | variables.framework.reloadPassword = "true";
10 | variables.framework.representationClass = "taffy.core.genericRepresentation";
11 | variables.framework.returnExceptionsAsJson = true;
12 |
13 | function onApplicationStart(){
14 | return super.onApplicationStart();
15 | }
16 |
17 | function onRequestStart(){
18 | return super.onRequestStart();
19 | }
20 |
21 | // this function is called after the request has been parsed and all request details are known
22 | function onTaffyRequest(verb, cfc, requestArguments, mimeExt){
23 | // this would be a good place for you to check API key validity and other non-resource-specific validation
24 | return true;
25 | }
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/resources/EchoMethodTunnelMember.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/resources/EchoMember.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/model/EventLog.cfc:
--------------------------------------------------------------------------------
1 | component norm_persistent="true" table="eventLog" extends="com.database.Norm" accessors="true" {
2 | property name="ID" type="numeric" fieldtype="id" generator="increment";
3 | property name="userID" type="string";
4 |
5 | property name="event" type="string";
6 | property name="description" type="string";
7 | property name="eventDate" type="date";
8 | /* Relationships */
9 | property name="user" inverseJoinColumn="ID" cascade="save-update" fieldType="one-to-one" fkcolumn="userID" cfc="model.User";
10 |
11 | function preLoad(){
12 | writeLog('preLoad');
13 | }
14 | function postLoad(){
15 | writeLog('postLoad');
16 | }
17 | function preInsert(){
18 | writeLog('preInsert');
19 | }
20 | function postInsert(){
21 | writeLog('postInsert');
22 | }
23 | function preUpdate( struct oldData ){
24 | writeLog('preUpdate: ' & serializeJSON( oldData.toStruct() ) );
25 | }
26 | function postUpdate(){
27 | writeLog('postUpdate');
28 | }
29 | function preDelete(){
30 | writeLog('preDelete');
31 | }
32 | function postDelete(){
33 | writeLog('postDelete');
34 | }
35 |
36 | }
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/tests/TestRepresentations.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 | function setup(){
4 | variables.representation = createObject("component", "taffy.core.baseRepresentation");
5 | }
6 |
7 | function test_setData_getData(){
8 | variables.representation.setData(10);
9 | assertEquals(10, variables.representation.getData());
10 | }
11 |
12 | function noData_returns_empty_rep_obj(){
13 | local.result = variables.representation.noData();
14 | local.meta = getMetaData(local.result);
15 | debug(local.meta);
16 | debug(local.result.getData());
17 | assertEquals('taffy.core.baseRepresentation', local.meta.fullname);
18 | assertEquals("", local.result.getData());
19 | }
20 |
21 | function test_withStatus_getStatus(){
22 | variables.representation.withStatus(42);
23 | assertEquals(42, variables.representation.getStatus());
24 | }
25 |
26 | function test_withHeaders_getHeaders(){
27 | local.h = {};
28 | local.h['x-dude'] = 'dude!';
29 | variables.representation.withHeaders(local.h);
30 | assertEquals(true, structKeyExists(variables.representation.getHeaders(), "x-dude"));
31 | }
32 |
33 |
34 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/coldspring_aop/com/aspects/FormattingAroundAdvice.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | // Run the called method
13 | local.methodReturnData = arguments.methodInvocation.proceed();
14 |
15 | // Put the return data into a parent structre.
16 | if (IsDefined("local.methodReturnData")) {
17 |
18 | local.stReturnDataStructure = StructNew();
19 | local.stReturnDataStructure["request_timestamp"] = Now();
20 | local.stReturnDataStructure["data"] = local.methodReturnData;
21 |
22 | return this.taffyResourceObject.representationOf(local.stReturnDataStructure).withStatus(200);
23 |
24 | }
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/dashboard/asset.cfm:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_twoFactories/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 | this.name = hash(getCurrentTemplatePath());
4 |
5 | variables.framework = {};
6 | variables.framework.reloadKey = "reload";
7 |
8 | /*
9 | You should NOT create your bean factory instance out here because that would cause it to be
10 | re-created for every request, which is not going to be efficient at all!
11 |
12 | Because of the Taffy Request Lifecycle, onApplicationStart is called BEFORE inspecting
13 | your framework default settings, so you can optionally set the bean factory into
14 | variables.framework from inside onApplicationStart.
15 |
16 | Note that this does not stop you from setting values above; as I've set the value for
17 | reloadKey. You can mix implementations like this; but anything that will have a significant
18 | load time should be done in onApplicationStart.
19 | */
20 |
21 | function onApplicationStart(){
22 | application.coldspring = createObject("component", "coldspring.beans.DefaultXMLBeanFactory");
23 | application.coldspring.loadBeans('config/coldspring.xml');
24 |
25 | variables.framework.beanFactory = application.beanFactory;
26 |
27 | return super.onApplicationStart();
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/examples/breezejs/assets/css/reset.css:
--------------------------------------------------------------------------------
1 | /** * Eric Meyer's Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/) * http://cssreset.com */
2 | html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p,
3 | blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em,
4 | img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i,
5 | center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption,
6 | tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure,
7 | figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time,
8 | mark, audio, video {
9 | margin: 0;
10 | padding: 0;
11 | border: 0;
12 | font-size: 100%;
13 | font: inherit;
14 | vertical-align: baseline;
15 | }
16 |
17 | /* HTML5 display-role reset for older browsers */
18 | article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
19 | display: block;
20 | }
21 |
22 | body {
23 | line-height: 1;
24 | }
25 |
26 | ol, ul {
27 | list-style: none;
28 | }
29 |
30 | blockquote, q {
31 | quotes: none;
32 | }
33 |
34 | blockquote:before, blockquote:after, q:before, q:after {
35 | content: '';
36 | content: none;
37 | }
38 |
39 | table
40 | {
41 | border-collapse: collapse;
42 | border-spacing: 0;
43 | }
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/tests/TestLoggers.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | function test_hoth(){
5 | var mockHoth = mock();
6 | var hothAdapter = '';
7 | var fakeError = {};
8 |
9 | //setup the behaviors we're expecting the adapter to run
10 | mockHoth.track('{struct}');
11 |
12 | //create hoth adapter to test
13 | hothAdapter = createObject("component", "taffy.bonus.LogToHoth").init(
14 | "taffy.examples.api_hoth.resources.HothConfig",
15 | mockHoth
16 | );
17 |
18 | //fake error
19 | fakeError.message = "This is a test error";
20 | fakeError.detail = "Rubber Baby Buggy Bumper";
21 | hothAdapter.saveLog(fakeError);
22 |
23 | mockHoth.verify().track('{struct}');
24 | }
25 |
26 | function test_BugLogHQ(){
27 | var mockBLHQ = mock();
28 | var blhqAdapter = '';
29 | var blhqSettings = {};
30 | var fakeError = {};
31 |
32 | mockBLHQ.notifyService('{string}', '{struct}');
33 |
34 | blhqAdapter = createObject("component", "taffy.bonus.LogToBugLogHQ").init(
35 | blhqSettings,
36 | mockBLHQ
37 | );
38 |
39 | //fake error
40 | fakeError.message = "This is a test error";
41 | fakeError.detail = "Rubber Baby Buggy Bumper";
42 | blhqAdapter.saveLog(fakeError);
43 |
44 | mockBLHQ.verify().notifyService('{string}', '{struct}');
45 | }
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/LICENSE.TXT:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 | Copyright (c) 2011 Adam Tuttle and Contributors
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5 |
6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7 |
8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9 |
10 |
11 | What does that mean?
12 |
13 | It means you can use Taffy pretty much any way you like. You can fork it. You can include it in a proprietary product, sell it, and not give us a dime. Pretty much the only thing you can't do is hold us accountable if anything goes wrong.
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/bonus/LogToEmail.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
19 |
24 |
25 | Exception Report
26 |
27 | Exception Timestamp: #dateformat(now(), 'yyyy-mm-dd')# #timeformat(now(), 'HH:MM:SS tt')#
28 |
29 |
30 |
31 | Exception Report
32 | Exception Timestamp: #dateformat(now(), 'yyyy-mm-dd')# #timeformat(now(), 'HH:MM:SS tt')#
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/snippets/Taffy/Application cfc-script.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Application cfc-script
4 | Creates an Application.cfc skeleton for a Taffy API using cfscript syntax
5 |
9 |
49 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_configVar/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | this.name = hash(getCurrentTemplatePath());
5 |
6 | // In the interest of compatibility, we'll write this out long-form so it works on CF8
7 | variables.framework = structNew();
8 | variables.framework.debugKey = "debug";
9 | variables.framework.reloadKey = "reload";
10 | variables.framework.reloadPassword = "true";
11 | variables.framework.representationClass = "taffy.core.nativeJsonRepresentation";
12 | variables.framework.dashboardKey = "dashboard";
13 | variables.framework.disableDashboard = false;
14 | variables.framework.unhandledPaths = "/flex2gateway";
15 | variables.framework.allowCrossDomain = false;
16 | variables.framework.globalHeaders = structNew();
17 | variables.framework.globalHeaders["X-MY-HEADER"] = "my header value";
18 | //variables.framework.beanFactory = "";
19 |
20 |
21 | /* If you have CF9+, the above could be written as:
22 |
23 | variables.framework {
24 | debugKey = "debug",
25 | reloadKey = "reload",
26 | reloadPassword = "true",
27 | representationClass = "taffy.core.nativeJsonRepresentation",
28 | dashboardKey = "dashboard",
29 | disableDashboard = false,
30 | unhandledPaths = "/flex2gateway",
31 | allowCrossDomain = false,
32 | globalHeaders = {
33 | "X-MY-HEADER" = "my header value"
34 | }
35 | }
36 | */
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/examples/breezejs/scripts/app/main.js:
--------------------------------------------------------------------------------
1 | /* main: startup script creates the 'todo' module and its Angular directives */
2 |
3 | // 'todo' is the one Angular (Ng) module in this app
4 | var todo = angular.module('todo', []);
5 |
6 | // Add global "services" (like breeze) to the Ng injector
7 | // Learn about Angular dependency injection in this video
8 | // http://www.youtube.com/watch?feature=player_embedded&v=1CpiB3Wk25U#t=2253s
9 | todo.value('breeze', window.breeze);
10 | todo.value('toastr', window.toastr);
11 |
12 | // Add Ng directives
13 | todo.directive('onFocus', function () {
14 | return {
15 | restrict: 'A',
16 | link: function (scope, elm, attrs) {
17 | elm.bind('focus', function () {
18 | scope.$apply(attrs.onFocus);
19 | });
20 | }
21 | };
22 | })
23 | .directive('onBlur', function () {
24 | return {
25 | restrict: 'A',
26 | link: function (scope, elm, attrs) {
27 | elm.bind('blur', function () {
28 | scope.$apply(attrs.onBlur);
29 | });
30 | }
31 | };
32 | })
33 | .directive('focusWhen', function () {
34 | return function (scope, elm, attrs) {
35 | scope.$watch(attrs.focusWhen, function (newVal) {
36 | if (newVal) {
37 | setTimeout(function () {
38 | elm.focus();
39 | }, 10);
40 | }
41 | });
42 | };
43 | });
44 |
--------------------------------------------------------------------------------
/examples/breezejs/scripts/app/logger.js:
--------------------------------------------------------------------------------
1 | /* logger: display color-coded messages in "toasts" and to console */
2 |
3 | // create and add logger service to the Ng injector
4 | todo.factory('logger', function (toastr, $window) {
5 |
6 | // This logger wraps the toastr logger and also logs to console
7 | // toastr.js is library by John Papa that shows messages in pop up toast.
8 | // https://github.com/CodeSeven/toastr
9 |
10 | toastr.options.timeOut = 2000; // 2 second toast timeout
11 | toastr.options.positionClass = 'toast-bottom-right';
12 |
13 | var logger = {
14 | error: error,
15 | info: info,
16 | success: success,
17 | warning: warning,
18 | log: log // straight to console; bypass toast
19 | };
20 |
21 | function error(message, title) {
22 | toastr.error(message, title);
23 | log("Error: " + message);
24 | };
25 | function info(message, title) {
26 | toastr.info(message, title);
27 | log("Info: " + message);
28 | };
29 | function success(message, title) {
30 | toastr.success(message, title);
31 | log("Success: " + message);
32 | };
33 | function warning(message, title) {
34 | toastr.warning(message, title);
35 | log("Warning: " + message);
36 | };
37 |
38 | // IE and google chrome workaround
39 | // http://code.google.com/p/chromium/issues/detail?id=48662
40 | function log() {
41 | var console = $window.console;
42 | !!console && console.log && console.log.apply && console.log.apply(console, arguments);
43 | }
44 |
45 | return logger;
46 | });
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/snippets/Taffy/Application cfc-tag.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Application cfc-tag
4 | Creates an Application.cfc skeleton for a Taffy API using cfml tags
5 |
6 |
7 |
9 |
10 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | ]]>
51 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 | this.name = "Taffy_testSuite";
4 |
5 | variables.framework = {};
6 | variables.framework.disableDashboard = false;
7 | variables.framework.reloadKey = "reload";
8 | variables.framework.unhandledPaths = "/Taffy/tests/someFolder,/Taffy/tests/tests,/tests/someFolder,/tests/tests";
9 | variables.framework.representationClass = "customJsonRepresentation";
10 | variables.framework.useEtags = true;
11 | variables.framework.globalHeaders = {};
12 | variables.framework.globalHeaders["x-foo-globalheader"] = "snafu";
13 |
14 | variables.framework.environments = {};
15 | variables.framework.environments.test = {};
16 | variables.framework.environments.test.reloadPassword = 'dontpanic';
17 |
18 | function getEnvironment(){
19 | return "test";
20 | }
21 |
22 | function onTaffyRequest(verb, cfc, requestArguments, mimeExt, headers) {
23 | var local = {};
24 |
25 | //pass data into a resource by modifying requestArguments
26 | if (structKeyExists(arguments.requestArguments, "hulk") and arguments.requestArguments.hulk eq "smash"){
27 | arguments.requestArguments.dataFromOTR = "who let the hulk out?!";
28 | }
29 |
30 | //get basic auth data, if any, and pass it into the resources
31 | local.credentials = getBasicAuthCredentials();
32 | arguments.requestArguments.username = local.credentials.username;
33 | arguments.requestArguments.password = local.credentials.password;
34 |
35 | if (structKeyExists(arguments.requestArguments, "refuse") and arguments.requestArguments.refuse)
36 | {
37 | return newRepresentation().withStatus(405);
38 | }
39 | else
40 | {
41 | return true;
42 | }
43 | }
44 |
45 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/coldspring_aop/config/coldspring.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | *
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | cachingAdvisor
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | *
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | formattingAdvisor
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_img/resources/randomScaled.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_Hoth/resources/HothConfig.cfc:
--------------------------------------------------------------------------------
1 | component
2 | implements = 'Hoth.object.iHothConfig'
3 | extends = 'Hoth.object.CoreConfig'
4 | accessors = 'true'
5 | {
6 |
7 | /** What is the name of your application? */
8 | property
9 | name='applicationName'
10 | default='Taffy Tests';
11 |
12 | /** How many seconds should we lock file operations?
13 | For most operations this is exclusive to a unique exception. */
14 | property
15 | name='timeToLock'
16 | default='4';
17 |
18 | /** Where would you like Hoth to save exception data?
19 | This folder should be empty. */
20 | property
21 | name='logPath'
22 | default='/taffy/examples/api_hoth/hoth/exceptions';
23 |
24 | // ------------------------------------------------------------------------------
25 | /** Would you like new exceptions to be emailed to you? */
26 | property
27 | name='EmailNewExceptions'
28 | default='true';
29 |
30 | /** What address(es) should receive these e-mails? */
31 | property
32 | name='EmailNewExceptionsTo'
33 | default='you@yourdomain.com';
34 |
35 | /** What address would you like these emails sent from? */
36 | property
37 | name='EmailNewExceptionsFrom'
38 | default='hoth-error-report@yourdomain.com';
39 |
40 | /** Would you like the raw JSON attached to the e-mail? */
41 | property
42 | name='EmailNewExceptionsFile'
43 | default='true';
44 | // ------------------------------------------------------------------------------
45 |
46 | /**
47 | The mapping where you would like Hoth to write it's log files.
48 | Without this setting, Hoth will write log files to the same directory
49 | Hoth is located within. This is not recomended as your will have content
50 | mixed into your Hoth code.
51 | **/
52 | setGlobalDatabasePath(path='/taffy/examples/api_hoth/hoth/logs/');
53 |
54 | //make the log path be evaluated as relative
55 | variables.logPathIsRelative = true;
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/tests/TestResource.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | function beforeTests(){
5 | variables.taffy = createObject("component","taffy.tests.Application");
6 | variables.resource = createObject("component", "taffy.core.resource");
7 | }
8 |
9 | function representationOf_returns_repClass(){
10 | application._taffy.settings.representationClass = "taffy.core.nativeJsonRepresentation";
11 | makePublic(variables.resource, "representationOf");
12 | local.result = variables.resource.representationOf(10);
13 | local.meta = getMetadata(local.result);
14 | debug(local.meta);
15 | assertEquals(true, eventuallyInherits(local.meta, 'taffy.core.baseRepresentation'));
16 | }
17 |
18 | function queryToArray_respects_column_case(){
19 | makePublic(variables.resource, "queryToArray");
20 | local.before = QueryNew("Foo,Bar");
21 | queryAddRow(local.before);
22 | querySetCell(local.before, "Foo", 42, 1);
23 | querySetCell(local.before, "Bar", "fubar", 1);
24 | debug(local.before);
25 | local.after = variables.resource.queryToArray(local.before);
26 | debug(local.after);
27 | local.keyList = structKeyList(local.after[1]);
28 | local.serialized = serializeJSON(local.after);
29 | debug(local.serialized);
30 |
31 | assertTrue( (local.keyList == "Foo,Bar" or local.keyList == "Bar,Foo"), 'column name case is not as expected');
32 | assertTrue( (local.serialized == '[{"Foo":42,"Bar":"fubar"}]') or (local.serialized == '[{"Bar":"fubar","Foo":42}]') );
33 | }
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 | if (structKeyExists(md, "fullname") && md.fullname eq class) {
44 | return true;
45 | } else {
46 | if (structKeyExists(md, "extends"))
47 | {
48 | return eventuallyInherits(md.extends, class);
49 | } else {
50 | return false;
51 | }
52 | }
53 |
54 |
55 |
--------------------------------------------------------------------------------
/box.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Dao",
3 | "version": "1.0.3",
4 | "author": "Abram Adams",
5 | "location": "abramadams/dao#v1.0.3",
6 | "createPackageDirectory": true,
7 | "packageDirectory": "database",
8 | "homepage": "http://abramadams.github.io/dao/",
9 | "documentation": "https://github.com/abramadams/dao/wiki",
10 | "repository": {
11 | "type": "git",
12 | "URL": "https://github.com/abramadams/dao.git"
13 | },
14 | "bugs": "",
15 | "slug": "dao",
16 | "shortDescription": "A ColdFusion library for easy Data Access, CRUD, ORM like functionality and LINQ style query building.",
17 | "description": "Dao/Norm is a duo of libraries that provide a simple yet full featured interface to perform script based queries as well as adds extended functionality such as ORM (with easy and dynamic relationships), oData (Consume/Produce), LINQ style queries and more. Basically it is the data interaction ColdFusion/Railo/Lucee should have come with out of the box. In short, the goal of this library is to allow one to interact with the database in a DB platform agnostic way, while making it super easy.",
18 | "instructions": "",
19 | "changelog": "",
20 | "type": "projects",
21 | "keywords": [
22 | "database",
23 | "orm",
24 | "linq",
25 | "odata",
26 | "sql",
27 | "dao"
28 | ],
29 | "private": false,
30 | "projectURL": "https://github.com/abramadams/dao",
31 | "License": [{
32 | "type": "Apache 2.0",
33 | "URL": "http://www.apache.org/licenses/LICENSE-2.0"
34 | }],
35 | "contributors": [],
36 | "dependencies": {},
37 | "devDependencies": {
38 | "testbox": "@latest"
39 | },
40 | "installPaths": {
41 | "testbox": "testbox"
42 | },
43 | "scripts": {
44 | "test": "box testbox run verbose=false"
45 | },
46 | "ignore": [
47 | "**/.*",
48 | "test",
49 | "tests",
50 | "daotest.cfm",
51 | "entitytest.cfm",
52 | ".project",
53 | "testbox",
54 | "examples",
55 | "model"
56 | ],
57 | "testbox": {
58 | "runner": "http://localhost:8500/tests/runner.cfm"
59 | }
60 | }
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/dashboard/dash.less:
--------------------------------------------------------------------------------
1 | @import 'bootstrap.min.less';
2 |
3 | body {
4 | padding-bottom: 30px;
5 | }
6 |
7 | .ver {
8 | font-size: 0.9em;
9 | font-weight: bold;
10 | display: inline-block;
11 | position: relative;
12 | top: -16px;
13 | left: 187px;
14 | }
15 |
16 | .masthead {
17 | button {
18 | float: right;
19 | margin-left: 10px;
20 | }
21 | }
22 |
23 | .stackTrace {
24 | display: none;
25 | }
26 |
27 | .alert {
28 | code {
29 | white-space: normal;
30 | }
31 | }
32 |
33 | .modal {
34 | .label {
35 | float: right;
36 | }
37 | .col-sm-6 {
38 | margin-top: 10px;
39 | }
40 | dl {
41 | margin: 0;
42 | }
43 | ul {
44 | padding: 0 0 0 15px;
45 | }
46 | }
47 |
48 | #resources {
49 | margin-top: -20px;
50 |
51 | .accordion-toggle {
52 | display: block;
53 | margin: -10px -15px;
54 | padding: 10px 15px;
55 |
56 | &:hover {
57 | text-decoration: none;
58 | background: #DDD;
59 | }
60 |
61 | }
62 | .resource {
63 | h4 {
64 | span {
65 | font-size: 0.6em;
66 | }
67 | }
68 | }
69 | .verb {
70 | float: right;
71 | margin-left: 5px;
72 | padding-top: 4px;
73 | margin-top: -18px;
74 |
75 | &.label-default {
76 | background-color: #ccc;
77 | }
78 | }
79 | .submitRequest {
80 | float: right;
81 | margin-left: 10px;
82 | }
83 | .resetRequest {
84 | display: none;
85 | float: right;
86 | }
87 | .micro {
88 | padding: 5px 0;
89 | width: 10px;
90 | text-align: center;
91 | }
92 | .reqBody {
93 | display: none;
94 | }
95 | .doc {
96 | color: #9E9E9E;
97 | }
98 | .progress {
99 | display: none;
100 | margin-top: 10px;
101 | }
102 | .response {
103 | display: none;
104 | }
105 | .responseTime {
106 | float: right;
107 | font-size: .8em;
108 | margin-top: 5px;
109 | margin-bottom: -2px;
110 | }
111 | .responseBody {
112 | white-space: nowrap;
113 | }
114 | pre {
115 | overflow-x: scroll;
116 | width: 100%;
117 | }
118 | .headerName {
119 | font-weight: bold;
120 | text-align: right;
121 | }
122 | .headerName
123 | ,.headerVal {
124 | font-size: 0.8em;
125 | line-height: 1.6em;
126 | }
127 |
128 | select {
129 | width: 85px;
130 | display: inline-block;
131 | }
132 |
133 | textarea {
134 | font-family: monospace;
135 | font-size: 0.9em;
136 | }
137 |
138 | }
139 |
140 | .response {
141 | display: none;
142 |
143 | label {
144 | display: block;
145 | text-align: right;
146 | }
147 | }
148 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_anythingtoxml/anythingtoxml/TabUtils.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | #chr(10)#
47 |
48 | #chr(09)#
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_twoFormats/resources/AnythingToXML/TabUtils.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | #chr(10)#
47 |
48 | #chr(09)#
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/tests/base.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/examples/breezejs/api/resources/todosCollection.cfc:
--------------------------------------------------------------------------------
1 | component extends="taffy.core.resource" taffy_uri="breeze/todos/Todos" {
2 |
3 | remote function get(string $filter = "" ,string $orderby = "", string $skip = "", string $top = ""){
4 |
5 | //you could have an entity CFC modeling your table and invoke it such as:
6 | //var todo = new model.TodoItem( dao = dao );
7 | //or just invoke the Norm and point it at a table in the datasource (identified in dao)
8 | var todo = new com.database.Norm( dao = application.dao, table = "TodoItem");
9 |
10 | return representationOf(
11 | //returns a breeze object containing all of the matching entities in our DB
12 | todo.listAsoData(
13 | filter = arguments.$filter,
14 | orderby = arguments.$orderby,
15 | skip = arguments.$skip,
16 | top = arguments.$top,
17 | excludeKeys = [ "_id", "other_field_you_want_to_hide" ]
18 | )
19 | ).withStatus(200);
20 |
21 | }
22 |
23 | remote function post(){
24 | /**********************************************************************
25 | * Initialize Sample Table/Data
26 | * Normally you're data would be real, so you'd use a service for this.
27 | ***********************************************************************/
28 |
29 | // create instance of the TodoItem entity CFC. This will create the table in the database
30 | // if it does not already exist
31 | todoItem = new model.TodoItem( dao = application.dao );
32 | // if there is any data present in the TodoItem table, delete it
33 | application.dao.delete("TodoItem","*");
34 |
35 | // now we'll add in our sample data
36 | todoItem.setDescription('Food');
37 | todoItem.setIsArchived(true);
38 | todoItem.setIsDone(true);
39 | todoItem.setCreatedAt( now() );
40 | todoItem.save();
41 |
42 | todoItem.copy();
43 | todoItem.setDescription('Water');
44 | todoItem.setIsArchived(true);
45 | todoItem.setIsDone(true);
46 | todoItem.save();
47 |
48 | todoItem.copy();
49 | todoItem.setDescription('Shelter');
50 | todoItem.setIsArchived(true);
51 | todoItem.setIsDone(true);
52 | todoItem.save();
53 |
54 | todoItem.copy();
55 | todoItem.setDescription('Bread');
56 | todoItem.setIsArchived(false);
57 | todoItem.setIsDone(false);
58 | todoItem.save();
59 |
60 | todoItem.copy();
61 | todoItem.setDescription('Cheese');
62 | todoItem.setIsArchived(false);
63 | todoItem.setIsDone(true);
64 | todoItem.save();
65 |
66 | todoItem.copy();
67 | todoItem.setDescription('Wine');
68 | todoItem.setIsArchived(false);
69 | todoItem.setIsDone(false);
70 | todoItem.save();
71 |
72 | return representationOf( todoItem.listAsoData( ) ).withStatus(200);
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_rateLimited/Application.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | this.name = "rate_limiting_example";
5 |
6 | function onApplicationStart(){
7 | application.accessLog = queryNew('apiKey,accessTime','varchar,time');
8 | application.accessLimit = 100; //requests
9 | application.accessPeriod = 60; //seconds
10 |
11 | return super.onApplicationStart();
12 | }
13 |
14 | function onTaffyRequest(verb, cfc, requestArguments, mimeExt){
15 | var usage = 0;
16 |
17 | //require some api key
18 | if (!structKeyExists(requestArguments, "apiKey")){
19 | return newRepresentation().noData().withStatus(401, "API Key Required");
20 | }
21 |
22 | //check usage
23 | usage = getAccessRate(requestArguments.apiKey);
24 | if (usage lte application.accessLimit){
25 | logAccess(requestArguments.apiKey);
26 | return true;
27 | }else{
28 | return newRepresentation().noData().withStatus(420, "Enhance your calm");
29 | }
30 |
31 | return true;
32 | }
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | select accessTime
41 | from application.accessLog
42 | where apiKey =
43 | and accessTime >
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | delete
66 | from application.accessLog
67 | where accessTime <
68 |
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/database/railoHacks.cfc:
--------------------------------------------------------------------------------
1 | /************************************************************
2 | *
3 | * Copyright (c) 2007-2015, Abram Adams
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | *
17 | ************************************************************
18 | *
19 | * Component : railoHacks.cfc
20 | * Author : Abram Adams
21 | * Date : 9/10/2015
22 | * @version 0.0.02
23 | * @updated 9/10/2015
24 | * Description : Helper methods to overcome compatibility
25 | * issues between Railo/Lucee and Adobe ColdFusion
26 | ***********************************************************/
27 | component accessors="true" {
28 | property dsn;
29 | public function init( required string dsn ){
30 | setDsn( dsn );
31 | }
32 |
33 | public any function getDBVersion( string datasource = this.getDsn() ){
34 | var d = "";
35 | dbinfo datasource=datasource name="d" type="version";
36 |
37 | return d;
38 | }
39 | public any function getDBName( string datasource = this.getDsn() ){
40 | var tables = "";
41 | dbinfo datasource=datasource name="tables" type="tables";
42 | return tables.table_cat[1];
43 | }
44 | public any function getColumns( required string table, string datasource = this.getDsn() ){
45 | var columns = "";
46 | dbinfo datasource=datasource name="columns" type="columns" table="#table#";
47 | return columns;
48 | }
49 | public any function getTables( string datasource = this.getDsn(), string pattern = "" ){
50 | var tables = "";
51 | dbinfo datasource=datasource name="tables" type="tables" table=pattern pattern=pattern;
52 | // filtering tables by pattern is case sensitive, though the source of pattern could have
53 | // come from extracting metadata from an object, wich does not retain case.
54 | if( !tables.recordCount ){
55 | dbinfo datasource=datasource name="tables" type="tables";
56 | tables = queryExecute(
57 | "SELECT * FROM tables WHERE table_name = :table",
58 | { table: pattern },
59 | { dbtype: 'query' }
60 | );
61 | }
62 |
63 | return tables;
64 | }
65 | public any function getIndex( required string table, string datasource = this.getDsn() ){
66 | var index = "";
67 | dbinfo datasource=datasource name="index" type="index" table="#table#";
68 | return index;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Guidelines for Contributing to Taffy
2 |
3 | Contributions of all shapes and sizes are welcome, encouraged, and greatly appreciated!
4 |
5 | For all contributions, you'll need a [free GitHub account](https://github.com/signup/free).
6 |
7 | ## Bug Reports / Feature Requests
8 |
9 | Please include all of the following information in your ticket:
10 |
11 | * CFML Platform and version (e.g. Adobe ColdFusion 9.0.2, Railo 4.0.2)
12 | * Java version (look it up in CF Administrator, or do `java -version` at the command line)
13 | * Taffy version (for bugs)
14 |
15 | ## Documentation
16 |
17 | Documentation is managed [in its own repository](https://github.com/atuttle/TaffyDocs) and changes are automatically published once they are merged into the master branch.
18 |
19 | There's no such thing as perfect documentation. It can never be thorough enough, never perfectly organized. If you find something confusing or outdated, please at least be so kind as to file a bug report for it, if you can't or won't fix it.
20 |
21 | ## Code
22 |
23 | Starting with the development of Taffy 1.4, all new development will be done against the **master** branch. When you want to make a change and submit it for the Bleeding Edge Release (BER), do the following:
24 |
25 | 1. [Fork the project](https://github.com/atuttle/Taffy/fork_select)
26 | 1. Clone to your local machine: `git clone https://github.com/YOUR-GITHUB-USERNAME/Taffy.git`
27 | 1. Create a topic branch for your changes: `git checkout -b BRANCH_NAME`
28 | 1. Make your changes and commit them.
29 | 1. Push your changes back to your fork. `git push -u origin BRANCH_NAME`
30 | 1. Send a pull request ([help with pull requests](https://help.github.com/articles/using-pull-requests))
31 | * Please make sure you select **master** as the destination branch
32 |
33 | ### Tests
34 |
35 | If at all possible, please include test cases for anything you add or change. Taffy uses [MXUnit](http://www.mxunit.org) (not included) for testing.
36 |
37 | You can run the test suite from the command line with Apache Ant. It's the default target, so just type `ant` from the root of the project directory and it should run them for you. **Note:** Our Jenkins instance uses the Ant script to run the tests, so if you want to run them via Ant you should either setup `jenkins.local` to point to localhost in your hosts file (and virtualhosts), or change the value for `test.server` in the build.xml file.
38 |
39 | You can also run the tests in your browser. Install MXunit to `/mxunit` and Taffy to `/taffy`, and then point your browser to: `http://localhost/taffy/tests` (this will initialize the test api), and then to `http://localhost/taffy/tests/tests/`, which will run the test suite.
40 |
41 | Taffy uses Jenkins for continuous integration, and you can see [build status/history here](http://fusiongrokker.com:8080/job/Taffy/).
42 |
--------------------------------------------------------------------------------
/examples/breezejs/api/Application.cfc:
--------------------------------------------------------------------------------
1 | component extends="taffy.core.api" {
2 | this.name = hash(getCurrentTemplatePath());
3 | this.mappings['/com'] = expandPath( '/' );
4 | this.mappings['/model'] = expandPath( '../model' );
5 | this.mappings['/taffy'] = expandPath( './taffy' );
6 | this.mappings['/resources'] = expandPath( './resources' );
7 |
8 | variables.framework = {
9 | reloadKey = "reload",
10 | reloadPassword = "true",
11 | disableDashboard = false,
12 | disabledDashboardRedirect = "/",
13 | debugKey = "debugonly"
14 | };
15 |
16 | // this function is called after the request has been parsed and all request details are known
17 | function onTaffyRequest(verb, cfc, requestArguments, mimeExt){
18 | // this would be a good place for you to check API key validity and other non-resource-specific validation
19 | return true;
20 | }
21 |
22 | public function onApplicationStart(){
23 | // Create a global instance of the dao component.
24 | application.dao = new com.database.dao( dsn = "dao" );
25 | // Initialize the data
26 | setupData();
27 | super.onApplicationStart();
28 | }
29 |
30 | public function setupData(){
31 | /**********************************************************************
32 | * Initialize Sample Table/Data
33 | * Normally you're data would be real, so you'd use a service for this.
34 | ***********************************************************************/
35 | todoItem = new model.TodoItem( dao = application.dao );
36 | // if there is any data present in the TodoItem table, delete it
37 | application.dao.delete("TodoItem","*");
38 |
39 | // now we'll add in our sample data
40 | todoItem.setDescription('Food');
41 | todoItem.setIsArchived(true);
42 | todoItem.setIsDone(true);
43 | todoItem.setCreatedAt( now() );
44 | todoItem.save();
45 |
46 | todoItem.copy();
47 | todoItem.setDescription('Water');
48 | todoItem.setIsArchived(true);
49 | todoItem.setIsDone(true);
50 | todoItem.save();
51 |
52 | todoItem.copy();
53 | todoItem.setDescription('Shelter');
54 | todoItem.setIsArchived(true);
55 | todoItem.setIsDone(true);
56 | todoItem.save();
57 |
58 | todoItem.copy();
59 | todoItem.setDescription('Bread');
60 | todoItem.setIsArchived(false);
61 | todoItem.setIsDone(false);
62 | todoItem.save();
63 |
64 | todoItem.copy();
65 | todoItem.setDescription('Cheese');
66 | todoItem.setIsArchived(false);
67 | todoItem.setIsDone(true);
68 | todoItem.save();
69 |
70 | todoItem.copy();
71 | todoItem.setDescription('Wine');
72 | todoItem.setIsArchived(false);
73 | todoItem.setIsDone(false);
74 | todoItem.save();
75 |
76 | }
77 |
78 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Dao & Norm
2 | * Dao - A ColdFusion library for easy and db agnostic CRUD interaction and Linq style query building.
3 | * Norm (Not ORM) - A dynamic Object Mapping layer built on top of DAO that provides oData support and ORM style object interactions (load, save, relate entities, etc...).
4 |
5 | ## Elevator Pitch
6 | Dao/Norm is a duo of libraries that provide a simple yet full featured interface to perform script based queries as well as adds extended functionality such as ORM (with easy and dynamic relationships), oData (Consume/Produce), LINQ style queries and more. Basically it is the data interaction ColdFusion/Railo/Lucee should have come with out of the box.
7 |
8 | In short, the goal of this library is to allow one to interact with the database in a DB platform agnostic way, while making it super easy.
9 |
10 | ## Requirements
11 | Currently this library has been actively used and tested on Lucee 4x, 5.x, CF11+
12 |
13 | ## Installation
14 | ### Manual
15 | Clone this repo and copy the "database" folder `(/database)` into your project (or into the folder you place your components)
16 | ### CommandBox
17 | `box install dao`
18 |
19 | ### Examples
20 | #### DAO
21 | ```ActionScript
22 | dao = new database.dao();
23 | dao.update("sometable",form);
24 | ```
25 | ```ActionScript
26 | function getUsers(){
27 | // normally injected or in applicaiton scope
28 | dao = new database.dao();
29 | return dao.read(
30 | sql = "
31 | SELECT fname as firstName, lname as lastName
32 | FROM Users
33 | ",
34 | returnType = "array"
35 | );
36 | }
37 | writeOutput( getUsers() );
38 | ```
39 | Output:
40 | ```JavaScript
41 | [
42 | {"firstName":"Jill","lastName":"Smith"},
43 | {"firstName":"Joe","lastName":"Blow"},
44 | {"firstName":"John","lastName":"Cash"}
45 | ]
46 | ```
47 | #### LINQ
48 | ```ActionScript
49 | dao.from( "eventLog" )
50 | .where( "eventDate", "<", now() )
51 | .andWhere( "eventDate", ">=", dateAdd( 'd', -1, now() ) )
52 | .run();
53 | ```
54 | #### Norm
55 | ```ActionScript
56 | User = new database.Norm("user");
57 | User.loadByFirstName("joe");
58 | User.setStatus("online");
59 | User.save();
60 | ```
61 | ## Resources
62 |
63 | **Documentation and Examples:** [https://github.com/abramadams/dao/wiki](https://github.com/abramadams/dao/wiki)
64 |
65 | **Chat:** The [CFML team Slack](http://cfml-slack.herokuapp.com) - Ask questions in the [#cfml-general channel](https://cfml.slack.com/messages/cfml-general/) and mention @abram.
66 |
67 | ## Contributing
68 | Pull requests welcome! See [installation instructions](https://github.com/abramadams/dao/wiki/02-Extending%5CTesting) for setup and testing.
69 |
70 | ## Copyright and License
71 |
72 | Copyright (c) 2007-2020 Abram Adams. All rights reserved.
73 |
74 | The use and distribution terms for this software are covered by the Apache Software License 2.0 (http://www.apache.org/licenses/LICENSE-2.0) which can also be found in the file LICENSE at the root of this distribution and in individual licensed files.
75 | By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove this notice, or any other, from this software.
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_anythingtoxml/anythingtoxml/XMLutils.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_twoFormats/resources/AnythingToXML/XMLutils.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api/resources/foo/bar/artistCollection.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | select * from artists
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | insert into artists (firstname,lastname,address,city,state,postalcode,email,phone,fax,thepassword)
25 | values (
26 | ,
27 | ,
28 | ,
29 | ,
30 | ,
31 | ,
32 | ,
33 | ,
34 | ,
35 |
36 | )
37 |
38 |
39 | select * from artists
40 | where
41 | firstname =
42 | and lastname =
43 | and address =
44 | and city =
45 | and state =
46 | and postalcode =
47 | and email =
48 | and phone =
49 | and fax =
50 | and thepassword =
51 |
52 |
53 |
54 |
55 |
58 |
59 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_configVar/resources/artistCollection.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | select * from artists
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | insert into artists (firstname,lastname,address,city,state,postalcode,email,phone,fax,thepassword)
25 | values (
26 | ,
27 | ,
28 | ,
29 | ,
30 | ,
31 | ,
32 | ,
33 | ,
34 | ,
35 |
36 | )
37 |
38 |
39 | select * from artists
40 | where
41 | firstname =
42 | and lastname =
43 | and address =
44 | and city =
45 | and state =
46 | and postalcode =
47 | and email =
48 | and phone =
49 | and fax =
50 | and thepassword =
51 |
52 |
53 |
54 |
55 |
58 |
59 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_twoFormats/resources/artistCollection.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | select * from artists
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | insert into artists (firstname,lastname,address,city,state,postalcode,email,phone,fax,thepassword)
25 | values (
26 | ,
27 | ,
28 | ,
29 | ,
30 | ,
31 | ,
32 | ,
33 | ,
34 | ,
35 |
36 | )
37 |
38 |
39 | select * from artists
40 | where
41 | firstname =
42 | and lastname =
43 | and address =
44 | and city =
45 | and state =
46 | and postalcode =
47 | and email =
48 | and phone =
49 | and fax =
50 | and thepassword =
51 |
52 |
53 |
54 |
55 |
58 |
59 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_anythingtoxml/resources/artistCollection.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | select * from artists
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | insert into artists (firstname,lastname,address,city,state,postalcode,email,phone,fax,thepassword)
25 | values (
26 | ,
27 | ,
28 | ,
29 | ,
30 | ,
31 | ,
32 | ,
33 | ,
34 | ,
35 |
36 | )
37 |
38 |
39 | select * from artists
40 | where
41 | firstname =
42 | and lastname =
43 | and address =
44 | and city =
45 | and state =
46 | and postalcode =
47 | and email =
48 | and phone =
49 | and fax =
50 | and thepassword =
51 |
52 |
53 |
54 |
55 |
58 |
59 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_jsonutil/resources/artistMember.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | select * from artists where artistId =
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | update artists
27 | set artistid=artistid
28 |
29 | ,firstname =
30 |
31 |
32 | ,lastname =
33 |
34 |
35 | ,address =
36 |
37 |
38 | ,city =
39 |
40 |
41 | ,state =
42 |
43 |
44 | ,postalcode =
45 |
46 |
47 | ,email =
48 |
49 |
50 | ,phone =
51 |
52 |
53 | ,fax =
54 |
55 |
56 | ,thepassword =
57 |
58 | where artistid =
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | delete from artists where artistid =
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_anythingtoxml/resources/artistMember.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | select * from artists where artistId =
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | update artists
27 | set artistid=artistid
28 |
29 | ,firstname =
30 |
31 |
32 | ,lastname =
33 |
34 |
35 | ,address =
36 |
37 |
38 | ,city =
39 |
40 |
41 | ,state =
42 |
43 |
44 | ,postalcode =
45 |
46 |
47 | ,email =
48 |
49 |
50 | ,phone =
51 |
52 |
53 | ,fax =
54 |
55 |
56 | ,thepassword =
57 |
58 | where artistid =
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | delete from artists where artistid =
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_jsonutil/resources/artistCollection.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | select * from artists
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | insert into artists (firstname,lastname,address,city,state,postalcode,email,phone,fax,thepassword)
27 | values (
28 | ,
29 | ,
30 | ,
31 | ,
32 | ,
33 | ,
34 | ,
35 | ,
36 | ,
37 |
38 | )
39 |
40 |
41 | select * from artists
42 | where
43 | firstname =
44 | and lastname =
45 | and address =
46 | and city =
47 | and state =
48 | and postalcode =
49 | and email =
50 | and phone =
51 | and fax =
52 | and thepassword =
53 |
54 |
55 |
56 |
57 |
60 |
61 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api/resources/artistMember.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | select * from artists where artistId =
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | update artists
36 | set artistid=artistid
37 |
38 | ,firstname =
39 |
40 |
41 | ,lastname =
42 |
43 |
44 | ,address =
45 |
46 |
47 | ,city =
48 |
49 |
50 | ,state =
51 |
52 |
53 | ,postalcode =
54 |
55 |
56 | ,email =
57 |
58 |
59 | ,phone =
60 |
61 |
62 | ,fax =
63 |
64 |
65 | ,thepassword =
66 |
67 | where artistid =
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | delete from artists where artistid =
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_configVar/resources/artistMember.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | select * from artists where artistId =
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | update artists
36 | set artistid=artistid
37 |
38 | ,firstname =
39 |
40 |
41 | ,lastname =
42 |
43 |
44 | ,address =
45 |
46 |
47 | ,city =
48 |
49 |
50 | ,state =
51 |
52 |
53 | ,postalcode =
54 |
55 |
56 | ,email =
57 |
58 |
59 | ,phone =
60 |
61 |
62 | ,fax =
63 |
64 |
65 | ,thepassword =
66 |
67 | where artistid =
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | delete from artists where artistid =
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_twoFormats/resources/artistMember.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | select * from artists where artistId =
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | update artists
36 | set artistid=artistid
37 |
38 | ,firstname =
39 |
40 |
41 | ,lastname =
42 |
43 |
44 | ,address =
45 |
46 |
47 | ,city =
48 |
49 |
50 | ,state =
51 |
52 |
53 | ,postalcode =
54 |
55 |
56 | ,email =
57 |
58 |
59 | ,phone =
60 |
61 |
62 | ,fax =
63 |
64 |
65 | ,thepassword =
66 |
67 | where artistid =
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | delete from artists where artistid =
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_requireApiKey/resources/artistMember.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | select * from artists where artistId =
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | update artists
36 | set artistid=artistid
37 |
38 | ,firstname =
39 |
40 |
41 | ,lastname =
42 |
43 |
44 | ,address =
45 |
46 |
47 | ,city =
48 |
49 |
50 | ,state =
51 |
52 |
53 | ,postalcode =
54 |
55 |
56 | ,email =
57 |
58 |
59 | ,phone =
60 |
61 |
62 | ,fax =
63 |
64 |
65 | ,thepassword =
66 |
67 | where artistid =
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | delete from artists where artistid =
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_rateLimited/resources/artistMember.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | select * from artists where artistId =
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | update artists
36 | set artistid=artistid
37 |
38 | ,firstname =
39 |
40 |
41 | ,lastname =
42 |
43 |
44 | ,address =
45 |
46 |
47 | ,city =
48 |
49 |
50 | ,state =
51 |
52 |
53 | ,postalcode =
54 |
55 |
56 | ,email =
57 |
58 |
59 | ,phone =
60 |
61 |
62 | ,fax =
63 |
64 |
65 | ,thepassword =
66 |
67 | where artistid =
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | delete from artists where artistid =
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_anythingtoxml/anythingtoxml/ArrayToXML.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | #variables.TabUtils.printtabs()#<#variables.XMLutils.getNodePlural(arguments.rootNodeName)# CF_TYPE='array'>
39 | #createXML(arguments.TheseItems,arguments.rootNodeName,arguments.AttributeList)#
40 | #variables.TabUtils.printtabs()##variables.XMLutils.getNodePlural(arguments.rootNodeName)#>
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | #variables.TabUtils.printtabs()#<#CurrentNode#>#CurrentNode#>
63 |
64 |
65 | #variables.AnythingToXML.ToXML(thisArray[i],arguments.rootNodeName,arguments.AttributeList)#
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_twoFormats/resources/AnythingToXML/ArrayToXML.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | #variables.TabUtils.printtabs()#<#variables.XMLutils.getNodePlural(arguments.rootNodeName)# CF_TYPE='array'>
39 | #createXML(arguments.TheseItems,arguments.rootNodeName,arguments.AttributeList)#
40 | #variables.TabUtils.printtabs()##variables.XMLutils.getNodePlural(arguments.rootNodeName)#>
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | #variables.TabUtils.printtabs()#<#CurrentNode#>#CurrentNode#>
63 |
64 |
65 | #variables.AnythingToXML.ToXML(thisArray[i],arguments.rootNodeName,arguments.AttributeList)#
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/examples/breezejs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Breeze Todos with AngularJs (Backed by CFML via DAO)
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | Breeze Todos
18 | with AngularJs & DI
(Backed by ColdFusion via DAO)
19 |
22 |
23 |
24 |
60 |
61 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/tests/tests/TestFactory.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | function beforeTests(){
5 | variables.taffy = createObject("component","taffy.tests.Application");
6 | makePublic(variables.taffy, "getBeanFactory");
7 | variables.factory = variables.taffy.getBeanFactory();
8 | variables.factory.loadBeansFromPath( expandPath('/taffy/tests/resources'), 'taffy.tests.resources', expandPath('/taffy/tests/resources'), true );
9 | }
10 |
11 | function throws_on_getBean_not_exists(){
12 | var local = {};
13 | local.nonExistentBean = "does_not_exist";
14 |
15 | try{
16 | local.result = variables.factory.getBean(local.nonExistentBean);
17 | fail("Expected 'Bean Not Found' exception to be thrown, but none was.");
18 | } catch (Taffy.Factory.BeanNotFound e) {
19 | //debug(e);
20 | assertTrue(findNoCase('not found', e.message) gt 0, "TaffyFactory exception message did not contain the words 'not found'.");
21 | }
22 | }
23 |
24 | function autowires_properties(){
25 | variables.factory.loadBeansFromPath( expandPath('/taffy/tests/resources'), 'taffy.tests.resources', expandPath('/taffy/tests/resources'), true );
26 | local.bean = variables.factory.getBean( 'EchoMember' );
27 | debug(local.bean);
28 | assertTrue( structKeyExists(local.bean, "customJsonRepresentation") );
29 | assertFalse( isSimpleValue(local.bean.customJsonRepresentation) );
30 | }
31 |
32 | function autowires_setters(){
33 | variables.factory.loadBeansFromPath( expandPath('/taffy/tests/resources'), 'taffy.tests.resources', expandPath('/taffy/tests/resources'), true );
34 | local.bean = variables.factory.getBean( 'EchoRegexMember' );
35 | debug(local.bean);
36 | assertTrue( structKeyExists(local.bean, "echoMember") );
37 | assertFalse( isSimpleValue(local.bean.echoMember) );
38 | }
39 |
40 | function skips_resources_with_errors(){
41 | variables.factory.loadBeansFromPath( expandPath('/taffy/tests/resourcesError'), 'taffy.tests.resourcesError', expandPath('/taffy/tests/resourcesError'), true );
42 | debug(application._taffy.status);
43 | assertTrue(structKeyExists(application._taffy.status, "skippedResources"));
44 | }
45 |
46 | function lists_skipped_resources(){
47 | variables.factory.loadBeansFromPath( expandPath('/taffy/tests/resourcesError'), 'taffy.tests.resourcesError', expandPath('/taffy/tests/resourcesError'), true );
48 | debug(application._taffy.status);
49 | assertTrue(structKeyExists(application._taffy.status, "skippedResources"));
50 | assertTrue( arrayLen(application._taffy.status.skippedResources) gt 0 );
51 | }
52 |
53 | function clears_skipped_resources_on_reload(){
54 | variables.factory.loadBeansFromPath( expandPath('/taffy/tests/resourcesError'), 'taffy.tests.resourcesError', expandPath('/taffy/tests/resourcesError'), true );
55 | debug(application._taffy.status);
56 | assertTrue(structKeyExists(application._taffy.status, "skippedResources"));
57 | assertTrue( arrayLen(application._taffy.status.skippedResources) gt 0 );
58 |
59 | variables.factory.loadBeansFromPath( expandPath('/taffy/tests/resources'), 'taffy.tests.resources', expandPath('/taffy/tests/resources'), true );
60 | debug(application._taffy.status);
61 | assertTrue(structKeyExists(application._taffy.status, "skippedResources"));
62 | assertTrue( ArrayLen(application._taffy.status.skippedResources) eq 0, "Expected skipped resources array to be empty but it wasn't" );
63 | }
64 |
65 | function treats_CRCs_as_transients(){
66 | var local = {};
67 | //this resource+method explicitly sets response status of 999
68 | local.result = apiCall("get", "/echo/2.json", "foo=bar");
69 | debug(local.result);
70 | assertEquals(999, local.result.responseHeader.status_code);
71 | //this resource+method usees the default response status => 200=passing test, 999=failing test
72 | local.result = apiCall("get", "/echo/tunnel/2.json", "foo=bar");
73 | debug(local.result);
74 | assertEquals(200, local.result.responseHeader.status_code);
75 | }
76 |
77 |
78 |
--------------------------------------------------------------------------------
/database/IDAOConnector.cfc:
--------------------------------------------------------------------------------
1 | /************************************************************
2 | *
3 | * Copyright (c) 2007-2021, Abram Adams
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | *
17 | ***********************************************************/
18 | interface {
19 |
20 | any function init(
21 | required dao dao,
22 | required string dsn,
23 | string user = "",
24 | string password = "",
25 | boolean useCFQueryParams = true ) output = false
26 | description="I initialize DB Specific DAO Connector.";
27 |
28 |
29 | any function getLastID() output = false
30 | description="I return the ID of the last inserted record.";
31 |
32 | boolean function delete( required string tableName, required string recordID, string IDField ) output = false
33 | description="I delete a record from the database where the PK matches the given recordID";
34 |
35 | boolean function deleteAll( required string tableName ) output = false
36 | description="I delete All records from the database.";
37 |
38 | query function select(
39 | string sql = "",
40 | string name = "sel_#listFirst(createUUID(),'-')#",
41 | any cachedWithin = "",
42 | string table = "",
43 | string alias = "",
44 | string columns = "",
45 | string where = "",
46 | any limit = "",
47 | any offset = "",
48 | string orderBy = ""
49 | ) output = false
50 | description="I select records from the database.";
51 |
52 | any function write( required tabledef tabledef, boolean insertPrimaryKeys, boolean bulkInsert ) output = false
53 | description="I insert data into the database. I take a tabledef object containing the tablename and column values. I return the new record's Primary Key value.";
54 |
55 | any function update( required any tabledef, string columns = "", required string IDField ) output = false
56 | description="I update all fields in the passed table. I take a tabledef object containing the tablename and column values. I return the record's Primary Key value.";
57 |
58 | any function define( required string tableName ) output = false
59 | description="I return the structure of the passed table.";
60 |
61 | struct function getPrimaryKey( required string tableName ) output = false
62 | description="I return the primary key column name and type for the passed in table.";
63 |
64 | array function getPrimaryKeys( required string tableName ) output = false
65 | description="I return the primary keys column name and type for the passed in table.";
66 |
67 | string function getSafeColumnNames( required string cols ) output = false
68 | description="I take a list of columns and return it as a safe columns list with each column wrapped within DB appropriate escape characters.";
69 |
70 | string function getSafeColumnName( required string col ) output = false
71 | description="I take a single column name and return it as a safe columns list with each column wrapped within DB appropriate escape characters.";
72 |
73 | string function getSafeIdentifierStartChar() output = false
74 | description="I return the opening escape character for a column name.";
75 |
76 |
77 | string function getSafeIdentifierEndChar() output = false
78 | description="I return the closing escape character for a column name.";
79 |
80 | tabledef function makeTable( required tabledef tabledef ) output = false
81 | description ="I create a table based on the passed in tabledef object's properties.";
82 |
83 | void function dropTable( required string table ) output = false
84 | description="I drop a table based on the passed in table name.";
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/core/resource.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | var local = {};
40 | if (structKeyExists(server, "railo")) {
41 | local.Columns = listToArray(arguments.q.getColumnList(false));
42 | }
43 | else {
44 | local.Columns = arguments.q.getMetaData().getColumnLabels();
45 | }
46 | local.QueryArray = ArrayNew(1);
47 | for (local.RowIndex = 1; local.RowIndex <= arguments.q.RecordCount; local.RowIndex++){
48 | local.Row = {};
49 | local.numCols = ArrayLen( local.Columns );
50 | for (local.ColumnIndex = 1; local.ColumnIndex <= local.numCols; local.ColumnIndex++){
51 | local.ColumnName = local.Columns[ local.ColumnIndex ];
52 | local.Row[ local.ColumnName ] = arguments.q[ local.ColumnName ][ local.RowIndex ];
53 | }
54 | ArrayAppend( local.QueryArray, local.Row );
55 | }
56 | return( local.QueryArray );
57 |
58 |
59 |
60 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_anythingtoxml/anythingtoxml/AnythingToXML.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | #variables.XMLutils.NodeNameCheck(arguments.NodeName)#>" />
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | Unable to Convert this element to XML" />
63 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/examples/breezejs/api/taffy/examples/api_twoFormats/resources/AnythingToXML/AnythingToXML.cfc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | #variables.XMLutils.NodeNameCheck(arguments.NodeName)#>" />
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | Unable to Convert this element to XML" />
63 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------