Add Custom Meta Data to a Team Site Programmatically - sharepoint

I have been asked to write a custom webpage in a web application integrated into a MOSS 2007 solution to allow users to create a teamsite using a custom template. No problem.
However, the user must have the ability to assign custom meta tags to the created team site to allow for specific searches, i.e. to assign country ("USA") and department ("Accounting") tags. Can anyone suggest a way of adding custom properties to the newly created team site via the SharePoint API?
Thanks, MagicAndi

There are 2 options:
You can use the Propertybag (SPWeb.Properties) of the SPWeb object of the new team site
You can add a list (invisble to users except admins) called "site tags" and add some items in there with key value pair fields i.e. item Country with value "USA" etc.

Related

Adding a Portal Category within SharePoint List

I'm wanting to add a new 'Portal Category' within a SharePoint List.
How would I be able to do that?
you can Create a Managed Metadata column for portal category then you can add it to your list from list settings check this reference of microsoft

Sharepoint Requirement Login?

I am setting up a SharePoint Online instance and I have some requirements that I do not know how to implement.
These are some of the requirements:
When a user logs into SharePoint, the user should select a country and city. Depending on the selected country and city, the corresponding site and subsites should appear.
Create folders that users cannot delete.
I don't know what is the process to create the first point and the option to disable in the second, if some of you know a tutorial or maybe knows how to do it, I would really appreciate it.
(1) One approach is modifying the welcome page through SharePoint Designer to contain HTML selectors for country and city. Based on the selected country and city, you can then redirect to the proper site using JavaScript.
(2) Creating folders that users can't delete requires custom .NET code. You can't run custom .NET code directly in SharePoint Online. Depending on your requirements, you need to create the folders using a console application or a custom app part. The console app or the app part can create the folders and remove permissions on the folders.

Custom column using MOSS Search Service

We are using out of the box MOSS search web service to retrieve meta data of the documents. We are able to retrieve the document name, document link, author, last modified person, last modified dates of the documents in SharePoint. There are some custom columns added in some document libraries in SharePoint. We would like to retrieve the data in the custom columns.
Can any one please let us know if its possible to retrieve the data from custom columns using MOSS search web service? Is there a configuration change required to be made in SharePoint?
Thanks.
Yes, you must do some additional setup if you want your custom columns to be crawled (you're talking about /_vti_bin/Search.asmx right?).
You will need to set up Managed Properties through your Shared Services provider in Central Admin.
Central Admin -> [your SSP] -> Search Administration -> Metadata properties
Then you'll create a new Managed Property.
Things to note:
A custom column won't show up to add as a managed property until an incremental crawl runs
After creating a new managed property, a full crawl is required to populate it with data

Changing the default page based on security group in SharePoint

We have a SharePoint site collection. In this site collection we have a home site and 6 other sites. Each of these sites belongs to a department in our company. Right now if you are a member of department A security group you would see homepage and your department site/tab when you navigate to the site. What they want me to do is to redirect the users directly to the department site/tab whenever they navigate to the site.
Is there any way to do this without coding or with coding?
With coding, you could write a very simple web control and include that on the home page. It would test which group a user belongs to and then redirect accordingly.
There are various ways to check if a user belongs to a group. One method is to get a reference to each SPGroup object and use SPGroup.ContainsCurrentUser.
You might also like to consider creating a custom list that maps SPGroup name against department URL, so you can manage behaviour of the control through the SharePoint UI.

Can SharePoint's Select People and Groups dialog box's Title and Department fields be customized with a custom membership provider?

I have created a custom membership provider for a SharePoint application but would like to populate the Title and Department columns for the MembershipUsers that are displayed with data from my user repository.
Is this possible? How can it be done?
I don't see anything in the System.Web.Security.MembershipUser class that could store this information. How does the Windows AD MembershipProvider have a different Display Name than the Account Name? Are some of these values coming from someplace else?
What happens in the AD is that, SharePoint runs the User Profile Sync Job that will pull all the required information from AD and updated the SharePoint UserProfile DB which In turn pushes to Each of the Site. Whereas in the case of the Custom Membership we don't have a direct option to update the Profile Information.
One method you can do is to update those information using code.There are two options you can update the User Profile information in the SSP so that it will be displayed in all the Site Collection or to Update the SPWeb.SiteUserInfo List. Please refer these link1 , link2 on how to do that. In case you want to update in SiteUserInfo list it is just another list just search for Item based on the user account name and update that item.

Resources