Example #1
0
        public static void EnsureAndRefreshMasterCollections()
        {
            var accountIDs = TBRAccountRoot.GetAllAccountIDs();

            foreach (string accountID in accountIDs)
            {
                string       acctLocation = "acc/" + accountID + "/";
                VirtualOwner owner        = VirtualOwner.FigureOwner(acctLocation);
                //CoreDomain.EnsureMasterCollections(owner);
                //CoreDomain.RefreshMasterCollections(owner);
                OIPDomain.EnsureMasterCollections(owner);
                OIPDomain.RefreshMasterCollections(owner);
            }
            var groupIDs = TBRGroupRoot.GetAllGroupIDs();

            foreach (string groupID in groupIDs)
            {
                string       grpLocation = "grp/" + groupID + "/";
                VirtualOwner owner       = VirtualOwner.FigureOwner(grpLocation);
                //CoreDomain.EnsureMasterCollections(owner);
                //CoreDomain.RefreshMasterCollections(owner);
                OIPDomain.EnsureMasterCollections(owner);
                OIPDomain.RefreshMasterCollections(owner);
            }
        }
Example #2
0
        public static string[] GetAllAccountLocations()
        {
            var accountIDs  = TBRAccountRoot.GetAllAccountIDs();
            var accountLocs = accountIDs.Select(accID => "acc/" + accID + "/");

            return(accountLocs.ToArray());
        }
Example #3
0
        public static string[] GetAllOwnerLocations()
        {
            var accountIDs  = TBRAccountRoot.GetAllAccountIDs();
            var accountLocs = accountIDs.Select(accID => "acc/" + accID + "/");
            var groupLocs   = GetAllGroupLocations();

            return(accountLocs.Union(groupLocs).ToArray());
        }
Example #4
0
 private static void refreshAllAccountTemplates(bool useWorker, params string[] viewTypesToRefresh)
 {
     string[] accountIDs = TBRAccountRoot.GetAllAccountIDs();
     foreach (var acctID in accountIDs)
     {
         RefreshAccountTemplates(acctID, useWorker, viewTypesToRefresh);
     }
 }
Example #5
0
        private static void RefreshAllAccounts()
        {
            var accountIDs = TBRAccountRoot.GetAllAccountIDs();

            foreach (var accountID in accountIDs)
            {
                var accountRoot = TBRAccountRoot.RetrieveFromDefaultLocation(accountID);
                accountRoot.Account.StoreAccountToRoot();
            }
        }
Example #6
0
        private static void PatchAccountsUpToDateWithRoot()
        {
            var accountIDs = TBRAccountRoot.GetAllAccountIDs();

            foreach (var accountID in accountIDs)
            {
                UpdateAccountRootToReferences.Execute(new UpdateAccountRootToReferencesParameters
                {
                    AccountID = accountID
                });
            }
        }
Example #7
0
        public static void SetAllInvitedViewerMembersAsFullCollaborators()
        {
            var accountIDs = TBRAccountRoot.GetAllAccountIDs();

            foreach (var acctID in accountIDs)
            {
                TBRAccountRoot accountRoot = TBRAccountRoot.RetrieveFromDefaultLocation(acctID);
                TBAccount      account     = accountRoot.Account;
                foreach (var grpRole in account.GroupRoleCollection.CollectionContent)
                {
                    if (TBCollaboratorRole.IsRoleStatusValidMember(grpRole.RoleStatus) == false)
                    {
                        grpRole.RoleStatus = TBCollaboratorRole.RoleStatusMemberValue;
                    }
                    if (grpRole.GroupRole == TBCollaboratorRole.ViewerRoleValue)
                    {
                        grpRole.GroupRole = TBCollaboratorRole.CollaboratorRoleValue;
                    }
                }
                account.StoreAccountToRoot();
            }
        }
Example #8
0
        private static void DeleteAllAccountAndGroupContents(bool useWorker)
        {
            var           accountIDs         = TBRAccountRoot.GetAllAccountIDs();
            var           groupIDs           = TBRGroupRoot.GetAllGroupIDs();
            List <string> referenceLocations = new List <string>();

            foreach (var accountID in accountIDs)
            {
                string referenceLocation = "acc/" + accountID + "/";
                referenceLocations.Add(referenceLocation);
            }
            foreach (var groupID in groupIDs)
            {
                string referenceLocation = "grp/" + groupID + "/";
                referenceLocations.Add(referenceLocation);
            }
            if (useWorker)
            {
                referenceLocations.ForEach(refLoc =>
                {
                    VirtualOwner owner = VirtualOwner.FigureOwner(refLoc);
                    QueueSupport.PutToOperationQueue(
                        new OperationRequest
                    {
                        DeleteOwnerContent = new DeleteOwnerContentOperation
                        {
                            ContainerName  = owner.ContainerName,
                            LocationPrefix = owner.LocationPrefix
                        }
                    }
                        );
                });
            }
            else
            {
                referenceLocations.ForEach(refLoc => StorageSupport.DeleteContentsFromOwner(refLoc));
            }
        }