Sharepoint View Grouping - performance - sharepoint

If you add grouping to a list view does it inheretly improve performance when you navigate to the view in the sharepoint page? i.e. if you use grouping, does sharepoint retrieve data when you click the [+] icon (using an Ajax call)? or is the data already retrieved beforehand?
Many thanks.

when u use grouping by default all your group document are not loaded first time. when u expand group it load all document.
After that using JavaScript it change the property from display none to display block and display block to display none and so on.
so according to performance it load all document first time but it's quick.
This is same for list also

My experience is that using groupings loads all data at once. So if you have a list with 1000 items and you display a grouped view, you may experience very slow loading.

Related

How to create a View with replication conflicts

I wish to create a view showing a number of fields from notes documents with replication or save conflicts. So far I have managed to create a basic view with a column for the document ID (Contract ID) then the next column states "Replication or Save Conflicts" but I don't seem to able to either get rid of the replocation or save conflcits column or add new columns to show additional fields from the document. Is there a way I can do this? I want to be able to show the view in XPages. Here is the View selection formula I am using;
SELECT #IsAvailable($Conflict)
Conflicts are not displayed good in views. here are a few alternative tips to deal with conflicts that might give you an idea or two :-)
Create a categorized column with the value of the field $ConflictItems in the view you have, then you will see which item is causing the conflict and can take action to prevent it.
When you open a conflict you can use the action menu "View Parent" to compare the parent and the conflict
Ytra ScanEZ is a great tool for finding and resolving conflicts. it is also possible to create a script that will compare the documents and present a diff list.
You can create an XPage to display your conflicts (and parents). The web is more dynamic as it allow you to layout your data in the way you want and is not restricted to the way view in Notes works. This kind of xpage can be displayed in Notes client or Web browser
Use XPages power. Get all documents from the view with your selection formula. But don't try to show any column value and get fields directly from back-end document you get from view entry entry.getDocument().
Sure, it has some performance impact, but for (hopefully) small amount of replication conflict it's nothing serious.

Create domino view dynamically in XPages

I want to know if I can click a button in my XPage and dynamically create a Domino View and then show it in a panel control on the same page. The reason I want to do this is because I have a categorized view and I don't want to lose category data by using full text search. So I am thinking of creating a new view dynamically and pass my search parameters, like end date or start date, into the view selection formula.
Is it possible? Any other alternative solution is also welcome.
yes you can, but you don't want to. A Domino view takes space in the database and quite some time for its first use. So you end up with a lot of views taking space and the need to adjust database space after removal. Your response times will suck big time.
Categories as shown in Notes views are no web interaction pattern, so you might want to solve a problem that actually shouldn't exist.
The preferred method for Domino application is navigation / drill down over search. But you could do a FTSearch where you add your category to the search parameters and render your results in a repeat control instead of a view control. There you have more control over the look and feel.
Whether or not it's the best solution, the answer to the immediate question about creating a view on the fly is yes: the Database class has a couple "createView" methods to allow you to create a new view, either entirely from scratch or based on a named other view. From there, you can use the "setSelectionFormula" and "createColumn" methods in the created View to build what you want. You can't do EVERYTHING with those methods, but it may be enough.
One problem you'd likely run into is ACL access: you'll need Designer rights to the database, which a normal user most likely wouldn't have. If you use the sessionAsSigner object to fetch a signer version of the DB (say, "var signerDB = sessionAsSigner.getDatabase(database.getServer(), database.getFilePath())"), you can work from there. Off the top of my head, I don't remember if you will also have to up the "Maximum Internet access" setting on the last tab of the ACL to Designer as well, but you may.
I am assuming that you are referring to the problem that exists when you choose the documents based on the category. This is something that I find highly annoying and I wish that it was possible to turn this on and off. It makes sense for embedded views, but not for much else.
What I did to solve this was to include the category value in the next column. In this way that text could still be seen, even if it was a flat view.
Alternatively, you could also look into using a repeater control and create your own way of presenting the information. This would be used instead of a (Dynamic)ViewPanel control. You could then present the information any way you wanted as long as it is returned in the viewrow set.
Happy Programming!

Handle click count for documents in SharePoint 2010

I am having a page with documents loaded in SharePoint 2010. I have three buttons below each documents in the page and they are 'Like','Unlike' and 'Comment'. So whenever people go there and see the documents they can click on any buttons of their wish.
My question is how to take the hit count of these buttons seperately and display it for each document. Is it possible to create a list with having these three columns and handle it using Client-Side scripting. Any suggestions or help is much appreciated.
Each item in SharePoint has a property bag that can contain ad-hoc data like this. You could certainly add additional columns to store this data and update those columns but that does mean that users could easily manipulate the values via the UI. Since the property bag is only accessible via the various API's, you wouldn't have this issue.
For an example of accessing the property bag via CSOM (which would be your best option since I'm assuming you want your users to be able to like, unlike and comment without refreshing the page each time), see this post reading and writing property bag values using CSOM
Another thing to consider for comments is the existing notes functionality that exists in SharePoint 2010 and SharePoint 2013. These comments are ties into the social functionality and may give you a bit more bang for your buck. To show the comments page for a particular list item see this post SharePoint Social Data using Javascript

Dojo DataGrid (8.5.3 UP1) Returning Blank Rows - based on Readers field

Trying out a Dojo DataGrid control on an alternate XPage (so as not to impact production) for an existing View, which utilizes Readers fields in the documents. I've got the REST service implemented (xe:viewItemFileService) and connected to the Dojo DataGrid just fine (from 8.5.3 UP1 controls).
I have two scenarios of user visibility (via Roles in the Readers field, assigned by NAB Group definition):
All documents visible (user A). User A can see all documents, everything works perfectly fine for this one.
User B can see some documents. ViewPanel control works fine, but once it's in the Dojo DataGrid, it only has values for the documents User B should see, the remaining X (difference between correctly visible and total document count) rows are populated with "..." (non-values).
Inspecting the REST service's output via the pathInfo yields only the correct documents for User B; which I take as a good sign and makes me think the Dojo DataGrid is what's misbehaving.
Actual Question:
How can I suppress the generation of the unnecessary rows?
I've tried to implement Marky Roden's approach, but got lost on the manipulation of how I can control what the DataGrid is looking at to generate row count (he's talking programmatic store definitions when I'm using the xe:djxDataGrid control). The attribute of rowsPerPage doesn't seem right, and I can't find one for the xe:restService that would make sense to me for what I'm looking for.
Anyone know how to do this? Would love to get this work. Been loving the series by Brad Balassaitis and what XPages can do for us.
Setup:
Domino Server 8.5.3 UP1
NSF signed as Server ID
The grid gets the hint for the number of rows from ?readViewEntriews which tells the actual number, not just the number of documents user B can see. Anyway just romping through reader protected views without designing for access speed has huge performance ramifications. If you can categorize the view by the combined reader/author fields and limit to that category both performance and empty rows will go away.
If you have multiple possible hits (username, role, group membership), you might want to use a rest service that returns data using some SSJS using a viewNavigator

SharePoint "Group By" is broken when using "Allow Multiple Values" for a column

I want to show the documents in my document library grouped by category. The category is a lookup column that I added that allows for multiple values. Unfortunately this breaks the "group by"-functionality completely. Is there a programmatic solution to this problem?
There is one way... It's complex and ugly - but it should work :)
It is possible for you to write you own view for at list (HTML, JavaScript and all). The VWSTYLES.xml file in the C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\GLOBAL\XML folder, contains the HTML and JavaScript for the default SharePoint view styles - getting your inspiration from this, you can create your own view style, where you can do anything you want!
The problem is, that SharePoint don't have any way to deploy your custom view style - this is where the ugly part comes in - you have two options for deploying your view style.
Add you code directly to the VWSTYLE.xml/Edit a copy of it and override it with a feature
Pros:
You will still be able to edit the
view from the SharePoint interface
Cons:
You override a default SharePoint
file - your work can be overridden by
a SharePoint update.
Your view style will be available on every list in SharePoint.
Create your view programmatically on the list
Pros:
You don't override any default
SharePoint files.
You can control which list uses your
view
Cons:
You wont be able to edit the view thru the SharePoint interface
I've used method 2 a couple of times myself - and it works... but it's not pretty! :)
I don't think what you are trying to do is possible. When grouping items/documents, you display them in different groups based on a grouping value. I don't think SharePoint has support for adding a single item to multiple groups. With multiple values in the grouping field its' impossible to know which group to add the item/document to. I am not sure if this is an error or if it's by design.
Thomas is correct, this is by design as the item would have to appear multiple times in different groups. It is worth noting that this is possible via the web services, however.
See why I was getting duplicate rows from the sharepoint lists web service
And no, I've no idea why the lists webservice will do it, but the API won't.
Check out this link as well. Access supports this functionality without having to do much ugly code. http://office.microsoft.com/en-us/access/HA012337221033.aspx
So here is a sort of hack that has worked for me, no guarantees though. While your column (Office in my case) has allow multiple values enabled, fill in all of your data as needed. Once done, go to List Settings, click the Column "Office", and turn off allow multiple values. SharePoint will pop up a warning about how this data may be lost (never happened to me). Hit okay, then modify the view you want grouped, "Office" should now show up on the drop down of columns to group by. Finished result will result in your groups (and or sub groups) showing up just fine.
The only qualm I have is that instead of having an item show up in both Group A B because it had both field A and field B checked in Column X, it just creates a new group, Column X: A; B. So in my case, I have staff in both Beaufort and Orangeburg Offices, instead of having those staff in both groups (preferable) it creates a new group as below:

Resources