From 5d6432c4ffdbba4b848f8001e9342a4cf56fa398 Mon Sep 17 00:00:00 2001 From: andreea-tita Date: Fri, 29 Aug 2014 12:12:20 +0300 Subject: [PATCH 01/13] #471-GH470 Layout, Menu, Users before merged with GH193 --- .../org/flowerplatform/core/CorePlugin.java | 6 ++- .../core/users/UserService.java | 47 ++++++++++++------- .../flex_client/web/WebPlugin.as | 1 - 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/org.flowerplatform.core/src/org/flowerplatform/core/CorePlugin.java b/org.flowerplatform.core/src/org/flowerplatform/core/CorePlugin.java index 794d4a72..bbae4279 100644 --- a/org.flowerplatform.core/src/org/flowerplatform/core/CorePlugin.java +++ b/org.flowerplatform.core/src/org/flowerplatform/core/CorePlugin.java @@ -236,6 +236,9 @@ public void start(BundleContext context) throws Exception { virtualNodeResourceHandler.addVirtualNodeType(ROOT_TYPE); virtualNodeResourceHandler.addVirtualNodeType(REPOSITORY_TYPE); + getNodeTypeDescriptorRegistry().getOrCreateTypeDescriptor("users"); + getNodeTypeDescriptorRegistry().getOrCreateTypeDescriptor("user"); + getNodeTypeDescriptorRegistry().getOrCreateTypeDescriptor(ROOT_TYPE) .addAdditiveController(CoreConstants.PROPERTIES_PROVIDER, new RootPropertiesProvider()) .addAdditiveController(CoreConstants.CHILDREN_PROVIDER, new RootChildrenProvider()); @@ -271,7 +274,8 @@ public void start(BundleContext context) throws Exception { .addAdditiveController(CoreConstants.PROPERTY_SETTER, new PreferencePropertySetter()) // TODO CC: to remove when working at preferences persistence .addAdditiveController(PROPERTY_DESCRIPTOR, new PropertyDescriptor().setTypeAs(CoreConstants.PROPERTY_DESCRIPTOR_TYPE_STRING).setNameAs("value").setPropertyLineRendererAs(PROPERTY_LINE_RENDERER_TYPE_PREFERENCE).setReadOnlyAs(true)); - + + new FileSystemControllers().registerControllers(); new ResourceDebugControllers().registerControllers(); new TypeDescriptorRegistryDebugControllers().registerControllers(); diff --git a/org.flowerplatform.core/src/org/flowerplatform/core/users/UserService.java b/org.flowerplatform.core/src/org/flowerplatform/core/users/UserService.java index 68ed0714..740a0d37 100644 --- a/org.flowerplatform.core/src/org/flowerplatform/core/users/UserService.java +++ b/org.flowerplatform.core/src/org/flowerplatform/core/users/UserService.java @@ -12,7 +12,14 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; +import org.flowerplatform.core.CoreConstants; +import org.flowerplatform.core.CorePlugin; +import org.flowerplatform.core.node.NodeService; import org.flowerplatform.core.node.remote.Node; +import org.flowerplatform.core.node.remote.NodeServiceRemote; +import org.flowerplatform.core.node.remote.ResourceServiceRemote; +import org.flowerplatform.core.node.remote.ServiceContext; +import org.flowerplatform.util.Utils; /** * @author Mariana Gheorghe @@ -23,30 +30,38 @@ public class UserService { private List users = new ArrayList(); public UserService() { - users.add(newTestUser("John")); - users.add(newTestUser("Jane")); - users.add(newTestUser("Jim")); +// users.add(newTestUser("John")); +// users.add(newTestUser("Jane")); +// users.add(newTestUser("Jim")); } - private Node newTestUser(String login) { - Node node = new Node("user:test|" + login, "user"); - node.getProperties().put("login", login); - node.getProperties().put("name", login + " " + login + "son"); - node.getProperties().put("email", login + "@domain.com"); - - //set an admin - if (login.equals("Jim")) { - node.getProperties().put("isAdmin", true); - } - return node; - } +// private Node newTestUser(String login) { +// Node node = new Node("user:test|" + login, "user"); +// node.getProperties().put("login", login); +// node.getProperties().put("name", login + " " + login + "son"); +// node.getProperties().put("email", login + "@domain.com"); +// +// //set an admin +// if (login.equals("Jim")) { +// node.getProperties().put("isAdmin", true); +// } +// return node; +// } @GET public List getUsers() { + String pathUri = "fpp:|.users"; + new ResourceServiceRemote().subscribeToParentResource(pathUri); + Node node = CorePlugin.getInstance().getResourceService().getNode(pathUri); + + ServiceContext context = new ServiceContext(); + context.add(CoreConstants.POPULATE_WITH_PROPERTIES, true); + users = CorePlugin.getInstance().getNodeService().getChildren(node,context); + return users; } - @GET @Path("/{nodeUri}") + @GET @Path("/{nodeUri}") @Produces(MediaType.APPLICATION_JSON) public Node getUser(@PathParam("nodeUri") String nodeUri) { for (Node user : users) { diff --git a/org.flowerplatform.flex_client.web/src/org/flowerplatform/flex_client/web/WebPlugin.as b/org.flowerplatform.flex_client.web/src/org/flowerplatform/flex_client/web/WebPlugin.as index 0411e945..1ef887b7 100644 --- a/org.flowerplatform.flex_client.web/src/org/flowerplatform/flex_client/web/WebPlugin.as +++ b/org.flowerplatform.flex_client.web/src/org/flowerplatform/flex_client/web/WebPlugin.as @@ -27,7 +27,6 @@ package org.flowerplatform.flex_client.web { import org.flowerplatform.flexutil.Utils; import org.flowerplatform.flexutil.global_menu.GlobalMenuBar; import org.flowerplatform.flexutil.iframe.EmbedViewProvider; - import org.flowerplatform.flexutil.iframe.IFrameOpenUrl; import org.flowerplatform.flexutil.layout.ViewLayoutData; import org.flowerplatform.flexutil.layout.event.ActiveViewChangedEvent; import org.flowerplatform.flexutil.layout.event.ViewsRemovedEvent; From c3719de1606cd0dda438852c6297d283e366bb62 Mon Sep 17 00:00:00 2001 From: andreea-tita Date: Mon, 1 Sep 2014 15:14:15 +0300 Subject: [PATCH 02/13] #471-GH470-Layout-Menu-Users --- .../flowerplatform/core/CoreConstants.java | 10 +++ .../org/flowerplatform/core/CorePlugin.java | 6 +- .../core/users/UserService.java | 72 +++++++++++-------- 3 files changed, 57 insertions(+), 31 deletions(-) diff --git a/org.flowerplatform.core/src/org/flowerplatform/core/CoreConstants.java b/org.flowerplatform.core/src/org/flowerplatform/core/CoreConstants.java index 9c05567a..b1db4c47 100644 --- a/org.flowerplatform.core/src/org/flowerplatform/core/CoreConstants.java +++ b/org.flowerplatform.core/src/org/flowerplatform/core/CoreConstants.java @@ -201,4 +201,14 @@ public class CoreConstants { public static final String USER_SUFFIX = ".user"; public static final String REPO_ROOT = "D:/data/git/flower-platform-4/flower-platform-4/runtime-workspace"; + + + ////////////////////////////////// + // Users + ////////////////////////////////// + + public static final String USERS = "users"; + public static final String USER = "user"; + public static final String USERS_PATH = "fpp:|.users"; + } diff --git a/org.flowerplatform.core/src/org/flowerplatform/core/CorePlugin.java b/org.flowerplatform.core/src/org/flowerplatform/core/CorePlugin.java index bbae4279..8e3ad1f8 100644 --- a/org.flowerplatform.core/src/org/flowerplatform/core/CorePlugin.java +++ b/org.flowerplatform.core/src/org/flowerplatform/core/CorePlugin.java @@ -21,6 +21,8 @@ import static org.flowerplatform.core.CoreConstants.REPOSITORY_TYPE; import static org.flowerplatform.core.CoreConstants.ROOT_TYPE; import static org.flowerplatform.core.CoreConstants.VIRTUAL_NODE_SCHEME; +import static org.flowerplatform.core.CoreConstants.USERS; +import static org.flowerplatform.core.CoreConstants.USER; import javax.servlet.http.HttpServletRequest; @@ -236,8 +238,8 @@ public void start(BundleContext context) throws Exception { virtualNodeResourceHandler.addVirtualNodeType(ROOT_TYPE); virtualNodeResourceHandler.addVirtualNodeType(REPOSITORY_TYPE); - getNodeTypeDescriptorRegistry().getOrCreateTypeDescriptor("users"); - getNodeTypeDescriptorRegistry().getOrCreateTypeDescriptor("user"); + getNodeTypeDescriptorRegistry().getOrCreateTypeDescriptor(USERS); + getNodeTypeDescriptorRegistry().getOrCreateTypeDescriptor(USER); getNodeTypeDescriptorRegistry().getOrCreateTypeDescriptor(ROOT_TYPE) .addAdditiveController(CoreConstants.PROPERTIES_PROVIDER, new RootPropertiesProvider()) diff --git a/org.flowerplatform.core/src/org/flowerplatform/core/users/UserService.java b/org.flowerplatform.core/src/org/flowerplatform/core/users/UserService.java index 740a0d37..18c1cd1c 100644 --- a/org.flowerplatform.core/src/org/flowerplatform/core/users/UserService.java +++ b/org.flowerplatform.core/src/org/flowerplatform/core/users/UserService.java @@ -1,5 +1,10 @@ package org.flowerplatform.core.users; +import static org.flowerplatform.core.CoreConstants.EXECUTE_ONLY_FOR_UPDATER; + +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.net.URLEncoder; import java.util.ArrayList; import java.util.List; @@ -16,10 +21,9 @@ import org.flowerplatform.core.CorePlugin; import org.flowerplatform.core.node.NodeService; import org.flowerplatform.core.node.remote.Node; -import org.flowerplatform.core.node.remote.NodeServiceRemote; import org.flowerplatform.core.node.remote.ResourceServiceRemote; import org.flowerplatform.core.node.remote.ServiceContext; -import org.flowerplatform.util.Utils; +import org.flowerplatform.core.node.resource.ResourceService; /** * @author Mariana Gheorghe @@ -30,9 +34,6 @@ public class UserService { private List users = new ArrayList(); public UserService() { -// users.add(newTestUser("John")); -// users.add(newTestUser("Jane")); -// users.add(newTestUser("Jim")); } // private Node newTestUser(String login) { @@ -48,55 +49,68 @@ public UserService() { // return node; // } + @SuppressWarnings("deprecation") @GET public List getUsers() { - String pathUri = "fpp:|.users"; - new ResourceServiceRemote().subscribeToParentResource(pathUri); - Node node = CorePlugin.getInstance().getResourceService().getNode(pathUri); + new ResourceServiceRemote().subscribeToParentResource(CoreConstants.USERS_PATH); + Node node = CorePlugin.getInstance().getResourceService().getNode(CoreConstants.USERS_PATH); ServiceContext context = new ServiceContext(); context.add(CoreConstants.POPULATE_WITH_PROPERTIES, true); users = CorePlugin.getInstance().getNodeService().getChildren(node,context); - + for (Node user : users){ + user.setNodeUri(URLEncoder.encode(user.getNodeUri())); + } + return users; } @GET @Path("/{nodeUri}") @Produces(MediaType.APPLICATION_JSON) public Node getUser(@PathParam("nodeUri") String nodeUri) { - for (Node user : users) { - if (user.getNodeUri().equals(nodeUri)) { - return user; - } + + ServiceContext context = new ServiceContext(); + context.add(CoreConstants.POPULATE_WITH_PROPERTIES, true); + Node user = CorePlugin.getInstance().getResourceService().getNode(nodeUri, context); + + if (user != null) { + return user; } + return null; } + @SuppressWarnings("deprecation") @POST @Consumes(MediaType.APPLICATION_JSON) - public Node saveUser(Node user) { - if (user.getNodeUri() == null) { - // new user - user.setNodeUri("user:test|" + user.getProperties().get("login")); - users.add(user); + public Node saveUser(Node user) throws UnsupportedEncodingException { + + Node parent = CorePlugin.getInstance().getResourceService().getNode(CoreConstants.USERS_PATH); + if (user.getType() == null) { + user.setType(CoreConstants.USER); + CorePlugin.getInstance().getNodeService().addChild( + parent, + user, + new ServiceContext(CorePlugin.getInstance().getNodeService()).add(CoreConstants.POPULATE_WITH_PROPERTIES, true)); + } - Node mem = getUser(user.getNodeUri()); + //CorePlugin.getInstance().getNodeService().setProperty(user, "name", user.getPropertyValue("name"), new ServiceContext()); + //CorePlugin.getInstance().getNodeService().setProperty(user, "email", user.getPropertyValue("email"), new ServiceContext()); + //CorePlugin.getInstance().getNodeService().setProperty(user, "login", user.getPropertyValue("login"), new ServiceContext()); + + user.getProperties().put("login", user.getPropertyValue("login")); - mem.getProperties().put("login", user.getProperties().get("login")); - mem.getProperties().put("name", user.getProperties().get("name")); - mem.getProperties().put("email", user.getProperties().get("email")); - return mem; + return user; } @DELETE @Path("/{nodeUri}") public void deleteUser(@PathParam("nodeUri") String nodeUri) { - for (Node user : users) { - if (user.getNodeUri().equals(nodeUri)) { - users.remove(user); - break; - } - } + + CorePlugin.getInstance().getNodeService().removeChild( + CorePlugin.getInstance().getResourceService().getNode(CoreConstants.USERS_PATH), + CorePlugin.getInstance().getResourceService().getNode(nodeUri), + new ServiceContext(CorePlugin.getInstance().getNodeService())); } } From baaab0de2216dc6e1c2bc00444b4207f27af8161 Mon Sep 17 00:00:00 2001 From: andreea-tita Date: Thu, 4 Sep 2014 14:38:45 +0300 Subject: [PATCH 03/13] #471 Layout, Menu, Users - modified the right area for user --- .../flowerplatform/core/CoreConstants.java | 3 + .../core/users/UserService.java | 112 ++++++++++--- .../flex_client/core/CorePlugin.as | 6 +- .../flex_client/resources/Resources.as | 6 +- .../.flexLibProperties | 4 +- ...ameOpenUrl.as => OpenUrlInIFrameAction.as} | 11 +- ...nUrlView.mxml => OpenUrlInIFrameView.mxml} | 6 +- .../WebContent/js/controllers.js | 12 +- .../partials/composed/sideMenuLayout.html | 8 +- .../WebContent/style/style.css | 110 +++++-------- .../WebContent/js/app.js | 20 --- .../WebContent/js/controllers.js | 143 +++++++---------- .../WebContent/js/services.js | 17 +- .../partials/composed/userSideMenu.html | 71 ++++---- .../partials/userAccountSettings.html | 151 ++++++++---------- .../WebContent/partials/userForm.html | 77 +-------- .../partials/userFormSideMenuContent.html | 30 ++-- .../partials/userGeneralSettings.html | 59 +++++++ .../WebContent/partials/userList.html | 2 +- .../public-resources/images/core/url_icon.png | Bin 3330 -> 753 bytes org.flowerplatform.resources/readme.md | 5 +- 21 files changed, 422 insertions(+), 431 deletions(-) rename org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/iframe/{IFrameOpenUrl.as => OpenUrlInIFrameAction.as} (65%) rename org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/iframe/{IFrameOpenUrlView.mxml => OpenUrlInIFrameView.mxml} (85%) create mode 100644 org.flowerplatform.js_client.users/WebContent/partials/userGeneralSettings.html diff --git a/org.flowerplatform.core/src/org/flowerplatform/core/CoreConstants.java b/org.flowerplatform.core/src/org/flowerplatform/core/CoreConstants.java index b1db4c47..7883b5dc 100644 --- a/org.flowerplatform.core/src/org/flowerplatform/core/CoreConstants.java +++ b/org.flowerplatform.core/src/org/flowerplatform/core/CoreConstants.java @@ -210,5 +210,8 @@ public class CoreConstants { public static final String USERS = "users"; public static final String USER = "user"; public static final String USERS_PATH = "fpp:|.users"; + public static final String HASH_ALGORITHM = "SHA-256"; + public static final String PASS_CHANGED = "Password changed !"; + public static final String PASS_NOT_CHANGED = "Password doesn't match !"; } diff --git a/org.flowerplatform.core/src/org/flowerplatform/core/users/UserService.java b/org.flowerplatform.core/src/org/flowerplatform/core/users/UserService.java index 18c1cd1c..4dd1e7d1 100644 --- a/org.flowerplatform.core/src/org/flowerplatform/core/users/UserService.java +++ b/org.flowerplatform.core/src/org/flowerplatform/core/users/UserService.java @@ -1,12 +1,13 @@ package org.flowerplatform.core.users; -import static org.flowerplatform.core.CoreConstants.EXECUTE_ONLY_FOR_UPDATER; - import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; import java.net.URLEncoder; -import java.util.ArrayList; +import java.nio.charset.Charset; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; import java.util.List; +import java.util.Map; +import java.util.Random; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -16,6 +17,7 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; +import javax.xml.bind.DatatypeConverter; import org.flowerplatform.core.CoreConstants; import org.flowerplatform.core.CorePlugin; @@ -25,30 +27,16 @@ import org.flowerplatform.core.node.remote.ServiceContext; import org.flowerplatform.core.node.resource.ResourceService; + /** * @author Mariana Gheorghe */ @Path("/users") public class UserService { - - private List users = new ArrayList(); public UserService() { } -// private Node newTestUser(String login) { -// Node node = new Node("user:test|" + login, "user"); -// node.getProperties().put("login", login); -// node.getProperties().put("name", login + " " + login + "son"); -// node.getProperties().put("email", login + "@domain.com"); -// -// //set an admin -// if (login.equals("Jim")) { -// node.getProperties().put("isAdmin", true); -// } -// return node; -// } - @SuppressWarnings("deprecation") @GET public List getUsers() { @@ -57,7 +45,7 @@ public List getUsers() { ServiceContext context = new ServiceContext(); context.add(CoreConstants.POPULATE_WITH_PROPERTIES, true); - users = CorePlugin.getInstance().getNodeService().getChildren(node,context); + List users = CorePlugin.getInstance().getNodeService().getChildren(node,context); for (Node user : users){ user.setNodeUri(URLEncoder.encode(user.getNodeUri())); } @@ -80,7 +68,6 @@ public Node getUser(@PathParam("nodeUri") String nodeUri) { return null; } - @SuppressWarnings("deprecation") @POST @Consumes(MediaType.APPLICATION_JSON) public Node saveUser(Node user) throws UnsupportedEncodingException { @@ -95,13 +82,20 @@ public Node saveUser(Node user) throws UnsupportedEncodingException { } - //CorePlugin.getInstance().getNodeService().setProperty(user, "name", user.getPropertyValue("name"), new ServiceContext()); - //CorePlugin.getInstance().getNodeService().setProperty(user, "email", user.getPropertyValue("email"), new ServiceContext()); - //CorePlugin.getInstance().getNodeService().setProperty(user, "login", user.getPropertyValue("login"), new ServiceContext()); + Node currentUser = CorePlugin.getInstance().getResourceService().getNode(user.getNodeUri()); + + // set saltPassword + hashPassword for active user + /* String saltPassword = DatatypeConverter.printBase64Binary(getSalt()); + String hashPassword = DatatypeConverter.printBase64Binary(createPasswordHash((String)user.getProperties().get("password"), saltPassword)); + CorePlugin.getInstance().getNodeService().setProperty(currentUser, "saltPassword", saltPassword, new ServiceContext()); + CorePlugin.getInstance().getNodeService().setProperty(currentUser, "hashPassword", hashPassword, new ServiceContext()); */ - user.getProperties().put("login", user.getPropertyValue("login")); + CorePlugin.getInstance().getNodeService().setProperty(currentUser, "firstName", user.getProperties().get("firstName"), new ServiceContext()); + CorePlugin.getInstance().getNodeService().setProperty(currentUser, "lastName", user.getProperties().get("lastName"), new ServiceContext()); + CorePlugin.getInstance().getNodeService().setProperty(currentUser, "email", user.getProperties().get("email"), new ServiceContext()); + CorePlugin.getInstance().getNodeService().setProperty(currentUser, "login", user.getProperties().get("login"), new ServiceContext()); - return user; + return currentUser; } @DELETE @Path("/{nodeUri}") @@ -113,4 +107,70 @@ public void deleteUser(@PathParam("nodeUri") String nodeUri) { new ServiceContext(CorePlugin.getInstance().getNodeService())); } + @POST @Path("/{nodeUri}/password") + public String changePassword(@PathParam("nodeUri") String nodeUri, Map map) { + Node currentUser = CorePlugin.getInstance().getResourceService().getNode(nodeUri); + + if (map.get("oldPassword").equals(currentUser.getPropertyValue("password"))) { + CorePlugin.getInstance().getNodeService().setProperty(currentUser, "password", map.get("newPassword"), new ServiceContext()); + return CoreConstants.PASS_CHANGED; + } + + //check oldPassword hash + set the newPassword hash + /* if (checkPassword(currentUser, map.get("oldPassword"))) { + String saltPassword = DatatypeConverter.printBase64Binary(getSalt()); + String hashPassword = DatatypeConverter.printBase64Binary(createPasswordHash(map.get("newPassword"), saltPassword)); + CorePlugin.getInstance().getNodeService().setProperty(currentUser, "saltPassword", saltPassword, new ServiceContext()); + CorePlugin.getInstance().getNodeService().setProperty(currentUser, "hashPassword", hashPassword, new ServiceContext()); + }*/ + + return CoreConstants.PASS_NOT_CHANGED; + } + + @POST @Path("/{nodeUri}/login") + public Node changeLogin(@PathParam("nodeUri") String nodeUri, String login) { + Node currentUser = CorePlugin.getInstance().getResourceService().getNode(nodeUri); + + CorePlugin.getInstance().getNodeService().setProperty(currentUser, "login", login, new ServiceContext()); + + return currentUser; + } + + /* generate a salt for password */ + public byte[] getSalt() { + byte[] salt = new byte[16]; + new Random().nextBytes(salt); + return salt; + } + + /* create a hashed password using salt */ + public byte[] createPasswordHash(String password, String salt) { + final Charset DEFAULT_CHARSET = Charset.forName("UTF-8"); + byte[] result = null; + + try { + MessageDigest digest = MessageDigest.getInstance(CoreConstants.HASH_ALGORITHM); + digest.update(salt.getBytes(DEFAULT_CHARSET)); + digest.update(password.getBytes(DEFAULT_CHARSET)); + result = digest.digest(); + } catch (NoSuchAlgorithmException e) {} + + return result; + } + + /* check if the entered password is the same with the hashed password */ + public boolean checkPassword(Node user, String password) { + boolean result = false; + String storedPasswordHash = (String)user.getProperties().get("hashPassword"); + String salt = (String)user.getProperties().get("saltPassword"); + byte[] checkPasswordHashBytes = createPasswordHash(password, salt); + String checkPasswordHash = DatatypeConverter.printBase64Binary(checkPasswordHashBytes); + + if (checkPasswordHash != null && storedPasswordHash != null && checkPasswordHash.equals(storedPasswordHash)) { + result = true; + } + + return result; + } + } diff --git a/org.flowerplatform.flex_client.core/src/org/flowerplatform/flex_client/core/CorePlugin.as b/org.flowerplatform.flex_client.core/src/org/flowerplatform/flex_client/core/CorePlugin.as index 0271aa47..0c069b1f 100644 --- a/org.flowerplatform.flex_client.core/src/org/flowerplatform/flex_client/core/CorePlugin.as +++ b/org.flowerplatform.flex_client.core/src/org/flowerplatform/flex_client/core/CorePlugin.as @@ -80,7 +80,7 @@ package org.flowerplatform.flex_client.core { import org.flowerplatform.flexutil.controller.TypeDescriptor; import org.flowerplatform.flexutil.controller.TypeDescriptorRegistry; import org.flowerplatform.flexutil.controller.TypeDescriptorRemote; - import org.flowerplatform.flexutil.iframe.IFrameOpenUrl; + import org.flowerplatform.flexutil.iframe.OpenUrlInIFrameAction; import org.flowerplatform.flexutil.layout.IWorkbench; import org.flowerplatform.flexutil.layout.Perspective; import org.flowerplatform.flexutil.service.ServiceLocator; @@ -319,9 +319,9 @@ package org.flowerplatform.flex_client.core { .show(); })); - registerActionToGlobalMenu(new IFrameOpenUrl() + registerActionToGlobalMenu(new OpenUrlInIFrameAction() .setLabel(Resources.getMessage("iframe.title")) - .setIcon(Resources.urlIcon) + .setIcon(Resources.openUrlIcon) .setParentId(CoreConstants.NAVIGATE_MENU_ID) ); diff --git a/org.flowerplatform.flex_client.resources/src/org/flowerplatform/flex_client/resources/Resources.as b/org.flowerplatform.flex_client.resources/src/org/flowerplatform/flex_client/resources/Resources.as index 0b60d012..d6e3dd06 100644 --- a/org.flowerplatform.flex_client.resources/src/org/flowerplatform/flex_client/resources/Resources.as +++ b/org.flowerplatform.flex_client.resources/src/org/flowerplatform/flex_client/resources/Resources.as @@ -60,6 +60,9 @@ package org.flowerplatform.flex_client.resources { [Embed(source="/core/open.png")] public static const openIcon:Class; + [Embed(source="/core/url_icon.png")] + public static const openUrlIcon:Class; + [Embed(source="/core/download.png")] public static const downloadIcon:Class; @@ -84,9 +87,6 @@ package org.flowerplatform.flex_client.resources { [Embed(source="/core/table_gear.png")] public static const tableGear:Class; - [Embed(source="/core/url_icon.png")] - public static const urlIcon:Class; - // Properties [Embed(source="/properties/properties.gif")] diff --git a/org.flowerplatform.flexutil/.flexLibProperties b/org.flowerplatform.flexutil/.flexLibProperties index 546aa1da..56f2417b 100644 --- a/org.flowerplatform.flexutil/.flexLibProperties +++ b/org.flowerplatform.flexutil/.flexLibProperties @@ -28,8 +28,8 @@ - - + + diff --git a/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/iframe/IFrameOpenUrl.as b/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/iframe/OpenUrlInIFrameAction.as similarity index 65% rename from org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/iframe/IFrameOpenUrl.as rename to org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/iframe/OpenUrlInIFrameAction.as index 0976b82b..51f25121 100644 --- a/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/iframe/IFrameOpenUrl.as +++ b/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/iframe/OpenUrlInIFrameAction.as @@ -4,18 +4,21 @@ package org.flowerplatform.flexutil.iframe { import org.flowerplatform.flexutil.FlexUtilGlobals; import org.flowerplatform.flexutil.action.ActionBase; - public class IFrameOpenUrl extends ActionBase { + /** + * @author Andreea Tita + */ + public class OpenUrlInIFrameAction extends ActionBase { - public function IFrameOpenUrl() { + public function OpenUrlInIFrameAction() { super(); } override public function run():void { - var view:IFrameOpenUrlView = new IFrameOpenUrlView(); + var view:OpenUrlInIFrameView = new OpenUrlInIFrameView(); FlexUtilGlobals.getInstance().popupHandlerFactory.createPopupHandler() .setViewContent(view) .setTitle(Resources.getMessage("iframe.title")) - .setIcon(Resources.urlIcon) + .setIcon(Resources.openUrlIcon) .setWidth(350) .setHeight(150) .show(); diff --git a/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/iframe/IFrameOpenUrlView.mxml b/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/iframe/OpenUrlInIFrameView.mxml similarity index 85% rename from org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/iframe/IFrameOpenUrlView.mxml rename to org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/iframe/OpenUrlInIFrameView.mxml index 57dbcefe..b9ad38f1 100644 --- a/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/iframe/IFrameOpenUrlView.mxml +++ b/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/iframe/OpenUrlInIFrameView.mxml @@ -1,4 +1,7 @@ + @@ -21,9 +24,8 @@ - + - diff --git a/org.flowerplatform.js_client.core/WebContent/js/controllers.js b/org.flowerplatform.js_client.core/WebContent/js/controllers.js index fc99ba52..f903a727 100644 --- a/org.flowerplatform.js_client.core/WebContent/js/controllers.js +++ b/org.flowerplatform.js_client.core/WebContent/js/controllers.js @@ -18,4 +18,14 @@ flowerControllers.controller('ComposedCtrl', ['$scope', 'contentTemplate', 'side $scope.template_sideMenu = { url: Template[sideMenuTemplate] }; $scope.template_sideMenuContentTemplate = { url: Template[sideMenuContentTemplate] }; -}]); \ No newline at end of file +}]); + +flowerControllers.controller('NavigationCtrl', function($scope, $location, $anchorScroll) { + $scope.path='General'; + $scope.scrollTo = function(id) { + var old = $location.hash(); + $location.hash(id); + $anchorScroll(); + $location.hash(old); + } +}); \ No newline at end of file diff --git a/org.flowerplatform.js_client.core/WebContent/partials/composed/sideMenuLayout.html b/org.flowerplatform.js_client.core/WebContent/partials/composed/sideMenuLayout.html index 8e056359..319fbdb8 100644 --- a/org.flowerplatform.js_client.core/WebContent/partials/composed/sideMenuLayout.html +++ b/org.flowerplatform.js_client.core/WebContent/partials/composed/sideMenuLayout.html @@ -2,16 +2,16 @@
-
+
-
+
-
-
+
+
diff --git a/org.flowerplatform.js_client.core/WebContent/style/style.css b/org.flowerplatform.js_client.core/WebContent/style/style.css index 19a251be..9cee6581 100644 --- a/org.flowerplatform.js_client.core/WebContent/style/style.css +++ b/org.flowerplatform.js_client.core/WebContent/style/style.css @@ -1,111 +1,75 @@ -.user-panel { +html { + min-height:100%; + position:relative; +} +body { + height:100%; +} + +/* style for right view */ +#col-side-menu, #side-menu { + position: absolute; + right: 0; + height: 100%; + min-height: 100%; + min-width: 55%; +} +#user-panel { + position: absolute; + right: 0; background:RGB(219,217,214); - position:absolute; - right:-100px; - width: 300px; + height: 100%; + min-height:100%; + min-width: 100%; } -.user-panel-name { - padding: 40px; +/* style for user image and name */ +#user-panel-header { + text-align: center; } +/* style for navbar */ +.navbar-menu { + padding-top: 40px; +} .navbar-header { float: none; } - .navbar-toggle { display: block; } - .navbar-collapse { border-top: 1px solid transparent; } - .navbar-collapse.collapse { display: none!important; } - .navbar-nav { float: none!important; margin: 7.5px -15px; } - .navbar-nav>li { float: none; } -#profile { - border-bottom: 1px solid RGB(219,217,214); -} - -.user-settings { - width: 500px; - background: none repeat scroll 0 0 #fff; - color: #666; - padding-left: 30px; - padding-right: 30px; - padding-top: 10px; - padding-bottom: 10px; -} - -.user-settings h3 { - padding-left: 30px; - padding-right: 30px; -} - +/* style for the first elements in form */ .change-username-form , .password-confirmation-form { margin-top: 0; } -.button { - background-color: #eeeeee; - border: 1px solid #d5d5d5; - border-radius: 3px; - color: #333; - font-size: 13px; - font-weight: bold; - padding: 7px 12px; - position: relative; - opacity: 0.8; -} - -.navbar-menu { - border-left: 20px solid transparent; - border-right: 20px solid transparent; -} - -.panel-default { - margin-left: 20px; - margin-right: 20px; -} - +/* style for elements from Profile panel */ .nav-pills>li>a { text-decoration:none; color: black; } -.panel-danger { - margin-left: 20px; - margin-right: 20px; -} - -.alert-danger { - margin-left: -30px; - margin-right: -30px; -} - -.nav-pills>li.active>a { - background-color: RGB(219,217,214); - color: black; -} - -.nav-pills>li.active>a:hover { - background-color: #EEE; - color: black; -} - +/* style for input if nothing is written */ :required { box-shadow: 1px 1px 4px transparent; } -hr { margin: 0.1em auto; } +/* style for delete-account button */ +#delete-account-button { + color: #8A0808; + width: 100%; +} \ No newline at end of file diff --git a/org.flowerplatform.js_client.users/WebContent/js/app.js b/org.flowerplatform.js_client.users/WebContent/js/app.js index 5a672ea9..d7876594 100644 --- a/org.flowerplatform.js_client.users/WebContent/js/app.js +++ b/org.flowerplatform.js_client.users/WebContent/js/app.js @@ -40,24 +40,4 @@ routesConfig.push({ } } } -}); - -routesConfig.push({ - path: '/users/:id/settings', - deps: ['js_client.users/js/services.js', 'js_client.users/js/controllers.js'], - route: { - templateUrl: 'partials/composed/sideMenuLayout.html', - controller: 'ComposedCtrl', - resolve: { - contentTemplate : function() { - return 'userAccountSettings'; - }, - sideMenuTemplate : function() { - return 'userSideMenu'; - }, - sideMenuContentTemplate : function() { - return 'userFormSideMenuContent'; - } - } - } }); \ No newline at end of file diff --git a/org.flowerplatform.js_client.users/WebContent/js/controllers.js b/org.flowerplatform.js_client.users/WebContent/js/controllers.js index 14d0c980..93e407bc 100644 --- a/org.flowerplatform.js_client.users/WebContent/js/controllers.js +++ b/org.flowerplatform.js_client.users/WebContent/js/controllers.js @@ -23,88 +23,63 @@ flowerProject.lazy.controller('UserListCtrl', ['$scope', '$location', 'User', 'T }]); -flowerProject.lazy.controller('UserFormCtrl', ['$scope', '$routeParams', '$location', '$http', 'User', - function($scope, $routeParams, $location, $http, User) { - - /** - * Get the user from the server, or create new user for this $scope. - */ - $scope.user = $routeParams.id == 'new' ? new User() : User.get({ id: $routeParams.id }); - - $scope.save = function() { - User.save($scope.user.messageResult).$promise.then(function(result) { - $scope.alert = { - message: 'User information for ' + result.firstName + ' ' + result.lastName + ' has been successfully updated.', - visible: true, - success: true - }; - }, function(error) { - $scope.alert = { - message: 'Server error. Please try again.', - visible: true, - danger: true - }; - }); - }; - - /** - * Go to users list. - */ - $scope.cancel = function() { - $location.path('/users'); - } - - $scope.remove = function() { - User.remove({ id: $scope.user.messageResult.nodeUri }).$promise.then(function(result) { - $scope.alert = { - message: 'User was deleted.', - visible: true, - success: true - }; - }, function(error) { - $scope.alert = { - message: 'Server error. Please try again.', - visible: true, - danger: true - }; - }); - }; - - }]); - -flowerProject.lazy.controller('UserAccountSettingsCtrl', ['$scope', '$routeParams', 'User' , 'Login' , - function($scope, $routeParams, User, Login) { - +flowerProject.lazy.controller('UserFormCtrl', ['$scope', '$routeParams', '$location', '$http', 'User', 'ChangeSettings', + function($scope, $routeParams, $location, $http, User, ChangeSettings) { /** * Get the user from the server, or create new user for this $scope. */ - $scope.login = Login.login; - $scope.changePassword = function(oldPassword, newPassword) { - var user = { nodeUri : Login.nodeUri , - properties: { - 'oldPassword': oldPassword, - 'newPassword': newPassword - }}; - User.save(user).$promise.then(function(result) { - $scope.alert = { - message: 'User information for ' + result.firstName + ' ' + result.lastName + ' has been successfully updated.', - visible: true, - success: true - }; - }, function(error) { - $scope.alert = { - message: 'Server error. Please try again.', - visible: true, - danger: true - }; - }); + $scope.user = $routeParams.id == 'new' ? new User() : User.get({ id: $routeParams.id }); + + $scope.save = function() { + User.save($scope.user.messageResult).$promise.then(function(result) { + $scope.alert = { + message: 'User information for ' + result.messageResult.properties.firstName + ' ' + result.messageResult.properties.lastName + ' has been successfully updated.', + visible: true, + success: true + }; + }, function(error) { + $scope.alert = { + message: 'Server error. Please try again.', + visible: true, + danger: true + }; + }); + }; + + /** + * Go to users list. + */ + $scope.cancel = function() { + $location.path('/users'); + } + + /** + * Delete user + */ + $scope.remove = function() { + User.remove({ id: $scope.user.messageResult.nodeUri }).$promise.then(function(result) { + $scope.alert = { + message: 'User was deleted.', + visible: true, + success: true + }; + }, function(error) { + $scope.alert = { + message: 'Server error. Please try again.', + visible: true, + danger: true + }; + }); }; - $scope.changeUsername = function(newlogin) { - var user = { nodeUri : Login.nodeUri , login : newlogin}; - User.save(user).$promise.then(function(result) { + /** + * Change password + */ + $scope.changePassword = function(oldPassword, newPassword) { + ChangeSettings.changeSettings({ id : $scope.user.messageResult.nodeUri, path : "password"}, + {'oldPassword' : oldPassword, 'newPassword' : newPassword }).$promise.then(function(result) { $scope.alert = { - message: 'User information for ' + result.firstName + ' ' + result.lastName + ' has been successfully updated.', + message: result.messageResult, visible: true, success: true }; @@ -118,13 +93,12 @@ flowerProject.lazy.controller('UserAccountSettingsCtrl', ['$scope', '$routePara }; /** - * Delete user - */ - $scope.deleteAccount = function() { - //var user = {nodeUri : Login.nodeUri}; - User.remove({ id :Login.nodeUri }).$promise.then(function(result) { + * Change login + */ + $scope.changeLogin = function() { + ChangeSettings.changeSettings({ id : $scope.user.messageResult.nodeUri, path : "login" }, $scope.user.messageResult.properties.login).$promise.then(function(result) { $scope.alert = { - message: 'User was deleted', + message: 'User information for ' + result.messageResult.properties.firstName + ' ' + result.messageResult.properties.lastName + ' has been successfully updated.', visible: true, success: true }; @@ -135,5 +109,6 @@ flowerProject.lazy.controller('UserAccountSettingsCtrl', ['$scope', '$routePara danger: true }; }); - }; -}]); \ No newline at end of file + }; + +}]); diff --git a/org.flowerplatform.js_client.users/WebContent/js/services.js b/org.flowerplatform.js_client.users/WebContent/js/services.js index f28c71d8..311c42c5 100644 --- a/org.flowerplatform.js_client.users/WebContent/js/services.js +++ b/org.flowerplatform.js_client.users/WebContent/js/services.js @@ -14,18 +14,29 @@ flowerProject.lazy.factory('User', ['$resource', function($resource) { query: { method: 'GET'/*, interceptor: { 'response': getMessageResult }*/ }, get: { method: 'GET', params: { id: '@id' } }, save: { method: 'POST' }, - remove: { method: 'DELETE', params: { id: '@id' } } + remove: { method: 'DELETE', params: { id: '@id' } }, }); }]); +flowerProject.lazy.factory('ChangeSettings' , ['$resource', function($resource) { + var getMessageResult = function(response) { + var messageResult = response.resource.messageResult; + return messageResult; + }; + + return $resource('http://localhost:8080/org.flowerplatform.host.web_app/ws-dispatcher/users/:id/:path', {}, { + changeSettings: { method: 'POST', params: { id: '@id' , path: '@path' } } + }); +}]); + flowerProject.lazy.factory('Login', [function() { return { - userID: 'user:test|John', + userID: encodeURIComponent("fpp:|.users#ID_1960040384"), userName: 'John Johnson', login: 'John', - nodeUri: 'user:test|John', + nodeUri: "fpp:|.users#ID_1960040384", isAdmin: true, repo: 'Repository' }; diff --git a/org.flowerplatform.js_client.users/WebContent/partials/composed/userSideMenu.html b/org.flowerplatform.js_client.users/WebContent/partials/composed/userSideMenu.html index 621c5881..c8e8b675 100644 --- a/org.flowerplatform.js_client.users/WebContent/partials/composed/userSideMenu.html +++ b/org.flowerplatform.js_client.users/WebContent/partials/composed/userSideMenu.html @@ -1,42 +1,47 @@ + +

-

-
-

+
+
+

- {{userName}} +

- - -
- +
+ +
+ +
+
+
+
-

diff --git a/org.flowerplatform.js_client.users/WebContent/partials/userAccountSettings.html b/org.flowerplatform.js_client.users/WebContent/partials/userAccountSettings.html index b5bb48f8..6a33597d 100644 --- a/org.flowerplatform.js_client.users/WebContent/partials/userAccountSettings.html +++ b/org.flowerplatform.js_client.users/WebContent/partials/userAccountSettings.html @@ -1,72 +1,54 @@ -
- -
- -
+ +
-

Account settings

+

Account settings

Please update this user's information.

+

Change password

+
-
- -
-
- -
-
-
-
- -
-
- -
-
-
-
- -
-
- -
-
-

- -

-
-
+
+
+ + +
+
+
+
+ +
+
+
+
+ +

+ +

Change username

+
+
-
- -
-
- -
+
+
-

- -

+ +

@@ -75,53 +57,46 @@

Change username

Delete account

+
-

- -

+

- + +
+
+
+
+
\ No newline at end of file diff --git a/org.flowerplatform.js_client.users/WebContent/partials/userForm.html b/org.flowerplatform.js_client.users/WebContent/partials/userForm.html index 8b7447ed..d9ff5b11 100644 --- a/org.flowerplatform.js_client.users/WebContent/partials/userForm.html +++ b/org.flowerplatform.js_client.users/WebContent/partials/userForm.html @@ -1,81 +1,14 @@
-

- -

+ +
- -
-

User Profile

-

Please update this user's information.

-
- -
-
-
- - -
- -
- - -
- -
- -
- - -
- -
- - -
- -
- -
- -
- - -
- -
- - -
- -
- -
- - -
- -
- - - - - - -
- -
- -
+ +
+
\ No newline at end of file diff --git a/org.flowerplatform.js_client.users/WebContent/partials/userFormSideMenuContent.html b/org.flowerplatform.js_client.users/WebContent/partials/userFormSideMenuContent.html index 4ca91198..c5d044cf 100644 --- a/org.flowerplatform.js_client.users/WebContent/partials/userFormSideMenuContent.html +++ b/org.flowerplatform.js_client.users/WebContent/partials/userFormSideMenuContent.html @@ -1,11 +1,21 @@ -
-
-

Profile

+
+ +
+ +
+

Profile

+
+ +
+ +
+
- -
\ No newline at end of file + +
+ diff --git a/org.flowerplatform.js_client.users/WebContent/partials/userGeneralSettings.html b/org.flowerplatform.js_client.users/WebContent/partials/userGeneralSettings.html new file mode 100644 index 00000000..bda3b49d --- /dev/null +++ b/org.flowerplatform.js_client.users/WebContent/partials/userGeneralSettings.html @@ -0,0 +1,59 @@ + + +
+
+

User Profile

+

Please update this user's information.

+
+ +
+
+
+ + +
+ +
+
+ + +
+ +
+ + +
+
+ +
+
+ + +
+
+ +
+ +
+ +
+
+ + + + + +
+
+
+ +
+ \ No newline at end of file diff --git a/org.flowerplatform.js_client.users/WebContent/partials/userList.html b/org.flowerplatform.js_client.users/WebContent/partials/userList.html index fff8be56..8f050474 100644 --- a/org.flowerplatform.js_client.users/WebContent/partials/userList.html +++ b/org.flowerplatform.js_client.users/WebContent/partials/userList.html @@ -26,7 +26,7 @@

User List

{{user.properties.login}} - {{user.properties.name}} + {{user.properties.firstName}} {{user.properties.lastName}} {{user.properties.email}} diff --git a/org.flowerplatform.resources/public-resources/images/core/url_icon.png b/org.flowerplatform.resources/public-resources/images/core/url_icon.png index 10dfaba079e97af14c16343ea4ec134f106505d1..414cff505ddee9ce483e13a6d08027c3be0b90c9 100644 GIT binary patch delta 730 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 JPDHLkV1mNOP+$N6 diff --git a/org.flowerplatform.resources/readme.md b/org.flowerplatform.resources/readme.md index 2962e4b5..7aefe946 100644 --- a/org.flowerplatform.resources/readme.md +++ b/org.flowerplatform.resources/readme.md @@ -17,7 +17,7 @@ Holds images and messages. | images/core/keyboard.png | https://www.iconfinder.com/icons/36136/keyboard_icon#size=16 | http://www.fatcow.com/ | core | | images/mindmap/arrowDown.png | https://www.iconfinder.com/icons/211620/arrow_b_right_icon#size=16 | http://opensource.org/licenses/MIT | mindmap | | images/mindmap/arrowUp.png | https://www.iconfinder.com/icons/211620/arrow_b_right_icon#size=16 | http://opensource.org/licenses/MIT | mindmap | -| images/properties/preferences.png | https://www.iconfinder.com/icons/105256/application_applications_configuration_contact_control_de_desktop_engineering_gear_gears_generator_machine_mime_preferences_reductor_settings_system_tool_tools_work_icon#size=16 | http://www.aha-soft.com/ | properties | +| images/properties/preferences.png | https://www.iconfinder.com/icons/105256/application_applications_configuration_contact_control_de_desktop_engineering_gear_gears_generator_machine_mime_preferences_reductor_settings_system_tool_tools_work_icon#size=16 | http://www.aha-soft.com/ | properties | | images/properties/preference.png | https://www.iconfinder.com/icons/105244/application_applications_configuration_contact_control_desktop_engineering_gear_gears_generator_machine_mime_preferences_reductor_settings_system_tool_tools_work_icon#size=16 | http://www.aha-soft.com/ | properties | ### Icons allowed for commercial use (NO link required) == @@ -25,7 +25,8 @@ Holds images and messages. | Icon Name | Icon Source URL | Usage | | ------------- | ------------- | ------------- | | images/core/download.png | https://www.iconfinder.com/icons/14411/arrow_down_download_icon#size=16 | core | -| images/core/upload.png | https://www.iconfinder.com/icons/14667/upload_icon#size=16 | core | +| images/core/upload.png | https://www.iconfinder.com/icons/14667/upload_icon#size=16 | core | +| images/core/url_icon.png | https://www.iconfinder.com/icons/21747/insert_url_icon#size=16 | core From 8ab3ba3061cfb42ed3cd7cdc0144b57db2a69d5e Mon Sep 17 00:00:00 2001 From: andreea-tita Date: Fri, 5 Sep 2014 12:12:24 +0300 Subject: [PATCH 04/13] #471 - modified css,added enter handler for iframe,Android platform verified --- .../src/MainMobile.mxml | 11 ++++++--- .../flexutil/iframe/OpenUrlInIFrameView.mxml | 2 +- .../WebContent/style/style.css | 13 +++++++---- .../partials/userAccountSettings.html | 22 +++++++----------- .../public-resources/images/core/url_icon.png | Bin 3330 -> 753 bytes 5 files changed, 27 insertions(+), 21 deletions(-) diff --git a/org.flowerplatform.flex_client.host_app.mobile/src/MainMobile.mxml b/org.flowerplatform.flex_client.host_app.mobile/src/MainMobile.mxml index b4014eca..bdd643ad 100644 --- a/org.flowerplatform.flex_client.host_app.mobile/src/MainMobile.mxml +++ b/org.flowerplatform.flex_client.host_app.mobile/src/MainMobile.mxml @@ -78,7 +78,6 @@ import es.xperiments.media.StageWebviewDiskEvent; import org.flowerplatform.flex_client.codesync.CodeSyncPlugin; - import org.flowerplatform.flex_client.core.CoreConstants; import org.flowerplatform.flex_client.core.CorePlugin; import org.flowerplatform.flex_client.host_app.mobile.view_content_host.WorkbenchMobileSplitViewHost; import org.flowerplatform.flex_client.host_app.mobile.view_edit_server_account.CommunicationErrorView; @@ -133,6 +132,11 @@ setDescriptorWithUrl(new TextPlugin(), 'servlet/public-resources/org.flowerplatform.flex_client.text/swc/org.flowerplatform.flex_client.text.swc|library.swf?pluginClass=TextPlugin') ]; + + public static function isAndroid():Boolean { + return (Capabilities.version.substr(0,3) == "AND"); + } + private function startPlugins():void { setBackButtonEnabled(true); for each (var plugin:AbstractFlexPlugin in plugins) { @@ -142,7 +146,8 @@ plugin.start(); } - var isAndroid:Boolean = true; + var isAndroid:Boolean = isAndroid(); + if (isAndroid) { CorePlugin.getInstance().serviceLocator.invoke("coreService.getSessionId", null, function(sessionId:String):void { StageWebViewDisk.addEventListener(StageWebviewDiskEvent.END_DISK_PARSING, function onDiskCacheEnd(e:StageWebviewDiskEvent):void { @@ -188,7 +193,7 @@ if (serverAccounts == null || serverAccounts.length == 0 ) { // add FP hub var hub:ServerAccount = new ServerAccount(); - hub.host = "http://csp41:8080/org.flowerplatform.host.web_app/"; + hub.host = "http://localhost:8080/org.flowerplatform.host.web_app/"; hub.friendlyName = "Flower Platform Hub"; hub.user = ""; hub.isDefault = true; diff --git a/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/iframe/OpenUrlInIFrameView.mxml b/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/iframe/OpenUrlInIFrameView.mxml index 081727bf..67918bcc 100644 --- a/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/iframe/OpenUrlInIFrameView.mxml +++ b/org.flowerplatform.flexutil/src/org/flowerplatform/flexutil/iframe/OpenUrlInIFrameView.mxml @@ -22,7 +22,7 @@ - + diff --git a/org.flowerplatform.js_client.core/WebContent/style/style.css b/org.flowerplatform.js_client.core/WebContent/style/style.css index 9cee6581..3d0881f9 100644 --- a/org.flowerplatform.js_client.core/WebContent/style/style.css +++ b/org.flowerplatform.js_client.core/WebContent/style/style.css @@ -1,9 +1,11 @@ html { - min-height:100%; - position:relative; + min-height: 100%; + min-width: 100%; + position: relative; } body { - height:100%; + height: 100%; + width: 100%; } /* style for right view */ @@ -12,8 +14,10 @@ body { right: 0; height: 100%; min-height: 100%; - min-width: 55%; + min-width: 50%; + overflow: hidden; } + #user-panel { position: absolute; right: 0; @@ -21,6 +25,7 @@ body { height: 100%; min-height:100%; min-width: 100%; + overflow: auto; } /* style for user image and name */ diff --git a/org.flowerplatform.js_client.users/WebContent/partials/userAccountSettings.html b/org.flowerplatform.js_client.users/WebContent/partials/userAccountSettings.html index 6a33597d..4f97b0d0 100644 --- a/org.flowerplatform.js_client.users/WebContent/partials/userAccountSettings.html +++ b/org.flowerplatform.js_client.users/WebContent/partials/userAccountSettings.html @@ -14,18 +14,18 @@

Change password

-
-
+ +
-
+
-
+
@@ -41,9 +41,8 @@

Change username

- - -
+ +
@@ -59,7 +58,7 @@

Delete account

- +

@@ -68,7 +67,6 @@

Delete account