Symantec Management Platform (SMP) Community

 View Only
  • 1.  Dynamically detect webparts contained in Portal view.

    Posted Sep 22, 2010 10:19 AM

    Can one detect at run time the web parts that are contained inside a portal page? Due to some of the webparts that are in our integration outside communication with a separate web server is needed to render the content.



  • 2.  RE: Dynamically detect webparts contained in Portal view.

    Posted Sep 29, 2010 06:14 PM

    I found the following article that sounds similar to what you are doing.

    https://www-secure.symantec.com/connect/forums/portal-page-dynamically-navigate

    Can you use this information?



  • 3.  RE: Dynamically detect webparts contained in Portal view.

    Posted Sep 29, 2010 09:32 PM

    I asked the original question, but this is a bit different as the portal page is create via the configuration. If there are examples where the portal is create in code would like to see that.

     

    Here is the scenario that we are faced with, there are external pages as webparts these parts would display the same information if the user was in a particular group and something completely different if in another group. What the portal would like to do is determine if the user was in the group and then decide if to display the webpart. 



  • 4.  RE: Dynamically detect webparts contained in Portal view.

    Posted Sep 30, 2010 11:03 AM

    A quick thought.  Could you modify the webparts to point to a custom solution aspx, this custom webpart would be able to get the users rights and show the page, or not show the page.

    This idea might take some more research, as I am not sure if you could resize the webpart size or hide if if inside the webpart it detected it should not be used.

    Hope this at leasts gives someone an idea they can expand on.



  • 5.  RE: Dynamically detect webparts contained in Portal view.

    Posted Oct 06, 2010 10:51 AM

    I apologize for the time it's taking on this one. I am enlisting some additional help from our core dev group. Hopefully I will have something for you in the next day or two.



  • 6.  RE: Dynamically detect webparts contained in Portal view.

    Posted Oct 07, 2010 12:42 PM

    There are a couple options to handling this.

    ---

    You could access the web parts in the portal, they are all part of the portal XML, detect the user and modify the XML file accordingly. But modifying it this way would make the changes for all instances of the portal and not just one so you would have to maintain a copy of the complete XML page then modify it each time a user logs in. I don't believe that this is the approach you want to take.

    ---

    You could create your own .aspx page and add those web portals to your own custom control. Again you would have to detect which user logs in then build the portal page for that user. I believe that isn't really a good option either.

    ---

    I believe the better, and easier, approach is to use the security model already in place.

    1. Create a Security Role for those each of those web parts that you want displayed, or not, depending upon the logged in user.

    2. Create the web part as you normally would.

    3. After created you can right click on the web part and open the Security page for that web part.

    4. In the drop down list you will see the Security Role you created in step 1 and you can then assign that web part to that Security Role.

    5. For each individual web part you can add those user to that particular Security Role, it isn't a problem for a user to be in more than one Security Role.

    Then when that user logs into the console, the Security Role will be applied and the web part will be displayed or hidden depending on whether the user has been added to that Security Role.



  • 7.  RE: Dynamically detect webparts contained in Portal view.

    Posted Oct 07, 2010 01:19 PM

    thanks for the suggestion, but the issue I'm dealing with is that the pages are not controlled through the SMP. An external server hosts these pages and based on a check of a property the 'real page' would know if the page should be rendered or not. 



  • 8.  RE: Dynamically detect webparts contained in Portal view.
    Best Answer

    Posted Oct 07, 2010 05:03 PM

    In that case, the only option I see working would be to create your own .aspx page and manage those parts in your code. Unfortunately we don't have any examples to show how to handle this.