Quantcast
Channel: Using Optimizely Platforms
Viewing all 8020 articles
Browse latest View live

Calculating discounted price

$
0
0

Hi

How can you calculate the discounted prices for a diferent customer group/price group?

private IEnumerable<DiscountedEntry> GetDiscountedPrices(ContentReference contentLink, IMarket CurrentMarket, IBaseContext context)
{
var promotionEngine = container
.With<PromotionEngineContentLoader>(container.With(context)
.GetInstance<CustomPromotionEngineContentLoader>())
.GetInstance<IPromotionEngine>();

return promotionEngine.GetDiscountPrices(
new[] { contentLink },
CurrentMarket,
CurrentMarket.DefaultCurrency,
referenceConverter,
lineItemCalculator);
}


Hide uploaded media under the media tab.

$
0
0

Hi, is it possible to hide media so they will not to be shown in the media tab in Epi?

Lets say we upload a document that should only be used in our custom tool within the system.

We don't want the uploaded documents to be shown in the media tab in EPI.

hit.OriginalObjectGetter.Invoke() is null (Find 13.2.2)

$
0
0

We have upgraded to 13.2.2 and some code based on episerver posts that was working fine has broken.

This below was getting back the underlying type from UnifiedSearch, anyone have any idea how to fix without reloading the content.

        /// <summary>
        /// Gets the original object.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="hit">The hit.</param>
        /// <returns>T.</returns>
        public static T GetOriginalObject<T>(this UnifiedSearchHit hit)
        {
            if (hit.OriginalObjectGetter != null)
            {
                var original = hit.OriginalObjectGetter.Invoke();
                if (original is T)
                {
                    return (T)original;
                }
            }
            return default(T);
        }

EPiServer DXC and SqlBlobProvider

$
0
0

Hi

I am not sure if I post this in the right forum, but I did not find a forum for EPiServer DXC.

At my company we are building a new site thats going to be hosted in EPiServer DXC. It says here: https://world.episerver.com/digital-experience-cloud-service/deploying/creating-a-new-cms-site-and-deploying/

that you should change to the following settings:

<episerver.framework><blob defaultProvider="azureblobs"><providers><add name="azureblobs" connectionStringName="EPiServerAzureBlobs" container="mysitemedia" type="EPiServer.Azure.Blobs.AzureBlobProvider,EPiServer.Azure" /></providers></blob><event defaultProvider="azureevents"><providers><add name="azureevents" connectionStringName="EPiServerAzureEvents" topic="MySiteEvents" type="EPiServer.Azure.Events.AzureEventProvider,EPiServer.Azure" /></providers></event></episerver.framework>

I would like to use the SqlBlobProvider

<episerver.framework><blob defaultProvider="sqlBlobProvider"><providers><add name="sqlBlobProvider" type="EPiCode.SqlBlobProvider.SqlBlobProvider, EPiCode.SqlBlobProvider" /></providers></blob><event defaultProvider="azureevents"><providers><add name="azureevents" connectionStringName="EPiServerAzureEvents" topic="MySiteEvents" type="EPiServer.Azure.Events.AzureEventProvider,EPiServer.Azure" /></providers></event></episerver.framework>

My guess is that thats' no problem.

Am I correct?

Regards Hans

Initialization fails when starting site (Activation error occurred while trying to get instance of type PropertyContentReferenceListTransform)

$
0
0

Hi, 

I am quite new with Episerver CMS and I am encountering a failure during the setup on my computer of an existing site. The solution contains a main project and a library project.

IIS has already been setup and db has been imported and configured.

I cannot get access to CMS at all and I get a failure during Initialization. I am sure I am doing some basic error, but I cannot figure it out.

Below is the log from Episerver. What does the "authority" error means in the inner exception?

Thanks in advance for your help!

2019-09-02 10:15:15,930 [1] ERROR EPiServer.Framework.Initialization.InitializationEngine: Initialize action failed for 'Initialize on class EPiServer.Enterprise.Internal.EnterpriseInitialization, EPiServer.Enterprise, Version=10.10.4.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'
EPiServer.ServiceLocation.ActivationException: Activation error occurred while trying to get instance of type PropertyContentReferenceListTransform, key "" ---> StructureMap.Building.StructureMapBuildException: Error while building type EPiServer.Core.Transfer.Internal.DependentContentTransfer. See the inner exception for details
1.) new DependentContentTransfer(*Default of IContentLoader*, *Default of IContentTypeRepository*, *Default of IPermanentLinkMapper*, *Default of ISiteDefinitionRepository*, *Default of ContentRootService*)
2.) EPiServer.Core.Transfer.Internal.DependentContentTransfer
3.) Instance of EPiServer.Core.Transfer.IDependentContentTransfer (EPiServer.Core.Transfer.Internal.DependentContentTransfer)
4.) new PropertyContentReferenceListTransform(*Default of IPermanentLinkMapper*, *Default of IContentLoader*, *Default of IDependentContentTransfer*)
5.) EPiServer.Core.Transfer.Internal.PropertyContentReferenceListTransform
6.) Instance of EPiServer.Core.Transfer.Internal.PropertyContentReferenceListTransform
7.) Container.GetInstance(EPiServer.Core.Transfer.Internal.PropertyContentReferenceListTransform)
---> System.ArgumentException: Authority cannot contain multiple ports
Parameter name: authority
at EPiServer.Web.UriAuthority..ctor(String authority)
at EPiServer.Web.HostDefinition.set_Name(String value)
at EPiServer.DataAccess.Internal.SiteDefinitionDB.HostDefinitionFromReader(IDataRecord r)
at EPiServer.DataAccess.Internal.SiteDefinitionDB.<List>b__4_0()
at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.<>c__DisplayClass31_0`1.<Execute>b__0()
at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method)
at EPiServer.Web.Internal.DefaultSiteDefinitionRepository.List()
at EPiServer.Core.Transfer.Internal.DependentContentTransfer..ctor(IContentLoader contentLoader, IContentTypeRepository contentTypeRepository, IPermanentLinkMapper permanentLinkMapper, ISiteDefinitionRepository siteRepository, ContentRootService contentRootService)
at lambda_method(Closure , IBuildSession , IContext )
--- End of inner exception stack trace ---
at lambda_method(Closure , IBuildSession , IContext )
at StructureMap.Building.BuildPlan.Build(IBuildSession session, IContext context) in c:\BuildAgent\work\a395dbde6b793293\src\StructureMap\Building\BuildPlan.cs:line 151
at StructureMap.SessionCache.GetObject(Type pluginType, Instance instance, ILifecycle lifecycle) in c:\BuildAgent\work\a395dbde6b793293\src\StructureMap\SessionCache.cs:line 93
at StructureMap.SessionCache.GetDefault(Type pluginType, IPipelineGraph pipelineGraph) in c:\BuildAgent\work\a395dbde6b793293\src\StructureMap\SessionCache.cs:line 68
at StructureMap.Container.GetInstance(Type pluginType) in c:\BuildAgent\work\a395dbde6b793293\src\StructureMap\Container.cs:line 337
at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
--- End of inner exception stack trace ---
at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance[TService]()
at EPiServer.Enterprise.Internal.EnterpriseInitialization.RegisterImportingEventHandlers(IDataImportEvents importerEvents, IServiceLocator factory)
at EPiServer.Enterprise.Internal.EnterpriseInitialization.Initialize(InitializationEngine context)
at EPiServer.Framework.Initialization.Internal.ModuleNode.Execute(Action a, String key)
at EPiServer.Framework.Initialization.Internal.ModuleNode.Initialize(InitializationEngine context)
at EPiServer.Framework.Initialization.InitializationEngine.InitializeModules()
EPiServer.ServiceLocation.ActivationException: Activation error occurred while trying to get instance of type PropertyContentReferenceListTransform, key "" ---> StructureMap.Building.StructureMapBuildException: Error while building type EPiServer.Core.Transfer.Internal.DependentContentTransfer. See the inner exception for details
1.) new DependentContentTransfer(*Default of IContentLoader*, *Default of IContentTypeRepository*, *Default of IPermanentLinkMapper*, *Default of ISiteDefinitionRepository*, *Default of ContentRootService*)
2.) EPiServer.Core.Transfer.Internal.DependentContentTransfer
3.) Instance of EPiServer.Core.Transfer.IDependentContentTransfer (EPiServer.Core.Transfer.Internal.DependentContentTransfer)
4.) new PropertyContentReferenceListTransform(*Default of IPermanentLinkMapper*, *Default of IContentLoader*, *Default of IDependentContentTransfer*)
5.) EPiServer.Core.Transfer.Internal.PropertyContentReferenceListTransform
6.) Instance of EPiServer.Core.Transfer.Internal.PropertyContentReferenceListTransform
7.) Container.GetInstance(EPiServer.Core.Transfer.Internal.PropertyContentReferenceListTransform)
---> System.ArgumentException: Authority cannot contain multiple ports
Parameter name: authority
at EPiServer.Web.UriAuthority..ctor(String authority)
at EPiServer.Web.HostDefinition.set_Name(String value)
at EPiServer.DataAccess.Internal.SiteDefinitionDB.HostDefinitionFromReader(IDataRecord r)
at EPiServer.DataAccess.Internal.SiteDefinitionDB.<List>b__4_0()
at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.<>c__DisplayClass31_0`1.<Execute>b__0()
at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method)
at EPiServer.Web.Internal.DefaultSiteDefinitionRepository.List()
at EPiServer.Core.Transfer.Internal.DependentContentTransfer..ctor(IContentLoader contentLoader, IContentTypeRepository contentTypeRepository, IPermanentLinkMapper permanentLinkMapper, ISiteDefinitionRepository siteRepository, ContentRootService contentRootService)
at lambda_method(Closure , IBuildSession , IContext )
--- End of inner exception stack trace ---
at lambda_method(Closure , IBuildSession , IContext )
at StructureMap.Building.BuildPlan.Build(IBuildSession session, IContext context) in c:\BuildAgent\work\a395dbde6b793293\src\StructureMap\Building\BuildPlan.cs:line 151
at StructureMap.SessionCache.GetObject(Type pluginType, Instance instance, ILifecycle lifecycle) in c:\BuildAgent\work\a395dbde6b793293\src\StructureMap\SessionCache.cs:line 93
at StructureMap.SessionCache.GetDefault(Type pluginType, IPipelineGraph pipelineGraph) in c:\BuildAgent\work\a395dbde6b793293\src\StructureMap\SessionCache.cs:line 68
at StructureMap.Container.GetInstance(Type pluginType) in c:\BuildAgent\work\a395dbde6b793293\src\StructureMap\Container.cs:line 337
at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
--- End of inner exception stack trace ---
at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance[TService]()
at EPiServer.Enterprise.Internal.EnterpriseInitialization.RegisterImportingEventHandlers(IDataImportEvents importerEvents, IServiceLocator factory)
at EPiServer.Enterprise.Internal.EnterpriseInitialization.Initialize(InitializationEngine context)
at EPiServer.Framework.Initialization.Internal.ModuleNode.Execute(Action a, String key)
at EPiServer.Framework.Initialization.Internal.ModuleNode.Initialize(InitializationEngine context)
at EPiServer.Framework.Initialization.InitializationEngine.InitializeModules()

Multi-site favicons for siteassets

$
0
0

Hi all,

We are running Episerver v11.5.1 on DXC in a multi-site environment.

We are able to serve different icon for each site by storing the icon in different paths for each site. This works fine for website pages.

But when we serve assets from /siteassets , say for example when someone opens a PDF in their Browser from the Search Results page, the favicon.ico is served from the root /favicon.ico

We have seen issues with 404's if there is no root favicon.ico, so we have placed a generic/empty looking favicon.ico in the root for now.

Can someone please explain how it is possible to serve a different favicon for different sites for /siteassets?

I did have a read of this post. Maybe a rewrite rule is possible on DXC based on domain name?
https://world.episerver.com/forum/User-Forum/Functionality-in-Episerver/Thread-Container/2015/8/multiple-favicons/


Reintroduce anchors in top navigation bar

$
0
0

During development I always log in to Episerver, open Edit and middle click (open in new tab) on Admin to be able to quickly switch between these to views. You have now made that impossible since there's only a script click event—i.e. not a real anchor element—on these buttons. A right click establishes this quite clear.

Change this back. A button leading to a new url should always be an anchor. Simple as that. Whether or not I should open this new page in the same browser tab or not is not for your developers to decide. Click events like these are just bad practice.

Add Content Delivery API with OAuth configuration

$
0
0

Hello,

We are trying to get the Content Delivery API working on an existing project (Episerver 11.10.2.0).

The default API is working, but we also want to use the OAuth possibility.

Therefore we need to add some lines to Startup.cs file.
But this file is missing in our project.

It's a project from one or two years ago.
So, what do we have to do? Create custom Startup.cs file? If so, with which code exactly?
What dow we have to do with the appSetting "owin:AutomaticAppStartup" value (should it be false or true)?

When we set the appSetting to true and add the following lines to our newly added Startup.cs file:

app.UseContentApiIdentityOAuthAuthorization<ApplicationUserManager<ApplicationUser>, ApplicationUser>(new ContentApiOAuthOptions()
{
      RequireSsl = false,
      AccessTokenExpireTimeSpan = TimeSpan.FromMinutes(41),
      RefreshTokenExpireTimeSpan = TimeSpan.FromDays(14)
});

we got the following error when calling /api/episerver/v2.0/site/:

Hopefully someone can help us with this problem!

Thanks in advance.


Grtz Sander


Determine if catalogentry is a product or variant by code

$
0
0

Hi,

What's the best way to determine if an entrycode belongs to a product or variant? 
I have a renderer that has different behaviour for variants and products. 
Using only code as a parameter, is it possible to find out if that code belongs to a product, variant or even perhaps a bundle?


Thanks in advance

Warning at startup: Could not load type 'EPiServer.Core.PropertyXForm', falling back to base type instead

$
0
0

Hi,

Does anybody have an idea, why do I find in my Episerver Log the following entry 519 times in the log file each time I start up the project? 2019-09-03 12:51:11,089;[9];WARN;EPiServer.DataAbstraction.PropertyDefinitionType;Could not load type 'EPiServer.Core.PropertyXForm', falling back to base type instead

We do not use XForms in the project and I can only find references to it in web.config, I guess which came with the installation.

Thanks in advance.

Menu items disappear in the new UI

$
0
0

We are having problem with the new UI and when having a lot of different items in our custom menu. I replicated it so you can see (so, this not how our looks just for you to see what is happening) in the image below. As you can see part of Visitor Groups is gone and if there were any items on the right of it, they would not be possible to select.

Are there any way to fix so it can be scrollable or simular?

PageEditing.GetEditUrl causes page within a page

$
0
0

I would like to make a link from one block in edit mode to another block in edit mode. I can generate the url using PageEditing.GetEditUrl but if I click on that link, it opens a page within a page which I dont want. If I make the link target="_blank" it opens correctly in a new tab, but thats not really what I want either. Is this possible?

Component ClientResources Path

$
0
0

Hello,

I have been banging my head against the wall for a while now trying to figure out what I am doing wrong here. I am trying to package my dashboard component, but when I try to reference the dojo script, it throws a 404 because it is looking in the ~/Episerver/Shell/{version}/ folder instead of my packaged component folder. Looking at the component package it all seems to be structured correctly in ~/modules/_protected/{package_name}. I am assuming its something I am doing wrong with my module.config but I can't seem to narrow it down.

<?xml version="1.0" encoding="utf-8"?><module productName="componentName" clientResourceRelativePath="1.0.9" loadFromBin="false" tags="EPiServerModulePackage"><assemblies><add assembly="company.componentName" /></assemblies><dojo><paths><add name="componentName" path="ClientResources/Scripts" /></paths></dojo><clientModule><moduleDependencies><add dependency="Shell" /><add dependency="CMS" /></moduleDependencies></clientModule></module>

Can anyone point me in the right direction?

Thanks

Variants shown as Not published, although dates are OK and IsActive = true in the database

$
0
0

Hi, everyone,

We are having a Commerce installation that gets the product info from InRiver. We are not working on the connector or InRiver, a partner company is.

They have set a variant as unpublished and then they tried to publish it, however, in the interface, this is still not displayed as published. When I checked the DB, IsActive is true and dates are correct as well. The partner company says that this happens only for accessories and spareparts, but not for genericvariants, although I can't effectively test this myself.

What could cause this, any ideas on what to check?

Thx,
Marija

Add Submission Count Method to IPermanentStorage

$
0
0

51 requests are made to LoadSubmissionFromStorage in IPermanentStorage when rendering the form submissions table in edit view. One request fetches all the submission data for the table, and 50 requests are made for the 50 days in the form submission chart from Episerver.Forms.Core.Data.FormdataRepository.GetSubmissionDataCount

When implementing encryption of form submissions, if one does not want the drawbacks of the encryption method included out of the box (https://devblog.gosso.se/2017/12/encrypting-form-submissions-episerver-forms/), one can implement encryption in a custom implementation of IPermanentStorage

However, if LoadSubmissionFromStorage is supposed to return decrypted data, the decryption process is initiated 51 times. Encryption keys are fetched for each submission (could be many) and each submission data field (many submissions, each with many fields) is decrypted. This is resource-intensive and does not scale well.

DdsPermanentStorage (default implementation of IPermanentStorage) simply returns an IQueryable with the form submission. On the other hand, our custom implementation of IPermanentStorage has to decrypt the data first in order to deliver on the method name - loading the submissions from storage. 

Is it possible for Episerver.Forms.Core.Data.FormdataRepository.GetSubmissionDataCount to simply use another method than LoadSubmissionFromStorage to get the submission count?

For instance, a new method named something like CountSubmissionsInStorage could be implemented in DdsPermanentStorage by calling LoadSubmissionFromStorage, since there is no decryption overhead associated with the request. This would enable us to return the submission count in a custom implementation of IPermanentStorage with significantly less overhead, and without loading the actual submissions from storage and decrypting them only to find the number of submissions.  

Best regards, 
Eivind


EPiServer 10.10.4.0: Unexpected behaviour of the DDS for the StorageUpdateEntity entity

$
0
0

Hello,

We are got next error in the logs during developing our project:

ERROR EPiServer.Packaging.Storage.StateStorage:ErrorFormat - There are more than one record in StorageUpdateEntity data store for server with id 'guid'. Extra records will be deleted.

I looked into the DB and found that the tblSystemBigTable table really contains two records with the EPiServer.Packaging.Storage.StorageUpdateEntity as the StoreName column values and equal ItemType and ServerId values but with different UpdateDate values.

I started debbuging and found this method in the EPiServer.Packaging.Storage.StateStorage:

public void SaveUpdateDate(DateTime updateDate)
{
    this._databaseHandlerAccessor().ExecuteLocked(nameof (StateStorage), (Action) (() =>
    {
        using (DynamicDataStore store = this._storeFactory.GetOrCreateStore(typeof (StorageUpdateEntity)))
        {
            StorageUpdateEntity storageUpdateEntity1 = store.Items().FirstOrDefault((Expression>) (p => p.ServerId == this._currentServerId));
            if (storageUpdateEntity1 == null)
                storageUpdateEntity1 = new StorageUpdateEntity()
                {
                    ServerId = this._currentServerId
                };
            StorageUpdateEntity storageUpdateEntity2 = storageUpdateEntity1;
            storageUpdateEntity2.UpdateDate = updateDate;
            store.Save((object) storageUpdateEntity2);
        }
    }));
}

It is called on initialization process after checking the modified date of the packages.config file and if it is not the same with the latest UpdateDate of the StorageUpdateEntity entity stored in the tblSystemBigTable table.

Then, follow by the SaveUpdateDate method logic, it should create new record to DDS in case there no one entity exists before or just update the UpdateDate of the existent DDS record.

The first case works good.

The second case does not work. It adds new DDS record instead of updation.

Could you please clarify this ocasion to me?

Thanks!

Override prices when adding through EpiServerAPI

$
0
0

Hi, 
When I add a price via EpiServerAPI, the old value isn't deleted, is there any option I can force an override when new price come.
Thank you

Cancel Order Not Updating Inventory

$
0
0

After cancelling the order from Commerce Manager, the inventory of the relevant product is not updating (not incrementing). 

Is there any reason for this issue ?

When I dig further by implementing AdjustInventoryOrRemoveLineItem method, I found that OperationKeys are not available in shipment parameter passing to AdjustInventoryOrRemoveLineItem method.

is there any reason for NOT having OperationKeys ?

Custom segment in the middle of URL

$
0
0

Hi,

I'm attemping to add a custom segment in the middle of an url. Consider the two urls:

/products/consumer/bikes and
/products/business/bikes

I would like both urls to route to the same page in Episerver CMS.

The cms page structure is:

  • Products
    • Bikes 

The consumer and business part of the url is added to the RouteData object in the request context. I believe I have the correct logic for this implemented in a custom segment class that extends the SegmentBase class.

However, what URL should I use when registering this custom segment to the route table? I have tried {language}/{node}/{customertype}/{partial}/{action} but it does not seem to match the mentioned urls to the Bikes-page.

   RouteTable.Routes.MapContentRoute(
                name: "CustomerTypeSegment",
                url: "{language}/{node}/{customertype}/{partial}/{action}",
                defaults: new { action = "index" },
                parameters: parameters
            );

The normal behaviour of the Episerver pages route will render the bike-page when hitting /products/bikes, however I am looking for the same behaviour using /products/consumer/bikes or /products/business/bikes. Is this even possible to do using only url segments? Or do I need to implement a custom PartialRouter?

Forum Add-on?

$
0
0

Does anyone know of a forum Add-on for Episerver 11, running on DXC? Anyone built one using the Social API?

Viewing all 8020 articles
Browse latest View live