This commit is contained in:
msyu
2024-10-23 11:17:42 +03:00
commit ab5c944862
380 changed files with 55823 additions and 0 deletions
@@ -0,0 +1,26 @@
<cfcomponent output="false">
<cfscript>
this.name = "taffy_ParentAppExample";//same name as parent folder application.cfc
this.applicationTimeout = createTimeSpan(0,2,0,0);
this.sessionManagement = false;
this.setClientCookies = false;
this.scriptProtect = false;
</cfscript>
<cffunction name="onApplicationStart" returnType="boolean" output="false">
<cfinclude template="mixin/appInit.cfm" />
<cfreturn true />
</cffunction>
<cffunction name="onRequestStart" returnType="boolean" output="false">
<cfargument name="thePage" type="string" required="true" />
<cfif structKeyExists(url, "reinit")>
<cfset onApplicationStart() />
</cfif>
<cfreturn true />
</cffunction>
</cfcomponent>
@@ -0,0 +1,6 @@
RewriteEngine On
#if we've already been rewritten to use index.cfm/* format, don't make a circular request
RewriteRule index\.cfm/* - [L]
RewriteRule ^(.*)$ index.cfm/$1
@@ -0,0 +1,16 @@
component extends="taffy.core.api" {
this.name = "taffy_ParentAppExample";//same name as api folder application.cfc
variables.framework = {};
variables.framework.beanFactory = "";
function onApplicationStart(){
include "../mixin/appInit.cfm";
variables.framework.beanFactory = application.beanFactory;
return super.onApplicationStart();
}
}
@@ -0,0 +1,6 @@
<!---
DO NOT DELETE THIS FILE
===============================
This file is necessary for Taffy to work, but should be blank.
All requests funnel through it, but are handled by framework internal functionality.
--->
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans>
<bean id="fakeData" class="taffy.examples.shared.fakeData" />
<bean id="fooCollection" class="taffy.examples.ParentApplication.model.fooCollection">
<property name="fakeData">
<ref bean="fakeData" />
</property>
</bean>
</beans>
@@ -0,0 +1,5 @@
<h1>Parent Application</h1>
<p>Hi there. I'm the parent application. Want to see what's under the hood?</p>
<cfdump var="#application#">
@@ -0,0 +1,2 @@
<cfset application.beanFactory = createObject("component", "coldspring.beans.DefaultXMLBeanFactory") />
<cfset application.beanFactory.loadBeans('/taffy/examples/ParentApplication/config/coldspring.xml') />
@@ -0,0 +1,13 @@
<cfcomponent extends="taffy.core.resource" taffy_uri="/foo">
<cffunction name="get" access="public" output="false">
<cfreturn representationOf(variables.fakeData.getData()).withStatus(200) />
</cffunction>
<!--- this will be called by the bean factory's autowire functionality --->
<cffunction name="setFakeData" access="public" output="false" returnType="void">
<cfargument name="fakeDataObj" type="any" required="true" hint="Shared FakeData object" />
<cfset variables.fakeData = arguments.fakeDataObj />
</cffunction>
</cfcomponent>