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)); }
public EventScheduleDrop(IPortalLiquidContext portalLiquidContext, IDataAdapterDependencies dependencies, IEventSchedule eventSchedule) : base(portalLiquidContext, eventSchedule.Entity) { Schedule = eventSchedule; _dependencies = dependencies; }
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)); }
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); }
public AdDrop(IPortalLiquidContext portalLiquidContext, IAd ad) : base(portalLiquidContext, ad.Entity) { Ad = ad; Image = new AdImageDrop(Ad); _adUrl = new Lazy <string>(GetAdUrl, LazyThreadSafetyMode.None); }
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); }
public ViewColumnDrop(IPortalLiquidContext portalLiquidContext, IViewColumn column) : base(portalLiquidContext) { AttributeLogicalName = column.AttributeLogicalName; DisplayName = column.DisplayName; Width = column.Width; }
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); }
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); }
/// <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)); }
public SiteMarkersDrop(IPortalLiquidContext portalLiquidContext, ISiteMarkerDataAdapter siteMarkers) : base(portalLiquidContext) { if (siteMarkers == null) { throw new ArgumentNullException("siteMarkers"); } _siteMarkers = siteMarkers; }
public EntitySetDrop(IPortalLiquidContext portalLiquidContext, string entityLogicalName) : base(portalLiquidContext) { if (entityLogicalName == null) { throw new ArgumentNullException("entityLogicalName"); } _entityLogicalName = entityLogicalName; }
public WebLinkSetsDrop(IPortalLiquidContext portalLiquidContext, IWebLinkSetDataAdapter webLinkSets) : base(portalLiquidContext) { if (webLinkSets == null) { throw new ArgumentNullException("webLinkSets"); } _webLinkSets = webLinkSets; }
public SnippetsDrop(IPortalLiquidContext portalLiquidContext, ISnippetDataAdapter snippets) : base(portalLiquidContext) { if (snippets == null) { throw new ArgumentNullException("snippets"); } _snippets = snippets; }
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)); }
public PortalViewEntityDrop(IPortalLiquidContext portalLiquidContext, IPortalViewEntity viewEntity) : base(portalLiquidContext) { if (viewEntity == null) { throw new ArgumentNullException("viewEntity"); } ViewEntity = viewEntity; }
public SiteMarkerDrop(IPortalLiquidContext portalLiquidContext, ISiteMarkerTarget target) : base(portalLiquidContext, target.Entity) { if (target == null) { throw new ArgumentNullException("target"); } Target = target; }
public EntityCollectionDrop(IPortalLiquidContext portalLiquidContext, EntityCollection entityCollection) : base(portalLiquidContext) { if (entityCollection == null) { throw new ArgumentNullException("entityCollection"); } _entityCollection = entityCollection; _entities = new Lazy <EntityDrop[]>(GetEntities, LazyThreadSafetyMode.None); }
protected PortalDrop(IPortalLiquidContext portalLiquidContext) { if (portalLiquidContext == null) { throw new ArgumentNullException("portalLiquidContext"); } _portalLiquidContext = portalLiquidContext; _eventsEnabled = new Lazy <bool>(GetEventsEnabled, LazyThreadSafetyMode.None); }
public SharePointDocumentListDrop(IPortalLiquidContext portalLiquidContext, string entityLogicalName, string folderName) : base(portalLiquidContext) { if (entityLogicalName == null) { throw new ArgumentNullException("entityLogicalName"); } _entityLogicalName = entityLogicalName; _folderName = folderName; }
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); }
public AdPlacementsDrop(IPortalLiquidContext portalLiquidContext, IAdDataAdapter adPlacements) : base(portalLiquidContext) { if (adPlacements == null) { throw new ArgumentNullException("adPlacements"); } _adPlacements = adPlacements; }
public PollPlacementsDrop(IPortalLiquidContext portalLiquidContext, IPollDataAdapter dataAdapter) : base(portalLiquidContext) { if (dataAdapter == null) { throw new ArgumentNullException("dataAdapter"); } _dataAdapter = dataAdapter; }
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); }
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); }
public WorkflowActionDrop(IPortalLiquidContext portalLiquidContext, Action action, int languageCode) : base(portalLiquidContext, action, languageCode) { var workflowAction = action as WorkflowAction; if (workflowAction == null) { return; } WorkflowId = workflowAction.WorkflowId; }
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); }
public CreateActionDrop(IPortalLiquidContext portalLiquidContext, Action action, int languageCode) : base(portalLiquidContext, action, languageCode) { var createAction = action as CreateAction; if (createAction == null) { return; } EntityFormId = createAction.EntityFormId; }
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); }