예제 #1
0
        /// <summary>
        /// Sets up .NET Remoting Lifetime Services and TCP Channel for this AppDomain.
        ///
        /// @comment WARNING: If you need to change the parameters of the Constructor,
        /// you also need to change the parameters in the .NET Reflection call in
        /// TClientAppDomainConnection!
        ///
        /// </summary>
        /// <param name="AClientID">ClientID as assigned by the ClientManager</param>
        /// <param name="AClientServerConnectionType">Tells in which way the Client connected
        /// to the PetraServer</param>
        /// <param name="AClientManagerRef">A reference to the ClientManager object
        /// (Note: .NET Remoting will be working behind the scenes since calls to
        /// this Object will cross AppDomains!)</param>
        /// <param name="ASystemDefaultsCacheRef">A reference to the SystemDefaultsCache object
        /// (Note: .NET Remoting will be working behind the scenes since calls to
        /// this Object will cross AppDomains!)</param>
        /// <param name="ACacheableTablesManagerRef"></param>
        /// <param name="AUserInfo">An instantiated PetraPrincipal Object, containing User
        /// information
        /// </param>
        public TClientDomainManager(String AClientID,
                                    TClientServerConnectionType AClientServerConnectionType,
                                    TClientManagerCallForwarder AClientManagerRef,
                                    TSystemDefaultsCache ASystemDefaultsCacheRef,
                                    TCacheableTablesManager ACacheableTablesManagerRef,
                                    IPrincipal AUserInfo) :
            base(AClientID,
                 AClientServerConnectionType, AClientManagerRef,
                 ((TPetraPrincipal)AUserInfo).UserID)
        {
            TCacheableTablesManager.GCacheableTablesManager = ACacheableTablesManagerRef;
            TSystemDefaultsCache.GSystemDefaultsCache       = ASystemDefaultsCacheRef;

            TLanguageCulture.Init();

            UserInfo.GUserInfo     = (TPetraPrincipal)AUserInfo;
            DomainManager.GSiteKey = TSystemDefaultsCache.GSystemDefaultsCache.GetInt64Default(SharedConstants.SYSDEFAULT_SITEKEY);

            if (DomainManager.GSiteKey <= 0)
            {
                // this is for connecting to legacy database format
                // we cannot add SiteKey to SystemDefaults, because Petra 2.3 would have a conflict since it adds it on startup already to the in-memory defaults, but not to the database
                // see also https://sourceforge.net/apps/mantisbt/openpetraorg/view.php?id=114
                DomainManager.GSiteKey = TSystemDefaultsCache.GSystemDefaultsCache.GetInt64Default("SiteKeyPetra2");
            }

            if (DomainManager.GSiteKey <= 0)
            {
                // this can happen either with a legacy Petra 2.x database or with a fresh OpenPetra database without any ledger yet
                Console.WriteLine("there is no SiteKey or SiteKeyPetra2 record in s_system_defaults");
                DomainManager.GSiteKey = 99000000;
            }
        }
예제 #2
0
 /// <summary>
 /// constructor
 /// </summary>
 public TClientDomainManager(String AClientID,
                             TClientServerConnectionType AClientServerConnectionType,
                             TClientManagerCallForwarder AClientManagerRef,
                             ISystemDefaultsCache ASystemDefaultsCacheRef,
                             ICacheableTablesManager ACacheableTablesManagerRef,
                             IPrincipal AUserInfo) :
     base(AClientID,
          AClientServerConnectionType, AClientManagerRef,
          "007")
 {
 }