Quantcast
Channel: SCN : All Content - SAP HANA Cloud Platform Developer Center
Viewing all 3285 articles
Browse latest View live

Uncaught TypeError: Cannot read property 'Table' of undefined

$
0
0

Hello,

 

I tried to follow the end to end guide (http://scn.sap.com/docs/DOC-33513). Unfortunately when I add the table as described in section 2.3 I get the following error, when I try to display the page in the javascript log: Uncaught TypeError: Cannot read property 'Table' of undefined. Nothing, besides the background, gets displayed. I attached my source code (Note that you have to rename the file to *.zip).

 

Best Regards,

Jan


Cloud Single Sign-On and On-Premise Identity Federation with SAP NetWeaver Cloud

$
0
0

This whitepaper provides guidance for IT architects and developers about designing and deploying integrated solutions on the SAP NetWeaver Cloud platform that support Single Sign-On and Identity Federation with existing On-Premise Identity Management technology. Based on a sample enterprise scenario, the key concepts and major steps towards implementing the solution are explained.

View this Document

SAP NetWeaver Cloud Security Tutorial - Single Sign-On and Identity Federation with SAP NetWeaver Identity Management

$
0
0

This tutorial is part of a series on how to setup Single Sign-On (SSO) and Identity Federation between the SAP NetWeaver Cloud platform and existing identity and access management (IAM) systems. In this document, a complete end-to-end scenario for integrating SAP NetWeaver Cloud with SAP NetWeaver Identity Management 7.2 will be implemented based on the Security Assertion Markup Language (SAML) 2.0 protocol.

View this Document

Trouble while setting Eclipse

$
0
0

Hello,

 

When I try to configure eclipse for NW cloud i get the below message. Can someone help ?

 

Cannot complete the install because one or more required items could not be found.

  Software being installed: Eclipse Tools for SAP NetWeaver Cloud 1.9.7.1 (com.sap.core.tools.eclipse.server.feature.feature.group 1.9.7.1)

  Missing requirement: Juno-specific Implementation for SAP NetWeaver Cloud 1.4.4.1 (com.sap.core.tools.eclipse.server.version 1.4.4.1) requires 'bundle org.eclipse.wst.server.core 1.4.0' but it could not be found

  Cannot satisfy dependency:

    From: WTP Server Adapter for SAP NetWeaver Cloud 1.4.4.1 (com.sap.core.tools.eclipse.server.cloud.feature.feature.group 1.4.4.1)

    To: com.sap.core.tools.eclipse.server.version [1.4.4.1]

  Cannot satisfy dependency:

    From: Eclipse Tools for SAP NetWeaver Cloud 1.9.7.1 (com.sap.core.tools.eclipse.server.feature.feature.group 1.9.7.1)

    To: com.sap.core.tools.eclipse.server.cloud.feature.feature.group [1.4.4.1]

Compilation Error: javax.servlet.annotation doesn't exist

$
0
0

Hello,

 

I created a Dynamic Web Project and converted it to a Maven Project. When I try to execute Maven Install I get the following Error:

[ERROR] COMPILATION ERROR :

[ERROR] bootstrap class path not set in conjunction with -source 1.6

C:\Users\D056848\workspace\social-media-integration\src\com\sap\netweaver\cloud\social\media\TwitterServlet.java:[5,31] error: package javax.servlet.annotation does not exist

[ERROR] C:\Users\D056848\workspace\social-media-integration\src\com\sap\netweaver\cloud\social\media\TwitterServlet.java:[13,1] error: cannot find symbol

 

I attached the complete Maven log for further details. Furthermore I attached my pom.xml which is basically the same as the pom.xml from the end-to-end tutorial.

 

In Project Properties --> Java Build Path the SAP Netweaver Cloud Library is existent (including javax.servlet-3.0.0.v201103241009.jar and javax.servlet.jsp-2.2.0.v201103241009.jar)

 

Any ideas?

 

Regards,

Jan

 

 

Deploy a web application programmatically on the cloud

$
0
0

Hi All,

 

I would like to know if it is possible to deploy .war from a running web application ?

I have a scenario when my first web app builds another  .war application file in runtime and then needs to deploy it on the same cloud.

Is it possible to do on nwtrial.ondemand.com cloud ? Is this a legal scenario ?

If yes, what apis or services should the first application use?

 

Regards,

Slavik.

Setting up Ubuntu for NetWeaver Cloud

$
0
0

Between Christmas and New Year I've had some time at home to play around with NetWeaver Cloud. This time I was wondering how to make it easier to run SAP NetWeaver Cloud on your machine with very little efforts to setup the infrastructure.

 

The persona for this script

The person that I wrote this script for is somebody

  • who likes to understand what you can do with NetWeaver Cloud
  • doesn't want to spend too much time and create a big data footprint on the hard drive
  • or simply wants to try out something new (just like me) :-)

 

The list of assets

After thinking through this is my list of assets I wanted to use

  • a Virtualized Ubuntu machine
  • SAP NetWeaver Cloud
  • the related SDK and the Eclipse Tools
  • a bash script to install everything properly with close-to-zero effort

 

Step 1: Setup a virtualized Ubuntu

After trying out the latest version Ubuntu 12.10 and Ubuntu 12.04 I found out that the more stable release is 12.04. With 12.10 I faced several issues with bad performance and after crawling the internet that seems to be a known issue that hasn't been fixed, yet.

So I took Ubuntu 12.04 desktop and installed it on VirtualBox on my MacBook Pro. This went pretty quickly and took me around 5 minutes.

Remember the password you've given the system :-)

 

Step 2: Download SAP NetWeaver Cloud SDK

Start Ubuntu and the Firefox browser, go to the SAP NetWeaver Cloud Update Site and download the SAP NetWeaver Cloud SDK.

Store it in the Downloads folder of your user.

 

Step 3: Store and run the bash-script

Now we get to the fun part of all of this.

Start the terminal in Ubuntu. For that you click on the Dash Home button at the top left and type-in Terminal into the search box. Click on the Terminal button showing up below the search field.

Screen Shot 2013-01-17 at 2.05.53 PM.png

Now you change to the Downloads folder and create a bash file called install.sh. For that you need to be logged-on as a root user.

sudo -s

cd Downloads

sudo gedit install.sh

Take the text below and copy and paste it to the editor in your Ubuntu system.

#!/bin/bash

 

echo "###########################################################"

echo "## Define variables for pre-downloaded software and URLs"

echo "###########################################################"

echo "# Neo SDK (get the file at https://tools.netweaver.ondemand.com/)"

echo "# The file needs to be stored in the Downloads folder"

filenameNeoSdk=neo-sdk-1.17.0.zip

urlCloudTools=https://tools.netweaver.ondemand.com/juno

 

echo "# Ensure that the script changes into the Downloads folder"

cd $HOME/Downloads

 

echo "###########################################################"

echo "## Update your ubuntu system"

echo "###########################################################"

apt-get update

echo "# Now upgrade assuming that all questions from the"

echo "# upgrade will be answered with yes"

apt-get upgrade --assume-yes

apt-get autoclean

apt-get autoremove

 

echo "###########################################################"

echo "## Install some additional packages"

echo "###########################################################"

echo "# Install JDK"

apt-get install openjdk-7-jre-headless --assume-yes


echo "###########################################################"

echo "## Install Eclipse"

echo "###########################################################"

echo "# Get Eclipse Juno for Linux (32 bit)"

wget http://mirror.netcologne.de/eclipse//technology/epp/downloads/release/juno/SR1/eclipse-jee-juno-SR1-linux-gtk.tar.gz&mirror_id=580

echo "# Unzip the Eclipse  tar file into the current folder"

tar xzf eclipse-jee-juno-SR1-linux-gtk.tar.gz

 

echo "# Move it to the opt directory"

mv eclipse /opt/

 

echo "###########################################################"

echo "## Start Eclipse"

echo "###########################################################"

/opt/eclipse/eclipse -clean

You need to ensure that the text #!/bin/bash is really on the first line. Additionally you'll also have to adapt the filename for the SDK you've downloaded to the name in the script in line 7

filenameNeoSdk=neo-sdk-1.17.0.zip

Save the file and exit the editor by closing it.

 

Before you can run it you need to make the bash file executable. You do that with the following command:

chmod +x install.sh

 

The only thing left to do now is to run the script and wait until Eclipse starts.

./install.sh

What will the script do? It'll

  • first update the Ubuntu OS itself (till line 21)
  • install Java on Ubuntu (line 23 - 27)
  • install Eclipse Juno (line 29 - 38)
  • start Eclipse (line 43)

 

Step 4: Setting up Eclipse

This is the part I'm still not happy with. Ideally one could install the SAP NetWeaver tools via the command line, too. Unfortunately I wasn't able to make that work. In theory this should work with the p2 director application, but I wasn't able to provide the SCN credentials to the script.

So just follow the instructions on the SAP NetWeaver Cloud Update Site on step number 3 and you're done :-)

 

 

Step 5: Taking advantage of the VM

Once you were able to setup everything properly you should create a snapshot of your VM and secure it. From this point on you can restore the VM whenever you want and have a fully functional development environment for SAP NetWeaver Cloud.


Not 100% there, yet

If I compare what I've tried to achieve and what I was able to do I wasn't successful in automating everything. There are a few things left:

  • In case you have an idea how to automate the installation of the SAP NetWeaver tools via the command line, please let me know and I'll update this blog accordingly.
  • Adding the NetWeaver server automatically would be another thing I'd like to see being automated. Again maybe some of you have an idea on how to best do it via the command line. Please let me know.
  • Any other idea how to improve the script? Please add a comment to this blog and I'll try to incorporate it.

 

It was a nice exercise to setup the script and install the development environment for SAP NetWeaver Cloud.

I hope you find this useful, too.

 

Best,

Rui

Delete old log files

$
0
0

I'm looking for a functionality to delete old log files from an application deployed on the nw cloud but I wasn't able to spot it yet. Neither the neo sdk tools nor the web page https://account.netweaver.ondemand.com/ seem to provide such a functionality. As a workaround I'd also be happy with some kind of logrotate functionality where I can manually trigger a rename of the existing logs so I can start with a new and empty log file.


Web application bundles (wab) on nw cloud

$
0
0

Is it possible (or planned to be supported) to deploy web application bundles on the nw cloud? According to the documentation one can deploy wars and osgi bundles. I just tried to deploy a minimal wab with a single servlet. The wab has a its classes under WEB-INF\classes, a web.xml fle and a manifest with the web contextpath entry and the the bundle class path set to WEB-INF\classes. After starting the app I can see in the log files entries like '

#DEBUG#com.sap.core.js.admin.operations.AdminOperations##anonymous#RMI TCP Connection(17)-10.78.1.9##foo#app#web#null#null#All bundles are active|

2013 01 28 10:22:40#+00#DEBUG#com.sap.core.js.admin.operations.AdminOperations##anonymous#RMI TCP Connection(17)-10.78.1.9##foo#app#web#null#null#All bundles are active|

2013 01 28 10:22:40#+00#DEBUG#com.sap.core.js.admin.operations.AdminOperations##anonymous#RMI TCP Connection(17)-10.78.1.9##foo#app#web#null#null#All bundles are resolved|

2013 01 28 10:22:40#+00#DEBUG#com.sap.core.js.admin.operations.AdminOperations##anonymous#RMI TCP Connection(17)-10.78.1.9##foo#app#web#null#null#Context path [webconsole] not found in any of the web application paths|

2013 01 28 10:22:40#+00#DEBUG#com.sap.core.js.admin.operations.AdminOperations##anonymous#RMI TCP Connection(17)-10.78.1.9##foo#app#web#null#null#Applications not started yet: {webconsole=Application with context path [webconsole] is not started.}|

2013 01 28 10:22:40#+00#DEBUG#com.sap.core.js.admin.operations.AdminOperations##anonymous#RMI TCP Connection(17)-10.78.1.9##foo#app#web#null#null#Not all applications started yet|

'

Is there anything else required? I've seen at http://zeroturnaround.com/software/jrebel/resources/documentation/jrebel-how-to-getting-started-with-sap-netweaver-cloud/ that they use a touchpoint action for p2 to extract the bundle but don't know if this is a strict requirement? The documentation is definitely lacking some details here. Also I wasn't able to find a list of the provided bundles/packages in the nw cloud. Sure one can enable the debug level logging (thats what I've done) and look at the output here but this isn't really cool.

Deployment to local server hangs occasionally due to ZipError

$
0
0

Hi,

I am experiencing this very often, but not I don't know how it can be provoked so it can be reproduced. It happens when I start the local server, while the WAR (config\.\pickup\server.war) is deployed.

However, when it happens, the Job hangs, and I cannot cancel. Restarting Eclipse is no option, as the Job is still running. So I can either kill Eclipse, or wait until a timeout is reached and the Job exits.

 

Is it possible to make the deployment job cancelable? Or at least catch up from the error and exit the job.

 

Below the stacktrace...

 

Regards, Sebastian

 

17:17:43,610 [com.sap.core.js.logging.bridge.OSGILogListener@4dfe7933] ERROR org.eclipse.osgi (OSGILogListener.java:62) writeLogTrowable - An unexpected runtime error has occurred. The application will terminate.java.util.zip.ZipError: jzentry == 0,

jzfile = 1739899488,

total = 853,

name = D:\Dev\sap-cloud\workspace\Servers\Local Test Server for SAP NetWeaver Cloud-config\webapps\server\WEB-INF\lib\jaxb-impl-2.2.6.jar,

i = 337,

message = null

    at java.util.zip.ZipFile$1.nextElement(ZipFile.java:527)

    at java.util.zip.ZipFile$1.nextElement(ZipFile.java:505)

    at java.util.jar.JarFile$1.nextElement(JarFile.java:246)

    at java.util.jar.JarFile$1.nextElement(JarFile.java:241)

    at org.apache.tomcat.util.scan.FileUrlJar.nextEntry(FileUrlJar.java:77)

    at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1995)

    at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1943)

    at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1928)

    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1322)

    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)

    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)

    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)

    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)

    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5173)

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)

    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)

    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)

    at org.eclipse.gemini.web.tomcat.internal.TomcatServletContainer.startWebApplication(TomcatServletContainer.java:125)

    at org.eclipse.gemini.web.internal.StandardWebApplication.start(StandardWebApplication.java:109)

    at org.eclipse.gemini.web.extender.WebContainerBundleCustomizer.addingBundle(WebContainerBundleCustomizer.java:45)

    at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:482)

    at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:1)

    at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:262)

    at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:185)

    at org.osgi.util.tracker.BundleTracker.open(BundleTracker.java:163)

    at org.eclipse.gemini.web.extender.ExtenderActivator$ExtendedWebContainerTracker.addingService(ExtenderActivator.java:59)

    at org.eclipse.gemini.web.extender.ExtenderActivator$ExtendedWebContainerTracker.addingService(ExtenderActivator.java:1)

    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:980)

    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)

    at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:262)

    at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:234)

    at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:941)

    at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:104)

    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)

    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)

    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)

    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)

    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)

    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)

    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)

    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)

    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:451)

    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:950)

    at org.eclipse.gemini.web.internal.WebContainerActivator$ServletContainerTracker.addingService(WebContainerActivator.java:117)

    at org.eclipse.gemini.web.internal.WebContainerActivator$ServletContainerTracker.addingService(WebContainerActivator.java:1)

    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:980)

    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)

    at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:262)

    at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:234)

    at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:941)

    at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:104)

    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)

    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)

    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)

    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)

    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)

    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)

    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)

    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)

    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:451)

    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:950)

    at org.eclipse.gemini.web.tomcat.internal.Activator.start(Activator.java:61)

    at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)

    at java.security.AccessController.doPrivileged(Native Method)

    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)

    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)

    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)

    at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389)

    at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1131)

    at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)

    at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)

    at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)

    at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)

    at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)

    at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)

    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)

    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

Sending attachments with javax.mail

$
0
0

Hi,

 

I'm having a bit of difficulty as it appears that the DataHandler class referenced in com.sap.javax.mail-1.41.jar javax.mail.internet.MimeBodyPart.setDataHandler is different to the one that is referenced in com.sap.javax.activation-1.1.1.jar

 

thus I'm getting:

 

java.lang.LinkageError: loader constraint violation: when resolving method "javax.mail.internet.MimeBodyPart.setDataHandler(Ljavax/activation/DataHandler;)V" the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) of the current class, au/com/discoveryconsulting/timesheet/demo/mail/MailEventSender, and the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) for resolved class, javax/mail/internet/MimeBodyPart, have different Class objects for the type n/DataHandler;)V used in the signature

 

my build path has the SAPNWCloud components above the JRE so the SAP libs should be the ones that are being referenced and not the ones from the JDK.

 

I'm currently running SDK 1.12 - so will update to 1.17 and see if that makes a difference...

 

this is the code that's dying:

 

MimeBodyPart sigAttachment = new MimeBodyPart();                              mainPart.addBodyPart(sigAttachment);                                FileDataSource sigDS = new FileDataSource(                                                  "/images/Discovery_email_sig.jpg");                              sigAttachment.setDataHandler(new DataHandler(sigDS)); //this line here!

 

Any pointers much appreciated.

 

Cheers,


Chris

NetWeaver Cloud Trial downtime announcements

$
0
0

In this discussion we are going to announce NetWeaver Cloud Trial landscape infrastructure downtimes.

 

Regards,

NetWeaver Cloud operations team

Sending formatted email with inline images from #sapnwcloud

$
0
0

Hello, and welcome to another blog in the series Joanna Chan and I are writing about our experiences and learning building a mobile application using the SAP NetWeaver Cloud as a platform. Sorry for the hashtag or should I say mot-dièses in the title, it just means linking to it in twitter becomes easier

 

Long live the whiteboard but the code's in the blog!

As has been the case with my other blogs in this series, I've thrown together a little video which goes through the key points of the blog and tries to explain them with the help of a few whiteboard drawings. This time however, I'll leave my code walkthrough to the blog - so please excuse the rather copious amounts of code below.

 

 

The video as embedded in the SCN blog is a little on the small size, so please feel free to open in another window if you want to make it a little bigger. http://www.youtube.com/watch?v=Uefr4HWLeM8

 

Problem:

So, we want to be able to send a user an email confirming that they have successfully sent their time sheet entries to our cloud repository. We want this email to be nicely formatted. An image or two in the body/sig block of the email would be nice. We'd like to group all the time sheet entries for a given user into one email. So if the user sends 10 time sheet entries through, only 1 email should be sent. But if they only post 1, then only 1 should be sent.

problem.jpg

 

Hundreds of emails

The first issue here is how on earth to only send one email, given that the trigger for the emails is a POST or a PUT to the time sheet entry resource?

 

solution.jpg

 

What we need to do somehow is to gather up all the triggers/posted entries into a bucket and send the bucket-load over. What we need is some way for the first time sheet entry to put up a flag that any subsequent entries can see and gather around. Then we need some way that the flag can be brought down after a certain amount of time has passed and send the email with the details of all the entries collected to that point. Sounds reasonable (although not simple) but how on earth does one achieve that?

 

 

 

 

Threads, synchronised methods and delayed action

In Java, just as in ABAP, it is possible to have asynchronous processes started from the same thread. and communicate with each other. In ABAP this in practice proves to be tricky as it means calling an RFC and communicating via polling shared memory areas. In Java, it's a bit simpler than that, and a decent part of the language deals with just this point. Whereas in ABAP the easily addressable memory space of a program is constrained to a single process (outside of using shared memory construction), in Java this is not the case.

 

I have a class - UserMailSender that has a private constructor, this means that it cannot be instantiated from outside of methods within the class itself. (It also mucks up subclassing it, but that's a different issue). That means a static method of the class must be used to create an instance. This design pattern is somewhat similar to the singleton design pattern that I love so much to hate. However, in this use case it makes sense - even if it isn't actually a singleton. (I'm sure that this design pattern should have a name - factory was closest I could find, but it doesn't really fit.) (Leave a comment if you know what the design pattern should be called!)

 

The method to actually trigger the sending of an email is:

 

public static synchronized UserMailSender addEntryForMail(                                                TimeSheetEntry entry, ServletContext context) {                synchronized (threadLock) {                                // see if there already exists an instance for this user                                UserMailSender foundInstance = null;                                int userId = entry.getAssociatedDay().getAssociatedUser().getId();                                Iterator<UserMailSender> mailerIter = mailSenders.iterator();                                while (foundInstance == null && mailerIter.hasNext()) {                                                UserMailSender mailer = mailerIter.next();                                                if (mailer.getUserId() == userId) {                                                                foundInstance = mailer;                                                }                                }                                if (foundInstance == null) {                                                foundInstance = new UserMailSender(userId, context);                                                mailSenders.add(foundInstance);                                }                                foundInstance.addEntry(entry);                                return foundInstance;                }
}

 

By specifying that the method is synchronized we can be sure that only one call to it will occur at a time, other calls will wait until the previous call is finished. (This does result in a bottleneck in our code, but so far this doesn't seem to be  a problem.) By further specifying within the code that a synchronised block exists we can "enqueue" , to use a more ABAP term, the handling of the list so that only one thread at a time may have access to add, retrieve or delete instances from the global list of email handlers.

 

It is this method that is called from the servlets (see my previous blog for more details:

 

protected void doPost(HttpServletRequest request,                                                HttpServletResponse response) throws ServletException, IOException {
...                // store in db                userData.store(entry);                // send email                UserMailSender.addEntryForMail(entry, this.getServletContext());       /send JSON response                outputResponse(entry, request, response);
....

 

When the method is called, it checks through a list of existing instances to see if a class has been instantiated for the current user id. (A HashMap or other lookup would probably be better code here than just looping through the array, but given the number of users I'm guessing would concurrently access my application, it's probably not worth fretting about). If I find an instance, then I call the addEntry method on it. If I can't find an instance I create one and add it to the list of existing instances.

 

Now, an interesting thing need to happen when we create that instance. It needs to shut itself down after a certain period of time, and remove itself from the list of instances available for users.

 

So in the constructor method of the class:

 

private UserMailSender(int userId, ServletContext context) {                this.userId = userId;                // can only be instantiated via static method                // on instantiation, create a callback that will trigger in 1 minute                Thread callBackThread = new Thread(new waitThenSendMail(this, context));                callBackThread.start();
}

 

I create a new "thread" or asynchronous task. This thread is started using the start() method. The constructor for the thread requires that you pass it an instance that implements the Runnable interface. So I have created a private inner class which does this:

 

private class waitThenSendMail implements Runnable {                UserMailSender userMailSender;                ServletContext context;                public waitThenSendMail(UserMailSender userMailSender,                                                ServletContext context) {                                this.userMailSender = userMailSender;                                this.context = context;                }                @Override                public void run() {                                try {                                                Thread.sleep(DELAY_BEFORE_SEND);                                } catch (InterruptedException e) {                                                // that's cool just send the mail                                }                                UserMailSender.removeMailer(userMailSender.getUserId());                                   userMailSender.sendMail(context);                                       }
}

 

Note how the constructor of this class takes a reference to the instance of UserMailSender class that called the thread. Another important point to note is that a reference to ServletContext is being passed through to all of these methods - this is so that we can eventually pass it to the sendMail method that is called in the implementation of the run() method. The run() method tries to sleep for however long I like (I've used 60 secs as I think this is quite reasonable). This is possible because we have a separate process that is not blocking anything else from occurring. Just that one thread is paused. Once it has finished sleeping, the thread then (and this is quite important) removes the reference to the instance from the global list.

 

private static synchronized void removeMailer(int userId) {                synchronized (threadLock) {                                UserMailSender foundInstance = null;                                Iterator<UserMailSender> mailerIter = mailSenders.iterator();                                while (foundInstance == null && mailerIter.hasNext()) {                                                UserMailSender mailer = mailerIter.next();                                                if (mailer.getUserId() == userId) {                                                                foundInstance = mailer;                                                }                                }                                if (foundInstance != null) {                                                int index = mailSenders.indexOf(foundInstance);                                                if (index != -1) {                                                                mailSenders.remove(mailSenders.indexOf(foundInstance));                                                }                                }                }
}

 

Like the method that fetched/created the instance in the global list, this method is synchronised both by definition and by the user of a synchronized block to ensure that only one thread at a time adds or removes entries.

Once we are sure that no more entries will be added to the current list (it is "finalised") then we start the process of actually sending the email.

 

Emails using NWCloud - setting it up

Before I could send an email from NWCloud there is a bit of a work to do in order to set it up.  You firstly will need an email account to send the emails from. The online documentation states that you can " integrate your own e-mail provider (currently subject to restrictions)" so whilst I do know that Google mail users (including apps users) do work, if you're using anything else, it might not! The online doco is pretty good, so I won't repeat it here. But will just clarify a few things that were perhaps not as straightforward.


Testing locally

You'll need to paste a copy of your email set-up xml into your local cloud set-up. And you'll need to re-do this every time you patch to a new SDK level! So it is worth keeping a copy with your application.

store_session_file.jpg

I store a copy in my WEB-INF folder. It might be an extra piece of info to deploy to the cloud, but it's a nice easy place to keep track of it. In the version 2.x of the NetWeaver Cloud this process is supposed to become easier I understand. Good thing too!

 

You'll need to copy this file to a folder of the "Servers" project  in Eclipse:

where_to_put_session_file.jpg

(Now wasn't that simpler than the doco ).

 

Deploying to the NWCloud Trial system

The next step is to deploy also to the cloud. You'll need to use the command line interface for this:

Uploading to cloud.png

 

One thing the doco doesn't mention is that you'll need to add the --host parameter with a link to the trial system, otherwise it defaults to the productive NWCloud. BTW - I've upgraded to a later SDK since I took the screenshot if you were wondering! You'll notice also that the content of the parameter values differ somewhat from the suggestions in the doco. All I can say is that you have proof in that there screenshot - what I entered worked!

 

 

Multipart MIME Messages

So now we have a collection of data that we want to send as an email, we have the required email account, and we uploaded that info to the cloud - how do we actually send the email? Well, before we can do that, we need to understand how to build that email.

 

The emails that you receive today are generally formatted as Multipart Multipurpose Internet Mail Extensions (MIME) Messages . In order to programmatically send one of these messages it helps to have a little understanding of what they are and how they are put together.

 

A multipart MIME message allows us to send the nicely formatted emails that most email clients support, along with images. Unlike HTML pages where the  browser fetches each image individual and the user agent string can be used to redirect the user to an appropriate rendering of the content, in MIME messages all the content, including alternate renderings must all be sent at once.

 

For our purposes there are two important multipart subtypes - Alternative and Related.

 

MIME.jpg

 

We need to create a message that has Related parts (that is to say the formatted text of the message and an inline image) but we also need to allow for the case were the email client that is used to receive our email does not know how to display HTML formatted documents, so we need to drop back to just using plain text. This requires us to use the Alternative subtype.

 

There a many different MIME types that we could use to convey our formatted message, but I'll use HTML as it's pretty darn simple and has lots of formatting options.

 

Building the HTML message

 

I threw together some code to build the message from the user object and the list of entries that should be sent:

 

public String getHTMLMailText(List<TimeSheetEntry> entries) {                String entriesText = "";                Iterator<TimeSheetEntry> entriesIter = entries.iterator();                int index = 0;                while (entriesIter.hasNext()) {                                index++;                                TimeSheetEntry entry = entriesIter.next();                                String times = "";                                if (entry.getHours() == 0) {                                                times = "Start to End: " + entry.getStartTime() + " - "                                                                                + entry.getEndTime();                                } else {                                                times = "<b>Hours:</b> " + entry.getHours() + " hours";                                }                                if (entry.isBillable())                                {                                                times += " (billable)";                                }                                else                                {                                                times += " (non-billable)";                                }                                String entryText = String.format("<p><b>Date:</b> "                                                + entry.getAssociatedDay().getDay().substring(6, 8) + "/"                                                + entry.getAssociatedDay().getDay().substring(4, 6) + "/"                                                + entry.getAssociatedDay().getDay().substring(0, 4)                                                + "</p><p>" + "<b>Project:</b> " + entry.getProjectCode()                                                + " - " + entry.getProjectName() + "</p><p>" + times                                                + "</p><p>" + "<b>Comments:</b> " + entry.getComments()                                                + "</p>");                                String divColor;                                if (index % 2 == 0) {                                                divColor = "#dcedf9";                                } else {                                                divColor = "#e8f3fb";                                }                                entriesText += "<div style=\"background-color:" + divColor + "\">"                                                                                + entryText + "</div>";                }                String text = String                                                .format("<p>Hi "                                                                + name                                                                + ",</p>"                                                                + "<p><i>Thanks for using the Discovery Consulting demonstration "                                                                + "mobile application.</i></p>"                                                                + "<p><i>If you would like to speak to one of our team on how we "                                                                + "can assist your enterprise, please reply to this email or contact "                                                                + "us on 0418105358.</i></p>"                                                                + "<p>Your time sheet entries have been successfully received "                                                                + "and will be transferred to payroll.</p>"                                                                + "<div style=\"background-color:#dcedf9\"> "                                                                + entriesText                                                                + "</div>"                                                                + "<p></p><p>Regards,</p>"                                                                + "<p>Discovery Consulting Group Pty Ltd</p>");                return text;
}

 

There was a slightly amusing (for me) exchange between our client relations person (great bloke is Leigh) and me when he offered to help with the formatting of the email, and I sent him an early version of this code and told him to go for it . Afterwards we refined terms a little - he sent me a mock-up and I did the formatting and we think it's not a bad result!

 

One of the things to note is that HTML in emails does not render the same way as HTML in your browser in every case, you may have very little control over things like margins between divs etc. So it is worth while testing and doing more testing. Don't forget that most people read email via mobile devices, so make sure you test those too. In this example code we've got a very simple alternating background colour for the time sheet entries to help distinguish one from the other.

 

Using the javax.mail services in NWCloud - adding inline images

 

Please excuse the gratuitous code in this section - but I think it's the best way to explain it! Here's the code that I use to send my emails.

 

package au.com.discoveryconsulting.timesheet.demo.mail;

import java.io.File;
import java.util.List;
import java.util.UUID;

import javax.mail.Message.RecipientType;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import javax.naming.InitialContext;
import javax.servlet.ServletContext;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import au.com.discoveryconsulting.timesheet.demo.TimeSheetUser;
import au.com.discoveryconsulting.timesheet.demo.entries.TimeSheetEntry;

public class MailEventSender {

                Transport transport;                Logger logger = LoggerFactory.getLogger(MailEventSender.class);                public void sendEmail(TimeSheetUser user, List<TimeSheetEntry> entries,                                                ServletContext context) {                                try {                                                InitialContext ctx = new InitialContext();                                                Session smtpSession = (Session) ctx                                                                                .lookup("java:comp/env/mail/Session");                                                transport = smtpSession.getTransport();                                                transport.connect();                                                MimeMessage mimeMessage = createMimeMessage(                                                                                smtpSession,                                                                                "'Discovery Mobile Demo' <timesheetdemo@discoveryconsulting.com.au>'",                                                                                user.getSettings().getEmail(),                                                                                "Demo Time Sheet Successfully Received",                                                                                user.getMailText(entries), user.getHTMLMailText(entries),                                                                                context);                                                transport.sendMessage(mimeMessage, mimeMessage.getAllRecipients());                                                transport.close();                                } catch (Exception e) {                                                logger.error(e.toString());                                }                }

 

The only public method of the email sending class is what was called from our time sheet entries aggregation logic. It get a reference to the email setup that we have loaded onto our server and then creates a MIME message using the private createMimeMessage method. It then uses the references to the email setup to send the message.

 

Ok - I'm going to try to break this code down a little.

 

private MimeMessage createMimeMessage(Session smtpSession, String from,                                String to, String subjectText, String mailText, String mailHTML,                                ServletContext context) throws MessagingException {                try {                                MimeMessage mimeMessage = new MimeMessage(smtpSession);                                InternetAddress[] fromAddress = InternetAddress.parse(from);                                InternetAddress[] toAddresses = InternetAddress.parse(to);                                mimeMessage.setFrom(fromAddress[0]);                                mimeMessage.setRecipients(RecipientType.TO, toAddresses);                                mimeMessage.setSubject(subjectText, "UTF-8");

 

Up to here it's pretty simple really - just creating the message and setting who it's from, to and the subject. It's the next bit that gets tricky! I even included a picture in my code to help me understand what the heck was happening ! Of course the inline Java formatting used in SCN doesn't use a fixed width font, so the pictures kinda screwed up...

 

                                // create main message                                // +----------------------------------------------+                                // | multipart/related........................... |                                // | +---------------------------+ +------------+ |                                // | |multipart/alternative..... | | image/jpg. | |                                // | | +-----------+ +---------+ | |........... | |                                // | | |text/plain | |text/html| | |........... | |                                // | | +-----------+ +---------+ | |........... | |                                // | +---------------------------+ +------------+ |                                // +----------------------------------------------+                                MimeMultipart mainPart = new MimeMultipart("related");

 

Firstly the related multipart is created,

 

                                // add the messages                                MimeBodyPart messageWrapper = new MimeBodyPart();                                MimeMultipart messagesPart = new MimeMultipart("alternative");                                MimeBodyPart html = new MimeBodyPart();                                MimeBodyPart plaintext = new MimeBodyPart();                                messagesPart.addBodyPart(plaintext);                                messagesPart.addBodyPart(html);

 

Then a new MimeBodyPart is created to insert the alternative multipart which contains both the HTML and plain text formatted versions of the email.

 

                                messageWrapper.setContent(messagesPart);                                mainPart.addBodyPart(messageWrapper);                                MimeBodyPart sigAttachment = new MimeBodyPart();                                mainPart.addBodyPart(sigAttachment);

 

The content of the alternative multipart is then inserted into the body part that is then added to the main related multipart. Another body part is created to hold the footer image that I use in my email.

                                // create the details for the sig content                                String embeddedAttachmentId = UUID.randomUUID().toString();                                String mailHTMLWithSig = "<html><body>" + mailHTML                                                                + "<p><img src=\"cid:" + embeddedAttachmentId                                                                + "\" alt=\"ATTACHMENT\"></p></body></html>";                                String sigPath = context                                                                .getRealPath("/images/Discovery_email_sig.jpg");                                File sigFile = new File(sigPath);                                sigAttachment.attachFile(sigFile);                                sigAttachment.setContentID("<" + embeddedAttachmentId + ">");                                sigAttachment.setHeader("Content-Type", "image/jpg");                                sigAttachment.setFileName(sigFile.getName());

 

This is where I really had some fun!  Unfortunately in NWCloud 1.x the email libs don't quite work as they should , so I had a bit of fun trying to get the javax.mail.internet.MimeBodyPart setDataHandler method working.  End result it doesn't and I had to try something else. Fortunately the attachFile method does work so I found some way of getting the image file into the MIME message. However, in order to do that, I needed to get a reference to the image file itself.

 

Fortunately there happens to be a way to get real file references from virtual paths (the ones used in your eclipse project) through the ServletContext method getRealPath. This was why all the email aggregation logic kept a reference to this servlet context. So that the context could be used in the final email handling to get a file handle for the image file to be sent.

 

Some other stuff that's worth noting, is that when calling the setContentID method the id needs to be inside carets  <> otherwise it doesn't work.

I've wrapped the HTML that I got for the entries  with a simple <html>  and <body> tags and added the attached image into the HTML with a reference to "cid:" or content-id and the GUID I created to reference the associated image.

 

                                plaintext.setText(mailText, "utf-8", "plain");                                html.setText(mailHTMLWithSig, "utf-8", "html");                                mimeMessage.setContent(mainPart);                                return mimeMessage;                } catch (Exception e) {                                logger.error(e.toString());                                return null;                }
}

 

Finally I actually load the generated HTML into the HTML body part, the plain text in the plain text body part and link the whole lot to the MIME message object that had the to, from, subject etc.

 

The result

successful_email.jpg

I'm really happy with the generated email, it looks good and it took some rather tricky work to get it there.

For those that are interested - here's the actual MIME message, including the plain text version of the email (minus all the server/send headers):

 

Date: Tue, 29 Jan 2013 00:35:55 -0800 (PST)
From: "'Discovery Mobile Demo'" <timesheetdemo@discoverydemo.com.au>
To: chris@wombling.com
Message-ID: <1594048334.5.1359448554627.JavaMail.javamailuser@localhost>
Subject: Demo Time Sheet Successfully Received
MIME-Version: 1.0
Content-Type: multipart/related;                 boundary="----=_Part_3_779503997.1359448552910"
X-Gm-Message-State: ALoCoQn7Kwk/A+NOBGgOVc754vUHDP41PADsZNMBpjI8HZk+8Xm5OY21WF0vgk2uvT+439s+Ilrx

------=_Part_3_779503997.1359448552910
Content-Type: multipart/alternative; 
                boundary="----=_Part_4_1473430879.1359448552910"

------=_Part_4_1473430879.1359448552910
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

Hi Chris Paine,

Thanks for using the Discovery Consulting demonstration mobile application.
If you would like to speak to one of our team on how we can assist your enterprise, please reply to this email or contact us on 0418105358.
Your time sheet entries have been successfully received and will be transferred to payroll.

Date: 20120115
Project: DISCO1 Timesheet demo app
Hours: 8.0 hours (non-billable)
Comments: I really hope this works

Date: 20120116
Project: DISCO1 Timesheet demo app
Hours: 10.0 hours (non-billable)
Comments: Working really hard

Date: 20120117
Project: DISCO1 Timesheet demo app
Hours: 12.0 hours (non-billable)
Comments: Must get emails working



Regards,
Discovery Consulting Group Pty Ltd

------=_Part_4_1473430879.1359448552910
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><body><p>Hi Chris Paine,</p><p><i>Thanks for using the Discovery Cons=
ulting demonstration mobile application.</i></p><p><i>If you would like to =
speak to one of our team on how we can assist your enterprise, please reply=
 to this email or contact us on 0418105358.</i></p><p>Your time sheet entri=
es have been successfully received and will be transferred to payroll.</p><=
div style=3D"background-color:#dcedf9"> <div style=3D"background-color:#e8f=
3fb"><p><b>Date:</b> 15/01/2012</p><p><b>Project:</b> DISCO1 - Timesheet de=
mo app</p><p><b>Hours:</b> 8.0 hours (non-billable)</p><p><b>Comments:</b> =
I really hope this works</p></div><div style=3D"background-color:#dcedf9"><=
p><b>Date:</b> 16/01/2012</p><p><b>Project:</b> DISCO1 - Timesheet demo app=</p><p><b>Hours:</b> 10.0 hours (non-billable)</p><p><b>Comments:</b> Worki=
ng really hard</p></div><div style=3D"background-color:#e8f3fb"><p><b>Date:=</b> 17/01/2012</p><p><b>Project:</b> DISCO1 - Timesheet demo app</p><p><b>=
Hours:</b> 12.0 hours (non-billable)</p><p><b>Comments:</b> Must get emails=
 working</p></div></div><p></p><p>Regards,</p><p>Discovery Consulting Group=
 Pty Ltd</p><p><img src=3D"cid:f5ab0d22-17e7-49c5-9ddd-a861e5ce089a" alt=3D=
"ATTACHMENT"></p></body></html>
------=_Part_4_1473430879.1359448552910--

------=_Part_3_779503997.1359448552910
Content-Type: image/jpg; name=Discovery_email_sig.jpg
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=Discovery_email_sig.jpg
Content-ID: <f5ab0d22-17e7-49c5-9ddd-a861e5ce089a>

/9j/4AAQSkZJRgABAQEAeAB4AAD/2wBDAAoHBwkHBgoJCAkLCwoMDxkQDw4ODx4WFxIZJCAmJSMg
IyIoLTkwKCo2KyIjMkQyNjs9QEBAJjBGS0U+Sjk/QD3/2wBDAQsLCw8NDx0QEB09KSMpPT09PT09
<snip> - for the sanity of us all!
+4PzoooAXdL/AM8x+dG6X/nmPzoooAduf+5+tOHSiigBaKKKACiiigAooooAKKKKACiiigAooooA
KKKKACiiigAooooAKKKKACiiigAooooAKKKKAP/Z
------=_Part_3_779503997.1359448552910--

Wrap up - key learnings, what else I'd implement

Sending an email with an image attachment, a company logo or a picture of the item you just ordered, whatever is quite possible using the SAP NWCloud. This generates some very interesting possibilities. I certainly see a much more interactive solution in the future. (That is if we're still using email!)

 

One key learning I had here is to re-examine every design choice/restriction that I've used/had with ABAP code. It is likely that it is either not relevant or is possible when using the NW Cloud - I just have to figure out how. That's not to say it's not possible with ABAP - it's just quite often easier in the cloud.

 

I'm very chuffed with my solution, especially as I had not found anyone else writing about using SAP NWCloud to send emails with inline images (and even blogs on using javax.mail are relatively few)! However, something that I should have implemented, but didn't - was some way of verifying that the email address that the user has entered is their own. A simple email verification link would have been simple to build using SAP NW Cloud, and is certainly a requirement for any productive solution like this where the user can enter their own (or if they wanted to, someone else's) email address. (I did default the email address when the user signs in using Google - but what would be good would be to also default a "validated email address" flag.)  There is all sorts of legislation regarding spam emails which I should probably try to be very careful about. In Australia, for example, any "commercial electronic message" must have a means for the recipient to unsubscribe and can be backed up by court action and fines! (Better get working on implementing that one!)

 

As per my previous blog, I'd like to implement some decent JUnit tests here too. If for nothing else than to give me some exercise in understanding how they could help with the development or potentially be a PITA.

 

Disclaimer, ramblings and what's next

As usual, even if I make outrageous claims like "here is the code I used", it's all for use at your own risk, I don't promise that any of it works or won't completely bugger up your system. Likewise, none of my ridiculous ramblings should be taken to be indicative of the opinion of my wonderful and very patient employer (who has had to deal with me not being able to come into the office again today as my poor little girl isn't feeling too well!)  If you do reuse my code, some attribution would be appreciated but really what is code development if not elaborate copy/paste. These are my opinions, ramblings and mistakes. I've tried not to offend, imply anything which might offend or eat fresh raspberries with whipped cream whilst putting together this blog. I'm pretty sure I've failed on one point there.

 

Next blog will likely be the use of CORS to allow successful connections from mobile devices to the cloud. But we'll see! (might be working on that unsubscribe button! )

 

In the meantime, and in my own time, I've put together a little page on www.wombling.com/BunkBed which shows that I don't just live, eat, sleep and dream SAP stuff - there is another side! (so there Jo! I know it's not quite the same as frocking up and writing a fashion blog, but it counts? cc John Moy.)

 

 

If you liked my blog and might even have found the code useful, please take a sec, log in and rate it and even click on the like button. So far Jo is getting far more likes than me and I'm nothing if not competitive. So if you want to have a little fun at my expense, please go read her blogs, rate them and like them and don't bother with mine .

SAP NetWeaver Cloud and BPM Rest API

$
0
0

In this blog I want to show you how to use the SAP NetWeaver Cloud and SAPUI5 and create a cloud application which connects securely with an on-premise SAP NetWeaver BPM system (7.3 or 7.31)

 

Inspired by all the great blogs about SAP NetWeaver Cloud recently published and some friendly reminders I decided to finally finish my first blog about SAP NetWeaver Cloud. It was on my to-do list and draft version for a very long time...

 

Last year when the SAP NetWeaver Cloud Beta Program was introduced I decided to join and sign up with the idea to create my Leave Request application in the cloud. After finishing this application came the idea to maybe submit a DemoJam entry for SAP TechEd Madrid. Actually Peter Peshev was the one suggesting I should participate with a SAP NetWeaver Cloud application. Thanks again Peter also for the great support during the beta-program and preparations for DemoJam.

The result: Twan van den Broek and me on stage at SAP TechEd DemoJam with our Garbage Collector SAPUI5 NetWeaver Cloud application.

 

On stage at TechEd DemoJam. The ultimate dream of every SAP Developer

More info and details about our DemoJam entry in a future blog.

 

My first application in the cloud

The idea I had for my first application is based on my previous blog. Where I showed how to develop a jQuery Mobile application for displaying and approving BPM Tasks with the BPM Rest API. I think this is an ideal application to put in the cloud:

  • No need to open up your NetWeaver 7.3(1) stack to the whole world
  • Secure connection to your On-Premise Backend System with the SAP Cloud Connector
  • Accessible anywhere and from any device

cloudapp.jpg

 

BPM Process

For the BPM Process I will use my sample project from my previous blog again: a Leave Request process. As mentioned by Matthias Steiner at SAPCodeJam Huizen“Leave Request is the new Hello World!”

 

This time I used the BPM Process from the document Building UIs with Ruby and Sinatra on NW BPM by Harald Schubert as example. This BPM process can be started by the employee when submitting the Leave Request. An administrator is not necessary to start the process as in my previous blog. This is how it looks now.

leaverequest.jpg

It’s a simple Leave Request where an employee submits a leave request and the manager approves or rejects it and gets a notification when the request is approved.

 

BPM RESTful API

For connection to this BPM Process I will be using the BPM Rest API again. More information about this service can be found here on Code Exchange and in this blog by Stefan Henke. Because this REST API is running on my on-premise system and is using Basic Authentication I had some challenges to make calls from the SAP NetWeaver Cloud.

  1. Basic Authentication on BPM Rest API. All call to the API need Basic Authentication.
  2. Same origin policy: To make it possible to make calls without having “Same origin policy” issues I created an HttpProxyServlet. All calls from my cloud application are redirect through this servlet.

For the first challenge I developed a simple LoginServlet. This servlet is running on my SAP NetWeaver 7.3 system. This servlet can be executed with parameters username and password and checks against the SAP UME if the supplied information is valid. If not it returns “NOK” as response. If user and password check are valid it returns “OK” with the user role.

 

LoginServlet running on SAP NetWeaver 7.3

package nl.ciber.login;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sap.security.api.IUser;
import com.sap.security.api.IUserAccount;
import com.sap.security.api.UMFactory;

/**
 * Servlet implementation class LoginValidator
 */
public class LoginServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;    /**     * @see HttpServlet#HttpServlet()     */    public LoginServlet() {        super();    }    /**     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)     */    protected void doGet(HttpServletRequest request, HttpServletResponse response)         throws ServletException, IOException {    }    /**     * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)     */    protected void doPost(HttpServletRequest request, HttpServletResponse response)         throws ServletException, IOException {        String username = request.getParameter("username");        String password = request.getParameter("password");        boolean result = false;        String returnValue = null;        try {            IUser user = UMFactory.getUserFactory().getUserByLogonID(username);            if (user != null) {                IUserAccount account = user.getUserAccounts()[0];                result = account.checkPassword(password);                if (result) {                    String firstname = user.getFirstName();                    String lastname = user.getLastName();                    String role = username; // Put portal role here (for now username)                    returnValue = firstname + " " + lastname + "|" + role;                }            }        } catch (Exception e) {            e.printStackTrace();        }        if (result) {            response.getWriter().println(returnValue);        } else {            response.getWriter().println("NOK");        }    }
}

 

For the second challenge I developed my own ProxyServlet. All requests from SAPUI5 are redirected to this Servlet. This servlet then executes the call serverside to the BPM API running on my on-premise NetWeaver 7.3 system and adds Basic Authentication to the requests. See this diagram for more information. No whiteboard video (like Chris Paine) yet, i will stick with powerpoint for now

sequencediag.jpg

HttpDestinations

Both servlets developed above make connection to the SAP NetWeaver 7.3 system by using Destination APIs from the SAP NetWeaver Cloud Connectivity Service like this:

 

<resource-ref>    <res-ref-name>logindest</res-ref-name>    <res-type>com.sap.core.connectivity.api.http.HttpDestination</res-type></resource-ref><resource-ref>    <res-ref-name>bpmdest</res-ref-name>    <res-type>com.sap.core.connectivity.api.http.HttpDestination</res-type></resource-ref>


In the web.xml they are configured and with JNDI lookup you can use them in your code:

 

Context ctx = new InitialContext();
HttpDestination destination = (HttpDestination) ctx.lookup("java:comp/env/bpmdest");
HttpClient createHttpClient = destination.createHttpClient();


These destinations can be configured on your local SAP NetWeaver Cloud or real SAP NetWeaver Cloud server via Eclipse:

connectivity.png

 

SAP Cloud Connector

To make a secure connection to your on-premise system the SAP Cloud Connector has to be used.

However there was another challenge. My first NetWeaver 7.3 was running on Windows and the SAP Cloud Connector is currently only available for SUSE Linux. Let’s hope it will be released for other platforms soon.

For my demo I was lucky that exactly at the right time there was the announcement of the new SAP NetWeaver 7.3 Trial for Linux. I downloaded it immediately and installed the SAP Cloud Connector on it. After installing the right rpm packages on the environment I could login to the SAP Cloud Connector and setup my secure connection to the SAP NetWeaver Cloud.

 

scc.jpg

After the initial configuration I got the message that “SAP Cloud Connector is operational”

 

scc_succesful.jpg

 

Next configuration is Access Control to the SAP NetWeaver BPM applications which is on the same machine and use the Ping Test applications for testing connectivity.

accesscontrol.jpg

More information about installation and configuration of the SAP Cloud Connector can be found here.

 

Note:I am aware that there is a possibility to use Single Sign-On and Identity Federation right now, but at the time of my developments this was not yet available and I am also not sure if this can be used together with SAP Connector. For more info about SAP NetWeaver Cloud Security Tutorial - Single Sign-On and Identity Federation with SAP NetWeaver Identity Management. See this document http://scn.sap.com/docs/DOC-35457

 

SAPUI5

Final part of my application is the front-end. For this I used the UI Development Toolkit for HTML5 better known as SAPUI5. When installing the Eclipse plug-ins for SAP NetWeaver Cloud the UI Development toolkit is automatically included. This way you can easily create a SAPUI5 application from scratch with wizards and you will get SAPUI5 javascript code-completion.

 

sapui5app.jpg

My application contains one shell with 3 nested views. As example for my project I used the great blog by John Patterson where he describes how to nest the views in one shell and handle navigation between them.

My application consists of 4 views with their controllers.

  • Shell – the main application frame for the other views
  • Login – Login form
  • Leave – Leave Request form for the employee
  • Approve – Approval inbox and form for the manager

 

Asynchronous HTTP requests with jQuery

From the SAPUI5 controllers several REST calls are executed for retrieving and submitting data to the LoginServlet and BPM RESTful Service. Here a short overview:


Login view
Behind the loginscreen there is asynchronous HTTP (Ajax) request to the LoginProxyServlet described above

 

$.ajax({         type: 'post',         url: 'LoginProxyServlet',        data: form,        dataType: 'text',        success: function(data) {            var loginData = $.trim(data);            if (loginData == "NOK") {                alert('Login failed! Please try again');            } else {                var oView = sap.ui.getCore().byId("view.shell");                var oCtrl = oView.getController();                oCtrl.navigateToView(loginData);            }        }
});

 

Leave view
In the controller of the leave view 4 REST call are involved to the BPM API

  1. Retrieve the right processdefinitionid of the BPM Process by name.
    GET: bpm/bpemservices/processdefinitions?vendor=ciber.nl&dcName=leaverequest~bpm&processName=LeaveRequest
  2. Retrieve the processstartid for this BPM Process
    GET: bpm/bpemservices/processstartevents?processDefinitionId=<processdefid>
  3. Retrieve the Process Start Data. Used for the data object
    GET: bpm/bpemservices/processstartevents/<processstartid>
  4. Post the start event with the data object populated with values from the leaverequest form.
    POST: bpm/bpemservices/processstartevents/<processstartid>

 

Approve view

For the approval screen the following data is retrieved and submitted with the RESTful API.

  1. Retrieval of tasks
    GET:
    bpm/bpemservices/taskinstances?status=READY&status=RESERVED
  2. Retrieve approve task data
    GET: bpm/bpemservices/taskinstances/<taskid>/input
  3. Submit data (Get schema, Claim task, Complete task)
    GET:
    bpm/bpemservices/taskinstances/<taskid>/output?schema=true
    PUT: bpm/bpemservices/taskinstances/<taskid>?action=CLAIM
    PUT: bpm/bpemservices/taskinstances/<taskid>?action=COMPLETE

 

The final result of this application can be viewed here:

 
The code for this SAP NetWeaver Cloud application can be found on github. In this application the SAPUI5 libraries are not included. For more information about setting up github and maven in eclipse. Check out this blog by Matthias Steiner.

To keep my github project clean I decided to use the general available bootstrap for sapui5. This way you don’t have to include any extra SAPUI5 libraries in your eclipse project. 


<script id="sap-ui-bootstrap"    type="text/javascript"  src="https://sapui5.netweaver.ondemand.com/resources/sap-ui-core.js"  data-sap-ui-theme="sap_goldreflection"  data-sap-ui-libs="sap.ui.commons,sap.ui.ux3,sap.ui.table"></script>

 

Disadvantage is that code completion for SAPUI5 will not work now, but that can be fixed by adding the UI5 project nature. More details in this blog by Christian Loos. about setting SAPUI5 in NWDS/Eclipse.

To run the application locally on your own SAP NetWeaver Cloud environment you can download the project from github. Update the pom file below to match your version of the SDK and set your NW_CLOUD_SDK_PATH environment variable to right location.

 

<properties>    <nw.cloud.jdk.version>1.6</nw.cloud.jdk.version>  <nw.cloud.sdk.version>1.17.0</nw.cloud.sdk.version>  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding></properties>

 

SAP NetWeaver 7.31 SP05 and SAPUI5 Inbox

Since SAP NetWeaver 7.31 SP05 it is possible to also use SAPUI5 directly from your BPM application. Instead of using WebDynpro Java, WebDynpro ABAP or Visual Composer screens it is possible to use SAPUI5 for UI Tasks. This way you have direct integration with the tasks and your SAPUI5 front-end. The new SAPUI5 Inbox control is used for retrieving tasks. I almost tried to use this new Inbox for our DemoJam in Madrid but I could not get it working on time….

Looking at the source code in the example I see that relative uri’s are used so I expect to make it work that the SAPUI5 front-end should be hosted on the same SAP NetWeaver 7.31 PO environment. But I am anxious to try it out and discover the possibilities.

 

Hope you enjoyed this blog and I should not forgot to mention the application shown here is just an example of what is possible by using SAP BPM, SAP NetWeaver Cloud and SAPUI5 and i could not resist to include the fantastic disclaimer I found in Joanna Chan’s latest blog.

Disclaimer: The above code, examples etc. are supplied with no guarantee to them actually being fit for use. Copy at your peril!

ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactorymanage

$
0
0

Hi guys,

 

I've unfortunately got an issue where I'm getting a low level class not found exception.

 

You can find the full stack trace attached but the jist is:

 

The server encountered an internal error () that prevented it from fulfilling this request.exception javax.servlet.ServletException: javax.naming.NamingException: Error while attempting to resolve reference [Root exception is javax.naming.NamingException: Could not create resource factory instance [Root exception is java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory]]

 

This error occurs time & time again for each workspace & version of eclipse. This error doesn't occur for any of my colleagues who follow the exact same steps.

 

The code that goes with it is:

 

try {            InitialContext ctx = new InitialContext();            ds = (DataSource) ctx.lookup("java:comp/env/jdbc/DefaultDB");
} catch (NamingException e) {            throw new ServletException(e);
}

 

 

Any help would be much appreciated

 

Thanks

 

Mark


SAPUI5 in web application bundle

$
0
0

I'm currently trying to build a simple web application bundle which makes use of sapui5. My bundle has roughly the following content:

 

`- META-INF/    `- MANIFEST.MF    `- p2.inf
`- WEB-INF/    `- classes/    `- lib/    `- web.xml
`- js/
`- resources/
`- index.html

 

The WEB-INF/lib folder contains the 13 jars for sapui5 version 1.8.6. The index.html includes the sap bootstrap js  and a local js which builds the shell content. The bootstrapping works but when it comes to the creation of the app specific sapui5 controllers and views I'm getting a browser error saying the resource is not available. On the server the log contains entries like:

 

javax.naming.NameNotFoundException: Name '/resources/foo/bar/l10n/messagebundle_en.properties' does not exist.
 at org.eclipse.gemini.web.tomcat.internal.loading.BundleDirContext.getNamedEntry(BundleDirContext.java:104)
 at org.eclipse.gemini.web.tomcat.internal.loading.BundleDirContext.doGetAttributes(BundleDirContext.java:169)
 at org.apache.naming.resources.BaseDirContext.getAttributes(BaseDirContext.java:1102)
 at org.apache.naming.resources.BaseDirContext.getAttributes(BaseDirContext.java:1055)
 at org.apache.naming.resources.ProxyDirContext.cacheLoad(ProxyDirContext.java:1613)
 at org.apache.naming.resources.ProxyDirContext.cacheLookup(ProxyDirContext.java:1536)
 at org.apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.java:297)
 at org.apache.catalina.core.ApplicationContext.getResource(ApplicationContext.java:536)
 at org.apache.catalina.core.ApplicationContextFacade.getResource(ApplicationContextFacade.java:201)
 at com.sap.ui5.resource.impl.ServletResourceLocator.findResource(ServletResourceLocator.java:87)
 at com.sap.ui5.resource.ResourceServlet.findResource(ResourceServlet.java:603)
 at com.sap.ui5.resource.ResourceServlet.findResource(ResourceServlet.java:622)
 at com.sap.ui5.resource.ResourceServlet.serveResource(ResourceServlet.java:453)
 at com.sap.ui5.resource.ResourceServlet.doGet(ResourceServlet.java:191)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
 at com.sap.security.auth.service.webcontainer.internal.Authenticator.invoke(Authenticator.java:147)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
 at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
 at com.sap.core.tenant.valve.TenantValidationValve.invokeNextValve(TenantValidationValve.java:169)
 at com.sap.core.tenant.valve.TenantValidationValve.invoke(TenantValidationValve.java:84)
 at com.sap.core.js.monitoring.tomcat.valve.RequestTracingValve.invoke(RequestTracingValve.java:27)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
 at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
 at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
 at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 at java.lang.Thread.run(Thread.java:722)|

 

Any hints someone?

NetWeaver Cloud downtime announcements

$
0
0

In this discussion we are going to announce NetWeaver Cloud infrastructure downtimes.

 

Regards,

NetWeaver Cloud operations team

Release Notes for SAP NetWeaver Cloud

$
0
0

Release Notes for SAP NetWeaver Cloud - January 31st

 

FunctionType of ChangeDescription

SAP Cloud Connector

Enhancement

SAP Cloud Connector (SCC) 1.2.0 has been released with the following enhancements:

  • An automatic check for landscape host and proxy (if existing) that shows whether a connection to the Cloud is possible. The result appears on the Home tab.
  • A manual connectivity check for all exposed systems, which shows whether the backend is reachable from SCC.
  • A process monitor that shows the status of all SCC processes and provides a restart option for the different process groups.

You can download SAP Cloud Connector via the SAP NetWeaver Cloud update site -> Additional Software tab.

 

 

Release Notes for SAP NetWeaver Cloud - January 17th

 

FunctionType of ChangeDescription

Sample Application “Paul the Octopus”

New

“Paul the Octopus” is a sample Web application that provides a complete example of all platform services of SAP NetWeaver Cloud, synchronously working together. The application code samples are provided and explained in details in a community blog.

For more information, see:

Community blog: Get Ready for Your Paul Position

Documentation: Running Sample Applications.

SAP NetWeaver Cloud Persistence ServiceEnhancement

The SAP HANA database is now available for use on the nwtrial.ondemand.com landscape. The default database type to be used (the SAP HANA database or SAP MaxDB) can be selected when you register for a developer account. For more information, see Signing Up for an Account.

Deploying an Application to SAP NetWeaver CloudBugfix

The issue with deploying to the Cloud when your IDE is behind a proxy requiring basic authentication has been resolved.

For more information, see this thread.

 

 

Release Notes for SAP NetWeaver Cloud - December 20th

 

FunctionType of ChangeDescription

Alerting based on custom JMX checks

New

It is now possible to receive alerts based on custom JMX checks defined via the SAP NetWeaver Cloud Console Client. The feature allows you to select an MBean attribute value to check and define a threshold for receiving alerts.

For more information, see Configuring Custom JMX Checks with SAP NetWeaver Cloud Console Client.

SAP NetWeaver Cloud Mail Service (beta)Enhancement

Debugging connection problems to the mail provider is now documented.

For more information, seeUsing the Mail Service-> Enabling the Debugging Feature section.

SAP NetWeaver Cloud Mail Service (beta)Removal

The deprecated mail service APIs needed for the OSGi programming model and for accessing the SAP Cloud Mail Gateway have been removed as announced.

To send e-mails from NetWeaver Cloud applications, use a mail account at an internet-accessible mail provider (for example GMail).

 

 

Release Notes for SAP NetWeaver Cloud - December 6th

 

FunctionType of ChangeDescription

Persistence Service Based on the SAP HANA Database

New

Persistence Service based on the SAP HANA database is now available for productive usage in SAP NetWeaver Cloud. It can be used with the following features and limitations:

  • Row and column store
  • Access via JDBC and JPA
  • No support of XS Engine
  • No access with SAP HANA Studio

Currently, the database platform (SAP HANA database or MaxDB) can only be chosen on account level.

Identity FederationNew

Identity federation is now available for productive use. For more information about using identity federation, see Securing SAP NetWeaver Cloud Applications.

Identity FederationEnhancement

Changed UI for identity federation in the Account page. The UI now adds the following tabs:

  • TRUST– You manage here the trust configurations of SAP NetWeaver Cloud as service provider, and an on-premise identity provider. For more information on using this part of the UI, see Using a Custom Identity Provider.
  • AUTHORIZATIONS– You manage here role assignments of users and groups on SAP NetWeaver Cloud. For more information on using this part of the UI, see Managing Roles and Groups.

SAP NetWeaver Cloud Connectivity Service

Enhancement

The SAP Cloud Connector version 1.1.1 is released with the following enhancements:

  • SCC audit log has been extended to contain information about SCC configuration changes
  • System mappings that expose the available backends include the configuration of the backend type (e.g. ABAP system, SAP Business Connector, non-SAP system)
  • Support of cookie domain attribute and HTTP redirect.
UI development toolkit for HTML5Enhancement

New control library sap.m is available for developing applications running on mobile devices.

For detailed information on all new features, see SAPUI5 Release Notes.

 

 

Release Notes for SAP NetWeaver Cloud - November 22nd

 

FunctionType of ChangeDescription

Local Development Scenario

New

SAP NetWeaver Cloud is now certified as Java EE 6 Web Profile compatible. For more information, see SAP NetWeaver Cloud Java EE 6 Web Profile Certified! and Java EE Compatibility.

The Java EE 6 Web Profile functionality comes as Beta and is delivered with SDK-2.0.2.Beta. The new major version of the SDK can be downloaded from https://tools.netweaver.ondemand.com with any free developer account. Currently, with this SDK it is possible to deploy applications only in Beta and Trial accounts (not allowed for productive accounts).

More information on the newly supported features with SDK-2.x is available in this blog post.

Local Development Scenario

Enhancement

The SAP JVM 7, a JDK 7 compatible Java Virtual Machine, is now available as a separate download from the Additional Software section on https://tools.netweaver.ondemand.com. It can be used for running a local SAP NetWeaver Cloud server.

For more information see Java Execution Environment and Installing the SAP JVM.

 

 

Release Notes for SAP NetWeaver Cloud - November 8th

 

FunctionType of ChangeDescription
Configuring Availability ChecksNew

You can now use the SAP NetWeaver Cloud Console to configure:

  • Availability check (URL) and response time thresholds for your application
  • E-mails to receive alerts if the availability check fails because the application is not available or because of poor performance.

You can do these configurations for a whole account and then they are applied to all applications running in this account.

For more information, see Application Monitoring and Alerting.

Eclipse Tools Support for JDK7

Enhancement

You can use Eclipse to develop, run and test your applications on SAP NetWeaver Cloud on top of Java Standard Edition Virtual Machine for Java 6 and 7. The desired version can be specified by changing the version of the Java facet of the deployed web project. For more information, see Creating an SAP NetWeaver Cloud Application.

SAP NetWeaver Cloud Connectivity Service and SAP Cloud ConnectorEnhancement

You can now download the SAP Cloud Connector also via the SAP NetWeaver Cloud update site, in addition to the SAP Service Marketplace. On the update site, the SCC download can be found under the “Additional Software” tab.

Be reminded that the SAP Cloud Connector versions prior to version 1.1.0 have reached end of life as announced in this blog post.

Identity FederationEnhancement

When configuring the local provider, you can now choose among three configuration options:

  • Default – the local provider for this tenant inherits the configuration for SAP NetWeaver Cloud
  • None – no own trust settings for this tenant
  • Custom – the tenant admin can configure the local provider settings. This option contains pretty much the configuration options existing up to now.

For more information, see Using a Custom Identity Provider.

 

 

Release Notes for SAP NetWeaver Cloud - October 25th

 

FunctionType of ChangeDescription
SAP NetWeaver Cloud Document ServiceNew
  • A new API for deleting a repository is now available.
  • HTTP headers If-Modified-Since and Last-Modified are now supported.

Choosing application VM (compute units) size

New

SAP NetWeaver Cloud offers four different sizes of application VM (compute units) that can be purchased for productive accounts. When deploying an application to a productive account using the SAP NetWeaver Console Client, you can now choose the application VM size from the options you have purchased.

For more information about the different sizes of application VM (compute units), see Application Runtime.

For more information about choosing application VM size using the console client, see Deploying Using SAP NetWeaver Cloud console client.

SAP NetWeaver Cloud Mail Service (beta)NewThe SAP NetWeaver Cloud Mail Service allows sending e-mail messages from Web applications via e-mail providers that are accessible in the Internet (e.g. GMail). E-mail provider and e-mail account are configured using mail destinations. According to the Java EE Specification, the reference to the javax.mail.Session configured by the mail destination is specified in web.xml instead of context.xml.
Eclipse ToolsNew

A wizard for collecting support information in a ZIP file is now available. When this ZIP file is attached to a support ticket, it may help SAP support to get better understanding of the user environment and process the issue faster. The wizard can be launched from the menupath Help -> Collect Support Information.

Eclipse ToolsEnhancement
  • The Logging tools now have the following enhancements:
    • There is an easier way to open the Server Logs view from the Servers view either by clicking a button in the view’s toolbar, or by double-clicking on the special node under each SAP NetWeaver Cloud server.
    • Log files are now opened in the standard Eclipse Console view
    • Refresh button has been added in the Loggers editor and Server Logs view
    • The sorting order of table columns in the Loggers editor and Server Logs view can now be changed.

For more information, see Viewing Logs and Setting Log Levels from the Eclipse IDE.

  • When the Users and the Connectivity editors are opened and there is no content, short help information is displayed in the empty space in the editor.
Server side support for JDK 7Enhancement

Application developers and application operators can run and test applications on the cloud on top of Java Standard Edition Virtual Machine for Java 6 and 7.

By default, all applications are still deployed on Java Standard Edition Virtual Machine for Java 6. Optionally, as a result of extensions in the application runtime, it is possible to designate in the SAP NetWeaver Cloud Console client that the application should be run on Java Standard Edition Virtual Machine for Java 7. In this way, application developers can also create applications which rely on features that are specific for Java Standard Edition Virtual Machine for Java 7.

For more information, see Deploying Using SAP NetWeaver Cloud Console Client.

SAP NetWeaver Cloud Connectivity Service and SAP Cloud ConnectorEnhancement

The Connectivity Service is now available also on the SAP NetWeaver Cloud Trial Landscape for free evaluation and demo purposes.

To use the on-demand to on-premise connectivity features of the Connectivity Service, you have to download and install the SAP Cloud Connector, which can now be downloaded from the SAP Service Marketplace with every valid S-User.

Be reminded to plan and perform the required migration to the SAP Cloud Connector version 1.1.0, as announced already with this blog post.

SAP NetWeaver Cloud Identity Service DocumentationEnhancement

The Programmatic Logout section is enhanced with information and examples how to avoid common problems with implementing logout.

For more information, see User Authentication.

SAP NetWeaver Cloud Document ServiceBugfixThe problem with throwing a wrong exception when you try to create a repository which already exists is now fixed.
SAP NetWeaver Cloud Mail Service (beta)DeprecationSending e-mails via the SAP NetWeaver Cloud Mail Gateway is deprecated and will be removed end of 2012. The alternative is to use a mail account at an internet-accessible mail provider (e.g. GMail) for sending e-mails from SAP NetWeaver Cloud applications.

 

 

Release Notes for SAP NetWeaver Cloud - September 27th

 

FunctionType of ChangeDescription
SAP NetWeaver Cloud Persistence ServiceNew

Persistence Service based on the SAP HANA database is now available in SAP NetWeaver Cloud as a beta version. It can be used with the following features and limitations:

  • Row and column store
  • Access via JDBC and JPA
  • No support of XS Engine

Currently the database platform (SAP HANA database or MaxDB) can only be chosen on account level. However, this is only possible for beta accounts.

SAP NetWeaver Cloud Connectivity Service and SAP Cloud Connector

New

Audit logging is now supported by the Connectivity and Configuration service.

The SAP Cloud Connector version 1.1.0 has been released (check this blog post for details) with the following features:

  • Upgrade support from older SAP Cloud Connector versions starting with version 1.0.1.
  • LDAP integration for authenticating SAP Cloud Connector administrators
  • System certificate for mutual authentication with connected backends
  • Easy temporary resource disablement

For more information, see Installing SAP Cloud Connector and LDAP Authentication.

Profiling a Web Application LocallyNew

The SAP JVM Profiler can be used to address the root cause of performance and memory problems.

It is a powerful tool that supports the developer in identifying runtime bottlenecks and reducing the memory footprint. Profiling can be enabled on the NetWeaver Cloud Server for Local testing without VM configuration changes and works reliably even for very large Java applications.

The SAP JVM Profiler can be easily integrated into any Eclipse-based environment by using the established plugin installation system of the Eclipse platform. It allows you to connect to a running SAP JVM and analyze collected profiling data in a graphical manner. The profiler plug-in provides a new perspective similar to the debug and Java perspective.

It is available through the SAP NetWeaver Cloud update site.

For more information, see Profiling a Web Application Locally.

Local Development ScenarioEnhancement

The SAP JVM is now available as a separate download from the additional software section on https://tools.netweaver.ondemand.com. It can be used for running a local SAP NetWeaver Cloud server.

The SAP NetWeaver Cloud infrastructure runs on SAP's own implementation of a Java Virtual Machine - SAP Java Virtual Machine (JVM).

SAP JVM is a fully certified Java Standard Edition Virtual Machine for Java 1.4, 5, 6, and 7. It is derived from Oracle’s HotSpot VM and JDK implementation, but enhanced with several supportability features such as the SAP JVM Profiler for better monitoring, and profiling applications running on the SAP NetWeaver Cloud server for local testing.

For more information, see Application Runtime and the SAP JVM section in Setting up the Tools.

Eclipse ToolsEnhancementEclipse Tools now show Javadoc for the Java classes from the 3rd party JARs included in the SAP NetWeaver Cloud SDK.
Eclipse ToolsEnhancement

Filter field has been added to the Loggers editor to make finding a particular logger easier.

For more information, see Viewing Logs and Setting Log Levels from the Eclipse IDE.

SAPUI5 ToolsEnhancement

New version 1.6.3 of SAP UI Development Toolkit for HTML5 (SAPUI5) has been released. For more information, see SAPUI5 detailed release notes.

Note that the RichTextEditor control of SAPUI5 will be changed with the next SAPUI5 release 1.8., which will be included in one of the next SAP NetWeaver Cloud releases. The reason is the embedded third-party component TinyMCE from Moxiecode Systems AB, which potentially can be used by customers/partners without being aware of the specific license terms. To prevent this accidental usage, the TinyMCE code will be removed. More instructions how to manually add TinyMCE code will follow in the release notes of SAPUI5 release 1.8.

 

 

Release Notes for SAP NetWeaver Cloud - September 13th

 

FunctionType of ChangeDescription
ID FederationNew

The following features of the ID Federation are now available:

  • Single sign-on with SAML 2.0 compliant on-premise identity providers (Beta)
  • Sharing of user profile information between SAP NetWeaver Cloud and on-premise user directories (Beta)

For more information, see Using a Custom Identity Provider.

  • Direct user-to-role assignments (Beta)
  • Role assignments based on user attributes  (Beta)

For more information, see Managing Roles and Groups.

LDAP Authentication in SAP Cloud ConnectorNew

SAP Cloud Connector supports LDAP-based authentication. If you have an LDAP server in your landscape, you can test the users available on the LDAP server.

For more information, see LDAP Authentication.

Eclipse ToolsNew

It is now possible to view the application logs directly in the Eclipse IDE.

For more information, see Viewing Logs and Setting Log Levels from the Eclipse IDE.

Eclipse ToolsBugfixAn issue with attaching source code when debugging Maven projects has been fixed.

 

 

Release Notes for SAP NetWeaver Cloud - September 4th

 

FunctionType of ChangeDescription
Eclipse ToolsNew

Eclipse Tools allow changing the effective level of loggers.

For more information, see Setting Log Levels for Loggers from the Eclipse IDE.

SAP NetWeaver Cloud Document ServiceEnhancement
  • Performance improvements for initial connection and session creation have been made.
  • Locking optimizations have been introduced that greatly reduce the probability of getting a BlockedException.
SAP NetWeaver Cloud Document ServiceBugfixDecimal values can now be negative as well.

 

 

Release Notes for SAP NetWeaver Cloud - August 16th

 

FunctionType of ChangeDescription
SAPUI5 ToolsNew

To support the development of HTML5 applications, SAPUI5 offers a set of Eclipse-based tools and editors. They provide wizards for creating application projects and views according to the model-view-controller concept, and other features like JavaScript code completion and in-place application preview. SAPUI5 tools can be downloaded as a feature from the Eclipse Tools update site both for Juno and Indigo versions.

For more information, see the SAPUI5 Development Tools section in the documentation.

SAP NetWeaver Cloud Document ServiceEnhancement

You can now develop applications that use the Document service using only pure Java EE consumption mechanism. You do not need to convert your Dynamic Web Project to OSGi Bundle Project, and you do not need to take care of imports in the manifest file.

For more information, see Using the Document Service in a Web Application.

 

 

Release Notes for SAP NetWeaver Cloud - August 2nd

 

FunctionType of ChangeDescription
SAP NetWeaver Cloud SDKEnhancement

The SAP NetWeaver Cloud SDK has been extended with:

  • Commands for installing, starting and stopping (non-blocking for usage in scripts) of a server for local development.
  • Samples (basic, authentication, and persistence) demonstrating the specific services. In addition, the samples show how to automate a headless build and test of Java EE web applications (WARs) with Apache Maven that:
    • Builds a WAR based on the SAP NetWeaver Cloud platform API
    • Shows how to run rudimentary unit tests
    • Installs, starts, waits for, and stops the local server runtime
    • Deploys the application to the cloud server runtime and runs the integration test
    • Starts, waits for, and stops the cloud server runtime
    • Deploys the application to the cloud server runtime and runs the integration test
  • Simplified and more comprehensive file system structure.

For more information, see Understanding the Development Environment and Running Sample Applications.

SAP NetWeaver Cloud Document ServiceEnhancement

Repositories are now isolated within an account. Only applications deployed in the same account as the application that created a repository can access that repository.

For more information, see Document Service Concepts.

SAP NetWeaver Cloud Document ServiceEnhancementUser forwarding is now supported in the local development scenario as well.
SAP NetWeaver Cloud Logging InfrastructureEnhancement

The log files are now rotated not only by date but also by size, to prevent generation of very large log files. After a file reaches 50 MB in size, it is archived and an index is added to its name. The oldest log file has the biggest index and the latest file is always without an index.

Development APIs DocumentationNew

The APIs documentation is now available online.

For more information, see API Documentation.

Eclipse Help for SAP NetWeaver CloudEnhancementContext-sensitive help has been added for the Preferences page and SDK Runtime Wizard.
SAP NetWeaver Cloud Security DocumentationEnhancement

A new document describing how you can protect your applications against cross-site request forgery (CSRF) security attacks has been added.

For more information, see Protecting from CSRF.

SAP NetWeaver Cloud Document ServiceBugfixAn issue leading to messages in the log file in the local development scenario has been fixed.
Eclipse Tools for SAP NetWeaver CloudBugfixChanging the context root of an OSGi-free application is now possible using the Web Project Settings property page.
Eclipse Tools for SAP NetWeaver CloudBugfixThe “Source not found” issue when debugging OSGi-free applications has been fixed.

 

 

Release Notes for SAP NetWeaver Cloud - July 19th

 

FunctionType of ChangeDescription
SAP NetWeaver Cloud Connectivity ServiceEnhancement

The SAP NetWeaver Cloud Connectivity service is now available for productive use.

For more information, see SAP NetWeaver Cloud Connectivity Service.

SAP NetWeaver Cloud Document ServiceEnhancement

The SAP NetWeaver Cloud Document service is now available for productive use.

For more information, see SAP NetWeaver Cloud Document Service.

Deploying an Application to SAP NetWeaver CloudEnhancementWhen deploying an application to SAP NetWeaver Cloud, you can use your e-mail address as a user name too.
SAP NetWeaver Cloud DocumentationEnhancement

The SAP NetWeaver Cloud documentation has a redesigned and more user-friendly welcome page.

For more information, see SAP NetWeaver Cloud Documentation.

 

 

Release Notes for SAP NetWeaver Cloud - July 5th

 

FunctionType of ChangeDescription
Managing Application LogsNew

New commands for managing application logs have been introduced in the SAP NetWeaver Cloud Console Client. For more information, see Managing Application Logs Using SAP NetWeaver Console Client.

New API of SAP NetWeaver Cloud Connectivity ServiceNew

A new API of Connectivity Service is introduced, the old API is deprecated and removed. For more information, see How to Use Destination API.

SAP NetWeaver Cloud Connectivity Service DocumentationEnhancementSAP NetWeaver Cloud Connectivity Service documentation for application developers has been restructured and enhanced. For more information, see How to Use SAP NetWeaver Cloud Connectivity Service.
SAP Cloud ConnectorEnhancement

Improved error handling of the SAP Cloud Connector and destination service.

For more information, see Installing and Configuring SAP Cloud Connector.

SAP NetWeaver Cloud Mail ServiceEnhancementThe API that is only needed for OSGi programming model  is deprecated and the Mail Service tutorial using the OSGi programming model is removed. For more information, see Sending E-Mails from SAP NetWeaver Cloud Applications.
SAP NetWeaver Cloud ID Service DocumentationEnhancement

The description of the local server scenario is updated; the location of the json file containing the configuration of local users has been added.

For more information, see User Authentication.

SAP NetWeaver Cloud Console ClientEnhancement

Improved supportability, error handling, logs, OS support. Console commands with the same name can be identified by their group (for example, deploy:start and local:start).

SAP NetWeaver Cloud Persistence Service SQL TraceNew The Persistence Service provides an SQL trace, allowing you to analyze and troubleshoot errors caused by SQL statements in your applications, irrespective of whether you are using JPA or plain JDBC. For more information, see Switching On the SQL Trace.
SAP NetWeaver Cloud Persistence Service JNDI LookupEnhancement

References to a  javax.sql.DataSource resource should now be defined in your application’s web.xml descriptor, in accordance with the Java EE Specification. The use of context.xml has been deprecated and will no longer be supported as of 13 September 2012. You should migrate all Web applications that consume the Persistence Service (javax.sql.DataSource) via JNDI lookup by following the straightforward three-step procedure described in Migrating Web Applications That Use context.xml.

 

 

 

Release Notes for SAP NetWeaver Cloud - June 21st

 

FunctionType of ChangeDescription
Setting Up the ToolsEnhancement

The update site provides now Indigo and Juno versions of the SAP NetWeaver Cloud Eclipse Tools.

Eclipse Connectivity EditorEnhancement

The Eclipse Connectivity Editor now provides a drop-down list widget for configuring the ProxyType property.

For more information, see Configuring an Application in the Eclipse IDE.

 

 

 

Release Notes for SAP NetWeaver Cloud - June 11th

 

FunctionType of ChangeDescription
Official name changedNew

SAP NetWeaver Neo is now officially called SAP NetWeaver Cloud.

Documentation and Eclipse Tools are rebranded to the official name.

Developer CenterNew

The new developer center is now the central point of entry to get information, news and support for SAP NetWeaver Cloud.

For more information, see SAP NetWeaver Cloud Developer Center.

Trial AccountsNew

A 90-days trial account can be obtained with a valid SCN account for free via the SAP NetWeaver Cloud Developer Center following these steps.

Setting Up the ToolsNewThe SAP NetWeaver Cloud tools and SDK can now be obtained easily via click through from the developer center by any SCN user. Before you can download the SAP NetWeaver Cloud SDK or Eclipse Tools, you have to agree to the EULA. For more information, see SAP NetWeaver Cloud Developer Center and Setting Up the Tools.
ID ServiceEnhancementYou can now develop applications that use authentication and authorization using only pure Java EE consumption mechanism. You do not need to convert your Dynamic Web Project to OSGi Bundle Project, and you do not need to take care of imports in the manifest file. For more information, see User Authorization.
Eclipse Connectivity EditorEnhancement

The Eclipse Connectivity Editor now automatically removes the “TrustAll” property if “ProxyType” is set to “OnPremise”. “TrustAll” should not be used in OnPremise scenarios.

For more information, see Configuring an Application in the Eclipse IDE.

SAP NetWeaver Cloud DocumentationEnhancement

Official documentation of SAP NetWeaver Cloud is now added in the Eclipse Help and is installed together with the Eclipse Tools for SAP NetWeaver Cloud.

Context help is added to the wizards and dialogs of the Eclipse Tools.

Eclipse ToolsEnhancementThe classpath of a Java EE project in Eclipse is now populated only with the JARs from the API folder of the SDK. In older versions of the Eclipse Tools the classpath was populated with all JARs from the SDK which might lead to problems when the application is deployed to the cloud.
Setting Up the ToolsEnhancementThe Eclipse Tools now warn you for upgrading the tools if you configure SDK that is much newer than the Eclipse Tools.
Update SiteEnhancementThe error messages of the update site have been improved.

 

 

 

Release Notes for SAP NetWeaver Neo - May 10th

 

FunctionType of ChangeDescription
SAP NetWeaver Neo Console ClientEnhancement

In the Neo Console client you can now specify which hosts can be contacted without a proxy.

A new Version command is added and you can also make use of suggested commands in case you spell a command incorrectly.
Setting Up the ToolsEnhancement

The SAP NetWeaver Neo Tools page look is enhanced with the Gold Reflection theme.

For more information, see SAP NetWeaver Neo Tools Page.
SAP NetWeaver Neo Connectivity ServiceEnhancement

Documentation describing how to consume BAPIs from an ABAP system via the SAP Cloud Connector and SAP Business Connector has been released in the Neo Community.

For more information, see Neo Community.

 

 

 

 

Release Notes for SAP NetWeaver Neo Beta - April

 

FunctionType of ChangeDescription
SAP NetWeaver Neo Mail Service (Beta)New

The SAP NetWeaver Neo Mail Service allows you to send electronic mail messages from your Web applications.
For more information, see SAP NetWeaver Neo Mail Service.

Account PageNew

The Account page is the central point for managing all activities associated with your account and for accessing key information about your applications.

For more information, see Managing Your Accounts and Applications.
Setting Up the ToolsEnhancementUsers need to log on with an S-user account in order to install Neo Eclipse Tools from the update site or download the Neo SDK.
For more information, see Setting Up the Tools.
Testing User Authentication in the Local Development ScenarioEnhancement

This feature allows developing and testing user authentication and authorization in an application on the local server in the Eclipse IDE without the need to have network connectivity and a user account in SAP ID Service.

For more information, see User Authentication.
Logging in SAP NetWeaver NeoEnhancement

The Neo application developers can now access SLF4J API directly without adding any references or packaging the library in the application archive.

For more information, see Logging in a SAP NetWeaver Neo Application.

 

 

 

Release Notes for SAP NetWeaver Neo Beta - March

 

FunctionType of ChangeDescription
SAP NetWeaver Neo Document Service (Beta)New

The SAP Netweaver Neo Document Service provides an on-demand content repository for unstructured or semi-structured content.
For more information, see SAP Document Service.

SAP NetWeaver Neo Connectivity Service (Beta)New

The SAP NetWeaver Neo Connectivity Service service allows SAP NetWeaver Neo applications to consume services from on-premise systems via HTTP based protocols using secure tunnel.
For more information, see  SAP Connectivity Service.

Server EditorEnhancement

New tab Connectivity in the Server Editor allows configuration of HTTP destinations for the Connectivity service.

For more information, see Configuring an Application in the Eclipse IDE.
New Server wizard pageEnhancement

The UI is changed to use the “account” and “application” terms instead of the internal technical terms of “space”, “appliance” and “component”.

For more information, see Deploying from the Eclipse IDE.
Deploying a Web Application LocallyBugfix

Resolved issue when stopping the local server, while it is still in starting state.

For more information about deploying a Web application locally, see

Deploying from the Eclipse IDE.

Deploying a Web Application LocallyBugfixResolved issue with freezing of the Eclipse IDE when the local server is not responding.
Deploying a Web Application LocallyBugfixResolved issue with NullPointerException when trying to run a Web application bundle with single JSP on the local server.
Deploying a Web Application LocallyBugfixResolved issue with starting the local server after restarting the Eclipse IDE.
Setting Up the ToolsBugfix

Resolved issue with incorrectly selected target definition when editing the server runtime environment.

For more information, see Setting Up the Tools.
Deploying from the Eclipse IDEBugfix

The console output of the local server is cleaned of confusing logs.

For more information, see Deploying from the Eclipse IDE.
Setting Up the ToolsBugfix

Resolved issue with not removing the error marker when selecting valid location for the SAP NetWeaver Neo SDK in the Preferences page.

For more information, see Setting Up the Tools.

 

 

 

Release Notes for SAP NetWeaver Neo Beta - February

 

FunctionType of ChangeDescription
SAP UI Development Toolkit for HTML5New

SAP UI Development Toolkit for HTML5 (SAPUI5) is a user interface technology that you can use to develop Web user interfaces.

For more information, see Getting Started With SAPUI5

SAP NetWeaver Neo Console ClientEnhancement

A new SAP NetWeaver Neo Console Client is introduced to provide command line interface to the SAP NetWeaver Neo platform. The console client provides deploy and start capabilities.

For more information, see Deploying Using SAP NetWeaver Neo Console Client

Logging in an applicationEnhancementYou can enable logging in a SAP NetWeaver Neo application by using the SLF4J API.
For more information, see Logging in an SAP NetWeaver Neo Application
Deploying an Application to SAP NetWeaver NeoBugfixWhen deploying to an existing component, the wizard now displays a warning message that the content will be overwritten.
For more information about deploying, see Deploying an Application to SAP NetWeaver Neo
Setting Up the ToolsBugfixIncorrect error message was shown when you enter an invalid location for SDK.
For more information about SDK location, see Setting Up the Tools
Setting Up the ToolsBugfixNullPointerException was thrown when you enter an invalid landscape URL.
For more information about landscape URL, see Setting Up the Tools
Setting Up the ToolsBugfixNullPointerException was thrown when you open the server editor.
For more information about  setting the runtime environment, see Setting Up the Tools
Consuming Internet ServicesBugfixNullPointerException was thrown during deployment of connectivity-enabled Web Application.
For more information, see Consuming REST Connectivity from Web Applications
Creating a Dynamic Web ProjectBugfixThe SAP NetWeaver Neo runtime now restricts the Java facet’s version for new Dynamic Web projects to be not greater than 1.6.
For more information, see Creating a HelloWorld Application
Starting and Stopping SAP NetWeaver Neo ComponentsBugfixThe timeout for starting and stopping a SAP NetWeaver Neo component is now shorter.
For more information about starting and stopping components, see Deploying an Application to SAP NetWeaver Neo

who is famous on SAP netweaver cloud community?

$
0
0

Initially, I had named this blog post as "Extract Person names from unstructured data using Apache UIMA running on Netweaver cloud" - but looking at all the interesting titles we are finding on Netweaver Cloud Developer center community blog- I decided to be cooler. :-) 

 

My previous blog post was on- how to deploy a UIMA annotator on Netweaver cloud as REST service. I have been playing around with various UIMA annotators that do some wonderful stuff extracting information from unstructured data. I started with concept mapper which finds concepts in the source text by comparing it with concept dictionary loaded in memory. It helps in identifying and enriching the concepts of your interest. It’s been widely used in medical field to analyze medical records and patient history where medical terms and its properties are well documented (National Library of Medicine).

 

I was thinking hard to find an application for concept mapper running on Netweaver cloud that could demonstrate its strength. I started with SAP netweaver cloud glossary as source of dictionary terms and was playing with some blog text to find the named entities. Idea was to classify blogs based on glossary terms. Like – find all the blogs which are related to Cloud connectivity services, blogs related to document services etc. However, I was not very happy with the dictionary based on glossary terms. Results received from Concept mapper based on this dictionary had many problems. I had to abandon this idea for a newer one- finding person names in text.

 

NameFinder service is implemented as a REST service running on Netweaver cloud. You can try it at-

https://namefinders0007950666trial.nwtrial.ondemand.com/uima-simple-server-concept/?mode=form

 

Enter some sample text with person names in it. Here some content taken from wiki.

namefinder 1.JPG

Submit the text to NameFinder annotator. You will see result with <NameAnnotation> xml tags.

 

namefinder 2.JPG

NameFinder annotator in based on OpenNLP toolkit that uses machine learning process for analyzing natural language text. It supports the most common NLP tasks, such as tokenization, sentence segmentation, part-of-speech tagging, named entity extraction, chunking, parsing, and coreference resolution. These tasks are usually required to build more advanced text processing services. OpenNLP also includes maximum entropy and perceptron based machine learning. I will try to cover all the technical details about NameFinder annotator in subsequent blogs.

 

This rest service can be easily consumed using following SAUI5 javascript code to show the NameAnnotation in a table–

              var oModel = new sap.ui.model.xml.XMLModel();

              $.ajax({

                  url: 'http://localhost:8080/uima-simple-server-concept/',

                  type: 'POST',

                  data: 'text='+InputText+'&mode=inline',

                  dataType: "xml",

                  success: function(xml) {

                     oModel.setData(xml);

                     sap.ui.getCore().byId("cTable").setModel(oModel);

                     sap.ui.getCore().byId("cTable").bindRows("/NameAnnotation"); 

                  }

 

Next challenge was to find a good source of unstructured data that can be programmatically fed to NameFinder REST api. ‘scnReader’ project by Tom Van Doorslaer which is documented in this blog came handy. Thank you Tom; for your wonderful work here. In no time, I was able to import this SAPUI5 project into eclipse and add my own code to read RSS feed items and pass it to NameFinder REST api and show the names in a table.

 

I added couple of input fields to SCN reader to take any RSS feed link and number of items to fetch.

scnReader 0.JPG

As a sample, I used Netweaver cloud developer center RSS feed for blogs.

 

RSS link.JPG

On entering RSS feed link and submitting – it fetches recent 10 items and shows in the table.

scnReader 1.JPG

 

Now we have blog list with its content that can be sent to NameFinder REST service for analysis. On clicking ‘Get Names’ following result in shown in ‘Identified English Names’ table:

scnReader 2.JPG

On scrolling down-

names scroll1.jpg

Further scroll down-

name scroll2.jpg

names scroll3.jpg

Total 18 names are identified from recent 10 blog posts in Cloud community. With some more javascript, number of occurrences of a name can be calculated for comparison. With some efforts, these results can be persisted into database (HANA?) with some additional information like blog category(tags), blog link, results from concept mapper, date and time information, etc to come with some real world application.

 

So now you know who is famous on SAP netweaver cloud community. Some of the NameAnnotations are not person names. These miss hits are due to machine learning algorithm and name finder model.  These models can be enriched and algorithm can be retrained using OpenNLP library to improve the accuracy.

Requirements for using SAP Cloud Apps?

$
0
0

Hi there..

 

I'm planing to develop an app for the SAP Cloud.

So I searched for the information, which requirements the end-user of the SAP Cloud App needs - but I didn't find some good answers.

He only need a SAP Account? Or what else?

 

Thanks for some help..

Andi

Viewing all 3285 articles
Browse latest View live




Latest Images