(FILECREATED " 3-Feb-87 11:35:10" {QV}<NOTECARDS>1.3K>NEXT>RGPATCH013.;2 5645   

      changes to:  (FNS NC.InsureProperFiling NC.CheckTitle)
		   (VARS RGPATCH013COMS)

      previous date: " 2-Feb-87 17:28:52" {QV}<NOTECARDS>1.3K>NEXT>RGPATCH013.;1)


(* Copyright (c) 1987 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT RGPATCH013COMS)

(RPAQQ RGPATCH013COMS ((* * rg 2/2/87 Fix some places that should return useful values)
			 (* * Changes to NCCARDS)
			 (FNS NC.CheckFiling NC.CheckTitle NC.InsureProperFiling)
			 (* * Changes to NCDATABASE)
			 (FNS NC.InstallDeviceVectorInNoteFile)))
(* * rg 2/2/87 Fix some places that should return useful values)

(* * Changes to NCCARDS)

(DEFINEQ

(NC.CheckFiling
  [LAMBDA (Card)                                             (* Randy.Gobbel "28-Jan-87 16:49")
                                                             (* Check to make sure this card has a contents hook of
							     some sort. If not, hook it up to a contents card.)

          (* * rht 12/8/84: Now checks whether both cards *and* fileboxes have been filed.)



          (* * rht 12/9/84: Now files in orphan filebox if NC.ForceFiling flag is off, without bothering the user.)



          (* * rht 2/9/85: Added call to NC.CardNeedsFilingP)



          (* * fgh 11/12/85 Updated to handle Card and NoteFile objects.)



          (* * fgh 6/9/86 Updated to set operation in progress indicator.)



          (* * rg 1/28/87 Make sure we always return a useful value)


    (LET (OperationInProgress)
         (COND
	   [(NC.CardNeedsFilingP Card)
	     (NC.ProtectedCardOperation Card Filing (COND
					  [NC.ForceFilingFlg (NC.MakeFilingLinks
							       Card
							       (CONCAT "This card (" (
									   NC.RetrieveTitle Card)
									 
							 ") is not currently filed in a FileBox."
									 (CHARACTER 13]
					  (T (NC.PrintMsg (NC.FetchWindow Card)
							    T "This card (" (NC.RetrieveTitle
							      Card)
							    ") is not currently filed in a FileBox."
							    (CHARACTER 13)
							    
						    "It is being filed in the ToBeFiled FileBox."
							    (CHARACTER 13))
					     (NC.HookToOrphanCard Card (fetch (NoteFile 
										    ToBeFiledCard)
									    of (fetch
										   (Card NoteFile)
										    of Card]
	   (T T])

(NC.CheckTitle
  [LAMBDA (Card)                                             (* Randy.Gobbel " 3-Feb-87 11:32")
                                                             (* If card specified by ID has no title, ask the user 
							     for a title.)

          (* * rht 11/19/84: Now checks NC.ForceTitlesFlg before griping.)



          (* * rht 12/6/84: Now sends ID rather than Window to NC.AssignTitle.)



          (* * fgh 11/11/85: Updated to handle new Card objects.)



          (* * rg 2/3/87 Now returns T if card already titled)


    (LET (Title Window)
         (SETQ Window (NC.FetchWindow Card))
         (COND
	   ((AND NC.ForceTitlesFlg (OR (NULL (SETQ Title (NC.RetrieveTitle Card)))
					   (EQUAL "Untitled" Title)))
	     (NC.PrintMsg Window T "This note card has no title." (CHARACTER 13))
	     (NC.AssignTitle Card T))
	   ((AND (NULL NC.ForceTitlesFlg)
		   (NULL (NC.RetrieveTitle Card)))
	     (NC.AssignTitle Card NIL "Untitled"))
	   (T T])

(NC.InsureProperFiling
  [LAMBDA (Card)                                             (* Randy.Gobbel " 3-Feb-87 11:33")
                                                             (* Called when any type of note card is being quitted 
							     from, i.e., closed)

          (* * rht 12/9/84: Moved check of the NC.ForceFiling flag into NC.CheckContentsHooks.)



          (* * fgh 11/12/85 Updated to handle Card and NoteFile objects.)



          (* * fgh 6/27/86 Changed format to allow being killed by ERROR!)



          (* * rg 1/28/87 Now returns CANCELLED if any of the component tests fail)


    (COND
      ((AND (NULL (NC.FetchBeingDeletedFlg Card))
	      (NC.CheckTitle Card)
	      (NC.CheckFiling Card))
	T)
      (T (QUOTE CANCELLED])
)
(* * Changes to NCDATABASE)

(DEFINEQ

(NC.InstallDeviceVectorInNoteFile
  [LAMBDA (NoteFile PublicOrPrivate)                         (* Randy.Gobbel " 2-Feb-87 17:07")

          (* * Figure out the appropriate device vector for NoteFile from its FullName and install in the device vector 
	  slot.)



          (* * fgh 5/23/86 First created.)



          (* * kef 7/23/86: Added the GETD NCCLIENT.AREYOUTHERE expression so this function can run without the aid of the 
	  NCCLIENT software.)



          (* * kef 7/23/86: Checks at the end to ensure that some sort of NoteFileDevice was installed.)



          (* * fgh 9/1/86 Adapted to use NC.DeviceVectorForHost.)



          (* * rg 2/2/87 Removed unused NSAddress var)


    (LET (Host)
         (SETQ Host (FILENAMEFIELD (fetch (NoteFile FullFileName) of NoteFile)
				       (QUOTE HOST)))
         (replace (NoteFile Device) of NoteFile with (NC.DeviceVectorForHost Host 
										  PublicOrPrivate))
         (OR (type? NoteFileDevice (fetch (NoteFile Device) of NoteFile))
	       (NCP.ReportError "Error in determining device vector for NoteFile"])
)
(PUTPROPS RGPATCH013 COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (722 4342 (NC.CheckFiling 732 . 2443) (NC.CheckTitle 2445 . 3521) (NC.InsureProperFiling
 3523 . 4340)) (4377 5564 (NC.InstallDeviceVectorInNoteFile 4387 . 5562)))))
STOP