Quantcast
Channel: Developer to developer
Viewing all 9076 articles
Browse latest View live

Custom (image) Content Provider - image doesn't render in edit mode

$
0
0

Hello,

I'm in the middle of implementing a custom content provider to server images from an external dam system.

I've got almost everything running, except, I have no images in on page edit mode.

My content provider returns a custom IContent type that inhertits from ImageData, this to blend in as best as possible in epi.
Behind it I have a custom blobprovider to stream images from the dam.

Thumbnails in the shell works, as well as the rendering on the public site. But I don't see any images in edit mode.
And I think the problems lies how epi generates it url's.

If I use an image from de default media library, the url to an image in edit mode is the following:
http://localhost:1812/EPiServer/CMS/Content/globalassets/en/demo/cotton/farm2.jpg,,14?epieditmode=False

But when I use an image from my provider, it's like this:
http://localhost:1812/EPiServer/CMS/Content/en/dam/9FCBB804-89E5-4443-8D969A9265D74B3B-home-banner.jpg,,1__bynder?epieditmode=True

If I open this url, it triggers 2 requests:

  1. http://localhost:1812/EPiServer/CMS/Content/en/dam/9FCBB804-89E5-4443-8D969A9265D74B3B-home-banner.jpg,,1__bynder?epieditmode=True
    Content-Type:text/html; charset=utf-8
  2. http://localhost:1812/EPiServer/CMS/Content/en/dam/9FCBB804-89E5-4443-8D969A9265D74B3B-home-banner.jpg,,1__bynder?epieditmode=False
    Content-Type:image/jpeg

When I use the edit action menu in the assets pane, it immediately renders the following (correct?) url:
http://localhost:1812/EPiServer/CMS/Content/en/dam/9FCBB804-89E5-4443-8D969A9265D74B3B-home-banner.jpg,,1__bynder?epieditmode=False
Content-Type:image/jpeg

Does anybody already encountered this? Any idea how to resolve this?

Many thanks,

bob


Copy site from one environment to another

$
0
0

Hi 

I'm new to epi .

Looking for a method to copy the site form low environment to higher environment.  

What Is the most efficient way to do it ? 

I sow the api and PowerShell cmdlet what do you suggest for content migration ? 

My database version (7048) is ahead of what my code expects (7047)

$
0
0

I have the problem of a database version ahead of my code, which is weirdly backward. Usually, you have a database version lagging behind your code, that needs to be upgraded, but I have this:

   The database schema for 'CMS' has not been updated to version '7047.0',
current database version is '7048.0'. Update the database manually by
running the cmdlet 'Update-EPiDatabase' in the package manager console
or set updateDatabaseSchema="true" on episerver.framework configuration
element.

I restored a database from my client and cloned their repo. This is what I get. They don't have any problems. No idea why I have an issue, but this is strange.

  • updateDatabaseSchema is already set to 'true," but remember that we're not "updating," as much as we need to go back one version.

  • I ran "Update-EPiDatabase" from the Package Manager Console. It ran through a whole bunch of SQL files very, very quickly. I checked them out -- I doubt any of them did anything, because they all check the database version, and the most recent one (10.9.0) abandons if the database is greater than 7047, which it is.

So...what do I do now?  How do you "downgrade" a database?

IndexingService configurations

$
0
0

Hi,

Anyone that knows how to configure IndexingService? 

We are trying to make it work in a load balanced environment. It worked fine in the load balanced test environment but in production environment we got these errors in the log file.

EPiServer.Search.Internal.RequestQueueHandler: RequestQueue failed to retrieve unprocessed queue items. Message: Object reference not set to an instance of an object.
Stacktrace: at EPiServer.Search.Data.Internal.SearchFactory.ConstructSyndicationItem(IndexRequestQueueItem queueItem)
at EPiServer.Search.Data.Internal.SearchFactory.GetUnprocessedQueueItems(String namedIndexingService, Int32 pageSize, Collection`1& ids)
at EPiServer.Search.Internal.RequestQueueHandler.ProcessQueue()

There is a table called "tblIndexRequestLog" but is empty, perhaps thats how it should be?

When we clicked on the reindex button on this page /episerver/CMS/Admin/IndexContent.aspx we got these errors. 

EPiServer.Search.IndexingService.IndexingService: Reset of index: '' failed. Index not found!

EPiServer.Search.Internal.RequestHandler: Could not reset index '' for service uri 'http://[server]/IndexingService/IndexingService.svc/reset/?namedindex=&accesskey=local'. Message: The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse()
at System.Net.HttpWebRequest.GetResponse()
at EPiServer.Search.Internal.RequestHandler.MakeHttpRequest(String url, IndexingServiceReference indexingServiceReference, String method, Stream postData, Action`1 responseHandler)
at EPiServer.Search.Internal.RequestHandler.ResetIndex(String namedIndexingService, String namedIndex)

Our configuration:

<episerver.search active="true">
  <namedIndexingServices defaultService="serviceName">
    <services>
      <add name="serviceName" baseUri="http://[server]/IndexingService/IndexingService.svc" accessKey="local" />
    </services>
  </namedIndexingServices>
  <searchResultFilter defaultInclude="true">
    <providers />
  </searchResultFilter>
</episerver.search>

<system.serviceModel>
  <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>

<episerver.search.indexingservice>
  <clients>
    <add name="local" description="local" allowLocal="true" readonly="false" ipAddress="0.0.0.0/0" ip6Address="::/0" />
  </clients>
  <namedIndexes defaultIndex="default">
    <indexes>
      <add name="default" directoryPath="\\[server]\App_Data\Index" readonly="false" />
    </indexes>
  </namedIndexes>
</episerver.search.indexingservice>

Lucene can create its index files, but when we search we only get hits when we search for the page ids.

Regards,

Morgan

remove container node pages from search

$
0
0

hi all,

i have a site in which i have a container node menu.

in that node i have several pages with different page types.

but when i want to do search i dont want to display results from container node(from its childrens pages also).

Problem with saving a ContentAccessControlList.

$
0
0

Hi!

I have a problem with saving a ContentAccessControlList. 

When i create a specific pagetype i want to programatically create a set of containers and subpages and set their access rights. 

Creating a page and its subpages/containers works fine but when i try to set the access rights for each subpage i get this error when i try to save.

System.NotSupportedException: 'Specified method is not supported.'

The Code:

public static void SetAccessRightsForPongChildPages(PageData page, string productCode = null)
{
var pageAccessControlList = new ContentAccessControlList(page.PageLink)
{
new AccessControlEntry("Administrators", AccessLevel.FullAccess, SecurityEntityType.Role),
new AccessControlEntry(ConfigurationManager.AppSettings["EPiRoleAdmin"], AccessLevel.FullAccess, SecurityEntityType.Role)
};
if (page is ContainerBasePage)
{
pageAccessControlList.Add(new AccessControlEntry("Everyone", AccessLevel.Read, SecurityEntityType.Role));
}
if (productCode != null)
{       pageAccessControlList.Add(new AccessControlEntry(ConfigurationManager.AppSettings["EPiRoleProdOwnerBase"] + productCode,       AccessLevel.FullAccess & ~AccessLevel.Administer & ~AccessLevel.Publish, SecurityEntityType.Role));
}
pageAccessControlList.Save();
}



I have also tried using pageAccessControlList.Save(SecuritySaveType.Replace);. 

Happy if anyone can point me in the right direction :)

[Pasting files is not allowed]

Can't load any membership providers

$
0
0

Hello,

I have just loaded an Alloy example site and was starting to look at logging into episerver. However, when I checked the <membership> and <roleManager> sections in web.config, they were empty. 

So after checking the docs at https://world.episerver.com/documentation/developer-guides/CMS/security/Authentication-and-authorization/, I filled out this section with the following config:

<membership defaultProvider="WindowsMembershipProvider"
userIsOnlineTimeWindow="10"><providers><clear /><add name="WindowsMembershipProvider"
type="EPiServer.Security.WindowsMembershipProvider, EPiServer"
deletePrefix="BUILTIN\" /></providers></membership><roleManager enabled="true" defaultProvider="WindowsRoleProvider"><providers><clear /><add name="WindowsRoleProvider"
applicationName="EPiServerSample"
type="EPiServer.Security.WindowsRoleProvider, EPiServer" /></providers></roleManager>

However, when I load the site now I get the following error message displayed:

Parser Error Message: Could not load type 'EPiServer.Security.WindowsRoleProvider' from assembly 'EPiServer'.

Does anyone know why this might be happening? As I'm using configuration straight out the latest docs I would have thought this would work..

Thanks,

Sam

Episerver 7.5 - Web Service APIs

$
0
0

Hello. I've no previous experience of Episerver but have been asked to look at integrating with a client's Episerver 7.5 installation, ideally using Episerver's built-in web services.

I'd be grateful if someone could confirm the following:

1) I'd like to query the Episerver search index. Am I correct in saying the only web service available to do this is provided as part of the "Find" module (I found the following Find reference https://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Find/75/searching-with-javascript/Searching-with-Javascript/)? 

2) I'd like to be able to add new content via a web service.  Am I correct in saying the only way to do this is via the Service API but this can only work Commerce content, not CMS content?

(I realise I may have to fall-back to developing a custom web api but certainly would rather use any built-in web services).

Thanks

Howard


Multiple drop-down linked together

$
0
0

So I am using Selection factory to populate my dropdowns. 

Is it possible to populate a dropdown based on another dropdown?

Like Country -> Region example

Imgix with EPiServer?

$
0
0

Hi!

I am wondering if anybody has ever tried to use imgix to render images in EPiServer. The challenges I have met so far, is that imgix need access to the blobs. So I tried to save the blobs in Amazon S3, and set it up with imgix. 

The problem then, is that the imgix has the guid instead of the filename in the url. 

E.g.: http://sitename.imgix.net/18dd89f3df594c69bd607873fe1273a7/a8fe8b347e484911a9a26101a919b69e.jpeg

But the url we want is /globalassets/.jpeg. 

How do I get around this?

I would like to migrate to amazon without having to manually add alle the images again.

Insight/Profile Store developer portal

$
0
0

Either I am missing something or do I need a account to an api or something for a couple of settings once you install the nuget in you application. The current documentation do not give any information on this and I thouhgt I would try the product as a developer to make it easier when having discussions with customers. 

Parameter name: Episerver Insight requires the properties episerver:profiles.InsightApiBaseUrl and episerver:profiles.InsightApiSubscriptionKey are set in the appSettings section.

Custom property on a page

$
0
0

So I am letting users authenticate from an external api. When these users create a page I just have CreatedBy in the currentPage instance. 

What I am trying to do is to add a property to the page which will be fullfilled by the PageCreatedEvent programtically and not be allowed to tempered with from te admin view.

I have this 

        public void Initialize(InitializationEngine context)
        {
            var events = context.Locate.ContentEvents();
            events.CreatedContent += CreatedContent;
        }
        private void CreatedContent(object sender, ContentEventArgs e)
        {
            var articlePage = e.Content as ArticlePage;
            if (articlePage != null)
            {
                // TODO: ...
            }
        }

Is there a way that I can create a property and make it hidden on the page edit page? And then how do I store it programmitcally? 

Thanks

ImageVault with XhtmlString in tinyMCE

$
0
0

Hi,

We have a solution where a page with xhtmlString property can have an images from ImageVault.

Images are getting inserted fine and it is working as expected apart from the alt text which is not getting reflected in xhtml string as attribute the resultant img tag from Image Vault has empty alt attribute and filled in src attribute.

We have alt metadata configured in the image vault for the images, and it has values in it.

/ImageVault/library/GetPublishedMediaItemInformation get all the metadata info for the image from the api call but the resultset alt is empty, eventhough the alt is available in imagevault editor

We are using ImageVault(v 4.7.2) and Episerver (v 8.11).

Any help would be greatly appreciated.

Thanks,

 Rams

Cloudflare problem

$
0
0

Hi,

We were trying to connect our website to the Cloudflare.

But here we have problem that chache is not working cause EPI is always sending nocache headers and with all requests we have coockie with session.

Is there any solution to fix that ? Or guidance how to configure EPI with cloudflare or Varnish solution?

Keep track of changes

$
0
0

Hi,

We need to provide an interface to our client to sync their database.
It will have some methods that returns e.g. the users that were created,deleted and changed (only a few columns like first and last name, but not passwords) since the last sync date.

I made a prototype that uses some custom tables and triggers.

It's allowed to create our own tables (as long as they are in a different schema) but I think it is not allowed to use triggers on episerver tables.

It might be possible to add this programatically on every submit, but then direct database changes would not show up.
It should work for users, products and orders

How would you implement this? Did anyone came across the same problem?

Thanks in advance,

Brecht Vanneste


Manual download of *.nupkg of Episerver Nuget

Error on InUseNotificationStore

$
0
0

Hello,

From time to time i have this error and i'm unable to understand what is causing it and how to reproduce. Does anybody have any ideea about what is causing it and how to fix?

System.ArgumentNullException: Value cannot be null.
Parameter name: id
at EPiServer.Framework.Validator.ThrowIfNull(String name, Object value)
at EPiServer.Cms.Shell.UI.Rest.Internal.InUseNotificationStore.Get(ContentReference id)
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
at EPiServer.Shell.Services.Rest.RestControllerBase.EndExecute(IAsyncResult asyncResult)
at EPiServer.Shell.Services.Rest.RestHttpHandler.EndProcessRequest(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)



Dojo dijit for more than one property

$
0
0

Good morning!

We currently have a case where we'd like a dojo dijit to set more than one of the EPiServer backend properties, in order to smoothen out the user experience when creating blocks. The case is as following:

We connect to a video service where the user can select a video, the service will then send a JSON object to the client containing video ID, URL, thumbnails, etc.

And while the current solution purposal to create an entire object from this is to just have a property for the entire JSON object and then override the save or publish event in EPi to split and serialize this object into smaller properties corresponding to the JSON properties.

I however, would like it better if there was a way to set multiple properties directly from the dojo dijit. So that I can skip having the entire JSON object as a property in the backend and overriding the epi events.

Is there any way to do this? I currently only find solutions where one dijit == one property in the backend.

Best regards.

SelectOne on PropertyValueList

$
0
0

I have an Episerver 11.3.1 site. I'm building a block that needs to store a list of strings, so I thougt this would be a perfect scenario for using the new property value list described here:  https://world.episerver.com/blogs/bartosz-sekula/dates/2017/10/property-value-list/

The problem is, I want each item in the list to be selected from a dropdown. Essentially, I want to apply the [SelectOne] attribute to each individual item in the list.

Here's what I tried. I created an editor descriptor for my property:

[EditorDescriptorRegistration(TargetType = typeof(IList<string>), UIHint = "ProductSpecList")]
public class ProductSpecListEditorDescriptor : PropertyValueListEditorDescriptor<string>

I did the following in the ModifyMetadata method override:

public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes)
{
    base.ModifyMetadata(metadata, attributes);

    if (metadata.CustomEditorSettings["innerPropertySettings"] is MetadataStoreModel model)
    {
        model.UiType = "epi-cms/contentediting/editors/SelectionEditor";
        var sf = new ProductSpecSelectionFactory();
        foreach (var item in sf.GetSelections(metadata))
        {
            model.Selections.Add(item);
        }
    }
}

I came up with that by comparing the json for two different properties (one a simple string with a SelectOne attribute, the other an IList<string>) coming back from the server after this ajax call:  /EPiServer/shell/Stores/metadata/EPiServer.Core.ContentData?modelAccessor=%7B%22contentLink%22%3A%22950_986%22%7D&dojo.preventCache=1516984334772

The list functionality works with this, but none of the items in the list have any sort of control - textbox, dropdown, or otherwise.

Is this even possible? I'd appreciate some help -- or if someone knows it definitively is not possible, I'd like to log it as a feature request. :)

"Failed to convert item" when saving a Visitor Group.

$
0
0

I'm implementing a Visitor Group Criterion which allows the user to select a category. I've borrowed the code from the built-in Visited Category Criterion but when I save the Visior Group I get an error saying  "Failed to convert item". I'm debugging my solution when I do this and there's no sign of an exception being throwin in the Output window for me to latch onto. I'm at a loss.

I've found this blog post but it lacks any real explanation for the issue:

https://world.episerver.com/forum/legacy-forums/Episerver-7-CMS/Thread-Container/2012/12/VisitorGroupCriterion-displays-Failed-to-convert-item/?pageIndex=2

What's causing the "Failed to convert item" error?

I'm using latest EPiServer.

Viewing all 9076 articles
Browse latest View live