Beschreibung
Diese Funktion ermöglicht es unterschiedliche Einstellungen am DNB-Benutzerprofil für die WinIBW3 vorzunehmen. Nach Aufruf öffnet sich ein Fenster mit vier Registerkarten:  Mit OK werden die erfassten Änderungen abgespeichert, mit Abbrechen, kann die Funktion ohne Speicherung der Eingaben beendet werden.
	
   
Historie
Datum  | 
geändert von  | 
Beschreibung  | 
|---|---|---|
2011-06-24  | 
Althaus  | 
neu erstellt  | 
2011-07-05  | 
Althaus  | 
Überarbeitung  | 
2011-07-09  | 
Althaus  | 
aktualisiert  | 
Dateien
Verzeichnis  | 
Dateiname  | 
|---|---|
scripts\  | 
dnb_public.js  | 
chrome\ibw\content\xul\  | 
dnb_einstellungen_dialog.js  | 
chrome\ibw\content\xul\  | 
dnb_einstellungen_dialog.xul  | 
Code
dnb_public.js
function EinstellungenDNBBenutzerprofil()
{
	var xulFeatures = "centerscreen, chrome, close, titlebar,modal=no,dependent=yes, dialog=yes";
	open_xul_dialog("chrome://ibw/content/xul/dnb_einstellungen_dialog.xul", xulFeatures);
}
dnb_einstellungen_dialog.js
//============================================================================
// dnb_einstellungen_dialog.js
// Kopie von: GBV, Karen Hachmann 
// Die Profile wären besser als Integer statt als String gespeichert worden. 
// Dies hätte aber einen wesentlichen Nachteil: Solange der Anwender nichts
// einträgt, steht der Wert auf 0, d.h. kein Exemplar, keine ELN usw. 
// Mein Wunsch ist aber, dass der Defaultwert auf 1 stehen sollte.
// Update: DNB, Bernd Althaus, 24.06.2011
//============================================================================
var application = Components.classes["@oclcpica.nl/kitabapplication;1"]
					.getService(Components.interfaces.IApplication);
const utility = 
{
	newFileInput: function() {
		return Components.classes["@oclcpica.nl/scriptinputfile;1"]
								.createInstance(Components.interfaces.IInputTextFile);
	},
     newFileOutput: function() {
        return Components.classes["@oclcpica.nl/scriptoutputfile;1"]
                                 .createInstance(Components.interfaces.IOutputTextFile);
	},
	newPrompter: function() {
         return Components.classes["@oclcpica.nl/scriptpromptutility;1"]
                                   .createInstance(Components.interfaces.IPromptUtilities);
   }
};
//----------------------------------------------------------------------------
function onLoad()
{
	var strPWD= application.getProfileString("dnbUser", "userPwd", "");
	document.getElementById('iduserKey').value = application.getProfileString("dnbUser", "userKey", "");
	
	if (strPWD != "") {
		document.getElementById('idpwd').value = "******"
	}
	
	document.getElementById('idkuerzel').value = application.getProfileString("dnbUser", "kuerzel", "");
	document.getElementById('idabteilung').value = application.getProfileString("dnbUser", "abteilung", "");
	var strStandort = application.getProfileString("dnbUser", "standort", "");
	if (strStandort == "DNB-F") {
		document.getElementById("idstandort").selectedIndex = 0;
	} else { 
		document.getElementById("idstandort").selectedIndex = 1;
	} 
	
	var strKatRicht = application.getProfileString("dnbUser", "katricht", "");
	switch(strKatRicht) {
		case "ZDB":
			document.getElementById("idkatricht").selectedIndex = 1;
			break;
		case "DEA":
			document.getElementById("idkatricht").selectedIndex = 2;
			break;
		case "DMA":
			document.getElementById("idkatricht").selectedIndex = 3;
			break;
		default:
			document.getElementById("idkatricht").selectedIndex = 0;
			break;
	}
	if (strStandort == "DNB-F") {
		document.getElementById("idstandort").selectedIndex = 0;
	} else { 
		document.getElementById("idstandort").selectedIndex = 1;
	} 
	
	document.getElementById('idmailPND').value = application.getProfileString("dnbUser", "PNDsender", "");
	document.getElementById('idmailGKD').value = application.getProfileString("dnbUser", "GKDsender", "");
	document.getElementById('idmailSWD').value = application.getProfileString("dnbUser", "SWDsender", "");
	
	document.getElementById('idcommand1').value = application.getProfileString("dnbUser", "userCommand1", "");
	document.getElementById('idcommand2').value = application.getProfileString("dnbUser", "userCommand2", "");
	document.getElementById('idcommand3').value = application.getProfileString("dnbUser", "userCommand3", "");
	
	document.getElementById('idsearch1').value = application.getProfileString("dnbUser", "userSearch1", "");
	document.getElementById('idsearch2').value = application.getProfileString("dnbUser", "userSearch2", "");
	document.getElementById('idsearch3').value = application.getProfileString("dnbUser", "userSearch3", "");
	
	document.getElementById('idtext1').value = application.getProfileString("dnbUser", "userText1", "");
	document.getElementById('idtext2').value = application.getProfileString("dnbUser", "userText2", "");
	document.getElementById('idtext3').value = application.getProfileString("dnbUser", "userText3", "");	
	
	document.getElementById('ididn1').value = application.getProfileString("dnbUser", "idn1", "");
	document.getElementById('ididn2').value = application.getProfileString("dnbUser", "idn2", "");
	
	document.getElementById('idvetermin').value = application.getProfileString("dnbUser", "vetermin", "");
	document.getElementById('idland').value = application.getProfileString("dnbUser", "land", "");
	
	document.getElementById('idNL1nam').value = application.getProfileString("dnbUser", "NL1nam", "");
	document.getElementById('idNL1sig').value = application.getProfileString("dnbUser", "NL1sig", "");
	document.getElementById('idNL1pnd').value = application.getProfileString("dnbUser", "NL1pnd", "");
	document.getElementById('idNL14180').value = application.getProfileString("dnbUser", "NL14180", "");
	
	document.getElementById('idNL2nam').value = application.getProfileString("dnbUser", "NL2nam", "");
	document.getElementById('idNL2sig').value = application.getProfileString("dnbUser", "NL2sig", "");
	document.getElementById('idNL2pnd').value = application.getProfileString("dnbUser", "NL2pnd", "");
	document.getElementById('idNL24180').value = application.getProfileString("dnbUser", "NL24180", "");
	
	document.getElementById('idNL3nam').value = application.getProfileString("dnbUser", "NL3nam", "");
	document.getElementById('idNL3sig').value = application.getProfileString("dnbUser", "NL3sig", "");
	document.getElementById('idNL3pnd').value = application.getProfileString("dnbUser", "NL3pnd", "");
	document.getElementById('idNL34180').value = application.getProfileString("dnbUser", "NL34180", "");
	
}
//----------------------------------------------------------------------------
function onAccept()
{
	application.writeProfileString("dnbUser", "userKey", document.getElementById('iduserKey').value);
	application.writeProfileString("dnbUser", "kuerzel", document.getElementById('idkuerzel').value);
	application.writeProfileString("dnbUser", "abteilung", document.getElementById('idabteilung').value);
	var ZDB_Bibliothek_IDN;
	var einstellung = document.getElementById("idstandort").selectedIndex;
	if (einstellung == 1) {
		application.writeProfileString("dnbUser", "standort", "DNB-F");
		ZDB_Bibliothek_IDN = "!009013849!";
	} else {
		application.writeProfileString("dnbUser", "standort", "DNB-L");
		ZDB_Bibliothek_IDN = "!009030115!";
	}
	
	einstellung = document.getElementById("idkatricht").selectedIndex;
	switch(einstellung) {
	case 1:
		application.writeProfileString("dnbUser", "katricht", "ZDB");
		application.writeProfileString("dnbUser", "help.cataloguing", "http://www.zeitschriftendatenbank.de/erschliessung/arbeitsunterlagen/zeta/");
		application.writeProfileString("dnbUser", "help.suffix", ".html");
		break;
	case 2:
		application.writeProfileString("dnbUser", "katricht", "DEA");
		application.writeProfileString("dnbUser", "help.cataloguing", "http://wiki.d-nb.de/download/attachments/41157656/");
		application.writeProfileString("dnbUser", "help.suffix", ".pdf");
		break;
	case 3:
		application.writeProfileString("dnbUser", "katricht", "DMA");
		application.writeProfileString("dnbUser", "help.cataloguing", "http://wiki.d-nb.de/download/attachments/41157656/");
		application.writeProfileString("dnbUser", "help.suffix", ".pdf");
		break;
	default:
		application.writeProfileString("dnbUser", "katricht", "DNB");
		application.writeProfileString("dnbUser", "help.cataloguing", "http://wiki.d-nb.de/download/attachments/41157656/");
		application.writeProfileString("dnbUser", "help.suffix", ".pdf");
		break;
	}
	application.writeProfileString("dnbUser", "PNDsender", document.getElementById('idmailPND').value);
	application.writeProfileString("dnbUser", "GKDsender", document.getElementById('idmailGKD').value);
	application.writeProfileString("dnbUser", "SWDsender", document.getElementById('idmailSWD').value);
	
	application.writeProfileString("dnbUser", "userCommand1", document.getElementById('idcommand1').value);
	application.writeProfileString("dnbUser", "userCommand2", document.getElementById('idcommand2').value);
	application.writeProfileString("dnbUser", "userCommand3", document.getElementById('idcommand3').value);
	
	application.writeProfileString("dnbUser", "userSearch1", document.getElementById('idsearch1').value);
	application.writeProfileString("dnbUser", "userSearch2", document.getElementById('idsearch2').value);
	application.writeProfileString("dnbUser", "userSearch3", document.getElementById('idsearch3').value);
	
	application.writeProfileString("dnbUser", "userText1", document.getElementById('idtext1').value);
	application.writeProfileString("dnbUser", "userText2", document.getElementById('idtext2').value);
	application.writeProfileString("dnbUser", "userText3", document.getElementById('idtext3').value);
	
	application.writeProfileString("dnbUser", "idn1", document.getElementById('ididn1').value);
	application.writeProfileString("dnbUser", "idn2", document.getElementById('ididn2').value);
	
	application.writeProfileString("dnbUser", "vetermin", document.getElementById('idvetermin').value);
	application.writeProfileString("dnbUser", "land",    document.getElementById('idland').value);
	
	application.writeProfileString("dnbUser", "NL1nam",  document.getElementById('idNL1nam').value);
	application.writeProfileString("dnbUser", "NL1sig",  document.getElementById('idNL1sig').value);
	application.writeProfileString("dnbUser", "NL1pnd",  document.getElementById('idNL1pnd').value);
	application.writeProfileString("dnbUser", "NL14180", document.getElementById('idNL14180').value);
	
	application.writeProfileString("dnbUser", "NL2nam",  document.getElementById('idNL2nam').value);
	application.writeProfileString("dnbUser", "NL2sig",  document.getElementById('idNL2sig').value);
	application.writeProfileString("dnbUser", "NL2pnd",  document.getElementById('idNL2pnd').value);
	application.writeProfileString("dnbUser", "NL24180", document.getElementById('idNL24180').value);
	
	application.writeProfileString("dnbUser", "NL3nam",  document.getElementById('idNL3nam').value);
	application.writeProfileString("dnbUser", "NL3sig",  document.getElementById('idNL3sig').value);
	application.writeProfileString("dnbUser", "NL3pnd",  document.getElementById('idNL3pnd').value);
	application.writeProfileString("dnbUser", "NL34180", document.getElementById('idNL34180').value);
	// Kopie von ZDB_BibliothekDefinieren.xul
	//var idn_input = document.getElementById("ZDB_BibliothekDefinieren_Textbox1").value;
	var idn_input = ZDB_Bibliothek_IDN;
	// FileOutput-Objekt deklarieren
	var FileOutput = Components.classes["@oclcpica.nl/scriptoutputfile;1"]
						.createInstance(Components.interfaces.IOutputTextFile);
	// Datei mit Namen "Eigene_Bibliothek.txt" im Nutzer-eigenen Profiles-Ordner anlegen, sofern diese Datei nicht bereits existiert
	FileOutput.createSpecial("ProfD", "Eigene_Bibliothek.txt");
	// Bestehenden Datei-Inhalt beim Schreiben in die Datei löschen
	// IDN wird auf korrekte Systax und Länge geprüft
    // Korrektur: Johann Rolschewski (ZDB), 07.07.2010, Validation muss auf 10 stellige IDNs angepasst werden
	if (idn_input.match(/^(\d{8,9}[\d|x|X])$/gi)){
		idn_input = "!" + idn_input + "!";
	}
	if (idn_input.match(/^!(\d{8,9}[\d|x|X])!$/gi)){
		// Bestehender Inhalt wird überschrieben
		FileOutput.setTruncate(true);
		// IDN in Datei schreiben
		FileOutput.write(idn_input);
		//application.messageBox("BibliothekDefinieren", "Die IDN " + idn_input + " wurde gespeichert.",  "message-icon");
	// Falls eine leere Eingabe erfolgt ist, wird der bestehende Inhalt gelöscht
	} else if (idn_input.length == 0){
		// Bestehender Inhalt wird überschrieben
		FileOutput.setTruncate(true);
		FileOutput.write("");
		//application.messageBox("BibliothekDefinieren", "Die IDN wurde gelöscht.",  "message-icon");
	} else {
		//application.messageBox("BibliothekDefinieren", "Die eingegebene IDN ist nicht korrekt: '" + idn_input + "'",  "alert-icon");
	}
	
	var strPWD = document.getElementById('idpwd').value;
	var strLenPWD = strPWD.length;
	if ((strPWD != "") && (strPWD != "******"))  {
		if (strLenPWD < 4) {
			application.messageBox("Passwort einrichten","Das Passwort muss max. 4 Zeichen lang sein!\n\n"
									+ "Alle sonstigen Einstellungen wurden gesichert!","");
			EinstellungenDNBBenutzerprofil();
		} else {	
			application.writeProfileString("dnbUser", "userPwd", strPWD);
		}
	}
	
}
//----------------------------------------------------------------------------
function onCancel()
{
	//
}
//----------------------------------------------------------------------------
function FrageSpeichern()
{
	if (bContentsChanged) {
		var prompt = utility.newPrompter();
		prompt.setDebug(true);
		if (prompt.confirmEx("Speichern?", "Änderungen speichern?", "Yes", "No", "", "", false) == 0) {
			einstellungenSpeichern();
		}
		bContentsChanged = false;
	}
}
//----------------------------------------------------------------------------
function hilfe1()
{
	application.messageBox("Info", "Sie können sich eine eigene Exemplarmaske einrichten." +
		"\nIm Menü 'Datenmasken' wählen Sie 'Exemplarmasken bearbeiten'. " +
		"\nDort wählen Sie die Datei 'exmuster_einzelband.txt' aus.", "message-icon");
}
dnb_einstellungen_dialog.xul
<?xml version="1.0"?> <!-- -*- Mode: HTML -*- --> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="Einstellungen für das DNB Benutzerprofil" onload="onLoad();" ondialogcancel="return onCancel();" ondialogaccept="onAccept();" onunload="application.activate();" buttons="accept, cancel" style="min-height: 30em" > <script type="application/x-javascript" src="chrome://ibw/content/xul/dnb_einstellungen_dialog.js" /> <tabbox flex="1"> <tabs > <tab label="Benutzerdaten" accesskey="B"/> <tab label="Benutzerprofil 1" accesskey="1" /> <tab label="Benutzerprofil 2" accesskey="2" /> <tab label="Benutzerprofil 3" accesskey="3" /> </tabs> <tabpanels > <tabpanel id="idSeite1" flex="1"> <vbox flex="1"> <groupbox> <caption label="Benutzerdaten" /> <label value="Hier können Benutzerdaten verwaltet werden."/> <grid flex="1"> <columns> <column flex="1"/> <column flex="2"/> </columns> <rows> <row> <label value="ILTIS-Kennung:" /> <textbox id="iduserKey" name="textbox" flex="1" height="22px"/> </row> <row> <label value="Passwort:" /> <textbox id="idpwd" name="textbox" flex="1" height="22px"/> </row> <row> <label value="Kürzel:" /> <textbox id="idkuerzel" name="textbox" flex="1" height="22px"/> </row> <row> <label value="Abteilung:" /> <textbox id="idabteilung" name="textbox" flex="1" height="22px"/> </row> <row> <label value="Standort:" /> <radiogroup id="idstandort"> <radio label="Leipzig" /> <radio label="Frankfurt" /> </radiogroup> </row> <row> <label value="Katalogisierungsrichtlinien:" /> <radiogroup id="idkatricht"> <radio label="DNB Titeldaten" /> <radio label="ZETA- Format der ZDB" /> <radio label="Deutsches Exilarchiv" /> <radio label="Deutsches Musikarchiv" /> </radiogroup> </row> </rows> </grid> </groupbox> </vbox> </tabpanel> <tabpanel id="idSeite2" flex="1"> <vbox flex="1"> <groupbox> <caption label="Mailbox" /> <label value="Hier können die Mailboxen verwaltet werden."/> <grid flex="1"> <columns> <column flex="1"/> <column flex="2"/> </columns> <rows> <row> <label value="PND:" /> <textbox id="idmailPND" name="textbox" flex="1" height="22px"/> </row> <row> <label value="GKD:" /> <textbox id="idmailGKD" name="textbox" flex="1" height="22px"/> </row> <row> <label value="SWD:" /> <textbox id="idmailSWD" name="textbox" flex="1" height="22px"/> </row> </rows> </grid> </groupbox> <groupbox> <caption label="IDNs für die Funktion Umlenkung" /> <label value="Hier können die IDNs für die Funktion Umlenkung verwaltet werden."/> <label value="Die IDN1 wird gesucht und überall im Datensatz gegen IDN2 ausgetauscht."/> <grid> <columns> <column flex="1"/> <column flex="2"/> </columns> <rows> <row> <label value="IDN1:" /> <textbox id="ididn1" name="textbox" height="22px"/> </row> <row> <label value="IDN2:" /> <textbox id="ididn2" name="textbox" height="22px"/> </row> </rows> </grid> </groupbox> </vbox> </tabpanel> <tabpanel id="idSeite3" flex="1"> <vbox flex="1"> <groupbox> <caption label="Kommandos" /> <label value="Hier können die Kommandos verwaltet werden (z.B. sc per goethe). Aufruf der Kommandos mit Alt+nr, z.B. Alt+1 für Kommando1."/> <label value=""/> <grid flex="1"> <columns> <column flex="1"/> <column flex="2"/> </columns> <rows> <row> <label value="Kommando1:" /> <textbox id="idcommand1" name="textbox" flex="1" height="22px"/> </row> <row> <label value="Kommando2:" /> <textbox id="idcommand2" name="textbox" flex="1" height="22px"/> </row> <row> <label value="Kommando3:" /> <textbox id="idcommand3" name="textbox" flex="1" height="22px"/> </row> </rows> </grid> </groupbox> <groupbox> <caption label="Suchfragen" /> <label value="Hier können die Suchfragen verwaltet werden (z.B. per goethe). Aufruf der Suchfragen mit Alt+Fnr, z.B. Alt+F1 für Suchfrage1."/> <label value="ACHTUNG: Suchfrage 1 wird in Funktion ND_Suche verwendet!"/> <label value=""/> <grid flex="1"> <columns> <column flex="1"/> <column flex="2"/> </columns> <rows> <row> <label value="Suchfrage1:" /> <textbox id="idsearch1" name="textbox" flex="1" height="22px"/> </row> <row> <label value="Suchfrage2:" /> <textbox id="idsearch2" name="textbox" flex="1" height="22px"/> </row> <row> <label value="Suchfrage3:" /> <textbox id="idsearch3" name="textbox" flex="1" height="22px"/> </row> </rows> </grid> </groupbox> <groupbox> <caption label="Textbausteine" /> <label value="Hier können die Textbausteine verwaltet werden. Aufruf der Textbausteine mit Strg+Fnr, z.B. Strg+F1 für Textbaustein1."/> <label value=""/> <grid> <columns> <column flex="1"/> <column flex="2"/> </columns> <rows> <row> <label value="Textbaustein1:" /> <textbox id="idtext1" name="textbox" flex="1" height="22px"/> </row> <row> <label value="Textbaustein2:" /> <textbox id="idtext2" name="textbox" flex="1" height="22px"/> </row> <row> <label value="Textbaustein3:" /> <textbox id="idtext3" name="textbox" flex="1" height="22px"/> </row> </rows> </grid> </groupbox> </vbox> </tabpanel> <tabpanel id="idSeite4"> <vbox> <groupbox> <caption label="Einstellungen für die Erwerbung" /> <label value="Hier können spezielle Einstellungen der Erwerbung vorgenommen werden."/> <label value=""/> <grid> <columns> <column flex="1"/> <column flex="2"/> </columns> <rows> <row> <label value="Default vorauss. Erscheinttermin:" /> <textbox id="idvetermin" name="textbox" flex="1" height="22px"/> </row> <row> <label value="Länderkürzel:" /> <textbox id="idland" name="textbox" flex="1" height="22px"/> </row> </rows> </grid> </groupbox> <groupbox> <caption label="Nachlässe" /> <label value="Hier können die Nachlässe des DeutschenExilarchivs verwaltet werden."/> <label value=""/> <grid flex="1"> <columns> <column flex="1"/> <column flex="2"/> <column flex="3"/> <column flex="4"/> </columns> <rows> <row> <label value="Nachlass 1: Name:" /> <textbox id="idNL1nam" name="textbox" flex="1" height="22px"/> <label value="Signatur:" /> <textbox id="idNL1sig" name="textbox" flex="2" height="22px"/> <label value="PND:" /> <textbox id="idNL1pnd" name="textbox" flex="3" height="22px"/> <label value="4180:" /> <textbox id="idNL14180" name="textbox" flex="4" height="22px"/> </row> <row> <label value="Nachlass 2: Name:" /> <textbox id="idNL2nam" name="textbox" flex="1" height="22px"/> <label value="Signatur:" /> <textbox id="idNL2sig" name="textbox" flex="2" height="22px"/> <label value="PND:" /> <textbox id="idNL2pnd" name="textbox" flex="3" height="22px"/> <label value="4180:" /> <textbox id="idNL24180" name="textbox" flex="4" height="22px"/> </row> <row> <label value="Nachlass 3: Name:" /> <textbox id="idNL3nam" name="textbox" flex="1" height="22px"/> <label value="Signatur:" /> <textbox id="idNL3sig" name="textbox" flex="2" height="22px"/> <label value="PND:" /> <textbox id="idNL3pnd" name="textbox" flex="3" height="22px"/> <label value="4180:" /> <textbox id="idNL34180" name="textbox" flex="4" height="22px"/> </row> </rows> </grid> </groupbox> </vbox> </tabpanel> </tabpanels> </tabbox> </dialog>