How can I configure a netTiers datasource to use a RouteParameter instead of a QueryStringParameter? - url-routing

NetTiers works fantastic out of the box using querystrings. Eg:
<data:AspnetUsersDataSource ID="AspnetUsersDataSource" runat="server" SelectMethod="GetByUserId">
<Parameters>
<asp:QueryStringParameter Name="UserId" QueryStringField="UserId" Type="String" />
</Parameters>
</data:AspnetUsersDataSource>
However, if I try to change the parameter to instead be:
<asp:RouteParameter Name="UserId" RouteKey="id" Type="String" />
It just see empty textboxes when navigating to my AspnetUsersEdit.aspx page via the routed url:
user/edit/id
My hunch is this isn't a url routing problem but is instead something I'm missing with how NetTiers fundamentally works. If anyone has successfully used url routing within NetTiers, I'd greatly appreciate any input!

I was able to solve my problem by using FormViews (a slight pain, but good enough for me). One important note that took me some time to solve - NetTiers generated the solution such that periods were contained in the virtual path of the project. Unfortunately this caused havoc with routing when testing locally. Altering the virtual path so as to not contain periods fixed things for me.

Related

Sitecore RichText field not indexing correctly in Solr in Prodcution only

I have a field whose type is set to Rich text in Sitecore.
On lower environments, the values get indexed correctly and HTML text is stored in Solr correctly.
On Production, for all items the HTML gets stripped off completely.
UPDATE: One difference is that in lower environments, we have Solr on Prem and on Production, it is Solr cloud
UPDATE: I have checked the CM and CD servers and all have the field reader for the Body Copy field
UPDATE: This is now happening for all items. Earlier, possibly the other items weren't updated and published and so they showed the HTML correctly?
What could the issue be?
It is only happening on Production
I have validated the config is as expected. The field is Body Copy
<fieldReaders type="Sitecore.ContentSearch.FieldReaders.FieldReaderMap, Sitecore.ContentSearch">
<param desc="id">defaultFieldReaderMap</param>
<mapFieldByTypeName hint="raw:AddFieldReaderByFieldTypeName">
<fieldReader fieldTypeName="html|rich text" fieldReaderType="Sitecore.ContentSearch.FieldReaders.RichTextFieldReader, Sitecore.ContentSearch" />
</mapFieldByTypeName>
<mapFieldByFieldName hint="raw:AddFieldReaderByFieldName">
<fieldReader fieldName="Body Copy" fieldReaderType="Sitecore.ContentSearch.FieldReaders.DefaultFieldReader, Sitecore.ContentSearch" />
</mapFieldByFieldName>
</fieldReaders>
It is now happening for all the content
I have resolved the HTML errors in the fields that reported HTML errors but that didn't fix it either.
If its happening uniformly to all fields, then my guess is that it has got to be your SOLR configuration.
Please review the managed-schema.xml document for the relevant SOLR Core on both your test and your production system.
You can do this via the file system (on prem):
i.e. C:\Solr\server\solr\web_index\conf\managed-schema.xml
Or via the SOLR dashboard (cloud and prem):
i.e. https://solr-domain:8983/solr/#/web_index/files?file=managed-schema
I suspect you will find a difference relating to filters.
Please see HTMLStripCharFilterFactory on this link for an example of a filter which would cause the issues you are describing:
https://solr.apache.org/guide/8_1/charfilterfactories.html#solr-htmlstripcharfilterfactory
Let me know if that helps at all.
Regards
Dean

Melt throws “Property without service 'property'”

When building certain mlt files with melt 7.1.0, they run just fine, but when building them with melt 6.24.0, the error message
[producer_xml] Property without service 'property'?
[producer_xml] Property without service 'property'??
appears any number of times. A minimal working example showing this warning precisely twice is the following:
<?xml version="1.0"?>
<mlt>
<profile width="1920" height="1080"/>
<chain id="chain0">
<property name="resource">mwe-in.mp4</property>
</chain>
<playlist id="playlist0">
<entry producer="chain0"/>
</playlist>
</mlt>
What is the origin of this error? How can it be fixed?
The documentation is rather sparse on properties and in particular does not seem to mention what it would even mean for a property to have a service. The check for properties without services however is still in the current code (though I have not checked whether the code is dead by now).
Chain services were added in 7.0.0 - they were not supported in 6.24.0 yet.
The XML will not work in 2.24.0 because it uses a chain. You can change "chain" to "producer" to make it work if you do not need to use chain/link features.
Caveat
Before writing this answer, I had not yet gotten around to look at the result. Thus, it stands that no further warnings are given, but with the following approach, only black (and silent) video will be generated.
Old Answer
While I do not understand enough about the internals of the MLT framework to have even an inkling about the origins, I managed to work around this problem by manually reordering the mlt files. In my cases, the error disappeared consistenly when any playlist tag was moved before the first chain tag of the file. In the MWE the error can thus be avoided like this:
<?xml version="1.0"?>
<mlt>
<profile width="1920" height="1080"/>
<playlist id="playlist0">
<entry producer="chain0"/>
</playlist>
<chain id="chain0">
<property name="resource">mwe-in.mp4</property>
</chain>
</mlt>

AngularJS: Problems, when changing hash parameters

I have a AngularJS App. When I have for example following URL:
foo.bar/app/#/en
and the user change it in the browser to (without reloading the page):
foo.bar/app/#/de
Some random controllers and $watch-functions are running again, causing some problems.
Is there a way to tell AngularJS not to do anything there? I dont want any functions/controller/whatever to run, if the hash parameter is changed
Thank you very much.
Found the solution:
https://stackoverflow.com/a/14329570/1678067
Works 100% perfect. Still not sure, what is exaclty happening, when I change something in the Hash param (in the URL).

CQ5 inplace editing and escaping html

I have a simple component that uses a xtype="textfield". In the JSP I am using the cq:text tag along with the escapeXml="true" attribute in order to escape the html characters. This works as it should. However if I start inline editing the component in the browser (not in chrome since it doesn't support it), the escaping no longer works and the html is converted to html code, reverting the escapeXml's action.
Does anyone know if this is a known bug of Inline Editing and what is the work around.
Thanks
Found the solution here. It's part of the cq:inplaceEditing configuration. If you need to fix the escaping, you will have to use plaintext as the editorType or you can simply disable inplaceEditing all together on a per component basis.
This is an example of how you could set your _cq_editConfig.xml
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
cq:actions="[text:Hero Row,-,edit,delete,-,insert]"
cq:dialogMode="floating"
cq:disableTargeting="{Boolean}true"
jcr:primaryType="cq:EditConfig">
<cq:inplaceEditing
jcr:primaryType="cq:InplaceEditingConfig"
active="{Boolean}false"
editorType="plaintext"/>
</jcr:root>
Hope this helps anyone else out there.
Don't forget to say thank you

Incorrect NavigationContext.QueryString values in Silverlight

I got problem in creating a navigation URI on our silverlight application. I got this URI mapper:
<uriMapper:UriMapping Uri="/Dev/{id}/Cov/{isAnalysed}" MappedUri="/Views/Cov/CovListView.xaml?Id={id}&isAnalysed={isAnalysed}" />
<uriMapper:UriMapping Uri="/Dev/{id}/Cov/{cId}/{cType}" MappedUri="/Views/Cov/CovListView.xaml?Id={id}&cId={cId}&cType={cType}" />
For the first Uri on the OnNavigatedTo method of the CovView.xaml the NavigationContext.QueryString would give this result.
[0]: {[Id, 1]}
[1]: {[isAnalysed, true]}
but navigating using the second URI would give this result
[0]: {[Id, 1]}
[1]: {[isAnalysed, 3/DAX]}
Not sure why it is somehow still using the first Uri.
Changing the order of the URI pattern/path (on the mapping and upon navigation) would solve the problem but for my case this should be the last option.
Has anyone meet this kind of problem and what did you do to resolve this (aside from changing the URI pattern/path)?
Thanks.
After some experimentation I came out with two solutions to fix the problem.
Change the pattern of the URI mapper and also the caller. In which, for my case is not a good solution since there are a lot of codes already navigating to this page using these URI pattern. Changing it would change a lot of codes.
Second solution is that, I found out that interchanging the sequence of the URI solves the problem. Instead of the above sequence, I put the second URI mapping first.
Changed the mapping sequence to this.
<uriMapper:UriMapping Uri="/Dev/{id}/Cov/{cId}/{cType}" MappedUri="/Views/Cov/CovListView.xaml?Id={id}&cId={cId}&cType={cType}" />
<uriMapper:UriMapping Uri="/Dev/{id}/Cov/{isAnalysed}" MappedUri="/Views/Cov/CovListView.xaml?Id={id}&isAnalysed={isAnalysed}" />
I implemented the second solution since it doesn't require me to change the pattern of the URI.
Hope this would help someone having a similar problem.

Resources