Wednesday, September 26, 2012

EP Version

There are official ways to obtain the version and release number of SAP portal. Here is a quick and dirty way.

View the source code of the logon page and check out the first line.

If it is 7.1.8.0.1, it means EP version 7.1, service pack 8, patch 1.

Wednesday, July 11, 2012

Hibernate Polymorphism

ClassOne and its sub-class ClassOneDotOne.

If you only want ClassOne, not ClassOneDotOne in your Hibernate query results, you will need to define
  1. if hbm.xml,
  2. if annotation, @hibernate.class polymorphism="explicit"
Yes, it is that simple.

Friday, June 22, 2012

Objective-C First Impression

I don't like the NS prefix. Ugly.

The Protocol is the Interface in Java. Here is the key sentence to understand it.
When you implement the methods of a protocol in one of your classes, your class is said to conform to that protocol.
 #import is to import a header file, not just a class or interface. Preferred over #include.

Java class has everything in one .java file. Objective-C class has its interface portion in a .h file, its implementation portion in a .m file. My understanding so far is that it is not possible to initialize any member variables in the .h file. Not mention any static final variables.

Type id is like the class Object in Java.

OK, if not a type id for a variable, it is so-called strongly typed, you need to have * at the head of the variable name. Ugly.

So the class method is the static in Java. Seems no concept of Constructor so one class method to create new instances is always necessary.



Friday, April 27, 2012

Let ApplicationContext Pick up Properties by Runtime Environment

In one of my recent projects, I needed to point to different data sources by run-time environment.

In the web container, we can define jndi data sources. But what about in the batch environment?

I have heard of something like dummy jndi but I have some problem trying to understand it. So I figured out another way.

In the applicationContext.xml file, I used propertyConfigure to define location at classpath:application.${runtime}.properties.

Then I created two properties file, application.development.properties and application.production.properties.

Then in the applicationContext.xml file, I just pick up the properties.

Then in the command line, I just need to specify the "runtime" variable by using -Druntime=development or -Druntime=production.

Done.

Note: if in applicationContext we need a value "\\abc\aaa", we need to define it in the properties file as "\\\\abc\\aaa".

Tuesday, March 27, 2012

Portal Drive

A nice tool to map KM folders into Windows PC/server.

Download path:

SAP Software Download Center -> Support Packages and Patches -> N -> SAP NetWeaver -> (Your SAP Portal Version/Release) -> Entry by Component -> Frontend

I downloaded 4.4 and 4.5. I installed 4.5.

Check if WebDAV is enabled. System Administration -> System Configuration -> Knowledge Management -> Content Management -> Protocols -> WebDAV

The Enable WebDAV Server should be checked on.

Configuration url

http://:57100/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/

Done.

Thursday, February 02, 2012

Unlock a document in KM

Content Administration -> KM Content

select the locked documents



from the Selection drop down menu, select unlock.