cc.xml co.xml
Wednesday, October 20, 2010
SAP - dist/PORTAL-INF/config
We are not using NWDI. We use a third-party source code management system.
The dist/PORTAL-INF/config folder was checked into the repository. Later when we did a quick PAR upload, NWDS complained not able to delete the folder.
Tried to find a way to prevent it being checked in, but found no solution.
Finally I found if I define this folder as Derived, it won't give me any trouble.
The dist/PORTAL-INF/config folder was checked into the repository. Later when we did a quick PAR upload, NWDS complained not able to delete the folder.
Tried to find a way to prevent it being checked in, but found no solution.
Finally I found if I define this folder as Derived, it won't give me any trouble.
Thursday, September 16, 2010
Java Write Text into a Image
graph = image.getGraphics();
graph.setColor(aColor);
graph.setFont(aFont);
graph.drawString(text, x-position, y-position);
graph.setColor(aColor);
graph.setFont(aFont);
graph.drawString(text, x-position, y-position);
Friday, September 10, 2010
Some small consideration when design web applications
Sometimes I think to myself, what makes web application different from others? I find a real case when I review a real application.
This application has an edit page, on which user can select "Y" or "N" from a drop list. It also define keys for "Y" and "N" in a message properties file and this application is designed for English only.
I think there are at least two small places that the designer can do better.
This application has an edit page, on which user can select "Y" or "N" from a drop list. It also define keys for "Y" and "N" in a message properties file and this application is designed for English only.
I think there are at least two small places that the designer can do better.
- use radio button instead of drop down list, this saves one click.
- still put real messages in properties files but no need to treat a "Y"/"N" choice as a real message
Monday, August 16, 2010
SAP Portal - Multiple Node Installation of a KM Scheduler Task
In an environment with more than one CM system, you must assign one (any) CM system in the cluster to each scheduler task.
Do not assign a scheduler task to more than one CM system at the same time. In the configuration of a scheduler task, there must be only one entry in the CM Systems parameter.
To balance the load, we recommend assigning all scheduler tasks to one dedicated CM system that runs separate from the load balancer. This separation removes the load caused by running the scheduler tasks from the other nodes and makes them available solely for your users.
Do not assign a scheduler task to more than one CM system at the same time. In the configuration of a scheduler task, there must be only one entry in the CM Systems parameter.
To balance the load, we recommend assigning all scheduler tasks to one dedicated CM system that runs separate from the load balancer. This separation removes the load caused by running the scheduler tasks from the other nodes and makes them available solely for your users.
Tuesday, July 27, 2010
Wednesday, June 23, 2010
Tips - How to Rename the Suffix of a Group Files on Windows
Very simple, use cmd and go to the directory,
rename *.abc *.xyz
DONE.
rename *.abc *.xyz
DONE.
Thursday, June 10, 2010
Have fun! World Cup is coming.
Last month a world wide telephone survey was conducted by the U.N.
There was only one question asked: "Would you please give your honest opinion about solutions to the food shortage in the rest of the world?"
This survey was a HUGE failure because of the followings,
1. In Eastern Europe they didn't know what "honest" meant.
2. In Western Europe they didn't know what "shortage" meant.
3. In Africa they didn't know what "food" meant.
4. In China they didn't know what "opinion" meant
5. In the Middle East they didn't know what "solution" meant
6. In South America they didn't know what "please" meant
7. In the USA they didn't know what "the rest of the world" meant
8. In Australia they hung up as soon as they heard the Indian accent.
There was only one question asked: "Would you please give your honest opinion about solutions to the food shortage in the rest of the world?"
This survey was a HUGE failure because of the followings,
1. In Eastern Europe they didn't know what "honest" meant.
2. In Western Europe they didn't know what "shortage" meant.
3. In Africa they didn't know what "food" meant.
4. In China they didn't know what "opinion" meant
5. In the Middle East they didn't know what "solution" meant
6. In South America they didn't know what "please" meant
7. In the USA they didn't know what "the rest of the world" meant
8. In Australia they hung up as soon as they heard the Indian accent.
Wednesday, May 19, 2010
SAP Portal - Internationalization on Room Directory
NetWeaver Collaboration with Enterprise Portal 7.0.18 only supports English and German.
To internationalize it, download com.sap.netweaver.coll.appl.ui.room.par and add
UIRoomdirectoryConsts_es.properties to support Spanish and
UIRoomdirectoryConsts_fr.properties to support French.
Then redeploy the par to EP.
To internationalize it, download com.sap.netweaver.coll.appl.ui.room.par and add
UIRoomdirectoryConsts_es.properties to support Spanish and
UIRoomdirectoryConsts_fr.properties to support French.
Then redeploy the par to EP.
Monday, May 17, 2010
SAP Portal - Promote KM Changes to Next Stage
As I said in my previous posts, we created a new XML form, a couple of new predefined properties, and a new filter. Now we need to promote these changes to next stage.
Portal Content
Portal Content
- create a transport package and add the changed iView into the package
- create a configuration archive and add the following into the archive
- KM->CM->Form-Based Publishing -> Forms Availability ->Folder Settings, the new folder-form setting
- KM->CM->Global Services->Property Metadata->Properties, the new metadata
- KM->CM->Global Services->Property Metadata->Groups, the new metadata group
- KM->CM->Global Services->Property Structures->Property Groups, the new property group and the all_groups
- KM->CM->Global Services->Resource List Filters, the new resource list filter
- KM->CM->Repository Filters, the new filter class
- KM->CM->User Interface->Settings->Layout Set, the new browser
- copy the new xml form to next stage
Friday, May 07, 2010
SAP Portal - Apply XML Form to KM Folder
Thursday, May 06, 2010
SAP Portal - Use Properties in XML Form
I found almost zero documents on this subject. I figured it out finally with some common sense and some luck.
I configured some predefined properties to my KM documents. After it, I needed to create a XML form and use these properties for users to create such documents.
Here is what I had done.
I configured some predefined properties to my KM documents. After it, I needed to create a XML form and use these properties for users to create such documents.
Here is what I had done.
- Open an existing News form and save as my own project, called FM_News.
- At the left side, select the Data Model, right click on Properties and select Reload Properties
- At the editor area, add a label ABC, add three check boxes A, B, and C
- Add a label DE, add two radio boxes, D and E
- Define A - Caption A, Name ABC, Value A, Property Reference /Properties/default:ABC
- Define B - Caption B, Name ABC, Value B, Property Reference /Properties/default:ABC
- Define C - Caption C, Name ABC, Value C, Property Reference /Properties/default:ABC
- Define D - Caption D, Name DE, Value D, Property Reference /Properties/default:DE
- Define E - Caption E, Name DE, Value E, Property Reference /Properties/default:DE
- Note: check box for multiple selection and radio box for single selection, XML Form Builder may warn you to use Combo Box instead, ignore it.
- Save and generate.
Tuesday, April 27, 2010
SAP Portal - XML Forms Builder
This builder is under the Content Management tab of Content Manager role.
After every change to the form, save the project and generate the project.
This generation, my understanding, is to publish the change to portal.
To move the change to QAS or PRD, copy its xml files from \usr\sap\[sid]\SYS\global\config\cm\etc\xmlforms to QAS or PRD servers.
After every change to the form, save the project and generate the project.
This generation, my understanding, is to publish the change to portal.
To move the change to QAS or PRD, copy its xml files from \usr\sap\[sid]\SYS\global\config\cm\etc\xmlforms to QAS or PRD servers.
Wednesday, March 17, 2010
SAP Portal - How to Configure Predefined Properties for KM Documents
We use KM Navigation iView to broadcast news which are posted in KM repository.
We need to separate them by Field and by Language.
Configuration,
We need to separate them by Field and by Language.
Configuration,
- System Adminsitration -> System Configuration -> Knowledge Management -> Content Management -> Global Services -> Property Metadata -> Groups
- New
- Global Services -> Property Metadata -> Properties
- New - Unique ID = NewsGroup-Field, Property ID = Field, Namespace Alias = default, Group = NewsGroup, Mandatory = Yes, Multi-Valued = Yes, Maintainable = Yes, Default Value = Field1, Allowed Values(csv) = Field1,Field2,Field3
- New - Unique ID = NewsGroup-Language, Property ID = Language, Namespace Alias = default, Group = NewsGroup, Mandatory = Yes, Multi-Valued = No, Maintainable = Yes, Default Value = English, Allowed Values(csv) = English,French
- Global Services -> Property Structures -> Property Groups
- New
- Global Services -> Property Structures -> Property Groups, select all_groups and Edit
- Add the newly created NewsOptions to Group Items and OK
- Content Administration -> KM Content, select a document and open its Details
- Settings -> Properties -> NewsGroup tab
- Done
SAP Portal - Namespaces
Tuesday, March 16, 2010
SAP Portal - Obtain Property from IResource
If, for example, you have created a pre-defined property for KM document, called it "MyProperty", you can obtain its value after obtain an IResource object.
Now what if the MyProperty is Multi-Valued? Here is the code.
IPropertyName myPropertyName = PropertyName.getPN("http://sapportals.com/xmlns/cm", "MyProperty");
IProperty myProperty = resource.getProperty(myPropertyName);
if (myProperty != null) {
String myPropertyValue = myProperty.getStringValue();
}
Easy?Now what if the MyProperty is Multi-Valued? Here is the code.
List values = property.getValues();
for (Iterator valuesIterator = values.iterator(); valuesIterator.hasNext();) {
String element = (String) valuesIterator.next();
}
SAP Portal - Obtain IUser from IResource
Add com.sap.portal.usermanagement/lib/com.sap.security.api.ep5.jar to classpath.
then,
By the way, to obtain the Locale
then,
IResource resource = ...;IUser is deprecated since it is a EP5 user. However, UME user is not available for KM. So, no choice.
IResourceContext context = resource.getContext();
IUser user = context.getUser();
By the way, to obtain the Locale
Locale locale = context.getLocale()
Thursday, March 11, 2010
SAP Portal - Enable Debugging on NWDS
- Ask your BASIS team to enable the debugging on portal server. It is fairly easy. If they need more than 20 minutes, they lie.
- Let them tell you the message server host and port.
- In your NWDS (7.0), Window > Preferences > SAP J2EE Engine.
- Select the remote one and enter the message server host and port.
- Open the J2EE Engine view, the remote server shall show you green stuff, locate the sever0 and write down the debug port
- Run > Debug... and create a new Remote Java Application
- Set the host name to your portal server, port number to the debug port you just wrote down
- Click Debug. Note, only one debug is allowed. If you want to debug on another project, disconnect the current debug, create and start another one.
- Done!
SAP Portal - Deploy Resource List Filter
- Deploy the par contains the Filter to portal.
- Logon Portal
- System Admin > System Configuration > Knowledge Management > Content Management > Global Services > Resource List Filters
- New
- Back to Content Management, then User Interface, Settings, Collection Grid Renderer Settings
- Select a Renderer, Duplicate
- Enable advanced option, select the newly created ResourceListFilter from drop down list
- Back to User Interface, then Layout Set, select a layout and duplicate
- Select the newly created Collection Renderer and save
- Create a KM Navigate iView and set its layout set to the newly created one
- DONE!
SAP Portal - Create a Resource List Filter
There are many articles on Resource List Filter on web but few discussed how to create it in NWDS. Here are my steps on NWDS 7.0.
I have downloaded all 7.0.18 libraries to a local directory and defined it as PORTAL_HOME. So here is my project classpath.
- Create a Portal Application in NWDS.
- Right click the project, New > Other... > Repository Framework 7.1.5 > Repository Filter Wizard
- Select NW04, check off Generate classpath (the generation didn't work for me), enter class name and package name
- A NamespaceFilter is created. It is not what I want. So I replace the class with the following source
import com.sapportals.wcm.WcmException;
import com.sapportals.wcm.repository.IProperty;
import com.sapportals.wcm.repository.IResource;
import com.sapportals.wcm.repository.IResourceList;
import com.sapportals.wcm.repository.PropertyName;
import com.sapportals.wcm.repository.service.layout.customizing.IParameters;
import com.sapportals.wcm.service.resourcelistfilter.IResourceListFilter;
/**
* @version 1.0
*/
public class NotificationFilter implements IResourceListFilter {
/**
* Returns a new instance of the resource list filter.
*/
public IResourceListFilter getNewInstance() {
return new NotificationFilter();
}
/**
* Filters the resource list
*/
public void filterResourceList(IResourceList list, IParameters parameters) throws WcmException {
IResource resource = null;
IProperty prop = null;
for (int i = list.size() - 1; i >= 0; i--) {
resource = list.get(i);
prop = resource.getProperty(PropertyName.createContentLength());
if (prop != null && prop.getLongIntValue() > 102400) { // remove resources greater than 100kB
list.remove(resource);
}
}
}
}
I have downloaded all 7.0.18 libraries to a local directory and defined it as PORTAL_HOME. So here is my project classpath.
- ECLIPSE_HOME/plugins/com.sap.ep.applicationDevelopment_7.00/prtapi.jar
- PORTAL_HOME/com.sap.netweaver.bc.util/lib/bc.util.public_api.jar
- PORTAL_HOME/com.sap.km.cm.service/lib/km.shared.service.resourcelistfilter_api.jar
- PORTAL_HOME/com.sap.netweaver.bc.rf/lib/bc.rf.framework_api.jar
- PORTAL_HOME/com.sap.km.cm.repository.service.base/lib/km.shared.repository.service.layout_api.jar
- PORTAL_HOME/com.sap.netweaver.bc.crt/lib/bc.crt_api.jar
Friday, March 05, 2010
J2C Bean and Team Development
IBM wizard uses XDoclet to generate J2C source from COBOL copybook. That's cool. It keeps the annotation in the source code. That's alright.
What bothers us is that every time any member checks out the code from team repository, it regenerates the same code and stamps a new timestamp on the code. After a while, it shows a lot of versions in the repository but actually nothing has been changed.
Our solution is to enable XDoclet builder on only one developer's workspace and disable everybody else. This is far from savvy but it seems no other options.
What if we really need to use XDoclet for other purposes? I can only guess IBM lab architectures have never used their own tool in any real-life and serious projects.
What bothers us is that every time any member checks out the code from team repository, it regenerates the same code and stamps a new timestamp on the code. After a while, it shows a lot of versions in the repository but actually nothing has been changed.
Our solution is to enable XDoclet builder on only one developer's workspace and disable everybody else. This is far from savvy but it seems no other options.
What if we really need to use XDoclet for other purposes? I can only guess IBM lab architectures have never used their own tool in any real-life and serious projects.
What has Spring IDE done to XML Editor?
I don't know.
My Rational Software Architect is 7.5.5. Every time after I installed the Spring IDE plugin, the XML Editor failed to open.
Anyone has the same problem?
My Rational Software Architect is 7.5.5. Every time after I installed the Spring IDE plugin, the XML Editor failed to open.
Anyone has the same problem?
Wednesday, February 03, 2010
Spring and Tiles
I have tried Spring 3.0.0 + Tiles 2.2.1, 3.0.0 + 2.1.4, 2.5.6 + 2.2.1, 2.5.6 + 2.1.4, none worked.
I went back to Spring 2.5.5 + Tiles 2.0.5. So far, this is the only combination works for me.
Copy to WEB-INF/lib, all from Spring 2.5.5 download,
I went back to Spring 2.5.5 + Tiles 2.0.5. So far, this is the only combination works for me.
Copy to WEB-INF/lib, all from Spring 2.5.5 download,
- commons-beanutils.jar
- commons-digester.jar
- commons-collections.jar
- spring-aop.jar
- spring-beans.jar
- spring-context.jar
- spring-context-support.jar
- spring-core.jar
- spring-jdbc.jar
- spring-tx.jar
- spring-web.jar
- spring-webmvc.jar
- tiles-api-2.0.5.jar
- tiles-core-2.0.5.jar
- tiles-jsp-2.0.5.jar
Thursday, January 21, 2010
When You Upgrade Struts
Sometimes, the application server won't recompile your JSP pages and you may receive errors like,
All you need to do is to clean up the temp directory of this application.
java.lang.NoClassDefFoundError: org.apache.struts.taglib.tiles.InsertTagIt misleads you to a classpath issue, but it is not.
All you need to do is to clean up the temp directory of this application.
Monday, January 18, 2010
SAP Portal - Steps to Create a Collaboration Room
My goal is to create a collaboration room in SAP Enterprice Portal. It shall display all documents in a KM directory assigned to this room. Same way like KM Navigation iView.
Users have asked to control the initial state of each folder, for example, expanded or collapsed, however, I am not sure if it is deliverable under NW EP 7.0.
Normally I would start from an existing room template by duplicating it, but this time, I want to start from the beginning, for readers including myself.
Here are my steps.
Users have asked to control the initial state of each folder, for example, expanded or collapsed, however, I am not sure if it is deliverable under NW EP 7.0.
Normally I would start from an existing room template by duplicating it, but this time, I want to start from the beginning, for readers including myself.
Here are my steps.
Part 1, create template workset
- Content Administration -> Portal Content -> com.sap.ip.collaboration -> Worksets
- Create a new workset under Worksets, name it e.g. MyColl_Room_v1
- Add Portal Content/com.sap.ip.collaboration/TemplatesAndPartContent/TemplateSpecific/Team Template/Pages/Documents and Links to MyColl_Room_v1 as delta link
- Add Portal Content/com.sap.ip.collaboration/TemplatesAndPartContent/Generic/Pages/Admin: Room to MyColl_Room_v1 as delta link, if only for users current requirements, Admin: Member would be enough, but for future growth, Admin: Room is usually a good choice
- Add Portal Content/com.sap.ip.collaboration/RoomPartContent/Generic/Pages/Documents to MyColl_Room_v1 as delta link
- Right click the Documents and select Edit
- Remove the Document iView inside the Documents page
- Add Portal Content/Content Provided by SAP/End User Content/Standard Portal Users/iViews/com.sap.km.iviews/URL Access/KM Navigation iView to the Documents page
- Save and close, part 1 done.
Part 2, create room template
- Content Administration -> Collaboration Content -> Room Template Administration
- Click the New Template button
- Name the new room template MyColl_Room_v2
- Give any appropriate description
- Specify any appropriate owner
- Select Private as it is the requirement
- Check on Fixed Room Type
- Select MyColl_Room_v2 as the Workset
- Click Next
- Remove the Public role as I don't need it
- Set Initial Role to Member and Admin Role to Admin
- Check Admin for all three pages, Member for only the RoomDocuments
- Add one external parameters, Docu_Folder_Path
- Skip the Extensions
- Complete mappings, see the mappings table
- Skip the Permissions
- Finish
Mappings table
- com_sap_netweaver_coll_information_roomid -> room_id
- customEntryPointDescrption -> room_description
- customEntryPointFolderPath -> Docu_Folder_Path
- customEntryPointName -> room_name
- path -> Docu_Folder_Path
- roomid -> room_id
- StartUri -> Docu_Folder_Path
- XFProjectPath -> roomstructure_rid
- com_sap_netweaver_coll_roomquicklaunch_roomid -> room_id
- com_sap_netweaver_coll_maintenance_roomid -> room_id
Part 3, create the collaboration room
- Content Administration -> Collaboration Content -> Room Creation
- Name it MyColl_Room_v1_001
- Any appropriate description, owner, categories
- Select MyColl_Room_v1 as Template
- Set the Docu_Folder_Path to the designated KM Folder
- Keep default for all rest.
- Finish
Subscribe to:
Posts (Atom)