Showing posts with label SharePoint 2013 Apps. Show all posts
Showing posts with label SharePoint 2013 Apps. Show all posts

Thursday, 1 January 2015

How to use SharePoint apps in SharePoint 2013 team sites

In my previous post, we have seen how to create and deploy an app to developer site.

Now i want to use that app in any SharePoint site. This is really interesting because ultimately we have to use apps anywhere in our SharePoint site. In starting stage, I have struggled very hard to find solution for how to add an app to my site and how to show that app in my SharePoint pages and finally got it.

Below are the steps which i have followed.

1. Take out app which is in solution's bin folder and keep it anywhere or else you can keep it in same place.
 path is looks like <solution path>/bin/Debug/app.publish/<version number>/<appname>.app

2. I have create new web application and one root collection. Now i want to use the existing app in newly created site.



If you want to use any app in your web application then there should be on app catalog for the web application and app should be added to the app catalog then only the app will be available to all site collections/sites under the web application.

So, now we need to specify where we should upload/add our app.
All apps are to be upload to app catalog only.
For this we can create new app catalog or we can use existing app catalog to the newly create web application.

For now am going to create new app catalog for the newly created web application.

3. Go to Apps in Central administration --> Click on Manage App Catalog.


4. Choose correct web application from web application list and select "Create a new app catalog site" then click OK.


5. Then it will open create app catalog page, in this specify the below details

    Title - Title for catalog site
    Description - Description for catalog site
    Web Site Address - Specify URL name
    Specify primary site collection administrator name then
    Specify list of end users names


6. After successfully creation of app catalog site it will redirect to manage app catalog page.
    Here click view setting --> it will redirect to site setting then click site collection administrators.



   Now add user name to whom you want to add as site collection administrators.


7. Now go to app catalog site home page, there you can see the below options
 
    Apps for SharePoint
    Apps for Office
    App Requests

Click on Apps for SharePoint.


8. Click "New App" and then upload your app file (.app).





9. Once the app successfully uploaded, we need to add few details about app then click OK.


10. After successfully adding app to the list, it will looks as below screen.


11. Now you go to site contents --> click add an app.



12. It will open apps page and will show all OOB apps in SharePoint and on left hand side you can find the below two options under your apps.
   
     Apps you can add (default selected)
     From your organization


13. Click on "From your organization" then you can see list of apps available where have been uploaded in app catalog.


14. Select your app by click on app, once you selected any app it will pop up once window asking about trusting the app. Click on "Trust it" then it will create new app in your SharePoint site.



15. Now create a page or open existing page to add newly created app.Here i have created new page named as "GetListDetailsApp.aspx"


16. Open the page in edit mode and click on "App part" on ribbon. it will show all apps in the current SharePoint site. select your app and click OK.


17. Now save the page and it will looks as below.


18. As i told in the starting my app will show list of available list/libraries in the current site.
if you click on get details button, it will show all available list and libraries.


Saturday, 27 December 2014

How to get list of libraries and list from the host web in SharePoint hosted app

In my previous post, we have seen how to create SharePoint hosted app.

Now i want to show one more sample of SharePoint hosted app.

Here i want to display list of libraries/lists in the host web  using SharePoint hosted app.

1. Open visual studio --> Click on create project.
2. Select 'App for SharePoint' and give a name to the project.



3. In the new app for SharePoint wizard, specify where to deploy and select 'SharePoint-hosted' for type of host.


3. Go to pages --> right click on pages select add new item --> select 'Client Web Part(Host web)' and give a name to the page.



4. It will open Create Client Web part wizard, in that keep the default values and click Finish.



5. Now change client web part title and description.


6. Change the body tag as below.
7. Now go to App.js which is in Scripts folder and modify the code as below.



8. Add App.js script link to the page.

9. Now we need to provide access permission to the app to read list data. double click on AppManifest.xml --> go to permission tab --> give propermission and save.


10. Now deploy the solution. Right click on solution and select deploy.


11. After successfully deployment, give automatically asking for trust. click on ok and trust it.


12. Go to a page and add the app part to the page. Click on "Get Details" button, it will show list of available libraries and list in the host web.

  


Sunday, 26 October 2014

Configuring SharePoint 2013 app environment


For SharePoint 2013 we need one domain which you will use for apps in your environment.

You must configure a new name in Domain Name Services (DNS) to host the apps. To help improve security, the domain name should not be a subdomain of the domain that hosts the SharePoint sites.

Here am using existing domain in my machine and going to create alias name for the existing domain.

To create a forward lookup zone for the app domain name

1. Open DNS manager --> right click on Forward lookup zones --> click New Zone




2. In the new zone wizard, click on next

3. In the zone type page, select 'Primary zone' and click next.



4. In the Active Directory Zone Replication Scope page, select To all DNS servers in this domain and then click Next.



5. In the Zone Name page, in the Zone name box type the name for your new app domain name, and then click Next.



6. On the Dynamic Update page, select Do not allow dynamic updates and then click Next -> Finish.




To create a wildcard Alias(CNAME) record for the new domain name

8. Open DNS Manager --> under computer name expand Forward Lookup Zones --> Select newly created domain.

9. Right Click on the domain name and then click New Alias (CNAME).


10. In the New Resource Record dialog box, in the Alias name (uses parent domain if left blank) box, type *.

11. The Fully qualified domain name (FQDN) box displays *. followed by the domain name that you created for apps. 

12. Next to the Fully qualified domain name (FQDN) for target host box, type the FQDN of the server that hosts the SharePoint sites.



Click OK.

Create the App Management and Subscription Setting Service Applications:

You have to add two services which are required to Install and Configure Apps on SharePoint 2013.

1. App Management Service
2. Microsoft SharePoint foundation Subscription Settings Service

we have to check these two services are running or not, if not need to start these two services.
Go to Central Admin -> Click Manage Services on Server under System Settings.



Make sure that the status of App Management Service and Microsoft SharePoint Foundation Subscription Settings Service are listed as Started.

By default App Management Service started but not  Microsoft SharePoint Foundation Subscription Settings Service.



Now we need to start it, so click on start and wait for few minutes.

After that it will shows both the services status is started.



Once you came to know that App management and Subscription Settings services are running, you have to configure respective service applications.

Go to central admin -> click on Manage Service Application



Now check the two service applications are created or not.




App Management service application created by default so now we need to configure Microsoft SharePoint foundation subscription application.

we can not create application for SharePoint foundation subscription by using UI so we have to create this service using powershell only.



Now check new service application has been created.

Configure the Subscription Settings service application by using Windows PowerShell

Here the Powershell commands

$account = Get-SPManagedAccount "UKREDDY\administrator

$appPoolSubSvc = New-SPServiceApplicationPool -Name SettingsServiceAppPool -Account $account

$appSubSvc = New-SPSubscriptionSettingsServiceApplication –ApplicationPool $appPoolSubSvc –Name "Subscription Settings Service" –DatabaseName SubscriptionSettings_Service_DB

$serviceAppProxy = New-SPSubscriptionSettingsServiceApplicationProxy -ServiceApplication $appSubSvc



Now you can find the Subscription Settings service application in list of SharePoint application.


Configuring SharePoint to use App domain:

To configure the Apps for SharePoint. Go to Central admin and click on Apps.




Click on Configure Apps URL --> Enter app domain and what would be the prefix of apps in SharePoint --> OK.




we need to create an App catalog site collection to hold our Apps. When you add an App by uploading an App package, this is where you will do that.

To configure the App Catalog for SharePoint. Go to an Apps section in Central admin.

Click on Manage App Catalog --> select create a new app catalog site choice selected and hit OK.



 


Select web application --> Enter the Title, website address and primary site collection administrator details. It is similar like creation of site collection. Once it got created it will be redirected to "Manage App Catalog" section.




In "Manage App Catalog" section you can see newly created site and if you can click on that site it will open App catalog site.



That's it you have successfully configured the Apps for SharePoint 2013 environment.

In the next post, will see how to create SharePoint 2013 apps.