Archive

Archive for the ‘SAP Enterprise Portal’ Category

SAP Portal: How do I reference a Javascript file in my iView?

28 March, 2006 Comments off

Easy when you know how

public void doInitialization(){
  request = (IPortalComponentRequest)this.getRequest();
  response = (IPortalComponentResponse)this.getResponse();
  IResource jsResource = request.getResource(IResource.SCRIPT, “scripts/myscript.js”);
  response.addResource(jsResource);
}
Categories: SAP Enterprise Portal

How do I find the url of my SAP Portal Component?

22 March, 2006 Comments off

Try this…

In SAP Netweaver Developer Studio

Open your project

Open the file:

MyPortalProject
    dist
        PORTAL-INF
            Portalapp.xml

You should now see a “Run…” button for each portal component in your project

Click the “Run…” button and the dev studio will open up a new browser window with the url to your component.

Categories: SAP Enterprise Portal

Installing Subclipse for SAP NetWeaver Developer Studio 2.0.13

20 March, 2006 2 comments

First download the correct version of Subclipse:

Download the Eclipse 2.x version

Extract the zip file and copy the two folders:

org.tigris.subversion.subclipse.core_0.9.3.3
org.tigris.subversion.subclipse.ui_0.9.3.3

To your plugins folder, in my case:

C:\\Program Files\\SAP\\JDT\\eclipse\\plugins

Fire up the developer studio and you should now have the subversion perspective available.

Menu: Window => Open Perspective => Other…

Select SVN Repository Exploring from the dialog.

Right click on the SVN Repository windows to add a new repository:

Menu: New => Repository Location…

You will now see the following dialog:

New Repository Dialog

Simply enter your subversion server address and user/password if required.

You should now see your source code, right click on the Trunk folder of a project and select Check Out as Project.

Cogs will start turning and when finished you will have a shiny new project to play with.

Categories: SAP Enterprise Portal

Installing SAP Netweaver Developer studio

16 March, 2006 1 comment

Before installing the studio you must first install the Java SDK:

j2sdk-1_4_2_06-windows-i586-p.exe

Just accept the defaults.

Now install Netweaver Depeloper studio (SP13 in my case)

NWDS_SP13\J2EE-RUNT-CD\IDE\JDTsetup.exe

Install all components.

You will be asked for the location of the Java SDK which if you accepted the default should be:

C:\j2sdk1.4.2_06

Next enter your proxy settings, wwwcache:8080 in my case.

Now sit back, relax and wait for the long install to finish!

Categories: SAP Enterprise Portal

SAP Portal Developer Guide

1 March, 2006 2 comments

Can’t remember that HTMLB syntax? Look no further…

SAP Portal Developer Guide

Categories: SAP Enterprise Portal

Functionally testing SAP Enterprise Portal using Watir

28 February, 2006 Comments off

It’s taken about a day but I’ve managed to get some functional tests running using Watir. It’s not been as easy as it could have been mainly due to the way the SAP Enterprise Portal uses iFrames and the anti cross site scripting in Internet Explorer. I got there in the end though! I can now logon to the portal and functionally test iViews using a fairly simple Watir (Ruby) script:

def logon
$ie.goto($html_root)

if $ie.contains_text("Log Off")
logoff()
end

$ie.text_field(:id, 'logonuidfield').set($user_id)
$ie.text_field(:id, 'logonpassfield').set($password)
$ie.button(:name, 'uidPasswordLogon').click
end

A couple of things to note:

Talk to the iView directly
Due to the use of iFrames and IE anti cross site scripting accessing an iView which is embedded in a portal page is not possible with the current (1.4.1) version of Watir. Simply get the url of the iView and access it directly.

Problem with HTMLB Text Fields
ID’s and Names of HTMLB Text Field controls appear to be generated on execution, so I had to write a little script which would find a text field using the title property:

def find_text_field_by_title(my_title)
found_text_field = nil

$ie.text_fields.each do |tf|
if tf.title == my_title then
found_text_field = tf
break
end
end

raise "No text field found with title = " +
my_title if found_text_field.nil?

return found_text_field
end

NOTE: I’m sure my Ruby/Watir scripts leave a lot to be desired, I don’t really know who to code in Ruby but they do seem to work!

Removing PAR files from the SAP Portal

23 February, 2006 Comments off

So you’ve accidentally uploaded a PAR file to the portal eh?

Here’s how to get rid…

(Top Menu) Java Development -> (Left Sub Menu) Tools -> Portal Archive Deployer&Remover

(Main Page) Archive Remover

Select the PAR file you wish to remove from the drop down list and click the “Clean” button

You should now see a message along the lines of:

INFO: Received clean-up request for application: “MyApp”
INFO: MyApp has been successfully removed from the PCD.

The PAR is no more.

Categories: SAP Enterprise Portal

SAP Portal PAR locations

23 February, 2006 Comments off

To find your PAR files once they are uploaded to the portal:

(Top Menu) Java Development -> (Left Sub Menu) Tools -> Portal Support Desk

(Main Page) Portal Runtime -> (Main Page) Browse Deployment

Now move to:

:ROOT/WEB-INF/deployment/pcd

You should now see a BIG list of files.

This is where your PAR files live!

Categories: SAP Enterprise Portal

Create a library project of SAP Portal PDK JARs

22 February, 2006 1 comment

It is a good idea to create a library project which includes all the jar files needed for a portal project. Why?
1. The SAP consultant told us to do it this way
2. It means on each new project you just need to include the library project and we are good to go.

So this is what we need to do:

Step 1: Get the portal PDK JAR files
These JAR files can de downloaded from the portal, they live under the following portal menu:

(Top Menu) Java Development -> (Left Sub Menu) Tools -> PDK Jars Download

Download the zip file and extract the JAR files to a folder on your PC for example c:\source\sap\devlibs

Step 2: Create the library project
In SAP Netweaver Developer Studio create a new project:

File -> New -> Project…

You will now see a wizard dialog:

Select Java -> Java Project

Click Next

Give the project a name DevLibs for example and specify a folder to save the project to.

You should now have a blank project to work with.

Step 3: Import the SAP Portal PDK JAR files
Right click your mouse on the new blank project you just created (in this case DevLibs) select Properties from the context menu.

You will now see the DevLibs properties dialog:

Select Java Build Path from the left pane.

Select “Libaries” from the Tab.

Click the “Add External JARs” button.

The file open dialog will now appear, select the downloaded JAR files from Step 1.

Click the “Order and Export” tab, click the “Select all” button.

Finally click the “OK” button.

You now have a library project which can be included in new portal projects!

Categories: SAP Enterprise Portal

SAP Portal HTTP or HTTPS?

22 February, 2006 Comments off

Want to tell if your iView is running over HTTP or HTTPS?

Try this:

WARNING: Untested code ahead!

HttpServletRequest servletRequest = componentRequest.getServletRequest();
String requestURL = servletRequest.getRequestURL().toString();
String protocol = requestURL.substring(0, requestURL.indexOf(":"));

if(protocol.equals(“http”))
{
// do HTTP stuff
}
else
{
// do HTTPS stuff
}

Categories: SAP Enterprise Portal