DevTreks.Data/Helpers/ContentHelper.cs
//public const string TEMPDOCS_DIRECTORYNAME = "tempdocs";
/// <summary>
///path accumulates from contract to service to app node
///standard filepath rule enforced: 
///owning club is club_accountid/
/// </summary>
/// <param name="uri"></param>
path accumulates from contract to service to app node
standard filepath rule enforced:
owning club is club_accountid
path accumulates from contract to service to app node standard filepath rule enforced : owning club is club_accountid
public static async Task<bool> SetFilePaths(ContentURI uri)
        {
            bool bHasCompleted = false;
            string sPathDelimiter 
                = FileStorageIO.GetDelimiterForFileStorage(uri);
            int iAncestorCount = (uri.URIDataManager.Ancestors != null) ?
                uri.URIDataManager.Ancestors.Count : 0;
            if (iAncestorCount > 0
                && uri.URINodeName.StartsWith(AppHelpers.Agreement.AGREEMENT_TYPES.service.ToString())
                == false)
            {
                int i = 0;
                foreach (ContentURI ancestorUri in uri.URIDataManager.Ancestors)
                {
                    if (i == 0)
                    {
                        uri.URIClub.ClubDocFullPath = AppSettings.MakeFilePath(sPathDelimiter,
                            GeneralHelpers.FILENAME_DELIMITER, 
                            AppSettings.GetResourceRootPath(uri, uri.URINetwork.WebFileSystemPath),
                            uri.URINetwork.PKId.ToString(), AppHelpers.Accounts.ACCOUNT_GROUPS.club.ToString(),
                            uri.URIClub.PKId.ToString(), uri.URIDataManager.AppType.ToString(),
                            uri.URIDataManager.SubAppType.ToString(),
                            AppHelpers.Agreement.AGREEMENT_BASE_TYPES.servicebase.ToString(),
                            uri.URIService.ServiceId.ToString(), ancestorUri.URINodeName,
                            ancestorUri.URIId.ToString());
                    }
                    else
                    {
                        uri.URIClub.ClubDocFullPath = string.Concat(
                            uri.URIClub.ClubDocFullPath, sPathDelimiter, 
                            ancestorUri.URINodeName, GeneralHelpers.FILENAME_DELIMITER, 
                            ancestorUri.URIId.ToString(), string.Empty);
                    }
                    i++;
                }
                uri.URIClub.ClubDocFullPath = string.Concat(uri.URIClub.ClubDocFullPath, 
                    sPathDelimiter, uri.URINodeName, 
                    GeneralHelpers.FILENAME_DELIMITER, uri.URIId.ToString(), string.Empty);
            }
            else
            {
                if (uri.URINodeName != AppHelpers.Agreement.AGREEMENT_BASE_TYPES.servicebase.ToString()
                    && uri.URINodeName != AppHelpers.Agreement.AGREEMENT_TYPES.service.ToString())
                {
                    uri.URIClub.ClubDocFullPath = AppSettings.MakeFilePath(sPathDelimiter,
                        GeneralHelpers.FILENAME_DELIMITER,
                        AppSettings.GetResourceRootPath(uri, uri.URINetwork.WebFileSystemPath),
                        uri.URINetwork.PKId.ToString(), AppHelpers.Accounts.ACCOUNT_GROUPS.club.ToString(),
                        uri.URIClub.PKId.ToString().ToString(), uri.URIDataManager.AppType.ToString(),
                        uri.URIDataManager.SubAppType.ToString(), AppHelpers.Agreement.AGREEMENT_BASE_TYPES.servicebase.ToString(),
                        uri.URIService.ServiceId.ToString(), uri.URINodeName, uri.URIId.ToString());
                }
                else
                {
                    uri.URIClub.ClubDocFullPath = AppSettings.MakeFilePath(sPathDelimiter,
                        GeneralHelpers.FILENAME_DELIMITER,
                        AppSettings.GetResourceRootPath(uri, uri.URINetwork.WebFileSystemPath),
                        uri.URINetwork.PKId.ToString(), AppHelpers.Accounts.ACCOUNT_GROUPS.club.ToString(),
                        uri.URIClub.PKId.ToString().ToString(), uri.URIDataManager.AppType.ToString(),
                        uri.URIDataManager.SubAppType.ToString(),
                        AppHelpers.Agreement.AGREEMENT_BASE_TYPES.servicebase.ToString(),
                        uri.URIService.ServiceId.ToString(), string.Empty, string.Empty);
                }
            }
            uri.URIClub.ClubDocFullPath = string.Concat(
                uri.URIClub.ClubDocFullPath, sPathDelimiter,
                MakeStandardFileNameFromURIPattern(uri));
            SetMemberPath(uri);
            await SetSelectedLinkedViewPaths(uri);
            FixFilePaths(uri);
            bHasCompleted = true;
            return bHasCompleted;
        }
public static async Task < bool > SetFilePaths ( ContentURI uri ) { bool bHasCompleted = false ; string sPathDelimiter = FileStorageIO . GetDelimiterForFileStorage ( uri ) ; int iAncestorCount = ( uri . URIDataManager . Ancestors != null ) ? uri . URIDataManager . Ancestors . Count : 0 ; if ( iAncestorCount > 0 && uri . URINodeName . StartsWith ( AppHelpers . Agreement . AGREEMENT_TYPES . service . ToString ( ) ) == false ) { int i = 0 ; foreach ( ContentURI ancestorUri in uri . URIDataManager . Ancestors ) { if ( i == 0 ) { uri . URIClub . ClubDocFullPath = AppSettings . MakeFilePath ( sPathDelimiter , GeneralHelpers . FILENAME_DELIMITER , AppSettings . GetResourceRootPath ( uri , uri . URINetwork . WebFileSystemPath ) , uri . URINetwork . PKId . ToString ( ) , AppHelpers . Accounts . ACCOUNT_GROUPS . club . ToString ( ) , uri . URIClub . PKId . ToString ( ) , uri . URIDataManager . AppType . ToString ( ) , uri . URIDataManager . SubAppType . ToString ( ) , AppHelpers . Agreement . AGREEMENT_BASE_TYPES . servicebase . ToString ( ) , uri . URIService . ServiceId . ToString ( ) , ancestorUri . URINodeName , ancestorUri . URIId . ToString ( ) ) ; } else { uri . URIClub . ClubDocFullPath = string . Concat ( uri . URIClub . ClubDocFullPath , sPathDelimiter , ancestorUri . URINodeName , GeneralHelpers . FILENAME_DELIMITER , ancestorUri . URIId . ToString ( ) , string . Empty ) ; } i ++ ; } uri . URIClub . ClubDocFullPath = string . Concat ( uri . URIClub . ClubDocFullPath , sPathDelimiter , uri . URINodeName , GeneralHelpers . FILENAME_DELIMITER , uri . URIId . ToString ( ) , string . Empty ) ; } else { if ( uri . URINodeName != AppHelpers . Agreement . AGREEMENT_BASE_TYPES . servicebase . ToString ( ) && uri . URINodeName != AppHelpers . Agreement . AGREEMENT_TYPES . service . ToString ( ) ) { uri . URIClub . ClubDocFullPath = AppSettings . MakeFilePath ( sPathDelimiter , GeneralHelpers . FILENAME_DELIMITER , AppSettings . GetResourceRootPath ( uri , uri . URINetwork . WebFileSystemPath ) , uri . URINetwork . PKId . ToString ( ) , AppHelpers . Accounts . ACCOUNT_GROUPS . club . ToString ( ) , uri . URIClub . PKId . ToString ( ) . ToString ( ) , uri . URIDataManager . AppType . ToString ( ) , uri . URIDataManager . SubAppType . ToString ( ) , AppHelpers . Agreement . AGREEMENT_BASE_TYPES . servicebase . ToString ( ) , uri . URIService . ServiceId . ToString ( ) , uri . URINodeName , uri . URIId . ToString ( ) ) ; } else { uri . URIClub . ClubDocFullPath = AppSettings . MakeFilePath ( sPathDelimiter , GeneralHelpers . FILENAME_DELIMITER , AppSettings . GetResourceRootPath ( uri , uri . URINetwork . WebFileSystemPath ) , uri . URINetwork . PKId . ToString ( ) , AppHelpers . Accounts . ACCOUNT_GROUPS . club . ToString ( ) , uri . URIClub . PKId . ToString ( ) . ToString ( ) , uri . URIDataManager . AppType . ToString ( ) , uri . URIDataManager . SubAppType . ToString ( ) , AppHelpers . Agreement . AGREEMENT_BASE_TYPES . servicebase . ToString ( ) , uri . URIService . ServiceId . ToString ( ) , string . Empty , string . Empty ) ; } } uri . URIClub . ClubDocFullPath = string . Concat ( uri . URIClub . ClubDocFullPath , sPathDelimiter , MakeStandardFileNameFromURIPattern ( uri ) ) ; SetMemberPath ( uri ) ; await SetSelectedLinkedViewPaths ( uri ) ; FixFilePaths ( uri ) ; bHasCompleted = true ; return bHasCompleted ; }
path accumulates from contract to service to app node
standard filepath rule enforced:
owning club is club_accountid
path accumulates from contract to service to app node standard filepath rule enforced : owning club is club_accountid
uri
ContentURI
None