Using Kentico CMS with pre-generated HTML - kentico

I have a huge amount of content that is in pre-generated static html pages. I am working with an organization that runs their web site using Kentico (11) on IIS. They wish to host the pregenerated HTML, but to have a consistent look and feel on the pre-generated pages.
Is there a way to includes tags etc inside the pre-generated html that gets kentico to process the content to give the standard look and feel for the website, without having to convert the content (potentially 100k+ pages) to normal kentico content (it just doesn't seem like a feasible approach, since the content is refreshed from the source regularly)

There is definitely no out of the box way to that. I also agree it is not a great approach overall. However, if someone was very determined to make it work and if you really had to, custom programming could make that happen.
You could create some custom logic and use the Kentico API (maybe in a scheduled task if the content is periodically refreshed). The custom code could possibly build out a content tree that is based on the folder structure of the files (if portal), or build out some routing logic (if mvc) to route requests. Those requests that match the ~/filename.html could then be intercepted by Kentico and your custom code, read the contents of that filename.html from disk, and use it as a datasource type of webpart (if portal engine) or a repository / model (if MVC), then use that info to populate the presentation layer of the response of the final html to the browser. That way you could wrap that pre-generated content in a master page with some level of control of what the header and footer look like (if portal engine) or a shared layout (if MVC).
Again, I don't recommend it. It might be very slow and tedious to attempt as well as have performance and scalability issues.
It could be a cleaner approach to somehow get that content into a SQL database and then use standard programming to deal with it in the Kentico layer / website.

Related

Is it possible to hardcode Kentico webparts into a layout?

Kentico 8.2.
I've got a layout "master" file - the creatively named Master.ascx.
I've got three web part zones in the layout: header, main and footer. Main just includes a content placeholder which is overridden by the next layout down - home, standard, whatever.
I could just drag and drop web parts onto the header and footer web part zones on to the "design" tab, but I don't want to for a few reasons:
Which web parts go in which zone is stored in the database, which isn't versioned in Git. The layout file itself is versioned via the "store CMS Virtual Files on disk" option.
The layout markup inside the header is complicated enough that I'll end up needing to have 4 or 5 web part zones for 4 or 5 web parts - or I'll need to write a layout web part or drag row layouts / column layouts in, etc - it seems much simpler to just hardcode web parts inside bespoke markup.
I find editing a plain text file with Visual Studio much faster than dragging and dropping web parts into a zone, and the same applies for anyone else who'll ever work on this site.
Which web parts go in which web part zone doesn't ever change - there's always a primary nav, share-on-facebook, etc - which web parts are included will never need to be in any way dynamic.
Is it possible to just hardcode a web part into my layout?
To answer your question, no you cannot hard code webparts in your layout. Simple reasoning is webparts are not part of a layout, they are part of a template . The webpart definition for each template is stored with the template in the database as XML. You can see this by going to a template and selecting the Webparts tab and it will display all the XML for each of the webparts on that page template.
Understand where you're coming from with your 4 points. What you also need to consider is:
what happens when you want/need upgrade or apply a hotfix?
from the client, content editor and content administrators perspective, having everything in code, renders the CMS pretty useless.
if you code everything in a physical file, it's then pretty pointless to have a CMS if it requires a developer or a physical code change for every request
The point of the CMS is to be dynamic and database driven. Not everything can reside in the file system, database or a code repository. Kentico has some very strong developer tools you can enable like workflow, versioning, and check-in/out.
I'd also enable your DBA and ensure they have a valid backup and recovery plan in the event of some disaster.
It's not possible, because it goes against the Portal Engine development model. If your main issue is the unavailability of these objects in GIT consider the option to save virtual objects (https://docs.kentico.com/display/K82/Deployment+mode+for+virtual+objects) to the file system, so they are picked up by GIT. I'd also suggest to keep the website upgrade safe (e.g. by using the Portal model), because the next version will feature CI support (saving of all DB objects to the file system) http://www.kentico.com/product/roadmap which is due to be released in 2 months

Which to choose and when: Web content, Dynamic List Records or Specific Model?

I find that Liferay concepts are quite confusing.
When I add new items, I don't know what is the best to choose:
Use the web content concept with template and structure
Use the dynamic list records
Use a specific model (using service builder).
All of these are really similars and can achieve same goals.
Have you got any clue or advice on what concept to choose when you develop some new features in Liferay?
You should use the components in this way :
Web Content : Web contents provide convenient way to create, update, view, modify, create RSS feeds, customize the content of the web site. It is one of the main component of the Liferay CMS. You should use web content when,
You have static content and want to show to the site.
You have specific structure of the content (like content with an inline image and a document link), then please use web content with the structure and template
You want to use ready to use content portlets ( web content list, web content display, web content search) instead of creating new set of portlets for your own type.
After all this, Liferay provides customization of web contents by allowing user to add new content type, creating rss feeds, structures, templates, ready workflow, content type roles etc.
Dynamic List : Consider dynamic list as a database with display functionality. Here, you can create a custom type of data and provide display functionality. If you have any requirement like user can create his/her own type of list maintain them, then go for it.
Custom Portlet : If your requirement is very case/scenario specific that you cannot achieve using list or web content or any other Liferay portlets (blogs, wiki, knowledge based articles etc) then go for custom portlet, here please remember, that at every liferay upgrade, you need to review the portlet and update the code accordingly in case of any API change or something. For OOB portlets, Liferay takes care of it.
Hope this helps!
It deends on what you want to have and how much control you want to have over your code.
To make simplistic application use web content concept with template
and structure.(need not to know technologies)
-To make some complex applications use dynamic list records
To make extremely complex applications and have full control over the flow use liferay service builder.(need t be a expert java programmer)
Hope that helps :)

Customize OOTB Table of Content Web Part

I'm using OOTB Table Of Content web part. However, the structure that it displays slightly differs from the one I need to show. I need to hide several node + render some additional. I though that I could take advantage of the control that is used that Table Of Content web part (if there's one). Is it possible to achieve?
Thanks
I think you should use Content Query Web Part or you can create a new web part using OOTB toc web part as a base and render it on your own. You can do additional operations that way as well.

Has anybody ever tried to screen scrape data from sites built with SharePoint?

Or at least could anybody point me to docs about its crazy proprietary url parameters and html field name obfuscation? I can only suppose this is caused by SharePoint...
The main problem is, given a start page built with SharePoint, I can't recreate a form post with a programmative client because:
field names vary, they are appended with a some sort of id, hash, whatever (I think session.wise? Not sure)
tracing HTTP traffic on my side, I see the HTTP request is packed with strange parameters like __REQUESTDIGEST, __VIEWSTATE, and many others
Is this an intentional protection device put up by SharePoint? Which is the underlying architecture and which objects are involved (script callbacks, ... )?
(BTW, I'm not doing anything evil, just trying to extract public government data from a website).
Thanks.
SharePoint is nothing more than an ASP.NET Application, SharePoint completely Built on top of ASP.NET 2.0.
Being said that __VIEWSTATE is nothing but a Hidden Field that has the View State Information
Coming to __REQUESTDIGEST this is an Intentional Protection, this carries some sort of
securito validation which is called FormDigest
And finally to answer your Question, You will not be able to guess field and stuffs unless you have control to change the sourcecode of the application. Reason why the Name of the fields looks like obfuscated is because those controls are not handwritten but generated by the Code of ASP.NET Engine and parser, Reason field having such a name called Naming Container
One suggestion I would say is that, rather than trying to scraping the screen data, you can try alternate approaches, like each of the List in the SharePoint has the XML Feed inbuilt,try to consume it, if you have access to the site, try to retrieve the information using export to excel etc.
In addition to RSS, SharePoint also has a Web Services interface that you can use to get at and interact with data stored in SharePoint in a programatic way.

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