Villagersonline : blogs : russ : Upload Classes
villagersonline
A Community Tunneling Protocol
The Village meets at 5pm Sundays
1926 N. Cloverland Ave. map

Links
(edit) The Village Cancer Relief Fund;


From: russ
Date: Thu Apr 29 11:21:24 MST 2004 Subject: Upload Classes

Responses
russ: Object-Orientedness (4/30/04)
russ: Nesting (4/30/04)
russ: Versioning (5/3/04)
russ: Security/Storage Paradigm (5/4/04)
Suki: Response (5/4/04)
russ: IMG tag (5/4/04)
Suki: Groovy (5/4/04)
benjipark: Classes and their ponderings (5/5/04)
russ: Yep! (5/5/04)
russ: Data Format (5/6/04)
russ: Cheapo Database (5/6/04)
Responses (sorted by date)
russ: Cheapo Database (5/6/04)
russ: Data Format (5/6/04)
russ: Yep! (5/5/04)
benjipark: Classes and their ponderings (5/5/04)
Suki: Groovy (5/4/04)
russ: IMG tag (5/4/04)
Suki: Response (5/4/04)
russ: Security/Storage Paradigm (5/4/04)
russ: Versioning (5/3/04)
russ: Nesting (4/30/04)
russ: Object-Orientedness (4/30/04)
My wacked-out programmer brain has been storming of late. I think I have a new feature to add to the website that will vastly expand the power that you guys, the users, have. I want to post it here so that the community can interact with it and help me develop it.

The idea is: Uploadable Upload Classes

What this comes from is my growing realization that there aren't really a lot of different types of uploads that happen here on the website. Everything falls into some mix of four categories:
1) Text (blogs, news, picture comments, etc.)
2) Small media (pictures are the only example so far)
3) Large media (mp3's and other large files Eric uploads)
4) Websites
This list could expand as we expand the capabilities of the website...

History

My first revelation came when I integrated the News and Blogs upload mechanisms. You may or may not know this, but each News item is actually a Blog with a special marker that causes it to be displayed on the home page. News items can be edited just like blogs. (Look for the edit link on each News item.) The revelation was that a Blog was not just a Blog...it was a generic text upload device. So I use it in several places, now; Eric can edit the links at the top of each page, and also edit the counter text on the bottom of the page (look for the edit links there). So every page you see on the website includes stuff from at least 2 different blogs that Eric has uploaded and can edit. I've been thinking of late that Sermons and Music should be converted to blogs so that Eric can edit the text.

The idea

Rather than continue to code each upload class by hand, my idea is to create a language which you can use to describe how a specific type of upload works. You can give it a name, you can specify what sorts of things can be uploaded into it, you can specify how they should be displayed when somebody views the upload, and you can specify how it should be listed in Latest Uploads.

So, for example, Benji asked for a new type of uploads, called "Backgrounds." He could use this to uploads large pictures that you could download and use as your desktop background. It would work sort of like the pictures upload, but would have some differences. Rather than having him bug me for it, and then having to explain in detail what he wanted it to look like, he could simply upload a file which describes exactly how the upload class should work. This upload class would automatically have a form that he could use to upload things; he could start uploading immediately without having to talk to me about it at all. Later, if Eric thought that Benji's upload class was really cool, he could add it to the list of "official" upload classes of the website.

Examples

I'm still very playing around with the syntax of what the files might look like. I want you guys to talk to me about whether you think it's readable or not.

Here's an example of what blogs might look like (compare it to http://villagersonline.com/upload/blogs/):

class Blog {
Text subject;
UploadDate date;
Text text;

function LatestUploadSummary() {
print username ": " MakeLink(this,subject) " (" date ")"
}

function Display() {
print "From: " username
print "Date: " date
print "Subject: " subject
print text }
}

To people who haven't done any programming, this probably looks a little intimidating. However, it's not too hard. Basically, this defines a new type of upload with several bits of information that are saved. These include:
* A field of type 'Text' named 'subject'
* A field of type 'UploadDate' named 'date'
* A field of type 'Text' named 'text'

The website automatically generates a form for you that will look something like this:


Username:

Forgot your username?

Password:

Forgot your password?

subject:

text:

This isn't very pretty, but the language will also allow you to override this default form and provide one with a prettier one that you design.

When the website wants to display entries for LatestUploads, it runs "function LatestUploadSummary()" to find out how to display it. This function does

    print username ": " MakeLink(this,subject) " (" date ")"

What this does is is prints something out to the webpage; the printout is first the user's name ('username'), then a colon and a space. Then it calls the MakeLink() function, which prints out a html link. Finally, it prints out a space, a paren, the date when the blog was uploaded, and a close paren. If you look at the blogs in Latest Uploads, this is more or less how they look currently.

When somebody tries to view the Blog that has been uploaded, the website runs the Display() function. This prints out the From, Date, and Subject lines, then prints out the text of the blog.

More details later...gotta go get on with the day. Any comments???

Edit this blog
Write a response Email the author



From: russ
Date: Fri Apr 30 12:57:56 MST 2004 Subject: Object-Orientedness

Object Orientedness

You don't have to derive an entirely new class every time that you want something new. Instead, you can declare a class to be derived from another class.

For instance, suppose you wanted to have your own thing that was a lot like a blog but included something new, like, for instance, you wanted each blog to have a single picture attached. Then you could write something like this:


class BlogWithPicture : Blog {
Picture picture;
function Display() {
Blog.Display()
print picture
}
}

You note in the class declaration that it says that there is a new class, called "BlogWithPicture", which is derived from "Blog". That means it includes everything from Blog, plus some more. So, like Blog, it includes the fields "subject," "date," and "text," but it also includes a Picture field called "picture."

The form for this class automatically gets a new field where the user can upload this picture.

Finally, the class declares a new Display() function. The first thing that it does is to display everything that a normal Blog does (with Blog.Display()). Then it displays the picture that was uploaded.

Edit this response
Write a response Email the author



From: russ
Date: Fri Apr 30 13:07:09 MST 2004 Subject: Nesting

You can have one upload class include another. For instance, in the examples above, Text, UploadDate, and Pictures would all be upload classes of their own. When you add a field, you are including another upload class into your own. So you could create for instance, this if you wanted to have a single upload which had two blogs inside of it:


class TwoBlogs {
Blog blog1;
Blog blog2;
function Display() {
blog1.Display()
blog2.Display()
}
}

The autogenerated forms automatically include two blog forms in your one form...allthough there is, of course, only one username/password set.

Edit this response
Write a response Email the author



From: russ
Date: Mon May 3 15:01:01 MST 2004 Subject: Versioning

One of the common things that happens with this website is that we change things. We add new features, or sometimes remove old ones. More often, we just update the look of things.

You could, of course, create a new class every time that you wanted to change something, and make it a child of the old version. But then it becomes harder to figure out where everything should show up in LatestUploads and stuff like that.

So, what I am thinking about is a versioning system where you can modify an existing class. The old data, which was uploaded using the old class, can still be viewed using the old version of the class. But new uploads will use the new class. They should be able to interact just fine.

Now, what happens when you aren't really changing anything about the class itself, you just want to change how it looks online a bit? You don't really want to upload a whole class, you just want to change one of the functions. Moreover, if you are doing this it is likely that you want this change to affect old uploads; you don't want this just to show up in new uploads.

This implies that there is a distinction between the version of the data in a class and the version of the display functions. Perhaps they should be uploaded separately? Perhaps what should happen is that you write the data structures, then you write the various forms later.

More thoughts coming....

Edit this response
Write a response Email the author



From: russ
Date: Mon May 3 17:43:59 MST 2004 Subject: Security/Storage Paradigm

The webmaster continues to mumble to himself....

I don't want somebody to steal/guess somebody else's password and use it to delete/modify lots of stuff posted by the other guy. Yet I want somebody to be able to modify/remove/rename things they post. This is how the language will solve the problem:

First of all, at the low level, nothing will be deletable. Once you upload something, it cannot be edited or removed. (Of course, the webmaster can break all the rules...)

However, users will still be able to do a "remove." What will happen when they "remove" something is that the connections which cause it to show up on the website will be removed, or else some sort of flag will be set up which will tell the website not to index it. So, although it will be sitting on the hard drive of the webserver, it will not be visible to the users of the website.

What this means is that users will be able to remove things from the website, but the webmaster will be able to restore stuff if something goes wrong.

In the last year of so of adminning this site, I've found that it's not just the raw data that is important to maintain. The metadata (like the last-modified date, the links to responses, etc.) is also important to keep accurate, and I want to protect it with the same security features. If some hacker can come in and delete (or undelete) huge amounts of stuff on the website, and I then have to fix it all by hand, that's a Bad Thing. Happily, this is doable with the system I'm devising here.

The metadata of the website will be protected just like the base data. So if there is a record which shows the current list of uploaded blogs, you can't delete that record. What you can do is edit (or make invisible) that record, but it still stays around in the backup copies of the website.

The way this happens is that when you edit things, you don't really edit or remove the old data. Instead, the old record is stored inside a "prev" field of the current record. Typically, a class's Display() function will only display the latest version, but it is possible to show old ones as well.

So, for example, when you upload a new class type (see Versioning above), you will be creating a new class record, but the old class record will still be available through the "prev" field.

Now, when something refers to something else in the website (such as how an uploaded object refers to the class which defines it), you need to decide whether that link is to a very particular version of the thing, or to the latest version. In the example where a certain upload (say, a Blog) points to the class which defines it (the Blog class), you want to point to a specific version of Blog. Even if the Blog class is updated, that specific blog you uploaded will always be controlled by the old code. On the other hand, if the thing you're uploading is something that controls how the website looks (such as the modifiable Links section on the top of this website), then you want to have everything refer to the most recent version; when you upload a new version, you want everything to automatically point to the new one.

I haven't figured out exactly how I'm going to do this yet. However, the website language will allow for both types of references; ones which are tied to a very particular version of an upload, and ones which follow the upload as it gets updated.

Edit this response
Write a response Email the author



From: Suki
Date: Tue May 4 09:28:21 MST 2004 Subject: Response

It sounds brilliant to me. Not that I understood it all. Perhaps the unprogramming types will need to take Upload Classes classes.
As I use the website, I don't find myself coming up with large design ideas. However, sometimes I wish I knew the html(?) language to throw a link or a picture into my blog. Like Eric did to post the club pictures on the home page last week, or to put photos in his bio. Is there a way to lay out simple commands (maybe a cheat sheet) or even programmed buttons for these kinds of things?
Sue

Edit this response
Write a response Email the author



From: russ
Date: Tue May 4 12:58:52 MST 2004 Subject: IMG tag

I will be adding, pretty soon, a way to upload pictures as part of your blog upload. However, for now, here's how to do it by hand:

1) Upload a picture to a collection
2) View the collection
3) Get the URL address for the picture.
-- On some browsers, you can get the URL easily. Try Right-clicking on the picture and looking for something like "Copy Link Address" or something like that.
-- Internet Explorer is harder...on version 5 you have to Right-Click on the picture, select "Properties", and copy the text in the "Address (URL)" field.
-- I'll check at work on how to do this in IE version 6...

The URL you want will look something like:
http://villagersonline.com/users/keibru/pictures/Emily%20L.'s%20Roses/files/42104emilyroses1.JPG

In your blog, you add this text:

<img src="URL">

Make sure there are double quotes around the URL. So the image in the example above would be this code:

<img src="http://villagersonline.com/users/keibru/pictures/Emily%20L.'s%20Roses/files/42104emilyroses1.JPG">

And what the reader will see is this:

Links

Links look like this:

<a href="website_URL">Text of the Link</a>

For example, this code:

<a href="http://villagersonline.com">this is a link</a>

will produce this link in a blog:

this is a link

Hint

When somebody posts a blog with a picture, link, or something else interesting, you can look at how we did it by clicking on the "Edit" link for that post.

Edit this response
Write a response Email the author



From: Suki
Date: Tue May 4 16:24:39 MST 2004 Subject: Groovy

That's perfect! Thanks.

Edit this response
Write a response Email the author



From: benjipark
Date: Wed May 5 02:52:02 MST 2004 Subject: Classes and their ponderings

Well I just had an interesting class for poetry. What we did was write one line of poetry then pass the papers around. Then we wrote a line of poetry in response. Next you fold the paper so only the line you wrote show and pass. Write line, fold and pass.

All this to say that I think it's posible for me to write a class that does the same thing. Each person see's the previous line of poetry and writes the next one. After getting to the predefined number of lines. The whole poem is displayed. Uber cool, and funny like madlibs.

Edit this response
Write a response Email the author



From: russ
Date: Wed May 5 13:44:08 MST 2004 Subject: Yep!

Yep. This is exactly the sort of stuff that I want to enable.

Edit this response
Write a response Email the author



From: russ
Date: Wed May 5 22:18:20 MST 2004 Subject: Data Format

The data format used in this system will be, essentially, a database. Each different type of upload has its own table with its own different fields. Each uploaded item is a record in the table.

The database is a relational database. So, if you have an upload class which uses other upload classes as fields (and most will), then uploading something will actually upload multiple records. There will be a record for the main upload. There will also be records for each of the constituent fields. Links in the main upload will point to the appropriate records for the fields. Only the main upload will get listed in Latest Uploads.

I figure that (probably) you won't necessarily have a different table for every upload class you've ever created. Instead, the website will create a new table only when the actually data format changes. This further reinforces the idea that the data format of an upload class should be separated from its various functions.

Edit this response
Write a response Email the author



From: russ
Date: Wed May 5 22:37:40 MST 2004 Subject: Cheapo Database

Eventually we'll have to move the website over to a formal database. However, for starters we'll implement the database with a file system. Each type of table will have its own directory. Each record in the table will be a subdirectory. Each field in the record will be a file, directory, or symlink to another record.

Edit this response
Write a response Email the author


Write a blog
Latest Updates

blogs (upload)
eric: Parenting thoughts (8/11/14)
sunnygirl7d: Reuben fishing blog (1 resp) (8/8/14)
samantha: My new blog (8/11/14)
eric: New Website (8/7/14)
dbonilla: Annie Moses Band (3/14/14)
Suki: Ash Wednesday (3/5/14)
andrea: Good news update! (1 resp) (2/3/14)
Carena: More moving help (2/1/14)
Carena: A Friend in Need (3 resp) (1/25/14)
em: Tell me how I can pray (1/24/14)
andrea: Need for Volunteers-Foster Car... (1/19/14)
andrea: suffering (1/7/14)
rodhugen: Two quotes (2 resp) (1/3/14)
cwill: Please pray (2 resp) (1/26/24)
Carena: Polaroid Camera (12/23/13)

pictures (upload)
Suki: Vespers Dec 2012 (1/26/24)
eric: Ordination (3/16/14)
Suki: Soup Supper 2012 (3/17/14)
eric: Belonging 2012 (1/7/14)
eric: sabbath (3/16/14)

bios (upload)
Mike_Wise (1/16/13)
james (11/14/12)
clrclady (1/28/12)
SPark (11/27/11)
benjipark (12/2/10)

music (upload)
Frosted Flakes :
Everywhere j2014 (1/16/14)
Frosted Flakes :
New Found Hope J2014 (1/16/14)
Frosted Fla es :
Trinity Jan2014 (1/16/14)
Skeptic Chickens :
No Condemnation (7/29/13)
Karen and Friends :
Breastplate May 5 (5/10/13)

sermons (upload)
Eric,Ron Layman: The Disciplines RL (3/6/14)
Eric: Habakkuk Part One (1/16/14)
Eric: Noah's Ark (9/27/13)
Eric: The Fall (9/13/13)
Rod: Creation (9/13/13)

Villagersonline.com 2010
Contact Us
(edit) Site Meter
Free Search Engine Submission
Free Search Engine Submission

"Best Viewed at 1024x768 under the light of the full moon in July while Mercury is in Leo
and six pigmy marmosets do the lambada behind you singing Kumbaya" -- User Friendly