How to get the first file from multiple folders in a document library in SharePoint Designer 2013 - xslt

I have a document library built in SharePoint. Inside this library there are multiple Document Set folders that contain template documents. I want to create a view where it only shows the most recent document from each of those folders. The reasoning is to have a library maintainer be able to drop a new file inside of it's designated folder and the users will be able to see a view with the list of the most recent documents from each folder without needing to click into the library and check each folder to see if a new file was uploaded.
Creating a view on SharePoint directly on the website does not satisfy this requirement for displaying the documents as outlined above. I have looked into a Content Query Web Part, but this feature also does not have enough settings to make this feature work. I opted to using SharePoint Designer 2013 and created a Custom Web Part and got stuck trying to edit the view. Through SharePoint Designer, I've managed to sort the records by their Modification date which puts the most up to date document at the top of the list. Then I managed to group the records by the folder name or "type of template". Now I am stuck trying to parse through the XSLT generated source code by SharePoint Designer and figuring out a way how to only display the first record of each folder/group. I currently have a REST call approach using jQuery and it seems to work fine, but I am trying to find if there is an XSLT approach that can solve this problem.
Update - Adding XML snippet
Here is a snippet of the XML that resembles the library.
<Library>
<Template>
<FileName>ExpensesReport.xslx</FileName>
<ModifiedDate>2022-12-10</ModifiedDate>
<TemplateType>Excel</TemplateType>
</Template>
<Template>
<FileName>Presentation.ppt</FileName>
<ModifiedDate>2022-12-11</ModifiedDate>
<TemplateType>PowerPoint</TemplateType>
</Template>
</Library>

Related

How do i create a custom document property in excel so that i can auto populate with a SharePoint workflow

I am setting up an automatic document generator on our department's SharePoint site - users will submit the necessary details via a SharePoint list and the workflow will run automatically in the background to generate the three documents namely; specification (word doc), clearance form (word doc) and requisition form(excel). I have managed to auto-populate the first two forms. However, i am not able to do the same for the third file, which is an excel file.
I understand that there is no insert function for document property and tried following this particular advise but i couldn't get it to work. https://superuser.com/questions/99386/excel-cell-value-as-excel-document-metadata-property
Anyone know how?
By default, SharePoint uses Word file template as the default template of Document content type.
If you want to create an excel file by using SharePoint Designer workflow, you can create a custom Document Type (in my testing, it is named "Excel Content Type")and set Document Template to an Excel file:
Then add the custom Document into your library, then use "Create List Item" to create an Excel file using the custom content type:
After the workflow runs, the result is like:

How can I publish mulitple content to dotCMS through script

As I am new to dotCMS, just wondering is it support any script through which I can upload/publish my multiple contents(i.e well structured directory) as whole. For example I have multiple text files with contents to publish how can i do this in one shot ?
I know it support dynamic content page, but seems that works on already created content/page.
There are two ways:
You can either put all the content in an Excel file and use the "import content" option of the "Add new Content" button in the dotCMS admin "Content" tab. To know what the Excel structure should be, first download a piece of the content you plan to upload by clicking on the "Export button in the same page".
The second way is to use the Restfull content API. Check the documentation on how to use it.

bpmn explorer # wso2

I need to customize the Search module of the BPMN Explorer integrated in wso2.
More exactly I want to be able to search using one of the task variables as search parameters.
I have looked in the git repository and came across https://github.com/wso2/carbon-business-process/blob/c6e60e57ab0de5d8de59041647f5cb9b7834d9c7/components/bpmn/org.wso2.carbon.bpmn.ui/src/main/resources/web/bpmn/instance_list_view.jsp
However this script is not in my BPS release (latest available downloaded already).
Could anyone please provide some pointers at least to how I could go about customizing the search function for bpmn explorer ?
Thanks!
Edit:
I managed to modify the gui (searchView.jag file )of the search function, but cannot add functionality for those new fields
You can do the necessary modifications (customize the seach function) to searchModel.jag file for the fields you added in searchView.jag. Please find it (searchModel.jag) under <BPS_HOME>/repository/deployment/server/jaggeryapps/bpmn-explorer/model directory.
If you look at the bpmn-explorer folder you can see three sub-folders namely controller, model and template. Here controller folder includes set of .jag files which are used to check the request is secure or not, hold the session and build basic structure of the rendering pages. .jag files in model folder are used to implement the business logic say as an example invoke activiti rest api to get the process variables, process information, etc. The .jag files in the template folder are used to render the UI elements with appropriate results. Hope this resolves your issue.

SharePoint Word Template central repository

I have to build something like this:
All our Word templates are saved in a central SharePoint Site (Document Library). For every customer we have a dedicated sharepoint workspace. In the workspace there should be a view, webpart or something like this where the all the files from the central template library should be shown. The template files should not lay NOT in the customer workspace.
When an user clicks on a word template in this view, webpart, the document should be opened in word and when the users edits and saves the document, it should be saved in the customer workspace (without prompting for a path).
I know that Content Types would be a possiblity for this, but this is too complicated for our intention.
Is there a possiblity influence word on opening where the document should be saved? Like an Parameter in the URL?
Au contraire, document types are the only way you will be able to get out of this mess unscathed.
For each "template" you can create a "site content type".
You will be able to set the url for that content type to the "template document" in your main site.
Customer site document libraries will then be able to create a "new" document and it will default to the library where they click the data from.
See
Change a content type for a list or library

Problem in provisioning when using stapling to customize sharepoint 2010 blog template

I'm trying to use stapling to customize sharepoint 2010 blog template. I created a stapling feature and another feature for customizing the the site definition (onet.xml). It's work fine for web parts but if I include List Views it gives an error when I'm trying to activate the "customizing feature" (Not the stapling feature)
Error is,
"Error occurred in deployment step 'Activate Features': Cannot complete this action."
This is the xml snippet which causes this problem. (I couldn't post the xml part here)
http://social.msdn.microsoft.com/Forums/en/sharepoint2010programming/thread/6ba343f3-020b-47e5-938c-aeedcf094adc
BTW I'm trying to customize the default page here and my approach is
1) Get a copy of the existing custom page and rename and include in the feature
2) Change the master page of the above file to custom.master
3) Change the layout of the above page without removing "ContentPlaceHolders"
4) In feature element put module element copied from onet.xml
Appreciate if anyone can provide some insite on this.
Thanks
-Madhawa
Try provisioning the file without the View to make sure that your Url and Path attributes are correct. Once an empty page is displaying, add the View XML back. For the List attribute, try using the relative URL path (ex. Lists/Blog) instead of the template ID.