Giter Site home page Giter Site logo

dxa-web-application-dotnet's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dxa-web-application-dotnet's Issues

Issues with Nuget package

When you pull in the DXA framework via Nuget:

  • 1.7 appears broken. The Common library seems to be missing the Context Service Claims Provider

Am I missing something?

Null AlternateText on the Image Model fails accessibility check

I'm building a DXA website where accessibility is key and one of the issues we've come across is the rendering of the image alt attribute. If that field is null then MVC strips out the tag

View:

<img src="@Model.Image.Url" alt="@Model.Image.AlternateText">

Rendered:

<img src="/images/image.jpg">

This unfortunately is invalid for accessibility see http://webaim.org/techniques/alttext/#basics

Every image must have an alt attribute. This is a requirement of HTML standard (with perhaps a few exceptions in HTML5). Images without an alt attribute are likely inaccessible. In some cases, images may be given an empty or null alt attribute (e.g., alt="").

You can solve this issue by changing the Image Entity Model to return an empty string instead of null e.g.

private string _alternativeText;

[SemanticProperty("s:name")]
[SemanticProperty("c:altText")]
public string AlternateText
{
    get => !string.IsNullOrEmpty(_alternativeText) ? _alternativeText : string.Empty;
    set => _alternativeText = value;
}

The DXA logging implementation does not log the class name of the original caller

When configuring the Log4Net logging to log the type ("Used to output the fully qualified type name of the caller issuing the logging request."), DXA logs all log lines like if they are logged by Sdl.Web.Common.Logging.Log4NetLogger.

For example:
Log4Net config: <conversionPattern value="%date [%thread] %-5level %type - %message%newline" />

Output: 2017-02-02 10:13:59,214 [9] DEBUG Sdl.Web.Common.Logging.Log4NetLogger - Binary with URL '/version.json' is still up to date, no action required

I guess this is caused by the DXA logging implementation not forwarding the the class name of the original caller.

DXA 2.0 CTP: Model Service does not serve pages if DCPs are missing

If a page contains a Dynamic Component Presentation, and that DCP is not published, the Model Service will not serve the page and return a 500.

Also, this is only reported in DEBUG level, which makes it harder to detect than it should be.

My expectation when calling a page with a missing DCP is that the page is returned, without the content contained in the DCP in question. Possibly an INFO (not DEBUG and not WARN) message stating that DCP X was requested but is not available.

Need support for keyword metadata within view models

The Tag model only has support for keyword title, description and key. Its a common requirement to have metadata on keywords, which should be available in the derived view models for components using these keywords.

It would be good if subclasses of Tag could be created with SemanticProperty decorators, which would enable the keyword metadata to be mapped to properties in the usual way.

Consider using FindBinary instead of TryFindBinary, and review clean-up logic

At https://github.com/sdl/dxa-web-application-dotnet/blob/master/Sdl.Web.Tridion/Statics/BinaryFileManager.cs#L166 there is a comment in the code, indicating that DD4T's behaviour is not as expected.

Reviewing the code at (and nearby) https://github.com/dd4t/DD4T.Core/blob/develop/source/DD4T.Factories/BinaryFactory.cs#L49 you can see that there is a FindBinary method which will test the boolean from TryFindBinary and throw if false.

Note also that the code at https://github.com/sdl/dxa-web-application-dotnet/blob/master/Sdl.Web.Tridion/Statics/BinaryFileManager.cs#L158 will not clean up in the way that the code at L169 does.

That said, the DD4T code isn't as clear as it might be. If using the obsolete streaming approach, you would not expect BinaryData to be available.

Idle timeout issue with DXA web application

Occasionally, I am getting the following error, when we browse to the DXA Sample site homepage,

         _Server Error in '/' Application.Index was outside the bounds of the array._

Apparently, the issue gets resolved when we do an IISReset and refresh the homepage again. Looks like it is the DummyCacheProvider which is causing the issue here.
Attached the site.log file for more details.
Site.log.txt

Log4Net dependency is shipped as assembly in the DXA package

The DXA Framework NuGet package contains the assembly for Log4net 2.0.3 and the target file forces the using web application to use this specific version. Log4net should be a NuGet dependency instead.

A practical use case is Application Insights which requires Log4net 2.0.5 or higher. Currently you cannot upgrade Log4Net since the DXA Framework adds Log4net 2.0.3 to the build output of your DXA site.

PageModel.GetXpmMarkup() should be split XPM page markup and the script

Sdl.Web.Common.Models.PageModel.GetXpmMarkup() has too many responsibilities. It should be split into three public methods:

  • GetXpmPageMarkup()
  • GetXpmScriptMarkup()
  • GetXpmScriptUrl()

This is because the XPM page markup i.e. <!-- Page Settings: {"PageID":"tcm:59-758-64","PageModified":"2017-04-25T14:18:34","PageTemplateID":"tcm:59-585-128","PageTemplateModified":"2017-08-23T10:09:38"} -->
and the script i.e. <script type="text/javascript" language="javascript" defer="defer" src="https://dev/WebUI/Editors/SiteEdit/Views/Bootstrap/Bootstrap.aspx?mode=js" id="tridion.siteedit"></script> are two distinct things.

HtmlHelperExtensions.DxaPageMarkup() should separately call page.GetXpmPageMarkup() and page.GetXpmScriptMarkup() to render both.

GetXpmScriptMarkup() will in turn call GetXpmScriptUrl() to get the URL.

By making those changes an implementor can extend the way the Page Markup and the script markup is rendered on the page. This is useful when for example delay loading the XPM initialization.

Mapping issue with Embedded Schema in retrofit mode

We are using DXA 1.7 for our project. As it is a migration project from Tridion Classic Implementation to DXA implementation. So we have to enable the retrofit mode.
Using this we are facing error while trying to map embedded items in the model. This is only working when the content model and embedded schema model is using same prefix. But if I change the prefix, then it is not working. I have tried all possible combination but not able to figure out any solution.

As a work around we are now using same prefix for content and embedded schema, but need a proper solution for that.

Sdl.Web.Common.Models.PageModel.GetXpmMarkup() calls unused XpmMetadata

Sdl.Web.Common.Models.PageModel.GetXpmMarkup() tries to retrieve the "CmsUrl" from the XpmMetadata. When this fails it will use the core.cmsurl config value from the Localization

        if (XpmMetadata.TryGetValue("CmsUrl", out cmsUrlValue))
        {
            cmsUrl = (string) cmsUrlValue;
        }
        else
        {
            cmsUrl = localization.GetConfigValue("core.cmsurl");
        }

The CmsUrl in the XpmMetadata is never used. We get the CMS URL from the web.config or from the Topology Manager.

Also, I think it is not logical to try to get the system wide CMS URL from the XpmMetadata. The latter has the page scope and we cannot have a different CMS URL for each page.

So I think we can safely remove the if (XpmMetadata.TryGetValue("CmsUrl", out cmsUrlValue)).

Web-Install.ps1 stops on relative path in -distDestination parameter

When calling web-install.ps1 with a relative path in the -distDestination parameter, the script will raise an error upon saving the Log.config.

For example web-install.ps1 -distDestination ..\..\test

This can simply be prevented by making sure the path is resolved with Resolve-Path before using it.

#Terminate script on first occurred exception
$ErrorActionPreference = "Stop"

$distDestination = Resolve-Path -Path $distDestination

#Process 'WhatIf' and 'Confirm' options
if (!($pscmdlet.ShouldProcess($distDestination, "Deploy DXA .NET Web Application"))) { return }

I would love to do a PR for this, but if I am not mistaken the installation scripts like web-install.ps1 is not in any of the Github repos.

Version number in design assets URL

The design assets in DXA are versioned, i.e. /system/v1.6/assets/css/main.css. The design version suggests we can put any value as a version numner, but something short like v1.6.1 is not matched and breaks. Resources loaded with such a version number result in a 404.

I propose to flex the regex used for the design assets, and make it consistent in the .NET and the JAVA implementation.

There are two options

  1. Fully flexible; Accept any string, including empty, as version number
  2. Allow version numbers; starting with v and followed by a semantic version number, or part of a semantic version number.

Of course the design version number does not have a meaning, the sole purpose is to have a different URL so that all clients/browsers will reload the design assets. So the string between /system/ and /assets could be anything as long if it is different from previous versions.

I think we can easily change the code to accept option 1, and not care too much about what kind of version number is used. This way the implementor cannot go wrong.

I did do a study on variantions of regexes for the design asset URLs, see https://gist.github.com/jhorsman/57f359efee6df50491209c5bcc6ebba1. It includes a strict and flex way to only allow semantic versioning in the version number.

DXA choose to display description (if available) over title/name field - Hardcoded in code

I see DXA code displaying description field value of a keyword component if it is available and not its name, I know its a best practice though have curiosity to know more.

What I see in the code here is that it is hard coded to choose description (if available) over title/name field.
But as also mentioned as comment in the code:

// TODO TSI-811: Keyword mapping should also be generic rather than hard-coded like below

string displayText = String.IsNullOrEmpty(keyword.Description) ? keyword.Title : keyword.Description;

How and when are we planning to have this ?

This has also been raised in stack exchange here.

Improve EntityError and SectionError views

The ServerError view view, SectionError view and EnityError view (from the DXA modules project) are not completely consistent:

view Git project location uses customErrors mode
ServerError.cshtml dxa-web-application-dotnet Site/Views/Shared/ yes; is not used when customErrors is On
SectionError.cshtml dxa-web-application-dotnet Site/Views/Shared/ no; always shows HTML formatted message with error details
EntityError.cshtml dxa-modules Areas/Core/Views/Entity/ no; always shows HTML formatted message with error details

I propose two changes to improve this.

  • Move all error views to Site/Views/Shared/ in the dxa-web-application-dotnet project. This way it is clearer to implementors that DXA expects those views to exist, even when the core module does not exist. Also, the EnityError is the only view in Areas/Core/Views/Entity/ which is not registered in the CoreAreaRegistration.
  • Do not render the technical error detail in the SectionError and EntityError when the customErrors mode is 'On' in the Web.config

Multiple html designs cannot be published at the same time if they have files with the same filename.

We created two Modules with different html design elements (css, js, etc...). They both have a file called style.css (pretty common) but they get published to different structure groups /system/assets/design1 and /system/assets/design2, however the Template that processes the Modules assings the variantId using this pattern: dist-filename, now since the html design is published using the same component (Same binary id) when you have this situation, you encounter that the same variant Id is going to be used and that's not allowed.

I've implemented a workaround that adds the structure group id to the variant id:

dist-sgId-filename, that way you can publish files with the same filename in different html designs on your modules.

Need a mechanism for passing parameters to Region views

I have a number of different column views, all of which are pretty much the same container HTML with some additional css classes and data attributes. In an ideal world I would like to create a single N-Column MVC view, and pass parameters to this from the Component Template, much in the way we can pass route values and/or CSS classes via CT metadata to the Entity controller/views.

For now the values I would need to pass are the number of columns (to perform the calculations required for row rendering), and some additional css classes and data attributes to place on the container HTML element.

Adding a specific metadata field for css classes is too specific (not all my attributes are classes), so I think there are the following most generic options:

  1. Abuse the existing routeValues metadata field to put region route values in and update the DefaultModelBuilder to pull these into the MvcData of the Region object
  2. Add a new regionRouteValues metadata field

I could then create HtmlHelper methods to pull out appropriate route values in my views. @rpannekoek - if you prefer one of these, or think of a better way, let me know - I will implement it in a pull request

Problem with resolving the landing page as default.html instead of index.html

I know there is a limitation of using the name of the page as index.html for landing page in DXA. But sometime in migration project client wants to use there old naming convention.
Like in our project they are using default.html for all the landing pages, as a result DXA is unable to resolve those landing pages url.

Is it configurable ? If not, Can you please make it configurable so that client can use their preference ?

Cannot remove Core area in DXA 1.6 web application

In a DXA 1.6 .NET based webapp I have created my own module, let's call it MyModule. All views, including page views, region views and the main view are in the MyModule area.

I am not dependent on the views and models from the Core area, however, the website does not work without a Core area registration. This is the minimal registration I need to be able to run the site: an AreaName and an empty RegisterAllViewModels().

namespace MyWebApp.Web.Site.Areas.Core
{
    using Sdl.Web.Common.Models;
    using Sdl.Web.Mvc.Configuration;

    public class CoreAreaRegistration : BaseAreaRegistration 
    {
        public override string AreaName => "Core";

        protected override void RegisterAllViewModels()
        {
        }
    }
}

This is a defect, since DXA 1.6 the Core module is split up in Framework and Core module with the purpose of making the core module optional.

I did not investigate in much detail, but I think this issue is related to the ControllerAreaName. The controllers are in the DXA Framework, and we still use the ControllerAreaName Core. Technically the page Controller is not in any area, but in the DXA framework.

WebRequestContext.CalculateScreenWidth() should default to 1024px / ScreenWitdh.Medium

I have ran into an edge case where the WebRequestContext.ScreenWidth becomes ExtraSmall while it is in fact a desktop.

This following piece of code in Sdl.Web.Mvc\Configuration\WebRequestContext.cs checks is the cookie is present and if it is assumes the contextengine provides a DisplayWidth. When ContextEngine is not pupulated (i.e. not wired up to the Context Service) the width is 0 and CalculateScreenWidth() returns Extra Small.

    protected static ScreenWidth CalculateScreenWidth()
    {
        int width = IsContextCookiePresent ? ContextEngine.GetClaims<BrowserClaims>().DisplayWidth : 1024;
        if (width < SiteConfiguration.MediaHelper.SmallScreenBreakpoint)
        {
            return ScreenWidth.ExtraSmall;
        }
        if (width < SiteConfiguration.MediaHelper.MediumScreenBreakpoint)

To correct the situtation the code should check if the DisplayWith is bigger than 0.

Exceptions leaking and cause view to render without PageModel

Sometimes DXA renders a page like this:
image

Error message

Server Error in '/' Application.
The model item passed into the dictionary is of type 'System.Web.Mvc.HandleErrorInfo', but this dictionary requires a model item of type 'Sdl.Web.Common.Models.PageModel'.

It looks like an exception is not caught by DXA, the webapp then wants to render an error message, the _Layout.cshtml is loaded and that one expects a PageModel object which of course is not present.

This happens for example when an entity view model is not registered.

@Html.DxaEntity() overrides original entity

MvcHtmlString DxaEntity(this HtmlHelper htmlHelper, EntityModel entity, string viewName, int containerSize = 0) overrides the original entity viewName. Is this done on purpose and if so, why? I tried to use the html helper function to use the same component twice due to how the CSS looks (the project is a migration where we want to reuse the HTML and CSS, it gets a bit weird).

Since it overrides the entity the code ends up something like this:

@Html.DxaEntity(Model.Entities.Single(m => m.MvcData.ViewName == "OriginalView"), "NewView")
@Html.DxaEntity(Model.Entities.Single(m => m.MvcData.ViewName == "NewView"), "EvenNewerView")

If it left the original entity alone the code could just be this:

@{
  var reuseMe = Model.Entities.Single(m => m.MvcData.ViewName == "OriginalView");
}
@Html.DxaEntity(reuseMe, "OneView")
@Html.DxaEntity(reuseMe, "AnotherView")

I get the feeling that I'm not really using it as intended...

Localization not passed in to ResolveLink

The localization parameter is not always passed into ResolveLink even when it is available.

Our project utilises the DD4T REST provider, which requires that the publication/localization is available.

I have created a pull request (#11) with a fix

Includes Pages don't allow for custom area

When converting includes into regions, the system assumes they always are in the "Core" (Default) area. The system should allow to specify the area to look for the included page (Page Template Metadata for MVC in the same way is done for other page templates). If not provided, then inherit it from the MVC data of the page doing the include, i.e. the including page area.

The method in question is in the DefaultModelBuilder class and it is called: GetRegionFromIncludePage(IPage page).

As a temporary solution, I have added an optional parameter: MvcData parentMvc:

    private static RegionModel GetRegionFromIncludePage(IPage page, MvcData parentMvc)
    {
        string regionName = page.Title;

        MvcData regionMvcData = new MvcData(regionName);
        if (parentMvc != null)
        {
            regionMvcData.AreaName = parentMvc.AreaName;
        }
        InitializeRegionMvcData(regionMvcData);

        return new RegionModel(regionName)
        {
            MvcData = regionMvcData,
            XpmMetadata = new Dictionary<string, string>
            {
                {RegionModel.IncludedFromPageIdXpmMetadataKey, page.Id},
                {RegionModel.IncludedFromPageTitleXpmMetadataKey, page.Title},
                {RegionModel.IncludedFromPageFileNameXpmMetadataKey, page.Filename}
            }
        };
    }

And I pass by, the mvcdata from the including page as follows:

RegionModel includePageRegion = GetRegionFromIncludePage(includePage, pageModel.MvcData);

Bug in logic for model mapping from embedded schemas with identical sub-field names

If your source schema has non-unique field names within embedded schemas (for example has two fields which use the same embedded schema, or use embedded schemas which have similarly named fields) then there will be issues with the model mapping (the second property will be mapped from the first embedded schema field, or not be found at all).

This can be fixed by passing around a context SemanticSchemaField while mapping properties from embedded fields. (see trivident@f1b7f3b)

Localizations objects in WebRequestContext.Localization.SiteLocalizations are partially loaded

The Localization objects in Localization.SiteLocalizations are partially loaded. Only the Localization id and Path properties are set. Other properties like Culture and Language are not set.

When the WebRequestContext.Localization itself is loaded there is logic in place to call Localization.EnsureInitialized() which loads all the Localization properties. This is not done for the Localization.SiteLocalizations.

The partially loaded Localization appears after a restart of the site. When all publications got a request, then all Localization objects are populated, including the ones in Localization.SiteLocalizations.

You can inspect the site Localization with this action and view: https://gist.github.com/jhorsman/679f6ab072c3896db41fcf893c3307b9

Edit: removed mention of /admin/refresh

Support URLs which don't map to a Publication in CM

When someone requests a URL on a DXA webapplication which cannot be mapped to a publication, this error message is rendered: No matching Localization found for URL 'http://hostname/path'.

There are two issues with this

  • The error message is not styled; DXA has styled 500 error and 404 Not found pages, these are used for most error situations, but when the publication mapping does not work the webstite visitor gets this un styled error.
  • The controllers are never hit, so you cannot have a controller handling any unmapped URLs. For example, I have a site which does not have any publication mapped to the root url at http://hostname/, instead all publications are mapped to /en, /nl and so on. I would like to make a controller which redirects the visitor from the root URL http://hostname/ to http://hostname/en but the request will never hit my controller.

The problem is caused by Sdl.Web.Mvc.Statics.StaticContentModule. This module serves static content items like media. It needs the site localization to figure out if the request URL is a static URL. When the localization cannot be found it will return a 404 not found status with the exception message.

I think the StaticContentModule should not render this error message. It could silently fail, write a warning to the log like it does today, and continue. The request will then go to the routes, eventually be handled by the PageController (or my custom controller in my use case). The PageController will also not find the site localization, and it can return a static 404 not found just like it can serve a static 500 error.

Ability to exclude XpmMetadata and XpmPropertyMetadata from ?format=json result

I think the ?format=json "trick" is awesome for potential data integrations with either 3rd party tools or mobile apps.
This however returns all the data, including a significant amount of Experience Manager metadata which is irrelevant in most integration scenarios. It would be good to have the ability to exclude this info from the returned data - either through configuration, or ideally, by having an additional parameter specifying you want the XPM data (so the default would be to not include it).

Example: http://nuno-dxa.azurewebsites.net/?format=json

Views declaration could be automated in AreaRegistration classes

• Could views be programmatically/automatically declared in each AreaRegistration class?
• Example:
RegisterViewModel("Footer", typeof(RegionModel), "Region");
Becomes
RegisterViewModel(viewname, typeof(modelfoundinviewfile), foldername);
• The folder hierarchy gives you the ControllerName parameter (only needed for views inside Navigation, Page and Region folders)
• You may need to parse the views the get the corresponding Model to pass as param, or do some magic.
• This could possibly allow the creation of “hot” views / views created on the fly, without recompiling would be awesome!

DXA - XPM - non-mandatory fields

In the case when component has non-mandatory and empty field, there is no appropriate XPM comment which will indicate that field can be editable by XPM.
This is scenario:

  • Schema has mandatory and non-mandatory fields, lets take just text fields as examples.
  • Rendering is OK in the case of mandatory field or non-mandatory field which has some text and source of the page is like
    image
  • If the field is non-mandatory and without value, output is different and looks like this
    image

As it can be noticed there is no XPM comment which will give the information about which field should be editable with XPM. - Code in View used to render non-mandatory fields is
image

WebRequestContext.IsPreview is always true for our current development environment so that part is ok. Model.TipText is null in that case, and maybe this is causing the issue.

Problem is related to the output because there is XPM related comment in the source of the page, so XPM does not recognize there is field without value which should be allowed for editing. Without this comment there is no placeholder "<< add text >>" when XPM is active.

Also it is tried with different approach and placing first div as it is on the following image, but same issue is there
image

Link to the conversation on StackExchange http://tridion.stackexchange.com/questions/13391/tridion-2013-dxa-xpm-non-mandatory-fields

Included Pages XMP Markup causes "Update Preview" loop

When a component in a included page is updated within the including page using XPM, and its respective page (included page) is not published afterwards, The "Update Sesssion Preview" button remains active and XPM asks for the update.

I think this has to do with the Component Presentations of the included pages not living withing the Including page itself, hence XPM cannot render the them with the latest version of either the component or component template

EntityController is not extensible

When creating your own Controller it's not possible to select the EntityController, instead you are left with taking the BaseController.

Current quick fix is copying the following lines into your own Controller and extend of BaseController;

[HandleSectionError(View = "SectionError")]
public virtual ActionResult Entity(EntityModel entity, int containerSize = 0)
{
    SetupViewData(entity, containerSize);
    EntityModel model = (EnrichModel(entity) as EntityModel) ?? entity;
    return View(model.MvcData.ViewName, model);
}

Multiple embedded schemas do not bind correctly

Hi there

I seem to have uncovered an edge-case whereby multiple embedded schemas do not bind correctly if they are in a certain order.

I have updated the schema for ItemList to have a field called moreItemsLink which is an embedded schema of Link.

I have also changed the C# model for ItemList to contain an IEnumerable of ItemListElement instead of a Teaser.

It appears from my debugging/logging (a sample log is below) that if the moreItemsLink field is after the itemListElement field then the model builder resolves the first child item's embedded link fields instead of the ones from moreItemsLink. If moreItemsLink is before the itemListElement field then it resolves properly (although I suspect that there may be an equivalent issue in this case whereby the items in the list bind to the moreItemsLink fields...)

I've attached two screenshots of the schemas I'm working against, and started the most relevant lines in the logs with a fat arrow - this is a bit of a tricky issue to explain so do let me know if you need more details.

Thanks

Tom

=> MapFieldValues : field.XPath=tcm:Content/custom:ItemList/custom:moreItemsLink, modelType=Sdl.Web.Common.Models.Link, multival=False, mapData.EmbedLevel=0
 GetFieldFromSemantics: SourceEntity.Title=, Prefix=, PropertyName=internalLink
   SemanticSchema.FindFieldBySemantics: Prefix=tri, Entity=ItemList, Property=internalLink
     SemanticSchema.FindFieldBySemantics: Testing field: Path=/ItemList/headline
       SemanticSchemaField.FindFieldBySemantics: THIS.Path=/ItemList/headline.  Prefix=tri, Entity=ItemList, Property=internalLink
     SemanticSchema.FindFieldBySemantics: NO - this field didn't match: Path=/ItemList/headline
     SemanticSchema.FindFieldBySemantics: Testing field: Path=/ItemList/itemListElement
       SemanticSchemaField.FindFieldBySemantics: THIS.Path=/ItemList/itemListElement.  Prefix=tri, Entity=ItemList, Property=internalLink
       SemanticSchemaField.FindFieldBySemantics: THIS.Path=/ItemList/itemListElement/headline.  Prefix=tri, Entity=ItemList, Property=internalLink
       SemanticSchemaField.FindFieldBySemantics: THIS.Path=/ItemList/itemListElement/subheading.  Prefix=tri, Entity=ItemList, Property=internalLink
       SemanticSchemaField.FindFieldBySemantics: THIS.Path=/ItemList/itemListElement/content.  Prefix=tri, Entity=ItemList, Property=internalLink
       SemanticSchemaField.FindFieldBySemantics: THIS.Path=/ItemList/itemListElement/media.  Prefix=tri, Entity=ItemList, Property=internalLink
       SemanticSchemaField.FindFieldBySemantics: THIS.Path=/ItemList/itemListElement/link.  Prefix=tri, Entity=ItemList, Property=internalLink
       SemanticSchemaField.FindFieldBySemantics: THIS.Path=/ItemList/itemListElement/link/linkText.  Prefix=tri, Entity=ItemList, Property=internalLink
       SemanticSchemaField.FindFieldBySemantics: THIS.Path=/ItemList/itemListElement/link/externalLink.  Prefix=tri, Entity=ItemList, Property=internalLink
       SemanticSchemaField.FindFieldBySemantics: THIS.Path=/ItemList/itemListElement/link/internalLink.  Prefix=tri, Entity=ItemList, Property=internalLink
       SemanticSchemaField.FindFieldBySemantics: THIS field contains matching semantics - returning!
=>     SemanticSchema.FindFieldBySemantics: YES - found a matching field: Path=/ItemList/itemListElement/link/internalLink

itemlistelement-schema


itemlist-schema


itemlist


itemlistelement

Exception occurred Access to the path 'c:\windows\system32\inetsrv\includes.json' is denied.

This appears in my site log files.

ERROR - Exception occurred Access to the path 'c:\windows\system32\inetsrv\includes.json' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at DD4T.Factories.BinaryFactory.WriteBinaryToFile(Byte[] bytes, String physicalPath, Dimensions dimensions) in C:\projects\dd4t-core\source\DD4T.Factories\BinaryFactory.cs:line 347

I have narrowed this down to one line of code, which is

binaryFactory.TryFindBinary(urlPath, out binary); in BinaryFileManager

I think this should actually be

binaryFactory.TryFindBinary(localFilePath, out binary);

DXA 2.0 CTP - if using auto-registration for CIS content service, DXA Model Service registration is lost after restart

DXA 2.0 Model service registers its information as extension properties in the content service. If the content service is using auto-registration, this information is lost after a server restart.

A work-around/solution for this is to not use auto-registration for the content service, and instead add this to the discovery service's cd_storage_conf.xml:

<Role Name="ContentServiceCapability" Url="http://your-machine:8081/content.svc"> <Property Name="dxa-model-service" Value="your-machine:8998"/> </Role>

Localization.EnsureInitialized() should not throw DxaItemNotFoundException

When calling Localization.EnsureInitialized() while the _System\Publish Settings page of that publication is not published should not throw an DxaItemNotFoundException.

The Localization objects of not-publised sites can appear in the Localization.SiteLocalizations of other publications. Hence it is not unexpected if the _System\Publish Settings is not available and Localization should not throw an exception.

Maybe when the _System\Publish Settings page is not published this publication should not be listed in the Localization.SiteLocalizations at all.

Language selector URL does not expect null page id

The Resolve action in the PageController cannot handle a null or empty page id in the itemId parameter. It should be more flexible and accept if no page id is passed.

The current behavior when page id 0 is passed is acceptable. In that case the controller redirects to the default page of the site.

For example this URL http://localhost/resolve/82?localizationId=51&defaultPath=/demo/ will work fine. It will try to resolve page id 82 in publication 51.

When the request does not have the context of a page this URL with page id 0 can be used http://localhost/resolve/0?localizationId=51&defaultPath=/demo/.

However if no page id is passed like http://localhost/resolve/?localizationId=51&defaultPath=/demo/ the webapplication returns an unexpected error:

Server Error in '/' Application.

Unexpected item type in TCM URI: tcm:0-0-0

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: Sdl.Web.Common.DxaException: Unexpected item type in TCM URI: tcm:0-0-0

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Use precompiled views

The example site in the dxa-web-application-dotnet project uses the DXA Core module. The DLL of the Core module is not available on GitHub though, and the views have to be copied into the Site project manually (or with a post-build step in the Code module project).

This gets messy, especially when following the same pattern in custom modules, and using multiple module solutions.

The solution is using Razor Generator. I think this is an broadly accepted way to precompile MVC views. See https://github.com/RazorGenerator and https://community.sdl.com/product-groups/sdl-tridion-dx/tridion-sites/tridion-developer/b/weblog/posts/precompile-your-dxa-views-with-razor-generator.

Combined with a NuGet package for the DXA Core module, this would make it way easier to work with multi-module DXA solutions.

Missing cd_ambient_conf.xml file

When I install create a DXA web application as described in Setting up a new ASP.NET MVC Web application and start it, the webapp will complain about the "cd_ambient_conf.xml".

Failed to load configuration file: C:\Users\me\SourceCode\example-dxa-stite\Site\bin\\config\cd_ambient_conf.xml

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: Sdl.Web.Delivery.Core.ConfigurationException: Failed to load configuration file: C:\Users\l19548828\SourceCode\example-dxa-stite\Site\bin\\config\cd_ambient_conf.xml


Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Adding SDL DXA .NET 1.6\web\web8\web-ref\config\cd_ambient_conf.xml (from the DXA installation media) to the webapp will resolve the issue. I think this step is missed in the documentation, or in the example web application.

I found this issue on both DXA .NET 1.5 and 1.6, did not test on other versions.

format=json doesn't work

According to the docs, it should be possible to get DXA 1.1 requests in JSON format, however this doesn't work (see http://docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v2/GUID-C5D23B8A-6846-4187-9997-A9A1010D418E)

The following error shows:

Self referencing loop detected for property 'Link' with type 'Sdl.Web.Common.Models.Link'. Path 'Regions[0].Entities[0].ItemListElements[0]'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Newtonsoft.Json.JsonSerializationException: Self referencing loop detected for property 'Link' with type 'Sdl.Web.Common.Models.Link'. Path 'Regions[0].Entities[0].ItemListElements[0]'.

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

This could be related to this: http://stackoverflow.com/questions/13510204/json-net-self-referencing-loop-detected

DXA1.6 web solution (dxa-web-application-dotnet-DXA_1.6_Release.zip)

Hello DXA Team,
It appears the DXA1.6 web solution (dxa-web-application-dotnet-DXA_1.6_Release.zip) is made to work with Web 8.x as the web.config in the solution has reference to Discovery service.

However, as I understand correctly, DXA 1.6 is compatible for Tridion 2013sp1hr1 and Discovery service is only applicable for SDL Web 8.x.....
Given the above, is there a DXA 1.6 web solution that is made for Tridion 2013sp1 ?

I see from this URL:
https://github.com/sdl/dxa-web-application-dotnet/releases?after=DXA_1.7_Sprint_2
where Rick mentioned these are the highlights in DXA 1.6
On-demand, Taxonomy-based navigation
Clearly separated Core Module
Support for HTML forms
Caching of DXA View Models
Upgrade to CIL 8.3

so indeed DXA 1.6 was upgraded to CIL 8.3, so this web solution will not work for Tridion 2013sp1hr1 as I assume for Tridion 2013sp1hr1, it does not know how to handle the new microservice framework.

Please advise on the next step...

I also asked this in jira (SRQ-7461)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.