composite keys on many-to-many relationships

2011-08-10 Thread Glyn Jackson

Hi, 

Just trying to understand this issues, maybe I have missed something

I created a many-to-many relationship in ORM (see below). When I add an account 
to a scape i.e. addAccount(account) the second time I add the 'same' account to 
the scape I 'should' get an error because of the composite key.

However, ORM happily adds it!
 
Scape.cfc
property name=Accounts singularname=Account fieldtype=many-to-many 
cfc=pAccount fkcolumn=scapeID inversejoincolumn=accID  
linktable=pLinkScapesAccount;

Account.cfc
property name=Scapes singularname=Scape fieldtype=many-to-many 
cfc=pScape fkcolumn=accID inversejoincolumn=scapeID  
linktable=pLinkScapesAccount;

What should I have done? There should never be two composite keys the same in 
the link table so why does ORM let me do this? Is there a way to force the 
correct behaviour?


Thanks for you help

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346644
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: composite keys on many-to-many relationships

2011-08-10 Thread Glyn Jackson

thanks i have posted in the orm group as suggested and asked for a little more 
help understanding what I did wrong.

link here: 
http://groups.google.com/group/cf-orm-dev/browse_thread/thread/bb644ecbe4da3214 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346646
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


ORM many-to-many code example difference

2011-08-09 Thread Glyn Jackson

Can someone tell me the difference between this... 

property name=POIs fieldtype=many-to-many fkcolumn=actionID cfc=pPOI 
type=array singularname=POI linktable=pLinkActionsToPOIs;

VS 

property name=POIs singularname=POI fieldtype=many-to-many cfc=pPOI 
fkcolumn=actionID inversejoincolumn=poiID  linktable=pLinkActionsToPOIs;




~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346585
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: ORM many-to-many code example difference

2011-08-09 Thread Glyn Jackson

The only difference is that the first is returning an array, which I think
is the default from memory. And the second is using the inversejoin which is
saying which column to join on, not really used it but the docs can explain
that it greater detail

What is your exact problem or question?


On Tue, Aug 9, 2011 at 7:29 PM, Glyn Jackson glyn.jack...@newebia.co.ukwrote:



No issues really. I was just going back in my code I noticed that at some point 
I started using the inversejoin version for many-to-many i.e. without array. 
the codes works both ways. I have no idea why I started using one over the 
other and can see no advantage to either.
 
Does anyone know if one performs better?

Thanks 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346587
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: ORM many-to-many code example difference

2011-08-09 Thread Glyn Jackson

It wont be performance as an issue, as each property is how you want to
reference the data and what/how it is returned. So if you have a type of
array then it will be returned as an array, type of struct returns it as a
struct. Not used the inversejoincolumn before so I am assuming that this
says I am joining on these IDS from the other side, other than that there is
no real differences.


On Tue, Aug 9, 2011 at 9:37 PM, Glyn Jackson glyn.jack...@newebia.co.ukwrote:



Tanks Andrew ;) 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346589
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


ORM relationship using EntityLoad issues

2010-10-19 Thread Glyn Jackson

Hi,

quick question, if anyone can help.

below you can see a entity for Campaign model. I want to get all campaign that 
have a company id of x  (1 to many relationship) so i tried this


returnobj = EntityLoad(Campaign,{company='1'},#sortColumn# #sort#);

however this gives me the following error...
You have attempted to dereference a scalar variable of type class 
java.lang.String as a structure with members.


how can i get all the campaign that have a company of x from my realtionship??

Model

component output=false persistent=true { 

property name=camp_id type=numeric ormtype=int fieldtype=id 
generator=identity sqltype=int; 
property name=camp_description column=camp_description type=string 
ormtype=string;
 
   
/* relationships*/
property name=company fieldtype=many-to-one fkcolumn=com_id cfc=company;



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338323
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: ORM relationship using EntityLoad issues

2010-10-19 Thread Glyn Jackson

Hi Russ,

sort ect are def just simple vars. I have hard coding the sortcolum and sort 
vars and got the same error. 

it looks right to me also, company is not a string tho should it be something 
like this

EntityLoad(Campaign,{company.getCom_id(1)},#sortColumn# #sort#);


however i know that won't work.

if i dump out Campaign this is what I see...


camp_id   1
camp_name 1
camp_description  1
camp_startDate{ts '2010-10-10 00:00:00'}
camp_endDate  {ts '2010-10-17 00:00:00'}
camp_active   YES

company [cfc2] component model.company 

  PROPERTIES
  com_id 1
  com_name   Glyn Inc




Syntax Looks valid to me, perhaps it is just tempremental about the quotes.

try
returnobj = EntityLoad(Campaign,{company=1},#sortColumn# #sort#);

are you sure sortorder and sort are simple variables and not complex
variables ?

Russ

On Tue, Oct 19, 2010 at 6:50 PM, Glyn Jackson 
glyn.jack...@newebia.co.ukwrote:

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338343
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: ORM relationship using EntityLoad issues

2010-10-19 Thread Glyn Jackson

Company is a structure for sure (struct posted above in reply to Russ) I asumed 
something like this would work, but no joy i.e.

company.getcom_id(1) 

 This error occurs when you use a function on a string that is looking
 for a structure.  Dump your variables and see which one has a string
 value instead of a key value pairs.
 
 On Tue, Oct 19, 2010 at 10:50 AM, Glyn Jackson
 glyn.jack...@newebia.co.uk wrote:
 
  Hi,
 
  quick question, if anyone can help.
 
  below you can see a entity for Campaign model. I want to get all 
 campaign that have a company id of x  (1 to many relationship) so i 
 tried this
 
 
  returnobj = EntityLoad(Campaign,{company='1'},#sortColumn# 
 #sort#);
 
  however this gives me the following error...
  You have attempted to dereference a scalar variable of type class 
 java.lang.String as a structure with members.


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338345
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


grid width 100% when inside a cflayout

2010-10-09 Thread Glyn Jackson

in CF9 using CFGRID, for some reason I cannot get it to be 100% the width of 
the cflayout. I know you can set the width in px but it seems I cannot make the 
width just 100% as its not supported. 

any other way to make the with of a grid 100% when inside a cflayout? 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338031
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


CFGRID width

2010-10-06 Thread Glyn Jackson

in CF9 using CFGRID, for some reason I cannot get it to be 100% the width of 
the cflayout. I know you can set the width but it's in px which is no good to 
me. i would like it i could make the width just 100% but its not accepted. any 
other way to make the with 100% of when inside a cflayout 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337927
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


ORM and many to many relationships

2010-09-21 Thread Glyn Jackson

I have posted about this on my blog, but if anyone here could give their 
opinion I would very much like to hear it.

I am trying to understand if I am looking at ORM correctly in terms of a 
many-to-many relationship.

blog post is here 
http://www.cfcoffee.co.uk/index.cfm/2010/9/20/Head-Spin-Moment-ORM-manytomany-Help

for the sake of cftalk I have posted again below. thanks :)




Below I have two tables. Users and Monsters. A user can have many monsters, and 
a monster can have many users. Therefore I have a many-to-many relationship. 
Now I decide to include a join table called mostercollected to normalise the 
table somewhat. So below is what I come up with.

/**
* user
*/
component output=false persistent=true {

property name=user_id column=user_id type=numeric
ormtype=int fieldtype=id generator=increment;

property name=user_name column=user_name
type=string ormtype=string;

 /* link tables */
property name=monsters fieldtype=many-to-many
CFC=monsters FKColumn=user_id singularname=monsters
inversejoincolumn=monster_id linktable=monstersCollected;

users function init() output=false{
return this;
}

}




/**
* monsters
*/
component output=false persistent=true {

property name=monster_id column=monster_id type=numeric
ormtype=int fieldtype=id generator=increment;

property name=monster_name column=monster_name type=string
ormtype=string ;

/* link tables */
property name=users fieldtype=many-to-many CFC=users
FKColumn=monster_id singularname=monsters
 inversejoincolumn=user_id linktable=monstersCollected;

monsters function init() output=false{
return this;
}

}


/* Join table */



component entityname=UserMonster persistent=true accessors=true
table=monstersCollected
{
property name=user_id
fieldtype=id,many-to-one
cfc=users
cascade=all
fkcolumn=user_id;

property name=monster_id
fieldtype=id,many-to-one
cfc=monsters
cascade=all
fkcolumn=monster_id;

}


Now if I dump a user to screen, yes I can see all the monsters that each user 
has (cool), but the array continues down more, showing all monsters and all 
users that belong to that monster, effectively repeating data (bad, right?).


My concern is that of performance. If every time I want to get a user and I 
then get monsters + monster again and users that belong to that monster (head 
spin, moment), this seems like a lot of overhead (or is it?).

Is this the issue I am making it out to be? 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337253
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: ORM and many to many relationships

2010-09-21 Thread Glyn Jackson

Thanks Gabriel,

o, ok so data is not pre loaded so to speak? if I just wanted to get the data 
its treated as an array  which is what confused me, i.e. like the array is 
waiting...

cfloop array=#rc.userbean# index=user

cfloop array=#user.getMonsters()# index=monster
   get montser that belong to  a user
/cfloop
  
/cfloop 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337256
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: ORM and many to many relationships

2010-09-21 Thread Glyn Jackson

PS thanks for the group link 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337257
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


ORM tables?

2010-08-31 Thread Glyn Jackson

Just want to make sure I am on the right path with my first jump into CF9 ORM. 
below are two tables. I user can have many monsters assigned to them, and a 
monster can belong to many users.

is there anything wrong with below so far?

/**
* monsters
*/
component output=false persistent=true { 

   property name=monster_id column=monster_id type=numeric 
ormtype=int fieldtype=id generator=increment;
   property name=monster_name column=monster_name type=string 
ormtype=string length=100;
   property name=monster_des column=monster_des type=string 
ormtype=string length=200;
   property name=monster_img1 column=monster_img2 type=string 
ormtype=string length=100;
   property name=monster_img1 column=monster_img2 type=string 
ormtype=string length=100;
   property name=monster_active column=monster_active 
type=boolean ormtype=boolean default=1;
   property name=monster_finished column=monster_finished 
type=boolean ormtype=boolean default=1;
   /* link tables */
   property name=users singularname=users fieldtype=many-to-many 
CFC=monsters linktable=monstersCollected 
   FKColumn=user_id inversejoincolumn=monster_id lazy=true 
cascade=all orderby=monster_id; 

monsters function init() output=false{
return this;
}

} 




/**
* company
*/
component output=false persistent=true { 

   property name=user_id column=user_id type=numeric ormtype=int 
fieldtype=id generator=increment;
   property name=user_name column=user_name type=string 
length=120 ormtype=string;
   property name=user_email column=user_email type=string 
length=250 ormtype=string;
   property name=user_password column=user_password type=string 
length=200 ormtype=string;
   property name=user_created column=user_created type=date 
length=200 ormtype=date; 
   /* link tables  */
   property name=monsters singularname=monsters 
fieldtype=many-to-many CFC=monsters linktable=monstersCollected 
   FKColumn=monster_id inversejoincolumn=user_id lazy=true 
cascade=all orderby=user_id;

users function init() output=false{
return this;
}

} 





~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336693
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: ColdBox: and CF9 ORM: Mapping for component user not found

2010-07-05 Thread Glyn Jackson

I assumed that tried it but  get
Variable USERSERVICE is undefined.
when using inject=userService:user
i also trted just inject;

Should this

property name=userService inject=entityService:user;

be

property name=userService inject=userService:user;

??


Hi, can anyone help.

I am playing around with CB 3 and CF9 ORM. I am not sure its wiring
everything up correctly as I get the message...

Error Messages:  Mapping for component user not found.
Either the mapping for this component is missing or the application must be
restarted to generate the mapping.

I have followed the sample app 'task manager' but think i have missed
something..

my handler login.cfc...

property name=userService inject=entityService:user;

/* Index handler */
function index(event){
var rc = event.getCollection();
userService.get();
event.setView(login/index);
}

my user.cfc

component output=false persistent=true{

property name=user_id fieldType=id;
property name=user_username notnull=true type=string;
property name=user_password type=string;
property name=user_email type=string;
property name=user_role type=string;
property name=user_created type=date dbdefault=#now()#;

user function init() output=false{
return this;
}

}

my service

component output=false singleton{

userService function init() output=false{
return this;
}

   User function getUser(user_id=) output=false{
   if( len(arguments.user_id) ){
   var user =
entityLoad(User,arguments.user_id,true);
   if(NOT isNull(user) ){
   return user;
   }
   }   
   return entityNew(User);
   }

etc...

app.cfc

// ORM Setup
this.ormEnabled = true;
this.datasource = testDS;
this.ormSettings = {
dbcreate = update,
dialect = MySQLwithInnoDB,
logSQL = true,
eventhandling = true,
eventhandler = model.ORMEventHandler,
flushAtRequestEnd = false
}; 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335059
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


ColdBox: and CF9 ORM: Mapping for component user not found

2010-07-04 Thread Glyn Jackson

Hi, can anyone help.

I am playing around with CB 3 and CF9 ORM. I am not sure its wiring
everything up correctly as I get the message...

Error Messages:  Mapping for component user not found.
Either the mapping for this component is missing or the application
must be restarted to generate the mapping.

I have followed the sample app 'task manager' but think i have missed
something..

my handler login.cfc...

property name=userService inject=entityService:user;

/* Index handler */
function index(event){
var rc = event.getCollection();
userService.get();
event.setView(login/index);
}

my user.cfc

component output=false persistent=true{

property name=user_id fieldType=id;
property name=user_username notnull=true type=string;
property name=user_password type=string;
property name=user_email type=string;
property name=user_role type=string;
property name=user_created type=date dbdefault=#now()#;

user function init() output=false{
return this;
}

}

my service

component output=false singleton{

userService function init() output=false{
return this;
}

User function getUser(user_id=) output=false{
if( len(arguments.user_id) ){
var user = entityLoad(User,arguments.user_id,true);
if(NOT isNull(user) ){
return user;
}
}   
return entityNew(User);
}

etc...

app.cfc

// ORM Setup
this.ormEnabled = true;
this.datasource = testDS;
this.ormSettings = {
dbcreate = update,
dialect = MySQLwithInnoDB,
logSQL = true,
eventhandling = true,
eventhandler = model.ORMEventHandler,
flushAtRequestEnd = false
}; 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335055
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


issues preserving the case of the key

2010-07-01 Thread Glyn Jackson

Hi

Having more issues with a JSON request. the page calling the service is case 
sensitive, this was solved using the bracket structure syntax: i.e. 
response['hotspots'] = []; to preserve the case of the key. however I have an 
array I have tried added the array different ways to the struct but it still 
comes out uppercase!

cfscript
var response  = StructNew();
var tempArray=ArrayNew(1);
var obj = ;
response['hotspots'] = [];


obj = 

{

distance = 100,
attribution=This is a test layer POI provider,
title= My layer - snowy4,
lon= 53.472696,
lat=-2.261843,  
imageURL=null,
line4=RADIOLIST-None,CustSlider-None, 
line3=SEARCHBOX - asdfdgxdg, 
line2=DevlId - 896Settings: range=1000', 
actions=, 
type=0, 
id=test_1

};


arrayappend(response['hotspots'],obj);



response['layer'] = testme;
response['errorString']='ok'; 
response['morePages']='false';
response['errorCode']= '0'; 
response['nextPageKey']='null';

/cfscript

   also tried

cfscript
var response  = StructNew();




response['hotspots'] = [

{

distance =100,
attribution=This is a test layer POI provider,
title= My layer - snowy4,
lon= 53.472696,
lat=-2.261843,  
imageURL=null,
line4=RADIOLIST-None,CustSlider-None, 
line3=SEARCHBOX - asdfdgxdg, 
line2=DevlId - 896Settings: range=1000', 
actions=, 
type=0, 
id=test_1

}];
arrayappend(response, hotspots);



response['layer'] = testme;
response['errorString']='ok'; 
response['morePages']='false';
response['errorCode']= '0'; 
response['nextPageKey']='null';

/cfscript



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335007
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: issues preserving the case of the key

2010-07-01 Thread Glyn Jackson

does not matter about this now this seems to work...


  obj['actions']=  [];
  arrayAppend(obj.actions, 'some value');  

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335010
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


JSON response need a little help

2010-06-30 Thread Glyn Jackson

Hi I am trying to create a JSON response it needs to be like the one below. I 
have created a CFC that returns a validate JSON response but not in the format 
needed I think I am not understanding something can anyone help? Thanks

Response needs to look like this

{hotspots: [
 {distance: 100, attribution: This is a test layer POI provider, 
  title: My layer - snowy4, 
  lon: 4884339, 
  imageURL: null, 
  line4: RADIOLIST-None,CustSlider-None, 
  line3: SEARCHBOX - asdfdgxdg, 
  line2: DevlId - 896Settings: range=1000, 
  actions: [], 
  lat: 52374544, 
  type: 0, 
  id: test_1},  
 {distance: 100, attribution: This is a test layer POI provider, 
  title: My layer - snowy4, 
  lon: 4887339, 
  imageURL: null, 
  line4: RADIOLIST-None,CustSlider-None, 
  line3: SEARCHBOX - asdfdgxdg, 
  line2: DevlId - 896Settings: range=1000, 
  actions: [], 
  lat: 52374544, 
  type: 0, 
  id: test_2}
 ], 
 layer: snowy4, 
 errorString: ok, 
 morePages: false, 
 errorCode: 0, 
 nextPageKey: null
 } 



My CFC 
cfscript
var response  = {} 
response.hotspots = {
distance ='100',
attribution=This is a test layer POI provider,
title= My layer - snowy4,
lon= 53.472696, 
imageURL='null',
line4= 'RADIOLIST-None,CustSlider-None', 
line3= 'SEARCHBOX - asdfdgxdg', 
line2= 'DevlId - 896Settings: range=1000', 
actions='', 
lat= '-2.261843', 
type='0', 
id='test_1'
};

response.layer = testme;
response.errorString='ok'; 
response.morePages='false';
response.errorCode= '0'; 
response.nextPageKey='null';

/cfscript


which gives me the JSON...

{
HOTSPOTS: {
TYPE: 0.0,
ATTRIBUTION: This is a test layer POI provider,
LINE2: DevlId - 896Settings: range=1000,
TITLE: My layer - snowy4,
LINE4: RADIOLIST-None,CustSlider-None,
LAT: 5.2374544E7,
ACTIONS: ,
IMAGEURL: null,
LINE3: SEARCHBOX - asdfdgxdg,
LON: 4884339.0,
ID: test_1,
DISTANCE: 100.0
},
ERRORSTRING: ok,
NEXTPAGEKEY: null,
LAYER: testme,
MOREPAGES: false,
ERRORCODE: 0.0
}

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334957
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: JSON response need a little help

2010-06-30 Thread Glyn Jackson

simply things! thanks that is something I missed yes. one last thing looking at 
what they want back it seems that 'hotspots' needs to be an array can you do 
implicit  Arrays in CF like this would this not give me an error? 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334959
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: JSON response need a little help

2010-06-30 Thread Glyn Jackson

cool so something like this would work?...

response['hotspots'] = [{
distance ='100',
attribution=This is a test layer POI provider,
title= My layer - snowy4,
lon= 53.472696,
lat= '-2.261843',  
imageURL='null',
line4= 'RADIOLIST-None,CustSlider-None', 
line3= 'SEARCHBOX - asdfdgxdg', 
line2= 'DevlId - 896Settings: range=1000', 
actions='', 
type='0', 
id='test_1'

}];



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334961
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


array help how do I do this?

2010-06-30 Thread Glyn Jackson

can anyone tell me what I am doing wrong here as as the hotspots does not seem 
to like this array i.e. the web service responses back Required field 'title' 
etc for all fields 

cfscript
var response  = StructNew(); 



response['hotspots'] = [

{

hotspots.distance ='100',
attribution=This is a test layer POI provider,
title= My layer - snowy4,
lon= 53.472696,
lat= '-2.261843',  
imageURL='null',
line4= 'RADIOLIST-None,CustSlider-None', 
line3= 'SEARCHBOX - asdfdgxdg', 
line2= 'DevlId - 896Settings: range=1000', 
actions='', 
type='0', 
id='test_1'

}



];



response['layer'] = genciamedialtd;
response['errorString']='ok'; 
response['morePages']='false';
response['errorCode']= '0'; 
response['nextPageKey']='null';

/cfscript 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334963
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: array help how do I do this?

2010-06-30 Thread Glyn Jackson

not an array issues must be to do with the upper-case conversion again, how do 
i get around that with... 

response['hotspots'] = [

{

distance =100,
attribution=This is a test layer POI provider,
title= My layer - snowy4,
lon= 53.472696,
lat=-2.261843,  
imageURL=null,
line4=RADIOLIST-None,CustSlider-None, 
line3=SEARCHBOX - asdfdgxdg, 
line2=DevlId - 896Settings: range=1000', 
actions=, 
type=0, 
id=test_1

} 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334965
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Gudies on how to create a Webservice and Security in Adobe ColdFusion 9? Please :)

2010-06-21 Thread Glyn Jackson

Looking for some advice on which method is best for the following scenario...

My clients 99% .NET guys. Myself about 50% now. I have been asked to maybe 
create a new web service in ColdFusion that allows other members of our team 
and our clients (none CF'ers) to integrate using .NET or any another language 
they feel fit. they don't have access to our servers so everything will be over 
HTTP(S) protocol. The service needs to allow them to do basic CRUD ON our own 
CF CMS and access our exchange calender currently done via CF also. again they 
are not on the same server or even in the same part of the world sometimes. as 
we have a lot invested in CF the webservice needs to be in CF  

So I want to know the best way forward in terms of a webservice, basic html 
posts? 
how would you open this up? 
what about security? how do I restrict others from acccess this as it needs to 
be open over https?

I just need to be pointed in the right direction with this, learn and read a 
few books. I have integrated with many services but never created one of my own 
in CF.

I have chosen to use the following

ColdFusion 9 Enterprise running on IIS7
ColdBox M5 (as we love modules)
exchange is accessed using cfexchnage tags this data needs to be returned as a 
service also.

Thanks in advance for any comments and recommendations. 
   

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334680
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Gudies on how to create a Webservice and Security in Adobe ColdFusion 9? Please :)

2010-06-21 Thread Glyn Jackson

Hi thanks, some very good advice on security :0. I just wanted to make sure I 
was not missing something here. will do more research but thanks. any other 
comments welcome   

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334684
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


cfexchangeConnection

2010-06-16 Thread Glyn Jackson

5 years of CF and this is the first time I have been asked to do something with 
MS exchange and CF. not being 100% if its possible with cfexchange tags can 
someone thats used them answer the following questionsthanks

My client has his exchanged server on a hosted server and I have CF on a server 
in another part of the world. I take it by using cfexchangeConnection and the 
IP address of a hosted exchange server CF will not have an issue  (i understand 
WebDav access needs to be configured in IIS for the exchange server).  

this is what I want to do if anyone can see any issues please let me know...

I will be using CF to query calender information for a user (I will have the 
login credentials)

the exchange server sits on on my clients hosted server not ours

i need to query free dates, times and book appointments in blocks of 15 mins 
and add this back  to outlook
  

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334608
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


CF9 threading issues that were not issues on CF8?

2010-06-10 Thread Glyn Jackson

Having a strange issue since we upgraded our server from CF8 standard to CF9 
Enterprise. if any one has any idea I would be very grateful :) 

Since this upgrade a number of sites using the ColdFusion with the ColdSpring 
framework have been acting strange. which ever CB site gets loaded first gets 
cached  and all sites use its config, so the other sites have the wrong DNS 
details and setting (setting which don't belong to them). 

now this did not happen before the upgrade and I always var my stuff and there 
should not be any threading issues, and if there was no issues before the 
upgrade how is this now happening?

I have a  coldbox/system mappings in CF admin

any other setting I should know about, I have not changed any setting noticed 
we have sandbox box now and its turned off would this be an issue?



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334460
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: CF9 threading issues that were not issues on CF8?

2010-06-10 Thread Glyn Jackson

very interesting, cache web server paths was not ticked, however component 
cache was, I unticking this everything came back to life! thanks Sean I was 
hoping you would answer this one.

PS Luis how come you have closed your forum, did I miss something?

 I responded on the ColdBox list and suggested looking at Server
 Settings  Caching  Cache web server paths to make sure it's
 unchecked (I believe it's checked by default?).
 
 Sean
 
 On Thu, Jun 10, 2010 at 11:32 AM, Glyn Jackson
 glyn.jack...@newebia.co.uk wrote:
 
  Having a strange issue since we upgraded our server from CF8 
 standard to CF9 Enterprise. if any one has any idea I would be very 
 grateful :)
 
  Since this upgrade a number of sites using the ColdFusion with the 
 ColdSpring framework have been acting strange. which ever CB site gets 
 loaded first gets cached  and all sites use its config, so the other 
 sites have the wrong DNS details and setting (setting which don't 
 belong to them).
 
  now this did not happen before the upgrade and I always var my stuff 
 and there should not be any threading issues, and if there was no 
 issues before the upgrade how is this now happening?
 
  I have a  coldbox/system mappings in CF admin
 
  any other setting I should know about, I have not changed any 
 setting noticed we have sandbox box now and its turned off would this 
 be an 
issu

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334465
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


reverse engineer PHP to CF

2010-03-29 Thread Glyn Jackson

I no nothing about PHP. can any one reverse engineer this following in CF?

 ?



switch($_REQUEST['op']){

 case 'load':
   
   
$ff=join('',file(stripslashes($_REQUEST['reportname']).'.'.$_REQUEST['reportid'].'_sql'));
   echo $ff;
 break;

 case 'save':
   $querytosave=stripslashes($_REQUEST['querytosave']);
   $fd=fopen($_REQUEST['reportname'].'.'.$_REQUEST['reportid'].'_sql','w');
   fputs($fd,$querytosave);
   fclose($fd); 
   echo $_REQUEST['reportname']. saved; 
 break;
  
 case 'list':
?
  ul class='treeview' id='treeview_?echo $_REQUEST['reportid'];?'
li class='list'Saved sql files
ul
?
if ($dh = opendir('./')) {
while (($filenm = readdir($dh))) {
if(strstr($filenm,$_REQUEST['reportid'].'_sql')){
 $parts = explode('.',$filenm); 
 echo li class='item'.$parts[0]./li;
  
}
}
closedir($dh);
}
?
/ul
/li
  /ul  

?  
 break; 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332405
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: reverse engineer PHP to CF

2010-03-29 Thread Glyn Jackson

Thank yes I have made a start and got below dont understand this line tho...

 case 'load':
   
   
$ff=join('',file(stripslashes($_REQUEST['reportname']).'.'.$_REQUEST['reportid'].'_sql'));
   echo $ff;
 break;



 cfset path = ExpandPath(/)
 cfdirectory action=list directory=#path# name=dirQuery 
filter=*.9000_sql

 

 
  cfdump var=#reportid#
 
 cfswitch expression=#op# 
  cfcase value=load 

  /cfcase 
  
  cfcase value=save 

  /cfcase 
  
  cfcase value=list 
  cfoutput
   ul class='treeview' id='treeview_#reportid#'
li class='list'Saved Reports
ul
cfloop query=dirQuery 
li class='item'#Replace(#dirQuery.name#,.9000_sql,  )#/li   
/cfloop 
/ul
/li
  /ul  
  /cfoutput
  /cfcase 
 
 
 
   
cfdefaultcase 
/cfdefaultcase 
 /cfswitch 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332410
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: reverse engineer PHP to CF

2010-03-29 Thread Glyn Jackson

@ Jason 
sorry yes just spotted your post, thanks

don't seem to get reportFile on save any idea why not?



I don't know PHP either, but this looks pretty straightforward.

I'm assuming that the request in this case is a form post, and I don't 
know if the save action should do an APPEND or a WRITE (I'm guessing it's 
a WRITE), but this looks close to me.

cfset reportFile = expandPath(.)  /  form.reportName  .  
form.reportID  _sql /
cfswitch expression=#form.op#
cfcase value=load
cffile action=READ file=#reportFile# variable=ff /
cfoutput#ff#/cfoutput
/cfcase
cfcase value=save
cfset qry = form.queryToSave /
cffile action=WRITE file=#reportFile# output=#qry# 
nameconflict=OVERWRITE /
cfoutput#form.reportName#/cfoutput saved ...
/cfcase
cfcase value=list
cfdirectory action=LIST directory=#expandPath('.')# name=files 
/
cfsavecontent variable=out
cfoutput
ul class=treeview id=treeview_#form.reportID#
li class=list
Saved sql files
ul
cfloop query=files
cfif right(name, 4) is _sql
li class=item
#listFirst(name, .)#
/li
/cfif
/cfloop
/ul
/li
/ul
/cfoutput
/cfsavecontent
/cfcase
/cfswitch 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332411
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: reverse engineer PHP to CF

2010-03-29 Thread Glyn Jackson

cool final is below...

cfparam name=reportName default= /
cfset reportFile = expandPath(/Powerbase)  /  reportName  .  
reportID  _sql / 
 
 cfswitch expression=#op# 
  cfcase value=load 
   cffile action=READ file=#reportFile# variable=ff / 
   cfoutput#ff#/cfoutput 
  /cfcase 
  
  cfcase value=save  
cfoutput  
cfdump var=#form#
 cfset qry = #form.queryToSave# / 
 cffile action=WRITE file=#reportFile# output=#qry# 
nameconflict=OVERWRITE / 
 cfoutput#reportName#/cfoutput saved ... 
 /cfoutput 
  /cfcase 
  
  cfcase value=list 
  
   cfdirectory action=LIST directory=#expandPath('/Powerbase')# 
name=files / 
   cfoutput 
   ul class=treeview id=treeview_#reportID# 
   li class=listSaved sql files 
 ul 
cfloop query=files 
  cfif right(name, 4) is _sql 
  li class=item#listFirst(name, .)#/li  
   
  /cfif   
 /cfloop
 /ul 
 /li   
 /ul 
/cfoutput 
  /cfcase 
 
 
 
   
cfdefaultcase 
/cfdefaultcase 
 /cfswitch 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332412
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: reverse engineer PHP to CF

2010-03-29 Thread Glyn Jackson

cool 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332415
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: CFDIV does not work in IE8 and any one review domain?

2010-03-19 Thread Glyn Jackson

cfdiv id=questionWindow  should be 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331890
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


CFDIV does not work in IE8 and any one review domain?

2010-03-18 Thread Glyn Jackson

Hi could someone take a look at the following domain...
http://www.she-says.net/

In Firefox, Chrome etc the cfdiv works however in IE 8 when you click submit, 
read answer then it brakes coming back i.e. does not display.

any reason why this happens in IE8?

code below

cfajaximport tags=cfform,cfdiv
cfajaxproxy cfc=#rc.locColdBoxProxy# jsclassname=cbProxy
cfdiv id=questionWindow

cfscript
myPlugin = getPlugin(plugin=fieldThis,customPlugin=true);
myPlugin.setType(type=rc.questionBean.gettype_id());
myPlugin.setAnswers(answers=rc.questionBean.getquestion_answers());
myPlugin.setCols(cols=rc.questionBean.getquestion_column());
/cfscript


cfform name=question id=question method=post 
action=#getSetting('sesBaseURL')#/survey/saveQuestion.cfm 


 

cfoutputbr/
h3b#rc.LookupQuestionBean.getquestion_order()#)/b 
#rc.questionBean.getquestion_text()#/h3
/cfoutput

cfoutput#myPlugin.renderIt()#/cfoutput
cfinput type=hidden name=survey_id 
value=#rc.surveyBean.getSurvey_id()# /
cfinput type=hidden name=question_id 
value=#rc.questionBean.getQuestion_id()# /
cfinput type=hidden name=sch_id 
value=#rc.schoolBean.getsch_id()# /
cfinput type=hidden name=startLayout value=false /
input type=submit id=questionSubmit class=questionSubmit value= 
/cfform


/cfdiv 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331857
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Code Review?

2010-02-11 Thread Glyn Jackson

yep the error was because of a users firewall not sending the http_referer so 
the value was - which mid function does not like. 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330583
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Code Review?

2010-02-10 Thread Glyn Jackson

I have been asked to looked as some code within this page is below. I have no 
idea what its doing however I was told its needed but keeps giving me errors. 
is your opinion why does this exists?

cfparam name=referer_itemID default=0
cfparam name=referer_popupID default=0
cfif len(cgi.HTTP_REFERER)
!--- Item ID ---
cfset begin_itemID = find(item_id:,cgi.HTTP_REFERER) + 8 /
cfif begin_itemID
cfset end_itemID = find(/,cgi.HTTP_REFERER,begin_itemID) /
cfset referer_itemID = 
mid(cgi.HTTP_REFERER,begin_itemID,end_itemID-begin_itemID) /
/cfif 


!--- MP ID ---
cfset begin_mpID = find(mp_id:,cgi.HTTP_REFERER) + 6 /
cfif begin_mpID
cfset end_mpID = find(/,cgi.HTTP_REFERER,begin_mpID) /
cfset referer_popupID = 
mid(cgi.HTTP_REFERER,begin_mpID,end_mpID-begin_mpID) /
/cfif

cfif not isNumeric(referer_itemID)
cfset referer_itemID = 0 /
/cfif
cfif not isNumeric(referer_popupID)
cfset referer_popupID = 0 /
/cfif

cfparam name=livewireLaunch default=0

cfif livewireLaunch
cfset referer_itemID = -1 /
/cfif
/cfif 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330531
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


ColdFusion debug stored procedures

2010-01-08 Thread Glyn Jackson

I have always had problem with the way ColdFusion reports errors in stored 
procedures and I was wondering how other CF’ers go about debugging the same 
sort of errors (without costly software).

For example, the following ColdFusion error is generated on a stored 
procedure...
Application Execution Exception
Error Type: Database : n/a
Error Messages: Invalid data '' for CFSQLTYPE CF_SQL_INTEGER.

I know what the error means but I have no way of knowing which one of 
cfprocparam fields its having problems with. ColdFusion does report a line 
number as always but it's the line end of the stored procedure not the actual 
cfprocparam line which it's failing on.

This is only really an issue for me when I have a big procedure with lot of 
cfprocparam as I have to test each one at a time to find which has the invalid 
value.

Looking forward to your comments

Thanks


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329491
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Web Service SSO

2010-01-08 Thread Glyn Jackson

I need to know where I start for the following I have been given a Web 
Service SSO URL test against, I need to open a new window and send login 
details accross. all i have is the xml.

my question is in CF how to i go about this? CFHTTP, xml etc? below is what I 
hev been given

Envelope Version=2.0 OrganisationUnitId=05B09E12 StaffId=123
  OrganisationUnitHierarchy
OrganisationUnit OrganisationUnitId=45C7CAF Name=test Command=Write
  OrganisationUnit OrganisationUnitId=65A362ABBD63 Name=Reading 
Investments Command=Write /
/OrganisationUnit
  /OrganisationUnitHierarchy
  StaffCollection
Staff OrganisationUnitId=BBD63 
StaffId=29C3D595-9403-4E3A-B0F4-9D29EEA94D47 FirstName=Test 
LastName=Adviser Email=t...@something.com
/Staff
  /StaffCollection
/Envelope 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329494
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


detect multiples?

2009-12-11 Thread Glyn Jackson

I have a loop which counts, I need to detect multiples of 6 i.e 

loop count
is it a  multiple of 6? true
else do nothing

is there a tag that does this? 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329082
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


convert this cfscript back to tag?

2009-12-10 Thread Glyn Jackson

Hi all, 

could someone convert this cfscript back to tag?


for(i=1;i lte listlen(#form.whatToUpdate#,,);i++){
  tempVal = #listgetat(form.whatToUpdate,i,,)#;
  form.ID = #tempVal#; //Option ID
  form.newRank = form[rank_  #tempVal#];
  
}


thanks 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329037
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


fusebox layout adding to csv?

2009-12-04 Thread Glyn Jackson

Hi I have an old fusebox app i am working on. it outputs a csv file with data 
however the html (layout) is also getting added to the csv? anyone know why.

cfsetting enablecfoutputonly=yes
cfscript
function cleanField(sField){
sField = (replace(sField,,,;,All));
sField = (replace(sField,chr(13)chr(10),;,All));
sField = (replace(sField,chr(13),;,All));
sField = (replace(sField,chr(10),;,All));
sField = (replace(sField,;;,;,All));
return sField;
}
/cfscript
cfsilent


cfset variables.columns = ArrayToList( 
Evaluate(#variables.thisQueryName#.getColumnNames()) )
cfset csv_TextBuffer = createObject(java,java.lang.StringBuffer).init()
cfset csv_TextBuffer.append(variables.columns  CHR(13))
cfloop query=#variables.thisQueryName#
cfset variables.record =  /
cfloop list=#variables.columns# delimiters=, index=colName
cfset variables.colVal = 
cleanField(Evaluate(#variables.thisQueryName#[variables.colName]))
#variables.colName#=#variables.colVal#,
cfset variables.record = variables.record  
#variables.colVal#,
/cfloop
cfset csv_TextBuffer.append( variables.record  CHR(13)) /
/cfloop
cfdump var=#variables.thisQueryName#
cfheader name=Content-Disposition value=attachment; 
filename=#request.filePreFix#-FF2009-#fusebox.fuseaction#.csv
cfcontent reset=true type=text/csv
/cfsilent

cfoutput#csv_TextBuffer.toString()#/cfoutput


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328834
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


AJAX CFGRID will not sort by column?

2009-11-03 Thread Glyn Jackson

Can anyone spot what is wrong here?
 
my AJAX grid IS working but when I try and sort the columns (by clicking in the 
grid) I get the following error... 

Error Executing Database Query.
:http: Invoking CFC: /admin/coldboxproxy.cfc , function: getAllproducts , 
arguments: {page:1,pageSize:10,gridsortcolumn:NAME,gridsortdir:ASC}

I am sure this is something just not getting passed to my service layer 
correctly.

the following is the code, sorry for the long post and help is welcome. thanks 


--view 

cfgrid name=Allproducts
 format=html
 pagesize=15
 striperows=yes
 selectmode=edit
 width=auto 
 height=auto
 
 bind=cfc:admin.coldboxproxy.getAllproducts({cfgridpage},
  {cfgridpagesize},
  {cfgridsortcolumn},
  {cfgridsortdirection})
onchange=cfc:admin.coldboxproxy.editProducts({cfgridaction},
 {cfgridrow},
 {cfgridchanged})
  cfgridcolumn name=prodId display=false select=no width=50 /
  cfgridcolumn name=productCode header=Item Code width=90/
  cfgridcolumn name=name header=Product Name width=233 /
  cfgridcolumn name=price header=Price width=65 type=numeric/
  cfgridcolumn name=salePrice header=Sale width=65 type=numeric /
  cfgridcolumn name=retailPrice header=RRP width=65 type=numeric /
  cfgridcolumn name=featured header=Featured values = off, on width=80 
/
  cfgridcolumn name=active header=Active values = on, off width=60  /
  cfgridcolumn name=weight display=no header=(kg) width=50 
type=numeric numberformat=99.99 /
  cfgridcolumn name=minQuantity header=Min Qty width=60 display=no 
values = 1,2,3,4,5,6,7,8,9,10/
  cfgridcolumn name=tax header=VAT width=40 numberformat=99..99 
display=no /
  cfgridcolumn name=catname header=Category width=220 select=no/
/cfgrid
/cfform



--coldboxproxy.cfc
cffunction name=getAllproducts output=false access=remote 
returntype=any hint=Process a remote call and return data/objects back.
  cfargument name=page type=numeric required=yes
  cfargument name=pageSize type=numeric required=yes
  cfargument name=gridsortcolumn type=string required=no default=
  cfargument name=gridsortdir type=string required=no default=

cfset var results = 
cfset results = 
getBean(storeService).getAJAXProducts(page=#arguments.page#,

 pageSize=#arguments.pageSize#,

 
gridsortcolumn=#arguments.gridsortcolumn#,

 gridsortdir=#arguments.gridsortdir#) /

!--- Convert Query for Paging ---
cfreturn QueryConvertForGrid(results,page,pageSize)
/cffunction 



--service layer: storeService

!---Get Product Grid AJAX---
cffunction name=getAJAXProducts access=public returntype=any 
output=false
  cfargument name=page type=numeric required=yes
  cfargument name=pageSize type=numeric required=yes
  cfargument name=gridsortcolumn type=string required=no default=
  cfargument name=gridsortdir type=string required=no default=
 cfscript
   var results = '';
   results = variables.productGateway.getAJAXProducts(page=#arguments.page#,

 pageSize=#arguments.pageSize#,

 
gridsortcolumn=#arguments.gridsortcolumn#,

 gridsortdir=#arguments.gridsortdir#);
 /cfscript
 cfreturn results
/cffunction 


--gateway/DAO


cffunction name=gridProducts access=remote returntype=struct 
verifyclient=yes output=no
  cfargument name=page type=numeric required=yes
  cfargument name=pageSize type=numeric required=yes
  cfargument name=gridsortcolumn type=string required=no default=
  cfargument name=gridsortdir type=string required=no default=
  !--- Local variables ---
  cfset var dataquery=
  !--- Get data ---
  cfquery name=dataquery  datasource=demostoreDS 
  SELECT p.prodid, p.name, '£' + CONVERT(varchar(12), p.price , 1) AS 
price, p.productCode, 
  p.salePrice, p.retailPrice, p.featured, p.active, p.weight, 
p.minQuantity, p.tax, p.catid, c.name as catName
  FROM products as p
  INNER JOIN categories c ON c.catid = p.catid
  cfif ARGUMENTS.gridsortcolumn NEQ 
 and ARGUMENTS.gridsortdir NEQ 
 ORDER BY cfqueryparam cfsqltype=cf_sql_varchar 

Re: AJAX CFGRID will not sort by column?

2009-11-03 Thread Glyn Jackson

Found the issues on this line...

 ORDER BY cfqueryparam cfsqltype=cf_sql_varchar 
value=#ARGUMENTS.gridsortcolumn# cfqueryparam cfsqltype=cf_sql_varchar 
value=#ARGUMENTS.gridsortdir#

it seems to work without the cfqueryparam. can anyone tell me why this is the 
case? 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327949
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: AJAX CFGRID will not sort by column?

2009-11-03 Thread Glyn Jackson

Thanks Ray, seems strange, I did not know that. 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327951
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


REReplace Statment Help

2009-10-21 Thread Glyn Jackson

I am just going over some old code, I found the following...

productPageName = Replace(#FORM.pageName#, ,-,All);
productPageName = REReplace(#productPageName#,[.*+?^${}()|[\]/\\],,All);

its seems like its create a page name but removed spaces and special characters 
i.e. this page! becomes this-page

cumbersome, any better ways of doing this, maybe one line of code and not two, 
or a function about this does this?

Thanks

Glyn 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327438
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: REReplace Statment Help

2009-10-21 Thread Glyn Jackson

Makes sense, thanks you. 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327452
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


ColdFusion Server keeps falling down!

2009-10-12 Thread Glyn Jackson

We have recently moved to a new virtual server, since the move we have been 
having issues with ColdFusion almost everyday. What seems random, ColdFusion 
slows down and then stops responding all together. I then try and restart the 
service and it errors stating CF cannot be stopped as it's busy or something. I 
wait for a few minutes and after a while it allows me to restart and everything 
is ok for a few days till it happens again.

On the old server we did not have these intermittent issues in fact over a year 
CF went down just once. Nothing has changed code wise, its still the same app. 
I have installed FusionReactor and it all seems ok, the only few things I have 
had from the crash protection is below, but I really don't think this is the 
issue as this is the same code running as the old server which was much less 
powerful then our new server.

I have installed the lasted hot fix, java and the server is fully patched. 
aything i think is relevent is below, anyone got any ideas to what could be 
doing this...?

:)

Thanks
-
details and settings
--
Version:  8,0,1,195765  
Edition: Standard  
Operating System: Windows 2003  
Java Version: 1.6.0_14  
Java Home: C:\Program Files\Java\jdk1.6.0_14\jre  
Java VM Version:  14.0-b16  

Simultaneous request limit 50 
CFThread Pool Size 10   
Maximum number of report threads 1   
Maximum number of running JRun threads 50   
Maximum number of queued JRun threads 1000  

Java and JVM
Java virtual machine path C:/Program Files/Java/jdk1.6.0_14/jre  
Initial memory size MB
Maximum memory size 512 MB 


patches: 
;C:/ColdFusion8/runtime/../lib/updates/hf801-1875.jar;  
C:/ColdFusion8/runtime/../lib/updates/hf801-1878.jar;  
C:/ColdFusion8/runtime/../lib/updates/hf801-71634.jar;  
C:/ColdFusion8/runtime/../lib/updates/chf8010003.jar;



FR Reports:

The following alert was generated at Mon Oct 12 19:39:46 BST 2009.

[Notify] Crash Protection - Memory Shortage Alert: Actual value: 4% (20MB), 
Threshold value: 5% (24MB)

Current (Triggering) Request:

 Request ID: 8332
 Request URL: http://www.safe4sure.co.uk/index.cfm
 Status: PENDING
 Started (Milliseconds): 1255372786347
 Started (Date/Time): 2009-10-12 19:39:46.347
 Thread ID: jrpp-130
 Client IP Address: 82.33.91.92
 Request Method: GET
 Execution Time (ms): 0
 Used Memory (percentage): 95
 Max Memory (KB): 504896
 Used Memory (KB): 483733
 Total Memory (KB): 496576
 Free Memory (KB): 12842





 


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327099
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: ColdFusion Server keeps falling down!

2009-10-12 Thread Glyn Jackson

Old server has gone, what figures should we be looking at? 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327102
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Whats wrong with this SQL?

2009-10-03 Thread Glyn Jackson

Any reason why below does now work? no errors it just does not do what it 
states.
it should look at all valueId's in the database and if its not in the list 
delete it, simple, right, so why does it not work?

DELETE FROM options 
WHERE valueId NOT IN  
cfqueryparam value=#arguments.list# cfsqltype=cf_sql_varchar / 

PS I dont have the option of using a stored procedure so it must be done at the 
layer above 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326876
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Whats wrong with this SQL?

2009-10-03 Thread Glyn Jackson

PS the list looks like...

1,2,3,4,5,6 etc 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326877
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Whats wrong with this SQL?

2009-10-03 Thread Glyn Jackson

simple when you know how. Thank you! 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326879
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


can I do the following entirety in script? (CF8)

2009-10-02 Thread Glyn Jackson

Hi, 

cfscript (ColdFusion 8) can I do the following entirety in script?


cfloop index=i list=#listToUpdate# DELIMITERS=, 

value = #i#

/cfloop

Thanks 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326834
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


CFFileServlet/_cf_image why?

2009-10-02 Thread Glyn Jackson

I am using CFIMAGE do resize images and use write to browser to view them I 
have noticed that when I view the image the path is something like this...

/CFFileServlet/_cf_image/_cfimg-x

how long does it say in this directory for? does it delete them when its done? 
I can still navigate to the URL and view the image after the request!!! why 
does it do this? does it clean its self up?

Thanks 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326844
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Coldbox plugins vs interceptors for user management

2009-10-02 Thread Glyn Jackson

Interceptors make requests in specific execution points in which it can 
process, pre-process, post-process and redirect requests, perfect for security! 
Think of interceptors as listeners to any request in your application.

http://ortus.svnrepository.com/coldbox/trac.cgi/wiki/cbInterceptorsGuide

A plug-in could make use of an interceptor or it could be a whole security 
plug-in that does many things.

I think it really depends on what your tiring to achieve, does it need to be 
reusable etc. 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326845
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: CFFileServlet/_cf_image why?

2009-10-02 Thread Glyn Jackson

Are you sure it deletes it afterwards I.E
http://www.safe4sure.co.uk/CFFileServlet/_cf_image/_cfimg-7294859208909333435.PNG
its still there?

do you set how CF treats these files in CFadmin? 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326861
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: can I do the following entirety in script? (CF8)

2009-10-02 Thread Glyn Jackson

barneyb thats interesting thanks


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326862
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: CFFileServlet/_cf_image why?

2009-10-02 Thread Glyn Jackson

O went back 5 mins later to that URL and got...

404
Not Found

so there must be some sort of time frame before its deleted, anyone know what 
this is? 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326863
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: CFFileServlet/_cf_image why?

2009-10-02 Thread Glyn Jackson

LOL, set myself up for that one :) 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326866
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: How to Handle Objects when Doing Several Updates and Once?

2009-09-29 Thread Glyn Jackson

Thanks you, yes thats the way I was thinking, makes sense. 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326761
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


How to Handle Objects when Doing Several Updates and Once?

2009-09-28 Thread Glyn Jackson

I am trying to work with objects and better understand how to use them. So far 
it has been straight forward when updating/creating/deleting one record at a 
time. But I now need to update many records at once is getting a bit tricky.

I simplified version of what I am doing so far is below...


I create an object...
var productBean = variables.storeService.createProductBean(); //Create Product 
Bean

Push the data into it using this very useful plugin in CB
getPlugin('beanFactory').populateBean(productBean);//The Magic Bean Machine

and then simply update my DAO via my service like so
variables.storeService.saveProduct(productBean)

my question
However I am now faced with a situation where I need update several records at 
the same time. So my question is how to I handle this with an object? do I have 
to repopulate my object in a loop and then do the database updates one at a 
time? I can see this causing many issues what if the write fails halfway etc, 
and it means writing some sort of array to store all the data while its being 
looped over, sounds cumbersome!

Below is how I would have done the update before objects in a procedural manner 
if you get what I mean...

cfloop from=1 to=#FORM.qty# index=i
cfscript
value = ;
if (i IS 1) {
value = #FORM.value1#;
}
else if (i IS 2) {
value = #FORM.value2#;
}
else if (i IS 3) {
value = #FORM.value3#;
}
else if (i IS 4) {
value = #FORM.value4#;
}
else if (i IS 5) {
value = #FORM.value5#;
}
else if (i IS 6) {
value = #FORM.value6#;
}
else if (i IS 7) {
value = #FORM.value7#;
}
/cfscript

cfif NOT value IS 
cfquery name=addValue datasource=dbSource
INSERT INTO optionValues (value, optionId) VALUES ('#value#', '#optionId#')
/cfquery
/cfif
cfset i = i + 1
/cfloop
cfset success = TRUE  


how do other people do this sort of update using objects, any example, blog 
posts, ect would be very useful. Thanks.

:)


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326689
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Its Friday please dont be mad! - checkbox which corresponded with the value?

2009-09-25 Thread Glyn Jackson

Going a bit mad! I should know how to do this but my brain is not working 
today

when the form below is submitted if the checkbox is checked I want to update 
the option on the valueId (which is a hidden field) and keep looping all the 
results only updating option have is ticked. however once submitted how will I 
know what checkbox ticked corresponded with what valueId?


cfoutput query=rc.option group=name
  tr class=tableBG2
td class=borderleftnbsp;/td
tdb#rc.option.name#/b/td
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
  /tr
  
 cfoutput
 cfset current = 
storeService.getCurrentOptions(prodID=#rc.ProdcutBean.getprodId()#,valueID=#rc.option.valueID#)
!--- cfdump var=#current#---
  tr
td class=borderleftnbsp; input type=checkbox cfif current.idexists 
eq 1 checked=checked /cfif //td
tdnbsp;nbsp;nbsp;nbsp;#rc.option.value#/td
td+ pound; input value=#NumberFormat(current.optionPrice,99.99)# 
type=text name=optionPrice size=3 / extra/td
tdnbsp;/td
tdnbsp;/td
  /tr
  input type=hidden value=valueId name=#rc.option.valueId# /
 /cfoutput  
  
  
/cfoutput 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326630
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Hot Fixes Explained

2009-09-08 Thread Glyn Jackson

thanks 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326081
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Hot Fixes Explained

2009-09-08 Thread Glyn Jackson

Hi Tom how are you?

That makes sense, its a mess! anyhow spent the time doing a bit of research 
this is what I have installed...

chf8010003.jar - latest hotfix
hf801-71634.jar- a fix for CFLAYOUT which came with new CSS so cannot be 
deleted 
hf801-1875.jar - JRun Security Hotfixes not cumulative 
hf801-71634.jar- not cumulative

any others I should know about? I still have a rendering issue with CFMENU 
which I assumed chf8010003.jar would fix but no joy :) I think I need to edit 
the CSS from CF's yahoo lib or report a but




  

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326085
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Hot Fixes Explained

2009-09-07 Thread Glyn Jackson

After installing the new hotfix chf8010002.jar 

in my libs/update folder I have the following...

chf8010002.jar
hf801-1875.jar
hf801-1878.jar
hf801-71634.jar

now it states in cfadmin the update level is hf801-1875.jar (is this the case? 
what about the chf8010002 I just installed?) in the tech notes it states to 
delete other hots fixes. 

my question is, does it mean delete only other Cumulative Hot Fixes I dont want 
to delete these do I?

hf801-1875.jar
hf801-1878.jar
hf801-71634.jar

as these are not cumulative right? In fact one of them had CSS files I have to 
update to fix a CFGRID rendering issue a while, back

Thanks


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326069
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


CF TAG that allow me to dump server specs?

2009-09-06 Thread Glyn Jackson

Hi All,

Is there a CF tag I don't know about which will allow me to dump my server 
specs like memory, processor speed etc

Thanks
 :)


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326053
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: CF TAG that allow me to dump server specs?

2009-09-06 Thread Glyn Jackson

Thanks 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326062
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


CFMENU - message submenu collapsed. click to expand submenu

2009-08-29 Thread Glyn Jackson

could someone cut and paste the the code below and tell me if you see the 
message
submenu collapsed. click to expand submenu 
under products items.

I dont remember CFMENU having this message before and I cannot get rid of it!

running CF 8.01



cfmenu bgColor=##c0c0c0
cfmenuitem display=Adobe href=http://www.adobe.com; /
cfmenuitem display=Products
cfmenuitem display=ColdFusion 
href=http://www.adobe.com/go/coldfusion; /
cfmenuitem display=Flash href=http://www.adobe.com/go/flash; /
/cfmenuitem
/cfmenu



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325846
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: CFMENU - message submenu collapsed. click to expand submenu

2009-08-29 Thread Glyn Jackson

very strange. it is def 100% being generated by CFMENU tag for me! 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325849
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: CFMENU - message submenu collapsed. click to expand submenu

2009-08-29 Thread Glyn Jackson

you can see it happening here

http://demo.salesmaxx.co.uk/test.cfm

only code on the page is

cfmenu bgColor=##c0c0c0
cfmenuitem display=Adobe href=http://www.adobe.com; /
cfmenuitem display=Products
cfmenuitem display=ColdFusion 
href=http://www.adobe.com/go/coldfusion; /
cfmenuitem display=Flash href=http://www.adobe.com/go/flash; /
/cfmenuitem
/cfmenu 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325851
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: submit one big form post of all tabs

2009-08-28 Thread Glyn Jackson

yes that would work but not with using includes with the tabs or source. the 
issue is that when you do it with an include it does not work due to CF 
thinking you dont have a completed form

Sorry I meant wrapping the whole set of tabs in 'form tags'  ... I
didn't mean to confuse you :)

-mark
 


Mark A. Kruger, CFG, MCSE
(402) 408-3733 ext 105
www.cfwebtools.com
www.coldfusionmuse.com
www.necfug.com

Glyn,

I have done this using cflayout and wrapping the whole set of tabs in from
tabs. What problems are you experiencing?

-mark
 


Mark A. Kruger, CFG, MCSE
(402) 408-3733 ext 105
www.cfwebtools.com
www.coldfusionmuse.com
www.necfug.com

someone must have done this before? using tab layout in CF8 had tabs with
just one form post submitting all data in all tabs at once? 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325817
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: submit one big form post of all tabs

2009-08-28 Thread Glyn Jackson

I see, never mind back to the drawing board. thanks. 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325823
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


cfinput type=datefield

2009-08-28 Thread Glyn Jackson

I am using CF8 and want to use  cfinput type=datefield but without cfinput 
does that make sense? ok I want to use ext popup calender for a input box but 
not via cfinput tag 

i.e.

input type=datefield

can I still use the library without cfinput? if so can soneone give me an 
example? 

Thanks 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325825
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: cfinput type=datefield

2009-08-28 Thread Glyn Jackson

I did try that but because I am using cflayout on the same page it all goes 
wrong coldfusion gets confused to which ext its using or should I sat the JS 
does. wondering it we can just yap into the ext1 JS bot use the paths or URL's 
that CF uses. 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325828
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: cfinput type=datefield

2009-08-28 Thread Glyn Jackson

Thanks Think I will try the jquery 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325833
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: submit one big form post of all tabs

2009-08-28 Thread Glyn Jackson

When you are using tabs with source it treats it as a page on its own so even 
if you include the form around the whole cflayout if you dont include the start 
and end cffrom tags again you will get a CF error, its the same with any thing 
you include in a tab layout using source or a bind 

i.e. the docs say If a file specified in the source attribute includes tags 
that use AJAX features, such as cfform, cfgrid, and cfpod, you must use the 
cfajaximport tag on the page that includes the cflayoutarea tag. For more 
information

this apply's the cffrom also. the error is simply because cf checks the 
included source pages see's that it missing the start and end CFFORM tags and 
errors.

 

I can't see why you wouldn't be able to. The tabs are an implementation 
of ExtJs 1.1, and I've done it with that. As long as the tab container 
is wrapped in your opening and closing form tags, and you aren't 
remotely populating the tab contents (via an ajax load) then it should 
be possible.

Steve Cutter Blades
Adobe Certified Professional
Advanced Macromedia ColdFusion MX 7 Developer

Co-Author of Learning Ext JS
http://www.packtpub.com/learning-ext-js/book
_
http://blog.cutterscrossing.com


On 8/28/2009 7:57 AM, Glyn Jackson wrote:
  I see, never mind back to the drawing board. thanks.

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325836
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


submit one big form post of all tabs

2009-08-25 Thread Glyn Jackson

I want to submit the data in all tabs as one big form post. this does not seem 
possible I had tried below and put my cfform tag around the whole cflayout but 
all i get now is he tag must be nested inside a cfform tag. which is not the 
case lol


cfoutputh1#Event.getValue('pageTitle','Please Fill In')#/h1/cfoutput
p*Required Field/p
cfform action=#getSetting('sesBaseURL')##Event.getValue('formURL','')# 
name=form id=form method=post
cflayout type=tab tabheight=400
cfloop index=i from=1 to=#ArrayLen(rc.tabs)#
 cflayoutarea title=#rc.tabs[i].title# selected=#rc.tabs[i].selected# 
name=#rc.tabs[i].name# 
 cfoutput#renderView('#rc.tabs[i].view#')#/cfoutput 
/cflayoutarea
/cfloop
/cflayout
a class=submit href=test onclick=document.form.submit();return 
false;spanLogin/span/a
/cfform 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325661
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: submit one big form post of all tabs

2009-08-25 Thread Glyn Jackson

someone must have done this before? using tab layout in CF8 had tabs with just 
one form post submitting all data in all tabs at once? 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325688
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: returning all table records ColdBox ColdSpring via an object?

2009-08-20 Thread Glyn Jackson

@ Judah McAuley

thanks very detailed response. its just a simple record set to display. So what 
your saying makes sense. 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325561
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: returning all table records ColdBox ColdSpring via an object?

2009-08-19 Thread Glyn Jackson

Thanks for the reply. reading my question back it did not make much sense, so 
you did well to work out what I was on about lol!
 
I'd go with a query unless you have a particular reason not to.

no reason, that would be the way I would normally do it, however if I wanted to 
try and keep this strict OO like I was wondering how this would play out. I can 
still access the service layer first(not server layer above lol) and the query 
directly but it seems to brake the rules of OO some what and I wondered how 
others do it. 

thanks for the link the site is down but will look at it when its back up.

Glyn 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325538
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


returning all table records ColdBox ColdSpring via an object?

2009-08-18 Thread Glyn Jackson

Confused about how I would go about returning all records from a table from my 
DAO?

this is how I would return a record with an ID (see below), however when 
returning all records needed for a cfloop i am not sure.

handler
 variables.adminUsersService.getUserByID(userBean); -- access service pass in 
my populated object

then to use it in my page
Welcome: #getPlugin(ioc).getBean(adminUsersService).getCurrentUser()#



my options are...

1)forget the bean as it only holds a set of data and have the service layer 
access the DAO and return a query, however downside cannot use getters!

2) use the object somehow to keep populating the data I need i.e. pass it in 
the server layer, server layer accesses the DAO passing in object, object is 
retuned populated object. --- not sure how to loop the data in a hander to 
keep population it until done? 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325527
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: ColdBox and ColdSpring Login

2009-08-16 Thread Glyn Jackson

Thanks Kevan
quote: user object would be stored in the session rather than just the username.

Interesting idea, thanks makes way more sense.  

PS, thank you for the link, just what I was looking for.

Glyn.

 if I should be do this all in my service, or should I come out again with
the username
 and run the bean.setUserSession() in the handler?
I'd keep everything behind the service (or even other objects beyond that)
and not put session related code in your handler.

I'd also keep session code out of the user object (if that is what
the setUserSession() function is doing). I would probably do something more
like:

if credentials are valid, then
session.user = userBean
endif

So your user object would be stored in the session rather than just the
username (if that's what you were planning).

Also have a look at
http://learn.objectorientedcoldfusion.org/wiki/Accessing_a_Users_Session_Data 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325483
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Illudium PU36, queryRowToStruct?

2009-08-16 Thread Glyn Jackson

Hi,

Thank you to everyone on house of fusion who has been very helpful so far with 
my stupid questions. I have another ;)
 
I was looking at some code I generated for a gateway by Illudium PU36. The read 
and update functions do not make any sense in that it does not have any return 
for me to get! However I noticed a function called queryRowToStruct I am 
assuming this has something to do with how I can return the query or access the 
query from my service layer, however this is a private function so my service 
layer cannot access it if this was true. I am just confused because without a 
way to return the query whats the point in these functions?

Are they wrong, or should I give them a return? or I am missing the purpose?

Thanks Glyn

-

!---Read---
cffunction name=readAdminUsers access=public output=false 
returntype=void
  cfargument name=adminusers type=salesMaxx.model.objects.adminusers 
required=true /
  cfset var qRead =  /
  cfset var strReturn = structNew() /
  cftry
cfquery name=qRead datasource=#variables.dsnBean.getname()# 
username=#variables.dsnBean.getusername()# 
password=#variables.dsnBean.getpassword()#

SELECT

adminId,

firstname,

surname,

email,

username,

password,

role,

lastLogin,

flag,

IP,

userLog,

createddatetime

FROMadminusers

WHERE   adminId = cfqueryparam 
value=#arguments.adminusers.getadminId()# CFSQLType=cf_sql_integer /

/cfquery
cfcatch type=database
  !--- leave the bean as is and set an empty query for the conditional 
logic below ---
  cfset qRead = queryNew(id) /
/cfcatch
  /cftry
  cfif qRead.recordCount
cfset strReturn = queryRowToStruct(qRead)
cfset arguments.adminusers.init(argumentCollection=strReturn)
  /cfif
/cffunction




cffunction name=queryRowToStruct access=private output=false 
returntype=struct

cfargument name=qry type=query required=true



cfscript

/**

 * Makes a row of a query into a structure.

 * 

 * @param query  The query to work with. 

 * @param rowRow number to check. Defaults to row 
1. 

 * @return Returns a structure. 

 * @author Nathan Dintenfass (nat...@changemedia.com) 

 * @version 1, December 11, 2001 

 */

//by default, do this to the first row of the query

var row = 1;

//a var for looping

var ii = 1;

//the cols to loop over

var cols = listToArray(qry.columnList);

//the struct to return

var stReturn = structnew();

//if there is a second argument, use that for the row 
number

if(arrayLen(arguments) GT 1)

row = arguments[2];

//loop over the cols and build the struct from the 
query row

for(ii = 1; ii lte arraylen(cols); ii = ii + 1){

stReturn[cols[ii]] = qry[cols[ii]][row];

}   

//return the struct

return stReturn;

/cfscript

/cffunction


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325484
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Illudium PU36, queryRowToStruct?

2009-08-16 Thread Glyn Jackson

 quote: Because CF passes CFCs by reference, your adminusers object will 
 magically have all of the updated info in it wherever you called 
 readAdminUsers() from. 

really, no way? so my admin object will have the data populated using the 
getters and setters! thats cool!

so let me see if I understand this. say I wanted to get data from my database 
where ID = 1

in my service layer I would do something like this...

var userDetails = variables.adminUsersGateway.readAdminUsers(arguments.bean);

then in my handler I could setadminusers.getname() to get the name.

do I have to use the object first to set the userID then pass in my object?.



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325487
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Illudium PU36, queryRowToStruct?

2009-08-16 Thread Glyn Jackson

This really works! Look at me I am starting to get this (is it really sad 
this is making me smile with joy lol)


I love this object stuff! So here is what I am doing,

I have just checked my user exist, got their details and set there session in 4 
lines of code in my handler! Now that's cool, right?

if (resultCount.recordcount eq 1){
variables.adminUsersService.getUserByID(userBean);//Get User Deatils, Object 
Will Have The User ID Already
variables.adminUsersService.setCurrentUser(userBean);// Setup User Session
}

I can see now how to make this better no need for the resultCount line I have 
do this via the object also! 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325488
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Illudium PU36, queryRowToStruct?

2009-08-16 Thread Glyn Jackson

Glad its not just me. Thanks again for you help, I am sure I will have more 
questions but I have a bit to be going on with now for a while at least.

Glyn 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325490
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: venture into OO, well sort of, need help!

2009-08-15 Thread Glyn Jackson

@Matt Quackenbush
thanks so much for taking the time to help me out :) that makes sense. kinda 
starting to get it. I think its going to be one of those things I need to do 
real world things with before I see the benefits. at the moment all I seem to 
be doing is adding extra overhead lol. 

is there any rules on this i.e. when an object is an object and should be used, 
when a service layer should be used and why not direct access etc? my UML sort 
of shows systems where I think I would need several service, gateways and 
objects but some cross over, is this normal? how do you organise your apps?

 

admin.cfc is an object which I passed around it also does my validation and 
cleans data. you stated that I could do things like below in the admin.cfc...

changePassword() 
sendTempPassword() 

is that not something my gataway should handle on its own accessed via the 
service layer?
 

@ Kevan Stannard

Sorry I was more trying to find out if the concepts of passing objects and 
'service' gateway is being used in the correct context. not the best example 
for login I know.



some stuff in admin.cfc
--

cfcomponent displayname=adminusers output=false
cfproperty name=adminId type=numeric default= /
cfproperty name=firstname type=string default= /
cfproperty name=surname type=string default= /
cfproperty name=email type=string default= /
cfproperty name=username type=string default= /
cfproperty name=password type=string default= /
cfproperty name=role type=string default= /
cfproperty name=lastLogin type=string default= /
cfproperty name=flag type=boolean default= /
cfproperty name=IP type=string default= /
cfproperty name=userLog type=string default= /
cfproperty name=createddatetime type=date default= /
!---PROPERTIES---
cfset variables.instance = StructNew() /
!---INITIALIZATION / CONFIGURATION---
cffunction name=init access=public returntype=adminusers output=false
  cfargument name=adminId type=string required=false default= /
  cfargument name=firstname type=string required=false default= /
  cfargument name=surname type=string required=false default= /
  cfargument name=email type=string required=false default= /
  cfargument name=username type=string required=false default= /
  cfargument name=password type=string required=false default= /
  cfargument name=role type=string required=false default= /
  cfargument name=lastLogin type=string required=false default= /
  cfargument name=flag type=string required=false default= /
  cfargument name=IP type=string required=false default= /
  cfargument name=userLog type=string required=false default= /
  cfargument name=createddatetime type=string required=false default= 
/
  !--- run setters ---
  cfset setadminId(arguments.adminId) /
  cfset setfirstname(arguments.firstname) /
  cfset setsurname(arguments.surname) /
  cfset setemail(arguments.email) /
  cfset setusername(arguments.username) /
  cfset setpassword(arguments.password) /
  cfset setrole(arguments.role) /
  cfset setlastLogin(arguments.lastLogin) /
  cfset setflag(arguments.flag) /
  cfset setIP(arguments.IP) /
  cfset setuserLog(arguments.userLog) /
  cfset setcreateddatetime(arguments.createddatetime) /
  cfreturn this /
/cffunction
!---PUBLIC FUNCTIONS---
cffunction name=setMemento access=public returntype=adminusers 
output=false
  cfargument name=memento type=struct required=yes/
  cfset variables.instance = arguments.memento /
  cfreturn this /
/cffunction
cffunction name=getMemento access=public returntype=struct 
output=false 
  cfreturn variables.instance /
/cffunction
!---Validation Checks---
cffunction name=validateUser access=public returntype=array 
output=false
cfargument name=formData type=struct required=true /
  cfset var errors = arrayNew(1) /
!--- username ---
  cfif (NOT len(trim(formData.username)))
cfset ArrayAppend(errors, Username is required) /
  /cfif
  cfif (len(trim(formData.username)) AND NOT 
IsSimpleValue(trim(formData.username)))
 cfset ArrayAppend(errors, Username is not a string) /
  /cfif
  cfif (len(trim(formData.username)) GT 12)
 cfset ArrayAppend(errors, Username is too long) /
  /cfif
 !--- password ---
  cfif (NOT len(trim(formData.password)))
cfset ArrayAppend(errors, Password is required) / 
  /cfif
  cfif (len(trim(formData.password)) AND NOT 
IsSimpleValue(trim(formData.password)))
cfset ArrayAppend(errors, Password is not a string) / 
  /cfif
  cfif (len(trim(formData.password)) GT 80)
cfset ArrayAppend(errors, Password is too long) / 
  /cfif 
  cfreturn errors /   
/cffunction




~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325471
Subscription: 

ColdBox and ColdSpring Login

2009-08-15 Thread Glyn Jackson

leading on from my last example which would be the best way to the following...
1) get the username from the database to store in a session
2) log them in

I was thinking about added the following in my handler after the validation 
checks..

variables.adminUsersService.doLogin(userBean);//Login User

this passes in my userbean to adminUsersService...

!---Login Request---
cffunction name=doLogin access=public returntype=any output=false
 cfargument name=bean type=salesMaxx.model.objects.adminusers 
required=true /
 cfscript
   var userDetails = variables.adminUsersGateway.readAdminUsers(arguments.bean);
bean.setUserSession();
 /cfscript

what i am not sure about is if I should be do this all in my service, or should 
I come out again with the username and run the bean.setUserSession() in the 
handler?

full handler below (with the bit above not in)

-
var rc = event.getCollection();//RC Reference   
var userBean = variables.adminUsersService.createAdminUserBean(); //Create 
adminUserBean
var errors = ;

getPlugin('beanFactory').populateBean(userBean);//the magic bean machine
errors = userBean.validateUser();//Check For Validation Errors  
 
 
 if (NOT ArrayLen(errors)){//No Validation Errors
   getPlugin('beanFactory').populateBean(userBean);
   resultCount = variables.adminUsersService.validateCredentials(userBean); 
//Check Login Credentials Does User Exist?
if (resultCount.IDEXISTS eq 1){

//LOG USER IN HERE???


}
else {
   getPlugin(messagebox).setMessage(error, Sorry, 
Username/Password not found.);
} 
 }
 else {//We Have Validation Errors Show The User A Message
 getPlugin(messagebox).setMessage(error, bThe Following 
Validation Errors Occurred:/bbr /,errors);
   
 }
   

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325473
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


venture into OO, well sort of, need help!

2009-08-14 Thread Glyn Jackson

The more I venture into OO type of design the more I have to get my head around 
todays its getters and setters. I think I am 'getting' in to the swing of 
this but I could do with some advice please! any advice and help is welcome!

I have no idea if I am just making this up as I go along anymore lol!

I have a ColdBox application which I am trying to learn ColdSpring with, so I 
have ColdSpring setup I need to it use...here how it went

I wanted to do some basic validation on a form and check if the user exists in 
the DB. 

Below is my code, from my understanding. Right or wrong?


var rc = event.getCollection();//RC Reference   
var userBean = variables.adminUsersService.createAdminUserBean(); //Create 
adminUserBean
var errors = userBean.validateUser(rc);//Check For Validation Errors  

if (NOT ArrayLen(errors)){//No Validation Errors
getPlugin('beanFactory').populateBean(userBean);
resultCount = variables.adminUsersService.validateCredentials(userBean); 
//Check Login Credentials Does User Exist?
if (resultCount.IDEXISTS eq 1){
//do login
}
else {
getPlugin(messagebox).setMessage(error, Sorry, Username/Password not 
found.);
  } 
   }
else {//We Have Validation Errors Show The User A Message
   getPlugin(messagebox).setMessage(error, bThe 
Following Validation Errors Occurred:/bbr /,errors);
 
   }


Few questions.

Is what I am doing OK?
service -- passes in the admin bean needs the gateway
gateway  -- my sql only acced from the service 
admin.cfc --- getters and setters, right?
correct right?

what are the benefits of me create the userBean above passing that into the  
getPlugin('beanFactory').populateBean(userBean); then using it and not the 
direct gateway?



my service
!---gets the gateway so it can be access via the service layer---
cffunction name=setadminUsersGateway access=public returntype=void 
output=false
cfargument name=adminUsersGateway required=true 
type=salesMaxx.model.adminUsersGateway / 
cfset variables.adminUsersGateway = arguments.adminUsersGateway /
/cffunction
 
!---creates the AdminUser Bean---
cffunction name=createAdminUserBean access=public 
returntype=salesMaxx.model.adminUsers output=false
  cfset var bean = 
createObject('component','salesMaxx.model.adminUsers').init(createUUID()) /
 cfreturn bean /
/cffunction
 

cffunction name=validateCredentials access=public returntype=any 
output=false
 cfargument name=bean type=salesMaxx.model.adminUsers required=true /
  cfset result = variables.adminUsersGateway.existsAdminUsers(arguments.bean) 
/
  cfreturn result /
/cffunction 



  


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325453
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


using my injected bean within a CFC

2009-07-26 Thread Glyn Jackson

Hi, I have my DNS bean injected into my CFC, I have used a setter. how do I now 
use the dns details now 'within' my CFC. do I create it in my init method? I 
want to do something like the following... 
cfquery name=test datasource=#instance.dsn.getName()# etc.  

--
 cffunction name=getdsnBean access=public returntype=any output=false 
hint=Return the dnsBean.
  cfreturn instance['dns'] /
/cffunction
   
cffunction name=setdsnBean access=public returntype=void output=false 
hint=Set the dsnBean.
cfargument name=dsnBean type=any required=true hint=dsnBean /
cfset instance['dsn'] = arguments.dsnBean /

/cffunction 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324969
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: using my injected bean within a CFC

2009-07-26 Thread Glyn Jackson

Hi,

I did try that with...

cffunction name=init access=public returntype=any hint=constructor
cfargument name=dsnBean type=any /
cfset variables.instance['dsnBean'] = arguments.dsnBean /
cfreturn this /
/cffunction

however I just get the error Element DSNBEAN is undefined in ARGUMENTS.

This is how I am injecting the bean into the CFC...

bean id=userGateway class=model.common 
  property name=dsnBean
   ref bean=dsnBean /
  /property
/bean 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324971
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: using my injected bean within a CFC

2009-07-26 Thread Glyn Jackson

the parameter to the init function was not passed in for some reason? 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324974
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: using my injected bean within a CFC

2009-07-26 Thread Glyn Jackson

I like this example (below) but for some reasons its not being passed...

cffunction name=init access=public returntype=any hint=constructor
cfargument name=dsnBean type=any required=yes /
cfset variables.instance['dsnBean'] = arguments.dsnBean /
cfreturn this /
/cffunction


the full coldspring.xml
-

!DOCTYPE beans PUBLIC -//SPRING//DTD BEAN//EN 
http://www.springframework.org/dtd/spring-beans.dtd;


beans default-autowire=byName
bean id=coldboxFactory class=coldbox.system.extras.ColdboxFactory /
bean id=ConfigBean factory-bean=ColdboxFactory 
factory-method=getConfigBean /

bean id=dsnBean factory-bean=ColdboxFactory factory-method=getDatasource
constructor-arg name=alias
valueDBDetails/value
/constructor-arg
/bean 


bean id=userService class=model.UserService /

bean id=userGateway class=model.common 
property name=dsnBean
ref bean=dsnBean /
/property
 /bean

/beans 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324975
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: using my injected bean within a CFC

2009-07-26 Thread Glyn Jackson

Hi Dominic,

I have tried...

bean id=dsnBean factory-bean=ColdboxFactory factory-method=getDatasource
constructor-arg name=alias
valueDBDetails/value
/constructor-arg
/bean 
bean id=userService class=model.UserService /

bean id=userGateway class=model.common 
constructor-arg name=dsnBean ref bean=dsnBean / 
/constructor-arg 
 /bean

and I still get The DSNBEAN parameter to the init function is required but was 
not passed in. 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324977
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: using my injected bean within a CFC

2009-07-26 Thread Glyn Jackson

I know it exsits as if I go back to the setter version i can dump the bean in 
the CFC

cffunction name=setdsnBean access=public returntype=void output=false 
_wireme=ioc
  cfargument name=dsnBean type=any required=true hint=Set DNS Beand /
  cfset variables.instance['dsnBean'] = arguments.dsnBean / 
  cfdump var=#arguments.dsnBean#
  cfabort
/cffunction

however I like your version better, but using the..

bean id=userGateway class=model.common   
constructor-arg name=dsnBean  
  ref bean=dsnBean /  
/constructor-arg 
/bean 

then...

cffunction name=init access=public returntype=any hint=constructor
cfargument name=dsnBean type=any required=yes /
cfset variables.instance['dsnBean'] = arguments.dsnBean /
cfreturn this /
/cffunction
  
just give me the same error The DSNBEAN parameter to the init function is 
required but was not passed in. 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324978
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: using my injected bean within a CFC

2009-07-26 Thread Glyn Jackson

Still not sure why I am getting this error since it should have been passed. 
any more ideas? thanks 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324979
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: using my injected bean within a CFC

2009-07-26 Thread Glyn Jackson

Restarted and used the dump as suggested and I get...

struct [empty]

strange! If I was to go back the to setdnsBean i can dump in that function and 
its there however I want to inject using the init

It should work again just in cause I will post the full code below, if you have 
any more ideas they would be very much welcome...

coldspring.xml
!DOCTYPE beans PUBLIC -//SPRING//DTD BEAN//EN 
http://www.springframework.org/dtd/spring-beans.dtd;
beans default-autowire=byName!--Autowire by name--
bean id=coldboxFactory class=coldbox.system.extras.ColdboxFactory /
!--Create Config Bean--
bean id=ConfigBean factory-bean=ColdboxFactory 
factory-method=getConfigBean /
!--Create DNS Bean--  
bean id=dsnBean factory-bean=ColdboxFactory factory-method=getDatasource
constructor-arg name=alias
valueDBDetails/value
/constructor-arg
/bean 
!--User Service Bean all external requests should hit this first to access 
User Gateway!--
bean id=userService class=model.UserService /
!--Gateway Bean needs DNS to be injected from DNS Bean!--
bean id=userGateway class=model.common   
constructor-arg name=dsnBean  
  ref bean=dsnBean /  
/constructor-arg 
/bean 
/beans


common.cfc
cfcomponent displayname=common output=false
! CONSTRUCTOR -   
cffunction name=init access=public returntype=any hint=constructor
cfargument name=dsnBean type=any required=yes /
cfset variables.instance['dsnBean'] = arguments.dsnBean /
cfreturn this /  
/cffunction


---

error

Error Type:  Application : [N/A]
Error Messages: The DSNBEAN parameter to the init function is required but was 
not passed in.

ID: CF_TEMPLATEPROXY
LINE:   187
Template:   D:\wwwroot\coldbox\system\plugins\beanFactory.cfc
ID: CF_UDFMETHOD
LINE:   240
Template:   D:\wwwroot\coldbox\system\plugins\beanFactory.cfc 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324981
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: using my injected bean within a CFC

2009-07-26 Thread Glyn Jackson

do you or anyone else have any more ideas on this? Thanks :) 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324982
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: using my injected bean within a CFC

2009-07-26 Thread Glyn Jackson

Hm, time to try the ColdSpring list I'd say. 
 Maybe its a ColdBox issue!


?And while you wait for an answer from there, use the property method and move 
on ;)

Will do, thanks for your help :)



Dominic

2009/7/26 Glyn Jackson glyn.jack...@newebia.co.uk


 do you or anyone else have any more ideas on this? Thanks :)

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324984
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


singletons ColdSpring and ColdBox

2009-07-26 Thread Glyn Jackson

I have another question regarding ColdSpring and ColdBox. I will be using it to 
create a bean on the init() method of my handler, I will not create the object 
again after that. This bean contains all my SQL and database interactions 
(example below). My question is, singletons. is this ok, I dont see how doing 
this be an issue as long as I var inside the CFC right?

example code inside my CFC

cffunction name=getproductListDep returntype=query
cfargument name=storeId type=numeric required=yes default=1
cfargument name=depId type=numeric default=0 
cfargument name=pagesize type=numeric default=5 
cfargument name=targetpage type=numeric default=1  
cfargument name=highest type=numeric default=0   
cfquery name=qryResult  datasource=#instance.dsn.getName()# 
username=#instance.dsn.getUsername()# password=#instance.dsn.getPassword()#
EXECUTE usp_listDepartments
@PageSize = cfqueryparam cfsqltype=cf_sql_varchar maxlength=4 
value=#arguments.pagesize# /,
@TargetPage = cfqueryparam cfsqltype=cf_sql_varchar maxlength=4 
value=#arguments.targetpage# /,
@Highest = cfqueryparam cfsqltype=cf_sql_varchar maxlength=2 
value=#arguments.highest# /,
@Sto = cfqueryparam cfsqltype=cf_sql_varchar maxlength=4 
value=#arguments.storeId# /, 
@Dept = cfqueryparam cfsqltype=cf_sql_varchar maxlength=4 
value=#arguments.depId# /
/cfquery
cfreturn qryResult
/cffunction

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324985
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


  1   2   >