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); } }
public static string[] GetAllAccountLocations() { var accountIDs = TBRAccountRoot.GetAllAccountIDs(); var accountLocs = accountIDs.Select(accID => "acc/" + accID + "/"); return(accountLocs.ToArray()); }
public static string[] GetAllOwnerLocations() { var accountIDs = TBRAccountRoot.GetAllAccountIDs(); var accountLocs = accountIDs.Select(accID => "acc/" + accID + "/"); var groupLocs = GetAllGroupLocations(); return(accountLocs.Union(groupLocs).ToArray()); }
private static void refreshAllAccountTemplates(bool useWorker, params string[] viewTypesToRefresh) { string[] accountIDs = TBRAccountRoot.GetAllAccountIDs(); foreach (var acctID in accountIDs) { RefreshAccountTemplates(acctID, useWorker, viewTypesToRefresh); } }
private static void RefreshAllAccounts() { var accountIDs = TBRAccountRoot.GetAllAccountIDs(); foreach (var accountID in accountIDs) { var accountRoot = TBRAccountRoot.RetrieveFromDefaultLocation(accountID); accountRoot.Account.StoreAccountToRoot(); } }
private static void AddLoginToAccount(string loginUrlID, string accountID) { TBRAccountRoot accountRoot = TBRAccountRoot.RetrieveFromDefaultLocation(accountID); TBLoginInfo loginInfo = TBLoginInfo.CreateDefault(); loginInfo.OpenIDUrl = loginUrlID; accountRoot.Account.Logins.CollectionContent.Add(loginInfo); accountRoot.Account.StoreAccountToRoot(); }
private static void PatchAccountsUpToDateWithRoot() { var accountIDs = TBRAccountRoot.GetAllAccountIDs(); foreach (var accountID in accountIDs) { UpdateAccountRootToReferences.Execute(new UpdateAccountRootToReferencesParameters { AccountID = accountID }); } }
private static void UpdateAccountAndGroups(string accountEmail) { string emailID = TBREmailRoot.GetIDFromEmailAddress(accountEmail); TBREmailRoot emailRoot = TBREmailRoot.RetrieveFromDefaultLocation(emailID); TBRAccountRoot accountRoot = TBRAccountRoot.RetrieveFromDefaultLocation(emailRoot.Account.ID); foreach (var groupRole in accountRoot.Account.GroupRoleCollection.CollectionContent) { TBRGroupRoot groupRoot = TBRGroupRoot.RetrieveFromDefaultLocation(groupRole.GroupID); RefreshAccountGroupMemberships.Execute(new RefreshAccountGroupMembershipsParameters { AccountID = accountRoot.Account.ID, GroupRoot = groupRoot }); InformationContext.ProcessAndClearCurrent(); InformationContext.Current.InitializeCloudStorageAccess(Properties.Settings.Default.CurrentActiveContainerName); } }
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(); } }
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)); } }