dd4t / dd4t.model Goto Github PK
View Code? Open in Web Editor NEWDD4T content model (.NET)
License: Apache License 2.0
DD4T content model (.NET)
License: Apache License 2.0
There should be two cache agents:
Both agents should store in the same cache store. Preferably one which supports async invalidation (so when the item is to be invalidated, this is done in the background and the most recent item is returned until the new item is put in the cache store).
IsAbstract
Parentkeywords
IsRoot
RelatedKeywords
https://tridion.stackexchange.com/questions/17961/dxa-1-2-intermittent-issue-in-json-output
https://tridion.stackexchange.com/questions/18235/dxa-1-5-intermittent-issue-in-json-output
I am suspecting that the root cause for the issues reported in the above questions are related to the JSONSerializer fix that was put in for DD4T.
The component presentation builder from DD4T ComponentPresentationBuilder is using the following https://github.com/dd4t/DD4T.TridionTemplates/blob/develop/source/DD4T.Templates.Base/Builder/ComponentPresentationBuilder.cs
try
{
// we cannot be sure the component template uses the same serializer service as the page template
// so we will call a factory which can detect the correct service based on the content
ISerializerService serializerService = SerializerServiceFactory.FindSerializerServiceForContent(renderedContent);
cp = serializerService.Deserialize<Dynamic.ComponentPresentation>(renderedContent);
}
In the base SerializerServiceFactory, I noticed that we are using the DD4T.Serialization.JSONSerializerService (https://github.com/dd4t/DD4T.Model/blob/2.0.4-beta1/source/DD4T.Serialization/SerializerServiceFactory.cs), which is using the DD4T.Serialization.JS JSONSerializerService and does not having the concurrency issue that is fixed below
private static string defaultSerializerServerType = "DD4T.Serialization.JSONSerializerService"; // Initialization in DD4T Serialization/SerializerServiceFactory
I see a commit transaction here
ff96b15 // Fixed and commited to DD4T
I would like to get some feedback before pursuing to upgrade the DD4T.Merged manually with the fix indicated above. The fix for the above issues would be to upgrade DD4T corresponding to the version of DXA.
Also, is it recommended that we switch the NewtonSoft references from 6.0.8 to 10.0.1, for the concurrency issue? I did not see an open issue in DD4T.Model and hence opened a new issue. Let me know your feedback!
Original post here; https://tridion.stackexchange.com/questions/21828/upgrade-to-tridion-9-5-and-net-dd4t-2-5-producing-error-with-ikeyword-on-dynami
Error:
<tcm:Error ErrorCode="80040356" Category="18" Source="Kernel" xmlns:tcm="http://www.tridion.com/ContentManager/5.0"><tcm:Line ErrorCode="80040356" Cause="true"><![CDATA[Could not create an instance of type DD4T.ContentModel.IKeyword. Type is an interface or abstract class and cannot be instantiated. Path 'Component.Fields.panels.LinkedComponentValues[1].Fields.link.EmbeddedValues[0].Link.LinkedComponentValues[0].Fields.CTAs.EmbeddedValues[0].Link.LinkedComponentValues[0].Categories[2].Keywords[0].ParentKeywords[0].IsRoot', line 1, position 28829.]]></tcm:Line></tcm:Error>
I found a workaround for dynamic templates as posted on Tridion Stack exchange, but now it's also appearing when calling FindComponentPresentations.
Is it possible to add to the JSONSerializerService?
public class KeywordConverter : CustomCreationConverter<IKeyword>
{
public override IKeyword Create(Type objectType)
{
return new Keyword();
}
}
ComponentPresentation has a Conditions property, but there is no way in the web application to get the name(s) of Target Group(s) linked to the CP.
In many personalization/targetting scenarios we would like to have Target Group details (name + id) available delivery side. For example:
This property is never filled (unless you write custom template code), and it is out of place here. AltText is a content / metadata field.
The property must be marked as obsolete so it can be removed in the next major release.
There is information in the DD4T XML / JSON against each component presentation for any TargetGroupConditions (previously Conditions) where each TargetGroup has an enumerable of Conditions.
However, the Conditions JSON contains no information about the concrete class it should be deserialized with (e.g. "$type": "CustomerCharacteristicCondition") and, presumably because of this, it is not possible to cast Condition to CustomerCharacteristicCondition to access its properties.
At present, it appears the only way to evaluate TargetGroupConditions would be to implement some custom deserialization in order to have access to the properties of each condition.
Hi, In my DD4T MVC Application, while rendering a page through "ActionExecutedContext" method, in my DD4T.ContentModel.Page i am getting value of "LastPublishedDate" as "01/01/0001". When i see in my Broker Database and check for the "Last_Published_Date" key for that particular page, i get correct date. Can anyone help me resolve the issue.
In Newtonsoft.JSON 13, a default MaxDepth of 64 for JSON (de)serialization was introduced. Although DD4T.Model references Newtonsoft 12, you can still run into this problem if you decide to upgrade Newtonsoft in your application.
It should be possible to configure a MaxDepth in the Web.config, so that you can override the default.
If time permits (otherwise we can use the Java version)
Deprecate DD4T.* namespace, move the classes into Dxa.* namespace
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.