Skip to Content
author's profile photo Former Member
Former Member

Accessing profiles of other components


Is there any way of accessing the profile of another component from a component? The two components are in the same namespace.



Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 30, 2005 at 04:00 PM

    This is how you do it,

    Give the component's path (including pcd..) of the component whose profile u need to this:

    IPortalComponentContext context = request.getComponentContext("pcd:/portal_content/xxxx/iview");

    IPortalComponentProfile profile = context.getProfile();

    String thisColor = profile.getProperty("color");

    Let me know if u need more.


    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      (Or) Try this:

      <b>iviewPath</b>: if u can pass the iviewpath dynamically using EPCM bag or cookies to this application then u cud find the title.

      try {
      		   Context initialContext = getEnvironment(request);
      		   IPcdContext targetObject = (IPcdContext)initialContext.lookup(<b>iviewPath</b>);
      			Object object = targetObject.getAttributes("").get("");
      			//Object object1 = targetObject.getAttributes("").get("");
      			if(object instanceof IPcdAttribute){
      				IPcdAttribute att = (IPcdAttribute)object;
      				objtitle = att.get(request.getLocale());
      			if(object1 instanceof IPcdAttribute){
      				IPcdAttribute att = (IPcdAttribute)object1;
      				objdesc = att.get(request.getLocale());
      	   } catch (NamingException e) {
      	public InitialContext getEnvironment(IPortalComponentRequest request) {
      			InitialContext initialContext = null;
      				IUser principalObj = null;
      				principalObj = this.getServiceUser("pcd_service");
      				Hashtable env = new Hashtable();
      				initialContext = new InitialContext(env);
      			}catch(NamingException e){
      			return initialContext;
      		public IUser getServiceUser(String username) {
      		IUser serviceUser = null;
      		IUserManagementEngine ume = 
      		IServiceUserFactory sufactory = ume.getServiceUserFactory();	
      		try {
      			serviceUser = sufactory.getServiceUser(username);
      		} catch (UMException e) {
      			return serviceUser;

      <b>PS: Please award points for helpful answers</b>

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.