Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Deploy XML in sharepoint

  Asked By: Sade    Date: Dec 31    Category: Sharepoint    Views: 1593

I am using an XML file to store my literal Alert messages such as ("Record saved
seccessfully", "Error occured in the page" ... etc) and when exception occurred
in my code in webpart, then I am reading the proper message from the xml file
and display it in the page.

I want to know where should I deploy that XML file so that I can read it in my
webpart, and also if there some securtiy issue/configuration that I need to do.



6 Answers Found

Answer #1    Answered By: Gina Freeman     Answered On: Dec 31

Actually, a better way to do this would be to create a Resource file, containing
a string table, and use that for storing your Alert messages. Resource files
are normally stored in the Resources directory of the 12 hive. This also
provides you an opportunity to localize your messages  by plugging into the
built-in localization capabilities of SharePoint.

If you still want to user your own XML files then I would put them in a
subdirectory under the Layouts directory of the 12 hive.

Answer #2    Answered By: Tyrell Nash     Answered On: Dec 31

So you are suggesting to create a resource file  and there I can put all my
messages. Thats really great solution.

But I think you are meaning Global resource file right ?

So I think I do not need to check the current page  culture because the
sharepoint will do this for me, right ?

But How can I read  that global resource file from my class library project?
because I am using the N-tire architecture.

Answer #3    Answered By: Silvia Wilkinson     Answered On: Dec 31

If you create a standard .resx file  using Visual Studio and deploy  it to the
Resources directory of the 12 hive using a WSP you can access any value using
the following line of code  where Keyword is the keyword in the string table and
ResourceFile is the base name of the .resx file.

SPUtility.GetLocalizedString("$Resources:Keyword", "ResourceFile",

If you have loaded language packs you can create localized copies of your .resx
file using the file naming syntax of ResourceFile.en-US.resx where en-US is
replaced with the appropriate locale code. SPUtility will automatically access
the correct localized file because you are passing the Language of the current
web where the web part is as part of the method. You should deploy a default
file with no locale code and one for each locale for which you have loaded a
language pack.

Answer #4    Answered By: Candy Walter     Answered On: Dec 31

I have followed up all your steps and I read  string from my localresource file,
so thank you.

now my question is, I want to make a localized Sharpoint website (English &
i tried to deploye an arabic resource file, and my sharepoint  page did not read
it, and the LCID give mes this number 1033 which is Enlgish lanugage?

So what configuration should I do to make my MOSS to be mulitligual ?

Answer #5    Answered By: Leanne Rios     Answered On: Dec 31

Out of the Box sharepoint  only supports sites in one language. To support other
languages (or other language resource files) you need to load a language pack
for the other languages you want to support. After you load the language pack
for Arabic you will be prompted when you create a site whether you want it in
English or Arabic. At that point if you pick Arabic you will be able to access
resource files from that site using an arabic language code. SharePoint doesn't
support individual sites in multiple languages.

The normal way to support multiple languages is to use a SharePoint publishing
feature called Variations. Variations allows you to specify a variation root
site. Any sites built below that root will be duplicated in the other languages
that you choose to support. You will need to translate the content on the
parallel sites manually however. When a user browses to a site they will be
taken to the site that matches the locale setting of their browser. You can
read more about variations here:


Answer #6    Answered By: Zachary Roberts     Answered On: Dec 31

I find that the forms library is the best place.

Didn't find what you were looking for? Find more on Deploy XML in sharepoint Or get search suggestion and latest updates.