As a failsafe to Russ' suggestion, I would use a combination of a timestamp and a user ID as the flag. If the timestamp has exceeded some predecided threshold or is null then the story is available to edit by all. If the timestamp is still within the threshold then only the user who's ID is flagged alongside the timestamp can edit the story. Once saved, the flag is set back to null. This gets round problems where a browser crashes or a user starts editing and then goes to lunch or on holiday or something.
HTH & HNY, Steve > As a sidenote, I would probably just jave a flag in the table > that I set > to true when the record is being edited rather than using a struct. > > > > -----Original Message----- > > From: Russ Michaels [mailto:[EMAIL PROTECTED]] > > Sent: 03 January 2003 00:30 > > To: [EMAIL PROTECTED] > > Subject: RE: [ cf-dev ] Application structure problem > > > > > > When someone opens a story for editing, add the UUID to a struct. > > In the query where you get the stories, don't select stories > > whose UUID is in the list. > > > > i.e > > > > Select * from stories > > Where NOT StoryID IN (#StructKeylist(application.openstories)#) > > > > > > Or if you want to display it but disable the link, do a > > search and only create a link if this is false. > > > > E.g > > <cfoutput query = "stories"> > > <cfif NOT StructKeyExists(application.openstories, storyID)> > > Create link <cfelse> Display story without link </cfif> </cfquery> > > > > HTH > > > > > > Russ Michaels > > Macromedia/Allaire Certified ColdFusion Developer > > > > Satachi Internet Development > > Unit 2, 7A Plough Yard > > London EC2A 3LP > > > > Phone: 0870 787 3610 > > Tech Support: 0906 9607800 > > FAX: 0709 2212 636 > > http://www.satachi.com > > email general: [EMAIL PROTECTED] > > email support: [EMAIL PROTECTED] > > > > Join our ColdFusion Developer discussion lists. > > Send an e-mail to [EMAIL PROTECTED] > > > > > -----Original Message----- > > > From: David Phipps [mailto:[EMAIL PROTECTED]] > > > Sent: 02 January 2003 20:28 > > > To: [EMAIL PROTECTED] > > > Subject: [ cf-dev ] Application structure problem > > > > > > > > > Hi, > > > > > > I am trying to get something to work and I can't seem to get > > > it right. I > > > have a list of stories all with their own UUID when one is > > > selected I want > > > the link to that story to be locked for other logged in users > > > and only > > > available to the current user that first selected that story. > > > > > > I have a structure in the session scope which holds all the > > > user's info and > > > when the story is selected I add the storyid to this > > > structure. I also > > > have a structure in the Application scope which holds all of > > > the session > > > structures. What I want to do is check to see if a > > > particular user is > > > viewing a story and if so remove the link to that story for > > > other users. > > > > > > So if joe bloggs is editing the story then John Doe cannot. > > > > > > I have a cfdump of the application structure below: > > > > > > > > > struct > > > applicationname abcde > > > usersloggedin struct > > > 83658838-2B39-5973-3866F7192C0E9281 struct > > > > > TIMECREATED {ts '2003-01-02 19:31:01'} > > > > > realname Joe Bloggs > > > uname > > > joe.bloggs > > > > > usergroups Administrators,Master > > > userid > > > 83658838-2B39-5973-3866F7192C0E9281 > > > > > storyid 91663878-2C49-4613-3866F7192C0E946 > > > > > > How do I reference the storyid that will be in one session > > > from within > > > another session in the same application? > > > > > > I assign the currentuser session struct to the application > > > struct like so: > > > <cfset > application.UsersLoggedin["#session.currentuser.userid#"] = > > > session.currentuser> > > > > > > I can access the storyid for a session but not from within a > > > different > > > session like so: > > > #Application.UsersLoggedin[session.currentuser.userid].storyid# > > > > > > Is there a way to grab the storyid from within the > > > application structure > > > without knowing which session structure it is in. Is there a > > > better way? > > > > > > Thanks in advance - hope you all had a great Christmas > and New Year. > > > > > > Dave Phipps > > > > > > > > > -- > > > ** Archive: > > http://www.mail-archive.com/dev%> 40lists.cfdeveloper.co.uk/ > > > > > > > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > > For additional commands, e-mail: > > > [EMAIL PROTECTED] For human help, e-mail: > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > -- > > ** Archive: > http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] For human help, e-mail: > > [EMAIL PROTECTED] > > > > > > -- > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > For human help, e-mail: [EMAIL PROTECTED] > > -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED]
