Re: simple import script

Chris Kent <[email protected]>
Newsgroups gmane.comp.cms.farcry.devel
Message-ID <[email protected]>
You might need to use assignCategories

See if the following gets you on the right track
<cfset stProps.catImage = 'list,of,catIDs') />
...
...
<cfset application.fapi.setData(stProperties=stProps) />
<cfset oCategory = CreateObject("component",
"#application.packagepath#.farcry.category") />
<cfset oCategory.assignCategories(objectid=
stProps.objectid,lCategoryIDs=stProps.catImage) />

Chris.

On Wednesday, 24 April 2013 22:54:23 UTC+1, Tunc wrote:
>
> Thanks, Chris 
>
> I have managed something today. I can import all including HTML. Where I 
> struggle is with the categories. It imports into to the content type's 
> table but category is not selected on the category tree when I edit the 
> record.. Category is Farcry's one.. 
>
> I use this to commit to Farcy.. 
> <cfset stProperties = structNew() /> 
> <cfset stProperties.catProduct = trim(aProducts[cntArray].catProduct) /> 
> ... 
>
> <cfset stResult = ohpcProduct.createData(stproperties=stProperties) /> 
>
>
> On 24 Apr 2013, at 20:08, Chris Kent <[email protected] <javascript:>> 
> wrote: 
>
> > I have always coded my own import scripts, usually find the hardest part 
> is getting the content in the correct format - inserting content into 
> FarCry is very easy using setData 
> > 
> > <cfset stProps = structNew() /> 
> > <cfset stProps.objectID =application.fapi.getUUID() /> 
> > <cfset stProps.typename = "yourTypeName" /> 
> > <cfset stProps.title = import.title /> 
> > <cfset stProps.prop1 = import.prop1 /> 
> >  ... 
> >  ... 
> > <cfset stProps.prop99 = import.prop99 /> 
> > <cfset application.fapi.setData(stProperties=stProps) /> 
> > 
> > 
> > 
> > Chris. 
> > 
> > On Wednesday, 24 April 2013 17:26:13 UTC+1, Tunc wrote: 
> > Hi 
> > 
> > Is there an example script of importing data from CSV or Excel files? I 
> do recall a plug in called Import few years ago but it looks like it is no 
> longer available. When I tried it last time for Farcy 6 it did not work 
> though. 
> > 
> > Thanks 
> > Tunc 
> > 
> > -- 
> > You received this message cos you are subscribed to "farcry-dev" Google 
> group. 
> > To post, email: farcr...-/[email protected] <javascript:> 
> > To unsubscribe, email: farcry-dev+...-/[email protected] <javascript:> 
> > For more options: http://groups.google.com/group/farcry-dev 
> > -------------------------------- 
> > Follow us on Twitter: http://twitter.com/farcry 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups "farcry-dev" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to farcry-dev+...-/[email protected] <javascript:>. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> >   
> >   
>
>
>

-- 
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev-/[email protected]
To unsubscribe, email: farcry-dev+unsubscribe-/[email protected]
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
--- 
You received this message because you are subscribed to the Google Groups "farcry-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to farcry-dev+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
For more options, visit https://groups.google.com/groups/opt_out.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.