How to get last modified date & author from search:search API? - xquery

I am uploading some documents in Marklogic Server (doc, docx, pdf, txt etc). Now I am building an interface in HTML & XQuery that allows a user to enter a search term and if that matches the contents of any documents, then that document name is displayed in the grid. I am using search:search API for searching. Now I also want to show last modified date and author of the document in the grid. Every windows document have last modified date and author property. But how can I get this information from search:search API so that I can show these information in the grid ?

If you have enabled the settings "maintain last modified," Marklogic keeps the last modified information in document property fragments. However, this is unrelated to the properties information kept in Windows, which are lost by default when you load them in Marklogic.
If you want to retain the Windows properties data, set up a filter in Information Studio to populate the Marklogic property fragments with the data. Alternately, you could write your own XSLT and use xdmp:document-filter() to store the data directly in the document.
Once you have loaded your documents and populated them with the properties you need, you can access the data directly if stored in the document, or using xdmp:document-properties() if stored in document properties.

Related

Custom properties/tags is replaced with actual values in MS Word using code or any SDK

I have scenario as I have a template in a Microsoft Word document (.docx) that has placeholders / tags / custom properties that say "{!CompanyName}" since I have a business necessity. This will later, after processing, be combined with the real database table contents or any other source values, and saved as a new Word document (.doc).
Which free SDK works the best for .net core?
Support for the following key feature should be included in the SDK 
tag replacement with actual data
Auto-generated table and rows
Image insertion into the template
Conditional check.
Please make a suggestion here!

Ignore Turkish Characters On Firestore Query

I have a .net app that uses Firestore as a database and It's using Firestore Query to find some data. The problem is data fields that include Turkish characters but if someone uses my app and wants to search for data and if don't use Turkish characters, the query can not find this data.
For example, if I want to search my name on my app and my name is saved like "Ertuğrul" and if the user searches like "Ertugrul", the query can not find it. I need it to find it. Is there a way to do that?
My code that uses query is here:
QRef = DataBase.Collection("CollName").Document("DocName").Collection("CollName")
.WhereGreaterThanOrEqualTo("NameSurname", $"{NameSurname}")
.WhereLessThanOrEqualTo("NameSurname", $"{NameSurname}\uF7FF");
Firestore queries always return documents where a particular field holds a perfect match. If you want to be able to search for "Ertuğrul" as well as for "Ertugrul", then besides the "NameSurname" field you should consider adding a new field called "NameSurnameWithoutSpecialCharacters" and store each name without those Turkish characters.
When a user searches, simply verify if the searched term contains "special" characters. If it does, search on the "NameSurname", otherwise search on the newly created field.

Getting list of licenseUrls

I'm trying to retrieve a list of used licences from ProGet to build a summary report.
I'm looking in the dbo.FeedLicenseUrls table which appears to have exactly what I want, but it's empty. What is required for this table to be populated?
Do you mean a list of licenses used by all packages in a feed? In that case, it has to be done on a feed-by-feed basis since it is stored in the metadata specific to the feed type (e.g. NpmPackageVersions.PackageJson_Bytes or RubyGemVersions.Metadata_Bytes).
To get this data for NuGet for example, you can query the feed at this URL to get all the license types in XML and parse the response body:
http://proget/nuget/{feedName}/search()?$select=LicenseUrl
As an FYI, The FeedLicenseUrls table is used to filter licenses before they are served to their respective clients, and is verified at request time.

Determine File Type of attachments stored in SQL Server as varbinary(MAX)

I need some help. We migrated an Access database to SQL Server. One column had attachment data the Attachment data type in MS Access. The MS Access application is being replaces by an ASP.NET web application.
This data now lives in a column of data type varbinary(MAX), there is no indication of the file name and or type (most attachments are Excel, Word and PDF docs).
In my ASP.Net application I am using a data reader that will allow users to retrieve the attachments by downloading them using a browser. (I have a new table for new attachments that contains the full file name and content type, and when present it works like a charm). Without the file types, all attachments come across as xml/garbles data files like shown in this image below (can't yet post images, been a long time reader, first contribution. Here is the text in which I had planned to highlight some key values:
ÿÿÿÿWorksheetExcel.Sheet.12****Access.OLE2Link¾ÐÏࡱá>þÿ þÿÿÿÿÿÿÿÿÿÿÿÿÿ]þÿÿÿþÿÿÿ !"#$%&'()*+,-./0123456789:;<=>?#ABCDEFGHIJKLMNOPQRSTUVWXYZ[\þÿÿÿþÿÿÿÿÿRoot EntryÿÿÿÿÿÿÿÿàÆ©÷òï…ÝŒkˆZ‚Å7Ï€Ole ÿÿÿÿÿÿÿÿÿÿÿÿCompObjÿÿÿÿeOlePres000ÿÿÿÿÿÿÿÿš­ þÿÿÿþÿÿÿþÿÿ‹ÀF CENTRA~1.XLSÿÿ­ÞHBCentral Dispatch Process Map.xlsxºÀF'C:\Users\MA~1\Desktop\CENTRA~1.XLSÿÿ­Þ]|C:\Users\ine\Desktop\Central Dispatch Process Map.xlsxÕLÀFƒ •Æh5)ÏBy>*Ϧc{>*ÏS5ŽŒ2S5&D%¯ CENTRA~1.XLSpï¾&D6®&D%¯*ƒœ2Central Dispatch Process Map.xlsxm-lkÑÊC:\Users\ine\Desktop\Central Dispatch Process Map.xlsx(
It appears that the content is there from which I should be able to extract the file name and types.
Here is my question, how do I migrate my attached files. I need to determine the content type and file names from the original data stored in varbinary(max), I then need to move the files from the current location into my new table with the attributes that describes the file name and file type.
Thanks

reporting services - data set has no query but works... Where could the query be located?

I was given a report today with a normal embedded data set (dataset1) and data source (datasource1) but the data set query is just a number: '1411'. The previous programer manually entered fields (not calculated fields) into the field tab.
When I click RUN, it works.
How is it populating the page without a proper query?
-There is only 1 tablix called (table1.) It also is pointing to dataset1.
-In Report Properties there is no VB code.
-RDL XML: Under dataset1's tag:
<DataSourceName>datasource1</DataSourceName>
<CommandText>=1411</CommandText>
I see no other SQL listed. Could there be something else on the server that's triggering it?
What sort of data source is "datasource1"?
If it's an RDBMS, check if there is a stored procedure or function in the database with the name "1411".
In SQL Server for example you could conceivably have a stored procedure called [1411] that returned a data set.
I'm assuming we are talking RDL (Report Definition Language). You might open this report with your favorite text editor and look at the CommandText XML tag to find the associated query. Hope that helps.

Resources