Info Quick-Start

Copyright  2000-2022, by HelmutZinn

Version 24-July-2023

This program is free software; you can redistribute it and/or modify it under the terms of the "BlackBox Component Builder Open Source License".

Saved from 'Component Pascal Collection' url http://www.zinnamturm.eu

Check, collect, link, replace & search all documents

The Info subsystem is a collection of tools to manage links and documents. It supports the following tasks:

	● Open a document in the same mode (browser or edit) as the current one
	● Start a program via link
	● Translate a website
	● Search through all documents
	● Create link list (table of contents)
	● Collect the documents
	● Correct text & links via change list
	● Build Cross-reference (subject index)
	● Check filenames
	● Check links
	● Replace in all documents

If you insert the following link in a odc document
	<InfoCmds.Start('http://www.oberon.ch')>OberonMicrosystems<>
then you have a link to the website of ...

If you insert the following link in a odc document
	<InfoCmds.Start('mailto:my.friend@mailbox.com')>mailto:my.friend@mailbox.com<>
then you can send a mail to ...

Another application of this subsystem is to translate a website. Select an url in your text document (e.g.: http://www.oberoncore.ru) and press the key Shift+Ctrl+L simultaneously. You get the translation of the oberonecore website from Russian to English.


Contents:

	1	Installation
	2	Howtouseit?
	3	Changelog
	4	Reference


1	Installation	 Up

1. Preconditions.
	Check that you have installed the Pac subsystem.
	Check that you have installed the Ctls subsystem.
	Check that you have installed the TboxTimer subsystem.
	Check that you have installed the Dos subsystem.

2. Unpack all files via Tools -> Decode. 
	
	List of contents:
		Info/Docu/Quick-Start.odc
		Info/Docu/Abstract.odc
		Info/Docu/Control-Commands.odc
		Info/Docu/Helpdesk.odc
		Info/Docu/Notes.odc
		Info/Docu/Shell-Commands.odc

		Info/Mod/Catalog.odc
		Info/Mod/CheckFilenames.odc
		Info/Mod/CheckLinks.odc
		Info/Mod/Cmds.odc
		Info/Mod/Collect.odc
		Info/Mod/Dialog.odc
		Info/Mod/ForEachEntry.odc
		Info/Mod/ForEachFile.odc
		Info/Mod/Index.odc
		Info/Mod/Links.odc
		Info/Mod/Log.odc
		Info/Mod/Look.odc
		Info/Mod/MissingLinks.odc
		Info/Mod/ReplaceLinks.odc
		Info/Mod/ReplaceTexts.odc
		Info/Mod/Search.odc
		Info/Mod/Trans.odc
		Info/Mod/Web.odc

		Info/Rsrc/CheckFilenames1.odc
		Info/Rsrc/CheckFilenames2.odc
		Info/Rsrc/CheckLinks.odc
		Info/Rsrc/CollectDocuments.odc
		Info/Rsrc/CreateCatalog.odc
		Info/Rsrc/CreateLinks.odc
		Info/Rsrc/LinkList.odc
		Info/Rsrc/Menus.odc
		Info/Rsrc/Replace.odc
		Info/Rsrc/Search.odc
		Info/Rsrc/Strings.odc
		Info/Rsrc/Web.odc

		Info/Rsrc/de/Strings.odc
	 List of contents 

3. Compile the following Modules 
	 "DevCompiler.CompileThis" 
	InfoDialog InfoLog InfoCmds InfoTrans InfoForEachEntry InfoForEachFile
	InfoCatalog InfoLook InfoIndex InfoSearch InfoCheckFilenames
	InfoLinks InfoReplaceLinks InfoReplaceTexts InfoCollect InfoMissingLinks InfoCheckLinks InfoWeb

	
	Replace in Winapi the definition of the PROCEDURE GetFullPathNameW* against the following one
	and compile WinApi.

	PROCEDURE GetFullPathNameW* (lpFileName: PtrWSTR; nBufferLength: INTEGER; lpBuffer: PtrWSTR; VAR [nil] lpFilePart: PtrWSTR): INTEGER;
	(*END GetFullPathNameW;*)
	 CPC Notes: If you have a compiling errors 

4. Update menus:
	"StdMenuTool.UpdateAllMenus"


6. Change the configuration in the file System/Mod/Config.odc for autostart of helpdesk 
		MODULE Config;

			IMPORT Dialog, Converters, OleData, InfoCmds, HostMenus, StdLinks, TextCmds;
	
			PROCEDURE Setup*;
			BEGIN
				...
				(* Dialog.Call("StdLog.Open", "", res); *)
				InfoCmds.SetBrowserMode; 
				InfoCmds.OpenTopic('Uhl/');
				HostMenus.TileHorizontal;
				TextCmds.find.ignoreCase := TRUE;
			END Setup;

		END Config.
	and compile it.

This change is done for the stand alone user version only. After the start of BlackBox it automaticlly opens the document Uhl/Inhalt.odc in browser mode and expand it over the whole window. At the developer station I use the subsystem Desktop instead.
 Ready 


2	How to use it?	 Up

2.1Openadocumentinthesamemode(browseroredit)asthecurrentone
2.2Startaprogramvialink
2.3Translateawebsite
2.4Searchthroughalldocuments
2.5Createlinklist(tableofcontents)
2.6Collectthedocuments
2.7Correcttext&linksviachangelist
2.8BuildCross-reference(subjectindex)
2.9Checkfilenames
2.10Checklinks
2.11Replaceinalldocuments


2.1 Open a document in the same mode (browser or edit) as the current one
Blackbox documents knows 4 states: browser mode, edit mode, hide marks and show marks. You can change this states via menus:

	Set Edit Mode	Dev -> Edit Mode	"StdCmds.SetEditMode"
	Set Browser Mode	Dev -> Browser Mode	"StdCmds.SetBrowserMode"
	Show Marks	Text -> Show Marks	"TextCmds.ToggleMarks"
	Hide Marks	Text -> Hide Marks	"TextCmds.ToggleMarks"

The frameworks provides 2 procedures for opening documents:

	"StdCmds.OpenBrowser('Std/Docu/Links', 'Docu StdLinks')"		Open Docu StdLinks in Browser Mode
	"StdCmds.OpenDoc('Std/Docu/Links')"		Open Docu StdLinks in Edit Mode

The Subsystem Info adds the procedure:

	"InfoCmds.OpenDoc('Std/Docu/Links')"		Open Docu StdLinks in the current Mode

which opens a document in the same state as the current one is open. For creating and editing links please read the StdLinks documentation.


2.2 Start a program via link
In the above descriptions we used links for opening Blackbox documents. Now we start other Windows programs via a link.

Starting the windows explorer
	"InfoCmds.Start('shell:MyComputerFolder')"	shell:MyComputerFolder
	"InfoCmds.Start('shell:Desktop')"	shell:Desktop
	"InfoCmds.Start2('explorer /e, D:\Blackbox\ProjectAll\')"	explorer /e, D:\Blackbox\ProjectAll\

You find a list of shell commands in Info/Docu/Shell-Commands

Starting command line
	"InfoCmds.Start('cmd')"	cmd
	"InfoCmds.Start2('cmd /k dir')"	cmd /k dir
	"InfoCmds.Start2('cmd /k ipconfig/all')"	cmd /k ipconfig/all

Starting a windows control programs
	"InfoCmds.Start('compmgmt.msc')"	compmgmt.msc
	"InfoCmds.Start('control')"	control
	"InfoCmds.Start2('control nusrmgr.cpl')"	control nusrmgr.cpl
	"InfoCmds.Start2('control admintools')"	control admintools

You find a list of control commands in Info/Docu/Control-Commands

Open Office documents
	"InfoCmds.Start('Info/Docu/Helpdesk.pps')"	Info/Docu/Helpdesk.pps
	"InfoCmds.Start('Info/Docu/Dictionary.xls')"	Info/Docu/Dictionary.xls

Open a website
	"InfoCmds.Start('iexplore')"	iexplore
	"InfoCmds.Start('http://www.oberon.ch')"	http://www.oberon.ch
	"InfoCmds.Start('http://www.zinnamturm.eu')"	http://www.zinnamturm.eu

Writing a email
	"InfoCmds.Start('mailto:feedback@zinnamturm.eu')"	mailto:feedback@zinnamturm.eu


2.3 Translate a website
For translating a website just select an url in your text document and open the menu Infodesk -> Translate Website... 
	Men:
		Infodesk -> Translate Website...
	or
		"TextCmds.InitFindDialog; StdCmds.OpenToolDialog('Info/Rsrc/Web', 'Translate Website')"

Another way is to press the key Shift+Ctrl+L to get the bing or google translation of the selected website.
E.g.: 
Select the url below
	http://www.oberoncore.ru
and then press the key Shift+Ctrl+L
You get the bing translation of the oberonecore website from Russian to English.


2.4 Search through all documents
You can search in all documents starting at the Source directory.

	Men:
		Infodesk -> Search... -> Search In All Docu
	or
		"TextCmds.InitFindDialog; StdCmds.OpenToolDialog('Info/Rsrc/Search', 'Search')"

If the field 'Filter:' is empty then it search in *.* all files.
If the field 'Filter:' contains 'odc' then it search in *.odc documents files only.
If the field 'Filter:' contains 'osf' then it search in *.osf files only.

Note: See 2.8 for creating the Cross-Reference list.


2.5 Create link list (table of contents)
You have a directory and you would like to create a link list to all those documents in the directory for easy access.

	Men: 
		Infodesk -> Link Documents... -> Create Link List
	or
		"StdCmds.OpenToolDialog('Info/Rsrc/CreateLinks', '#Info:Link Documents')"

Note: This document is discarded after closing. You have to save it manally if you would like to keep it.


2.6 Collect the documents
In the focus document there are a lot of links. Now you can create a file list of all linked documents.

	Men:
		Infodesk -> Collect & Move Documents... -> Create File List
	or
		"StdCmds.OpenToolDialog('Info/Rsrc/CollectDocuments', '#Info:Collect & Move Documents')"

Note: Look at the Log for links not insert into the file list. 

To work thru the file list and collect all files into the destination directory.

	Men:
		Infodesk -> Collect Documents... -> Move Files


2.7 Correct text & links via change list
After moving the files to the destination some links may be broken. You can use the file list for fixing those links or creating your own document for a list of changes separated by tabs. 

auto
find 1	replace 1
find 2	replace 2
and so on ...

In the first line the word "auto" is need for enable the commands. It protects the form against running the commands while another document has the fucus.  If the focus is on your list of changes then use 

Men:
	Infodesk -> Collect Documents... -> Correct Links
	Infodesk -> Collect Documents... -> Correct Texts

The command "Correct Links" or "Correct Text" works thru the list and does the changes in all documents.

See 2.11 to do one replace without a list.

Note: Beware, both commands changed all documents without request. Look at the Log to see which documents was changed. 


2.8 Build Cross-reference (subject index)
Men: 
	Infodesk -> Build Reference... -> New Index
or
	"StdCmds.OpenToolDialog('Info/Rsrc/CreateCatalog', '#Info:Build Reference')"

New Index will scan through all files and generate an index of all words, except those listed as trivial. Trival word should be listet in Info/Rsrc/Strings following a "Tab" and a "." (Period).

STRINGS
a	.
are	.
do	.
does	.
is	.
the	.

If the field 'Filter:' is empty it looks at *.* all files.
If the field 'Filter:' contains 'odc' then it looks at *.odc documents files only.
If the field 'Filter:' contains 'osf' then it looks at *.osf files only.

<InfoCmds.SetTopic('Help/Uhl/'); InfoLook.FindInIndex>Stichwortverzeichnis<> --> open file "Help/Uhl/Index.odc"


2.9 Check filenames
A filename should be no longer than 64 characters and the complete name including the path should be no longer than 260 characters. This utility finds too long file names and too deep pathes. It can correct it automatically or interaktive. Choose the switch "Testrun" for testing without changing anything. Often I get trouble with national language characters in filename. They can automatically translated.

Men: 
	Infodesk -> Check Filenames...
or
	"StdCmds.OpenToolDialog('Info/Rsrc/CheckFilenames1', '#Info:Check Filenames')"


2.10 Check links
Is every document reachable via link? Are all links working? You find it out with 

Men: 
	Infodesk -> Check Links...
or
	"StdCmds.OpenToolDialog('Info/Rsrc/CheckLinks', '#Info:Check Links')"


2.11 Replace in all documents
If one file move to another directory then you would like to change all links to that file. To do the replace thru all documents use

Men: 
	Infodesk -> Replace in all Documents... -> Replace Texts
	Infodesk -> Replace in all Documents... -> Replace Links
or
	"TextCmds.InitFindDialog; StdCmds.OpenToolDialog('Info/Rsrc/Replace', '#Info:Replace in all Documents')"

See 2.7 to do replace with a list of changes.

Note: Beware, both commands changed all documents without request. Read the Log to see which documents was changed. 


3	Change log	 Up

May 2015: New MODULE InfoWeb added for translate a website
March 2014: Adapt according to the CPC Edition of BlackBox 1.7


4	Reference	 Up

My thanks for the help to Dominik Gruntz mailto:gruntz@fh-aargau.ch 
and Werner Braun mailto:werner.braun@o3-software.de 

Use it and enjoy! - salos y disfrtalos! - Bonne utilisation - Приятного использования - Powodzenia - Viel Spa

Helmut Zinn
feedback@zinnamturm.eu
