how can I show yesterday's page view statistics in Kentico? - kentico

I want to show yesterday page view statistics statistic in kentico10
I have used page view web part, but it doesn't include yesterday field as shown below.
But it doesn't include yesterday field!

One approach would be to clone the biult in webpart (Page Views) which creates a copy of the webpart in the database and copies the code files to the filesystem. Then you would edit the StatisticsType property, add in a new value for yesterday
Yesterday would be added in a value into the datasource:
Then in the C# code behind of the .cs class you would edit Reload data to handle the yesterday query the way the other queries are handled.
You would simply set the correct fromDate, startDate, and Interval type to represent "yesterday".
I don't recommend editing the built in webpart because that is not a 100% upgrade safe change.

Related

SharePoint view limitation

I have a document library in SharePoint online. I keep on dumping the records into it. As SharePoint have a 5000 record view limitation the moment it reaches that limit, still I will be able to upload documents but it doesn't show up any where.
Eventually I end up creating a new view and apply a filter and then the document starts showing up under the new view.
My question here is: Is there a way to automatically create a view when it reaches the 5000 limitation and put the newly uploaded documents to the new view.
Yes, you can do this via MS Flow/Workflow & server side apps/scripts of course but it's not a good approach to the issue IMO.
Have you indexed the columns? I just tested this now on a document library with 20k documents and I'm able to filter. There are limitations which you should look into (complex filtering), that's where compound indexes come in.
If you still have issues then I recommend you give the highlighted content web-part a try. You can create custom search queries & it looks similar to a document library if u set the settings correctly. The only meh thing about this approach is there is a delay for search to update, from 15 mins to 6 hours depending on how much data you have

Liferay 7 Eclipse IDE override default categories behaviour

I need to create a portlet in order to change the default category behaviour/interface in Liferay 7.
My objective is to duplicate assetcategory table, expand and change its columns, and use this new table as a reference for categories within Liferay backend.
Therefore there are three key points my portlet has to update:
The category organization UI to create/update category tables on
DB. I’m able to create a new Liferay module project (panel-app template) which can present the UI backend interface from the side menu and interact with the DB.
Override default category selection panel within web content
properties panel (metadata > category select). I can create a new
Liferay module project fragment to override the
com.liferay.asset.categories.selector.web, however I’ve noticed I can
select only one file path (eg. META-INF/resources/view.jsp)
Override default asset publisher filter behaviour in order to allow
my custom categories selection. I’ve not yet investigated this
point.
I’m currently stuck at point 2 because after creating a new Liferay module project fragment, set the target Host OSGI Bundle to com.liferay.asset.categories.selector.web (which I believe is the correct one, please correct me if it isn't) and selecting the overridden files as META-INF/resources/view.jsp, I can’t proceed to redraw the category selection interface.
Here my attempts:
Updating the code view.jsp (eg. adding some text string) I can correctly
see them in the portlet.
Removing/commenting all the code in view.jsp an error is shown:
Asset category selector is temporarily unavailable
Selecting all three files available to be overridden in the main
portlet wizard (META-INF/resources/view.jsp, init.jsp and
init-ext.jsp) and updating view.jsp (like the first example) nothing
happen in the portlet
Some screenshot below:
Case 1
Case 2
Case 3
I need to create a portlet in order to change the default category
behaviour/interface in Liferay 7. My objective is to duplicate
assetcategory table, expand and change its columns, and use this new
table as a reference for categories within Liferay backend.
Just this alone sounds like a humongous task, bigger than what would fit into a stackoverflow question.
AssetCategories are used in every single content type, e.g. WebContent, Blog Articles, Message Board Posts, Wiki Pages, Knowledgebase Articles etc.. Replacing such a vital component by your own implementation is something that will safely ruin your next upgrade experience, because there you'd have to do this again, bringing your code to whatever changes will be made in the next version. And this "upgrade" includes Security Patches.
Overall, your premise sounds to me like a x-y problem and I'd rather recommend that you step back from your intended solution and look for other options to meet your business requirements. There surely are some.
My recommendation: Rather add something to the platform than ripping out a very central and generic component, reimplementing it in a business-specific manner. If you need a different filtering than Asset Publisher provides: Build your own Asset Publisher and implement the business specific rules there. Or think again about organizing your content in a different way than you currently organize it.
Unless you're already a Liferay Core Developer and are asking for a hint on how to change the implementation for the next version. But your question history here doesn't look like it.

How to get the date of the content initial published date?

In Kentico, is there a way to know the date the content was published for the first time? In the view_cms_tree_joined view there are fields called DocumentLastPublished and DocumentCreatedWhen but the latter is populated when the user save the content initially even if it's not published and the former is updated when the content is republished. Should I look at the workflowversionhistory?
You'd have to look through the workflow history for that document and get the initial publish state. If you don't want to do that (might be pretty messy and lengthy) you could always add a field to the page type for an initial publish date which will allow someone to add that date or default to when it is saved and not allow it to be editable after it is saved by using a macro on the enabled property of that field.

What is this type of webpart called and how do I create it?

I need to create a library for meeting minutes and agendas exactly like
So basically I need a library that organizes meeting minutes and agendas by fiscal year, then Team name.
Any help pointing me in the right direction would be appreciated.
The web part is called a List View Web part.
To create one, first create a document library and add the relevant columns by which you want to organize the documents. Optionally, you can then create a view (or modify an existing view) in the library to display the documents grouped by the desired columns.
Once the library has been created, you can show it on any page by adding its list view web part to that page.
Every view that you create in the library automatically gets its own page with the appropriate list view web part already added.

Autofilling Part Values in an Orchard Controller

I'm very new to Orchard (and ASP.NET MVC) and I'm having some difficulty wrapping my head around how Orchard part properties can be automatically set in a controller. I have a "Gallery" content type, consisting of the stock Title, Container and Owner parts. I'm creating a controller with a Create method that hides all of the details of the Container part since I'm going to set the default page length, the item type, et cetera in the HttpPost version of the Create method. My problem is I don't know how to set those values on the http Post.
My general plan was as follows:
I created a CreateGalleryViewModel containing the title and admin username, both as a string. IN the view those two are represented as form fields. On the submit, I could run TryUpdateModel in the controller to update the CreateGalleryViewModel with the form values. But then how do I update the Part properties? I think I'm supposed to run IContentManager.UpdateEditor(, this) but I don't think this ca, work because I never ran IContentManager.BuildEditor in the first place. Here's where I'm stuck because I don't see how the content parts get validated and updated properly.
Am I looking at this at the wrong level of abstraction? How do I make a simplified editor for my Gallery content type?
What you basically need to know here is the following:
You can build the editor of a content item with IContentManager.BuildEditor()
You can updated an item's parts' values from the POST data with IContentManager.UpdateEditor()
You can also access parts by "casting" content items with the As() method (needs the Orchard.ContentManagement namespace).
When you're dealing with content items because of their dynamic nature it's rarely a good approach to create a view model where you recreate some of the parts' properties. If you have such static view models for what's contained in a content item then you'll miss the extensibility and flexibility that comes with Orchard's content model. E.g. if you add a new part to that content type since you're using a static view model the new part won't be handled.
For a complete example of how to manage content items from code, see the Training Demo module.

Resources