Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tell us what is missing in PnP Core SDK / what feature would you like to see added #849

Closed
jansenbe opened this issue May 12, 2022 · 17 comments
Labels
question Further information is requested

Comments

@jansenbe
Copy link
Contributor

jansenbe commented May 12, 2022

To further grow PnP Core SDK we'd like to understand what features you'd like to see added to PnP Core SDK. If you've need a feature in your project or you've suggestions for features to add then please reply on this issue.

To get started a series of ideas are added, feel free to like the idea to prioritize it 👍

@jansenbe jansenbe added the question Further information is requested label May 12, 2022
@jansenbe jansenbe pinned this issue May 12, 2022
@jansenbe

This comment was marked as resolved.

@jansenbe

This comment was marked as resolved.

@jansenbe

This comment was marked as resolved.

@jansenbe

This comment was marked as resolved.

@jansenbe

This comment was marked as resolved.

@jansenbe
Copy link
Contributor Author

jansenbe commented May 16, 2022

Sites delta API support. See https://docs.microsoft.com/en-us/graph/delta-query-overview. Testing showed that sites/delta works on the beta endpoint, not on v1.0

@MathijsVerbeeck
Copy link
Contributor

MathijsVerbeeck commented May 18, 2022

Send an email to a user (can be useful for example after an automation has finished)

@iloving

This comment was marked as resolved.

@jansenbe

This comment was marked as resolved.

@iloving

This comment was marked as resolved.

@jansenbe

This comment was marked as resolved.

@jansenbe

This comment was marked as resolved.

@gszdev
Copy link

gszdev commented Jun 23, 2022

Support for new TermStore Rest API _api/v2.1/termStore (used in ModernExperience).

For example: CSOM (Microsoft.SharePoint.Client) offers a way to search for Terms using the one of the following methods:

  • Microsoft.SharePoint.Client.Taxonomy.TermStore.GetTerms(LabelMatchInformation labelMatchInformation)
    RestApi EndPoint: {SiteUrl}/_api/v2.1/termStore/searchTerm(label='{WordsToSearchFor}',languageTag='en-US')?$expand=set
    PnP JS has already implemented the searchTerm method (Link to PnP JS GitHub Report -> searchTerm docs)

  • Microsoft.SharePoint.Client.Taxonomy.TermStore.GetTermsById(Guid[] termIds)
    Get multiple Terms by Id without loading the FieldInfo to get the TermSet.Id to get the TermSet and then getting each Term by Id, ...
    I don't know wether there is any RestApi EndPoint to offer such a way to get multiple terms at once.

  • Also a way getting a term (GetTermById) without knowing the term group would be nice.

Is there a way to get these features in PnP Core SDK?

Btw do anyone know where the documentation of _api/v2.1/termStore clould be found?

@jansenbe
Copy link
Contributor Author

jansenbe commented Jun 23, 2022

@gszdev , thanks for the feedback, these indeed are useful extensions to have. We're using Microsoft Graph for taxonomy support , will need to check if this is possible using Graph. Using the v2.1 endpoint is not something we support today and (theoretically) this end point is the SharePoint proxy for Graph and one should prefer using Graph over v2.1 whenever possible.

For getting multiple terms in one go batching might be the solution, will investigate that as well.

Update: quick research showed that both requests are not possible today using Microsoft Graph. I'll check with the Graph team owning these features, plan B could be to wrap the CSOM endpoints (like we do for some other missing methods). I'll create a separate issue to track this request --> see #892

@gszdev
Copy link

gszdev commented Jun 23, 2022

Moving the TaxonomyExtensions.GetWssIdForTerm from PnP Framework to PnP Core SDK would also be helpfull.

Here's the link to the PnP Framework (CSOM) implementation:
TaxonomyExtensions.GetWssIdForTerm

I'm new to PnP Core SDK so I'm not able to create a pull request because I don't know where how to put the methods in (IWeb, ITermStore, ...).

Here's my code snipped (Extension Methods) for PnPCore SDK:
`

public static class SharePointIWebExtensions
{
	public static int GetWssIdForTerm(this IWeb web, ITerm term)
	{
		return GetWssIdForTermAsync(web, term.Id).GetAwaiter().GetResult();
	}

	public static int GetWssIdForTerm(this IWeb web, Guid termId)
	{
		return GetWssIdForTermAsync(web, termId.ToString()).GetAwaiter().GetResult();
	}

	public static int GetWssIdForTerm(this IWeb web, string termId)
	{
		return GetWssIdForTermAsync(web, termId).GetAwaiter().GetResult();
	}

	public static async Task<int> GetWssIdForTermAsync(this IWeb web, ITerm term)
	{
		return await GetWssIdForTermAsync(web, term.Id).ConfigureAwait(false);
	}

	public static async Task<int> GetWssIdForTermAsync(this IWeb web, Guid termId)
	{
		return await GetWssIdForTermAsync(web, termId.ToString()).ConfigureAwait(false);
	}

	public static async Task<int> GetWssIdForTermAsync(this IWeb web, string termId)
	{
		var site = web.PnPContext.Site;
		var taxonomyHiddenListServerRelativeUri = UrlUtility.Combine(site.ServerRelativeUrl, "Lists/TaxonomyHiddenList");

		var taxonomyHiddenList = await site.RootWeb.Lists.GetByServerRelativeUrlAsync(taxonomyHiddenListServerRelativeUri.ToString());

		var camlQuery = new CamlQueryOptions()
		{
			ViewXml = $@"<View><Query><Where><Eq><FieldRef Name='IdForTerm' /><Value Type='Text'>{termId}</Value></Eq></Where></Query></View>",
			DatesInUtc = true,
		};                        

		await taxonomyHiddenList.LoadItemsByCamlQueryAsync(camlQuery);
		var items = taxonomyHiddenList.Items.AsRequested();

		if (items.Any())
		{
			return items.First().Id;
		}
		else
		{
			return -1;
		}
	}
}

`

@gszdev

This comment was marked as resolved.

@jansenbe
Copy link
Contributor Author

Closing this issue as things have been implemented or a specific issue has been created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants