I have a custom infopath workflow which allows users to submit expesne reports. Whenever someone submits an expense report in the Forms Library the workflow is initiated. The workflow checks the weburl and using a generic method creates a link to point to the workflow item and sends this link in a mail to the submitter and approvers.
Now what i want to achieve is that i need a way to point to the workflow item using a public url so even if the user is submitting a request from intranet or internet the link will be pointing to the internet url and hence the users can open items from their mailbox using internet url when the intranet is not available.
So i guess in short i need a way to get the public url for a site. Also keeping in mind that site may be extended for internet with some security settings in place. What would be the easiest and most efficient way to do this.
Relative path of you Page or the Link will be same irrespective of the Zone from which the user access the Site. All you need to change in the URL is the host name part.
You can get the URL for any Zone with the Following code
SPContext.Current.Site.WebApplication.GetResponseUri(Microsoft.SharePoint.Administration.SPUrlZone.Default).AbsoluteUri
You can make sure you always get URLs from a specific zone by creating a new SPSite object and specifying the zone for it in the constructor. In your case you could try with the Default zone (SharePoint uses URLs from this zone when sending emails for example) or the Internet zone. You have a small sample below:
using(SPSite site = new SPSite(currentSiteId, SPUrlZone.Default)
{
string publicUrl = site.MakeFullUrl(serverRelativeUrl);
// note that MakeFullUrl takes a server relative url not a site relative one
}
If I understand what you are attempting, you want an internet accessible method to access a SharePoint workflow object. Correct me if I am wrong.
Here is what I would do: I would set up a simple website w/ DNS that has a single page that exposes the workflow object. That way, you can just use this site as the base for the link in the notification.
Example: I have an HTML forms engine that I wrote a while back. A customer just requested that it be accessible on the internet as well. I created a new site in IIS, reverse proxied the IP address, and voila, my intranet application is exposed to the internet. Of course, there are security issues and small intranet caviats that had to be taken care of, but nothing too major.
Hope that helps.
Related
In my company we have some internal applications what we would like to link to in the cloud.
Do I just need to add an Embed web part in SPO and then add an iframe to a https of the local application (that can only be acccessed on our network) ?
Thanks
P
I believe this is what you need:
https://learn.microsoft.com/en-us/sharepoint/administration/configure-alternate-access-mappings
Each web application can be associated with a collection of mappings between internal and public URLs. Both internal and public URLs consist of the protocol and domain portions of the full URL (for example, https://www.fabrikam.com). A public URL is what users type to access the SharePoint site, and that URL is what appears in the links on the pages. Internal URLs are in the URL requests that are sent to the SharePoint site. Many internal URLs can be associated with a single public URL in multi-server farms (for example, when a load balancer routes requests to specific IP addresses to various servers in the load-balancing cluster).
Each web application supports five collections of mappings per URL. The five collections correspond to five zones (default, intranet, extranet, Internet, and custom). When the web application receives a request for an internal URL in a particular zone, links on the pages returned to the user have the public URL for that zone. For more information, see Plan alternate access mappings for SharePoint 2013.
Add an internal URL
On the Alternate Access Mappings page, click Add Internal URLs.
If the mapping collection that you want to change is not specified, then choose one. In the Alternate Access Mapping Collection section, on the Alternate Access Mapping Collection menu, click Change alternate access mapping collection.
On the Select an Alternate Access Mapping Collection page, click a mapping collection.
In the Add internal URL section, in the URL protocol, host and port box, type the new internal URL (for example, https://www.fabrikam.com).
In the Zone list, click the zone for the internal URL.
Click Save.
We are working on solution, that via injected javascript on Sharepoint Online site uses Outlook (O365)
REST API (client side) and injects entries to the calendar on Sharepoint subsite.
For that purpose, application on https://apps.dev.microsoft.com has been registered.
Overall, it’s working quite well, however, there is problem about Redirect URIs on the application itself.
As site collection contains many subsites with their own calendars, to make it work, we supposed to add
redirect URIs for all of the particular calendars, what may be difficult, as new sites will be created during site collection lifespan.
So basically what we would like to achieve, is to add for example “allowed domain” in the application,
that will allow redirections for the all of the subsites as well.
Is this even possible?
What is best practice?
Regards,
Pawel
Just redirect to a page in your app with all links you would like to include.
Also, keep in mind, using the api will apply security so the user will be able to see only authorized calendar for his identity, so you don't need to include static link that a user may not have access to.
Hope this helps.
I am creating a site collection by calling a built-in SharePoint web service.
http://Server_Name/_vti_adm/admin.asmx
This web service has a method called CreateSite which allows users to create a site collection. Pretty straight forward (method documentation).
It creates a site with a URL such as:
http://Server_Name/sites/SiteCollection_Name
I would like to create a site collection where the Name of the Site comes first, such as:
http://SiteCollection_Name/Server_Name
I remember there is a property called UseHostHeaderAsSiteName
I can't see an option to use this property with CreateSite method. How do we use this property or any method to create a site that will give the URL such as:
http://SiteCollection_Name/Server_Name
What you describe - http://SiteCollection_Name/Server_Name - is not possible by the SP API. The URL format is protocol://server:port/path. The site collection can occur only in the path.
If you need different hostnames - the server part - you'd have to register them in the DNS mapped to your SP server IP address and then set up alternative access URLs in your SP web application so that they are accepted by SP. (SP is picky if you do not use the same hostname in the URL which it was installed with...)
I have Sharepoint 2010 hosted with windows authentication . I have created a document library inside a new site and uploaded few files.
Now,I'm trying to utilize the info of these files in some application using Rest Webservice exposed by sharepoint.
*http://{server_name}/{site}/_vti_bin/ListData.svc/{Document_Library_name}*
In the response I get xml containing details of files uploaded in document library. One of the tag in response of xml (inside src attribute of tag) contains detail of url of file uploaded,
Now when I try to use this url for document display/download in my application/browser, it pops up with the window authentication which I have for Sharepoint site . After I provide correct user/password the document gets downloaded.
Is it somehow possible to make this document url public(I don't want window authentication pop up) ? At the same time I don't want to disable the Windows authentication for Sharepoint site .
Thanks in advance
By public do you mean accessible within your LAN or accessible from the internet given the sharepoint site is bound to an internet facing interface? I would imagine on the LAN it would be best to simply use the guest account for users who you wanted to give 'public' access to.
Bear in mind the only reason you're prompted for login details is probably because you're not using Internet Explorer.
I have an Info-path task form in a custom SharePoint workflow that I have made.
The custom task form says to the user you have a task you need to complete here is a link to the document that you need to fill out in order to complete the task.
However the client's server has an alternative access mapping.
I pass the generated workflow URL to the task form of the document in the item-metadata.xml however this does not take into account the alternate access mapping and therefore the link is the wrong URL on the client's machine.
How do I manage to generate a URL on the server that takes into account the access mapping?
From the AAM page which URL is the workflow using, Default?
If so what about swapping around the AAM so the one you want to use is listed as Default?