Home   -   Computerkurs   DemoMatrix   Editpointstatic   Folderwatcher   Gipsydrive   Licenses   Shrinkseries   V4   More...  

Attic   Carom   Contao   Downloads   Gallery   Jgara   Jren   Jtel   Odbctest   Stacks   V4N   VB   VBA   Wakati   Workspace  

Aerialview   Designpatterns   Thirdpartyproducts   References   Styleguides   Learning   Tasks  

Joes   Docu   Modules   Rename   Reports   Telegraph   Trafo   Trees   Undo  

Previous page Home chapter Next page

Trilo - Downtown - More - V4N - Tasks

Multiparallel Renaming

Rename Orderdocuments while having database and filesystem in sync. It's about imported order files mostly DOC files, which are stored in archive directories, and must sometimes shifted.

Task for a novice having a four week practical in Dotnet/C-Sharp programming, trying to leave useful code behind. The task: Write a button to rename files in the V4/V4Net/Joes storage area synchronous in the database and on the filesystem.

Orderdocuments coming into the office, are input into V4/V4Net/Joes to be further processed. The original DOC/DOCX/PDF files are archived. They may contain details we want recall later, but which are not input into the database. In the database's Orderdocuments Table is a field referring to the file.

Sometimes we need to rename the files or shift them around in directories. This must be done through a method in Joes, which keeps the field in the Orderdocuments Table synchronous.

Step 1   -   Inspect the existing User Interface, where the new control would fit in. Paint a prototype of the control you imagine.

Step 2   -   Somehow, the files must be selected, and the new filenames or directory must be input. Plan a user interface procedure, how the user can select or input those parameters.

Step 3   -   Inspect the code behind the planned control and figure out how from there, your call can propagate to the place where the task finally is executed.

Step 4   -   Prepare the place for the executing code, means write the method framework for a functioning call plus returning success or error messages and provide a means for breaking the run.

Step 5   -   Figure out, what methods Dotnet provides you for searching on the harddisk, for selecting and renaming files. Figure out, what storage variables or classes are suited to handle lists of filenames.

Step 6   -   Write the code to rename one file.

Step 7   -   Write the code to iterate over a list of files and rename them all.

Step 8   -   Strap the user interface and the executing method together so the user can work with it. She or he wants interactively select files and their new names and receive feedback about success or failure.

Step 9   -   Get access to the database.

Step 10   -   Write the access to the database.

Step 11   -   Extend the already existing loop for adapting the filenames in the Orderdocuments Table.

Step 12   -   Above strategy was: iterate over the filesystem while watching the Orderdocuments Table and keeping it synchronous. The opposite strategy should be considered as well: Iterate over the table and keep the filesystem in sync.

Step 13   -   . . .

   Issue (20081219°1221)
   Renaming files in a Subversion Workspace:
   Problem: When using the filesystem rename feature as beeing intended by Joesrenamer, then (1) the Subversion history of the file is broken and (2) in the repository, storage is wasted due to deleting/adding instead of shifting the file.
   First-idea: It's easy - just use the Subversion rename command instead of the filesystem command. Joesrenamer will detect the change anyway.
   BUT: When using the Subversion rename command, not only the one wanted file is involved, but as well 'unpredictable' changes in the .svn shadow directories are made. And that disturbs Joesrenamer.
   Try the following solution: In Joesrenamer, just ignore the .svn shadow directories. Will that help?

Renamer Ticket   (20080716°1634 )   Fill in the fields below to start with the task.
Ticket   :   subscriber-name = K., checkin-timestamp = (now), checkout-timestamp = (quarteryear-later)
Step Short statement how and why Status
Prepare workspace. It is Joesrename Repository. It's still empty. You need to copy here from v4net components to make it run independentyl. Find the minimum components necessary. Prepare the workspace until it compiles. So the novice has a startpoint. please S./N.
Inspect existing V4Net GUI modules. Look for a place to hook. . .
Select existing control as template and implement your prototype GUI side by side. . .
Select existing code structure as template and implement your prototype engine side by side of it. . .
Connect your two structures. . .
. . wanted
. . processing
. . ready

(Task 20080716°1634 Multiparallel File Renaming)

Comments and Snippets

For first ideas about a filerenaming user interface, inspect the following existing standalone renaming tools.
  -   Rename-IT. Downloads Repository archive (20080711°2321)
  -   Metamorphose. Downloads Repository archive (20071111°1901)
  -   . . .
Of course, those programs have much more sopinsticated interfaces, as you need or want. It is interresting, what different file selection mechanisms and interfaces exsit. This is no trivial thing! For us is a simple wildcard commandline sufficient.

(log 20080822°0221 ncm)   New chapter name "Multiparallel Renaming" instead of "Joe's Renamer". Not only this sounds more adventurous, there is also a specific idea with it. Until now, the idea was, to watch renaming in the filesystem and then keep the database in sync, or vice versa. Now the idea might be, to maneuver an independend name list between those two, and have instances of arbitrary objects attatched, which are then all kept in sync. Until now, we only considered exactly two such physical instances: the filesystem and the database entries. But with such intermediate abstract list object, names at even more places could be kept in sync, e.g. an additional external DMS or any hypertext links somewhere or whatever. Riddle: Which Design Pattern were wanted for such feature?

Datenschutz Imprint

http://downtown.trilo.de/tasks_20080717-1235_jren_.html © 2008 - 2018 Trilo Software e.K.   (20080716°1634)