コード例 #1
0
        public PageDrop(IPortalLiquidContext portalLiquidContext, IPortalViewEntity viewEntity, SiteMapNodeDrop siteMapNode) : base(portalLiquidContext, viewEntity)
        {
            if (siteMapNode == null)
            {
                throw new ArgumentNullException("siteMapNode");
            }

            SiteMapNode = siteMapNode;
            var current             = HttpContext.Current;
            var contextLanguageInfo = portalLiquidContext.ContextLanguageInfo;

            if (!contextLanguageInfo.IsCrmMultiLanguageEnabled)
            {
                this._availableLanguages = new Lazy <LanguageDrop[]>(() => new LanguageDrop[0]);
                this._languages          = new Lazy <LanguageDrop[]>(() => new LanguageDrop[0]);
            }
            else
            {
                var previewPermission = new PreviewPermission(PortalContext.Current.ServiceContext, PortalContext.Current.Website);
                if (previewPermission.IsEnabledAndPermitted)
                {
                    this._availableLanguages = new Lazy <LanguageDrop[]>(() => contextLanguageInfo.GetWebPageWebsiteLanguages(viewEntity.EntityReference, current).Select(websiteLanguage => new LanguageDrop(this, websiteLanguage)).ToArray());
                    this._languages          = new Lazy <LanguageDrop[]>(() => contextLanguageInfo.ActiveWebsiteLanguages.Select(websiteLanguage => new LanguageDrop(this, websiteLanguage)).ToArray());
                }
                else
                {
                    this._availableLanguages = new Lazy <LanguageDrop[]>(() => contextLanguageInfo.GetWebPageWebsiteLanguages(viewEntity.EntityReference, current).Where(lang => lang.IsPublished).Select(websiteLanguage => new LanguageDrop(this, websiteLanguage)).ToArray());
                    this._languages          = new Lazy <LanguageDrop[]>(() => contextLanguageInfo.ActiveWebsiteLanguages.Where(lang => lang.IsPublished).Select(websiteLanguage => new LanguageDrop(this, websiteLanguage)).ToArray());
                }
            }

            this._isPageless = new Lazy <bool>(() => CrmSiteMapProvider.IsPageless(current));
        }
コード例 #2
0
        public EventScheduleDrop(IPortalLiquidContext portalLiquidContext, IDataAdapterDependencies dependencies, IEventSchedule eventSchedule)
            : base(portalLiquidContext, eventSchedule.Entity)
        {
            Schedule = eventSchedule;

            _dependencies = dependencies;
        }
コード例 #3
0
ファイル: EntityList.cs プロジェクト: ITLec/Dynamics-365-XEP
        private EntityListDrop GetEntityListById(IPortalLiquidContext portalLiquidContext, Context context, string idVariable)
        {
            var idValue = context[idVariable];

            if (idValue == null)
            {
                return(null);
            }

            Guid id;

            if (!Guid.TryParse(idValue.ToString(), out id))
            {
                return(null);
            }

            var portalOrgService = portalLiquidContext.PortalOrganizationService;

            var entityList = portalOrgService.RetrieveSingle(
                "adx_entitylist",
                FetchAttribute.All,
                new[] {
                new Condition("adx_entitylistid", ConditionOperator.Equal, id),
                new Condition("statecode", ConditionOperator.Equal, 0)
            });

            return(GetEntityListDrop(portalLiquidContext, context, entityList));
        }
コード例 #4
0
        public GridMetadataDrop(IPortalLiquidContext portalLiquidContext, GridMetadata gridMetadata, int languageCode) : base(portalLiquidContext)
        {
            if (gridMetadata == null)
            {
                return;
            }
            CssClass             = gridMetadata.CssClass;
            GridCssClass         = gridMetadata.GridCssClass;
            GridColumnWidthStyle = gridMetadata.GridColumnWidthStyle == null ? null : gridMetadata.GridColumnWidthStyle.GetValueOrDefault(EntityGridExtensions.GridColumnWidthStyle.Percent).ToString();
            ColumnOverrides      = gridMetadata.ColumnOverrides != null?gridMetadata.ColumnOverrides.Select(c => new ViewColumnDrop(portalLiquidContext, c)) : null;

            _viewActions         = new Lazy <IEnumerable <ActionDrop> >(() => gridMetadata.ViewActions != null ? gridMetadata.ViewActions.Select(a => CreateActionDrop(portalLiquidContext, a, languageCode)) : null, LazyThreadSafetyMode.None);
            _itemActions         = new Lazy <IEnumerable <ActionDrop> >(() => gridMetadata.ItemActions != null ? gridMetadata.ItemActions.Select(a => CreateActionDrop(portalLiquidContext, a, languageCode)) : null, LazyThreadSafetyMode.None);
            _loadingMessage      = Localization.CreateLazyLocalizedString(gridMetadata.LoadingMessage, languageCode);
            _errorMessage        = Localization.CreateLazyLocalizedString(gridMetadata.ErrorMessage, languageCode);
            _accessDeniedMessage = Localization.CreateLazyLocalizedString(gridMetadata.AccessDeniedMessage, languageCode);
            _emptyMessage        = Localization.CreateLazyLocalizedString(gridMetadata.EmptyMessage, languageCode);
            _detailsFormModal    = new Lazy <DetailsFormModalDrop>(() => new DetailsFormModalDrop(portalLiquidContext, gridMetadata.DetailsFormDialog, languageCode), LazyThreadSafetyMode.None);
            _editFormModal       = new Lazy <EditFormModalDrop>(() => new EditFormModalDrop(portalLiquidContext, gridMetadata.EditFormDialog, languageCode), LazyThreadSafetyMode.None);
            _createFormModal     = new Lazy <CreateFormModalDrop>(() => new CreateFormModalDrop(portalLiquidContext, gridMetadata.CreateFormDialog, languageCode), LazyThreadSafetyMode.None);
            _deleteModal         = new Lazy <DeleteModalDrop>(() => new DeleteModalDrop(portalLiquidContext, gridMetadata.DeleteDialog, languageCode), LazyThreadSafetyMode.None);
            _errorModal          = new Lazy <ErrorModalDrop>(() => new ErrorModalDrop(portalLiquidContext, gridMetadata.ErrorDialog, languageCode), LazyThreadSafetyMode.None);
            _lookupModal         = new Lazy <LookupModalDrop>(() => new LookupModalDrop(portalLiquidContext, gridMetadata.LookupDialog, languageCode), LazyThreadSafetyMode.None);
            _createRecordModal   = new Lazy <CreateRelatedRecordModalDrop>(() => new CreateRelatedRecordModalDrop(portalLiquidContext, gridMetadata.CreateRelatedRecordDialog, languageCode), LazyThreadSafetyMode.None);
        }
コード例 #5
0
        public AdDrop(IPortalLiquidContext portalLiquidContext, IAd ad)
            : base(portalLiquidContext, ad.Entity)
        {
            Ad    = ad;
            Image = new AdImageDrop(Ad);

            _adUrl = new Lazy <string>(GetAdUrl, LazyThreadSafetyMode.None);
        }
コード例 #6
0
 public UserDrop(IPortalLiquidContext portalLiquidContext, IPortalViewEntity viewEntity) : base(portalLiquidContext, viewEntity)
 {
     _basicBadgesUrl           = new Lazy <string>(GetBasicBadgesUrl, LazyThreadSafetyMode.None);
     _roles                    = new Lazy <string[]>(GetRolesForUser, LazyThreadSafetyMode.None);
     _roleKeys                 = new Lazy <string[]>(GetRoleKeysForUser, LazyThreadSafetyMode.None);
     _profileBadgesUrl         = new Lazy <string>(GetProfileBadgesUrl, LazyThreadSafetyMode.None);
     _forumThreadSubscriptions = new Lazy <IEnumerable <ForumThreadDrop> >(() => GetForumThreadSubscriptions(portalLiquidContext), LazyThreadSafetyMode.None);
 }
コード例 #7
0
        public ViewColumnDrop(IPortalLiquidContext portalLiquidContext, IViewColumn column) : base(portalLiquidContext)
        {
            AttributeLogicalName = column.AttributeLogicalName;

            DisplayName = column.DisplayName;

            Width = column.Width;
        }
コード例 #8
0
        public PortalViewContextDrop(IPortalLiquidContext portalLiquidContext, IDataAdapterDependencies dependencies) : base(portalLiquidContext)
        {
            var viewContext = portalLiquidContext.PortalViewContext;

            Entity  = viewContext.Entity == null ? null : new PortalViewEntityDrop(portalLiquidContext, viewContext.Entity);
            User    = viewContext.User == null ? null : new UserDrop(portalLiquidContext, viewContext.User);
            Website = viewContext.Website == null ? null : new WebsiteDrop(portalLiquidContext, viewContext.Website, dependencies);
        }
コード例 #9
0
        public PortalViewContextDrop(IPortalLiquidContext portalLiquidContext) : base(portalLiquidContext)
        {
            var viewContext = portalLiquidContext.PortalViewContext;

            Entity  = viewContext.Entity == null ? null : new PortalViewEntityDrop(portalLiquidContext, viewContext.Entity);
            User    = viewContext.User == null ? null : new UserDrop(portalLiquidContext, viewContext.User);
            Website = viewContext.Website == null ? null : new WebsiteDrop(portalLiquidContext, viewContext.Website);
        }
コード例 #10
0
        /// <summary>
        /// Load the URL to the visualization service route to get the chart builder.
        /// </summary>
        /// <param name="portalLiquidContext">The current <see cref="IPortalLiquidContext"/>.</param>
        /// <returns>The URL to the service.</returns>
        private static Lazy <string> GetLazyServiceUrl(IPortalLiquidContext portalLiquidContext)
        {
            var url = portalLiquidContext.UrlHelper.RouteUrl("Visualizations_GetChartBuilder", new
            {
                __portalScopeId__ = portalLiquidContext.PortalViewContext.Website.EntityReference.Id
            });

            return(new Lazy <string>(() => url, LazyThreadSafetyMode.None));
        }
コード例 #11
0
        public SiteMarkersDrop(IPortalLiquidContext portalLiquidContext, ISiteMarkerDataAdapter siteMarkers) : base(portalLiquidContext)
        {
            if (siteMarkers == null)
            {
                throw new ArgumentNullException("siteMarkers");
            }

            _siteMarkers = siteMarkers;
        }
コード例 #12
0
        public EntitySetDrop(IPortalLiquidContext portalLiquidContext, string entityLogicalName) : base(portalLiquidContext)
        {
            if (entityLogicalName == null)
            {
                throw new ArgumentNullException("entityLogicalName");
            }

            _entityLogicalName = entityLogicalName;
        }
コード例 #13
0
        public WebLinkSetsDrop(IPortalLiquidContext portalLiquidContext, IWebLinkSetDataAdapter webLinkSets) : base(portalLiquidContext)
        {
            if (webLinkSets == null)
            {
                throw new ArgumentNullException("webLinkSets");
            }

            _webLinkSets = webLinkSets;
        }
コード例 #14
0
        public SnippetsDrop(IPortalLiquidContext portalLiquidContext, ISnippetDataAdapter snippets) : base(portalLiquidContext)
        {
            if (snippets == null)
            {
                throw new ArgumentNullException("snippets");
            }

            _snippets = snippets;
        }
コード例 #15
0
ファイル: EntityList.cs プロジェクト: ITLec/Dynamics-365-XEP
        private static Lazy <string> GetLazyModalFormTemplateUrl(IPortalLiquidContext portalLiquidContext)
        {
            var url = portalLiquidContext.UrlHelper.RouteUrl("PortalModalFormTemplatePath", new
            {
                __portalScopeId__ = portalLiquidContext.PortalViewContext.Website.EntityReference.Id
            });

            return(new Lazy <string>(() => url, LazyThreadSafetyMode.None));
        }
コード例 #16
0
        public PortalViewEntityDrop(IPortalLiquidContext portalLiquidContext, IPortalViewEntity viewEntity) : base(portalLiquidContext)
        {
            if (viewEntity == null)
            {
                throw new ArgumentNullException("viewEntity");
            }

            ViewEntity = viewEntity;
        }
コード例 #17
0
        public SiteMarkerDrop(IPortalLiquidContext portalLiquidContext, ISiteMarkerTarget target) : base(portalLiquidContext, target.Entity)
        {
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }

            Target = target;
        }
コード例 #18
0
        public EntityCollectionDrop(IPortalLiquidContext portalLiquidContext, EntityCollection entityCollection) : base(portalLiquidContext)
        {
            if (entityCollection == null)
            {
                throw new ArgumentNullException("entityCollection");
            }

            _entityCollection = entityCollection;
            _entities         = new Lazy <EntityDrop[]>(GetEntities, LazyThreadSafetyMode.None);
        }
コード例 #19
0
        protected PortalDrop(IPortalLiquidContext portalLiquidContext)
        {
            if (portalLiquidContext == null)
            {
                throw new ArgumentNullException("portalLiquidContext");
            }

            _portalLiquidContext = portalLiquidContext;
            _eventsEnabled       = new Lazy <bool>(GetEventsEnabled, LazyThreadSafetyMode.None);
        }
コード例 #20
0
        public SharePointDocumentListDrop(IPortalLiquidContext portalLiquidContext, string entityLogicalName, string folderName) : base(portalLiquidContext)
        {
            if (entityLogicalName == null)
            {
                throw new ArgumentNullException("entityLogicalName");
            }

            _entityLogicalName = entityLogicalName;
            _folderName        = folderName;
        }
コード例 #21
0
        public FormModalDrop(IPortalLiquidContext portalLiquidContext, Modal modal, int languageCode) : base(portalLiquidContext, modal, languageCode)
        {
            var formModal = modal as FormModal;

            if (formModal == null)
            {
                return;
            }
            _loadingMessage = Localization.CreateLazyLocalizedString(formModal.LoadingMessage, languageCode);
        }
コード例 #22
0
        public AdPlacementsDrop(IPortalLiquidContext portalLiquidContext, IAdDataAdapter adPlacements)
            : base(portalLiquidContext)
        {
            if (adPlacements == null)
            {
                throw new ArgumentNullException("adPlacements");
            }

            _adPlacements = adPlacements;
        }
コード例 #23
0
        public PollPlacementsDrop(IPortalLiquidContext portalLiquidContext, IPollDataAdapter dataAdapter)
            : base(portalLiquidContext)
        {
            if (dataAdapter == null)
            {
                throw new ArgumentNullException("dataAdapter");
            }

            _dataAdapter = dataAdapter;
        }
コード例 #24
0
        public ErrorModalDrop(IPortalLiquidContext portalLiquidContext, Modal modal, int languageCode) : base(portalLiquidContext, modal, languageCode)
        {
            var errorModal = modal as ErrorModal;

            if (errorModal == null)
            {
                return;
            }
            _body = Localization.CreateLazyLocalizedString(errorModal.Body, languageCode);
        }
コード例 #25
0
        public DeleteModalDrop(IPortalLiquidContext portalLiquidContext, Modal modal, int languageCode)
            : base(portalLiquidContext, modal, languageCode)
        {
            var deleteModal = modal as DeleteModal;

            if (deleteModal == null)
            {
                return;
            }
            _confirmation = Localization.CreateLazyLocalizedString(deleteModal.Confirmation, languageCode);
        }
コード例 #26
0
        public WorkflowActionDrop(IPortalLiquidContext portalLiquidContext, Action action, int languageCode)
            : base(portalLiquidContext, action, languageCode)
        {
            var workflowAction = action as WorkflowAction;

            if (workflowAction == null)
            {
                return;
            }
            WorkflowId = workflowAction.WorkflowId;
        }
コード例 #27
0
 public ActionDrop(IPortalLiquidContext portalLiquidContext, Action action, int languageCode)
     : base(portalLiquidContext)
 {
     if (action == null)
     {
         return;
     }
     _buttonLabel   = Localization.CreateLazyLocalizedString(action.ButtonLabel, languageCode);
     _buttonTooltip = Localization.CreateLazyLocalizedString(action.ButtonTooltip, languageCode);
     _type          = new Lazy <string>(() => action.GetType().Name, LazyThreadSafetyMode.None);
 }
コード例 #28
0
        public CreateActionDrop(IPortalLiquidContext portalLiquidContext, Action action, int languageCode)
            : base(portalLiquidContext, action, languageCode)
        {
            var createAction = action as CreateAction;

            if (createAction == null)
            {
                return;
            }
            EntityFormId = createAction.EntityFormId;
        }
コード例 #29
0
        public WebLinkSetDrop(IPortalLiquidContext portalLiquidContext, IWebLinkSet webLinkSet) : base(portalLiquidContext, webLinkSet)
        {
            if (webLinkSet == null)
            {
                throw new ArgumentNullException("webLinkSet");
            }

            WebLinkSet = webLinkSet;

            _webLinks = new Lazy <WebLinkDrop[]>(() => webLinkSet.WebLinks.Select(e => new WebLinkDrop(this, e)).ToArray(), LazyThreadSafetyMode.None);
        }
        public SearchIndexQueryResultDrop(IPortalLiquidContext portalLiquidContext, ICrmEntitySearchResult result) : base(portalLiquidContext)
        {
            if (result == null)
            {
                throw new ArgumentNullException("result");
            }

            Result = result;

            _entity = new Lazy <EntityDrop>(GetEntity, LazyThreadSafetyMode.None);
        }