更换SAP Portal的登录界面
有许多文章可以参考。当然有些小的错误,需要大家自己去寻找位置。
(以下文档并非我写,如果侵犯了你的版权,请与我联系。)
1. 说明
门户系统中有标准的登陆页面。包括用户输入用户名和密码的界面、包括请求管理员帮助的界面等。 如果需要你可以修改这些界面来展示企业的特征。要实现门户登陆页面的客户化, 就必须修改SAP标准的登陆组件中的jsp页面,重新配置用户管理来使用修改过的登录组件。
标准的门户登陆组件包括登陆页面使用的代码和资源包含在SAP的PAR文件 com.sap.portal.runtime.logon.par中。
上面所说的对登录页面所作的修改会在系统升级后被覆盖。基于这个原因你需要在修改之前保存所有的文件备份。在每次系统升级后必须重新进行修改。
2. 修改方法
2.1 对SAP标准的登录组件进行备份和修改
在门户应用服务器上的<J2EE_Engine_Instance>\j2ee\cluster\server<X>\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\deployment\pcd.目录下找到文件com.sap.portal.runtime.logon.par.bak.
首先备份文件com.sap.portal.runtime.logon.par.bak ,然后将文件重命名,例如:将它重命名为my.new.logon.par。
将文件my.new.logon.par 移动到 <J2EE-Engine_Instance>目录外。
将文件 my.new.logon.par解压,并保留该文件解压后原有的目录结构。
修改my.new.logon.par文件解压出来的文件。
将修改后的文件重新放回my.new.logon.par文件中。
将文件 my.new.logon.par 拷贝到下面的目录中 <J2EE_Engine_Instance>\j2ee\cluster\server<X>\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\deployment\pcd。
2.2 修改authschemes.xml文件的方法
1. 通过执行<SAPJ2EEEngine_installation>\j2ee\configtool\configtool.bat.来打开Config Tool
2. 选择标签来切换到配置编辑模式。.
3. 在属性列表中,选择cluster_data server persistent com.sap.security.core.ume.service.
4. 切换到编辑模式,选择按钮 (查看和编辑模式的转换).
5. 在树形列表中,选择authschemes.xml并选择 (显示选择节点的详细信息)。
6. 选择下载和保存文件到本地。
7. 在本地编辑下载的文件,在文件authschemes.xml中,用“my.new.logon”替换文件中<frontendtarget>标签中出现的所有的字符串“com.sap.portal.runtime.logon”并保存文件。
8. 在配置属性列表中为编辑的文件进行更新:
a. 选择节点com.sap.security.core.ume.service。
b. 在树形列表中,选择authschemes.xml。
c. 右键点击该节点,并选择“change”。
d. 在本地目录中选择上面的文件并选择上栽。
e. 选择保存。
f. 选择关闭窗口。
9. 重启选择的群集节点使修改生效。
3. 以后修改登录页面方式
修改PAR文件内容
3.1 PAR文件上载
使用系统管理员账号登录门户系统
选择“系统管理”“支持”,在Top Level Areas中选择“Portal Runtime”,在Portal Anywhere" Admin Tools中选择,“Administration Console”
在Archive Uploader中点击按钮“浏览”,选择本地的PAR文件,然后点击“Upload”按钮,上载文件。
上载完成后重启门户服务器,使修改生效
以下的文章大都是英文。
http://hi.baidu.com/bobylou/blog/item/f046f603021bb2e909fa9354.html
Here are some simple steps to follow to customize your very own SAP Enterprise Portal Login Page. The login page is part of the par file with the name com.sap.portal.runtime.logon.par 1) Copy the file with the above name from the following location (EP6 SP9 and higher). It has the additional ending ".bak", which you should remove on you local copy : 2) Import the PAR file into Netweaver Developer Studio: - Select File>Import . - Choose the option PAR file. Select Next and a popup window appears. - In the window you have 3 text fields: The location of the par file, a project name (which will also be the new par file name) and the location where the project should be saved. The project name should differ from the original SAP file to avoid overwriting of the original. It also works as a security blanket, in case you have an exception in your custom logon code or want to start from scratch again. 3) Check, that you have the following 2 JAR files under the subfolder /lib : 1. com.sap.portal.runtime.logon_api.jar 2. umelogonbase.jar If you don't have these file, you will see a portal exception on the Logon page and the log file will have the entry: at com.sapportals.portal.prt.core.broker.PortalComponentItemFacade.getInstanceInternal... The files you need are located in the original PAR file. Just open it with a Unzip Program and copy the files in your project. Now you have your project prepared and you are ready for making changes. The most important files for a customization are: - images, which are stored under dist\layout - JSP files, which are stored under dist\PORTAL-INF All JSP pages include 3 additional files: The header (umLogonTopArea.txt), the bottom (umBotArea.txt) files, as well as the logon_proxy.txt . The different pages in the Logon Par file are Logon page : umLogonPage.jsp Problem page : umLogonProblemPage.jsp Help page (PW reset) : umHelpPage.jsp Reset Password : umResetPasswordPage.jsp Change Password Page: changePasswordPage.jsp Certificate Logon : umLogonCertPage.jsp Now enough about what elements we have. Let's customize ! But first make sure that you upload the new par-file, customize the authschemes.xml and restart the portal. Changing Text The text seen on the logon page is not in the JSP page, but in properties files which are called by tags like the Welcome text : <%=logonLocale.get("xtit_WELCOME")%> In order to change "Welcome" to "Welcome to MyHR" you have to : - Unzip the file umelogonbase.jar which you can find under dist\PORTAL-INF\lib - Find the file "logonLabels_" which contains your language; e.g. for german logonLabels_de.properties, for russian logonLabels_ru.properties or for English logonLabels_en.properties The default is in the file logonLabels.properties . - Find the key which is used in the tag (here it is xtit_WELCOME) and change the text after the equal sign. - Save the changed file and create a updated JAR file using a zip program. The file needs to be named umelogonbase.jar, not umelogonbase.zip or umelogonbase.jar.zip. - Put the JAR file back to dist\PORTAL-INF\lib. Remove Support and Register links The links are controlled with the UM settings ume.logon.logon_help ume.logon.selfreg You could also just comment out the lines... Change/add images To exchange the two images, which are by default on the logon page, do the following steps:
Add a Document (e.g. Intro or FAQ) You can add a document link to the logon page, which points to a KM document. Updating the Logon Document would then involve no transports,and if wanted an approval process. Less paperwork to worry.... 1. Setup a folder Logon, e.g. under Public Documents and put in there the document you want to point to. 2. Setup the folder with Read access for the Anonymous Users group. 3. Create a KM Document iview and choose Anonymous as access, but don¡¦t change the path to the document yet. 4. Preview the document and note down the URL of this page (In most browsers Right-click outside the image and select Properties to get the URL). 5. In the iview add now the KM path an d preview it again to make sure that the path is correct. 6. In the logon page, create a link. The href value is the URL you noted down but starting with /irj and without the portal server name and port (otherwise you have to change it after every transport). To spin this idea further you could show an XML form by putting that into an IFrame. Dynamic Images and Links I want to archive a Logon page that looks different for different user. The final PAR file should also work through the DEV, QUA (and sometimes Staging STG ) and PRD without changes in the code. The user will access the portal in all cases via different URLs. Hence we have to check the Request URL which can be accessed in a Java Servlet [getRequestURL()]. In the code below we look in which system we are: <% String url = componentRequest.getServletRequest().getRequestURL().toString(); if (url.indexOf("portal-e.")!= -1){... } else if (url.indexOf("portal-d.")!= -1){... } else if (url.indexOf("portal-q.")!= -1){...} else if (url.indexOf("portal.")!= -1) {...} else{...} %> Another idea is to have different views depending from which URL you are coming. Using that URL, you could have your Multi-Tenant portal without waiting to NW 2004s. Accepting a Policy with the first Logon A problem somebody had in the forum was, that a brandnew user should be redirected the first time to a Policy iview, where the user has to accept the policy. After the acceptance the iview should not appear anymore. The solution was to add an new attribute field in the User Profile See : http://help.sap.com/saphelp_nw04/helpdata/en/a3/d2ffd64602c149949ca3cf379dc295/content.htm Authschemes.xml I have now the new par file, but to have the portal reference on this PAR file, we need to customize and upload the customized authschemes.xml file through the Config-Tool of SAP WebAS. When you edit the file, you should download the file to a local directory, edit it, and when uploading the edited file, create a new node in the configuration tree for it. In this way you do not loose the original version of the file. 1. Start the Config Tool by executing 2. Navigate to cluster_data>server>persistent>com.sap.security.core.ume.service. 3. Switch to edit mode by clicking on the pencil which is at the upper right area. 4. In the tree, select authschemes.xml and choose Download. Save the file to your local directory 5. Edit the local file: To select the new PAR file as the Logon page change the occurrence of all substrings com.sap.portal.runtime.logon to your project/PAR file name. All com.sap.portal.runtime.logon should be substituted with something like com.company.portal.runtime.logon (or whatever you project name is). Don’t remove the part behind it. (These are the profiles in the portalapp.xml and have the names default, certlogon, basicauthentication, header, and anonymous). 6. Create a new node in the configuration tree in the Config-Tool for the edited file as follows: a.Select the node com.sap.security.core.ume.service. b. Choose the symbol for Creating a node below the selected node. c. Select the type File-entry. d. Choose Upload and select the custom file from your local directory. e. Enter a name for the entry, for example, authschemes_myHR.xml. By default, the name of the uploaded file is used. f. Choose Create. g. Choose “Close window”. h. The new node appears in the configuration tree. i. Go to Global server configuration>services> com.sap.security.core.ume.service and edit the property login.authschemes.definition.file. The value needs to be changed from authschemes.xml to authschemes_myHR.xml j. Restart the Portal. |