Advantages of using custom classes in custom modules - kentico

Introduction
I'm designing an application using Kentico 11 CMS. Client provided me with this information:
Big data are expected
Versioning and workflow would be nice to have but are not mandatory
Editing interface for the data is needed
My research
Based on Kentico out of the box capabilities, I had to decide whether to use Pages, Module classes or Custom tables to store data. I've excluded Pages as they are not advised for big data by docs. After some additional reserach I consider Custom module to be the best option for me.
Documentation states that:
Custom modules: Workflow cannot be used for your data. Versioning of the stored data is not supported by default.
Question
1) Am I able to easily bypass this restriction when using custom classes for the custom module? (meaning versioning and workflow)
2) Is there any collision when defining an interface for editing the data, while using custom classes in custom modules?
3) When defining general indexes for searching will there be any problem when using custom classes in custom modules?

You can setup versioning (https://devnet.kentico.com/articles/module-development-versioning-recycle-bin), not workflow. If you need workflow just for publishing, first you can use pages appliaction, then after page is published move the content to custom class.
You can use default UI from Kentico or you can create your own.
I don't think so, but you can create always custom index if will be something wrong with general

Related

Where does Orchard CMS stored content definition?

I am fairly new to Orchard CMS.
I am going through how a module is created an got a question.
According to the documentation, content definition could be created in two ways:
use admin content definition page
create module project in visual studio
is there any difference?
I created a test content definition and try to find it in the SQL compact database. I can't seem to find it.
Anyone know where that info is stored?
Thanks
You can find the content definition in the following tables in the Orchard database:
Settings_ContentFieldDefinitionRecord
Settings_ContentPartDefinitionRecord
Settings_ContentPartFieldDefinitionRecord
Settings_ContentTypeDefinitionRecord
Settings_ContentTypePartDefinitionRecord
The admin interface uses the same APIs that are used when defining content definition from code, so it's basically the same thing. I tend to define content definition in migrations, as that's the best way to ensure that content definition changes are properly applied on all instances of the application (the migrations automatically run during application startup). The admin interface is intended for users who do not have access to the source code (ex. administrators, not developers).

What is the Recommended Approach for Hosting Transformations when creating a Custom Module?

In Kentico 11, in a custom module you are developing, when using a custom Page Template (portal mode) for the UI Element, where is the appropriate place to host Transformations used by web parts of that template? "Appropriate" meaning the transformations can be bundled with the module for import/export operations or at least grouped with it logically in Kentico admin?
The Kentico Custom Module app doesn't contain a Transformations tab for its Classes.
Repeater web parts used on the UI page template only list Custom Tables and Page Types when looking for transformations. Transformation doesn't seem to be supported for a Custom Class.
I could create a standalone container Page Type to host all transformations for the module, however this would be outside the module. These transformations would use data from Classes in the module (through repeater web parts and query data sources for example). It seems odd to put them outside so I am suspicious of doing this.
Up until now I've only used the out-of-box tab and listing web parts to create custom modules. Now I need to get into more customization, and prefer the portal mode to easily build templates using web parts. Transformations seem to be the missing consideration in this development flow.
Neither can I find Transformations mentioned in the Custom Module documentation. Kentico Documentation I'm referencing is:
Creating custom modules
Manually creating the interface for custom modules
Martin Hejtmanek's Module development articles like this one
I can find a place to put my transformations. I'm looking for thoughts about where to best put them and bundle them with my custom module work.
Your findings are a shortcoming in the module documentation. The documentation talks in great detail on how to build the module and display it within the Kentico UI but talks little to none on how to display that content outside of Kentico on the public facing website.
What you mentioned, using a custom Page Type as a container is a simple easy approach and I believe you can bundle this with your module. Yes it doesn't make sense but using this approach will allow you to have your custom queries to access the module data and display options (transformations).
You have another option to create custom webparts for this and package them with your module but I'd recommend against this because it takes away from the basic usage of Kentico and will require code maintenance and modifications for simple changes.
If you look at page types you will see that Kentico does the custom page types to hold transformations. They have ones like RSS Transformations, E-Commerce Transformations, etc.
That is the way I have always done it also.
I suggest you to take a look at the custom table module as example, i.e. user interface part of it: there is transformation menu item under edit custom table in the interface. Take a look on how it is done and try to clone/modify it for your own custom module. If you check the DB: cms_transformation table has TransformationClassID field. So transformation is attachable to a class - so you custom classes can have transformations attached. Honestly i've never done it, but this is the way how I would approach. I would keep apples with apples, oranges with oranges... yeah sure you can always create "container page type" and it will work, but i would play around with the custom module. You might need to create and extender in this case.
#John,
As per Brenden post, you can achieve this using custom web part with your custom logic.
Refer below URL:
https://docs.kentico.com/k10/developing-websites/defining-website-content-structure

Using custom control from another database

I need to use a custom control which is a simple navigation bar from another database
navigation bar is made with twitter bootstrap css framework,
why do I need to use a custom control from another database?
because this navigation bar is going to be common to four notes Databases,
how can I implement this more efficiently?, a control that is common to four databases
Domino includes template inheritance features that allow either an entire application or a specific design element (like a Custom Control) to be updated whenever the template design changes. You could link the shared Custom Control in each of your four applications to a common template so that, if you need to make changes to it, you only have to change it in one place. You can not reference a Custom Control that only exists in another application; you'd have to store it in each and link the design to keep it synchronized.
Alternatively, you can use the Extensibility API to convert it to a library component. Controls of this kind can be used in any application running on a server that has the library installed. A video tutorial for this process can be found here.

Drupal, a custom searchable user profile should be based on Node or Custom db?

I have to work on a Drupal project to create user profile for some specific users on the website with some special fields. They can be a different role. Main idea is to search. User profile must be searchable with provided criteria.
I have two options,
1- Using node with (content_profile)
2. Create my own form and tables.
One my question is, is it possible to create a separate search machanism for custom created database? and is there a way to cache search result? or should I use node based? please advice some one with idea on this..
Thanks.
Yes it is possible to create a search mechanism using views and exposing the custom table to views via the api (there is a blog post here: http://blog.menhir.be/2008/10/22/expose-database-fields-to-views-in-a-custom-drupal-module/ and there is more info using the advanced help module (http://drupal.org/project/advanced_help) (install and look through the views documetation), then you could also use the Views caching.
A custom table and fields would be my preferred method if you have a lot of users as the profile tables can get pretty big (this may not be an issue for you), or you could use the content profile module http://drupal.org/project/content_profile and possibly save yourself some work!
If you wanted to perform a complete custom search not using views you'd probably need to implement that and the caching yourself if you went the custom field/table route, but you'd gain a lot of flexibility.

Sharepoint: Best way to display lists of non-Sharepoint content with "compatible" UI?

I've built a web part for Sharepoint that retrieves data from an external service. I'd like to display the items in a way that's UI-compatible with Sharepoint (fits in with its surroundings.)
I'm aware of the "DataFormWebPart" but was unable to get one working properly. It requires a valid DataSource and I was unable to build one from the results of a web service call... Part of the problem is that my web service wrappers don't expose the XML return info, rather I have a bunch of deserialized objects. There doesn't seem to be an easy way to turn actual objects into a datasource, or populate a "generic" datasource from object data.
I could use an SPGridView to get the same UI, but the grid control doesn't have much in the way of smarts -and- it forces every field into its own column. I'd prefer to render each list item as a single cell with complex rendering (for instance the way that StackOverflow shows its lists of questions.) I'd also like to get as much of the Sharepoint-standard UI as possible, such as the sorting, filtering, and paging controls.
So, first: Has anyone here written a Sharepoint control that does this, and if so do you have sample code to share? If not: am I overlooking some useful control, whether MS-supplied or available in an external library?
Thanks!
Steve
Sharepoint: Best way to display lists
of non-Sharepoint content with
“compatible” UI?
Take a look at the built in sharepoint web controls:
Microsoft.SharePoint.WebControls Namespace
It contains all the controls used in sharepoint. I'd tell you more, but the documentation is very thorough.
Problem with SharePoint is that there are a bunch of different ways to do this. If your data is not changing too often and is not overly large it may be worth considering entering it into a list for display.
If you have the Enterprise licence it may be worth getting your data into the BDC and using it there.
you may have to convert the objects into xml or use the serialised objects with the XML webpart for display. This still has the issue of custom rendering using XSLT.
Here's a great article that explains how to configure BDC connections to web services using the BDC Definition Editor:
Creating a Web Service Connection by Using the Business Data Catalog Definition Editor
http://msdn.microsoft.com/en-us/library/bb737887.aspx
The best way to do this IMO is to make a Web Part. As a Web Part the UI will be automatically rendered to be the same as the theme the site is using (unless you override it) and it will be able to be placed anywhere by anyone with admin privileges.
Tutorial on making a Web Part
Tutorial on packaging and deploying a Web Part
Example Web Part Source Code
You could create a custom web part and use an SPGridView. You say you don't like it, because it forces every field into its own column, but that's not true. You can create a template (ITemplate) for every column and fully customize what's shown inside it, just like you would using a normal ASP.Net GridView. Using this approach I've added the little "New" images right next to a list item's Title, just like SharePoint does itself.

Resources