CustomAction ribbon tab buttons not enabled


I’ve written a Ribbon Tab Custom Action in my app web which is displayed on the Host Web. It’s persisted onto every page with a delegate control in a different solution.

The issue I have is that when I deploy my app and open my tab in the host web, none of the buttons are enabled. I assume this is because of an error in the CustomAction xml somewhere, but I cannot see it.

Any Help would be appreciated!

The tab has four buttons in total, one in a group on its own and three in another group.

    <?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

  <CustomAction
  Id="Ribbon.HelpTab.General"
  Location="CommandUI.Ribbon">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition
        Location="Ribbon.Tabs._children">
          <Tab
          Id="HelpTab.General"
          Title="Help!"
          Description="Help with using the IPL Hub">
            <Scaling Id="HelpTab.Scaling">
              <MaxSize
                Id="HelpTab.MaxSize.General"
                GroupId="HelpTab.Group.General"
                Size="OneLarge"
                Sequence="1"/>
              <MaxSize
                Id="HelpTab.MaxSize.Context"
                GroupId="HelpTab.Group.Contextual"
                Size="ThreeLarge"
                Sequence="2"/>
              <Scale
                Id="HelpTab.Scale.General"
                GroupId="HelpTab.Group.General"
                Size="OneLarge"
                Sequence="3"/>
              <Scale
                Id="HelpTab.Scale.Context"
                GroupId="HelpTab.Group.Contextual"
                Size="ThreeLarge"
                Sequence="4"/>
            </Scaling>
            <Groups Id="HelpTab.General.Groups">
              <Group
                Id="HelpTab.Group.General"
                Title="General Help"
                Template="HelpTab.Templates.One">
                <Controls Id="HelpTab.Group.General.Controls">
                  <Button Id="HelpTab.General.Button"
                 Sequence="15"
                 LabelText="General Help"
                 Command="Invoke_HelpButton"
                 Image32by32="/_layouts/images/placeholder32x32.png"
                 TemplateAlias="help1"
                 ToolTipTitle="Help Portal"
                 ToolTipDescription="Go to Help" />
                </Controls>
              </Group>
              <Group Id="HelpTab.Group.Contextual"
                     Title="This Page"
                     Template="HelpTab.Templates.Three">
                <Controls Id="HelpTab.Group.Contextual.Controls">
                  <Button Id="HelpTab.Contextual.Help"
                          Sequence="2"
                          LabelText="Help For This Page"
                          Command="Invoke_Contextual_Help"
                          Image32by32="/_layouts/images/placeholder32x32.png"
                          TemplateAlias="Contexthelp1"
                          ToolTipTitle="Help"
                          ToolTipDescription="Get help on this page"/>
                  <Button Id="HelpTab.Contextual.Policies"
                          Sequence="3"
                          LabelText="Policies for This Page"
                          Command="Invoke_Contextual_Policies"
                          Image32by32="/_layouts/images/placeholder32x32.png"
                          TemplateAlias="Contexthelp2"
                          ToolTipTitle="Policies"
                          ToolTipDescription="Policies to help guide what you are doing"/>
                  <Button Id="HelpTab.Contextual.Tutorials"
                          Sequence="4"
                          LabelText="Tutorials for This Page"
                          Command="Invoke_Contextual_Tutorials"
                          Image32by32="/_layouts/images/placeholder32x32.png"
                          TemplateAlias="Contexthelp3"
                          ToolTipTitle="Tutorials"
                          ToolTipDescription="Tutorials to help with what you are doing"/>
                </Controls>
              </Group>
            </Groups>
          </Tab>
        </CommandUIDefinition>
        <CommandUIDefinition Location="Ribbon.Templates._children">
          <GroupTemplate Id="HelpTab.Templates.One">
            <Layout Title="OneLarge">
              <Section Type="OneRow">
                <Row>
                  <ControlRef DisplayMode="Large" TemplateAlias="help1"/>
                </Row>
              </Section>
            </Layout>
          </GroupTemplate>
        </CommandUIDefinition>
        <CommandUIDefinition Location ="Ribbon.Templates._children">
          <GroupTemplate Id="HelpTab.Templates.Three">
            <Layout Title="ThreeLarge">
              <Section Type="OneRow">
                <Row>
                  <ControlRef DisplayMode="Large" TemplateAlias="Contexthelp1" />
                  <ControlRef DisplayMode="Large" TemplateAlias="Contexthelp2" />
                  <ControlRef DisplayMode="Large" TemplateAlias="Contexthelp3" />
                </Row>
              </Section>
            </Layout>
          </GroupTemplate>
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler Command="Invoke_HelpButton"
            CommandAction="~appWebUrl/Launcher.aspx?{StandardTokens}&amp;Source=RibbonGeneral" />
        <CommandUIHandler Command="Invoke_Contextual_Help"
            CommandAction="~appWebUrl/Launcher.aspx?{StandardTokens}&amp;Source=RibbonContextual&amp;ItemId=Help"/>
        <CommandUIHandler Command="Invoke_Contextual_Policies"
            CommandAction="~appWebUrl/Launcher.aspx?{StandardTokens}&amp;Source=RibbonContextual&amp;ItemId=Policies"/>
        <CommandUIHandler Command="Invoke_Contextual_Tutorials"
            CommandAction="~appWebUrl/Launcher.aspx?{StandardTokens}&amp;Source=RibbonContextual&amp;ItemId=Tutorials"/>
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
</Elements>

Localized list views in SharePoint-hosted Apps


I was trying to localize my SharePoint app and I encountered a bit of a problem. I created a feature resx file, added all the names to it and replaced my static names with $Resources:[MY_LOCALIZED_STRING]. And it works fine except for list views. SharePoint can’t resolve display names of all the views.

Has anyone encountered such a problem in the past? How to fix it?

How to test SharePoint app (SP-hosted) subscription license?


I’m creating SP-hosted app for SharePoint and wanted to know, can I test it with subscription test license.

In all information about SP licensing and testing is only available with choices “Trial”, “Free” and “Paid”. This subscription model came after all documentation and “test” scenarios.

Link to msdn – about importing test licences – but there is nothing about subscription tests.

Link to msdn – about subscription – info about what to do with subscription values.

Does Microsoft have any test scenario to test it?

I would be grateful for this very valuable information

Why does my Sharepoint app modal dialog gets access denied error when using razor, but works fine when I use an aspx page


I am attempting to open the iframe in my sharepoint provider hosted app as a modal using a MVC razor view. When I open the app I get a 0×80070005 – JavaScript runtime error: Access is denied. in sp.ui.dialog.js and my js scripts are never loaded but the html displays in the modal. When I use the same code with the HostWebDialog set to false so it opens its own page, everything loads correctly. It also loads correctly as a modal if I put my view into an aspx page instead a razor view.

I have looked at

http://stackoverflow.com/questions/1886547/access-is-denied-javascript-error-when-trying-to-access-the-document-object-of

and

http://blogs.msdn.com/b/officeapps/archive/2012/11/29/solving-cross-domain-problems-in-apps-for-sharepoint.aspx

which seemed to be my issue at first, but debugging my code is showing that the access denied error is occurring when the modal is called and before any of my code is run.

If anyone has an idea as to why this is failing in razor but not in the aspx page, I would appreciate it.

Edit: This is happening when its run in IE10 which is a requirement. When I run the app in chrome I do not get the access denied error, but my scripts still do not load

How to encapsulate code in SharePoint 2010 and make it accessible across multiple solutions


Anyone know the best way to reference a class to be used for any/all all solutions (web parts, application pages, timer jobs, etc)?

I have several small modules of code that I’ve copied to multiple solutions that I’d prefer to maintain in one solution that can be called from other solutions.

I don’t know the best way to do this or if it’s even possible.

Any ideas?

Host SharePoint provider-hosted apps on SharePoint farm's WFE servers


I have a SharePoint 2013 farm deployed in my company (5 WFEs). I’d like to build SharePoint provider-hosted apps for that farm. In order to do that I need to have another Windows farm (which I’m not going to get) to host those provider-hosted apps.
My idea is to host SharePoint provider-hosted apps on the existing WFEs (to overcome this situation).

What possible drawbacks could you imagine if I followed that idea?

SharePoint 2013 upload(and resize) image with REST api problem


I am trying to create an SP2013 APP, the user should be able to upload an image to a SharePoint list. The image needs to be resized before it is being uploaded.
I got the upload function to upload the original image but when i am trying to upload the resized image the image is corrupt(broken).

I have been using AngularJS directive for this task:
http://angular-js.in/image-upload/

Here is an image of my object:
enter image description here

The first red marked “dataURL” is the original image dataURL and when i send it with REST to my list it works just fine, but as the original size.
The second red marked “dataURL” is the resized object, it works fine to put the dataURL into a tag and it shows the correct resized image but when i try to send that dataURL with REST to my list the image is broken(corrupt).
I know it has to do with the dataURL not being binary code, i have tried to convert it but no luck.
How can i send the resized image to my sharepoint list?

Here is my Perform Upload function:

function PerformUpload(imageResult) {
        console.log(imageResult); //The console.log result is seen in the uploaded picture above.
        var url;
        var libraryName = "ProfilePics";
        var fileName = imageResult.file.name;
        var folderName = "";
        var fileData = imageResult.resized.dataURL;

        // if there is no folder name then just upload to the root folder
        if (folderName == "") {
            url = appweburl + "/_api/SP.AppContextSite(@TargetSite)/web/lists/getByTitle(@TargetLibrary)/RootFolder/Files/add(url=@TargetFileName,overwrite='true')?" +
                "@TargetSite='" + hostweburl + "'" +
                "&@TargetLibrary='" + libraryName + "'" +
                "&@TargetFileName='" + fileName + "'";
        }
        else {
            // if there is a folder name then upload into this folder
            url = appweburl + "/_api/SP.AppContextSite(@TargetSite)/web/lists/getByTitle(@TargetLibrary)/RootFolder/folders(@TargetFolderName)/files/add(url=@TargetFileName,overwrite='true')?" +
               "@TargetSite='" + hostweburl + "'" +
               "&@TargetLibrary='" + libraryName + "'" +
               "&@TargetFolderName='" + folderName + "'" +
               "&@TargetFileName='" + fileName + "'";
        }

        // use the request executor to perform the upload
        var reqExecutor = new SP.RequestExecutor(appweburl);
        reqExecutor.executeAsync({
            url: url,
            method: "POST",
            headers: {
                "Accept": "application/json; odata=verbose",
                "X-RequestDigest": digest
            },
            contentType: "application/json;odata=verbose",
            binaryStringRequestBody: true,
            body: fileData,
            success: function (x, y, z) {
                alert("Success!");
            },
            error: function (x, y, z) {
                alert("Error!");
            }
        });
    }

Provider Hosted App in VM


Is it possible to run a provider hosted app from a vm on the same server as Sharepoint? And if so should i do it or is there a better way?
Thanks

SharePoint Apps – Multilingual metadata in catalog


I would like to add an SharePoint App I developed onto my own Office 365 tenant.

When uploading the .app file into the App Catalog, I can fill some metadata (Short description, Long description, …).

But I want to set some different values of these fields depending on the language. I would like to have a description different in English and in French.

I cannot figure how to do it. There are 2 fields “Metadata language” and “Default metadata language” but I don’t understand how they work.
Could anyone help me?

Thanks in advance.

Provider hosted app : throw error 403 on creating clientcontext to other site


I have created a provider hosted app, in which the app reads a list which is in other site . But I am getting Error 403 when I’m trying to create a ClientContext object of this site.

So if I have context of http://server/sites/site1 and I want to access a list in other site with url http://server/sites/site2. Is this operation possible in CSOM?

I already have the context of the site in which the app is running.

 ClientContext siteContext = new ClientContext("http://some_url");

Please let me know what am I missing.

UPDATE

Error message:

Access denied. You do not have permission to perform this action or
access this resource

Question and Answer is proudly powered by WordPress.
Theme "The Fundamentals of Graphic Design" by Arjuna
Icons by FamFamFam