right now I have the Url from a video item, that im showing in a Video native webpart, but i need to get the title and description for processing.
For that, I only can use Javascript, so, I get the List ID like this:
function(siteUrl, webUrl, relativeFileUrl, itemResult) {
var ctx = new SP.ClientContext(siteUrl);
var site = ctx.get_site();
var web = site.openWeb(webUrl);
var file = web.getFileByServerRelativeUrl(relativeFileUrl);
var item = file.get_listItemAllFields();
var list = item.get_parentList();
ctx.load(web);
//ctx.load(item, 'Id');
ctx.load(item);
ctx.load(list);
ctx.executeQueryAsync(
Function.createDelegate(this, function(sender, args){
// success
//console.log("Success");
itemResult({
list : list,
item : item
});
}),
Function.createDelegate(this, function(sender, args) {
// error
...
})
);
}
But when i check the sharepoint model, it creates two items for the video types, so the Title and description are associated with a second element, and this function only bring me the first element, that its like a folder, and when you modify the item, you modify its the second element.
There is any way I can get the Title and Description for the video having this item? Or there is maybe other approach for getting it?
Thanks for your help!
web.getFolderByServerRelativeUrl(relativeFileUrl)
andfile.get_properties()
and with that I getTitle
anddescription
, but cannot findLikesCount
Any idea how i get it? Thanks. – Alejandro Saldarriaga Aug 14 '15 at 14:51Microsoft.Office.Server.ReputationModel.Reputation.setLike
to a folder? – Alejandro Saldarriaga Aug 14 '15 at 16:29