Umbraco Articulate Tags and Categories Returning "System.String[]" - umbraco

I am trying to set up a blog using Umbraco and the Articulate plugin. Everything seems to be working great except the Tags and the Categories are returning a string that contains "System.String[]" rather than the values I have assigned to those fields.
I am using Umbraco version 7.6.3 and Articulate version 2.0.5.

There's a bug and you need to disable the new built in property value converters for the categories to work:
https://github.com/Shazwazza/Articulate/issues/233

Related

Grails 3 parsing of hash map properties with "." in key not working as expected in earlier versions

We have the following property for our multi-tenant application which helps us find the tenant based on domain.
mydomains = [
'www.google.com': 'tenant1',
'www.abc.com': 'tenant2'
]
In grails2.2.4 we were able to access it as
grailsApplication.config.mydomains['www.abc.com']
it would correctly give us 'tenant2' in 2.2.4, but in grails 3.3.7 it seems to create a map for each "." in the key & as such unable to find the tenant for a given domain. Here is how the mydomains property is parsed in 3.3.7
[www:[google:[com:tenant1], abc:[com:tenant2]]]
Is there an approach where i could get that same behavior in 3.3.7 ?
Instead of grailsApplication.config.mydomains['www.abc.com'] use grailsApplication.config.getProperty('mydomains.www.abc.com').
BTW... This isn't directly related to your question but there are very few situations for which referencing grailsApplication.config directly is really the best thing to do. See the article at https://objectcomputing.com/resources/publications/sett/retrieving-config-values-in-grails-3 and the video at https://objectcomputing.com/products/grails/quickcasts/runtime-config-values-grails-3 for more info. In the video I discuss some of the reasons that directly accessing grailsApplication.config isn't usually the best thing.
I hope that helps.

Vaadin 12 ItemLabelGenerator of ComboBox when used in grid ComponentRenderer

Today I have upgraded from Vaadin 11.0.2 to 12.0.0 - Everything went smooth, except one thing:
In a grid of mine where I have a rendered column to show a ComboBox, there is a strange issue with the ItemLabelGenerator. I defined it as follows:
grid.addColumn(new ComponentRenderer<>(gridItem -> {
ComboBox<MyObject> comboBox = new ComboBox<>();
comboBox.setItems(myObjectsService.findAll());
comboBox.setValue(gridItem.getMyObject());
comboBox.setItemLabelGenerator(MyObject::getName); // MyObject::getName returns String
// comboBox.addValueChangeListener omitted
return comboBox;
}))
.setHeader("MyObject")
.setId("myObject");
This has been working fine in Vaadin 11.0.2 but now the item-labels are displayed as package.path.to.myobject.MyObject#41d8d522 and not the actual name of gridItem.getMyObject();
When I click on the ComboBox to show all options, the labels are correct! but as soon as I select one, it turns into the aforementioned wrong string.
Important detail: for testing reasons I have now added a similar ComboBox with the same setup into a simple VerticalLayout (AKA not in a grid), and there everything works perfectly fine. That is why I think the issue is with the ComponentRenderer somehow and not with the ComboBox alone.
Is this a bug, or have I missed something when upgrading to 12.0.0 ?
In the vaadin blog post about the new release of Vaadin 12, I see that there is one known breaking change, and it has to do with ComboBox:
If you are coming from Vaadin 10 or 11, you should update the platform dependency in your project build file. The only breaking change we introduced was because ComboBox now supports server-side lazy-loading. If you are using filtering with a ComboBox see instructions on fixing the possible compilation issue.
However, no filtering whatsoever is involved in my case.
This answer was written by Diego Sanz Villafruela in the Vaadin Forum, where I raised this exact issue too.
I created an example similar to yours and I discover that the order in
which you set the value and the ItemLabelGenerator matters.
You should put comboBox.setValue after setting the
comboBox.setItemLabelGenerator.
Otherwise the method String.valueOf(obj) will be called the first
time, giving you the object's representation (MyObject#41d8d522) and
not the name.

How to display Groups alphabetically on swagger-ui?

I'm using Swashbuckle.AspNetCore to create my swagger-ui.
I can order operations within a group the way I want, but how to order the groups themselves?
Ex: the correct order would be: ContratedDemand, Demand, Subscriptions and Users, but I'm getting as the image below.
I'm using Swashbuckle.AspNetCore 1.2.0
UPDATE: According to #HelderSepu (tks!), I have to set the Tags and the operations will be ordered according to them.
So, how to set the tags the way I want using Swashbuckle?
I finally found the problem.
The issue was due a conflict with the "LowerCaseDocumentFilter" (an IDocumentFilter) used to create all paths with lower case instead of the default .net PascalCase.
The code I was using was found here: https://github.com/domaindrivendev/Swashbuckle/issues/834
That class works fine for its purposes, but as it adds and removes the paths from the SwaggerDocument path dictionary, it changes the groups order as a side effect.
I removed this filter and the groups are now ordered alphabetically.

Using Lucene.Net_2_9_1/contrib/Spatial.Net with Umbraco

I've tried doing this with Umbraco 6.1.6. I've pretty much implemented what Drew did here: http://our.umbraco.org/forum/developers/extending-umbraco/23200-Lucene-with-spatialnet?p=0
I'm storing lat and long data in umbraco nodes. The nodes are being indexed as encided values with tiers. But, I am not returning any results when I add the DistanceFilter to the query.
I'm just wondering if anyone else has tried this and got it working. Perhaps you can post some code.
Thanks.
Josh,
Have you inspected the index using luke just to ensure that fields are there? Also have you tried running raw queries (get the generated query written out using code) on the index using luke?
Regards
Ismail

Multi language, intelligent link conversion

I'm pretty new to Umbraco, so my question may turn out to be pretty simple, but I wasn't able to find any simple guide on it online.
I'm building a simple website with one domain and structure as follows
Content
- en
-- products
-- contacts
- cs
-- produkty
-- kontakty
and so on. My first question is: since I want to accomplish some nice results in SEO, I need to (i) assign meta language to contents of "en" and "cs" nodes, as well as some keywords. How should I do this?
Second: Say that in the future, I decide to add a new language, ex. Russian. So what I would need to do is to make a copy of the "en" node and its contents while the links included in the newly created copy should be rewritten to point at the copy and not the original (original would be /en/anotherpage, which should be rewritten to /ru/anotherpage). Is this possible?
Thanks,
Ondrej
You could build the content structure as a single root node and then have multiple Language homepage nodes directly beneath the content root.
To assign a language, you could create a custom datatype that simply displays all the .Net cultures, e.g. en-GB, fr-FR etc. Include that data type as a field on the language homepage document type and then output this value in the markup on the homepage and each descendant.
In the Language homepage document type, you can add a textstring property called 'umbracoUrlName'. You can then use this property to override the Url name. E.g. So you could call the page www.domain.com/en/ instead of www.domain.com/en/english-home/
With regards to duplicating the site at a later date, this is a difficult one. If the links are created using data types like the media picker and uComponent's multi node tree picker, then you will have no option but to inherit the links from the copied branch. However, if the links are created dynamically in the Razor or XSLT, then you should be able to make the links relative to the Language homepage or the current page. E.g. in XSLT getting the children of the parent language homepage would be something like $currentPage/ancestors-or-self::* [#level = '2']/child::* . In other words you can avoid hard coding links by using a clever bit of relative traversal.
This should give you a good start on creating multilingual sites in Umbraco
http://our.umbraco.org/wiki/how-tos/running-multi-lingual-sites-under-a-single-domain
If you was to create a Russian version in the future you would do exactly what you have mentioned above, its that easy.
To set the language meta data I would store this in a property on the langauge root node eg: /en/ to get the language page property from any page:
var langNode = new Node(int.Parse(node.Path.Split(',')[1]));
langNode.GetProperty("languageCode");
As for copying the English version to the Russian version and fixing all the links, I'm not aware of anything in umbraco to help you with this, you could write something yourself to find all the links and node references and fix them. you could use the relations API to keep track of what was copied from where to where. You'll need to be aware that you could end up copying nodes more than once.
If you don't have too much data, manually fixing links may be quicker.

Resources