Okay, I don’t normally write about pro wrestling on my blog, but honestly, enough’s enough with the lack of logic. So let me sum up the situation first.
Originally posted at http://www.ektron.com/Blogs/Ken-McAndrew/Smart-Forms-For-the-Marketer/
As any of my developer brethren will tell you, I’m a big proponent of Ektron’s Smart Forms. In our world, they’re a great way to structure content, to make dictionary objects for storing things like settings, and to store more data in a defined way than is natively available in the Ektron workarea. I like to call them a database inside the database.
But this is geared more towards marketers and decision-makers, those that use what we developers do. So you might not be familiar with what a Smart Form is or why it’s a good idea to use it. Hopefully after this, you’ll not only understand it, but if your application isn’t making use of the concept, you’ll convince your development team to look into it.
So this question came in from Twitter, and I’ve seen it before, but to go over the nuances is difficult in 140 character chunks, so let’s try this.
As those of you who’ve worked with Ektron know, it’s a web site project at its core. (Trust me, many of us are arguing for a web app project model…and we’ll keep doing it, too.) Now while this is a pain, it can also be a benefit to you, and here’s how.
When developing an intranet, one of the items to consider straight out of the gate is security. A content management system will help you get started, but there are still a number of things to think about. This three-part blog series will explore how to securely configure user setup with an intranet powered by Ektron™.
Really, this should be an easy one, and if someone would like to sneak it into Ektron 9.1, please feel free.
For the longest time, when you set up your templates (PageBuilder or not), you give it a nice descriptive name and can even describe your template. But when you go into creating content or PageBuilder pages, the templates always use the filenames, from setting up what templates a folder can use to selecting the template in the drop down for HTML content to the labels for creating PageBuilder pages.
Soooo…any reason it can’t use the template names we give it? And use the descriptions in tooltips?
As an extra, being able to select the screenshot for the PageBuilder template to use in the add new page dialog would be nice too. I find that if you’re using forms authentication, it’ll bounce to the login page for the default screen capture and not give you the template shot you want. I was able to finally replace them manually by pasting what I wanted over top what the system generated, but I had to set them read-only because every so often, Ektron would replace them. Having the ability to supply my own captures (or tell it when to take a capture) would be beneficial.
I decided to make this blog entry an open forum for developers to drop in things they’d like to see added/removed/fixed in a theoretical Ektron 10. (Revisit the disclaimer from the last blog entry first!) I know the Ektron dev center has a forum devoted to this kind of thing, but it hasn’t had a new post in almost a month, and I’m targeting this more towards the Twitter die-hards. There’s lot of Ektron developers out there, but those that are on Twitter and use the hashtag and participate in Synergy or Office Hours is a lot lower.
Remember, I can’t promise anything on if this stuff happens. And if it’s something that’s broken that you need fixed immediately, get ahold of support naturally. But if you have an idea, post it in the comments. If you like someone’s idea, vote it up.
Oh, and if you aren’t going to Synergy, you really should. If you can’t go, maybe we can arrange for your face to travel!
First off, a disclaimer: I don’t work for Ektron or have any insight into what “Ektron 10” would be. These are just my thoughts on things that should be done.
From a high-level perspective, I think the time’s come to really shake up Ektron and shake the tree loose of the legacy stuff. While I used one of the old APIs just recently, it’s really to the point that things need to be cleaned up, refit, and rebuilt.
Over the last two weeks I’ve been doing a lot of work around users in Ektron, and having talked with one of my colleagues yesterday about the processes I’m using, I’ve come to the conclusion that it’s time to abandon the CMS users vs. membership users concept, and instead go to a single user pool.
First off, there really is one user pool behind the scenes. You can’t use the same username in CMS and membership users, for example. So this isn’t a huge change programmatically, I don’t think. But right now, you have to go to two separate locations to manage the users, and if you want a user to have an everyday membership account versus an as-needed author account, you need two accounts. Especially when you consider PageBuilder, because you don’t want a person just browsing your site seeing the design bar/elements all the time.
When you bring in LDAP or Active Directory, things get more complex. If you’re using LDAP, you can only connect up to CMS users, and groups all have to be done manually. If you’re using AD, you can connect to either CMS or membership users and bring in the groups, but again, you can only connect to one side.
So here’s what I’d do. Go to a single pool of users with three options for the user: member, author, or admin. For the authors, you can then use the roles to give them access to just working with content or being able to use PageBuilder (perhaps even the level of PageBuilder…can they make master layouts or just page layouts?). I would then expand the user groups and make part of their creation also have a role of member or author. That way, when you assign someone to a group, you can determine what access they have when they’re in member mode or in author mode, as well as determining what permissions can be set on the folder/content level. To simplify permissions, only groups can be added, not individual users…I think that’ll make things easier to manage for admins anyway.
With respect to the members versus authors, the biggest thing is whether the editing bars show up or not. There’s already a slider to switch modes in Ektron 9, perhaps a similar slider to turn off edit mode, or add a member/author radio button to the standard login control. I think it should be possible for a user to browse their site as an everyday user and then switch to authoring when needed.
The final piece surrounds permissions. I think it’s time to switch to a SQL model of what I call “negative permissions.” Currently, permissions work where if you’re in two groups and you have editing permissions in one group, you have editing permissions regardless if the other group doesn’t. There would be a need to add a “no permissions” option instead of just on/off, because a checkbox off should be interpreted as it is now, which is “inherit whatever other groups say” but there could be a “no permission” option as well so that if group two is explicitly said that they can’t edit, the user can’t edit even if group one says they can.
Feel free to add your thoughts or ideas in the comments!
I went through an exercise today that made me very glad I’d set my Visual Studio solution up properly. I had to make some changes to smart forms in my site, changing field types, making multiple fields that were really a “pick one method” and so on. After changing the smart forms, then I had to regenerate the XSD-based classes, and then I had to rework the data code. But because I layered my code nicely, that was as far as I had to go.
I didn’t come up with this idea myself…it’s actually part of an Ektron webinar by Steve Mann. It was supposed to be focused more on dependency injection but at the end, it kind of skimps out (and I’m still hoping for part 2 to really address that!). But in there, Steve describes a good method for setting up your Visual Studio solution. Of course, your project may need something else, but this is a good basic start.
First off, set up a Common class project where you’ll keep code that’s used in all of your other classes. Realistically, this should be devoid of Ektron code, mostly containing things like the smart form XSD-generated classes and your own data classes for translating your data source to your website.
Then, you’ll want to set up a DataAccess class, which obviously is where you do all of your data retrieval (read: Ektron calls). You should reference the Common class here. Basically, this is where you use the Framework API to retrieve data from Ektron, then pass it off to your own classes to return just the fields and data you need. You can also do searches here against the search API, call third-party data sources, and so on.
Next, set up a Business class. This is what connects your DataAccess and your website code. You’ll add references to the Common and DataAccess class projects here. Now a number of your calls here might seem like they’re just pass-throughs (IE, just calling the DataAccess and doing nothing else). But you should also do any custom caching here, as well as combining multiple data calls if necessary into a single product.
Finally, you’ve got your website, whether you’re using the web site project that installs by default or using a web application project that you later combine into a CMS400Min site. This should have references to the Common and Business classes. At this point, you can see that if needed, you could change out your entire data layer and you wouldn’t break your code in the website or business layer. This isolation makes it a lot easier to make adjustments as well.
From there, you can add other helper classes if you want. For example, I have a common functions class that I use from project to project with very generic items, like caching and logging. I also have a common Ektron library that has more generic functions, these routed towards CMS-based items that aren’t specific to my project. For example, I set up a PageBuilderBase class that holds some of the common functions you find in a PageBuilder wireframe, which I can then inherit from in my website, thus minimizing the copy/paste of code. As you develop more projects, you’ll find more of these opportunities to refactor and genericize. as well as what you read other developers put out; I added James Stout’s code to hide unused PageBuilder zones to my PageBuilderBase, for example.
Organizing your project solutions can be a tricky thing, especially if you find yourself unhappy with how you do the initial setup, and it can be really hard to reconfigure once you get into development. I hope this helps you with a starting point at least.
ASP.NET developers are very familiar with the idea of setting global configuration values for a web application. You can use either the appSettings section of your web.config, or you can use an external file like an application.config if you don’t want to mix things in with your web.config. Fortunately, using Ektron gives you another option that is more flexible from both a development as well as user management perspective.
James Stout (AKA eGandalf) recently wrote a blog post on architecting your CMS folder structure. One of these folders is named “Configuration” and will be the home for our exercise. We’ll be using a smart form for setting up the configurations, which not only gives us structure but allows us to set up multiple configuration blocks. This lets us set up one block for site-wide config, another for a specific section’s config, etc, and set permissions so only certain users can affect certain configurations. (This also shows one advantage, that a developer isn’t needed to change configurations like they would be with a .config file.)
The smart form structure is very simple. Set it up with a multi-group-box with two fields in the box, one for Key and one for Value. We’ll be using the content types methodology for retrieving the data. We’ll then use a function that returns a Dictionary object (that you should cache!) that will store all of the data; you’ll find this code on the Ektron code library. The only change to make would be for the XmlConfigurationId, that should be changed to the ID of your smart form.
Now that you have your dictionary of config values, you’re all set to go. You can either call it as needed, or set up a manager class of public property names to retrieve the values from. If you do that, make sure you’re only using the Get (no Set here), and also make sure you do a sanity check for the key, which is easy to do with a dictionary using ContainsKey.
So a little over a year ago now, I decided to get back into the gym and get myself healthier again. I hadn’t really done anything workout-wise in a few years, ever since I had to give up tae kwon do because my knees couldn’t take the jumps and stances for long periods anymore. And I’d had doctors look at my knees, but they couldn’t find anything wrong to do surgery on.
Last summer, I was over 420 pounds (I started weighing when I reached 420, but I think I was 430 before I got a scale that could do 400+). I couldn’t walk more than a few minutes without my lower back seriously hurting me. A month or so later, I started going to a chiropractor that found some issues in my neck as well, and also tried to do some work with my knees. The gym I was going to was alright, but I kept losing my personal trainer, and the prospect of just going into a gym to walk on a treadmill was boring me to tears.
Then came Hurricane Sandy. To be clear, in the DC area it wasn’t much of anything (in fact, I did a little promo video for Ektron out in it, which by the time it was used at Synergy I was embarrassed about given the devastation in New York/New Jersey). But I also met a new friend via one of my Ektron contacts on Twitter, who turned out to live not far away from me, and was actually working at my old company. She in turn introduced me to the boxing/kickboxing gym I go to now, which gave me a new lease on my exercise program…a cardio program I could do and get the fun parts of my tae kwon do classes in at the same time? Sold! If you live in the Sterling/Herndon/Reston area, give Title Boxing a check-out. Also about that time, I got back on Weight Watchers, to help keep an eye on my diet.
So that was step one on the revival train. Step two came professionally. I’d been working officially at C-SPAN since February of 2011 and I really enjoyed it. But the last few months, my enjoyment was really decreasing, and department morale was getting pretty low. (I’m not telling any tales out of school saying this.) We were finishing up a long and tedious project, and out of the blue comes a recruiter looking to talk to me. He actually contacted me twice, the second time publicly calling me out on Twitter. So I go and have lunch, and a couple of weeks later I’m offered an opportunity I couldn’t say no to…better pay, better commute, better work/life balance. I definitely didn’t expect that to happen, but again, social media made something good happen.
Which brings me to step three. About four years ago, I met this woman on Match and dated her for a few months before she broke up with me. Out of the blue, not even a week after I start my new job, she friends me on Facebook. This leads to us getting lunch together, because we both work in the Tysons Corner area now, so the mall’s convenient (even more so once the Metro comes in near the end of the year). That leads to a movie the following night. And that leads to getting back together. It really feels like we picked right back up where we left off, but even better. We spend some evenings and the weekends together, I’ve helped her babysit, we’re learning to cook more together, we’re talking about taking dance lessons…it’s great. (And for the record, I’ve cooked a few meals now, and no one’s been poisoned. :) )
So here I am, a year after my first weigh-in and getting back into the gym. Since then, I’ve lost nearly 70 pounds. I can walk longer distances again without pain. And if you’d told me a year ago that I’d be at a totally new job and that I’d have a girlfriend, I’d have called you nuts. But I am, and I do, and I think I’m the happiest I’ve been in a long, long time.
Here’s to one year down. Let’s hope by this time next year, I can drop another 70 pounds (which would make me the lightest I’ve been in many years), that the job’s still going great, and that my relationship with Cherilyn is still going strong.