From 73a6181b315a4f2f8628fc0f5417ae2c160d88f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20Stockl=C3=B6w?= <carsten.stockloew@igd.fraunhofer.de> Date: Mon, 28 Oct 2013 13:57:06 +0000 Subject: [PATCH] added missing dependency, modified maven-bundle-plugin config --- uCC/ucc.frontend/pom.xml | 23 +++---- .../ucc/windows/SelectUserWindow.java | 64 +++++++++++-------- 2 files changed, 45 insertions(+), 42 deletions(-) diff --git a/uCC/ucc.frontend/pom.xml b/uCC/ucc.frontend/pom.xml index 1a1447dd8..74941bf09 100644 --- a/uCC/ucc.frontend/pom.xml +++ b/uCC/ucc.frontend/pom.xml @@ -97,6 +97,14 @@ <version>4.2.0</version> <scope>provided</scope> </dependency--> + <dependency> + <groupId>org.universAAL.ontology</groupId> + <artifactId>ont.profile.ui.mainmenu</artifactId> + </dependency> + <dependency> + <groupId>org.universAAL.ontology</groupId> + <artifactId>ont.profile</artifactId> + </dependency> </dependencies> <build> @@ -121,23 +129,8 @@ <Bundle-Version>${project.version}</Bundle-Version> <Bundle-Activator>org.universAAL.ucc.service.manager.Activator</Bundle-Activator> <Bundle-Vendor>FZI Karlsruhe</Bundle-Vendor> - <Import-Package> - com.vaadin.*, - javax.*, - org.osgi.*, -<!-- org.slf4j.*, --> - org.w3c.dom, - org.universAAL.ucc.configuration.*, - org.universAAL.middleware.*, - org.universAAL.ucc.startup.model.*, - org.universAAL.ucc.model.*, - org.universAAL.ucc.api, - org.universAAL.ucc.startup.api.*, - org.universAAL.ucc.database.* - </Import-Package> <!-- <Private-Package>javax.xml.bind.*</Private-Package> --> <Private-Package> - javax.xml.bind.annotation, org.universAAL.ucc.client.util, org.universAAL.ucc.subscriber, org.universAAL.ucc.webconnection, diff --git a/uCC/ucc.frontend/src/main/java/org/universAAL/ucc/windows/SelectUserWindow.java b/uCC/ucc.frontend/src/main/java/org/universAAL/ucc/windows/SelectUserWindow.java index 2429eea73..e3bafeb61 100644 --- a/uCC/ucc.frontend/src/main/java/org/universAAL/ucc/windows/SelectUserWindow.java +++ b/uCC/ucc.frontend/src/main/java/org/universAAL/ucc/windows/SelectUserWindow.java @@ -3,9 +3,20 @@ package org.universAAL.ucc.windows; import java.util.List; import java.util.Map; +import org.universAAL.middleware.container.utils.LogUtils; +import org.universAAL.middleware.rdf.Resource; +import org.universAAL.middleware.service.CallStatus; +import org.universAAL.middleware.service.ServiceRequest; +import org.universAAL.middleware.service.ServiceResponse; import org.universAAL.middleware.util.Constants; +import org.universAAL.ontology.profile.Profilable; +import org.universAAL.ontology.profile.Profile; import org.universAAL.ontology.profile.User; +import org.universAAL.ontology.profile.service.ProfilingService; +import org.universAAL.ontology.profile.ui.mainmenu.MenuEntry; +import org.universAAL.ontology.profile.ui.mainmenu.MenuProfile; import org.universAAL.ucc.model.AALService; +import org.universAAL.ucc.service.manager.Activator; import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; @@ -77,33 +88,32 @@ public class SelectUserWindow extends Window implements Button.ClickListener { } //Adds a MenuEntry for new installed AAL service to Endusers view -// private void addEntry(String userID, String entryName, String vendor, String serviceClass, String iconURL) -// { -// MenuEntry me = new MenuEntry((new StringBuilder()).append(Constants.uAAL_MIDDLEWARE_LOCAL_ID_PREFIX).append(/*"nutritonalEntry"*/ entryName).toString()); -// me.setVendor(new Resource(vendor)); -// me.setServiceClass(new Resource(serviceClass)); -// Resource pathElem = new Resource(iconURL); -// pathElem.setResourceLabel(entryName); -// me.setPath(new Resource[] { -// pathElem -// }); -// ServiceRequest sr = new ServiceRequest(new ProfilingService(), null); -// sr.addValueFilter(new String[] { -// "http://ontology.universAAL.org/Profile.owl#controls" -// }, new User(userID)); -// sr.addAddEffect(new String[] { -// "http://ontology.universAAL.org/Profile.owl#controls", "http://ontology.universAAL.org/Profile.owl#hasProfile", "http://ontology.universAAL.org/Profile.owl#hasSubProfile", "http://ontology.universaal.org/UIMainMenuProfile.owl#hasEntry" -// }, me); -// ServiceResponse res = Activator.getSc().call(sr); -// if(res.getCallStatus() == CallStatus.succeeded) -// LogUtils.logDebug(Activator.getmContext(), Activator.class, "addEntry", new Object[] { -// "new user ", userID, " added." -// }, null); -// else -// LogUtils.logDebug(Activator.getmContext(), Activator.class, "addEntry", new Object[] { -// "callstatus is not succeeded" -// }, null); -// } + private void addEntry(String userID, String entryName, String vendor, String serviceClass, String iconURL) + { + MenuEntry me = new MenuEntry((new StringBuilder()).append(Constants.uAAL_MIDDLEWARE_LOCAL_ID_PREFIX).append(/*"nutritonalEntry"*/ entryName).toString()); + me.setVendor(new Resource(vendor)); + me.setServiceClass(new Resource(serviceClass)); + Resource pathElem = new Resource(iconURL); + pathElem.setResourceLabel(entryName); + me.setPath(new Resource[] { + pathElem + }); + ServiceRequest sr = new ServiceRequest(new ProfilingService(), null); + sr.addValueFilter(new String[] { ProfilingService.PROP_CONTROLS }, + new User(userID)); + sr.addAddEffect(new String[] { ProfilingService.PROP_CONTROLS, + Profilable.PROP_HAS_PROFILE, Profile.PROP_HAS_SUB_PROFILE, + MenuProfile.PROP_ENTRY }, me); + ServiceResponse res = Activator.getSc().call(sr); + if(res.getCallStatus() == CallStatus.succeeded) + LogUtils.logDebug(Activator.getmContext(), Activator.class, "addEntry", new Object[] { + "new user ", userID, " added." + }, null); + else + LogUtils.logDebug(Activator.getmContext(), Activator.class, "addEntry", new Object[] { + "callstatus is not succeeded" + }, null); + } } -- GitLab