Sensenet: Pagination on Document Library - sensenet

It is possible to define pagination on document library?
I have a document library with more that 10000 documents... when I open the library occurs an timeout.

Actually SenseNet already does this! They just don't deliver it in the standard list control. If you open up the PRC and navigate to /Root/IMS/BuiltIn/Portal you'll see a list control with paging. The code can be found at /Root/Global/renderers/UserExploreGrid.ascx as User Control portlet. You can copy the code and change it to meet your needs.
Our company prefers to create User Control portlets and use Datatables with calls to the SenseNet OData API using skip and top to deliver pages.
Finally, given that SenseNet Content is stored as a tree structure (in SQL!), you can move the Content after creation so that data is organized hierarchically. A common solution is to take the first letter of the DisplayName and create a sub-folder from that letter, thereby reducing the number of items at a single node.
Here's what the paging looks like:

The short answer is no. Right now there isn't a built in functionality for that.
The long answer is that you can make a pagination yourself. One of the core member of sensenet made a grid where you can use pagination. It won't work with the current free to use releases because they lack the js files she used. But the idea behind it, is using a custom view. Which you can achieve by adding a system folder named Views under a the Document library and adding your custom view there.

You can use this grid for Explore, just follow these steps:
Go to the Explore action page, and switch editor mode on the PRC.
Place a ClientContext portlet (this can find under the Portlets->Application section in the portlet picker dialog) to the Wide column. Set portlet (client context porlet) properties, Apparance to None. It is a technical portlet, which allow get the CurrentContext in javascript. This is a very important element to work with this grid. The Grid use the client context.
Place a UserControlPortlet (In the portlet picker, Portlets->Application section) to the Wide Column.
Set portlet properties:
4.1. Portlet title: <%$ Resources: PortletTitles, Items%>
4.2. User Control path: /Root/Global/renderers/UserExploreGrid.ascx
Checkin Page modification on the PRC.
Enjoy your pageable explore portlet.
Keep in mind that this grid is specifically designed for users, so they will miss actions in the top menu. These must be handwritten. Then I suggest you copy the UserControl ( /Root/Global/renderers/UserExploreGrid.ascx)
and then put the action list on it . You can read more info about action list here: http://wiki.sensenet.com/ActionList
Br,
maros

Related

how to add autocomplete function to a column in oracle apex tabular form report

i want to add an autocomplete function to work in one of my column suppose name.It is easy to do using items.but how can i do it in the report.
Since a report doesn't contain Apex items, you can't do this with the built in features. Ignoring any possible plugins that may already be available, you can do this with jQuery UI, specifically the Autocomplete widget. Apex already includes some of the jQuery UI suite, but you may need to download the Autocomplete widget from the jQuery website.
This will need some custom work on your end. This really isn't that hard if you know how to use jQuery.
Download the jQuery UI Autocomplete widget and include it on your page. You can put just the .js file for that in your Application Shared Items. I have the whole jQuery UI library in a separate place on the webserver because I use different parts for different projects.
Source in that widget in the page properties.
You'll need to create text items with apex_item.text in your report.
You'll need an On Page Load dynamic action to attach the Autocomplete widget to your text items.
For the autocomplete source, if it's short, you can just use a Javascript variable that you put on the Apex page. If it's longer or you need to find the list at run time, you can use a function that calls apex.server.process.
If your report has Partial Page Refresh turned on, make sure the DA in step 4 has Dynamic scope, not Static.

Piranha CMS customisation

A few questions on customisation with Piranha CMS.
Is there a way to create additional custom site-wide items similar to those from the site helper? http://piranhacms.org/docs/api-reference/site-helper
e.g. to be able to set a phone number used throughout the site but still editable in the settings section of the manager.
Is is possible to create additional custom items for a page, e.g. page subtitle, and for those to appear in the Information section of page editing? Creating a region for say a page subtitle seems overkill.
Is it possible to create a custom page type with a region that is a collection of HtmlRegions or similar? e.g. for the purpose of managing a set of FAQs or similar enumerated content?
Is is possible to define custom settings properties for a page type?
Yes, you can add regions to your site in the same way as with page types under Settings > Sites. You then add content for them under Content > Pages > Edit Site.
You can add simple text properties on the page type. They will be shown as single line text inputs under Properties when editing the page.
No native support, however the region body can be anything that can be serialized to JSON so you have to handle this in the edit view for your region.
There is no support for injecting fields into the page settings, however if it's important you can override the whole edit view for pages and do anything you like by placing a copy of the view in the manager area in your local project. You can find the views in the github repo in the 2.2.5 branch.
Regards
HÃ¥kan

Flag module - link's position change (Drupal)

I've just installed Flags module and it looks awful when on the bottom I see "Flag this item" link. The only thing I've found in configuration is enabling it to show as normal link. Still I haven't found how to change position of this link. Is it even possible to change link's place? I have installed CCK Blocks but it doesn't give me any option to get rid of it. If someone know or suspect what's possible - please help me.
Try the Display Suite module, this module is integrated with many modules like flag, title etc...
Display Suite allows you to take full control over how your content is displayed using a drag and drop interface. Arrange your
nodes, views, comments, user data etc. the way you want without having
to work your way through dozens of template files. A predefined list
of layouts (D7 only) is available for even more drag and drop fun!
https://drupal.org/project/ds
You can move and generate custom layouts for the fields/properties on the entity display formatter: teaser, full...

Alfresco Share site's dashlet for document library

I was wondering whether exists any dashlet which allows you to explore a site's document library. As far as I know doesn't exist such dashlet out of the box, there only exists the "Site Content" dashlet but it is slightly limited.
I have been searching around and "googling" and I found these useful resources that could be useful as a starting point if I had to create my own:
http://ecmarchitect.com/archives/2012/05/08/1592
http://code.google.com/p/fme-alfresco-extensions/wiki/GalleryPlusDashlet2
Do somebody know more dashlets/resources targeting this issue? Any suggestion?
As a temporary solution, I'm also thinking in the possibility of taking advantage of the "Web View" dashlet, by configuring in it such URL that retrieves the documentlist region/component in the documentlibrary page. For example:, share/page/components/documentlibrary/documentlist or share/page/site/{site}/documentlibrary?region=documentlist. Maybe it is crazy or what I'm saying doesn't make any sense, but it is just an idea.
Another idea that have just came to my mind is the option of creating a custom Surf/Share page which includes the component/webscript that implements the explorer of the document library, specifically the documentlist component. Then configure the "Web View" dashlet giving the URL that points to the custom page created. Would it make sense?
Thanks in advance.
You are going to see a couple of site visualization and navigation dashlets on Alfresco Visualization Tools available on https://github.com/bhagyas/alfresco-visualization-tools. The project is still at it's initial phase, but you will find interesting snippets of code used to retrieve the document library content trees within the dashlets.
The project was presented by me at Alfresco DevCon in Berlin just a week ago to bring interactive navigation and content analytics. If interested, you can find the slides at the lightening talk slides in the DevCon 2012 site at Alfresco.
Cheers! =)
Hi I've done exactly the same, it was not really needed for a Dashlet but for to embed the documentlibrary of a site in an iframe for another site.
So what I did was indeed create a new page template embedded-documentlibrary.
I've copied first the following files and renamed them:
site-data/pages/documentlibrary.xml
site-data/template-instances/documentlibrary.xml
site-webscripts/org/alfresco/documentlibrary.ftl
If you rename file 3 or put it in another folder, you need to check the paths in file 1 & 2.
So to make only the documentlibrary appear instead of everyting I just removed everything in file 3 within the <div id="alf-hd"> tag.
If you remove the tag, the document-tree will also be removed and it gave some javascript errors. This should be fixed in the latest version, but haven't tied that.
So it's extremely easy to create your own page and instead of navigating to site/documentlibrary you just navigate to site/embedded-documentlibrary or your own name you've chosen.
And yes then you'll need to use the web-view Dashlet to show it.
The only thing you need to know is, that the links open within the iframe. So if you use the web-view Dashlet, you need to open the links in a new window.
For my situation I needed an iframe, in your case you could also just let the freemarker from your Dashlet render the components needed.
There is a document-liberary-display dashlet available in the alfresco add-on list which can be used to show all the documents from document-library on site-dashlet.
http://addons.alfresco.com/addons/document-library-display-dashlet

Need to access the Page object in Global.asax in the PreRequestHandlerExecute

I have a huge website (containing around 5000+) pages. There is a theme functionality in the website where user can choose different colors for their profile. Now i want to use the ASP.net theme feature and put different CSS (for different colors) in the theme folder and in Global.asax i want check the user theme and render appropriate link element with the css. But my problem is, i am not able to access the Page element for adding the link in the page.
Here is my code
Dim page As System.Web.UI.Page = TryCast(System.Web.HttpContext.Current.Handler,System.Web.UI.Page)
page.StyleSheetTheme = "Black"
But when i run this code I get a Null reference error.
P.s : My application is very huge so its not possible to have a master page or a base class and inherit it in every page.
Please suggest.
The page is not available in PreRequestExecute. This function is called before asp.net steps in to handle things, and asp.net is responsible for the page. Think of PreRequestExecute as being earlier in the scheme of things, like when IIS is first trying to figure out what to do with this thing it has, the thing is not even a page yet.
You might want to look into some of the other events that you can hook, there are events that would take place after the page has loaded that may allow you to do what you are suggesting.
Rather than going into global.asax for this, consider using master pages. One possibility is to have nested master pages, where the first master page sets up overall layout, and the nested master handles the theme. (Or one of several nested master pages, all referencing the same top-level master page). If necessary, you can use the PreInit event in the page to change master pages, and select the master that matches your theme selection.
You can centralize this function by having your own class that inherits System.Web.UI.Page, and have all your own pages inherit this new class. Handle the PreInit event there. (As well as other useful functions, like page-level handling of unhandled exceptions, general security issues, etc.
EDITED TO ADD: As #aepheus correctly notes, the page hasn't been instantiated at the PreRequestHandlerExecute event. So there's no page class you can access.