Matt

I hope this is helpful. I tried to strip it down to the most relevant
parts... If this doesn't help enough let me know what you need. Thanks. I
used one example of a variable that I think may be causing some of my
trouble.

Bryan

------------------------------------

from mach-ii.xml.cfm

          <listener name="executeScheduleListener"
type="flexcomm.model.execute-schedule.execute-schedule-listener">
            <invoker type="MachII.framework.invokers.EventInvoker" />
         </listener>

        <event-handler event="executeSchedule" access="public"
            login="true"
            appRoles=""
        >
            <event-arg name="pageTitle" value="Execute Schedule"/>
            <event-arg name="includeCalendar" value="true" />
            <event-bean name="fcSchedule"
type="flexcomm.model.fc-schedule.fc-schedule"
                fields="scheduleId"/>

            <notify listener="executeScheduleListener"
method="executeSchedule" resultArg="fcSchedule"/>

            <!--begin custom code-->
            <!--this is rendered first but displayed second and we don't
want the message displayed above it-->
            <event-arg name="displayMessage" value="false"/>
            <event-arg name="ignoreArgs"
value="changedBy,changedDate,groupMainId,statusCode"/>
            <notify listener="groupMainListener" method="getGroupMains"
resultArg="groupMains" />
            <event-arg name="ignoreArgs" value=""/>
            <view-page name="groupMainList" contentArg="layout.list" />
            <!--anything but "false" displays the message but we do have to
change it from false-->
            <event-arg name="displayMessage" value=""/>
            <!--end custom code-->
            <view-page name="executeSchedule" contentArg="layout.content"/>
            <announce event="mainTemplate" copyEventArgs="true"/>
        </event-handler>

from coldspring.xml

    <bean id="ExecuteScheduleService"
        class="flexcomm.model.execute-schedule.execute-schedule-service">
        <property name="FcScheduleService"><ref bean="FcScheduleService"
/></property>
        <property name="SecurityService"><ref bean="SecurityService"
/></property>
        <property name="ExecuteScheduleDao"><ref bean="ExecuteScheduleDao"
/></property>
        <property name="ExecuteScheduleGateway"><ref
bean="ExecuteScheduleGateway" /></property>
        <property name="FcCommissionService"><ref bean="FcCommissionService"
/></property>
        <property name="GeneralService"><ref bean="GeneralService"
/></property>
        <property name="MultipleRequestFacade"><ref
bean="MultipleRequestFacade"/></property>
        <!--BEGIN all of the method objects-->
        <property name="CommissionMethodDao"><ref bean="CommissionMethodDao"
/></property>
        <property name="CommissionMethodDebugDao"><ref
bean="CommissionMethodDebugDao" /></property>
        <property name="CommissionMethodTotalDao"><ref
bean="CommissionMethodTotalDao" /></property>
        <property name="CommissionMethodWrk3wyBundleDao"><ref
bean="CommissionMethodWrk3wyBundleDao" /></property>
        <property name="CommissionMethodWrk4wyBundleDao"><ref
bean="CommissionMethodWrk4wyBundleDao" /></property>
        <property name="CommissionMethodWrkBonusDao"><ref
bean="CommissionMethodWrkBonusDao" /></property>
        <property name="CommissionMethodWrkBundleDao"><ref
bean="CommissionMethodWrkBundleDao" /></property>
        <property name="CommissionMethodWrkCmplFlatDao"><ref
bean="CommissionMethodWrkCmplFlatDao" /></property>
        <property name="CommissionMethodWrkComboDao"><ref
bean="CommissionMethodWrkComboDao" /></property>
        <property name="CommissionMethodWrkFlatDao"><ref
bean="CommissionMethodWrkFlatDao" /></property>
        <property name="CommissionMethodWrkFlatAlacarteDao"><ref
bean="CommissionMethodWrkFlatAlacarteDao" /></property>
        <property name="CommissionMethodWrkFlatBonusDao"><ref
bean="CommissionMethodWrkFlatBonusDao" /></property>
        <property name="CommissionMethodWrkFlatRangeDao"><ref
bean="CommissionMethodWrkFlatRangeDao" /></property>
        <property name="CommissionMethodWrkFlatSpinDao"><ref
bean="CommissionMethodWrkFlatSpinDao" /></property>
        <property name="CommissionMethodWrkRequireDao"><ref
bean="CommissionMethodWrkRequireDao" /></property>
        <property name="CommissionMethodWrkSellinBonusDao"><ref
bean="CommissionMethodWrkSellinBonusDao" /></property>
        <property name="CommissionMethodWrkSrmFlatDao"><ref
bean="CommissionMethodWrkSrmFlatDao" /></property>
        <property name="CommissionMethodWrkSrmSpinDao"><ref
bean="CommissionMethodWrkSrmSpinDao" /></property>
        <property name="CommissionMethodWrkTierDao"><ref
bean="CommissionMethodWrkTierDao" /></property>
        <!--END all of the method objects-->
    </bean>

    from execute-schedule-service.cfc

        <cffunction name="executeSchedule" access="public" output="false"
returntype="flexcomm.model.fc-schedule.fc-schedule"
            hint="Returns a query object containing FcSchedules">
        <cfargument name="securityUser" type="any" required="true" />
        <cfargument name="scheduleId" type="numeric" required="true" />
        <cfargument name="minuteToRun" type="string" required="true" />
        <cfargument name="runAnyTime" type="string" required="false"
default="false" />
        <cfargument name="empType" type="string" required="false"
default="any" />
        <cfargument name="reRunDaysAgo" type="string" required="false"
default="0" />
        <cfargument name="reRunDay" type="string" required="false"
default="all" />
        <cfargument name="simulatedTodayDate" type="string" required="false"
default="" />
        <cfargument name="simulatedStartDate" type="string" required="false"
default="" />
        <cfargument name="simulatedEndDate" type="string" required="false"
default="" />
        <cfargument name="simulatedReportRun" type="string" required="false"
default="false" />
        <cfargument name="sendEmails" type="string" required="false"
default="true" />
        <cfargument name="sendStartCompleteEmails" type="string"
required="false" default="true" />
        <cfargument name="adminEmail" type="string" required="false"
default="" />
        <cfargument name="userEmail" type="string" required="false"
default="" />
        <cfargument name="emailReport" type="string" required="false"
default="false" />

        <cfset var local = structNew() />
        <cfset local.methodInfo = structNew() />

        ...

        <cfset local.oSFileSeparator =
getGeneralService().getOSFileSeparator() />
        <cfset local.scheduleResultsFolderParent =
"#local.oSFileSeparator#flexcomm-schedule-results#local.oSFileSeparator#" />

        ...

        <cfset local.currentTime = now() />
        <!---this allows the commission ids to line up no matter how many
places they hold--->
        <cfset local.commissionIdJustified = variables.instance.commissionId
+ 100000 />
        <!---this allows the schedule ids to line up no matter how many
places they hold--->
        <cfset local.scheduleIdJustified = variables.instance.scheduleId +
100000 />
        <!---this allows the milliseconds to line up no matter how many
places they hold--->
        <cfset local.currentMillisecondsJustified =
timeFormat(local.currentTime, 'l') + 1000 />


        <cfset variables.instance.scheduleResultsFolder =
expandPath(local.scheduleResultsFolderParent) &
            "c" &  local.commissionIdJustified & "s" &
local.scheduleIdJustified &
            "d" & dateFormat(local.currentTime, 'yymmdd') & "t" &
timeFormat(local.currentTime, 'HHMMSS') & "m" &
local.currentMillisecondsJustified &
            getGeneralService().getOSFileSeparator()
         />

         ...

        <!---write the report--->
        <cfset variables.instance.reportFilePath =
writeReport(local.createReport,variables.instance.scheduleResultsFolder,"writeReport")
/>

        ...

        <cfreturn variables.instance.fcSchedule />
    </cffunction>



    <cffunction name="writeReport" access="public" output="false"
returntype="string"
        hint="Write the report">
        <cfargument name="reportToWrite" type="string" required="true" />
        <cfargument name="writeFileDir" type="string" required="true" />
        <cfargument name="writeFileName" type="string" required="true" />

        <!---
        <cfargument name="sendEmailTo" type="string" required="false"
default="" />
         --->

        <cfset var local = structNew() />

        <cfset local.currentTime = now() />
        <!---this allows the milliseconds to line up no matter how many
places they hold--->
        <cfset local.currentMillisecondsJustified =
timeFormat(local.currentTime, 'l') + 1000 />

        <cfset local.reportToWriteFilePath = arguments.writeFileDir & "d" &
dateFormat(local.currentTime, 'yymmdd') & "t" &
timeFormat(local.currentTime, 'HHMMSS') & "m" &
local.currentMillisecondsJustified & arguments.writeFileName & ".xls" />
        <cfset local.reportToWriteInFileFormat =
getGeneralService().convertCrlfTo("file",arguments.reportToWrite) />
        <cftry>
            <cffile action="write" file="#local.reportToWriteFilePath#"
output="#local.reportToWriteInFileFormat#" addnewline="no">
            <cfcatch>
                <cfthrow type="application" message="#CFCATCH.message#"
detail="#CFCATCH.detail#" />
            </cfcatch>
        </cftry>

        <cfreturn local.reportToWriteFilePath />
    </cffunction>



On Wed, Dec 10, 2008 at 9:56 PM, Matthew Woodward <m...@mattwoodward.com>wrote:

> Bryan S wrote:
>
>> The best answer I can give until I get back to my code on Friday is that I
>> am doing exactly like you do in Mach Blog. I used that code as my template.
>>
>
> Let me know when you get back to your code. Clearly something isn't quite
> like MachBlog. :-)
>
>
> --
> Matt Woodward
> m...@mattwoodward.com
> http://www.mattwoodward.com/blog
>
> Please do not send me proprietary file formats such as Word, PowerPoint,
> etc. as attachments.
> http://www.gnu.org/philosophy/no-word-attachments.html
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to Mach-II for CFML list.
To post to this group, send email to mach-ii-for-coldfusion@googlegroups.com
To unsubscribe from this group, send email to 
mach-ii-for-coldfusion-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/mach-ii-for-coldfusion?hl=en
SVN: https://greatbiztoolsllc-svn.cvsdude.com/mach-ii/
Wiki / Documentation / Tickets: 
http://greatbiztoolsllc-trac.cvsdude.com/mach-ii/
-~----------~----~----~----~------~----~------~--~---

Reply via email to