Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

Accessing Portal Area Document Library programmatically from a WSS

  Asked By: Prince Joyce         Date: Jun 10, 2005      Category: Sharepoint      Views: 492
 

I have a series of related WSS sites, and I have a document library
containing documents that are related to each of the WSS sites. The
document library is stored in a portal area.

I would like to add a web part to each of those sites that displays the
contents of the document library.

Can someone tell me how I can programmatically access the contents of a
portal area document library from a WSS site?

Basically, I know that I need to access the Area object, and from there,
I can create a SPQuery. And I know it is something like the following
code snippet. Except that if I am in a WSS site, than I do not have the
PortalContext.Current available.

Area area = AreaManager.GetArea(PortalContext.Current, new
Guid(AreaID));
list = area.Web.Lists[ListID];
SPQuery query = new SPQuery();

Tagged:                

 

8 Answers Found

 
Answer #1       Answered By: Dakota Shaffer          Answered On: Jun 10, 2005       

Have you considered using a data view web  part with the data source being the doc lib?

 
Answer #2       Answered By: Ted Gilmore          Answered On: Jun 10, 2005       

How would I go about doing that? My understanding of the Data View Web Part is that it requires opening the site  page in Front Page. If I do that, then doesn’t my page become unghosted, which I understand is a no-no?

 
Answer #3       Answered By: Monte Cooley          Answered On: Jun 10, 2005       

Yes, you need to use FP to add  the web  part.

I wouldn't classify unghosted pages as a no-no. While ghosted pages are preferred over unghosted, I would say that unghosted pages that meet the requirements are better than ghosted pages that do not.

 
Answer #4       Answered By: Guadalupe Bullock          Answered On: Jun 10, 2005       

Fair enough. I’ll keep this option on the back burner then. I’m interested in hearing options from the rest of the list  as well.

 
Answer #5       Answered By: Nathanial Mcclure          Answered On: Jun 10, 2005       

I'm interested in hearing options from the rest of the list  as well.

That's a good idea! I'll bet there are many different solutions.

 
Answer #6       Answered By: Matt Prince          Answered On: Jun 10, 2005       

I have a follow-up to yesterday’s question. I stumbled on a web  part from a company called Omnisys – http://www.omnisys.co.il/ that basically does what I am looking for. I am waiting for some feedback from them on configuration options, but in case anyone else comes across this same question, their Document Library Viewer web part  is worth a look.

 
Answer #7       Answered By: Brooks Bond          Answered On: Jun 10, 2005       

Why not create  a DVWP for the libraries you want to view?

 
Answer #8       Answered By: Gregg Wilkinson          Answered On: Jun 10, 2005       

You can still create  a DVWP through editing a temporary page through FrontPage. You can then export the finished webpart, and import it into a ghosted page. This way you can still use the GREAT DVWP, and not unghost your page.

 


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].