Scoop -- the swiss army chainsaw of content management
Front Page · Everything · News · Code · Help! · Wishlist · Project · Scoop Sites · Dev Notes · Latest CVS changes · Development Activities
Defining stories <--> objects associations New Code
By sleeper22 , Section Code []
Posted on Sun Sep 08, 2002 at 12:00:00 PM PST
A mechanism for establishing many-to-many relationships betweeen stories and other records in the database.

I. motivation
I'd like to see more features in scoop that support integration with a well-structured set of data, around which discussion can focus.

Phantros' site 4literature.net is a good example -- there are all those texts that are being reviewed, so strong ties between stories and non-story data is important. Other uses include bookstore/library, a store or other catalog, or the tying of files (photos,sound,documents,diagrams), wikis, anything that can be considered an object.

Once this mechanism is implemented, there are plenty of fun possibilities, such as search enhancements, cross-referencing, and new types of stories...

For example, a story in the 'photos' section could automatically
display a thumbnail in the story_summary area, with a link to the photo that would be more reliable than a hypertext link.... i.e. you could change your site's directories around and the links would change automatically because they're not hard-coded in the story's text.

II. interface
With this feature installed, the submitstory page includes input fields for identifiers of objects that should be tied to a story.

III. db changes

A. a new table:
story_ties
----------
tie_id = auto increment primary key
sid
class  = the name of a table like "books" or "wiki"
field  = the name of field of that table
value  = the value of the field for the record being tied to.

unique index on (sid,class,field,value)

<table>.<field> should be a key field, so that class+field+value identifies one and only one record in the scoop database.

tie_id is used to keep track of the order of insertion, so that you can list ties in order of relevance/strength.

B. a new block
story_ties_types block that is arranged table style (one record per line, values separated by commas), with fields:
----------------
class = name of the tied table
field = name of a key field in that table
label = what to call this object class being tied to
perm  = name of scoop perm allowing creation of this tie type
max_ties = max number of ties of this type, per story

if this block doesn't exist, the patch to AdminStories.pm will have no noticeable effect.

C. perms
one or more perm(s) must be created that allow a submitter to enter story ties on the submit story page. One perm can be used for more than one tie type; i.e if you wanted you could have a perm "tie_stories" that controls the use all types of story types.

for each perm mentioned in story_ties_types block:

  1. add the perm name(s) to the "perms" block
  2. grant some group(s) the perm in the Groups admin tool
sample block contents
book,isbn,ISBN #,write_reviews,3
recipe,recipe_id,Recipe Number,1
patch,patchid,Scoop code patch,3

IV. TODO

  • methods for displaying tied objects. currently you'd have to write your own box.
  • search enhancements
  • make the data entry more flexible, such as by addint a field to story_ties_types that controls input type (text field; select from list)
V. CODE
If anyone wants a diff now, that's cool. otherwise i'd like to do more testing and hear your ideas about this design.

VI. Using this feature for scoop.k5
Too bad we don't yet have wikis or some other form of versioned document objects on this site... wouldn't it be so useful to upload a piece code that you can continue to update? yet have it remain associated with a story that introduces it and maintains running commentary from all users? and be able to browse back and forward thru time -- from one draft to the next? and possibly allow other users to edit it, marked with different colors?

Using story_ties, we could not only tie this shared document that is held in the site's db, but also tie a link to the webCVS page. Then you can make diffs between any two versions of the cvs file and the discussed file... but i guess that's another sstory!

< Badgergoose | Scooping the Macintosh Performa 6116CD >

Menu
· create account
· faq
· search
· report bugs
· Scoop Administrators Guide
· Scoop Box Exchange

Login
Make a new account
Username:
Password:

Poll
useful feature?
· yes for me 100%
· maybe for someone 0%
· no 0%
· isn't it thirsty around here? 0%

Votes: 2
Results | Other Polls

Related Links
· Scoop
· More on New Code
· Also by sleeper22

Story Views
  23 Scoop users have viewed this story.

Display: Sort:
Defining stories <--> objects associations | 2 comments (2 topical, 0 hidden)
Whoah, way cool. (none / 0) (#1)
by LukeyBoy on Wed Sep 11, 2002 at 07:52:29 PM PST

Very nice, this will push Scoop closer to a full-scale content management system.



very interesting (none / 0) (#2)
by Phantros on Tue Sep 17, 2002 at 03:28:07 PM PST

Quite an interesting idea. I'm looking forward to seeing how this ends up.

As an aside, being a bit less experienced and a bit more lazy, I loosely linked the stories being reviewed with the section of the story. For example, the text might be in /Stephen_Crane/Red_Badge_of_Courage and the section might be /section/Red_Badge_of_Courage with a parent section of /section/Stephen_Crane so I got the parent section then stripped the two, recombined, and got the URL to point to the book. I then added a link to the book in the sections_title_subsections box. Example here.

Your solution is a bit more complete and elegant though. ;)

You mentioned wikis...I've been kinda wanting a wiki system to be built into scoop. I'd use it to have a page where users (perhaps trusted users and higher?) could write a biography for each author.

4Literature - Read, write, and discuss your favorite books.



Defining stories <--> objects associations | 2 comments (2 topical, 0 hidden)
Display: Sort:

Hosted by ScoopHost.com Powered by Scoop
All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest © 1999 The Management

create account | faq | search