/// <summary> /// Read LoginResult object from login.properties. /// </summary> /// <param name="lprops">Map that contains login.properties</param> /// <returns>LoginResult object</returns> protected static LoginResult readLoginResult(IXProperties lprops) { LoginResult loginResult = new LoginResult(); loginResult.clientInfo = new ClientInfo(); loginResult.clientInfo.ticket = lprops["loginResult.clientInfo.ticket"]; loginResult.clientInfo.language = lprops["loginResult.clientInfo.language"]; loginResult.clientInfo.country = lprops["loginResult.clientInfo.country"]; loginResult.ticketLifetime = lprops.Get("loginResult.ticketLifetime", 120); loginResult.user = new UserInfo(); loginResult.user.id = lprops.Get("loginResult.user.id", -1); loginResult.user.name = lprops["loginResult.user.name"]; loginResult.user.flags = lprops.Get("loginResult.user.flags", 0); return(loginResult); }
/// <summary> /// Initialize /// </summary> /// <param name="conn">Connection object</param> /// <param name="arcName">Archive name</param> /// <param name="connProps">Connection properties</param> /// <returns></returns> public virtual void Init(FWConnection conn, string arcName, IXProperties connProps) { this.connVal = conn; this.classFactoryVal = new FWContentClassFactory(this); this.sordZVal = new SordZ(SordC.mbLeanMembers | SordC.mbDocVersionMembers); this.editZVal = new EditInfoZ(EditInfoC.mbDocumentMembers | EditInfoC.mbSignatureMembers | EditInfoC.mbAttachmentMembers, sordZVal); // try to get the temporary directory from the connection properties String tmpDir = (connProps != null) ? connProps[FWConnFactory.PROP_TEMP_DIR] : null; if (tmpDir != null && tmpDir.Length != 0) { tempDirVal = makeTempDir(tmpDir, Path.Combine(arcName, "Temp")); checkoutDirVal = makeTempDir(tmpDir, Path.Combine(arcName, "Checkout")); } else { try { // not found: use the users APPDATA directory tempDirVal = makeTempDir(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "ELO Digital Office"), Path.Combine(arcName, "Temp")); checkoutDirVal = makeTempDir(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "ELO Digital Office"), Path.Combine(arcName, "Checkout")); } catch (Exception) { try { tempDirVal = makeTempDir(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "ELO Digital Office"), Path.Combine(arcName, "Temp")); checkoutDirVal = makeTempDir(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "ELO Digital Office"), Path.Combine(arcName, "Checkout")); } catch (Exception) { // Konto "Local System" unter Windows 2003 kann nicht auf APPDATA zugreifen. tempDirVal = makeTempDir(Path.Combine(Path.GetTempPath(), "ELO Digital Office"), Path.Combine(arcName, "Temp")); checkoutDirVal = makeTempDir(Path.Combine(Path.GetTempPath(), "ELO Digital Office"), Path.Combine(arcName, "Checkout")); } } } // Initialize the FWDownloadManager object downloadManagerVal = ClassFactory.NewDownloadManager( tempDirVal, connProps.Get(FWConnFactory.PROP_CACHE_DOCUMENT_LIFETIME_SECONDS, FWConnFactory.PROP_CACHE_DOCUMENT_LIFETIME_DEFAULT)); checkedOutDocumentsManagerVal = ClassFactory.NewCheckedOutDocumentsManager(checkoutDirVal); }
private void InitTempFileFilters() { string s = props.Get("FileSystem.tempFiles", ""); if (s.Length != 0) { tempFileFilters = s.Split(new char[] { ',', ' ' }); for (int i = 0; i < tempFileFilters.Length; i++) { string f = tempFileFilters[i]; f = f.Replace('*', ':').Replace('?', '/'); f = Regex.Escape(f); f = f.Replace(":", ".+").Replace('/', '.'); tempFileFilters[i] = "^" + f + "$"; } } }