DELTA 79 0 3386 SVN―eπuVΕsnˆo†Š†ŽG‹€l;™G€2b›€aJœ™!g€+  €i¦jŒƒ¨S„2‘]•‚«b€ΎX4volvedentire \item Time-stamps: We assume all files have a time-stamp that tells us the last time this file was modifiedThis will not be the case if the user specifies that they wish to transfer files manually. In this case, the synchronizer exits when the user has completed all desired transfersthe Personal Device Synchronizer module. The methods are sorted in order of appearance in the program. They are sorted in a depth-first-search manner, so each section is completely explained before we move to the next section\\ \method {synchronizeno error. If sync was unsuccessful, our return value signifies an error} \begin{verbatim} beginSync(device, known_devices, known_computers) if acquaintedWithComputererror output, symbolizing that we could not sync \end{verbatim} \method {acquaintedWithComputer(device)} {Determine if the given device is known by thisWithComputer \end{verbatim} \end{verbatim} no error. If sync was unsuccessful, our return value signifies an error} \begin{verbatim} firstSync(device) determine from the user whether this device should be synchronized automatically with the database or if the user would prefer to manually transfer files if manual sync manualTransfer(device) if auto sync add this device's ID to the list of known_devices on the computer create a change_log that is initially empty for this device if the device has never been synced with another computer completeTransfer(device, target=device) if the device has been synced with another computer in the past if the user wants to overwrite one version completely completeTransfer(device, target), where target depends on their response otherwise let the user manually decide which files to keep on each version of the database using the manualTransfer method after the user transfers files, ask which copy is the master set target to be the other and run completeTransfer(device, target) in order to ensure that the versions are synchronized \end{verbatim} \method {manualTransfer(device)} {Allows users to manually transfer specific files between a device and a computer} {Takes the device as input, and assumes access to files specified above} {Exits when the user specifies that they have transfered all files they wish to} \begin{verbatim} This method is straight forward. Allow the user to copy, move, delete, add and rename files on the device and computer. \end{verbatim} \method {completeTransfer(device, target)} {Transfer the entire database from the computer to the specified device or vice versa. This will happen the first time a device is synchronized with a computer, or when a device/computer wants to throw out all old data.} {Takes a device as input, and a target which will be either the device or the computer. Assumes access to the database and all files described above} {Synchronizes the two databases by completely overwriting one} \begin{verbatim} completeTransfer(device, target) if the target is the device copy the entire database from the computer to the device this includes a change_log and a known_computers file both are initially empty add this computer's ID to the known_computers file if the target is the computer copy the entire database from the device to the computer this includes a change_log and a known_devices file both are initially empty add this device's ID to the known_devices file \end{verbatim} \method {syncFiles(device)} {Automatically synchronize the computer with the given device. This is performed on a device and a computer that have been previously synchronized} {The device with which we will synchronize. We assume access to the files listed above.} {Exits successfully when all files in both \emph{change\_log}s have been copied appropriately.} \begin{verbatim} syncFiles(device) check to see if any files have been changed on the device or computer since the last synchronization by running outOfDateWithComputer(device) if this function returns false, exit successfully otherwise create an empty array, update_list, that will store the paths of all files that need to be updated update_list = getFileList(device) for each element in update_list, copy the file from the source path to the destination path \end{verbatim} \method {outOfDateWithComputer(device)} {Determines if the files on the computer or the given device have been updated since the last synchronization} {Takes the device as input, assumes access to the files listed above} {Returns true if modifications have been made to the database by either machine} \begin{verbatim} outOfDateWithComputer(device) return true if the change_log on the computer (for this specific device), or the change_log on the device (for this specific computer) are non-empty \end{verbatim} \method {getFileList(device)} {Reduces the \emph{change\_log}s on the computer and device into usable data.} {Takes the device as input, assumes access to both \emph{change\_log}s} {Returns a list of lists. Each sublist contains a path to the source file (the one to be copied from) and a path to the destination file (the one to be copied to). The elements in this list are all the files that need to be updated, with no repeats or exceptions.} \begin{verbatim} getFileList(device) we need two lists to store the files that need to be updated device_update_list - files that have been updated on the device computer_update_list - files that have been updated on the computer each element in these lists stores the source and destination of the file to be updated conflict_list is a list of files that have conflicts for each file in the change_log on the device, if this file exists in the device_update_list move on otherwise, add this file to the device_update_list for each file in the change_log on the computer, if this file exists in the deviceUdpateList, add it to the conflict_list (if it already exists, do nothing) remove it from device_update_list otherwise, add this file to the computer_update_list make a overall list called update_list set it equal to the concatenation of computer_update_list, device_update_list, and manageConflicts(conflict_list) updateChangeLogs(device, update_list) return update_list \end{verbatim} \method {manageConflicts(conflict\_list)} {Resolves all conflicts, which occur when the computer and device have both updated a specific file since the last sync} {Takes the list of such files, and the device being synchronized, as input.} {Returns a list of lists, where each sublist stores the destination and source files. These depend on how the conflict is resolved} \begin{verbatim} allow the user to by-pass the following process by choosing to always keep the file with the newer time-stamp create a list of lists called resolved_list for each item in conflict_list, alert the user that there is a conflict ask which file they would like to keep if they do not want to decide now, store both files on both systems with a suffix of 1 or 2 deleted files are a special case ask the user if they would like to keep the new version or do not want the file anymore. if they defer judgement, save the file with the current name \end{verbatim} \method {updateChangeLogs(device, change\_list)} {When changes are made during a synchronization with one device, these changes must be reflected in the other \emph{change\_log}s.} {Takes the device being synchronized, and a list of lists. Each sublist contains the source of the file modified and the destination.} {Updates all \emph{change\_log}s so that they reflect the changes made by this synchronization. This includes clearing the \emph{change\_log}s for the devices that just synchronized.} \begin{verbatim} for each element in change_list, if the destination is on the device add this file to the change_logs for all computers except for the one we are currently syncing with if the destination is on the computer add this file to the change_logs for all devices except the one being synchronized currently clear the change_log for the current device on the current computer, and the change_log for the current computer on the current device. \end{verbatim} \end{document}ENDREP DELTA 78 0 5004 SVN¨{Ι{X©(+‚m<€M‚„)'†1‚‡Y‚/‰vŒ‚lŒ1i‡4‘{’;€“6”z ‚7—… ™?€e„z‘€‘yNote: What is shown is a second-design of the Importer. After working on the implmentation of the module, it was clear that the original component specifications were not defined with correctly modularity.iiiimportClassc \itemv. \item \emph{downloadLink(link, target)}: Will download a classcast or webpage as the file ``target''. \item \emph{diff(file1, file2)}: Similar to the \textsc{diff} program found on unix systems. It will find the lines that differ between file1 and file2. It will return these differences in an array. \item \emph{relevancyCheck(text)}: Given some lines of text, this method will check with known course and assignment identification algorithms if the text pertains to course information or an assignment. \item \emph{checkIfUpdate(text, file)}: Checks if the text provided is an update of information already stored in a ``course'' file. \item \emph{updateCourseFile(text, file)}: Uses \textsc{checkIfUpdate} to deermine whether the text is an update or new information. If it is an update, the information will be replaced in the ``course'' file, and if the information is new, it will be added to it. \item \emph{updatePreviousAssignment(assignment, data)}: Will replace previous assignment information with new assignment information. \item \emph{updatePreviousCourseInformation(assignment, data)}: Will replace previous course information with new course information. \item \emph{importNewAssignment(data)}: Will create new assignment. \item \emph{importNewInformation(data)}: Will create new course information. \item \emph{screenscrape(link)}: Apply screenscraping algorithms to find assignments and course information. \end{itemize} %Third Level \subsection{WebImporter} \textbf{Requirements:} \begin{itemize} \item The WebImporter must be able to store course and assignment information in the database. It will read the contents of the webpage by screenscraping for relevant information using appropriate parsing algorithms. \item The WebImporter must be able to periodically examine imported webpages for either updates on previous course or assignment information, or new course and assignment information. \end{itemize} \noindent \textbf{Interface:} \begin{itemize} \item \emph{updateLink(link)}: Will check for differences from local copy of the webpage against the live webpage for updates or new information. \item \emph{checkPreviousAssignment(link)}: Will check local copy of the webpage with the live webpage if the data its been given is a previous assignment or not. \item \emph{checkPreviousCourseInformation(link)}: Will check local copy of the webpage with the live webpage if the data its been provided is previous course information or not.ersonalDeviceExporter} component personal deviceDevice(file, device)}: If the user wants Cue to automatically sync all files, then Cue's database will be synchronized with the files on the \emph{device}. Otherwise, the user can manually select which files should be transferedPersonal Device Exporter} \textbf{Requirements:} The following requirements are applicable to this component: \begin{itemize} \item Allow users to transfer data stored in Cue's database between a computer and a personal device such as an iPod or PDA. \item Allow the user to manually select which files to transfer. \item Automatically synchronize all files on the computer and device, if specified. \item Provide a viewable format for assignments and to-do lists on devices that support this feature. \item Provide a viewable format for documents, such as class notes, on devices that support this feature. \end{itemize} \noindent \textbf{Interface:} The personal device exporter will be an abstract class that implements the functionality (such as synchronization) that is common for all devices. There will be particular classes that implement the functionality that is device specific. In the abstract class, the following methods are of interest: \begin{itemize} \item \emph{synchronize(device)}: Depending on user input, this will either automatically synchronize all files on the device with those on the computer, or allow the user to manually transfer files. (This is a considerably complicated module that is designed in detail in the Personal Device Synchronization document) \item \emph{detectDevice(device)}: Identifies valuable information about the device that is going to by synchronized. For instance, it will identify the model and ID numbers of the device, since these data are necessary in the synchronization method. \item \emph{copyFiles(source, destination)}: Copies files from a given source to a destination. This will be specific to each device, since there are a variety of operating systems that personal devices run. \item \emph{removeFiles(location)}: Removes the file found in the location specified. Again, this is device-specific. \item \emph{convertFileType(file, device)}: If desired, this method converts specific files to a format that is viewable on the specified device. Again, device-specific. \end{itemize} %%Third Level %\subsection{Synchronizer} %\textbf{Requirements:} %\begin{itemize} % \item First requirement %\end{itemize} %\noindent \textbf{Interface:} %\begin{itemize} % \item First method %\end{itemize} \end{document} ENDREP id: 1b.0.r95/14479 type: file pred: 1b.0.r81/49732 count: 2 text: 95 0 9045 14453 03a2ab2bc9c96ae81d30be9332b4c5a0 props: 79 3399 29 0 ff5c3c1f7bdb48ba0201950780ae7e31 cpath: /project3/individual_components/lamotte-mitchell/sync.tex copyroot: 0 / PLAIN K 13 iPod_idea.rtf V 18 file 19.o.r75/3686 K 8 sync.tex V 19 file 1b.0.r95/14479 END ENDREP id: 16.0.r95/14825 type: dir pred: 16.0.r81/50081 count: 4 text: 95 14727 85 85 50b0c4908d0568af89693b08dacc936a cpath: /project3/individual_components/lamotte-mitchell copyroot: 0 / PLAIN K 16 lamotte-mitchell V 18 dir 16.0.r95/14825 K 7 sampson V 16 dir 17.0.r93/638 K 8 striplin V 17 dir 18.0.r85/1512 END ENDREP id: 15.0.r95/15142 type: dir pred: 15.0.r93/940 count: 13 text: 95 15009 120 120 69c5f3c6d9cd7d96eff9a7431871fbe1 cpath: /project3/individual_components copyroot: 0 / id: 14.0.r95/15310 type: file pred: 14.0.r94/1429 count: 12 text: 95 9068 5388 9467 5fd3d93bf5443f84bb58476bd10713b9 props: 66 0 29 0 ff5c3c1f7bdb48ba0201950780ae7e31 cpath: /project3/component_specs.tex copyroot: 0 / PLAIN K 20 architecture.graffle V 19 file 10.0.r83/28052 K 16 architecture.tex V 18 file 13.0.r77/1095 K 24 architecture_diagram.pdf V 19 file 1a.0.r83/28269 K 19 component_specs.tex V 19 file 14.0.r95/15310 K 21 individual_components V 18 dir 15.0.r95/15142 K 16 project_plan.odt V 17 file z.0.r68/9460 K 16 project_plan.tex V 16 file 1c.0.r84/45 K 22 project_plan_table.pdf V 19 file 1d.0.r81/49525 K 11 svninfo.sty V 18 file 12.0.r49/5199 END ENDREP id: y.0.r95/15982 type: dir pred: y.0.r94/2094 count: 53 text: 95 15529 440 440 16deaa33a9ad2531f699b35758095420 cpath: /project3 copyroot: 0 / PLAIN K 8 project2 V 16 dir x.0.r41/3433 K 8 project3 V 17 dir y.0.r95/15982 END ENDREP id: 0.0.r95/16215 type: dir pred: 0.0.r94/2324 count: 95 text: 95 16127 75 75 a82b8b9405c3e42f171f947c938aa6a7 cpath: / copyroot: 0 / 1b.0.t94-1 modify true false /project3/individual_components/lamotte-mitchell/sync.tex 14.0.t94-1 modify true false /project3/component_specs.tex 16215 16350