Skip to Content
0
Former Member
Apr 06, 2006 at 05:35 PM

URL Generator not working

69 Views

Hi people,

I need to get the URL of an already created iView in my PCD and I am using the following code (inside an AbstractPortalComponent) for that:

IUrlGeneratorService urlGeneratorService = null;

try{
	urlGeneratorService = (IUrlGeneratorService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.URLGENERATOR_SERVICE);
} catch (Exception re){
	System.out.print(re.toString());
}

IPortalUrlGenerator portalUrlGenerator = null;
ISpecializedUrlGenerator specializedUrlGenerator = urlGeneratorService.getSpecializedUrlGenerator(IPortalUrlGenerator.KEY);

if(specializedUrlGenerator != null && specializedUrlGenerator instanceof IPortalUrlGenerator){
	portalUrlGenerator = (IPortalUrlGenerator)specializedUrlGenerator;

	myNewParameter = portalUrlGenerator.generatePortalComponentUrl(request, myParameter);
}

My imports are:

import com.sapportals.portal.prt.service.urlgenerator.IUrlGeneratorService;
import com.sapportals.portal.prt.service.urlgenerator.specialized.IPortalUrlGenerator;
import com.sapportals.portal.prt.service.urlgenerator.specialized.ISpecializedUrlGenerator;
import com.sapportals.wcm.repository.ResourceFactory;
import com.sapportals.wcm.service.IServiceTypesConst;

I have also built the following portalapp.xml:

<?xml version="1.0" encoding="utf-8"?>
<application>
  <application-config/>
  <components>
    <component name="ProxyiView">
      <component-config>
        <property name="ClassName" value="com.mycompany.ProxyiView"/>
	<property name="SafetyLevel" value="low_safety"/>
	<property name="SharingReference" value="htmlb, usermanagement, knowledgemanagement"/>
      </component-config>
    </component>
  </components>
  <services/>
</application>

However, it keeps generating an error when I run the iView:

com/sapportals/wcm/repository/ResourceFactory.
Exception id: 02:30_06/04/06_0009_601745950
See the details for the exception ID in the log file

What could be the problem?

Thanks in advance,

Fernando Urzedo