With the below code i now can check for table existence, and also for
that table data existence, i created this on a custom polling
statistics page for the polling and pollingvotes types:
- polling type check -
<!--- check if the polling type is deployed, else show link to deploy
--->
<cftry>
<cfset oFormtoolUtil = createObject("component",
"farcry.core.packages.farcry.formtools") />
<cfset sqlColumns="objectid" />
<cfset polling = oFormtoolUtil.getRecordset(sqlColumns=sqlColumns,
sqlWhere="objectid = objectid", typename="polling",
bCheckVersions=true) />
<cfcatch type="database">
<cfoutput>The 'Polling' content type has not been deployed yet.
Click <a href="/webtop/admin/customadmin.cfm?module=customlists/
polling.cfm&plugin=wsoFarcryPolling&deploy=true">here</a> to
deploy it now.</cfoutput>
<cfabort>
</cfcatch>
</cftry>
<!--- check if any polling data exists, else show link to create
polling --->
<cfif polling.q.recordcount LE 0>
<cfoutput>Currently there is no polling to get data from. Click <a
href="/webtop/admin/customadmin.cfm?module=customlists/
polling.cfm&plugin=wsoFarcryPolling">here</a> to create one now.</
cfoutput>
<cfabort>
</cfif>
- pollingvotes check -
<!--- check if the pollingvotes type is deployed, else show link to
deploy --->
<cftry>
<cfset oFormtoolUtil = createObject("component",
"farcry.core.packages.farcry.formtools") />
<cfset sqlColumns="objectid" />
<cfset pollingvotes =
oFormtoolUtil.getRecordset(sqlColumns=sqlColumns,
sqlWhere="objectid = objectid", typename="pollingvotes",
bCheckVersions=true) />
<cfcatch type="database">
<cfoutput>The 'Pollingvotes' content type has not been deployed yet.
Click <a href="/webtop/admin/customadmin.cfm?module=customlists/
pollingvotes.cfm&plugin=wsoFarcryPolling&deploy=true">here</a>
to deploy it now.</cfoutput>
<cfabort>
</cfcatch>
</cftry>
<!--- check if any pollingvotes data exists, else show statement --->
<cfif pollingvotes.q.recordcount LE 0>
<cfoutput>Currently there are no polling votes made.</cfoutput>
<cfabort>
</cfif>
For the pollingvotes that is not a type to display in the custom list,
i created a file in the custom list with a cflocation in it, so that
the deploy function will work and redirect to the pollingvotes
statistics page:
cfsetting enablecfoutputonly="true">
<cfimport taglib="/farcry/core/tags/formtools" prefix="ft" />
<cfimport taglib="/farcry/core/tags/admin/" prefix="admin" />
<!--- set up page header --->
<admin:header title="Pollingvotes" />
<ft:objectAdmin
title="Pollingvotes"
typename="pollingvotes"
ColumnList="objectid"
SortableColumns="objectid"
lFilterFields="objectid"
plugin="wsoFarcryPolling"
sqlorderby="datetimelastUpdated desc" />
<admin:footer />
<cflocation url="/webtop/admin/customadmin.cfm?module=customlists/
pollingstatistics.cfm&plugin=wsoFarcryPolling" addtoken="no">
<cfsetting enablecfoutputonly="false">
On Nov 10, 1:39 pm, Marco van den Oever <[EMAIL PROTECTED]>
wrote:
> Yes indeed, well for now nothing more to do then write a custom try
> script in that page that will check on db and data existence.
>
> Thanks.
>
> On Nov 10, 1:32 pm, "Tomek Kott" <[EMAIL PROTECTED]> wrote:
>
> > Agreed :). I haven't heard of a better way of doing things, but I do really
> > like the automatic "This has not been deployed" statement. Too bad it
> > doesn't seem to work on associated types.
>
> > On Sun, Nov 9, 2008 at 10:55 PM, Marco van den Oever <
>
> > [EMAIL PROTECTED]> wrote:
>
> > > Hi yes i know, but users not always do what they should do :)
>
> > > On Nov 10, 4:24 am, "Tomek Kott" <[EMAIL PROTECTED]> wrote:
> > > > Oh, when you have one content type page that uses data from another
> > > > type.
> > > > This I don't know how to check.
> > > > However, when using a new plugin, the first thing that a user should do
> > > it
> > > > go into the admin section and deploy all the relevant new types so that
> > > you
> > > > don't have a problem like that.
>
> > > > Tomek
>
> > > > On Sun, Nov 9, 2008 at 12:17 PM, Marco van den Oever <
>
> > > > [EMAIL PROTECTED]> wrote:
>
> > > > > I'm not sure i understand this, when you have a custom content type
> > > > > and use that page directly to edit or add data, then automatically you
> > > > > get an "type is not yet deployed" message.
>
> > > > > Now i have a custom page that uses the data of a custom content type,
> > > > > how can i trigger the checking for existence of that type being
> > > > > deployed or not from the custom page?
>
> > > > > Thanks
>
> > > > > On Nov 6, 2:23 pm, "Tomek Kott" <[EMAIL PROTECTED]> wrote:
> > > > > > I believe it happens automatically if you create a page (using the
> > > xml)
> > > > > > under webtop that uses objectbroker to reference the particular type
> > > and
> > > > > > then surf to that page.
> > > > > > Tomek
>
> > > > > > On Thu, Nov 6, 2008 at 8:09 AM, Marco van den Oever <
>
> > > > > > [EMAIL PROTECTED]> wrote:
>
> > > > > > > Anyone any idea how to replicate "The 'blablabla' content type has
> > > not
> > > > > > > been deployed yet. Click here to deploy it now." statement?
>
> > > > > > > I have a custom statistics page where i want to replicate this
> > > > > > > statement when the content type which enables these statistics, is
> > > not
> > > > > > > yet deployed.
>
> > > > > > > Any directions?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"farcry-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/farcry-dev?hl=en
-~----------~----~----~----~------~----~------~--~---