DevReach Conference 2018

December 6th, 2018 | Posted by Robert Curlette in .NET | Conference - (0 Comments)

Being a Developer means we must constantly update our knowledge with the latest tools and techniques, frameworks and cloud options. One of the best ways to do that is attend a developer conference, where we can get a lot of information in a few days, and also network with fellow developers.

This year I was happy to return to DevReach in Sofia, an event organized by Progress Software (in the past, Telerik) and focussed on the Microsoft .Net technology stack. The first time I attended was in 2013 at a local cinema in Sofia, and I was impressed by the quality of the organization and high quality of talks an speakers. The event was one of the inspirations for me when I created the Tridion Developer Summit conference. This year did not disappoint! We were back to the cinema, with a very full agenda with several tracks and high quality speakers. The speakers were all industry experts, mostly from Microsoft or Progress software, and were very familiar with the content they spoke about.

A full list of sessions is available at https://devreach.com/sessions/

They also have a Facebook page with photos of the event.  https://www.facebook.com/DevReach/

All talks were recorded and will show up on the Progress YouTube channel here:  https://www.youtube.com/channel/UCwr0eQsblxgpjkUXbiCjrRA

The agenda was littered with talks on AI and Machine Learning, Serverless and Docker, and also cloud and Azure. We had a few sessions about .Net, and these were well attended, with people standing in the aisles, or sitting on the floor in front, all with their eyes glued to the code on the screen, and listening to the speakers unraveling the code on the screen in front of us. The talks were very well attended and I had to sit on the floor a couple of times to attend a talk. A good sign, if you ask me!

One of my favorite talks at the event was the Docker presentation by Chris Klug (https://twitter.com/ZeroKoll). He not only knew his content, he presented it in a very funny and interesting way. He walked us through why to use Docker, and how he uses it to run .Net Core in an isolated and trusted way on his laptop. Slides were at a minimum and he spent lots of time at the command prompt, issuing commands like a true console ninja, and wow’ing us in the process. He ran over on time, but he still wanted to show his last demo, so he fired off a few commands at the command prompt, hit return, waited 10 seconds, and it all worked…or it seemed to.

Another nice talk was the session after his was by Tibi Covaci (from Codemag) on the state of .Net – what is happening in the Core and with the latest version of the .Net Framework 4.6. This was a really nice summary and the presenter knew his content really well.

I also attended a few AI talks, which mostly focussed on the business case and were an introductory level, showing code only within Powerpoint. I hope next year we see more live demos and live coding, and also more deep talks.

On day 2 I was really looking forward to the Sitefinity Headless CMS, since I have a background in Content Management and wanted to see how Sitefinity would handle this new trend. After some basic concepts were explained, we were shown the OData response in the browser, and then shown a WebApp and Mobile App that consumed the CMS data from the OData service. I have used OData in the past and not been too impressed with it. Seems to get difficult when filtering results, or doing more advanced queries of the dataset. One of the participants made some comments about exactly this, and then said he had later figured it out. But, unfortunately the talk was very short, using less than half of the time for the talk, and didn’t seem well prepared. I would have liked to see more code, more behind the scenes of how he consumed the data, and in general more discussion around the idea of headless versus standard.

After this talk I listened in on a .Net Rocks live show, always funny and a pleasure to listen to the topics discussed and how they move through so many different ideas. The discussion went to Serverless and tooling, with one of the guests speaking about VIM and her use of the editor. Others spoke about VS Code, and how helpful the debugger is in it.

Finally, the day wrapped up with a very inspirational talk from Neal (reverentgeek), titled ‘You Are Awesome!’. He comes from my home State of Georgia, and it was nice to hear a familiar accent. 🙂 Very inspiring, authentic and from the heart, Neal shared with us that we can all get better at something by putting in the time and dedication to the task, and continue practicing. For example, a few years ago Neal discovered he likes to draw, made some sketches for a conference talk of a man, and then 3 years later made the same sketch. The level of detail and quality had improved a lot! That reminded me that we need to practice a bit, every day, and to be nice to ourselves and allow us to fail sometimes, but keep moving forward. Big thanks to Neal for sharing his honest story.

We were all invited to a 10 year celebration party at a nearby hotel, where a famous Bulgarian rock band performed while we networked with the speakers and other attendees.

Overall, the event was very well organized and offered a lot to the participants. Big thanks to Progress for hosting the event! I hope they are able to continue providing such a high quality Developer event to the Balkan region.

Here are some helpful tips when working with JSON.NET.  It is sometimes challenging to find the right method or property to use because we don’t have access to intellisense when using the ‘dynamic’ object type often preferred by JSON.NET.Here are some helpful tips when working with JSON.NET.  It is sometimes challenging to find the right method or property to use because we don’t have access to intellisense when using the ‘dynamic’ object type often preferred by JSON.NET.
The context is that I get an existing JSON document, and I need to add new properties and nodes into the document.

Hope this was of some help to you with providing some more examples of the excellent JSON.NET library.  If you have any more tips or suggestions for the code I am happy to hear them.  Thanks.

While creating some JSON for the Metadata on a Structure Group in C# I came across an interesting challenge to display the URI and Title of the Embedded Schema. Initially I was using a FieldDefinition instead of an EmbeddedFieldDefinition and then the ID and Title properties were not available of the Embedded Field. Casting the variable to an EmbeddedSchemaFieldDefinition was the proper way to access the EmbeddedField definition info.

 

EmbeddedSchemaField right1Field = pageMetaFields[fieldName] as EmbeddedSchemaField;
EmbeddedSchemaFieldDefinition def = right1Field.Definition as EmbeddedSchemaFieldDefinition;

embeddedSchemaFieldDef.RootElementName = def.EmbeddedSchema.RootElementName; //"Content";
embeddedSchemaFieldDef.Id = def.EmbeddedSchema.Id; // "tcm:11-123-8";
embeddedSchemaFieldDef.Title = def.EmbeddedSchema.Title; // "Metadata fieldname";

The Tridion GUI is powered by JavaScript while the backend is powered by .Net and sending a (nice) message from .Net to the GUI has been very challenging – until now. Using SignalR, an open-source product from Microsoft, it is possible to show or ‘echo’ the message from the .Net Event System, Templates or Customer Resolvers and show them in the GUI. Check out the tutorial that Will Price and I wrote published on SDL Tridion World to find out how to implement this yourself. Special thanks to SDL’s Bart Koopman for helping get the article online and embracing the GitHub Gist embed for source code.

Tridion C# TBB Upload Tip

June 10th, 2013 | Posted by Robert Curlette in .NET | Tridion - (0 Comments)

When saving a C# TBB I recently had the error message ‘Error 1 Invalid URI: The format of the URI could not be determined.’?

My first thought was to check the URI in the AssemblyInfo.cs file – was it the correct folder URI?  Did I have a typo?  Did the folder exist?  But, all was fine.

Then I recalled seeing this error before and it is related to the config.xml file that we create using TcmUploadAssembly.exe to upload the TBB.  In this file we must specify the URL of the server, which is, of course, also a URI.

The wrong value was:  <targetURL>localhost</targetURL>

Correct:  <targetURL>http://localhost</targetURL>

So, just in case you ever hit this error I hope this little tip can save you some time.

In my previous article I described how to use a Console application to check-in items using the Core Service. In this article I will describe how to setup and use the log4net framework to output content to the Console window and also to a log file.

1. Get the log4net DLLs using NuGet. Right-click on the project name and select ‘Manage Nuget Packages’. If you do not have this option then download NuGet and then try again.

2. Update the app.config file with the log4net configuration. NuGet packages can modify our config files, but unfortunately the log4net NuGet package does not.

This configuration does the following:
– Specifies a Console Logger to automatically write all messages to the console
– Uses a Date rolling file appender

<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<log4net>
<appender name="Console" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %-5level: %message%newline" />
</layout>
</appender>
<appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="CheckinItems.log"/>
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<maxSizeRollBackups value="7" />
<maximumFileSize value="10MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%-5level %date{yyyy-MM-dd HH:mm:ss} - %m%n"/>
</layout>
</appender>
<root>
<level value="ALL" />
<appender-ref ref="LogFileAppender" />
<appender-ref ref="Console" />
</root>
</log4net>
</configuration>

3. Add this code to your Main method to startup log4net

XmlConfigurator.Configure();

4. Instantiate an instance of a logger

private readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

5. Write a log message

log.Info("log something");