[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

563.0. "Script to export file cabinet?" by BIGUN::BRUCE () Fri Apr 24 1992 05:35

    One of our customers is moving away from ALL-IN-1 to a distributed
    Macintosh Environment.  As part of the conversion/upgrade, they will
    need to move the users ALL-IN-1 documents to the Macintosh platform.

    We have been asked by the prime contractor for the bid to provide a
    quote to write a script with the following specifications:

       A script is required which will copy each users file cabinet to a
       WPS-PLUS file under VMS.  The script will create a "top-level"
       directory with the same name as the users ALL-IN-1 user name.  It will
       then create a subdirectory for each folder in the cabinet - replacing
       spaces and characters not valid under VMS with an underscore.  It will
       then copy each document in the folder to the appropriate subdirectory,
       naming it the same name as in ALL-IN-1 with an extension of .WPL - once
       again checking for special characters.  Duplicate document names will
       be retained as individual VMS files with a unique identifier eg #1, #2
       appended to file name.

       The script will also copy any mail messages from the mail folders in a
       similar fashion.

       The script will cycle through all the users on the ALL-IN-1 system.  It
       will ignore 20/20 documents.

    Before I start hacking code, has anyone done anything like this before,
    or have any pointers or tips on how it might be done?

    regards

    Malcolm
T.RTitleUserPersonal
Name
DateLines
563.1not what you asked...CHRLIE::HUSTONFri Apr 24 1992 15:066
    
    I know this is not what you asked for, but would a MAC interface to 
    the IOS file cabinet help?
    
    --Bob
    
563.2YesBIGUN::BRUCEMon Apr 27 1992 00:376
    Yes, a MAC interface to the IOS file cabinet would be a great help.
    
    Any chance of getting one within the next two months?  :-)
    
    Malcolm
    
563.3script to cycle through folderRUNAWY::NTTDA::MENARDMon Apr 27 1992 18:0049
The attached script cycles through a particular folder and creates files in TXT
and WPL format in predetermined diretories.  You'll have to add code to build
the subdirectories on the fly and to cycle through all folders in file cabinet.

!	
!	Select folder; default to current folder 
!
	GET #SEARCH_FOLDER = OA$CURDOC_FOLDER
	FORM SELECT_FOLDER
	.IF OA$FORM_DISPOSE EQ 0 THEN .EXIT
	.IF #SEARCH_FOLDER EQS "" THEN .EXIT
	GET #COMPARE_FOLDER = #SEARCH_FOLDER
!
!	Select output Destination
!	
	GET #VMS_TEXT_DIR = "APPLICATIONS:[PROPOSALS_DEV.CONTENT.TXT]"
	GET #VMS_WPL_DIR  = "APPLICATIONS:[PROPOSALS_DEV.CONTENT.WPL]"
!
! Make the first document in the selected file the current file
!
	CABINET SELECT #SEARCH_FOLDER,,,
	GET #TOP_DOC = OA$CURDOC
!
.LABEL COPY_NEXT
!
	GET OA$DISPLAY = OA$CURDOC_TITLE
	FORCE
!	
!  Create the text version
!
	GET #VMSFILE = #VMS_TEXT_DIR OA$CURDOC_TITLE ".TXT"
	COPY OA$CURDOC_FILENAME  #VMSFILE
!	
!  Create the WPL version
!               
	GET #VMSFILE = #VMS_WPL_DIR OA$CURDOC_TITLE ".WPL"
	GET OA$DCL = "COPY " OA$CURDOC_FILENAME " " #VMSFILE
!
!  Check for end of folder; if not end go to beginning of loop
!
	CABINET NEXT_DOCUMENT #TOP_DOC
	.IF OA$CURDOC_FOLDER NES #COMPARE_FOLDER THEN .GOTO EXIT_IT
	.GOTO COPY_NEXT                            

.LABEL EXIT_IT
	DISPLAY "FINI"
	.EXIT


563.4script to remove spaces from tiitleRUNAWY::NTTDA::MENARDMon Apr 27 1992 18:1238
This command procedure will remove spaces from a title so that you can make a 
valid VMS file name.  Use symbols to pass the title back and forth from a script.
You may have to hack a little to get it to work like you want, but at least it's
a start.

RAM

$!------------------------------------------------------------------------------
! Purpose:
$! 	The purpose of this command file is to take the title of the current
$!      WPL document and create the filename of the document to be transfered.
$!
$!------------------------------------------------------------------------------
$ NEW_TITLE = ""
$! Title is parameter P1
$ COPY_TITLE = P1
$ COPY_TITLE_LEN = F$LENGTH(COPY_TITLE)
$ SEARCH_STRING:
$! 
$! Search throught the string searching for blanks.  When one is found, take the
$! text preceding it and add to already created title.  An occurence of a blank
$! will be replaced with an underscore.  Continue until end of string.
$!
$ BLANK_LOC = F$LOCATE(" ", COPY_TITLE)
$ NEW_TITLE = NEW_TITLE + F$EXTRACT(0,BLANK_LOC,COPY_TITLE)
$ NEW_COPY_TITLE = F$EXTRACT(BLANK_LOC+ 1, COPY_TITLE_LEN-BLANK_LOC, COPY_TITLE)
$ COPY_TITLE = NEW_COPY_TITLE
$ COPY_TITLE_LEN = F$LENGTH(COPY_TITLE)
$ IF COPY_TITLE_LEN .EQ. 0 THEN GOTO FINISH_AND_EXIT
$ NEW_TITLE = NEW_TITLE + "_"
$ GOTO SEARCH_STRING
$ FINISH_AND_EXIT:
$! Create the entire destination spec and copy the file to it
$ DEST_SPEC = P3 + NEW_TITLE + ".WPL"
$ COPY 'P2' 'DEST_SPEC'
$ EXIT


563.5What's different?SHALOT::NICODEMWho told you I'm paranoid???Mon Apr 27 1992 23:423
	RE: .4

	Is there a reason you didn't simply use the MAKE_FILE_NAME function?
563.6ignoranceDEVOTN::NTTDA::MENARDTue Apr 28 1992 17:441
re: -1  in my defense, I didn't write .4!  MAKE_FILE_NAME is definitely the way to go!!