On Mon, Sep 14, 2020 at 05:38:47PM +0300, Ayuka Phanuel wrote: > On Sat, Sep 12, 2020 at 4:29 PM Ayuka Phanuel <[email protected]> > wrote: > > > I want to add the total number of records to the news-xmlui. Is this data > > in the repository meta and how can I add it to the page ? > > > > For example: > > > > > > <document xmlns="http://di.tamu.edu/DRI/1.0/" xmlns:i18n=" > > http://apache.org/cocoon/i18n/2.1" version="1.1"> > > <body> > > <div id="file.news.div.news" n="news" rend="primary" > > class="white-box"> > > <div class="welcome-msg"> > > <head>My Dspace</head> > > <p>My dspace description</p> > > * <p>{{7000 records}}</p>* > > </div> > > </div> > > </body> > > <options/> > > <meta> > > <userMeta/> > > <pageMeta/> > > <repositoryMeta/> > > </meta> > > </document>
I believe that this is not already provided, in repositoryMeta or anywhere else. But it should be simple to query the database for something like 'SELECT COUNT(*) FROM item WHERE in_archive = TRUE AND withdrawn = FALSE' (PostgreSQL) or 'SELECT COUNT(*) FROM item WHERE in_archive = 1 AND withdrawn = 0' (Oracle). For HQL you may find this helpful: https://stackoverflow.com/a/37750623/2916377 Scanning tables is somewhat expensive. You may want to add indexes to those columns, or to cache the result for a few minutes rather than re-calculating it every time. org.dspace.app.xmlui.aspect.discovery.SiteViewer may be a good place to add this to the repositoryMeta. -- Mark H. Wood Lead Technology Analyst University Library Indiana University - Purdue University Indianapolis 755 W. Michigan Street Indianapolis, IN 46202 317-274-0749 www.ulib.iupui.edu -- All messages to this mailing list should adhere to the DuraSpace Code of Conduct: https://duraspace.org/about/policies/code-of-conduct/ --- You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/20200915130606.GA3796%40IUPUI.Edu.
signature.asc
Description: PGP signature
