[rt-commit] [svn] r603 - in experiments/orange-elephant: . doc lib/OE ui

jesse at fsck.com jesse at fsck.com
Thu Mar 18 23:24:43 EST 2004


Author: jesse
Date: Thu Mar 18 23:24:42 2004
New Revision: 603

Added:
   experiments/orange-elephant/lib/OE/
   experiments/orange-elephant/lib/OE/Record.pm
   experiments/orange-elephant/ui/EditEmployee
Modified:
   experiments/orange-elephant/   (props changed)
   experiments/orange-elephant/doc/arch
Log:
Checking in more expermients

Modified: experiments/orange-elephant/doc/arch
==============================================================================
--- experiments/orange-elephant/doc/arch	(original)
+++ experiments/orange-elephant/doc/arch	Thu Mar 18 23:24:42 2004
@@ -1 +1,72 @@
+UI
+
+	Applications have:
+		Pages
+			
+
+
+
+	Pages contain:
+		other pages
+		UI components
+
+
+
+	Controller takes attribute-edit forms and performs updates
+
+DataModel
+
+	Applications have 
+		Pages
+		ObjectTypes
+
+
+	Objects have (immutable):
+		
+		Application
+		Type
+		UUID
+
+
+
+
+	Exposes a simple API that supports:
+
+		Load an object by UUID
+		Find objects matching some criteria
+		Get attribute
+		Set attribute
+		HTML Form entry to edit attribute
+
+
+		Show object history	
+
+
+	
+
+Merge tool
+
+	For a given application:
+
+		Tell a peer what objects we have
+		Get the peer's list of objects
+
+		For any object both the peer and I share:
+			Get the peer's txns
+				for each txn the peer has that I don't:
+					apply the txn locally
+					prompt for resolution on conflict.
+					(basic conflict resolution is based on time of last merge with the peer)
+
+				for each txn I have that the peer doesn't:
+					send the txn to the peer as an update
+
+		For any object the peer has that I don't:
+			Grab the object and all its txns
+
+
+		For any object I have that the peer doesn't:
+			Push it all up.
+			
+	
 

Added: experiments/orange-elephant/lib/OE/Record.pm
==============================================================================
--- (empty file)
+++ experiments/orange-elephant/lib/OE/Record.pm	Thu Mar 18 23:24:42 2004
@@ -0,0 +1,67 @@
+# Proprietary Unpublished work of Best Practical Solutions.
+# This code is not licensed for use or redistribution
+
+use strict;
+use warnings qw/all/;
+
+package OE::Record;
+
+sub new  {
+  my $proto = shift;
+  my $class = ref($proto) || $proto;
+  my $self  = {}; 
+  my $actor = shift;
+  $self->{'actor'} = shift;
+  bless ($self, $class);
+  return $self;
+}
+
+
+sub load {
+	my $self = shift;
+	my $type = shift;
+	my $uuid = shift;
+
+	$data = YAML::LoadFile($type."-".$uuid);
+	$self->{'values'}  = $data->{'values'};
+
+
+}
+
+
+
+sub value {
+	my $self = shift;
+	my $attr = shift;
+	if (@_) { 
+		my $newval = shift;
+		$self->add_transaction(attribute => $attr, 
+					old => $self->value($attr),
+					new => $newval);
+
+		$self->{'values'}->{$attr} = $newval;
+
+	}
+	return $self->{'values'}->{$attr};	
+}
+
+sub attributes {
+	my $self = shift;
+	return keys %{$self->{'values'}};
+}
+
+
+sub add_transaction {
+	my $self = shift;
+	my %args = (attribute => undef,
+		    old => undef,
+	            new => undef,
+		    actor => $self->{'actor'},
+		   @_);
+
+
+
+	return(1);
+
+
+}

Added: experiments/orange-elephant/ui/EditEmployee
==============================================================================
--- (empty file)
+++ experiments/orange-elephant/ui/EditEmployee	Thu Mar 18 23:24:42 2004
@@ -0,0 +1,17 @@
+
+Welcome, $CURRENT_USER.Name.  To change your name, just type it here: $CURRENT_USER~Name
+
+Edit the profile for $user.Name in the table below.
+
+| Name|$user~Name  __Currently $user~Name__ |
+| Title|$user~Title |
+
+A list of all system users whose names start with 'A' and whose phone numbers contain 8:
+
+ at FIND Users ( Name =~ /^A/ && Phone =~ /8/) AS $user
+
+	| $user.Name | $user.Phone | [Edit | EditUser?user=$user.UUID ] |
+
+
+
+



More information about the Rt-commit mailing list