Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all 25064 articles
Browse latest View live

Powershell and page editing

$
0
0

I am looking for a way to edit the content of a wiki page using powershell.

I have been able to successfully replace the _entire_ aspx page with different content, but that looses all the goodness that SharePoint provides.

Essentially I am getting content from an html file and I need to load it into a blank sharepoint wiki page.  I can create the page, just need to find a way to load the content in.

Could anyone assist?

SharePoint 2013


ReplaceContent attribure is not declared

$
0
0

Hi,

I have create Package using Design Manager on one machine and then have tried to deploy it on another server. I got the error related to the Replace Content attribute, that it is not declared. Why?

I have imported this package to the Visual Studio, have removed everywhere this attribute and it started to work.

Open .rdlx file from local desktop

$
0
0

Hi,

  I have created Power View report in share point and downloaded a copy onto my local desktop 

While trying to open .rdlx file from desktop, It was saying there is no support file to open .rdlx files in my system, Can you please let me know Is there any workaround procedure to open .rdlx file from local system.

Thank You,

Grace

VS2012 Error

$
0
0

Hi All,

I am trying to create App for SP2013 using VS2012. I am able to create and deploy a simple app "Hello World". But, in visual studio in solution explorer it shows some error. Pls let me know the reason and what to do to resolve it.

Thanks.

SharePoint authentication from Siteminder authenticated portal

$
0
0

Hello Techies,

We have intranet portal which is authentication using Siteminder against AD. There is search textbox and submit button on portal. Upon entering search terms and clicking on Submit button, we want to redirect users to SharePoint searchresults page with k=searchterms.

The major hurdle is, SharePoint is AD authenticated so when users are redirected we don't want to show them AD authentication popup again as they are already authenticated by Siteminder.

Is there any way we can pass-in User context from portal to SharePoint so that SharePoint does not ask for authentication again?

Thanks,

SF...

Sharepoint 2013 search display template hover panel

$
0
0

I have a  task in which I have to customize the  search display template for webpage ,am  which I did successfully  by copying webpage template and modifying it .by the way I am using search result webpart but the hover panel of the modified template is not showing the snapshot of the webpage , can you tell me what might be the issue because I have just modified this

<divid="_#= $htmlEncode(itemId) =#_"name="Item"data-displaytemplate="WebPageItem"class="ms-srch-item"onmouseover="_#= ctx.currentItem_ShowHoverPanelCallback =#_"onmouseout="_#= ctx.currentItem_HideHoverPanelCallback =#_">
                _#=ctx.RenderBody(ctx)=#_   <divid="_#= $htmlEncode(hoverId) =#_"class="ms-srch-hover-outerContainer"></div></div>

by this

<table><tr><td><ahref="_#=ctx.CurrentItem.Path=#_">   _#=ctx.CurrentItem.NewsTitleOWSTEXT=#_   </a></td></tr><tr><td>
              _#=ctx.CurrentItem.NewsDescriptionOWSMTXT=#_   </td></tr><tr><td>
           PublishingTime -_#=ctx.CurrentItem.NewsPublishingDateDatatype=#_  </td></tr></table><divid="_#= $htmlEncode(hoverId) =#_"class="ms-srch-hover-outerContainer"></div></div>

what do I have to do to make the hover panel display the snapshot of webpage , or  you could refer me to article that talks about this thing !!!!!


Why html display templates are reflecting the changes made?

$
0
0

I created a search display template for a specific set of results and uploaded the same in the display templates library. On upload SharePoint created the corresponding java script action file. 

The next day when I tried to edit some thing in the html file its not at all reflecting. But when i close and open the file again the change i made are saved properly.

To test the same i again uploaded a new template html file to the library. This time it did not even create the java script action file. 

What could be the issue? 

I have another question, when wrote a query rule to change the display template for a specific set of results, the display template is not at all showing the managed properties which i am trying to display in the html file. But the same properties are coming when i change the setting of Search result webpart to use singe template under display template settings? 

Can anyone tell me why this behaving like this?  

SearchBoxEx Auto Suggestion either from DB or web service

$
0
0

We need to include auto suggestion in SearchBoxEx control. we already have Suggestion values in data base and it will dynamically added by end user. Which we need to include in the auto suggestion.

Anyone have idea for this.


create and deloy Site templates in Sharepoint 2013

$
0
0

HI to all,

i new to sharepoint, and searching many articles to find an answer to my question and just get more confused.

My objective is to create a new site template from an already created site with publishing feature activated, i found out that the option "save as site template" is disabled because of the publishing feature, but i also read in an article that it is possible to save it as a template using powershell and i'm using this script

$Web=Get-SPWeb http://intradev.ge.pt/sites/gqual/process/TemplateProcess

$Web.SaveAsTemplate("SiteTemplateProcess","Title","Description",1)

1.Question

since method return void i dont know whether template was created or not, where can i find the created template?

2.Question the template which i want to create is to be used in an automatic deployment process, i mean, some user clicks a button which will run a ps script to deplyo a new sub site created from the site template previously mentioned. Is this the correct approach?

Please give me your feedbacks with the best approach for this objective!

Thank you!

Publishing Template - Variations

$
0
0
I created an authoring site in English and 2 target sites for 2 other languages. When I make any changes to the pages on the English site, it is carried over to the target sites. However, the list that I've created on authoring site is not sent to the target sites. Isn't that the way it should work? Please through some light on this. Thanks.

-- VT

How do you integrate a control driven Excel app using Sharepoint Excel Services seamlessly?

$
0
0

I'm trying to externalize slider controls into JavaScript so that I can parameterize an Excel app that I created.  So when the user operates the controls in one iframe that the SharePoint Excel app updates in real-time, so that its seamless with no refresh delays.  Does any have sample code to accomplish this?  Thank you in advanced.

How to set up a sharepoint dev environment?

$
0
0

I have Windows 7 Professional.

How do I set up a share point development environment?  It seems that the requirement is pretty demanding: server versions of Windows such as Win server 2008, and share point server, neither is cheap to obtain.

So, to get my hands dirty with share point development, what's the most frugal and efficient way to do?

Thank you!

SPFile Author and ModifiedBy not set when calling SPFileCollection.Add(String, Byte[], SPUser, SPUser, DateTime, DateTime) with elevated privileges. Why? Work-around?

$
0
0

I am attempting to create a new document in an ItemCheckingOut event receiver, replacing the existing stub document with a new document containing current content downloaded from an external system.  I need to preserve the document author and editor from the original document.  The document is created successfully, and running with elevated privileges allows the creation and modification dates to be set. 

By sandwiching the SPFileCollection.Add call between logging statements, I can see the passed parameters and the result.

Restoring file: folder.Files.Add(Shared Documents/Off2010 Excel2.xlsx, [], "i:0#.w|vdcqa\cbrown", "i:0#.w|vdcqa\dgreenland", 02/28/2013 13:33:19, 02/28/2013 13:35:03)

Restored file: SPFile.TimeCreated='02/28/2013 05:33:19', SPFile.Author='SHAREPOINT\system', SPFile.TimeLastModified='02/28/2013 05:35:03', SPFile.ModifiedBy='SHAREPOINT\system'

The TimeCreated and TimeLastModified properties are set to the expected values, but the Author and ModifiedBy are not set.  This works in SP2010 so I suspect the issue may be related to the claims based authentication as the SPUser objects passed as input have claims based authentication prefixes, but I don't see how to pass the SPUser properties in a way that will work in this case.

public override void ItemCheckingOut(SPItemEventProperties properties)
{
	SPListItem item = properties.ListItem;
	string fileName = GetFileNameFromLinkName(item.Name);
	byte[] data = GetFileContents(item);
	SPSecurity.RunWithElevatedPrivileges(delegate()
	{
		using (SPSite elevatedSite = new SPSite(properties.WebUrl))
		{
			elevatedSite.AllowUnsafeUpdates = true;
			using (SPWeb elevatedWeb = elevatedSite.OpenWeb())
			{
				elevatedWeb.AllowUnsafeUpdates = true;
				SPListItem linkItem = elevatedWeb.Lists[properties.ListId].GetItemById(properties.ListItem.ID);
				try
				{
					fileName = GetUniqueFileName(fileName, linkItem.Url, elevatedWeb);
					SPFolder folder = linkItem.File.ParentFolder;
					DateTime timeCreated = Convert.ToDateTime(linkItem["Created"]); }
					DateTime timeLastModified = Convert.ToDateTime(linkItem["Modified"]); }
					SPUser createdBy = null;
					object authorPropVal = linkItem["Author"];
					if (authorPropVal != null)
					{
						SPFieldUserValue uv = new SPFieldUserValue(elevatedWeb, authorPropVal.ToString());
						if (uv != null)
							createdBy = uv.User;
					}
					SPUser modifiedBy = null;
					object editorPropVal = linkItem["Editor"];
					if (editorPropVal != null)
					{
						SPFieldUserValue uv = new SPFieldUserValue(elevatedWeb, editorPropVal.ToString());
						if (uv != null)
							modifiedBy = uv.User;
					}
					Log.Trace("Restoring file: folder.Files.Add({0}/{1}, [], \"{2}\", \"{3}\", {4}, {5}",
						folder.Url, fileName, createdBy, modifiedBy, timeCreated, timeLastModified);
					SPFile newItem = folder.Files.Add(
						folder.Url + "/" + fileName,
						data,
						createdBy,
						modifiedBy,
						timeCreated,
						timeLastModified);
					SPTimeZone timeZone = elevatedWeb.RegionalSettings.TimeZone;
					Log.Trace("Restored file: SPFile.TimeCreated='{0}', SPFile.Author='{1}', SPFile.TimeLastModified='{2}', SPFile.ModifiedBy='{3}'",
						timeZone.UTCToLocalTime(newItem.TimeCreated),
						newItem.Author,
						timeZone.UTCToLocalTime(newItem.TimeLastModified),
						newItem.ModifiedBy);
				}
				catch (Exception ex)
				{
					Log.Error(ex, "Failure creating content item for file: {0}", fileName);
					throw;
				}
			}
		}
	});
}

Can anyone help me understand what is going on and suggest a way to fix it?


Dave M

how to target apps for specific site collections

$
0
0

is there a way to make only specific site collections to be able to add my app?

Scenario is : I have created a app and want only few site collection is allowed to add? App should not be seen by all site collection. 

Access Web App Link To SharePoint User List

$
0
0
I'm trying to build a 2013 Access web application that uses the SharePoint 2013 user list as a lookup.  The SharePoint user list doesn't show up when linking to the SharePoint sites lists through add table and it doesn't work to link to /_catalogs/users/.  This is relatively simple to do with SharePoint lists but I havent been able to find any way to do it within an Access web application table.

Sharepoint 2013 one workflow call another

$
0
0
In sharepoint 2013 is there any new feature that will allow one sharepoint 2013 workflow call another sharepoint 2013 workflow.

One webapp interacts with multiple identity providers(ip-sts) without adfs

$
0
0
Hello, Is it possible to use one webapp (w more site collection each its has own host name) multiple ip-sts without ADFS? I would like to give access to four external partners with federated auth. I'd like to install a custom ip-sts locally to authenticate a local user and send the token with claims to the sp rp-sts. (Short version) Thx, Istvan

SharePoint Hosted App request remote service with Basic Authentication

Addition of user to sharepoint group using rest API

$
0
0

How to add a user to a SharePoint group using rest API .I tried the following code but it didnt work .

Exception: 404 Bad request.Please help.

 string listPostBody = "{'__metadata':{'type':'SP.User'}}";
                byte[] listPostData = System.Text.Encoding.ASCII.GetBytes(listPostBody);
                string formDigest = ReturnFormDigest(url);
                HttpWebRequest listRequest = (HttpWebRequest)HttpWebRequest.Create(url + "/_api/Web/SiteGroups(35)/users/adduser('i:0#.w|domain\\jacana')");
                listRequest.Method = "POST";
                listRequest.ContentLength = listPostBody.Length;
                listRequest.ContentType = "application/json;odata=verbose";
                listRequest.Accept = "application/json;odata=verbose";
                listRequest.Credentials= CredentialCache.DefaultCredentials;
                listRequest.Headers.Add("X-RequestDigest", formDigest);
                Stream listRequestStream = listRequest.GetRequestStream();
                listRequestStream.Write(listPostData, 0, listPostData.Length);
                listRequestStream.Close();
                HttpWebResponse listResponse = (HttpWebResponse)listRequest.GetResponse();

can v add user to sharepoint group using rest api?

$
0
0
Is it possible to add user to sharepoint group using rest api?
Viewing all 25064 articles
Browse latest View live