Project

General

Profile

Feature #3222

rewrite admin console for native web (html5/css/javascript)

Added by Greg Shah over 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD

GroupsAccountManagement.png (64.6 KB) Sergey Ivanovskiy, 03/09/2017 04:00 AM

ds_bind.diff Magnifier (926 Bytes) Hynek Cihlar, 03/09/2017 03:15 PM

SessionsWithFilter.png (30.1 KB) Sergey Ivanovskiy, 03/24/2017 02:39 PM

admin_ca.zip (38.5 KB) Hynek Cihlar, 04/26/2017 09:51 AM

extended_user_report.pdf (22.3 KB) Sergey Ivanovskiy, 05/04/2017 07:13 AM

extended_user_report_with_nonfittedrows.pdf (124 KB) Sergey Ivanovskiy, 05/04/2017 07:46 AM

groups_report_word_wraps.pdf (8.58 KB) Sergey Ivanovskiy, 05/08/2017 10:18 AM

groups.pdf (17.4 KB) Sergey Ivanovskiy, 05/08/2017 04:21 PM

Screenshot at 2017-06-01 10_49_00.png (93.8 KB) Hynek Cihlar, 06/01/2017 04:52 AM

Screenshot at 2017-06-01 10_47_59.png (94.2 KB) Hynek Cihlar, 06/01/2017 04:52 AM


Related issues

Related to Database - Feature #3307: enhance LockAdministrator implementation to collect info on sessions waiting to lock a record New
Related to Runtime Infrastructure - Bug #3338: performance of large report PDF generation in admin UI is very slow New
Related to Runtime Infrastructure - Support #3339: rework the admin UI package javadoc to match the current advin v2 implementation New

History

#1 Updated by Greg Shah over 7 years ago

  • Tracker changed from Bug to Feature

This task is for the rewrite/conversion of the current admin console (java applet) to a pure javascript approach.

Thoughts on the approach (from CA, HC, GES):

Use GWT to re-build the admin console, as there are no constraints on how the admin console needs to look. The advantage is that we may reuse the logic and data structures at the source code level, with relatively little changes. Also the structure of GWT apps is similar to Swing - UI components and events through subscriber pattern. A quick check of the applet sources didn't find any UI components not already present in GWT (there are even very good 3rd party component libraries if needed).

To call the admin API (which is on the Java P2J server) we could reuse the binary two-way web socket implementation that we developed. The advantage of this is that we have already carefully considered how to make an efficient and secure transport and by reusing it, any fixes in that code would be leveraged in both places. On the other hand, the amount of data that will be sent via the admin API is not as heavy as the web GUI driver and we have less of a need for the binary support. The primary problem is that if we use the web socket implementation, we will need to encode all API definitions as we do now for the GUI web driver, which is not only time consuming, but harder to maintain.

GWT provides an RPC that is a simpler way to implement the API transport. It handles the tough parts of the call/return for us and hides some of the complexity that we encode manually in the GUI web client implementation (for performance purposes). Of course, one can plug in any transport mechanism, so reusing the existing mechanisms from the web-client should be OK. But GWT's RPC is very easy to use and maintain and would be probably cheaper to built on it. The RPC works over HTTPS as long as the whole GWT app is served to the client over HTTPS. GWT uses standard POST requests with serialized objects, it posts to the base URL (from where the app was loaded) and adds a custom suffix to it.

As long as we can make the GWT RPC work securely and with reasonable performance, then using the GWT RPC is the approach we will use.

Overall the idea with GWT is to have both a framework for the UI (layout, tables ,etc) and a simpler way for the RPC transport. We want to avoid having to write html components by hand.

We will need to provide javascript versions of all the screens in the admin console (see com/goldencode/p2j/admin/client/), including the customer's add-on screens (see src/.../admin/client/). Since the server side of the admin console is already written as an API today, I expect that the majority of the work is in the replacement of the Swing applet code.

We need to plan that our Jetty servlet container will be configured via program (FWD server startup code for the admin console), instead of using a deployment descriptor. This is consistent with our current Jetty implementation and we also will need to be able to dynamically load customer-specific extensions (which will be configured in the directory).

As a rough estimate, expect a total of 256 man-hrs. 40 hrs for the basic application infrastructure, common data structures, transport and server binding, 24 hrs for each of the seven more complex screens, 16 hrs for each of the two less complex screens, 16 hrs testing.

#2 Updated by Eric Faulhaber about 7 years ago

Is there a requirement for the UI to be built using responsive design? If so, how easy is it to do so with GWT?

#3 Updated by Hynek Cihlar about 7 years ago

Eric Faulhaber wrote:

Is there a requirement for the UI to be built using responsive design? If so, how easy is it to do so with GWT?

GWT depends on CSS for HTML styling and AFAIK the default style sheets do not provide responsiveness. However there are third party templates like the material design one at https://gwtmaterialdesign.github.io/gwt-material-demo. Alternatively we can always write our own CSS.

#4 Updated by Greg Shah about 7 years ago

Is there a requirement for the UI to be built using responsive design? If so, how easy is it to do so with GWT?

Here is an example of how someone did responsive design with GWT:

http://www.javaworld.com/article/2842875/java-web-development/responsive-web-design-with-google-web-toolkit.html

BUT, I should note that it is NOT a top priority. Responsive design can take a significant amount of time to implement and we did not plan for that time in this task. I would prefer to keep the option open to implement it later, but not to spend significant time on it now.

#5 Updated by Hynek Cihlar about 7 years ago

I am currently working on bootsrapping the new admin application and require an advice of what server/client runtime modes to use.

The new admin is a standard GWT application running JS in the web browser connected to a GWT servlet which transparently handles remoting. The servlet requires a servlet handler together with a servlet session manager, all is embedded in Jetty similarly as we embed other components served to the web.

My unknown is whether the servlet (handler) can be (or should be) running inside the server JVM or whether new p2j client should be spawn as we currently do in case of Web UI clients?

#6 Updated by Greg Shah about 7 years ago

My unknown is whether the servlet (handler) can be (or should be) running inside the server JVM

Running inside the server JVM is significantly preferred. I want to avoid the complexity of a client JVM. The trick will be dynamically setting up (and tearing down) the security context for each request/response.

#7 Updated by Greg Shah about 7 years ago

Sergey: Please look at the backend part of the admin UI, that is to create the GWT RemoteService interface and implement it according to the existing Admin API.

Hynek is working on the server-side application bootstrap and the high-level UI layout on the client.

#8 Updated by Sergey Ivanovskiy about 7 years ago

Hynec, would you plan to keep this directory structure of src/com/goldencode/p2j/admin2/?

admin2.iml
AdminApp.launch
build.xml
gwt-unitCache/
src/
war/  

It seems that the sources src/ can be attached to this root package com/goldencode/p2j/admin2/ directly (in the main project src/) to be parsed by the current Eclipse project.
The current admin API uses these data objects:
AdminDef.java
CertDef.java
DatabaseDef.java
PersistenceDef.java
RecordLockInfo.java
StartupDef.java
AclDef.java
AuditDef.java
ExportsDef.java
LoggingDef.java
ProcessDef.java
RuntimeDef.java
TaggedName.java
AuthConfigDef.java
GroupDef.java
RecordInfo.java
SessionInfo.java
UserDef.java
JarOpErrorCode.java

Would you like to reuse these data object and to make them DTO objects?

#9 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynec, would you plan to keep this directory structure of src/com/goldencode/p2j/admin2/?

Yes, the idea is to deploy admin2 as an embedded servlet app running in the fwd server process. This is why the sources are placed inside of src/com/goldencode/p2j.

Would you like to reuse these data object and to make them DTO objects?

Yes.

#10 Updated by Sergey Ivanovskiy about 7 years ago

Ok, thank you. Please correct if my understanding is not correct. Does it mean that this new web application will be injected in the current web server process depending on the directory settings if admin console is enabled? Would you plan to implement it or is it included in my work part?

#11 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Ok, thank you. Please correct if my understanding is not correct. Does it mean that this new web application will be injected in the current web server process depending on the directory settings if admin console is enabled? Would you plan to implement it or is it included in my work part?

Yes, you got the idea. The web application will be injected to the server process however not the client. This part is on me, I already have some changes for this.

#12 Updated by Sergey Ivanovskiy about 7 years ago

Ok, it seems that I have time to debug the current admin and to use it and to check the current work flows for different screens before implementing these all DTO and the GWT RemoteService interface based on the current AdminExports.

#13 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Ok, it seems that I have time to debug the current admin and to use it and to check the current work flows for different screens before implementing these all DTO and the GWT RemoteService interface based on the current AdminExports.

Yes, please let me know if you need any help there.

#14 Updated by Sergey Ivanovskiy about 7 years ago

Ok, thank you. I think that due to jetty changes we need to fix workable state for the current admin console

=== modified file 'src/com/goldencode/p2j/main/AppletHandler.java'
--- src/com/goldencode/p2j/main/AppletHandler.java    2013-11-07 07:38:05 +0000
+++ src/com/goldencode/p2j/main/AppletHandler.java    2017-02-10 19:22:37 +0000
@@ -23,6 +23,7 @@
 import javax.servlet.*;
 import javax.servlet.http.*;

+import org.eclipse.jetty.http.MimeTypes;
 import org.eclipse.jetty.server.handler.*;
 import org.eclipse.jetty.server.*;

@@ -386,6 +387,9 @@
       public JarResourceHandler(HashMap<String, String> jarMap)
       {
          this.jarMap = jarMap;
+         final MimeTypes mimeTypes = new MimeTypes();
//+         mimeTypes.addMimeMapping("jar", "application/java-archive");
+         setMimeTypes(mimeTypes);
       }

       /**

It is required to initialize _mimeTypes field of the base handler.

#15 Updated by Greg Shah about 7 years ago

Please create branch 3222a and put your changes there.

#16 Updated by Hynek Cihlar about 7 years ago

Greg Shah wrote:

Please create branch 3222a and put your changes there.

Please note that 3222a already exists.

#17 Updated by Sergey Ivanovskiy about 7 years ago

Hynec, 3222a grows from 11135 and doesn't contain gradle changes. The note 14 is only to initialize _mimeTypes that can be initialized on doStart(). But we don't use it because our handler is not managed by a ContainerLifeCycle.

#18 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynec, 3222a grows from 11135 and doesn't contain gradle changes.

Yes, we should rebase. Can I do it now, or do you have any changes to be checked in?

The note 14 is only to initialize _mimeTypes that can be initialized on doStart(). But we don't use it because our handler is not managed by a ContainerLifeCycle.

I think the proper way is to "start" the JarResourceHandler instantiated in AppletHandler(). This is what I did to fix the NPE error. Let me check in the change.

#19 Updated by Sergey Ivanovskiy about 7 years ago

I have no changes. Yes, agree, please rebase 3222a.

#20 Updated by Hynek Cihlar about 7 years ago

Hynek Cihlar wrote:

I think the proper way is to "start" the JarResourceHandler instantiated in AppletHandler(). This is what I did to fix the NPE error. Let me check in the change.

Please see 3222a revision 11137.

Also you may need the following change to make the original admin work, depending on your actual configuration.

index 1f79d65,1f79d65..edc2c6f
--- a/src/com/goldencode/p2j/main/AppletHandler.java
+++ b/src/com/goldencode/p2j/main/AppletHandler.java
@@@ -126,7 -126,7 +134,8 @@@
                    allJars.append(',');

                 String baseName    = getBaseName(realJarName);
--               String virtJarName = targetRoot + "/" + baseName; 
++               String virtJarName = targetRoot + "/" + baseName;
++               virtJarName = virtJarName.replace("//", "/");

                 allJars.append(virtJarName);
                 jarMap.put(virtJarName, realJarName);

#21 Updated by Hynek Cihlar about 7 years ago

3222a rebased against latest trunk.

#22 Updated by Sergey Ivanovskiy about 7 years ago

No, I can access Admin applet without path modifications. It looks unclear that from the code user's passwords are encoded in the directory.xml using SHA1 message digest (HashPassword) but a simple test on my system echo "actual password" | sha1sum (echo "actual password" | sha1sum | base64) produces a different string from the current user's password stored in the directory.xml. What is an actual message digest algorithm for user's passwords?

#23 Updated by Sergey Ivanovskiy about 7 years ago

Hynek, please clarify the archtecture of the GWT Admin application. Does it look like the GWT server is a P2J server client and GWT client delegates all its requests to GWT server, and the GWT server delegates logon requests and all other requests to P2J server. Is there a direct access to the P2J server from the GWT admin web application?
Found that the current Admin server doesn't implement these methods

   public static String[] listLoggingInstances()
   public static LoggingDef getLogging(String name)
   public static boolean setLogging(LoggingDef logging)
   public static boolean addLogging(String name, LoggingDef logging)
   public static boolean cloneLogging(String nameFrom, String nameTo)
   public static boolean moveLogging(String nameFrom, String nameTo)
   public static boolean deleteLogging(String name)
   public static String[] listExportsInstances()
   public static ExportsDef getExports(String name)
   public static boolean setExports(ExportsDef logging)
   public static boolean addExports(String name, ExportsDef logging)
   public static boolean cloneExports(String nameFrom, String nameTo)
   public static boolean moveExports(String nameFrom, String nameTo)
   public static boolean deleteExports(String name)
   public static String[] listStartupInstances()

   public static StartupDef getStartup(String name)
   public static boolean setStartup(StartupDef startup)
   public static boolean addStartup(String name, StartupDef logging)

   public static boolean cloneStartup(String nameFrom, String nameTo)
   public static boolean moveStartup(String nameFrom, String nameTo)
   public static boolean deleteStartup(String name)
   public static String[] listPersistenceInstances()

   public static PersistenceDef getPersistence(String name)
   public static boolean setPersistence(PersistenceDef persistence)
   public static boolean addPersistence(String name, PersistenceDef persistence)
   public static boolean clonePersistence(String nameFrom, String nameTo)

   public static boolean movePersistence(String nameFrom, String nameTo)
   public static boolean deletePersistence(String name)

   public static String[] listDatabaseInstances()

   public static DatabaseDef getDatabase(String name)

   public static boolean setDatabase(DatabaseDef database)

   public static boolean addDatabase(String name, DatabaseDef logging)

   public static boolean cloneDatabase(String nameFrom, String nameTo)

   public static boolean moveDatabase(String nameFrom, String nameTo)

   public static boolean deleteDatabase(String name)

   public static String[] listRuntimeNames()

   public static String[] listRuntimeServers()

   public static String[] listRuntimeAccounts()

   public static String[] searchRuntimeByAccount(String account, String itemName)

   public static RuntimeDef getRuntime(String serverName, String accountName)

   public static boolean setRuntime(RuntimeDef runtime)

   public static boolean addRuntime(String serverName, String accountName, 
                             RuntimeDef runtime)
   public static boolean cloneRuntime(String serverNameFrom, String accountNameFrom,
                               String serverNameTo, String accountNameTo)

   public static boolean moveRuntime(String serverNameFrom, String accountNameFrom,
                               String serverNameTo, String accountNameTo)
   public static boolean deleteRuntime(String serverName, String accountName)

May be I lost some unimplemented methods here. Should these methods be implemented in this task?

#24 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynek, please clarify the archtecture of the GWT Admin application. Does it look like the GWT server is a P2J server client and GWT client delegates all its requests to GWT server, and the GWT server delegates logon requests and all other requests to P2J server. Is there a direct access to the P2J server from the GWT admin web application?

The server part of the GWT app will exist in-process in the FWD server, the servlet will be initialized as part of the FWD server bootsrap (i.e. StandardServer.bootstrap() or close to this method). The servlet will be passed the existing AdminServerImpl (or AdminExports if we make AdminServerImpl to implement this interface) which is also initialized in StandardServer.bootstrap(). For now please assume that your servlet already has a reference to AdminExports and implement the servlet with this assumption.

May be I lost some unimplemented methods here. Should these methods be implemented in this task?

AFAIK, our task is not to provide any additional features, only convert the existing application to html5.

#25 Updated by Hynek Cihlar about 7 years ago

Greg, please validate the following pseudo algorithm for establishing the security context for the GWT admin. I want to make sure I get it right before it is fully implemented.

The term GWT client refers to the admin application part running in web browser. The term GWT server refers to the GWT servlet and related classes running in the Jetty server embedded in FWD server process.

1. A request comes from the GWT client trying to access a protected resource.
2a. GWT server checks whether the HTTP session contains a valid and authenticated security context and it doesn't find it.
2b. GWT server creates HTTP response to notify GWT client to show a login form.
3. User submits his credentials.
4a. GWT server recognizes the login request,
4b. establishes an unique initial security context for the current thread by calling SecurityManager.getInstance().setUniqueInitialSecurityContext() if it doesn't already exists,
4c. processes the login credentials and calls SecurityManager.serverAuthHook(), if the method returns auth success, retrieves the UserAccount and checks whether it is enabled (is Admin user role/rights check needed here?),
4d. creates new security context, by calling SecurityManager.createSecurityContext(), creates new com.goldencode.p2j.security.Session,
4e. stores the created security context (and/or Session) in HTTP session,
4f. creates a success HTTP response to GWT client.
5. GWT client repeats the original request for the protected resource.
6a. GWT server checks whether the HTTP session contains a valid and authenticated security context and it does find it.
6b. establishes an unique initial security context for the current thread by calling SecurityManager.getInstance().setUniqueInitialSecurityContext() if it doesn't already exists,
6c. sets the context from step 6a with SecurityManager.pushAndSwitchSecurityContext() and proceeds with dispatching the request to AdminExports.
6d. Before the HTTP response is sent back to GWT client, GWT server pops the security context with SecurityManager.popAndRestoreSecurityContext().

#26 Updated by Greg Shah about 7 years ago

AFAIK, our task is not to provide any additional features, only convert the existing application to html5.

Correct.

#27 Updated by Greg Shah about 7 years ago

User submits his credentials.
4a. GWT server recognizes the login request,
4c. processes the login credentials and calls SecurityManager.serverAuthHook(), if the method returns auth success, retrieves the UserAccount and checks whether it is enabled (is Admin user role/rights check needed here?),
4d. creates new security context, by calling SecurityManager.createSecurityContext(), creates new com.goldencode.p2j.security.Session,

This part must probably call something in the SecurityManager that securely manages the authentication process. Let's call this static method SecurityManager.authenticateServer(String userid, String password). It essentially must replace the SecurityManager.authenticateLocal() code that normally handles the server-side auth for our network protocol. This authenticateServer() code would need to call SecurityManager.serverAuthHook() to authenticate.

If that succeeds, then the equivalent to the bottom part of SecurityManager.authenticateLocal() (starting at line 2830) would be run. The biggest issue with making that common code is that we currently have it integrated with sending back various responses. This code is intermixed, but perhaps it can be separated. In a perfect world, we would extract it into a worker method that can be called from both authenticateLocal() and authenticateServer().

It is important that the security context is managed there, inside of the SM to ensure that the processing is both common code and is secure.

6b. establishes an unique initial security context for the current thread by calling SecurityManager.getInstance().setUniqueInitialSecurityContext() if it doesn't already exists,
6c. sets the context from step 6a with SecurityManager.pushAndSwitchSecurityContext() and proceeds with dispatching the request to AdminExports.
6d. Before the HTTP response is sent back to GWT client, GWT server pops the security context with SecurityManager.popAndRestoreSecurityContext().

Correct. Yes, I think you have the right idea.

#28 Updated by Sergey Ivanovskiy about 7 years ago

Hynec, please review committed revision 11144. It excluded admin2 GWT application classes from the P2J build target ant-compile and added GWT SDK home to admin2 application ant build script. Are there another ways to support dependencies from GWT and P2J for admin2 web application? I would like to use these remote interface and its asynchronous interface src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/shared/AdminService2.java src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/shared/AdminService2Async.java since the admin service interface should be common to server and client packages (rev. 11145). Now the project admin2 has a broken state due to it misses a closed '}' in AddAccountEventHandler.java and some classes are absent (Presenter).

#29 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynec, please review committed revision 11144. It excluded admin2 GWT application classes from the P2J build target ant-compile and added GWT SDK home to admin2 application ant build script.

The changes look good. The exclusion of admin2 classes from p2j build is OK for now. But I am thinking whether we should move admin2 outside of the P2J source tree into its own (i.e. $P2J/admin2). admin2 in its own source root would simplify setup of the dev tools I think.

Are there another ways to support dependencies from GWT and P2J for admin2 web application? I would like to use these remote interface and its asynchronous interface src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/shared/AdminService2.java src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/shared/AdminService2Async.java since the admin service interface should be common to server and client packages (rev. 11145).

What is the immediate problem you are having?

Now the project admin2 has a broken state due to it misses a closed '}' in AddAccountEventHandler.java and some classes are absent (Presenter).

In my last check in the compilation errors are fixed.

#30 Updated by Sergey Ivanovskiy about 7 years ago

Thanks, checked that the rev 11146 fixed admin2 compilation issues and now GWT admin2 project is in a good state. To this moment I used Eclipse, installed Eclipse GWT plugin and created a new admin2 java project from the existing ant build file and added that this project depends on P2J project.

It seems that we need to split a GWT servlet from the remote service implementation object that delegates most requests to AdminExport proxy object and to add new methods to the remote interface that implement 4a,4c and 4d. Also I found that com.goldencode.p2j.util.date class can't implement Serializable but Externalizable. Thus it seems that we need some converters or to change this code. Although these AdminExports methods that use date in their signatures are not supported by P2J now

   public date[] listHolidays();
   public boolean changeHolidays(date[] additions, date[] deletions);

Do you plan to do all tasks from the discussed note 25?

#31 Updated by Greg Shah about 7 years ago

I don't understand why we have a duplicated package hierarchy:

src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/

But I am thinking whether we should move admin2 outside of the P2J source tree into its own (i.e. $P2J/admin2). admin2 in its own source root would simplify setup of the dev tools I think.

This may be OK temporarily, but it is definitely not wanted when it is time to merge to trunk. Keeping it separate means a more complicated setup both at build time and at runtime. This would be more error prone, and would require more documentation and support effort.

#32 Updated by Greg Shah about 7 years ago

Also I found that com.goldencode.p2j.util.date class can't implement Serializable but Externalizable.

Typically, code that takes Serializable can also take Externalizable. What is the issue?

Also: it is possible we can remove the use of date and change to using a Date.

#33 Updated by Hynek Cihlar about 7 years ago

Greg Shah wrote:

I don't understand why we have a duplicated package hierarchy:

src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/

This is a temporal layout, it follows the default assumptions for the gwt project rooted in src/com/goldencode/p2j/admin2.

#34 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

It seems that we need to split a GWT servlet from the remote service implementation object

Why is it so?

[...]
Do you plan to do all tasks from the discussed note 25?

Since I already acquired the knowledge of the security context and related services it makes sense for me to implement it I think. Also I don't see that much space there to split it.

#35 Updated by Sergey Ivanovskiy about 7 years ago

Ok. There is only the reason to split the code is that Admin2ServiceImpl can be used as an admin service provider that doesn't depend on GWT environment, but Admin2ServiceServlet depends on GWT. I have no objections to leave servlet and service implementation in one servlet class.

#36 Updated by Sergey Ivanovskiy about 7 years ago

Greg Shah wrote:

Also I found that com.goldencode.p2j.util.date class can't implement Serializable but Externalizable.

Typically, code that takes Serializable can also take Externalizable. What is the issue?

There is no open issue. It is just that GWT RPC doesn't transmit com.goldencode.p2j.util.date since requires that it implements Serializable or IsSerializable GWT marker interface, http://www.gwtproject.org/doc/latest/tutorial/RPC.html#serialize

#37 Updated by Sergey Ivanovskiy about 7 years ago

GWT compiler generates corresponding JS objects for each new type used by service methods in AdminExports, but it requires source code and not just compiled classes. It seems that there are no ways to reuse these code and their dependencies

import com.goldencode.p2j.admin.AclDef;
import com.goldencode.p2j.admin.AclDef.Acl;
import com.goldencode.p2j.admin.AdminDef;
import com.goldencode.p2j.admin.AdminDef.Profile;
import com.goldencode.p2j.admin.AuditDef;
import com.goldencode.p2j.admin.AuthConfigDef;
import com.goldencode.p2j.admin.CertDef;
import com.goldencode.p2j.admin.DatabaseDef;
import com.goldencode.p2j.admin.ExportsDef;
import com.goldencode.p2j.admin.GroupDef;
import com.goldencode.p2j.admin.JarOpErrorCode;
import com.goldencode.p2j.admin.LoggingDef;
import com.goldencode.p2j.admin.PersistenceDef;
import com.goldencode.p2j.admin.ProcessDef;
import com.goldencode.p2j.admin.RecordInfo;
import com.goldencode.p2j.admin.RecordLockInfo;
import com.goldencode.p2j.admin.RuntimeDef;
import com.goldencode.p2j.admin.SessionInfo;
import com.goldencode.p2j.admin.StartupDef;
import com.goldencode.p2j.admin.TaggedName;
import com.goldencode.p2j.admin.UserDef;

#38 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

GWT compiler generates corresponding JS objects for each new type used by service methods in AdminExports, but it requires source code and not just compiled classes. It seems that there are no ways to reuse these code and their dependencies
[...]

The additional source paths can be included in the module XML file using the <source> element, pls see http://www.gwtproject.org/doc/latest/DevGuideOrganizingProjects.html#DevGuideModuleXml.

#39 Updated by Sergey Ivanovskiy about 7 years ago

Yes, there are two local paths

  <source path='client'/>
  <source path='shared'/>

But how would you reuse this simple class com.goldencode.p2j.admin.AclDef that depends on com.goldencode.p2j.security.Rights. These classes would be reused if they have no dependencies to other packages.

#40 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Yes, there are two local paths
[...]
But how would you reuse this simple class com.goldencode.p2j.admin.AclDef that depends on com.goldencode.p2j.security.Rights. These classes would be reused if they have no dependencies to other packages.

In this particular case AclDef as well as all the Rights implementors seem to be simple POJO classes with no additional serializable dependencies.

#41 Updated by Sergey Ivanovskiy about 7 years ago

Does it mean that GWT compiler can handle this case? Please explain how it can be fed?

#42 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Does it mean that GWT compiler can handle this case? Please explain how it can be fed?

Yes, it can handle this case. The compiler only needs to know where it can find the sources of all (even transitive) dependencies. You can instruct it with the <source> XML element.

#43 Updated by Sergey Ivanovskiy about 7 years ago

It is not obvious for me, please post a concrete example for this com.goldencode.p2j.admin.AclDef class, but there are another dependencies for an example ClassNotFound from JDK. How can they be handled by GWT compiler?

#44 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

It is not obvious for me, please post a concrete example for this com.goldencode.p2j.admin.AclDef class, but there are another dependencies for an example ClassNotFound from JDK. How can they be handled by GWT compiler?

Add <source path='<replacw with p2jhome/src>'/> just below <source path='shared'/> in AdminApp.gwt.xml. However we must be careful what types do we include even transitively in the client code, so that we don't end up with the whole FWD translated into Javascript.

GWT includes support for standard Java classes like ClassNotFound for example so these don't have to be included explicitly.

#45 Updated by Sergey Ivanovskiy about 7 years ago

Ok, thanks, I will try again to include all required for AdminExports resources, the dependencies are not only from this package com.goldencode.p2j.admin, but they are in directory, net, ... even <source> and <super-source> elements supports includes and excludes attributes with ant-like patterns, the result can be negative.

#46 Updated by Sergey Ivanovskiy about 7 years ago

Please look at these errors and evaluate the set of code required to generate GWT DTOs - data transfer objects

     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/shared/AdminService2Async.java'
     [java]             [ERROR] com.goldencode.p2j.admin.AclDef cannot be resolved to a type
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/admin/AdminDef.java'
     [java]             [ERROR] Line 55: No source code is available for type com.goldencode.p2j.security.Description; did you forget to inherit a required module?
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/admin/AclDef.java'
     [java]             [ERROR] Line 86: No source code is available for type java.io.ObjectInput; did you forget to inherit a required module?
     [java]             [ERROR] Line 105: No source code is available for type java.io.ObjectOutput; did you forget to inherit a required module?
     [java]             [ERROR] Line 88: No source code is available for type java.lang.ClassNotFoundException; did you forget to inherit a required module?
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/admin/TaggedName.java'
     [java]             [ERROR] Line 88: No source code is available for type com.goldencode.p2j.util.BaseDataType; did you forget to inherit a required module?
     [java]             [ERROR] Line 194: No source code is available for type com.goldencode.p2j.util.character; did you forget to inherit a required module?
     [java]             [ERROR] Line 198: No source code is available for type com.goldencode.p2j.util.int64; did you forget to inherit a required module?
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/admin/RecordLockInfo.java'
     [java]             [ERROR] Line 62: No source code is available for type com.goldencode.p2j.security.SessionToken; did you forget to inherit a required module?
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/admin/UserDef.java'
     [java]             [ERROR] com.goldencode.p2j.directory.DateValue cannot be resolved to a type
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/security/Rights.java'
     [java]             [ERROR] com.goldencode.p2j.directory.DirectoryService cannot be resolved to a type
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/directory/DateValue.java'
     [java]             [ERROR] Line 54: No source code is available for type java.lang.ThreadLocal<T>; did you forget to inherit a required module?
     [java]             [ERROR] Line 65: No source code is available for type java.util.Calendar; did you forget to inherit a required module?
     [java]             [ERROR] Line 54: No source code is available for type java.text.SimpleDateFormat; did you forget to inherit a required module?
     [java]             [ERROR] Line 131: No source code is available for type java.text.ParsePosition; did you forget to inherit a required module?
     [java]             [ERROR] Line 269: No source code is available for type java.text.FieldPosition; did you forget to inherit a required module?
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/directory/TimeValue.java'
     [java]             [ERROR] Line 50: No source code is available for type java.lang.ThreadLocal<T>; did you forget to inherit a required module?
     [java]             [ERROR] Line 50: No source code is available for type java.text.SimpleDateFormat; did you forget to inherit a required module?
     [java]             [ERROR] Line 276: No source code is available for type java.text.FieldPosition; did you forget to inherit a required module?
     [java]             [ERROR] Line 135: No source code is available for type java.text.ParsePosition; did you forget to inherit a required module?
     [java]             [ERROR] Line 62: No source code is available for type java.util.Calendar; did you forget to inherit a required module?
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/directory/DirectoryService.java'
     [java]             [ERROR] Line 704: The method forName(String) is undefined for the type Class
     [java]             [ERROR] Line 706: The method getDeclaredConstructors() is undefined for the type Class<capture#1-of ?>

#47 Updated by Sergey Ivanovskiy about 7 years ago

I think it is a wrong way to use these objects (from note 37) as DTOs for new admin remote service.

#48 Updated by Sergey Ivanovskiy about 7 years ago

For an example, these required JDK classes

     [java]          Line 54: No source code is available for type java.lang.ThreadLocal<T>; did you forget to inherit a required module?
     [java]          Line 65: No source code is available for type java.util.Calendar; did you forget to inherit a required module?
     [java]          Line 54: No source code is available for type java.text.SimpleDateFormat; did you forget to inherit a required module?
     [java]          Line 131: No source code is available for type java.text.ParsePosition; did you forget to inherit a required module?
     [java]          Line 269: No source code is available for type java.text.FieldPosition; did you forget to inherit a required module?

are not emulated by GWT.

#49 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

For an example, these required JDK classes
[...]
are not emulated by GWT.

Yes, not all types are supported by GWT. For such a cases we will have to come up with a workaround, for example by restructuring the existing DTOs or creating new ones better suitable for GWT remoting.

#50 Updated by Sergey Ivanovskiy about 7 years ago

If it doesn't intersect with your tasks, then I will create news DTO with the same key fields without any business logic that are have the same names and are plain java objects. Do you agree with this plan?

#51 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

If it doesn't intersect with your tasks, then I will create news DTO with the same key fields without any business logic that are have the same names and are plain java objects. Do you agree with this plan?

Yes, no problem. Just please post the list of DTOs you plan to change/create here.

#52 Updated by Sergey Ivanovskiy about 7 years ago

I think it makes sense to create all DTO from note 37 and new DTO com.goldencode.p2j.admin2.shared.model.ClientIdentity, because it would be inconsistent if one DTO is from P2J com.goldencode.p2j.admin and the other is a new created DTO from com.goldencode.p2j.admin2.shared.model.

#53 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

I think it makes sense to create all DTO from note 37 and new DTO com.goldencode.p2j.admin2.shared.model.ClientIdentity, because it would be inconsistent if one DTO is from P2J com.goldencode.p2j.admin and the other is a new created DTO from com.goldencode.p2j.admin2.shared.model.

com.goldencode.p2j.admin.AclDef
com.goldencode.p2j.admin.AclDef.Acl
com.goldencode.p2j.admin.AdminDef
com.goldencode.p2j.admin.AdminDef.Profile
com.goldencode.p2j.admin.AuditDef
com.goldencode.p2j.admin.AuthConfigDef
com.goldencode.p2j.admin.CertDef
com.goldencode.p2j.admin.DatabaseDef
com.goldencode.p2j.admin.ExportsDef
com.goldencode.p2j.admin.GroupDef
com.goldencode.p2j.admin.JarOpErrorCode
com.goldencode.p2j.admin.LoggingDef
com.goldencode.p2j.admin.PersistenceDef
com.goldencode.p2j.admin.ProcessDef
com.goldencode.p2j.admin.RecordInfo
com.goldencode.p2j.admin.RecordLockInfo
com.goldencode.p2j.admin.RuntimeDef
com.goldencode.p2j.admin.SessionInfo
com.goldencode.p2j.admin.StartupDef
com.goldencode.p2j.admin.TaggedName
com.goldencode.p2j.admin.UserDef

The above classes can be used with GWT, I don't see any showstoppers there. All the fields are of the supported GWT types. There are only a few cases where an unsupported type is used in method parameter. Like DirectoryService in DirectoryRights.toDirectoryNode(). These methods can be moved out into separate classes.

#54 Updated by Sergey Ivanovskiy about 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

I think it makes sense to create all DTO from note 37 and new DTO com.goldencode.p2j.admin2.shared.model.ClientIdentity, because it would be inconsistent if one DTO is from P2J com.goldencode.p2j.admin and the other is a new created DTO from com.goldencode.p2j.admin2.shared.model.

com.goldencode.p2j.admin.AclDef
com.goldencode.p2j.admin.AclDef.Acl
com.goldencode.p2j.admin.AdminDef
com.goldencode.p2j.admin.AdminDef.Profile
com.goldencode.p2j.admin.AuditDef
com.goldencode.p2j.admin.AuthConfigDef
com.goldencode.p2j.admin.CertDef
com.goldencode.p2j.admin.DatabaseDef
com.goldencode.p2j.admin.ExportsDef
com.goldencode.p2j.admin.GroupDef
com.goldencode.p2j.admin.JarOpErrorCode
com.goldencode.p2j.admin.LoggingDef
com.goldencode.p2j.admin.PersistenceDef
com.goldencode.p2j.admin.ProcessDef
com.goldencode.p2j.admin.RecordInfo
com.goldencode.p2j.admin.RecordLockInfo
com.goldencode.p2j.admin.RuntimeDef
com.goldencode.p2j.admin.SessionInfo
com.goldencode.p2j.admin.StartupDef
com.goldencode.p2j.admin.TaggedName
com.goldencode.p2j.admin.UserDef

The above classes can be used with GWT, I don't see any showstoppers there. All the fields are of the supported GWT types. There are only a few cases where an unsupported type is used in method parameter. Like DirectoryService in DirectoryRights.toDirectoryNode(). These methods can be moved out into separate classes.

I don't understand your idea, please clarify it. Now I am blocked at this point.

#55 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

I don't understand your idea, please clarify it. Now I am blocked at this point.

I went through all the classes from note 37 and checked, whether it can be used by GWT. These are my findings. Please be more specific, what is not clear to you.

#56 Updated by Sergey Ivanovskiy about 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

I don't understand your idea, please clarify it. Now I am blocked at this point.

I went through all the classes from note 37 and checked, whether it can be used by GWT. These are my findings. Please be more specific, what is not clear to you.

You wrote

The above classes can be used with GWT, I don't see any showstoppers there. All the fields are of the supported GWT types. There are only a few cases where an unsupported type is >used in method parameter. Like DirectoryService in DirectoryRights.toDirectoryNode(). These methods can be moved out into separate classes.

According to my finding these classes can't be used because of dependencies, com.goldencode.p2j.admin.AclDef. The other simple POJO like com.goldencode.p2j.admin.CertDef or classes without any contained fields like com.goldencode.p2j.admin.AuditDef can be used as they are. I don't understand you agree or disagree?

#57 Updated by Constantin Asofiei about 7 years ago

Hynek, unless my understanding is incorrect, when GWT converts a Java class to JS, it doesn't take just the fields, but its entire definition; from a previous post by Sergey:

     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/security/Rights.java'
     [java]             [ERROR] com.goldencode.p2j.directory.DirectoryService cannot be resolved to a type

These errors come from Rights.toDirectoryNode method, which has a DirectoryService field; and AclDef$ACL.rights is an instance of a Rights implementation.

#58 Updated by Hynek Cihlar about 7 years ago

Constantin Asofiei wrote:

Hynek, unless my understanding is incorrect, when GWT converts a Java class to JS, it doesn't take just the fields, but its entire definition; from a previous post by Sergey:
[...]
These errors come from Rights.toDirectoryNode method, which has a DirectoryService field; and AclDef$ACL.rights is an instance of a Rights implementation.

Yes, this is what I mentioned in note 53.

#59 Updated by Sergey Ivanovskiy about 7 years ago

I would like to clarify that all required dependencies were included under p2j-src admin2/src/com/goldencode/p2j/admin2/p2j-src and then I used <super-source>, if it would be succeeded with GWT compilation, then this can be scripted.

#60 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

The above classes can be used with GWT, I don't see any showstoppers there. All the fields are of the supported GWT types. There are only a few cases where an unsupported type is >used in method parameter. Like DirectoryService in DirectoryRights.toDirectoryNode(). These methods can be moved out into separate classes.

According to my finding these classes can't be used because of dependencies, com.goldencode.p2j.admin.AclDef.

Yes, this is because of some of the method declarations use unsupported types, like DirectoryService. These methods must be moved to separate classes. The new separate classes won't be used by the GWT client code and won't be converted by GWT.

#61 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

I would like to clarify that all required dependencies were included under p2j-src admin2/src/com/goldencode/p2j/admin2/p2j-src and then I used <super-source>, if it would be succeeded with GWT compilation, then this can be scripted.

Does it mean you copied the DTOs to p2j-src?

#62 Updated by Sergey Ivanovskiy about 7 years ago

Yes, it is like in an example (http://www.gwtproject.org/doc/latest/DevGuideOrganizingProjects.html#DevGuideModuleXml) for adding new JRE class java/util/UUID.java to be GWT emulated.

#63 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Yes, it is like in an example (http://www.gwtproject.org/doc/latest/DevGuideOrganizingProjects.html#DevGuideModuleXml) for adding new JRE class java/util/UUID.java to be GWT emulated.

I believe you don't have to do that. Just give the GWT compilers a hint where to find those classes in the original location, using the <source> xml element in the module xml file.

#64 Updated by Sergey Ivanovskiy about 7 years ago

I would like to select a subset of DTO types and dependencies from P2J source and super-source makes it possible. Now I will check the source pointed to P2J source and report the results unless you already have checked this way.

#65 Updated by Sergey Ivanovskiy about 7 years ago

I was providing relative paths with respect to the current GWT module /home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2 like this one
for P2J source <source path='../../../../../../../../../../src'/> and got warning

[WARN] Non-canonical source package: ../../../../../../../../../../src/

and these errors
     [java]    Finding entry point classes
     [java]       Tracing compile failure path for type 'com.goldencode.p2j.admin2.test.TestAdmin2API'
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/test/TestAdmin2API.java'
     [java]             [ERROR] com.goldencode.p2j.admin2.shared.AdminService2Async cannot be resolved to a type
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/shared/AdminService2Async.java'
     [java]             [ERROR] Line 251: No source code is available for type com.goldencode.p2j.admin.JarOpErrorCode; did you forget to inherit a required module?
     [java]             [ERROR] Line 69: No source code is available for type com.goldencode.p2j.admin.SessionInfo; did you forget to inherit a required module?
     [java]             [ERROR] Line 104: No source code is available for type com.goldencode.p2j.admin.TaggedName; did you forget to inherit a required module?
     [java]             [ERROR] Line 188: No source code is available for type com.goldencode.p2j.admin.AclDef; did you forget to inherit a required module?
     [java]             [ERROR] Line 73: No source code is available for type com.goldencode.p2j.admin.RecordLockInfo; did you forget to inherit a required module?
     [java]             [ERROR] Line 317: No source code is available for type com.goldencode.p2j.admin.StartupDef; did you forget to inherit a required module?
     [java]             [ERROR] Line 170: No source code is available for type com.goldencode.p2j.admin.CertDef; did you forget to inherit a required module?
     [java]             [ERROR] Line 100: No source code is available for type com.goldencode.p2j.admin.AuditDef; did you forget to inherit a required module?
     [java]             [ERROR] Line 345: No source code is available for type com.goldencode.p2j.admin.DatabaseDef; did you forget to inherit a required module?
     [java]             [ERROR] Line 55: No source code is available for type com.goldencode.p2j.admin.AdminDef; did you forget to inherit a required module?
     [java]             [ERROR] Line 331: No source code is available for type com.goldencode.p2j.admin.PersistenceDef; did you forget to inherit a required module?
     [java]             [ERROR] Line 45: No source code is available for type com.goldencode.p2j.admin.AclDef.Acl; did you forget to inherit a required module?
     [java]             [ERROR] Line 92: No source code is available for type com.goldencode.p2j.admin.AuthConfigDef; did you forget to inherit a required module?
     [java]             [ERROR] Line 108: No source code is available for type com.goldencode.p2j.admin.GroupDef; did you forget to inherit a required module?
     [java]             [ERROR] Line 57: No source code is available for type com.goldencode.p2j.admin.AdminDef.Profile; did you forget to inherit a required module?
     [java]             [ERROR] Line 148: No source code is available for type com.goldencode.p2j.admin.ProcessDef; did you forget to inherit a required module?
     [java]             [ERROR] Line 303: No source code is available for type com.goldencode.p2j.admin.ExportsDef; did you forget to inherit a required module?
     [java]             [ERROR] Line 79: No source code is available for type com.goldencode.p2j.admin.RecordInfo; did you forget to inherit a required module?
     [java]             [ERROR] Line 289: No source code is available for type com.goldencode.p2j.admin.LoggingDef; did you forget to inherit a required module?
     [java]             [ERROR] Line 365: No source code is available for type com.goldencode.p2j.admin.RuntimeDef; did you forget to inherit a required module?
     [java]             [ERROR] Line 127: No source code is available for type com.goldencode.p2j.admin.UserDef; did you forget to inherit a required module?

#66 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

I would like to select a subset of DTO types and dependencies from P2J source and super-source makes it possible.

Yes, super-source seems to be the way to go. But we certainly don't want to duplicate sources in the project structure. If you point it to he original DTOs directory and use the inclusion xml tags to include only the required classes that should give the expected result.

#67 Updated by Sergey Ivanovskiy about 7 years ago

Don't understand what is incorrect but I used

   <source path='../../../../../../../../../../src/com/goldencode/p2j/admin/'>
      <include name='JarOpErrorCode.java' />
      <include name='*Info.java' />
      <include name='*Def.java' />
   </source>

but these source were still unknown by GWT compiler, the path '../../../../../../../../../../src/com/goldencode/p2j/admin/' is checked, correct

#68 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Don't understand what is incorrect but I used
[...]
but these source were still unknown by GWT compiler, the path '../../../../../../../../../../src/com/goldencode/p2j/admin/' is checked, correct

Doesn't source take a package qualified name? What about super-source?

#69 Updated by Sergey Ivanovskiy about 7 years ago

I couldn't reproduce the correct GWT run for these relative paths '../../../../../../../../../../src/', the GWT compiler couldn't find the target sources. Don't know it is my error or GWT compiler doesn't accept relative paths?

#70 Updated by Sergey Ivanovskiy about 7 years ago

https://groups.google.com/forum/#!topic/google-web-toolkit/1xDY6nhRevc provides a source code for GWT's ModuleDefSchema.java and it proves that relative paths are not accepted.
https://github.com/morristech/gwt/blob/master/dev/core/src/com/google/gwt/dev/cfg/ModuleDefSchema.java lines: 806-824

#71 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

https://groups.google.com/forum/#!topic/google-web-toolkit/1xDY6nhRevc provides a source code for GWT's ModuleDefSchema.java and it proves that relative paths are not accepted.
https://github.com/morristech/gwt/blob/master/dev/core/src/com/google/gwt/dev/cfg/ModuleDefSchema.java

source takes package name, you can't give it a relative path. Can you use super-source instead?

#72 Updated by Sergey Ivanovskiy about 7 years ago

It is handled the same manner

    /**
     * Like adding a translatable source package, but such that it uses the
     * module's package itself as its sourcepath root entry.
     */
    @SuppressWarnings("unused") // called reflectively
    protected Schema __super_source_begin(String path, String includes,
        String excludes, String skips, String defaultExcludes,
        String caseSensitive) {
      return fChild = new IncludeExcludeSchema();
    }

    @SuppressWarnings("unused") // called reflectively
    protected void __super_source_end(String path, String includes,
        String excludes, String skips, String defaultExcludes,
        String caseSensitive) {
      addSourcePackage(path, includes, excludes, skips, defaultExcludes,
          caseSensitive, true);
    }

..........................

    private void addSourcePackage(String modulePackagePath, String relDir,
        String[] includeList, String[] excludeList, String[] skipList,
        boolean defaultExcludes, boolean caseSensitive, boolean isSuperSource) {
      String normChildDir = normalizePathEntry(relDir);
      if (normChildDir.startsWith("/")) {
        logger.log(TreeLogger.WARN, "Non-relative source package: " 
            + normChildDir, null);
        return;
      }
      if (normChildDir.startsWith("./") || normChildDir.indexOf("/./") >= 0) {
        logger.log(TreeLogger.WARN, "Non-canonical source package: " 
            + normChildDir, null);
        return;
      }
      if (normChildDir.startsWith("../") || normChildDir.indexOf("/../") >= 0) {
        logger.log(TreeLogger.WARN, "Non-canonical source package: " 
            + normChildDir, null);
        return;
      }

      String fullPackagePath = modulePackagePath + normChildDir;

      if (isSuperSource) {
        /*
         * Super source does not include the module package path as part of the
         * logical class names.
         */
        moduleDef.addSuperSourcePackage(fullPackagePath, includeList,
            excludeList, skipList, defaultExcludes, caseSensitive);
      } else {
        /*
         * Add the full package path to the include/exclude/skip lists since the
         * logical name of classes on the source path includes the package path
         * but the include, exclude, and skip lists do not.
         */
        addPrefix(includeList, fullPackagePath);
        addPrefix(excludeList, fullPackagePath);
        addPrefix(skipList, fullPackagePath);

        moduleDef.addSourcePackage(fullPackagePath, includeList, excludeList,
            skipList, defaultExcludes, caseSensitive);
      }
}

and sadly I tried it too.
Sergey Ivanovskiy wrote:

I would like to clarify that all required dependencies were included under p2j-src admin2/src/com/goldencode/p2j/admin2/p2j-src and then I used <super-source>, if it would be succeeded with GWT compilation, then this can be scripted.

We don't need to store any files under p2j-src, only if build is running they are copied in this directory by build script.

#73 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Sergey Ivanovskiy wrote:

I would like to clarify that all required dependencies were included under p2j-src admin2/src/com/goldencode/p2j/admin2/p2j-src and then I used <super-source>, if it would be succeeded with GWT compilation, then this can be scripted.

We don't need to store any files under p2j-src, only if build is running they are copied in this directory by build script.

Ok, we can eventually deal with this later.

#74 Updated by Sergey Ivanovskiy about 7 years ago

Sergey Ivanovskiy wrote:

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

I think it makes sense to create all DTO from note 37 and new DTO com.goldencode.p2j.admin2.shared.model.ClientIdentity, because it would be inconsistent if one DTO is from P2J com.goldencode.p2j.admin and the other is a new created DTO from com.goldencode.p2j.admin2.shared.model.

com.goldencode.p2j.admin.AclDef
com.goldencode.p2j.admin.AclDef.Acl
com.goldencode.p2j.admin.AdminDef
com.goldencode.p2j.admin.AdminDef.Profile
com.goldencode.p2j.admin.AuditDef
com.goldencode.p2j.admin.AuthConfigDef
com.goldencode.p2j.admin.CertDef
com.goldencode.p2j.admin.DatabaseDef
com.goldencode.p2j.admin.ExportsDef
com.goldencode.p2j.admin.GroupDef
com.goldencode.p2j.admin.JarOpErrorCode
com.goldencode.p2j.admin.LoggingDef
com.goldencode.p2j.admin.PersistenceDef
com.goldencode.p2j.admin.ProcessDef
com.goldencode.p2j.admin.RecordInfo
com.goldencode.p2j.admin.RecordLockInfo
com.goldencode.p2j.admin.RuntimeDef
com.goldencode.p2j.admin.SessionInfo
com.goldencode.p2j.admin.StartupDef
com.goldencode.p2j.admin.TaggedName
com.goldencode.p2j.admin.UserDef

The above classes can be used with GWT, I don't see any showstoppers there. All the fields are of the supported GWT types. There are only a few cases where an unsupported type is used in method parameter. Like DirectoryService in DirectoryRights.toDirectoryNode(). These methods can be moved out into separate classes.

I don't understand your idea, please clarify it. Now I am blocked at this point.

Hynek, please clarify the next step that you would like to change the above classes in order to be used by GWT or it would be my task? DTO classes are important for independent client development and service testing.

#75 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynek, please clarify the next step that you would like to change the above classes in order to be used by GWT or it would be my task? DTO classes are important for independent client development and service testing.

The next step would be to remove the methods using the unsupported types out of the DTO classes into separate classes. Please go ahead with this.

#76 Updated by Sergey Ivanovskiy about 7 years ago

Please review committed revision 11147 that moved business logic for Rights out to DirectoryService. But DTOs are still not ready because they require to fix these errors

     [java]       Tracing compile failure path for type 'com.goldencode.p2j.admin2.test.TestAdmin2API'
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/test/TestAdmin2API.java'
     [java]             [ERROR] com.goldencode.p2j.admin2.shared.AdminService2Async cannot be resolved to a type
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/shared/AdminService2Async.java'
     [java]             [ERROR] com.goldencode.p2j.admin.AclDef cannot be resolved to a type
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/admin/AclDef.java'
     [java]             [ERROR] Line 86: No source code is available for type java.io.ObjectInput; did you forget to inherit a required module?
     [java]             [ERROR] Line 105: No source code is available for type java.io.ObjectOutput; did you forget to inherit a required module?
     [java]             [ERROR] Line 88: No source code is available for type java.lang.ClassNotFoundException; did you forget to inherit a required module?
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/admin/TaggedName.java'
     [java]             [ERROR] Line 88: No source code is available for type com.goldencode.p2j.util.BaseDataType; did you forget to inherit a required module?
     [java]             [ERROR] Line 194: No source code is available for type com.goldencode.p2j.util.character; did you forget to inherit a required module?
     [java]             [ERROR] Line 198: No source code is available for type com.goldencode.p2j.util.int64; did you forget to inherit a required module?
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/admin/RecordLockInfo.java'
     [java]             [ERROR] com.goldencode.p2j.security.SessionToken cannot be resolved to a type
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/admin/UserDef.java'
     [java]             [ERROR] com.goldencode.p2j.directory.DateValue cannot be resolved to a type
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/security/SessionToken.java'
     [java]             [ERROR] Line 78: The method format(String, int) is undefined for the type String
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/directory/DateValue.java'
     [java]             [ERROR] Line 54: No source code is available for type java.lang.ThreadLocal<T>; did you forget to inherit a required module?
     [java]             [ERROR] Line 65: No source code is available for type java.util.Calendar; did you forget to inherit a required module?
     [java]             [ERROR] Line 54: No source code is available for type java.text.SimpleDateFormat; did you forget to inherit a required module?
     [java]             [ERROR] Line 131: No source code is available for type java.text.ParsePosition; did you forget to inherit a required module?
     [java]             [ERROR] Line 269: No source code is available for type java.text.FieldPosition; did you forget to inherit a required module?
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/directory/TimeValue.java'
     [java]             [ERROR] Line 50: No source code is available for type java.lang.ThreadLocal<T>; did you forget to inherit a required module?
     [java]             [ERROR] Line 50: No source code is available for type java.text.SimpleDateFormat; did you forget to inherit a required module?
     [java]             [ERROR] Line 276: No source code is available for type java.text.FieldPosition; did you forget to inherit a required module?
     [java]             [ERROR] Line 135: No source code is available for type java.text.ParsePosition; did you forget to inherit a required module?
     [java]             [ERROR] Line 62: No source code is available for type java.util.Calendar; did you forget to inherit a required module?
     [java]          Checked 9 dependencies for errors.

#77 Updated by Sergey Ivanovskiy about 7 years ago

Commtted rev. 11148 eliminated one error.

     [java]       Tracing compile failure path for type 'com.goldencode.p2j.admin2.test.TestAdmin2API'
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/test/TestAdmin2API.java'
     [java]             [ERROR] com.goldencode.p2j.admin2.shared.AdminService2Async cannot be resolved to a type
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/shared/AdminService2Async.java'
     [java]             [ERROR] com.goldencode.p2j.admin.AclDef cannot be resolved to a type
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/admin/AclDef.java'
     [java]             [ERROR] Line 86: No source code is available for type java.io.ObjectInput; did you forget to inherit a required module?
     [java]             [ERROR] Line 105: No source code is available for type java.io.ObjectOutput; did you forget to inherit a required module?
     [java]             [ERROR] Line 88: No source code is available for type java.lang.ClassNotFoundException; did you forget to inherit a required module?
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/admin/TaggedName.java'
     [java]             [ERROR] Line 88: No source code is available for type com.goldencode.p2j.util.BaseDataType; did you forget to inherit a required module?
     [java]             [ERROR] Line 194: No source code is available for type com.goldencode.p2j.util.character; did you forget to inherit a required module?
     [java]             [ERROR] Line 198: No source code is available for type com.goldencode.p2j.util.int64; did you forget to inherit a required module?
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/admin/UserDef.java'
     [java]             [ERROR] com.goldencode.p2j.directory.DateValue cannot be resolved to a type
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/directory/DateValue.java'
     [java]             [ERROR] Line 54: No source code is available for type java.lang.ThreadLocal<T>; did you forget to inherit a required module?
     [java]             [ERROR] Line 65: No source code is available for type java.util.Calendar; did you forget to inherit a required module?
     [java]             [ERROR] Line 54: No source code is available for type java.text.SimpleDateFormat; did you forget to inherit a required module?
     [java]             [ERROR] Line 131: No source code is available for type java.text.ParsePosition; did you forget to inherit a required module?
     [java]             [ERROR] Line 269: No source code is available for type java.text.FieldPosition; did you forget to inherit a required module?
     [java]          [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2/p2j-src/com/goldencode/p2j/directory/TimeValue.java'
     [java]             [ERROR] Line 50: No source code is available for type java.lang.ThreadLocal<T>; did you forget to inherit a required module?
     [java]             [ERROR] Line 50: No source code is available for type java.text.SimpleDateFormat; did you forget to inherit a required module?
     [java]             [ERROR] Line 276: No source code is available for type java.text.FieldPosition; did you forget to inherit a required module?
     [java]             [ERROR] Line 135: No source code is available for type java.text.ParsePosition; did you forget to inherit a required module?
     [java]             [ERROR] Line 62: No source code is available for type java.util.Calendar; did you forget to inherit a required module?
     [java]          Checked 7 dependencies for errors.

#78 Updated by Sergey Ivanovskiy about 7 years ago

All these error related to TaggedName and DateValue and TimeValue, I think we should not use TaggedName in admin2 service methods and replace DateValue by Date in these DTOs.
ADDED: and AclDef has these methods

   public void XreadExternal(ObjectInput in)
   throws IOException,
          ClassNotFoundException

   public void XwriteExternal(ObjectOutput out)
   throws IOException

that reference unsupported types: java.io.ObjectInput and java.io.ObjectOutput.

#79 Updated by Sergey Ivanovskiy about 7 years ago

Committed revision 11149 and 11150 prepared DTOs to be used with Service2Admin GWT Remote service interface.

#80 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Committed revision 11149 and 11150 prepared DTOs to be used with Service2Admin GWT Remote service interface.

In SessionToken, please use NumberFormat for formatting the hex string.

I'm curious why did you move the inner DTO classes in their own file modules? Did GWT complain compiling the inner classes?

Otherwise the changes seem reasonable.

#81 Updated by Sergey Ivanovskiy about 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Committed revision 11149 and 11150 prepared DTOs to be used with Service2Admin GWT Remote service interface.

In SessionToken, please use NumberFormat for formatting the hex string.

If we will use com.google.gwt.i18n.client.NumberFormat, then P2J will get a new GWT dependency, gwt-user-2.*.*.jar. Is it ok?

I'm curious why did you move the inner DTO classes in their own file modules? Did GWT complain compiling the inner classes?

It seems that these inner classes were moved out because GWT failed to instantiate them. Their code usages showed that they could be in their own modules.

#82 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Committed revision 11149 and 11150 prepared DTOs to be used with Service2Admin GWT Remote service interface.

In SessionToken, please use NumberFormat for formatting the hex string.

If we will use com.google.gwt.i18n.client.NumberFormat, then P2J will get a new GWT dependency, gwt-user-2.*.*.jar. Is it ok?

Right, we should not introduce GWT dependency into the non-admin code. I didn't realize GWT rolls its own NumberFormat class.

#83 Updated by Sergey Ivanovskiy about 7 years ago

Committed revision 11151 fixed missed history entries.

#84 Updated by Sergey Ivanovskiy about 7 years ago

The program described by notes 25 and 27 is not very clear for me. Now I am using the administration java applet login use case to access the P2J server and its AdminExports service

   public int authenticate(ClientIdentity clientId) throws Exception
   {
      ServerSession servSession = new ServerSession();
      // get the password from the form - no verification here
      String pw = clientId.getPassword();

      // stuff the bootstrap config
      BootstrapConfig bc = new BootstrapConfig();
      bc.setServer(false);
      bc.setConfigItem("security", "trust_mgr", "disable", "true");
      SecurityManager sm = SecurityManager.createInstance(bc);

      servSession.securityManager = sm;

      bc.setConfigItem("net", "queue", "conversation", "true");
      bc.setConfigItem("net", "queue", "start_thread", "false");
      bc.setConfigItem("net", "server", "host", hostP2J);
      bc.setConfigItem("net", "server", "port", portP2J);
      bc.setConfigItem("security", "certificate", "validate", "false");
      bc.setConfigItem("security", "authentication", "type", "program");
      bc.setConfigItem("access", "subject", "id", clientId.getUserId());
      bc.setConfigItem("access", "password", "user", pw);
      bc.setConfigItem("net", "connection", "secure", "true");
      bc.setConfigItem("net", "server", "secure_port", securePortP2J);

      // instantiate network session manager
      SessionManager sessMgr = SessionManagerFactory.createLeafNode(bc);

      // establish a session with the P2J server
      Session session = sessMgr.connectDirect(new InterruptedExceptionHandler(),
                                      null);

      session.addSessionListener(servSession);

      servSession.session = session;

      // get the admins server APIs
      AdminExports adm = (AdminExports) RemoteObject.obtainNetworkInstance(AdminExports.class, session);

      servSession.service = adm;

      servSession.delegate = new AdminService2Impl(adm);

      System.out.println("clientId: " + clientId.getUserId() + "/" + clientId.getPassword() + " " + httpSession.getId());
      System.out.println("serverName: " + adm.getServerName());
      return 0;
   }

But failed to reuse the current P2j session between different requests within the current http session between this GWT servlet and GWT ajax client.

#85 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

The program described by notes 25 and 27 is not very clear for me. Now I am using the administration java applet login use case to access the P2J server and its AdminExports service
[...]
But failed to reuse the current P2j session between different requests within the current http session between this GWT servlet and GWT ajax client.

Please don't bother with the server side session and security context management, I have this already implemented and am just merging it to the task branch.

#86 Updated by Sergey Ivanovskiy about 7 years ago

I missed a "return" statement and now it works properly.

#87 Updated by Sergey Ivanovskiy about 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

The program described by notes 25 and 27 is not very clear for me. Now I am using the administration java applet login use case to access the P2J server and its AdminExports service
[...]
But failed to reuse the current P2j session between different requests within the current http session between this GWT servlet and GWT ajax client.

Please don't bother with the server side session and security context management, I have this already implemented and am just merging it to the task branch.

Ok, I didn't commit my changes, since they would be unused. When do you plan to commit your changes? Did you choose a GWT widget framework/library for new administration client?

#88 Updated by Sergey Ivanovskiy about 7 years ago

May be it can help to test functionality, decided to commit a TestAdmin2 client rev 11152. To evaluate this test example please start P2J simple server with 3333 insecure and 3334 secure ports and run ant over build_test.xml with devmode target (it starts GWT jetty and GWT code server); then open Google Chrome for http://127.0.0.1:8888/TestAdmin2.html.

#89 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

The program described by notes 25 and 27 is not very clear for me. Now I am using the administration java applet login use case to access the P2J server and its AdminExports service
[...]
But failed to reuse the current P2j session between different requests within the current http session between this GWT servlet and GWT ajax client.

Please don't bother with the server side session and security context management, I have this already implemented and am just merging it to the task branch.

Ok, I didn't commit my changes, since they would be unused. When do you plan to commit your changes?

I want to have it committed during today. Part of the commit will be also the fully working login use case.

Did you choose a GWT widget framework/library for new administration client?

I'd like to use GWTP, what do you think?

#90 Updated by Sergey Ivanovskiy about 7 years ago

I didn't work with this framework, it seems that it requires two new dependencies Guice and GIN dependency injection frameworks for java and GWT respectively.

#91 Updated by Hynek Cihlar about 7 years ago

Hynek Cihlar wrote:

I want to have it committed during today. Part of the commit will be also the fully working login use case.

Sergey, I'm having some difficulties with the JS side. I probably won't be able to commit it today.

#92 Updated by Hynek Cihlar about 7 years ago

Hynek Cihlar wrote:

Hynek Cihlar wrote:

I want to have it committed during today. Part of the commit will be also the fully working login use case.

Sergey, I'm having some difficulties with the JS side. I probably won't be able to commit it today.

The changes are committed.

Sergey, please note that web.xml is no longer needed and used by the app. The backend part of admin2 is now fully embedded in StandardServer. To run the app, just launch the Simple server and point your browser to https://localhost:7443/admin2/. You can login with an admin account, in the default Simple server configuration the account name is 'admin' and the password is not needed.

Also I haven't tried running the GWT super-dev mode. But it should be possible to do by running the Simple server and instructing GWT launcher not to use its own embedded server but instead point it to https://localhost:7443/admin2/.

#93 Updated by Sergey Ivanovskiy about 7 years ago

After updating to the current rev 11153 and running ./gradlew jar native -Dpost.build=yes -Dspawn.install.folder=~/opt/spawner the build was failed

:ant-antlr
:ant-compile
[ant:javac] /home/sbi/projects/3222a/src/com/goldencode/p2j/main/StandardServer.java:177: error: package com.goldencode.p2j.admin2.server does not exist
[ant:javac] import com.goldencode.p2j.admin2.server.*;
[ant:javac] ^
[ant:javac] 1 error
:ant-compile FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ant-compile'.
> Compile failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Could you look at this?

#94 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

After updating to the current rev 11153 and running ./gradlew jar native -Dpost.build=yes -Dspawn.install.folder=~/opt/spawner the build was failed
[...]
Could you look at this?

Please move admin2.server and admin2.shared to the standard p2j project structure, that is from p2j_home/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2 to p2j_home/src/com/goldencode/p2j/admin2 and update the build scripts accordingly if needed.

#95 Updated by Sergey Ivanovskiy about 7 years ago

Ok, it seems that we can use WebAppContext to deploy admin2 war in /com/goldencode/p2j/main/StandardServer.java.

#96 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Ok, it seems that we can use WebAppContext to deploy admin2 war in /com/goldencode/p2j/main/StandardServer.java.

Note that we already use ServletContextHandler and the app is served from a classpath. War is not needed, neither WebAppContext.

#97 Updated by Sergey Ivanovskiy about 7 years ago

The note 95 remark means that this code from /com/goldencode/p2j/main/StandardServer.java can use WebAppContext instead of

                // admin2
               if (adm)
               {
                  ResourceHandler res = new ResourceHandler();
                  res.setWelcomeFiles(new String[] {"AdminApp.html"});

                  // TODO: serve the resources from classpath
                  res.setResourceBase("file:///home/hc/gcd/p2j_repo/p2j/src/com/goldencode/p2j/admin2/war");

                  ServletContextHandler context =
                     new ServletContextHandler(ServletContextHandler.SESSIONS);

                  context.addFilter(AuthFilter.class,
                            "/adminapp/AdminService",
                                    EnumSet.allOf(DispatcherType.class));

                  // TODO: make the context configurable
                  context.setContextPath("/admin2");
                  context.addServlet(AdminServiceImpl.class, "/adminapp/AdminService");
                  context.addServlet(AuthServiceImpl.class, "/adminapp/AuthService");
                  context.setWelcomeFiles(new String[] {"AdminApp.html"});
                  context.insertHandler(res);

                  // TODO: make request logging configurable
                  RequestLogHandler rlh = new RequestLogHandler();
                  Slf4jRequestLog requestLog = new Slf4jRequestLog();
                  requestLog.setExtended(false);
                  rlh.setRequestLog(requestLog);

                  HandlerList list = new HandlerList();
                  list.setHandlers(new org.eclipse.jetty.server.Handler[] {
                     context,
                     rlh,
                     new DefaultHandler()
                  });

                  handlers[--num] = list;
               }

#98 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

The note 95 remark means that this code from /com/goldencode/p2j/main/StandardServer.java can use WebAppContext instead of
[...]

The advantage of serving the app from classpath (with ServletContextHandler) is that you don't have to rebuild war in order to apply any code changes. Also the build process can be a bit simpler, no need to package the war and distribute it.

Do you see any advantage of using WebAppContext?

#99 Updated by Greg Shah about 7 years ago

I prefer to keep everything in the p2j.jar and use ServletContextHandler to enable it. The admin interface should be built into FWD. There is no reason to split it off. The old p2jadmin.jar was only needed to provide a minimal FWD implementation for the applet download.

Does anyone see a reason to split the admin interface into its own jar?

#100 Updated by Sergey Ivanovskiy about 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

The note 95 remark means that this code from /com/goldencode/p2j/main/StandardServer.java can use WebAppContext instead of
[...]

The advantage of serving the app from classpath (with ServletContextHandler) is that you don't have to rebuild war in order to apply any code changes. Also the build process can be a bit simpler, no need to package the war and distribute it.

Do you see any advantage of using WebAppContext?

Greg Shah wrote:

Does anyone see a reason to split the admin interface into its own jar?

I have no another reasons except p2j.jar becomes more massive, new GWT dependency will be added and it will be missed independence if we consider new GWT administration application as an independent module.

#101 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

I have no another reasons except p2j.jar becomes more massive, new GWT dependency will be added

The java dependencies will go to p2j_home/build/lib, they won't be embedded in p2j.jar itself.

and it will be missed independence if we consider new GWT administration application as an independent module.

AFAIK there is no plan to deploy admin as an independent module. It would be also a bit complicated with the current architecture.

#102 Updated by Greg Shah about 7 years ago

AFAIK there is no plan to deploy admin as an independent module.

Correct. It is only an integrated part of the FWD server.

#103 Updated by Hynek Cihlar about 7 years ago

For the HTML layout I would like to use Bootstrap implemented by http://gwtbootstrap.github.io/. Boostrap is widely used with many ready to use themes (if the default is not suitable) and clear path to responsive design. Please let me know if there are any objections or ideas on styling.

#104 Updated by Greg Shah about 7 years ago

Bootstrap is good, you can use it. We already use it in the embedded web demo app (and in some poc code).

I would very much like for the UI to be completely responsive and fully usable on mobile devices (tablets and phones). You are allowed to change the UI in any way needed. The layout and look/feel of the current UI does not need to be maintained. Only the functionality of the current UI must be maintained.

I expect to add features and capabilities to the admin UI after the web transition is complete. Many of these facilities will be highly useful for monitoring and managing FWD servers. I expect that admin users will want the ability to monitor/manage from their mobile devices.

#105 Updated by Hynek Cihlar about 7 years ago

Greg Shah wrote:

I would very much like for the UI to be completely responsive and fully usable on mobile devices (tablets and phones). You are allowed to change the UI in any way needed. The layout and look/feel of the current UI does not need to be maintained. Only the functionality of the current UI must be maintained.

I expect to add features and capabilities to the admin UI after the web transition is complete. Many of these facilities will be highly useful for monitoring and managing FWD servers. I expect that admin users will want the ability to monitor/manage from their mobile devices.

Ok, sounds good.

#106 Updated by Hynek Cihlar about 7 years ago

Hynek Cihlar wrote:

For the HTML layout I would like to use Bootstrap implemented by http://gwtbootstrap.github.io/.

This library seems to be a bit outdated. A better option will be https://github.com/gwtbootstrap3/gwtbootstrap3 which provides nearly full support of Bootstrap 3.

#107 Updated by Hynek Cihlar about 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

After updating to the current rev 11153 and running ./gradlew jar native -Dpost.build=yes -Dspawn.install.folder=~/opt/spawner the build was failed
[...]
Could you look at this?

Please move admin2.server and admin2.shared to the standard p2j project structure, that is from p2j_home/src/com/goldencode/p2j/admin2/src/com/goldencode/p2j/admin2 to p2j_home/src/com/goldencode/p2j/admin2 and update the build scripts accordingly if needed.

Sergey, did you have chance to do this? If not I will move the files myself now, no problem.

#108 Updated by Sergey Ivanovskiy about 7 years ago

No, it is not ready now, because I thought that you would have some another plans to build P2J and new administration application. Please explain do you use Visual Editor for new administration views and what is your IDE and how did you configure new administration project? I am using Eclipse and build this project according to note 30.

#109 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Please explain do you use Visual Editor for new administration views and what is your IDE and how did you configure new administration project? I am using Eclipse and build this project according to note 30.

I am using Idea. FWD and the Admin2 server sources are built by Idea, the client-side with ant admin2/build.xml. I am not sure if Eclipse would allow you to define the admin2/src source root inside p2j/src, but moving the (server) java sources out of admin2/src will work OK with the standard FWD build process.

#110 Updated by Hynek Cihlar about 7 years ago

3222a revision 11155 integrates the originally standalone Admin2 web app into P2J project structure. Also removed the requirement to install GWT manually, all the dependencies are fetched by gradle, changed UI layout for easier Bootstrap integration and related changes.

Please read p2jhome/src/com/goldencode/p2j/admin2/README.md on how to build and run Admin2 after these changes.

You should update ASAP as these changes will likely cause conflicts.

#111 Updated by Sergey Ivanovskiy about 7 years ago

Hynec, could you help, with 3222a branch the P2J simple server is failed with these errors, but with the trunc version it works properly

[03/03/2017 16:34:15 MSK] (org.hibernate.engine.jdbc.spi.SqlExceptionHelper:ERROR) Invalid value "en_US_P2J" for parameter "collator"; SQL statement:
set collation "en_US_P2J" [90008-193]
[03/03/2017 16:34:15 MSK] (org.hibernate.engine.jdbc.spi.SqlExceptionHelper:WARN) SQL Error: 90008, SQLState: 90008
[03/03/2017 16:34:15 MSK] (org.hibernate.engine.jdbc.spi.SqlExceptionHelper:ERROR) Invalid value "en_US_P2J" for parameter "collator"; SQL statement:
set collation "en_US_P2J" [90008-193]
com.goldencode.p2j.cfg.ConfigurationException:  Initialization failure
    at com.goldencode.p2j.main.StandardServer.hookInitialize(StandardServer.java:1757)
    at com.goldencode.p2j.main.StandardServer.bootstrap(StandardServer.java:878)
    at com.goldencode.p2j.main.ServerDriver.start(ServerDriver.java:415)
    at com.goldencode.p2j.main.CommonDriver.process(CommonDriver.java:396)
    at com.goldencode.p2j.main.ServerDriver.process(ServerDriver.java:147)
    at com.goldencode.p2j.main.ServerDriver.main(ServerDriver.java:756)
Caused by: java.lang.RuntimeException: Error initializing persistence services
    at com.goldencode.p2j.persist.Persistence.initializeInstance(Persistence.java:3881)
    at com.goldencode.p2j.persist.PersistenceFactory.getInstance(PersistenceFactory.java:109)
    at com.goldencode.p2j.persist.DatabaseManager.initialize(DatabaseManager.java:1400)
    at com.goldencode.p2j.persist.Persistence.initialize(Persistence.java:816)
    at com.goldencode.p2j.main.StandardServer$10.initialize(StandardServer.java:1103)
    at com.goldencode.p2j.main.StandardServer.hookInitialize(StandardServer.java:1753)
    ... 5 more
Caused by: org.hibernate.exception.GenericJDBCException: Invalid value "en_US_P2J" for parameter "collator"; SQL statement:
set collation "en_US_P2J" [90008-193]
    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)
    at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:130)
    at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
    at com.sun.proxy.$Proxy5.executeBatch(Unknown Source)
    at com.goldencode.p2j.persist.dialect.H2Helper.executeDDL(H2Helper.java:441)
    at com.goldencode.p2j.persist.dialect.H2Helper.prepareDatabase(H2Helper.java:161)
    at com.goldencode.p2j.persist.Persistence.initializeInstance(Persistence.java:3861)
    ... 10 more
Caused by: org.h2.jdbc.JdbcBatchUpdateException: Invalid value "en_US_P2J" for parameter "collator"; SQL statement:
set collation "en_US_P2J" [90008-193]
    at org.h2.jdbc.JdbcStatement.executeBatch(JdbcStatement.java:676)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:122)
    ... 15 more

Can it be caused by conflicts in versions of dependent libraries?

#112 Updated by Constantin Asofiei about 7 years ago

Sergey Ivanovskiy wrote:

Hynec, could you help, with 3222a branch the P2J simple server is failed with these errors, but with the trunc version it works properly
[...]
Can it be caused by conflicts in versions of dependent libraries?

Yes, p2jpl.jar might be the problem: do a ant install_p2jpl to re-install p2jpl.jar into /opt/pljava/<user>.

#113 Updated by Sergey Ivanovskiy about 7 years ago

It doesn't help for me, I used testcases/simple/server.sh and added to the classpath all libraries from uast/p2j/lib because before it was failed due to new GWT dependencies. We added
Guice that should propagate dependency injection principle and module system, but sadly classpath becomes more and more longer.

#114 Updated by Eric Faulhaber about 7 years ago

Make sure you have picked up fix 3209e/11189 AND that you re-install the newly built p2jspi.jar into the extensions directory of the JVM you are using.

#115 Updated by Sergey Ivanovskiy about 7 years ago

I can run simple server with trunc version and with the current 3209e, but it doesn't work with 3222a. Eric, do you mean that we should apply rev. 11189 from 3209e to 3222a branch?

#116 Updated by Sergey Ivanovskiy about 7 years ago

I applied rev. 11189 from 3209e to 3222a and rebuilt all, but it didn't work with 3222a. Can it be the library classpath that causes problems?
Hynec, did you run simple server with 3222a successfully? Could you send me your starting script. It can help to fix this issue. Now I used to add all jars from 3222a/lib to the classpath.

#117 Updated by Sergey Ivanovskiy about 7 years ago

Found p2j-hibernate-core-4-1.8.jar that is absent in 3209e/build/lib, but is present in 3222a/build/lib? and h2.jar version is different

#118 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Found p2j-hibernate-core-4-1.8.jar that is absent in 3209e/build/lib, but is present in 3222a/build/lib?

I am just about to commit a fix for this.

#119 Updated by Hynek Cihlar about 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Found p2j-hibernate-core-4-1.8.jar that is absent in 3209e/build/lib, but is present in 3222a/build/lib?

I am just about to commit a fix for this.

Committed, pls do a full p2j build: ant all.

For the collation issue, as a workaround you may deactivate persistence if you don't need it. This is what I do. In directory.xml search for name="active".

#120 Updated by Sergey Ivanovskiy about 7 years ago

What is the collation issue? If persistence is deactivated, then simple server isn't failed at start.

#121 Updated by Eric Faulhaber about 7 years ago

Sergey Ivanovskiy wrote:

I applied rev. 11189 from 3209e to 3222a and rebuilt all, but it didn't work with 3222a.

Did you install the newly built p2jspi.jar into the Java extensions directory for the JVM you are using (e.g., /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/)?

#122 Updated by Sergey Ivanovskiy about 7 years ago

Yes, I tried to use 3209e built p2jspi.jar and 3222a built p2jspi.jar and installed p2jspi.jar into /usr/lib/jvm/default-java/jre/lib/ext/ and default-java is a link to java-8-openjdk-amd64/.

#123 Updated by Eric Faulhaber about 7 years ago

The contents should look like this (except for the timestamps, of course):

Archive:  /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/p2jspi.jar
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  2017-02-02 17:56   META-INF/
      199  2017-02-02 17:56   META-INF/MANIFEST.MF
        0  2017-02-02 17:55   META-INF/services/
       43  2017-02-02 17:55   META-INF/services/java.text.spi.CollatorProvider
        0  2017-02-02 17:55   com/
        0  2017-02-02 17:56   com/goldencode/
        0  2017-02-02 17:56   com/goldencode/p2j/
     1088  2017-02-02 17:56   com/goldencode/p2j/Version.class
        0  2017-02-02 17:56   com/goldencode/p2j/spi/
     2879  2017-02-02 17:56   com/goldencode/p2j/spi/ISO_8859_1Collator.class
     2463  2017-02-02 17:56   com/goldencode/p2j/spi/P2JCollatorProvider.class
---------                     -------
     6672                     11 files

Is that the case?

#124 Updated by Eric Faulhaber about 7 years ago

Also, is /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/p2jspi.jar readable by world?

-rw-r--r-- 1 root root 5160 Feb  2 18:03 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/p2jspi.jar

I guess so, if it's working from a different branch, but f not:
sudo chmod 644 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/p2jspi.jar

#125 Updated by Sergey Ivanovskiy about 7 years ago

Thank you, it looks for 3222a built p2jspi.jar like

META-INF/
META-INF/MANIFEST.MF
com/
com/goldencode/
com/goldencode/p2j/
com/goldencode/p2j/Version.class
com/goldencode/p2j/spi/
com/goldencode/p2j/spi/ISO_8859_1Collator.class
com/goldencode/p2j/spi/P2JCollatorProvider.class

there is no service part.
Committed rev 11157.

#126 Updated by Eric Faulhaber about 7 years ago

This is what 3209e/11189 fixed.

#127 Updated by Sergey Ivanovskiy about 7 years ago

It seems that now p2jspi.jar is correct and installed as an extension of JRE, but this exception is still not fixed.

(org.hibernate.engine.jdbc.spi.SqlExceptionHelper:ERROR) Invalid value "en_US_P2J" for parameter "collator"; SQL statement:
set collation "en_US_P2J" [90008-193]
com.goldencode.p2j.cfg.ConfigurationException:  Initialization failure
    at com.goldencode.p2j.main.StandardServer.hookInitialize(StandardServer.java:1757)
    at com.goldencode.p2j.main.StandardServer.bootstrap(StandardServer.java:878)
    at com.goldencode.p2j.main.ServerDriver.start(ServerDriver.java:415)
    at com.goldencode.p2j.main.CommonDriver.process(CommonDriver.java:396)
    at com.goldencode.p2j.main.ServerDriver.process(ServerDriver.java:147)
    at com.goldencode.p2j.main.ServerDriver.main(ServerDriver.java:756)
Caused by: java.lang.RuntimeException: Error initializing persistence services
    at com.goldencode.p2j.persist.Persistence.initializeInstance(Persistence.java:3881)
    at com.goldencode.p2j.persist.PersistenceFactory.getInstance(PersistenceFactory.java:109)
    at com.goldencode.p2j.persist.DatabaseManager.initialize(DatabaseManager.java:1400)
    at com.goldencode.p2j.persist.Persistence.initialize(Persistence.java:816)
    at com.goldencode.p2j.main.StandardServer$10.initialize(StandardServer.java:1103)
    at com.goldencode.p2j.main.StandardServer.hookInitialize(StandardServer.java:1753)
    ... 5 more
Caused by: org.hibernate.exception.GenericJDBCException: Invalid value "en_US_P2J" for parameter "collator"; SQL statement:
set collation "en_US_P2J" [90008-193]
    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)
    at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:130)
    at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
    at com.sun.proxy.$Proxy5.executeBatch(Unknown Source)
    at com.goldencode.p2j.persist.dialect.H2Helper.executeDDL(H2Helper.java:441)
    at com.goldencode.p2j.persist.dialect.H2Helper.prepareDatabase(H2Helper.java:161)
    at com.goldencode.p2j.persist.Persistence.initializeInstance(Persistence.java:3861)
    ... 10 more
Caused by: org.h2.jdbc.JdbcBatchUpdateException: Invalid value "en_US_P2J" for parameter "collator"; SQL statement:
set collation "en_US_P2J" [90008-193]
    at org.h2.jdbc.JdbcStatement.executeBatch(JdbcStatement.java:676)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:122)
    ... 15 more

I set the breakpoint inside of P2JCollatorProvider. It seems that the corresponding local service provider was initialized correctly (en_US_P2J is in available locale list) but exception was still thrown
LocaleServiceProviderPool.getAvailableLocales() line: 197 [local variables unavailable]    
Collator.getAvailableLocales() line: 432    
CompareMode.getCollator(String) line: 232    
Parser.parseSetCollation() line: 5249    
Parser.parseSet() line: 5078    
Parser.parsePrepared() line: 447    
Parser.parse(String, boolean) line: 317    
Parser.parse(String) line: 289    
Parser.prepareCommand(String) line: 254    
Session.prepareLocal(String) line: 561    
Session.prepareCommand(String, int) line: 502    
JdbcConnection.prepareCommand(String, int) line: 1203    
JdbcStatement.executeUpdateInternal(String) line: 126    
JdbcStatement.executeBatch() line: 661    
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]    
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62    
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43    
Method.invoke(Object, Object...) line: 498    
BasicStatementProxyHandler(AbstractStatementProxyHandler).continueInvocation(Object, Method, Object[]) line: 122    
BasicStatementProxyHandler(AbstractProxyHandler).invoke(Object, Method, Object[]) line: 81    
$Proxy5.executeBatch() line: not available    
H2Helper.executeDDL(List<String>, Database) line: 441    
H2Helper.prepareDatabase(Database) line: 161    
Persistence.initializeInstance() line: 3861    

#128 Updated by Hynek Cihlar about 7 years ago

The collation issue is caused by one of the dependencies of GWT. In particular gwt-dev depends on com.ibm.icu:icu4j. In org.h2.value.CompareMode.getInstance() the method body returns a compare implementation relying on icu4j Collator (com.ibm.icu.text.Collator) and not the expected java.text.Collator due to the icu4j being present on the classpath. I am now looking into ways how to force h2 to use the expected collator.

#129 Updated by Hynek Cihlar about 7 years ago

Hynek Cihlar wrote:

The collation issue is caused by one of the dependencies of GWT. In particular gwt-dev depends on com.ibm.icu:icu4j. In org.h2.value.CompareMode.getInstance() the method body returns a compare implementation relying on icu4j Collator (com.ibm.icu.text.Collator) and not the expected java.text.Collator due to the icu4j being present on the classpath. I am now looking into ways how to force h2 to use the expected collator.

Committed a fix to 3222a which removes icu4j from runtime dependencies. Please do a full rebuild after update.

#130 Updated by Sergey Ivanovskiy about 7 years ago

It seems that we can't use GWT devmod with https. I found these articles https://github.com/gwtproject/gwt/issues/7535, http://zlamalp.blogspot.ru/2014/07/run-gwt-dev-mode-behind-https.html, but this case is still not clear for me.

#131 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

It seems that we can't use GWT devmod with https.

For development, let's just turn ssl off. Comment out line 317 (new SslConnectionFactory(sslContextFactory, protocol),) in GenericWebServer.java, this will make jetty serve through the plain HTTP.

#132 Updated by Hynek Cihlar about 7 years ago

Sergey, how is the admin GWT service coming up? Do you need any inputs from me?

#133 Updated by Sergey Ivanovskiy about 7 years ago

Hynek Cihlar wrote:

Sergey, how is the admin GWT service coming up? Do you need any inputs from me?

Yes, please help to retrieve com.goldencode.p2j.net.Session. I used this interface com.goldencode.p2j.admin2.shared.AdminService2 and its peer AdminService2Async and also
I need to get this object (AdminExports) RemoteObject.obtainNetworkInstance(AdminExports.class, session). Correct?

#134 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynek Cihlar wrote:

Sergey, how is the admin GWT service coming up? Do you need any inputs from me?

Yes, please help to retrieve com.goldencode.p2j.net.Session. I used this interface com.goldencode.p2j.admin2.shared.AdminService2 and its peer AdminService2Async and also
I need to get this object (AdminExports) RemoteObject.obtainNetworkInstance(AdminExports.class, session). Correct?

The AdminExports proxy instance is used only in the network context, i.e. on the client to talk to the server. Don't use AdminExports but instead call AdminServerImpl (which in the end implements the AdminExports interface) from the GWT service. All the methods of AdminServerImpl are static and it uses security context to store per-session data. Thus you need to be logged in (as admin) in order for AdminServerImpl to work.

#135 Updated by Sergey Ivanovskiy about 7 years ago

Hynek Cihlar wrote:

The AdminExports proxy instance is used only in the network context, i.e. on the client to talk to the server. Don't use AdminExports but instead call AdminServerImpl (which in the end implements the AdminExports interface) from the GWT service.

Understand, I didn't plan to use AdminExports proxy on the client. Can I move com.goldencode.p2j.admin2.client.AdminService remote interface from client package to shared package?

All the methods of AdminServerImpl are static and it uses security context to store per-session data. Thus you need to be logged in (as admin) in order for AdminServerImpl to work.

Do you have new code or changes for com.goldencode.p2j.admin2.server.AdminServerImpl? You developed a package accessed method Session locateSessionById(Object sessionId) of SecurityManager. Can I used it to get the current com.goldencode.p2j.net.Session for an authenticated user?

#136 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Can I move com.goldencode.p2j.admin2.client.AdminService remote interface from client package to shared package?

Please.

All the methods of AdminServerImpl are static and it uses security context to store per-session data. Thus you need to be logged in (as admin) in order for AdminServerImpl to work.

Do you have new code or changes for com.goldencode.p2j.admin2.server.AdminServerImpl? You developed a package accessed method Session locateSessionById(Object sessionId) of SecurityManager. Can I used it to get the current com.goldencode.p2j.net.Session for an authenticated user?

com.goldencode.p2j.net.Session is used only during client/server communication. In our case there is no client, the application running in web browser talks directly to Jetty embedded in FWD server. Why do you need com.goldencode.p2j.net.Session?

Btw. locateSessionById() retrieves security session - com.goldencode.p2j.security.Session and not com.goldencode.p2j.net.Session.

#137 Updated by Sergey Ivanovskiy about 7 years ago

Oh, thank you, now I understand that you mean com.goldencode.p2j.admin.AdminServerImpl.

#138 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Oh, thank you, now I understand that you mean com.goldencode.p2j.admin.AdminServerImpl.

Right, sorry I wasn't more explicit.

#139 Updated by Sergey Ivanovskiy about 7 years ago

Hynec, please review committed revision 11160-62 that should implement com.goldencode.p2j.admin2.server.AdminServerImpl.

#140 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynec, please review committed revision 11160-62 that should implement com.goldencode.p2j.admin2.server.AdminServerImpl.

It looks good.

If you don't have anything else in your task list, would you please take care of integrating Bootstrap into the project? We need this in order to start producing the actual Admin UI. See the easy-to-follow setup doc at https://github.com/gwtbootstrap3/gwtbootstrap3/wiki/Initial-Setup. We will need the base module gwtbootstrap3 as well as gwtbootstrap3-extras which contains some useful widgets like date/time picker. Also take a look at the demo at http://gwtbootstrap3.github.io/gwtbootstrap3-demo/, it show cases all the features the library provides. The demo uses GWTP and so adopting the demo source codes should be pretty straightforward.

#141 Updated by Sergey Ivanovskiy about 7 years ago

Ok, planning to take this task.

#142 Updated by Sergey Ivanovskiy about 7 years ago

Hynec, could you help? If an admin user had been successfully authorized for access in LoginPresenter.onSubmitLoginInfo, then PlaceManager should open new HomeView view, but actually it only revealed this view and didn't hide LoginView. How would we fix it? Is it correct?

#143 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynec, could you help? If an admin user had been successfully authorized for access in LoginPresenter.onSubmitLoginInfo, then PlaceManager should open new HomeView view, but actually it only revealed this view and didn't hide LoginView. How would we fix it? Is it correct?

LoginPresenter and HomePresenter were both revealed in separate slots, and thus showing both at the same time. See the change in rev 11163.

Also, I had to replace the GIN injection of AuthService with GWT.create(), for some reason the injection stopped working.

#144 Updated by Sergey Ivanovskiy about 7 years ago

This code

=== modified file 'src/com/goldencode/p2j/admin2/client/application/login/LoginPresenter.java'
--- src/com/goldencode/p2j/admin2/client/application/login/LoginPresenter.java    2017-03-08 17:18:26 +0000
+++ src/com/goldencode/p2j/admin2/client/application/login/LoginPresenter.java    2017-03-08 19:46:45 +0000
@@ -34,17 +34,17 @@
    }

    private final PlaceManager placeManager;
-   private AuthServiceAsync authService;
+   private final AuthServiceAsync authService;

    @Inject
    LoginPresenter(EventBus eventBus,
                   MyView view,
                   MyProxy proxy,
-                  PlaceManager placeManager)
+                  PlaceManager placeManager, AuthServiceAsync authService)
    {
       super(eventBus, view, proxy, ApplicationPresenter.SLOT_MAIN);
       this.placeManager = placeManager;
-      this.authService = GWT.create(AuthService.class);
+      this.authService = authService;
       getView().setUiHandlers(this);
    }


is working for me. What happens with your build?

#145 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

This code
[...]
is working for me. What happens with your build?

It appeared after you moved the interfaces from client to shared package. But I am not sure it is the cause, probably not.

Btw. if you have the Bootstrap ready, please check it in.

#146 Updated by Hynek Cihlar about 7 years ago

Sergey, I am working in the app menu. You can pick one of the screens of the original Admin and start implementing it.

#147 Updated by Sergey Ivanovskiy about 7 years ago

Ok. Please look at the committed revision 11164. Don't know where should be dependencies for bootstrap3. I added build.gradle and imported build.xml and set gwtc task to be dependent on gwtbootstrap3 task that copied its dependencies into build/gwtbootstrap3. But there is a gradle gwt plugin http://steffenschaefer.github.io/gwt-gradle-plugin/doc/latest/configuration

#148 Updated by Sergey Ivanovskiy about 7 years ago

Recently the old admin has been accessible but now I have problems with java plugin. Trying to resolve them. I need to select a view for an implementation.

#149 Updated by Constantin Asofiei about 7 years ago

Sergey Ivanovskiy wrote:

Recently the old admin has been accessible but now I have problems with java plugin. Trying to resolve them. I need to select a view for an implementation.

Yes, I've been having problems running the applet from the browser, too. What it works is running it from Eclipse: add a new "Java Applet" configuration, with com.goldencode.p2j.admin.client.AdminClient and parameters p2jservername:127.0.0.1 and p2jserverport:<your-port>.

Build the project externally and add the p2jadmin.jar and p2j.jar to the classpath, with no source folders added. After this, you can run your server (from Eclipse or standalone, as long as you use the same p2j.jar) and the applet should work.

#150 Updated by Sergey Ivanovskiy about 7 years ago

Constantin, thank you, it works for me.

#151 Updated by Sergey Ivanovskiy about 7 years ago

I can take this screen Group Accounts Management if there are no objections.

#152 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Ok. Please look at the committed revision 11164. Don't know where should be dependencies for bootstrap3.

Sergey, I moved the Bootstrap dependencies to the main gradle build file to keep it together with the other gwt dependencies.

#153 Updated by Sergey Ivanovskiy about 7 years ago

I would like to start with more simple screen, for an example Session Management and then will do more complex "Group Accounts Management"? Is it ok?

#154 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

I would like to start with more simple screen, for an example Session Management and then will do more complex "Group Accounts Management"? Is it ok?

Yes, it makes sense.

#155 Updated by Sergey Ivanovskiy about 7 years ago

Committed rev.11166 fixed build.xml and AdminApp.gwt.xml to work with AdminServiceAsync and added unworkable Session Management view. These common files are changed

modified src/com/goldencode/p2j/admin2/AdminApp.gwt.xml
modified src/com/goldencode/p2j/admin2/client/NameTokens.java
modified src/com/goldencode/p2j/admin2/build.xml

#156 Updated by Sergey Ivanovskiy about 7 years ago

I was trying to get getSessionList via AdminServiceAsync interface and encountered that wa.targeted had a false value in this singleton AdminServerImpl

   public static SessionInfo[] getSessionList()
   {
      WorkArea wa = workArea.get();

      if (!wa.targeted || !wa.sa.adminAccess())
      {
         return null;
      }

      return wa.sa.getSessionList();
   }

The true value was set by AdminServerImpl.setTargetLive(true); during TemporaryAccountPool static initialization.

#157 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

I was trying to get getSessionList via AdminServiceAsync interface and encountered that wa.targeted had a false value in this singleton AdminServerImpl
[...]
The true value was set by AdminServerImpl.setTargetLive(true); during TemporaryAccountPool static initialization.

Please try to apply the attached diff. I am not sure this is enough for AdminServerImpl to work, let me know if there are more issues. Also I think there should be a corresponding DirectoryService.unbind() on session logout, I'll figure this out later.

#158 Updated by Hynek Cihlar about 7 years ago

Sergey, have you had chance to work on the table "widget" for displaying tabular data? If not I would take that.

#159 Updated by Sergey Ivanovskiy about 7 years ago

Please develop your plan if you have some generalization in mind. With your diff I have an issue that an admin user can't be authorized for access, but temporarily to test functionality i was added this method to session list

   public SessionInfo[] getSessionList()
   {
      AdminServerImpl.setTargetLive(true);
      return AdminServerImpl.getSessionList();
   }

and got this serialization exception due to some rpc policy that surprisingly couldn't validate array of SessionInfo
(org.eclipse.jetty.server.handler.ContextHandler$Context:WARNING) Exception while dispatching incoming RPC call
com.google.gwt.user.client.rpc.SerializationException: Type '[Lcom.goldencode.p2j.admin.SessionInfo;' was not assignable to 'com.google.gwt.user.client.rpc.IsSerializable' and did not have a custom field serializer.For security purposes, this type will not be serialized.: instance = [Lcom.goldencode.p2j.admin.SessionInfo;@5b42704f
        at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:696)
        at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:130)
        at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter$ValueWriter$8.write(ServerSerializationStreamWriter.java:167)
        at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:606)
        at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:644)
        at com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess(RPC.java:497)
        at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:589)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:333)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:303)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:373)
        at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1689)
        at com.goldencode.p2j.admin2.server.AuthFilter.doFilter(AuthFilter.java:43)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
        at org.eclipse.jetty.server.handler.ResourceHandler.handle(ResourceHandler.java:410)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1162)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
        at org.eclipse.jetty.server.Server.handle(Server.java:518)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
        at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:186)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
        at java.lang.Thread.run(Thread.java:745)

There are some rpc files with rpc policy generated by GWT compiler in www/WEB-INF/deploy/adminapp but they are absent in www/adminapp. This issue is not clear for me.

#160 Updated by Sergey Ivanovskiy about 7 years ago

You can use committed rev 11167 to test session list if you will add some how them into main view after successful authorization.

#161 Updated by Sergey Ivanovskiy about 7 years ago

LegacySerializationPolicy is working in this case, but this policy due to the source code is restrictive. It detects an array and check that its element implements isSerializable or a custom serialization method

  /**
   * Instantiable types are primitives, {@line IsSerializable}, types with
   * custom serializers, and any arrays of those types. Merely
   * {@link Serializable} types cannot be instantiated or serialized directly
   * (only as super types of legacy serializable types).
   */
  private boolean isInstantiable(Class<?> clazz) {
    if (clazz.isPrimitive()) {
      return true;
    }
    if (clazz.isArray()) {
      return isInstantiable(clazz.getComponentType());
    }
    if (IsSerializable.class.isAssignableFrom(clazz)) {
      return true;
    }
    return SerializabilityUtil.hasCustomFieldSerializer(clazz) != null;
  }

?

#162 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

LegacySerializationPolicy is working in this case, but this policy due to the source code is restrictive. It detects an array and check that its element implements isSerializable or a custom serialization method
[...]
?

Put a breakpoint to RemoteServiceServlet.getSerializationPolicy(), this should give a clue why the standard serializer is not loaded. I suspect it will fail opening the web context stream of the serialization policy file (*.gwt.rpc).

#163 Updated by Sergey Ivanovskiy about 7 years ago

It helps, thank you. Committed rev 11168 fixed this issue with help of WebAppContext. Now Session list is serialized and view is updated.

#164 Updated by Sergey Ivanovskiy about 7 years ago

Hynec, I found that the session list returned by getSessioList() method from the note 159 is incorrect, because the old admin displays the different sessions in the same state. Do you work on this issue?

#165 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynec, I found that the session list returned by getSessioList() method from the note 159 is incorrect, because the old admin displays the different sessions in the same state.

I'll look at it.

#166 Updated by Hynek Cihlar about 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Hynec, I found that the session list returned by getSessioList() method from the note 159 is incorrect, because the old admin displays the different sessions in the same state.

I'll look at it.

Remove the call to AdminServerImpl.setTargetLive(true) in note 159, update to the current revision and also make sure you have the call to AdminServerImpl.setTargetLive(true) in AuthServiceImpl. If you still find session differences, please give more details and steps to reproduce it.

#167 Updated by Sergey Ivanovskiy about 7 years ago

I updated to rev 11169 and applied your patch, it seems that the current administration session is not included in this list. For an example, I have an admin user and log into our administration web application, but this session is not included, but it is different from the remote administration client session. Is it correct?

#168 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

I updated to rev 11169 and applied your patch, it seems that the current administration session is not included in this list. For an example, I have an admin user and log into our administration web application, but this session is not included, but it is different from the remote administration client session. Is it correct?

Yes, at the moment only network sessions are displayed.

#169 Updated by Sergey Ivanovskiy about 7 years ago

Ok, thank you, I am doing note-153, note-154.

#170 Updated by Sergey Ivanovskiy about 7 years ago

I encountered a minor bug that displaying a modal dialog changes the background layout. This effect happens also for Modal1 in this sample demo http://gwtbootstrap3.github.io/gwtbootstrap3-demo/#modals, right padding is added to the body node.

#171 Updated by Sergey Ivanovskiy about 7 years ago

Hynec, please post links or samples code that are related to how to create nested views/presenters and(or) modal dialogs with GWTP. It seems that it is difficult to support nested views (dialogs). I only succeeded to build gwtbootstrap modal dialogs from the parent view but to have logically separated code in the parent view looks incorrect.

#172 Updated by Sergey Ivanovskiy about 7 years ago

Committed rev 11170 added Session Management view with Filter view. In order to evaluate I used these uncommitted code until we have no menu.

=== modified file 'src/com/goldencode/p2j/admin2/client/application/login/LoginPresenter.java'
--- src/com/goldencode/p2j/admin2/client/application/login/LoginPresenter.java    2017-03-08 22:18:25 +0000
+++ src/com/goldencode/p2j/admin2/client/application/login/LoginPresenter.java    2017-03-09 19:02:50 +0000
@@ -65,9 +65,13 @@
             if (res == SecurityConstants.AUTH_RESULT_SUCCESS)
             {
                PlaceRequest placeRequest = new PlaceRequest.Builder()
-                  .nameToken(NameTokens.HOME)
-                  .build();
+               .nameToken(NameTokens.HOME)
+               .build();
                placeManager.revealPlace(placeRequest);
+               PlaceRequest placeRequest2 = new PlaceRequest.Builder()
+               .nameToken(NameTokens.SESSIONS)
+               .build();
+               placeManager.revealPlace(placeRequest2);
             }
             else
             {

=== modified file 'src/com/goldencode/p2j/admin2/server/AuthServiceImpl.java'
--- src/com/goldencode/p2j/admin2/server/AuthServiceImpl.java    2017-03-07 15:57:38 +0000
+++ src/com/goldencode/p2j/admin2/server/AuthServiceImpl.java    2017-03-10 14:14:55 +0000
@@ -1,5 +1,6 @@
 package com.goldencode.p2j.admin2.server;

+import com.goldencode.p2j.admin.*;
 import com.goldencode.p2j.security.*;
 import com.google.gwt.user.server.rpc.RemoteServiceServlet;
 import com.goldencode.p2j.admin2.shared.AuthService;
@@ -40,6 +41,15 @@
       try
       {
          res = secMgr.authenticateServer(s.getId(), userid, password);
+         secMgr.pushAndSwitchSecurityContextBySessionId(s.getId());
+         try
+         {
+            AdminServerImpl.setTargetLive(true);
+         }
+         finally
+         {
+            secMgr.popAndRestoreSecurityContext();
+         }
       }
       catch (RestrictedUseException e)
       {

#173 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynec, please post links or samples code that are related to how to create nested views/presenters and(or) modal dialogs with GWTP. It seems that it is difficult to support nested views (dialogs). I only succeeded to build gwtbootstrap modal dialogs from the parent view but to have logically separated code in the parent view looks incorrect.

What view of the original Admin are you trying to build?

#174 Updated by Hynek Cihlar about 7 years ago

Sergey I have checked in the menu and added the Sessions link to it. Also I nested Sessions below Home, the idea is to have the Home presenter represent all the content to be accessible after the user authenticates.

#175 Updated by Sergey Ivanovskiy about 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Hynec, please post links or samples code that are related to how to create nested views/presenters and(or) modal dialogs with GWTP. It seems that it is difficult to support nested views (dialogs). I only succeeded to build gwtbootstrap modal dialogs from the parent view but to have logically separated code in the parent view looks incorrect.

What view of the original Admin are you trying to build?

Working on Group Accounts management view (Accounts>Groups). Planning to use the same construction that was applied for Session Management View to display Filter dialog.

#176 Updated by Hynek Cihlar about 7 years ago

I checked in changes which make the super devmode work. In respect to that I changed the embedded Jetty not to use SSL as super devmode doesn't work with SSL, and renamed admin2/www to admin2/war which makes super devmode configuration less painful. I highly recommend using super devmode in development, it greatly reduces turnaround times. Please see admin2/README.md on how to run Admin2 in super devmode.

#177 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynec, please post links or samples code that are related to how to create nested views/presenters and(or) modal dialogs with GWTP.

See a modal dialog example in 3222a revision 11173, in Main menu --> Runtime Settings --> Custom Libraries.

#178 Updated by Sergey Ivanovskiy about 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Hynec, please post links or samples code that are related to how to create nested views/presenters and(or) modal dialogs with GWTP.

See a modal dialog example in 3222a revision 11173, in Main menu --> Runtime Settings --> Custom Libraries.

Thanks, you are using manually displayed dialog, but I would like to know if there exists a support of nested dialogs using GWTP style with Model, View and Presenter per a dialog with possibility to delegate some functionality to its parent view/controler. It seems that there are no parent views and parent controllers in GWTP framework.

#179 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Hynec, please post links or samples code that are related to how to create nested views/presenters and(or) modal dialogs with GWTP.

See a modal dialog example in 3222a revision 11173, in Main menu --> Runtime Settings --> Custom Libraries.

Thanks, you are using manually displayed dialog, but I would like to know if there exists a support of nested dialogs using GWTP style with Model, View and Presenter per a dialog with possibility to delegate some functionality to its parent view/controler. It seems that there are no parent views and parent controllers in GWTP framework.

Yes, for simple modals I think is is better not to use separate presenters. What modal are you implementing?

#180 Updated by Sergey Ivanovskiy about 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Hynec, please post links or samples code that are related to how to create nested views/presenters and(or) modal dialogs with GWTP.

See a modal dialog example in 3222a revision 11173, in Main menu --> Runtime Settings --> Custom Libraries.

Thanks, you are using manually displayed dialog, but I would like to know if there exists a support of nested dialogs using GWTP style with Model, View and Presenter per a dialog with possibility to delegate some functionality to its parent view/controler. It seems that there are no parent views and parent controllers in GWTP framework.

Yes, for simple modals I think is is better not to use separate presenters. What modal are you implementing?

I decided to use separate dialogs represented by their views that built with UiBuilder and GIN with its parent controller that implements UIHandlers interface. It helps to overcome these mentioned design problems. There are many dialogs with its own fields on my view Accounts>Groups. Now I have no these problems. I would like only to notify about these design issues related to GWTP. May be I am not 100% correct here. Corrected: I have no these problems.

#181 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Hynec, please post links or samples code that are related to how to create nested views/presenters and(or) modal dialogs with GWTP.

See a modal dialog example in 3222a revision 11173, in Main menu --> Runtime Settings --> Custom Libraries.

Thanks, you are using manually displayed dialog, but I would like to know if there exists a support of nested dialogs using GWTP style with Model, View and Presenter per a dialog with possibility to delegate some functionality to its parent view/controler. It seems that there are no parent views and parent controllers in GWTP framework.

Yes, for simple modals I think is is better not to use separate presenters. What modal are you implementing?

I decided to use separate dialogs represented by their views that built with UiBuilder and GIN with its parent controller that implements UIHandlers interface. It helps to overcome these mentioned design problems.

What design problem om particular?

There are many dialogs with its own fields on my view Accounts>Groups.

How visually complex are these?

#182 Updated by Sergey Ivanovskiy about 7 years ago

Hynec, do you have objections if I will move AdminApp.css to public folder or another preferable folder from war/ and copied it during gwtc and devmode to the deployed directory war/adminapp?

#183 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynec, do you have objections if I will move AdminApp.css to public folder or another preferable folder from war/ and copied it during gwtc and devmode to the deployed directory war/adminapp?

AdminApp.css is already accessible as web resource, try http://localhost:7443/admin2/AdminApp.css.

#184 Updated by Sergey Ivanovskiy about 7 years ago

Ok. Don't mind my previous question. I realized that we can use the path from the root <stylesheet src="/AdminApp.css"/>
, but now I used the relative path to our application.

#185 Updated by Sergey Ivanovskiy about 7 years ago

If we inspect our application page by Browser's Html Inspector, then we can find that css styles are included in this order

<link type="text/css" rel="stylesheet" href="menu.css"> <!-- menu styles are linked at the begining-->
<script type="text/javascript" language="javascript" src="adminapp/adminapp.nocache.js"></script>
<link rel="stylesheet" href="http://127.0.0.1:7443/admin2/adminapp/css/bootstrap-3.3.7.min.cache.css">
<link rel="stylesheet" href="http://127.0.0.1:7443/admin2/adminapp/css/font-awesome-4.7.0.min.cache.css">
<link rel="stylesheet" href="http://127.0.0.1:7443/admin2/adminapp/css/bootstrap-datepicker3-1.5.1.min.cache.css">
<link rel="stylesheet" href="http://127.0.0.1:7443/admin2/adminapp/gwt/clean/clean.css">
....

But it seems from https://www.w3.org/TR/CSS2/cascade.html#cascade that the order of included css can be important if we will overwrite some bootstrap styles.
Thus we can attach menu.css after all boootstrap css by making these changes in AdminApp.gwt.xml by including something like
  <inherits name='com.google.gwt.user.User'/>
  <inherits name='com.google.gwt.inject.Inject' />
  <inherits name='org.gwtbootstrap3.GwtBootstrap3'/>
  <inherits name="org.gwtbootstrap3.extras.datepicker.DatePicker"/>
  <inherits name="com.google.gwt.logging.Logging"/>
  <!-- Inherit the default GWT style sheet.  You can change       -->
  <!-- the theme of your GWT application by uncommenting          -->
  <!-- any one of the following lines.                            -->
  <inherits name='com.google.gwt.user.theme.clean.Clean'/>
  <!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
  <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
  <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->
  <stylesheet src="/admin2/menu.css"/>
  <stylesheet src="/admin2/AdminApp.css"/>
.....

#186 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Thus we can attach menu.css after all boootstrap css by making these changes in AdminApp.gwt.xml by including something like
[...]

Agree.

#187 Updated by Sergey Ivanovskiy about 7 years ago

Please review these css changes, committed revision 11174.

#188 Updated by Sergey Ivanovskiy about 7 years ago

Committed revision 11175 added Group Accounts Management view that is still in progress.

#189 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Please review these css changes, committed revision 11174.

The change is OK.

#190 Updated by Sergey Ivanovskiy about 7 years ago

Hynec, should we move packages groups and session into home package like it was done for runtime_settings?

#191 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynec, should we move packages groups and session into home package like it was done for runtime_settings?

Yes, please.

#192 Updated by Sergey Ivanovskiy about 7 years ago

Committed rev 11176 renamed session package to sessions and moved groups and sessions into home.

#193 Updated by Sergey Ivanovskiy about 7 years ago

Planning to consider the User Accounts Management view that is accessible by Accounts > Users, since it is similar to Accounts > Groups if there are no objections.

#194 Updated by Sergey Ivanovskiy about 7 years ago

Hynek, please review committed revision 11177 that changed version for guava 'com.google.guava:guava:21.0' and added guava-gwt 'com.google.guava:guava-gwt:21.0' to be used with gwt-2.8.0. I didn't find another solution to fix sessions filter.

#195 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynek, please review committed revision 11177 that changed version for guava 'com.google.guava:guava:21.0' and added guava-gwt 'com.google.guava:guava-gwt:21.0' to be used with gwt-2.8.0. I didn't find another solution to fix sessions filter.

What was the problem?

#196 Updated by Sergey Ivanovskiy about 7 years ago

The problem is that Guava started to support GWT-2.8.0 from version release 20. https://github.com/google/guava/wiki/Release19

#198 Updated by Hynek Cihlar about 7 years ago

In my last commit I included MultiCallback class that simplifies dispatching of multiple servlet calls. For example useful in cases where screen must be updated based on data from multiple service methods.

So instead of doing this:

      service.methodA(new AsyncCallback<ResultA>()
      {
         @Override
         public void onFailure(Throwable caught)
         {
            .. handle error ..
         }

         public void onSuccess(ResultA result)
         {
            service.methodB(new AsyncCallback<ResultB>()
            {
               @Override
               public void onFailure(Throwable caught)
               {
                  .. handle error ..
               }

               @Override
               public void onSuccess(ResultB result)
               {
                  service.methodC(new AsyncCallback<ResultC>()
                  {
                     @Override
                     public void onFailure(Throwable caught)
                     {
                        .. handle error ..
                     }

                     @Override
                     public void onSuccess(ResultC result)
                     {
                        .. update UI based on ResultA, ResultB and ResultC ..
                     }
                  });
               }
            });
         }
      });

one can do this:

      MultiCallback mc = new MultiCallback();
      AsyncCallback<ResultA> cbA = mc.newCallback();
      AsyncCallback<ResultB> cbB = mc.newCallback();
      AsyncCallback<ResultC> cbC = mc.newCallback();

      mc.onSuccess(() ->
      {
         ResultA resA = mc.getResult(cbA);
         ResultB resB = mc.getResult(cbB);
         ResultC resC = mc.getResult(cbC);

         ..  update UI based on resA resB and resC ..
      });

      // MultiCallback provides a default error handler which can be overriden

      service.methodA(cbA);
      service.methodA(cbB);
      service.methodA(cbC);

Besides the more readable code MultiCallback also allows all the service methods to be executed in parallel.

#199 Updated by Sergey Ivanovskiy about 7 years ago

You didn't notify that you removed com.goldencode.p2j.admin2.shared.model.TaggedName and it seems that the project 3222a is in broken state now because of

xecuting task ':ant-compile' (up-to-date check took 0.0 secs) due to:
  Task has not declared any outputs.
[ant:javac] Compiling 9 source files to /home/sbi/projects/3222a/build/classes
[ant:javac] /home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/client/application/home/runtime_settings/CustomLibrariesView.java:148: error: cannot find symbol
[ant:javac]       MultiCallback mc = new MultiCallback();
[ant:javac]       ^
[ant:javac]   symbol:   class MultiCallback
[ant:javac]   location: class CustomLibrariesView
[ant:javac] /home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/client/application/home/runtime_settings/CustomLibrariesView.java:148: error: cannot find symbol
[ant:javac]       MultiCallback mc = new MultiCallback();
[ant:javac]                              ^
[ant:javac]   symbol:   class MultiCallback
[ant:javac]   location: class CustomLibrariesView
[ant:javac] 2 errors
:ant-compile FAILED
:ant-compile (Thread[Daemon worker,5,main]) completed. Took 1.951 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ant-compile'.
> Compile failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.

BUILD FAILED

Total time: 7.58 secs
Received result Failure[value=org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':ant-compile'.] from daemon DaemonInfo{pid=5075, address=[4ffa1e6d-af6e-4cde-8419-815ec47775ac port:44813, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]], idle=false, lastBusy=1489600551194, context=DefaultDaemonContext[uid=2aa081c2-b7ee-4efa-a815-fe45b7abcbe1,javaHome=/usr/lib/jvm/java-8-openjdk-amd64,daemonRegistryDir=/home/sbi/.gradle/daemon,pid=5075,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]} (build should be done).

#200 Updated by Hynek Cihlar about 7 years ago

I checked in the missing files, the project should compile fine now.

I removed com.goldencode.p2j.admin2.shared.model.TaggedName and modified the original com.goldencode.p2j.admin.TaggedName so that it could be used on the client directly. The shared.model version didn't contain the features needed on the client.

#201 Updated by Hynek Cihlar about 7 years ago

Revision 11180 resolves compile failures caused by the removal of shared/model/TaggedName.java.

#202 Updated by Sergey Ivanovskiy about 7 years ago

Hynek Cihlar wrote:

I checked in the missing files, the project should compile fine now.

I removed com.goldencode.p2j.admin2.shared.model.TaggedName and modified the original com.goldencode.p2j.admin.TaggedName so that it could be used on the client directly. The shared.model version didn't contain the features needed on the client.

Understand, thanks.

#203 Updated by Hynek Cihlar about 7 years ago

Sergey, on the accounts/groups, I think that moving the buttons to the panels' footers would make the buttons more visually connected with the tables. Just an idea.

#204 Updated by Sergey Ivanovskiy about 7 years ago

Ok, at first they were at the footer, but next time I decided to test out of footer layout.

#205 Updated by Sergey Ivanovskiy about 7 years ago

Committed revision 11183 fixed Session Management view.

#206 Updated by Hynek Cihlar about 7 years ago

Sergey, we need a way to simplify how data grids are created. Currently it is a lot of manual work which can be automated. Considering the number of data grids yet to be created this could save us significant amount of time during the initial implementation as well as future maintenance.

I have created GridHelper class which at this point significantly simplifies creation of simple data grids - list based, no pagination, single selection model. Please check out the class, provide feedback and feel free to extend with new methods to create data grids with pagination, multi selection model, etc.

#207 Updated by Sergey Ivanovskiy about 7 years ago

Ok, planning to use and to generalize table creation code into GridHelper. What is the purpose of <dirset dir="/home/hc/gcd/p2j-idea-project/out/production/p2j"/> in build.xml of admin2? It seems that gwtc target completes successfully without this path.

Now I am moving state machine from the old admin to admin2 in order to set enable states for focused widgets.

#208 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

What is the purpose of <dirset dir="/home/hc/gcd/p2j-idea-project/out/production/p2j"/> in build.xml of admin2?

This is a classpath pointing to the output build folder of my IDE, this allows me to run the app without the need to execute ant. Please ignore it, I will remove it in my next commit.

#209 Updated by Sergey Ivanovskiy about 7 years ago

Committed revision 11187 added view state machine for HasEnabled widgets.The usage of this state machine in the case of auto opened modal dialogs is tricky due to a disabled button prevents a current event to be propagated to the next listener. The workaround is to invoke the target handler on a blur event that follows a target click event.

#210 Updated by Hynek Cihlar about 7 years ago

On 17.3.2017 21:58, Hynek Cihlar wrote:

Greg,

I checked the Majic Admin extension sources. I think we will need additional 10 to 15 MD to rewrite it. The biggest risk is in the print functionality. While the original Admin relies on the built-in Swing support, GWT doesn't offer this out of the box. We will have to come up with an approach to print output - generate PDF (on the server), or build an alternative DOM and print that directly, or something else.

Hynek

#211 Updated by Sergey Ivanovskiy about 7 years ago

Committed revision 11188 fixed add, delete, clone and update group actions.

#212 Updated by Hynek Cihlar about 7 years ago

Sergey, I have implemented a general mechanism to displaying common message dialogs. The idea is to encapsulate dialogs that appear in the application more than once. Currently simple message dialogs (with various combinations of buttons) are implemented, but we should also implement dialogs containing input fields.

See the MessageDialogs interface and how it is used in CustomLibrariesView. When you encounter a message dialog that appears in the application more than once (and it doesn't contain any app-specific logic) please add it to MessageDialogPresenter.

#213 Updated by Sergey Ivanovskiy about 7 years ago

Committed revision 11192 moved sessions and groups packages into console and accounts respectively, added com.goldencode.p2j.admin.AdminHelper to be used by admin2 and admin.

#214 Updated by Sergey Ivanovskiy about 7 years ago

An interesting use case to delete 2 groups simultaneously with help of MultiCallback is not succeeded. This method AdminServiceAsync.deleteGroup(String name, AsyncCallback<Boolean> callback) callback returns false for one of these groups. But then it can be deleted too.

#215 Updated by Constantin Asofiei about 7 years ago

Sergey Ivanovskiy wrote:

An interesting use case to delete 2 groups simultaneously with help of MultiCallback is not succeeded. This method AdminServiceAsync.deleteGroup(String name, AsyncCallback<Boolean> callback) callback returns false for one of groups.

In the old Admin Console, is this operation atomic - i.e. if a group delete fails, then no group is deleted?

#216 Updated by Hynek Cihlar about 7 years ago

Sergey, if you happen to get stuck with DataGrid not initially displaying data in Bootsrap's Modal widget (as I did) make sure you initialize the grid in the modal's shown handler (Modal.addShownHandler()). This pattern can be seen in ListSelect (to be committed).

#217 Updated by Sergey Ivanovskiy about 7 years ago

Constantin Asofiei wrote:

Sergey Ivanovskiy wrote:

An interesting use case to delete 2 groups simultaneously with help of MultiCallback is not succeeded. This method AdminServiceAsync.deleteGroup(String name, AsyncCallback<Boolean> callback) callback returns false for one of groups.

In the old Admin Console, is this operation atomic - i.e. if a group delete fails, then no group is deleted?

No, it is not atomic. The old Admin removes selected items sequentially. It displays a message warning if it is not succeeded and then follows the next selected item to delete.

#218 Updated by Sergey Ivanovskiy about 7 years ago

It seems that deleteGroup is not thread safe and after applying this diff the delete issue is gone out. But I am not sure, because it is just a test

=== modified file 'src/com/goldencode/p2j/admin/AdminServerImpl.java'
--- src/com/goldencode/p2j/admin/AdminServerImpl.java    2017-02-25 14:49:57 +0000
+++ src/com/goldencode/p2j/admin/AdminServerImpl.java    2017-03-20 16:25:34 +0000
@@ -1122,7 +1122,7 @@
     * 
     * @return   true if successfully deleted the group
*/
- public static boolean deleteGroup(String name)
+ public static synchronized boolean deleteGroup(String name) {
// access the target
WorkArea wa = workArea.get();

#219 Updated by Sergey Ivanovskiy about 7 years ago

Working on Accounts>Users screen.

#220 Updated by Sergey Ivanovskiy about 7 years ago

Committed revision 11196 moved AuthModes out for common usages.

#221 Updated by Hynek Cihlar about 7 years ago

Sergey, after the update to 11196 I am getting compilation errors when running build.gradle, see below.

    [exec] [ant:javac] /home/hc/gcd/p2j_repo/p2j/src/com/goldencode/p2j/admin2/client/application/home/accounts/AuthModes.java:7: error: illegal forward reference
     [exec] [ant:javac]    SERVER_AUTH(AuthModes.VALUES.getUseServerAuth()),
     [exec] [ant:javac]                         ^
     [exec] [ant:javac] /home/hc/gcd/p2j_repo/p2j/src/com/goldencode/p2j/admin2/client/application/home/accounts/AuthModes.java:9: error: illegal forward reference
     [exec] [ant:javac]    PASSWORD_AUTH(AuthModes.VALUES.getPasswordAuth()),
     [exec] [ant:javac]                           ^
     [exec] [ant:javac] /home/hc/gcd/p2j_repo/p2j/src/com/goldencode/p2j/admin2/client/application/home/accounts/AuthModes.java:11: error: illegal forward reference
     [exec] [ant:javac]    CERT_AUTH(AuthModes.VALUES.getCertificateAuth()),
     [exec] [ant:javac]                       ^
     [exec] [ant:javac] /home/hc/gcd/p2j_repo/p2j/src/com/goldencode/p2j/admin2/client/application/home/accounts/AuthModes.java:13: error: illegal forward reference
     [exec] [ant:javac]    CERT_PASSWORD_AUTH(AuthModes.VALUES.getCertificateAndPasswordAuth()),
     [exec] [ant:javac]                                ^
     [exec] [ant:javac] /home/hc/gcd/p2j_repo/p2j/src/com/goldencode/p2j/admin2/client/application/home/accounts/AuthModes.java:15: error: illegal forward reference
     [exec] [ant:javac]    CUST_AUTH(AuthModes.VALUES.getCustomAuth());

#222 Updated by Hynek Cihlar about 7 years ago

I am working on the Access Control section now.

#223 Updated by Sergey Ivanovskiy about 7 years ago

Hynek Cihlar wrote:

Sergey, after the update to 11196 I am getting compilation errors when running build.gradle, see below.

Sorry, committed revision 11197 fixed this error.

#224 Updated by Sergey Ivanovskiy about 7 years ago

Committed revision 11198 added Accounts>Users view to the application menu.

#225 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynek Cihlar wrote:

Sergey, after the update to 11196 I am getting compilation errors when running build.gradle, see below.

Sorry, committed revision 11197 fixed this error.

No problem, I was able to work around it.

#226 Updated by Hynek Cihlar about 7 years ago

Sergey, I don't think the table paging of Accounts->Groups and Accounts->Users is necessary. The original Admin applet doesn't provide any sort of paging, and the admin service doesn't provide any paging support either. So all the records must be fetched to the client anyway. From the usability point of view it is easier to scroll through all the (filtered and sorted) records than page.

#227 Updated by Sergey Ivanovskiy about 7 years ago

Agree, I will remove paging widgets from these views. Committed revision 11199,11200 added SecuritySelectorGroup that is an implementation of RadioGroupBase<T> for the particular enum type SecuritySelectorOptions.
This widget will be useful if this schema can be generalized for any enumeration type. The required parser can be created from this type Class<E>, where E ? extends Enum, but I don't know how to list all its elements.

#228 Updated by Sergey Ivanovskiy about 7 years ago

Committed revision 11201 added EnumRadioGroup and removed the particular group widget SecuritySelectorGroup, planning to check generic types and if this test will work, then EnumCreator will be removed.

#229 Updated by Sergey Ivanovskiy about 7 years ago

Hynek Cihlar wrote:

Sergey, I don't think the table paging of Accounts->Groups and Accounts->Users is necessary. The original Admin applet doesn't provide any sort of paging, and the admin service doesn't provide any paging support either. So all the records must be fetched to the client anyway. From the usability point of view it is easier to scroll through all the (filtered and sorted) records than page.

Hynek, did you test grids filled with more than 50 records (default page size)?

#230 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynek, did you test grids filled with more than 50 records (default page size)?

No, but I set the page size to be Integer.MAX_VALUE.

#231 Updated by Sergey Ivanovskiy about 7 years ago

It seems that CertificatesUtils has types/classes that can't be used on the client side. We should add new corresponding service methods to be used on the client side.
For an example,

   public static TaggedName[] getCertificateHierarchy(String alias, AdminExports adm)

#232 Updated by Sergey Ivanovskiy about 7 years ago

It seems that there are no GWT or bootstrap3 widget that can represent certificates as a dropdown list with two columns. Now I am using ListBox with one column.

#233 Updated by Sergey Ivanovskiy about 7 years ago

It seems we should add this method

   /**
    * Client-side validation of the extension data. This means only following
    * validation is done:
    * <ul>
    *    <li>check if the mandatory widgets have data</li>
    *    <li>check if the numeric, date, etc fields are valid</li>
    *    <li>any other special validation which can be done on client-side</li>
    * </ul>
    * 
    * @param    userName
    *           The user for which extension field validation is needed. If 
    *           null, it means a new user is added.
    * 
    * @return   the extension object which holds extension data
    * 
    * @throws   AccountExtValidationException if client-side validation fails
*/
public Serializable validateExtensions(String userName)
throws AccountExtValidationException;

to our administration service.

#234 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

It seems that there are no GWT or bootstrap3 widget that can represent certificates as a dropdown list with two columns. Now I am using ListBox with one column.

I already implemented a widget ListSelect that is capable to display (and select) TaggedName objects. Yours will be very similar so feel free to reuse.

#235 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

It seems we should add this method
[...]
to our administration service.

What is the use case?

#236 Updated by Sergey Ivanovskiy about 7 years ago

It is used by Add new user and edit user use cases for the admin applet.

#237 Updated by Sergey Ivanovskiy about 7 years ago

Committed revision 11202 did intermediate changes: moved 2 methods from CertificatesUtils to AdminHelper to be used in GWT admin client too, added dialog style for radio button labels and radio button group widget.

#238 Updated by Sergey Ivanovskiy about 7 years ago

Hynek, should this functionality AdminAccountExtension be implemented by GWT client?

#239 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynek, should this functionality AdminAccountExtension be implemented by GWT client?

Probably yes, do you need to have this resolved now? Or can we postpone this until we have finished the core features?

#240 Updated by Sergey Ivanovskiy about 7 years ago

Yes, we can suppose that a customer extension is not used.

#241 Updated by Greg Shah about 7 years ago

The customer account extensions are in use. I think Hynek is just suggesting to finish the other core features first. We will be working on a client's custom screens next, which use these extension interfaces.

#242 Updated by Sergey Ivanovskiy about 7 years ago

Ok, SecurityAdmin.getUser for bogus throws this exception due to bogus.getPasswordDate() is not set

Caused by: java.lang.NullPointerException
        at com.goldencode.p2j.security.SecurityAdmin.getUser(SecurityAdmin.java:1162)
        at com.goldencode.p2j.admin.AdminServerImpl.getUser(AdminServerImpl.java:1283)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.goldencode.p2j.util.MethodInvoker.invoke(MethodInvoker.java:76)
        at com.goldencode.p2j.net.Dispatcher.processInbound(Dispatcher.java:709)
        at com.goldencode.p2j.net.Conversation.block(Conversation.java:364)
        at com.goldencode.p2j.net.Conversation.run(Conversation.java:184)
        at java.lang.Thread.run(Thread.java:745)

#243 Updated by Sergey Ivanovskiy about 7 years ago

We are using UserDef on the client side, but the conversion from String to byte[] is not trivial. For an example, it needs to know the client encoding if it is UTF-8, then
http://stackoverflow.com/questions/4584998/how-to-convert-a-byte-array-to-a-string-and-string-to-a-byte-array-with-gwt thread proposes this construction

private static class UTF8Decoder
{
    final byte[] the_input;
    int the_index, the_length;

    protected UTF8Decoder( byte[] bytes )
    {
        super();
        this.the_input = bytes;
        this.the_index = 0;
        this.the_length = bytes.length;
    }

    /*
    Get the next byte. It returns UTF8_END if there are no more bytes.
    */
    int get()
    {
        int c;
        c = the_input[the_index] & 0xFF;
        the_index += 1;
        return c;
    }

    /*
        Get the 6-bit payload of the next continuation byte.
        Return UTF8_ERROR if it is not a contination byte.
    */
    int cont()
    {
        int c = get();
        if( (c & 0xC0) == 0x80 )
            return (c & 0x3F);
        else
            throw new IllegalArgumentException( "Failed to pass strict UTF-8" );
    }

    CharSequence getStringUTF8()
    {
        StringBuilder sb = new StringBuilder( the_input.length ); // allocate a maximum size
        while( the_index < the_length )
        {
            int c; /* the first byte of the character */
            int r; /* the result */

            c = get();
            /*
                Zero continuation (0 to 127)
            */
            if( (c & 0x80) == 0 )
            {
                sb.append( (char) c );
            }
            /*
                One continuation (128 to 2047)
            */
            else if( (c & 0xE0) == 0xC0 )
            {
                int c1 = cont();
                if( c1 >= 0 )
                {
                    r = ((c & 0x1F) << 6) | c1;
                    if( r >= 128 )
                        sb.append( (char) r );
                    else
                        throw new IllegalArgumentException();
                }
            }
            /*
            Two continuation (2048 to 55295 and 57344 to 65535)
            */
            else if( (c & 0xF0) == 0xE0 )
            {
                int c1 = cont();
                int c2 = cont();
                if( (c1 | c2) >= 0 )
                {
                    r = ((c & 0x0F) << 12) | (c1 << 6) | c2;
                    if( r >= 2048 && (r < 55296 || r > 57343) )
                        sb.append( (char) r );
                    else
                        throw new IllegalArgumentException();
                }
            }
            /*
            Three continuation (65536 to 1114111)
            */
            else if( (c & 0xF8) == 0xF0 )
            {
                int c1 = cont();
                int c2 = cont();
                int c3 = cont();
                if( (c1 | c2 | c3) >= 0 )
                    sb.append( (char) ((((c & 0x0F) << 18) | (c1 << 12) | (c2 << 6) | c3) + 65536) ); // TODO this might not work as it is being cast to a char
            }
            else
                throw new IllegalArgumentException( "Failed strict UTF8 parsing" );
        }
        return sb;
    }
}

Also it seems we should add <meta charset="utf-8" /> to AdminApp.html
Are there another ideas how to convert char strings into byte array?

#244 Updated by Sergey Ivanovskiy about 7 years ago

But it seems that String.getBytes("UTF-8") is in the JRE emulated set.

#245 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

But it seems that String.getBytes("UTF-8") is in the JRE emulated set.

Are you referring to the UserDef.password? I think we should set its value on the server anyway, MessageDigest which is used to calculate the password hash is not supported by GWT.

#246 Updated by Sergey Ivanovskiy about 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

But it seems that String.getBytes("UTF-8") is in the JRE emulated set.

Are you referring to the UserDef.password? I think we should set its value on the server anyway, MessageDigest which is used to calculate the password hash is not supported by GWT.

It seems that UserDef.password, is filled on the client side.!

#247 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

But it seems that String.getBytes("UTF-8") is in the JRE emulated set.

Are you referring to the UserDef.password? I think we should set its value on the server anyway, MessageDigest which is used to calculate the password hash is not supported by GWT.

It seems that UserDef.password, is filled on the client side.!

In the original Admin yes, it has the java.security package available. But this is different on GWT.
Another aspect could be security. Do we want to reveal the hashing algorithm (and potential input params like salt (which is not currently used)) to the outside world?

#248 Updated by Sergey Ivanovskiy about 7 years ago

No problems. I only was confused by discussion http://stackoverflow.com/questions/4584998/how-to-convert-a-byte-array-to-a-string-and-string-to-a-byte-array-with-gwt and didn't consider security algorithms on the client side. An admin user should provide new user with text password. I guessed that a custom security plugin would force a new user to create new password if there is such security policy.
Committed revision 11206 added common ModalViewWithUiHandlers to be used with a parent controller that is an instance of UiHandlers.

#249 Updated by Sergey Ivanovskiy about 7 years ago

Committed revision 11208 added "Clone Selected User As" dialog.

#250 Updated by Sergey Ivanovskiy about 7 years ago

Please review committed revision 11209 that changed EnumCreator to use generic enum types and EnumRadioGroup.

#251 Updated by Hynek Cihlar about 7 years ago

Sergey Ivanovskiy wrote:

Please review committed revision 11209 that changed EnumCreator to use generic enum types and EnumRadioGroup.

It looks pretty good.

#252 Updated by Hynek Cihlar about 7 years ago

A nice feature that naturally comes with the web environment and GWT are the persistent URLs. I have implemented this for the Access Control section, the effective grid filter is reflected in the URL and the presenter/view reads the URL to configure the filtering logic when revealed.

The visible user effect is that navigating to the url https://admin:1234/admin2/acl?r=system&a=somename&f=whatever will correctly filter the acl grid in the target view. Obviously such URLs can be bookmarked or shared.

I think this feature would be useful in all the views that support filtering.

Sergey see NameTokens.ACL and ACLView.onReveal() how this is implemented. It is actually very simple.

#253 Updated by Sergey Ivanovskiy about 7 years ago

Ok, committed revision 11211 added filter parameter to sessions url. Now it looks like

#254 Updated by Sergey Ivanovskiy about 7 years ago

Committed rev 11213 added generic CustomComboBox based on DataGrid<TRowObject>.

#255 Updated by Sergey Ivanovskiy about 7 years ago

Committed revision 11215 added Find User dialog and used ModalDialogs as a manager via UsersPresenter (controller).

#256 Updated by Hynek Cihlar about 7 years ago

Sergey, there is a new widget that implements modal dialog for data input, see the class InputDialog. With a simple field definition, you can quickly craft dialogs for simple user input with validations.

#257 Updated by Hynek Cihlar about 7 years ago

Here's a quick implementation status summary. The list below shows the individual Admin sections (as defined in the app menu) with implementation status.

Target - complete (only live target is supported according to the original Admin app)
Print - 50% complete, the screens can be now printed using the browser's print support. There is more work required on the CSS styles so that only the relevant information on each screen is rendered during print. ETA 2 MD
Runtime Settings - complete (Per Server and Per Account subsections are not implemented in the original Admin app)
Access Control - about 60% complete, ETA 3 MD
Accounts - Sergey?
Console - 15% complete, ETA 3 MD
Log Off + Help - 0%, ETA 0.5 MD
Final design - 0%, ETA 1-3 MD. This includes layout improvements to unify appearance of all components, improve UX, introduce images, colors, etc. The ETA largely depends on how pretty we want the app to be.

Sergey, can you please post status and ETA of Accounts?

#258 Updated by Sergey Ivanovskiy about 7 years ago

Hynek Cihlar wrote:

Here's a quick implementation status summary. The list below shows the individual Admin sections (as defined in the app menu) with implementation status.

Target - complete (only live target is supported according to the original Admin app)
Print - 50% complete, the screens can be now printed using the browser's print support. There is more work required on the CSS styles so that only the relevant information on each screen is rendered during print. ETA 2 MD
Runtime Settings - complete (Per Server and Per Account subsections are not implemented in the original Admin app)
Access Control - about 60% complete, ETA 3 MD
Accounts - Sergey?
Console - 15% complete, ETA 3 MD
Log Off + Help - 0%, ETA 0.5 MD
Final design - 0%, ETA 1-3 MD. This includes layout improvements to unify appearance of all components, improve UX, introduce images, colors, etc. The ETA largely depends on how pretty we want the app to be.

Sergey, can you please post status and ETA of Accounts?

Accounts is 40 % complete, approximately 14 MD was spent, so estimation time is 60 % * 14 MD / 40 % = 21 MD

#259 Updated by Hynek Cihlar about 7 years ago

Sergey, I added the Alarm class, it is used to show the last error message from server. It mimics the behavior of the original AdminClient.alarm().

Also I improved InputDialog to support the cases when Save button is clicked and the save operation fails. The Save button must not dismiss the dialog automatically, the user code decides when it should be dismissed.

#260 Updated by Sergey Ivanovskiy about 7 years ago

I used programming dialogs only for errors and warnings notifications and approval actions but their styles are different from dialogs on Groups and Users screens. The current rev is 11218. ModalViewWithUiHandlers is a base class for all modal dialogs for Groups and Users screens. I used a conception of one controller and many views, also it gives possibility to concentrate dialog related logic in dialog class. These views have many widgets inside and using programmatic dialogs can confuse to complete the original old admin applet logic.

#261 Updated by Sergey Ivanovskiy about 7 years ago

These screens: Accounts>Processes and Accounts>Certificates are next to do.

#262 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

I used programming dialogs only for errors and warnings notifications and approval actions but their styles are different from dialogs on Groups and Users screens.

Please be specific about the differences.

The current rev is 11218. ModalViewWithUiHandlers is a base class for all modal dialogs for Groups and Users screens. I used a conception of one controller and many views, also it gives possibility to concentrate dialog related logic in dialog class. These views have many widgets inside

and using programmatic dialogs can confuse to complete the original old admin applet logic.

Please explain.

Are you talking about the InputDialog class?

#263 Updated by Sergey Ivanovskiy almost 7 years ago

I didn't use InputDialog now. Is it you forced me to use this dialog instead of the existing ones in Accounts>Groups and Accounts>Users?

#264 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

I didn't use InputDialog now. Is it you forced me to use this dialog instead of the existing ones in Accounts>Groups and Accounts>Users?

I surely don't want you to force you to do anything.

The original Admin shares many UI elements in the whole app. The elements share some common appearance and behavior. Ideally we should identify all these commonalities and create common code for it. This will save us time not only during the initial implementation but also later during maintenance, UI improvements, etc.

We surely don't want to end up with two different implementations of Admin2. So please, if you find that a common widget doesn't fulfill your requirements while it should (like an error message box, or whatever), extend the common code or ask.

The InputDialog was meant really only for the simplest cases of forms in modal windows with only a few input fields and trivial layout.

In your case while UserAccountDefinitionView and CloneUserAccountView probably should have custom layouts (as you do now), the classes FilterSessionsView, FindUserAccountView, RemovingGroupsAlert and TerminateSessionAlert are good candidates for InputDialog or ModalDialogs common code.

I will demonstrate how much effort you could have saved with using the common code wisely. Sorry for the verbosity, but it is needed for the demonstration.

RemovingGroupsAlert using the common code (this is how it could be implemented):

function foo()
{
   this.modalDialogs.showYesNo("Title", "Do you want to remove the groups?", res ->
   {
         // yes
         if (res == 0)
         {
            .. the yes app logic ...
         }
         // no
         else
         {
            ... the no app logic ...
         }
   });
}

RemovingGroupsAlert with custom layout (this is how you implement it now):

public class RemovingGroupsAlert extends ModalViewWithUiHandlers<UsersUIHandlers>
{
   private static Logger logger = Logger.getLogger("RemovingGroupsAlert");

   interface Binder extends UiBinder<Widget, RemovingGroupsAlert>
   {
   }

   interface AlertMessages extends Messages
   {
      @DefaultMessage("User being removed from {0}. Continue?")
      String userBeingRemovedAlert(String groupsMsg);

      @DefaultMessage("{0} group account")
      String groupAccount(String name);

      @DefaultMessage("{0} groups")
      @AlternateMessage({"=1", "1 group"})
      String groupsMessage(@PluralCount int numberOfAccounts);
   }

   @UiField
   Modal modal;

   @UiField
   Text deleteSelectedAlert;

   @UiField
   Button yesAction;

   @UiField
   Button noAction;

   private final AlertMessages messages;

   private TaggedName[] selectedUserGroups;

   private TaggedName userAccount;

   @Inject
   public RemovingGroupsAlert(RemovingGroupsAlert.Binder binder, RemovingGroupsAlert.AlertMessages messages)
   {
      initWidget(binder.createAndBindUi(this));
      this.messages = messages;
   }

   @UiHandler("yesAction")
   void onYesAction(ClickEvent e)
   {
      logger.log(Level.INFO, "onYesAction");
      getUiHandlers().removeUserFromGroups(userAccount, selectedUserGroups);
   }

   @UiHandler("noAction")
   void onNoAction(ClickEvent e)
   {
      logger.log(Level.INFO, "onNoAction");
      getUiHandlers().cancelRemovingGroupsAlert();
   }

   public void setAlert(TaggedName userAccount, TaggedName[] selectedUserGroups)
   {
      if (selectedUserGroups != null && selectedUserGroups.length > 0)
      {
         this.userAccount = userAccount;
         this.selectedUserGroups = selectedUserGroups;
         deleteSelectedAlert.setText(this.messages.userBeingRemovedAlert(
                  this.messages.groupsMessage(selectedUserGroups.length)));
      }
   }

   @Override
   protected Modal getModal()
   {
      return modal;
   }

}
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui" 
   xmlns:b="urn:import:org.gwtbootstrap3.client.ui" xmlns:b.html="urn:import:org.gwtbootstrap3.client.ui.html" 
   xmlns:b.gwt="urn:import:org.gwtbootstrap3.client.ui.gwt">
   <b:Container fluid="true">
      <b:Row>
         <b:Column size="XS_12">
            <b:Modal closable="true" title="Removing Groups" 
               fade="true" dataBackdrop="STATIC" dataKeyboard="true" 
               b:id="RemovingGroupsAlert" ui:field="modal">
               <b:ModalBody>
                  <g:HorizontalPanel>
                     <g:cell width="10%" verticalAlignment='ALIGN_MIDDLE'>
                        <b:Heading size="H2">
                           <b.html:Span addStyleNames="glyphicon glyphicon-exclamation-sign" />
                        </b:Heading>
                     </g:cell>
                     <g:cell width="90%" horizontalAlignment='ALIGN_CENTER' verticalAlignment='ALIGN_MIDDLE'>
                        <b:Heading size="H4">
                           <b.html:Text ui:field="deleteSelectedAlert" />
                        </b:Heading>
                     </g:cell>
                  </g:HorizontalPanel>
               </b:ModalBody>
               <b:ModalFooter>
                  <b:Button type="PRIMARY" dataDismiss="MODAL" 
                     ui:field="yesAction">Yes</b:Button>
                  <b:Button type="DANGER" dataDismiss="MODAL" ui:field="noAction">No</b:Button>
               </b:ModalFooter>
            </b:Modal>
         </b:Column>
      </b:Row>
   </b:Container>
</ui:UiBinder>
   @Override
   public void setupRemovingGroupsAlert(TaggedName group, TaggedName[] users)
   {
      getView().getRemovingGroupsAlert().setAlert(group, users);
   }
   ...
   getView().getRemovingGroupsAlert().setUiHandlers(this);
   ...
   getView().addToSlot(MODAL_CONTENT, getView().getRemovingGroupsAlert());
   ...
   bindSlot(UsersPresenter.MODAL_CONTENT, modalFragment);
   ...
   // plus a code that reveals the modal dialog presenter, which I didn't find

Do you still see programmatic dialogs confusing?

#265 Updated by Sergey Ivanovskiy almost 7 years ago

Do you still see programmatic dialogs confusing?

Yes, I think that UI styles are better supported by custom dialogs and the code is more readable and hence better to support.

We surely don't want to end up with two different implementations of Admin2. So please, if you find that a common widget doesn't fulfill your requirements while it should (like an error message box, or whatever), extend the common code or ask.

Yes, I don't want to end up, so I used ModalDialogs and will be use Alarm for notifications.

#266 Updated by Sergey Ivanovskiy almost 7 years ago

Committed revision 11220 added Alarm and ModalDialogs to GroupsPresenter and did improvements to use view states.

#267 Updated by Sergey Ivanovskiy almost 7 years ago

Committed revision 11221 added Accounts and Console modules and injected them in Home module.

#268 Updated by Sergey Ivanovskiy almost 7 years ago

Committed revision 11222 added Accounts>Processes and Accounts>Certificates views.

I tried to add a keyboard support to DataGrid in UsersView (), there is a problem if we use multi selection model and set a keyboard selection policy to
KeyboardSelectionPolicy.BOUND_TO_SELECTION. Any case I don't know how to do it and this can be a time consuming problem.

      grid.addCellPreviewHandler(new CellPreviewEvent.Handler<TaggedName>()
      {
         @Override
         public void onCellPreview(CellPreviewEvent<TaggedName> event)
         {
            NativeEvent nevt = event.getNativeEvent();

            int keyCode = nevt.getKeyCode();
             if (keyCode == KeyCodes.KEY_UP     || keyCode == KeyCodes.KEY_DOWN ||
                 keyCode == KeyCodes.KEY_LEFT   || keyCode == KeyCodes.KEY_RIGHT ||
                 keyCode == KeyCodes.KEY_PAGEUP || keyCode == KeyCodes.KEY_PAGEDOWN)
             {
                int rowIndex = grid.getKeyboardSelectedRow();
                TaggedName row = dataProvider.getList().get(rowIndex);
                selectionModel.setSelected(row, true);
             }
         }});

Hynek, if you know how to support keyboard in data grids, please add this functionality to common classes.

#269 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Committed revision 11222 added Accounts>Processes and Accounts>Certificates views.

I tried to add a keyboard support to DataGrid in UsersView (), there is a problem if we use multi selection model and set a keyboard selection policy to
KeyboardSelectionPolicy.BOUND_TO_SELECTION.

What is the use case and what is the problem exactly?

#270 Updated by Hynek Cihlar almost 7 years ago

In my last commit I improved AdminCallback and MultiCallback with the capability to fetch and report server messages or exceptions thrown by the service calls. I also changed the semantics of the call result in order to allow the server messages reporting. A call is considered success according to the AdminCallback.isSuccess() result, the method currently returns true when the result is non-null and if boolean then the result must also hold true. isSuccess() can be overridden in case the default implementation is not suitable for any particular server call.

Sergey, also please note that when you use MultiSelect you first have to create all your child callbacks before issuing the server calls otherwise onDone() can be called multiple times. I have fixed this for the "delete users" use case, please fix the other places, too.

#271 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Committed revision 11222 added Accounts>Processes and Accounts>Certificates views.

I tried to add a keyboard support to DataGrid in UsersView (), there is a problem if we use multi selection model and set a keyboard selection policy to
KeyboardSelectionPolicy.BOUND_TO_SELECTION.

What is the use case and what is the problem exactly?

It is related to common requirements if there is a requirement to navigate, focus and select rows in data grids with help of keyboards. It seems that now the data grids are not
controlled by keyboards keys.

#272 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

It is related to common requirements if there is a requirement to navigate, focus and select rows in data grids with help of keyboards. It seems that now the data grids are not
controlled by keyboards keys.

The grids seem to process key input alright, both navigation and selection/multi selection. The only problem I see is that the currently focused row doesn't provide any visual feedback. I'll check whether the data grid widget handles this already.

#273 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

It is related to common requirements if there is a requirement to navigate, focus and select rows in data grids with help of keyboards. It seems that now the data grids are not
controlled by keyboards keys.

The grids seem to process key input alright, both navigation and selection/multi selection. The only problem I see is that the currently focused row doesn't provide any visual feedback. I'll check whether the data grid widget handles this already.

That is about I wrote replying to your question.

#274 Updated by Hynek Cihlar almost 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

It is related to common requirements if there is a requirement to navigate, focus and select rows in data grids with help of keyboards. It seems that now the data grids are not
controlled by keyboards keys.

The grids seem to process key input alright, both navigation and selection/multi selection. The only problem I see is that the currently focused row doesn't provide any visual feedback. I'll check whether the data grid widget handles this already.

A potential fix is in revision 11225. See the Access Control data grid.

#275 Updated by Sergey Ivanovskiy almost 7 years ago

Committed revision 11226 fixed delete groups and delete users use cases and moved EnumRadioGroup and CustomComboBox to widget com/goldencode/p2j/admin2/client/widget/.

#276 Updated by Sergey Ivanovskiy almost 7 years ago

Committed revision 11227 added AccountsConstants.

#277 Updated by Sergey Ivanovskiy almost 7 years ago

Now I am moving these methods (that depend on java.security API) from CertificateUtils to AdminServerImpl in order to export them to GWT client

TaggedName[] getCertificateHierarchy(String alias);
int validateCertificate(CertDef cert);
Map<String, String> getCertificateDNProperties(CertDef cd, boolean owner);
String getCertificateDNProperty(CertDef cd, String prop, boolean owner);
Map getCertificateProperties(CertDef cd);

#278 Updated by Sergey Ivanovskiy almost 7 years ago

Committed revision 11234 added BasePresenter with history utility methods, improved EnumRadioGroup, added get certificates use case and exported new methods from "note 277" to GWT client.

#279 Updated by Sergey Ivanovskiy almost 7 years ago

Committed revision 11235 added BaseViewWithUIHandlers to improve nested dialogs management.

#280 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek, it seems that we need to rebase 3222a over the current trunc version. Is it a right moment to rebase 3222a? Can we postpone this update?

#281 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Is it a right moment to rebase 3222a?

Yes, please go ahead with the rebase.

#282 Updated by Sergey Ivanovskiy almost 7 years ago

Ok, 3222a is in progress.

#283 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek, the trunc P2J has build.gradle with these comments/warnings

configurations {
    antCompile
    aspectjCompile

    // all runtime dependencies needed for FWD client, FWD application server and conversion
    fwdCCS

    // all runtime dependencies needed for FWD conversion and FWD application server
    fwdConvertServer

    // all runtime dependencies needed for FWD conversion and FWD client
    fwdConvertClient

    // all runtime dependencies needed for both FWD client and FWD application server
    fwdClientServer

    // all runtime dependencies needed for FWD conversion
    fwdConvert {extendsFrom fwdCCS, fwdConvertServer, fwdConvertClient}

    // all runtime dependencies needed for FWD application server
    fwdServer {extendsFrom fwdCCS, fwdConvertServer, fwdClientServer}

    // all runtime dependencies needed for FWD client
    fwdClient {extendsFrom fwdCCS, fwdClientServer, fwdConvertClient}
.....................................................
    // all dependencies needed to build FWD
    // do not add dependencies to this configuration directly!
    fwdAllCompile {extendsFrom fwdAllRuntime}

.........................................
}

but build.gradle (3222a) has these new configurations
configurations {
    antCompile
    p2jCompile
    p2jRuntime { extendsFrom p2jCompile}
    aspectjCompile
........................
    gwtRuntime

    gwtCompile {extendsFrom gwtRuntime}

    allRuntime {extendsFrom gwtRuntime, p2jRuntime}
    allCompile {extendsFrom gwtCompile, p2jCompile}
}

It needs to merge these two versions. gwtRuntime and gwtCompile are out of these configuration schema. What are your proposals?

#284 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

It needs to merge these two versions. gwtRuntime and gwtCompile are out of these configuration schema. What are your proposals?

Please add the gwtRuntime to fwdServer and gwtCompile to fwdAllCompile.

#285 Updated by Sergey Ivanovskiy almost 7 years ago

Ok, thank you. Now I am testing the source code before merging it into rep.

#286 Updated by Sergey Ivanovskiy almost 7 years ago

Committed revision 11244 was after rebasing over the current p2j trunc 11146 and committed revision 11245 fixed incorrect merge with build.gradle.

#287 Updated by Sergey Ivanovskiy almost 7 years ago

Hynec, is this task to fix a resource base path in your task list?

                   // fix path here
-                  webApp.setResourceBase("file:///home/hc/gcd/p2j_repo/p2j/src/com/goldencode/p2j/admin2/war");
+                  webApp.setResourceBase("file:///home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/war");

#288 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynec, is this task to fix a resource base path in your task list?
[...]

Yes, I have it on my list. The file resource must be replaced with a classpath resource.

#289 Updated by Sergey Ivanovskiy almost 7 years ago

The applet administration client have no functionality to generate X509 certificates and it implements only imports of ASCII PEM certificates that is accessible via Accounts>Certificates>Add Certificate. But actually it only imports a base64-encoded DER certificate that contains -----BEGIN CERTIFICATE----- used as the header and -----END CERTIFICATE----- as the footer.
Should we add Import button to Certificate Definition dialog opened by Add Certificate to load an ASCII PEM certificate from the local file system?
Should we implement new functionality to generate X509 certificates in DIR binary and ASCII PEM forms?

#290 Updated by Greg Shah almost 7 years ago

Should we add Import button to Certificate Definition dialog opened by Add Certificate to load an ASCII PEM certificate from the local file system?

Yes, definitely. Good idea.

Should we implement new functionality to generate X509 certificates in DIR binary and ASCII PEM forms?

If it can be done quickly, yes.

#291 Updated by Greg Shah almost 7 years ago

Sergey Ivanovskiy wrote:

Now I am moving these methods (that depend on java.security API) from CertificateUtils to AdminServerImpl in order to export them to GWT client
[...]

I have not had the chance to look at the code in the branch. I do wonder if some of the code in CertificateUtils should actually reside in the security package. Put it wherever it makes most sense for reuse.

#292 Updated by Sergey Ivanovskiy almost 7 years ago

Greg Shah wrote:

Sergey Ivanovskiy wrote:

Now I am moving these methods (that depend on java.security API) from CertificateUtils to AdminServerImpl in order to export them to GWT client
[...]

I have not had the chance to look at the code in the branch. I do wonder if some of the code in CertificateUtils should actually reside in the security package. Put it wherever it makes most sense for reuse.

I meant that these methods are required to be exposed via com.goldencode.p2j.admin2.shared.AdminService

   public TaggedName[] getCertificateHierarchy(String alias);

   public int validateCertificate(CertDef cert);

   public Map<String, String> getCertificateDNProperties(CertDef cd, boolean owner);

   public String getCertificateDNProperty(CertDef cd, String prop, boolean owner);

   public Map<String, Object> getCertificateProperties(CertDef cd);

   public Boolean isSelfSigned(CertDef cert);

and to reuse them I placed the corresponding methods in AdminServerImpl and reused CertificateUtils where these methods were implemented.

#293 Updated by Greg Shah almost 7 years ago

Good.

#294 Updated by Sergey Ivanovskiy almost 7 years ago

Committed revision 11246 added PEM certificate import. Committed revision 11247 implemented "Assign certificate to process" use case.

#295 Updated by Sergey Ivanovskiy almost 7 years ago

Committed rev. 11248 added styles to InputDialog to use a horizontal layout with columns. It seems that in some use cases GWT administration client should be able to restart P2J server and then to reconnect to the administration web service as soon as it will be ready and possibly to restore the current screen. I haven't developed this functionality yet.

#296 Updated by Sergey Ivanovskiy almost 7 years ago

Committed revision 11249 added AsyncAction to chain two asyncronious actions, fixed InputDialog look and feel according to custom dialogs.
I tried to use the same idea that was used by com.goldencode.p2j.admin2.client.application.home.runtime.customlib.ListSelect but encountered visual effect that the data in the target table appeared after seconds delays. Finally I decided to use CellTable instead of DataGrid in CertificateDetailsView dialog.

#297 Updated by Hynek Cihlar almost 7 years ago

Sergey, unless you have any valid objections I will change the button styles for default non-dangerous actions from DANGER to PRIMARY and the non-primary buttons to DEFAULT. The DANGER style should be used to alert the user about any unexpected situation and bring his attention to the screen, that is why is the style called "danger".

#298 Updated by Sergey Ivanovskiy almost 7 years ago

Ok, in this case I should change DANGER to PRIMARY for all custom dialogs. If you have additional code changes, then please fix it. The current rev. is 11250 now.

#299 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek, do you have some task from your list that you haven't started yet that can be delegated? How to integrate "Switch to ACL" action from Groups, Users and Processes views?

#300 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynek, do you have some task from your list that you haven't started yet that can be delegated?

You can take anything from Console menu except of Sessions.

How to integrate "Switch to ACL" action from Groups, Users and Processes views?

This can be done using the "account" url query parameter: #/acl?a=account.

#301 Updated by Sergey Ivanovskiy almost 7 years ago

Ok, I will start from Record Locks.

#302 Updated by Sergey Ivanovskiy almost 7 years ago

Hynec, did you try to run hotel_gui with 3222a? I rebuilt database and application with help of ant clean, ant clean.db, ant deploy, but the server failed with this error

[04/19/2017 16:41:06 MSK] (org.hibernate.cfg.beanvalidation.TypeSafeActivator:WARN) HHH000274: Unable to apply constraints on DDL for com.goldencode.hotel.dmo._meta.impl.MetaFileImpl
java.lang.NullPointerException
        at com.em.validation.rebind.resolve.PropertyResolver.resolve(PropertyResolver.java:116)
        at com.em.validation.rebind.resolve.PropertyResolver.getPropertyMetadata(PropertyResolver.java:62)
        at com.em.validation.rebind.reflector.RuntimeReflectorImpl.<init>(RuntimeReflectorImpl.java:64)
        at com.em.validation.rebind.reflector.factory.RuntimeReflectorFactory.getReflector(RuntimeReflectorFactory.java:54)
        at com.em.validation.client.reflector.ReflectorFactory.getReflector(ReflectorFactory.java:40)
        at com.em.validation.client.metadata.factory.DescriptorFactory.getBeanDescriptor(DescriptorFactory.java:97)
        at com.em.validation.client.CoreValidatorImpl.getConstraintsForClass(CoreValidatorImpl.java:365)
        at com.em.validation.client.ValidatorImpl.getConstraintsForClass(ValidatorImpl.java:113)
        at org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyDDL(TypeSafeActivator.java:172)
        at org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyDDL(TypeSafeActivator.java:138)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.applyRelationalConstraints(BeanValidationIntegrator.java:208)
        at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:126)
        at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:303)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1755)
        at com.goldencode.p2j.persist.DatabaseManager.registerDatabase(DatabaseManager.java:2494)
        at com.goldencode.p2j.persist.DatabaseManager.initialize(DatabaseManager.java:1439)
        at com.goldencode.p2j.persist.Persistence.initialize(Persistence.java:864)
        at com.goldencode.p2j.main.StandardServer$11.initialize(StandardServer.java:1166)
        at com.goldencode.p2j.main.StandardServer.hookInitialize(StandardServer.java:1806)
        at com.goldencode.p2j.main.StandardServer.bootstrap(StandardServer.java:931)
        at com.goldencode.p2j.main.ServerDriver.start(ServerDriver.java:463)
        at com.goldencode.p2j.main.CommonDriver.process(CommonDriver.java:444)
        at com.goldencode.p2j.main.ServerDriver.process(ServerDriver.java:195)
        at com.goldencode.p2j.main.ServerDriver.main(ServerDriver.java:804)

#303 Updated by Sergey Ivanovskiy almost 7 years ago

But I was running successfully hotel_gui with the current trunc P2J.

#304 Updated by Constantin Asofiei almost 7 years ago

Did you do ant deploy.all?

#305 Updated by Sergey Ivanovskiy almost 7 years ago

  • File deploy.all.txt added

Constantin Asofiei wrote:

Did you do ant deploy.all?

No, I tried deploy.all and there exists an unknown problem with import.db if tested it against the current 3222a

    [java] WARN: HHH000274: Unable to apply constraints on DDL for com.goldencode.hotel.dmo.hotel.impl.MetaUserImpl
     [java] java.lang.NullPointerException
     [java]     at com.em.validation.rebind.resolve.PropertyResolver.resolve(PropertyResolver.java:116)
     [java]     at com.em.validation.rebind.resolve.PropertyResolver.getPropertyMetadata(PropertyResolver.java:62)
     [java]     at com.em.validation.rebind.reflector.RuntimeReflectorImpl.<init>(RuntimeReflectorImpl.java:64)
     [java]     at com.em.validation.rebind.reflector.factory.RuntimeReflectorFactory.getReflector(RuntimeReflectorFactory.java:54)
     [java]     at com.em.validation.client.reflector.ReflectorFactory.getReflector(ReflectorFactory.java:40)
     [java]     at com.em.validation.client.metadata.factory.DescriptorFactory.getBeanDescriptor(DescriptorFactory.java:97)
     [java]     at com.em.validation.client.CoreValidatorImpl.getConstraintsForClass(CoreValidatorImpl.java:365)
     [java]     at com.em.validation.client.ValidatorImpl.getConstraintsForClass(ValidatorImpl.java:113)
     [java]     at org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyDDL(TypeSafeActivator.java:172)
     [java]     at org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyDDL(TypeSafeActivator.java:138)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [java]     at java.lang.reflect.Method.invoke(Method.java:498)
     [java]     at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.applyRelationalConstraints(BeanValidationIntegrator.java:208)
     [java]     at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:126)
     [java]     at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:303)
     [java]     at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1755)
     [java]     at com.goldencode.p2j.schema.ImportWorker$Library.initialize(ImportWorker.java:631)
     [java]     at com.goldencode.expr.CE73.execute(Unknown Source)
     [java]     at com.goldencode.expr.Expression.execute(Expression.java:391)
     [java]     at com.goldencode.p2j.pattern.Rule.apply(Rule.java:491)
     [java]     at com.goldencode.p2j.pattern.RuleContainer.apply(RuleContainer.java:583)
     [java]     at com.goldencode.p2j.pattern.RuleSet.apply(RuleSet.java:98)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.apply(PatternEngine.java:1585)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.processAst(PatternEngine.java:1464)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.processAst(PatternEngine.java:1412)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.run(PatternEngine.java:1025)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.main(PatternEngine.java:2041)

Please look at the deploy.all logs. May be we should rebase 3222a over the current trunc and then compare the build files and libraries.

#306 Updated by Eric Faulhaber almost 7 years ago

FYI, I just did a clean checkout of hotel_gui and ran ant deploy.all against FWD trunk. It completes without error, which indicates something different about 3222a.

#307 Updated by Eric Faulhaber almost 7 years ago

Eric Faulhaber wrote:

FYI, I just did a clean checkout of hotel_gui and ran ant deploy.all against FWD trunk. It completes without error, which indicates something different about 3222a.

I also should have noted that the server starts without error.

#308 Updated by Sergey Ivanovskiy almost 7 years ago

Yes, it looks like this problem is related to 3222a only.

#309 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek, I would like to rebase 3222a if you have no objections.

#310 Updated by Sergey Ivanovskiy almost 7 years ago

  • File deleted (deploy.all.txt)

#311 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynek, I would like to rebase 3222a if you have no objections.

No problem.

#312 Updated by Sergey Ivanovskiy almost 7 years ago

Ok, then I am starting rebase now.

#313 Updated by Sergey Ivanovskiy almost 7 years ago

3222a pushed up to revision 11256.

#314 Updated by Sergey Ivanovskiy almost 7 years ago

If GWT validation API is removed from dependencies of gwtRuntime, then the thrown exception will be this one

     [java] Apr 19, 2017 11:53:08 PM com.mchange.v2.log.slf4j.Slf4jMLog$Slf4jMLogger$WarnLogger log
     [java] WARNING: Bad pool size config, start 3 < min 8. Using 8 as start.
     [java] Elapsed job time:  00:00:01.532
     [java] Apr 19, 2017 11:53:08 PM org.hibernate.dialect.Dialect <init>
     [java] INFO: HHH000400: Using dialect: com.goldencode.p2j.persist.dialect.P2JH2Dialect
     [java] Apr 19, 2017 11:53:08 PM org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService
     [java] INFO: HHH000399: Using default transaction strategy (direct JDBC transactions)
     [java] Apr 19, 2017 11:53:08 PM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>
     [java] INFO: HHH000397: Using ASTQueryTranslatorFactory
     [java] Apr 19, 2017 11:53:08 PM org.hibernate.dialect.Dialect <init>
     [java] INFO: HHH000400: Using dialect: com.goldencode.p2j.persist.dialect.P2JH2Dialect
     [java] Apr 19, 2017 11:53:08 PM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>
     [java] INFO: HHH000397: Using ASTQueryTranslatorFactory
     [java] EXPRESSION EXECUTION ERROR:
     [java] ---------------------------
     [java] sessionFactory = imp.initialize(config, hiberProps)
     [java]                      ^  { Error applying BeanValidation relational constraints }
     [java] ---------------------------
     [java] ERROR:
     [java] java.lang.RuntimeException: ERROR!  Active Rule:
     [java] -----------------------
     [java]       RULE REPORT      
     [java] -----------------------
     [java] Rule Type :   POST
     [java] Source AST:  [ hotel ] DATA_MODEL/ @0:0 {292057776129}
     [java] Copy AST  :  [ hotel ] DATA_MODEL/ @0:0 {292057776129}
     [java] Condition :  sessionFactory = imp.initialize(config, hiberProps)
     [java] Loop      :  false
     [java] --- END RULE REPORT ---
     [java] 
     [java] 
     [java] 
     [java]     at com.goldencode.p2j.pattern.PatternEngine.run(PatternEngine.java:1057)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.main(PatternEngine.java:2041)
     [java] Caused by: com.goldencode.expr.ExpressionException: Expression execution error @1:22
     [java]     at com.goldencode.expr.Expression.execute(Expression.java:484)
     [java]     at com.goldencode.p2j.pattern.Rule.apply(Rule.java:491)
     [java]     at com.goldencode.p2j.pattern.RuleContainer.apply(RuleContainer.java:583)
     [java]     at com.goldencode.p2j.pattern.RuleSet.apply(RuleSet.java:98)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.apply(PatternEngine.java:1585)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.processAst(PatternEngine.java:1464)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.processAst(PatternEngine.java:1412)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.run(PatternEngine.java:1025)
     [java]     ... 1 more
     [java] Caused by: org.hibernate.HibernateException: Error applying BeanValidation relational constraints
     [java]     at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.applyRelationalConstraints(BeanValidationIntegrator.java:219)
     [java]     at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:126)
     [java]     at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:303)
     [java]     at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1755)
     [java]     at com.goldencode.p2j.schema.ImportWorker$Library.initialize(ImportWorker.java:631)
     [java]     at com.goldencode.expr.CE73.execute(Unknown Source)
     [java]     at com.goldencode.expr.Expression.execute(Expression.java:391)
     [java]     ... 8 more
     [java] Caused by: java.lang.reflect.InvocationTargetException
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [java]     at java.lang.reflect.Method.invoke(Method.java:498)
     [java]     at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.applyRelationalConstraints(BeanValidationIntegrator.java:208)
     [java]     ... 14 more
     [java] Caused by: org.hibernate.HibernateException: Unable to build the default ValidatorFactory
     [java]     at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:524)
     [java]     at org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyDDL(TypeSafeActivator.java:119)
     [java]     ... 19 more
     [java] Caused by: javax.validation.ValidationException: Unable to find a default provider
     [java]     at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:264)
     [java]     at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:111)
     [java]     at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:521)
     [java]     ... 20 more

#315 Updated by Sergey Ivanovskiy almost 7 years ago

Hynec, tt seems that we need to fix build.gradle so that these libraries will be used directly in order to fix hotel_gui with 3222a, but now incorrect GWT validation provider is used by hibernate

-rw-r--r-- 1 root root   64804 Apr 20 01:13 classmate-1.3.1.jar
-rw-r--r-- 1 root root  762113 Apr 20 00:41 hibernate-validator-5.4.1.Final.jar
-rw-r--r-- 1 root root   34495 Apr 20 00:54 hibernate-validator-cdi-5.4.1.Final.jar
-rw-r--r-- 1 root root  237816 Apr 20 00:47 javax.el-3.0.1-b08.jar
-rw-r--r-- 1 root root   66802 Apr 20 01:12 jboss-logging-3.3.0.Final.jar
-rw-r--r-- 1 root root   63777 Apr 20 01:11 validation-api-1.1.0.Final.jar

#316 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynec, tt seems that we need to fix build.gradle so that these libraries will be used directly in order to fix hotel_gui with 3222a, but now incorrect GWT validation provider is used by hibernate
[...]

The problem is that GWT libraries are used on the FWD server runtime together with other Hibernate dependencies.

I think we will have to hint Hibernate to use the correct validation provider. I didn't look into this in more detail but maybe this could be helpful: https://docs.jboss.org/hibernate/stable/validator/reference/en-US/html_single/?v=4.1#section-configuring-validator-factory.

#317 Updated by Hynek Cihlar almost 7 years ago

Sergey, unless you already started working on these I am taking Console/Logging and Console/Audit as my next task.

#318 Updated by Sergey Ivanovskiy almost 7 years ago

Ok, I am working on Acquire Locks view, in my old admin applet application Services, Logging and Audit are disabled. At this moment I am not succeeded with validation provider for Hibernate. It seems that there is an unknown library ( for me ) that requires validation-api-1.0.0.GA.jar old version of javax validation API, but hibernate-validator-5.4.1.Final.jar requires validation-api-1.1.0.Final.jar. The older version 4.3.1.Final of hibernate-validator requires validation-api-1.0.0.jar. It seems that some listed in build.gradle libraries have hidden dependencies that have been called transitive dependencies. Also hibernate-validator should be excluded from gwtc classpath.

#319 Updated by Sergey Ivanovskiy almost 7 years ago

gwtbootstrap3-0.9.4 requires gwt-user of 2.7.0 and this version requires validation-api-1.0.0.GA.jar.

#320 Updated by Hynek Cihlar almost 7 years ago

Sergey, I have some project structural changes to commit. If you have uncommitted changes please check them in. I don't want to cause you any troubles with merging conflicts.

#321 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek Cihlar wrote:

Sergey, I have some project structural changes to commit. If you have uncommitted changes please check them in. I don't want to cause you any troubles with merging conflicts.

Please commit your changes, there are no troubles. I will merge my changes as they will be ready.

#322 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynek Cihlar wrote:

Sergey, I have some project structural changes to commit. If you have uncommitted changes please check them in. I don't want to cause you any troubles with merging conflicts.

Please commit your changes, there are no troubles. I will merge my changes as they will be ready.

Checked in. Let me know if you encounter issues. Also, note that the DTO classes must no longer be copied under the admin2 project tree.

#323 Updated by Sergey Ivanovskiy almost 7 years ago

  • File failed2compile.txt added

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Hynek Cihlar wrote:

Sergey, I have some project structural changes to commit. If you have uncommitted changes please check them in. I don't want to cause you any troubles with merging conflicts.

Please commit your changes, there are no troubles. I will merge my changes as they will be ready.

Checked in. Let me know if you encounter issues. Also, note that the DTO classes must no longer be copied under the admin2 project tree.

Yes, the compilation is failed. Please look at the attached file.

 ./gradlew jar native --debug -Dpost.build=yes -Dspawn.install.folder=~/opt/spawner -Dsrv.certs=~/projects/testcases/simple/server/srv-certs.store 2>&1 > failed2compile.txt 
10:46:38.676 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
10:46:38.676 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
10:46:38.676 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
10:46:38.677 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
10:46:38.677 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':ant-compile'.
10:46:38.677 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Compile failed; see the compiler error output for details.
10:46:38.677 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
10:46:38.677 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
10:46:38.677 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. 

What is the purpose of these changes? These changes moved admin2 GWT root under com/goldencode/p2j and removed prepare-dto target, didn't they?
ADDED:
It seems that two new GWT module are under com/goldencode/p2j, AdminRightsEditors.gwt.xml and AdminTypes.gwt.xml, and the AdminTypes.gwt.xml is responsible for DTO, but admin2 GWT
AdminApp.gwt.xml is still under com/goldencode/p2j/admin2/?

#324 Updated by Sergey Ivanovskiy almost 7 years ago

My local directory 3222a is an exact copy of 3222a branch and I tried to compile a clean copy.

#325 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

My local directory 3222a is an exact copy of 3222a branch and I tried to compile a clean copy.

The compile errors are fixed. Please update.

#326 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

My local directory 3222a is an exact copy of 3222a branch and I tried to compile a clean copy.

The compile errors are fixed. Please update.

Ok, thanks. What is the current revision of 3222a?

#327 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

It seems that two new GWT module are under com/goldencode/p2j, AdminRightsEditors.gwt.xml and AdminTypes.gwt.xml, and the AdminTypes.gwt.xml is responsible for DTO, but admin2 GWT
AdminApp.gwt.xml is still under com/goldencode/p2j/admin2/?

I have split the project into three GWT modules - AdminTypes, AdminRightsEditors and AdminApp.

The AdminTypes includes all the DTO classes and generic UI classes. AdminRightsEditors contains the admin rights editors and includes AdminTypes. And finally AdminApp contains the app logic and includes both AdminTypes and AdminRightsEditors.

The split up allows to include additional rights editors. This setup allows to keep the development of rights editors separate from the admin application itself (AdminApp GWT module).

The prepare-dto build target is no longer needed. The DTO are now covered by AdminTypes GWT module and as such are included into AdminApp.

#328 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

The compile errors are fixed. Please update.

Ok, thanks. What is the current revision of 3222a?

The fixes went to 11263.

#329 Updated by Sergey Ivanovskiy almost 7 years ago

  • File deleted (failed2compile.txt)

#330 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Hynec, tt seems that we need to fix build.gradle so that these libraries will be used directly in order to fix hotel_gui with 3222a, but now incorrect GWT validation provider is used by hibernate
[...]

The problem is that GWT libraries are used on the FWD server runtime together with other Hibernate dependencies.

I think we will have to hint Hibernate to use the correct validation provider. I didn't look into this in more detail but maybe this could be helpful: https://docs.jboss.org/hibernate/stable/validator/reference/en-US/html_single/?v=4.1#section-configuring-validator-factory.

Hynek, please help with this issue. From my tries ant import.db can be executed without errors if certain libraries will be copied to JRE/lib/ext directory with correct permissions, but this validation.xml file

<validation-config xmlns="http://jboss.org/xml/ns/javax/validation/configuration" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/configuration">
    <default-provider>org.hibernate.validator.HibernateValidator</default-provider>
</validation-config>

under com/goldencode/p2j/persist didn't help, the following exceptions were still thrown
     [java] WARN: HHH000274: Unable to apply constraints on DDL for com.goldencode.hotel.dmo.hotel.impl.MetaUserImpl
     [java] java.lang.NullPointerException
     [java]     at com.em.validation.rebind.resolve.PropertyResolver.resolve(PropertyResolver.java:116)
     [java]     at com.em.validation.rebind.resolve.PropertyResolver.getPropertyMetadata(PropertyResolver.java:62)
     [java]     at com.em.validation.rebind.reflector.RuntimeReflectorImpl.<init>(RuntimeReflectorImpl.java:64)
     [java]     at com.em.validation.rebind.reflector.factory.RuntimeReflectorFactory.getReflector(RuntimeReflectorFactory.java:54)
     [java]     at com.em.validation.client.reflector.ReflectorFactory.getReflector(ReflectorFactory.java:40)
     [java]     at com.em.validation.client.metadata.factory.DescriptorFactory.getBeanDescriptor(DescriptorFactory.java:97)
     [java]     at com.em.validation.client.CoreValidatorImpl.getConstraintsForClass(CoreValidatorImpl.java:365)
     [java]     at com.em.validation.client.ValidatorImpl.getConstraintsForClass(ValidatorImpl.java:113)
     [java]     at org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyDDL(TypeSafeActivator.java:172)
     [java]     at org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyDDL(TypeSafeActivator.java:138)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [java]     at java.lang.reflect.Method.invoke(Method.java:498)
     [java]     at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.applyRelationalConstraints(BeanValidationIntegrator.java:208)
     [java]     at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:126)

#331 Updated by Sergey Ivanovskiy almost 7 years ago

Hynec, there is the following issue with MenuView/MenuPresenter. Selecting the same menu item as it has been currently opened with some url parameters discards them. The framework doesn't provide PlaceRequest with current parameters in this case void prepareFromRequest(PlaceRequest request).

#332 Updated by Sergey Ivanovskiy almost 7 years ago

Now I am doing certificates tree instead of the table view, there are solvable issues with tree presentation.

#333 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynek, please help with this issue. From my tries ant import.db can be executed without errors if certain libraries will be copied to JRE/lib/ext directory with correct permissions, but this validation.xml file
[...]
under com/goldencode/p2j/persist didn't help, the following exceptions were still thrown
[...]

I think I have found a solution for this by explicitly disabling bean validation. I will commit the change once I get the server to run without errors. There are some other unrelated issues caused by the admin2 changes and now I am fighting with H2 not seeing the en_US_P2J collation even though it worked OK before.

Anyway you can leave the validation error to me.

#334 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynec, there is the following issue with MenuView/MenuPresenter. Selecting the same menu item as it has been currently opened with some url parameters discards them. The framework doesn't provide PlaceRequest with current parameters in this case void prepareFromRequest(PlaceRequest request).

Isn't this an expected behavior? I mean selecting a menu item clearing the URL query parameter?

#335 Updated by Sergey Ivanovskiy almost 7 years ago

Ok, it is not an issue.

#336 Updated by Hynek Cihlar almost 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Hynek, please help with this issue. From my tries ant import.db can be executed without errors if certain libraries will be copied to JRE/lib/ext directory with correct permissions, but this validation.xml file
[...]
under com/goldencode/p2j/persist didn't help, the following exceptions were still thrown
[...]

I think I have found a solution for this by explicitly disabling bean validation. I will commit the change once I get the server to run without errors. There are some other unrelated issues caused by the admin2 changes and now I am fighting with H2 not seeing the en_US_P2J collation even though it worked OK before.

Anyway you can leave the validation error to me.

3222a revision 11267 fixes the validation issue. Eric, can you please review the change?

Sergey, note that the hotel server still fails to run. I have some additional fixes about to be checked in.

#337 Updated by Eric Faulhaber almost 7 years ago

Hynek Cihlar wrote:

3222a revision 11267 fixes the validation issue. Eric, can you please review the change?

The change looks good to me. It was never my intention to use this feature in Hibernate, so disabling it explicitly should be ok.

Is the classpath used during conversion changed as well? In other words, is this going to cause any problems when we generate the schema? Note that we use Hibernate's deprecated schemagen tool to do so, so I guess this validation feature is not enabled with that.

#338 Updated by Hynek Cihlar almost 7 years ago

Eric Faulhaber wrote:

Hynek Cihlar wrote:

3222a revision 11267 fixes the validation issue. Eric, can you please review the change?

The change looks good to me. It was never my intention to use this feature in Hibernate, so disabling it explicitly should be ok.

Is the classpath used during conversion changed as well? In other words, is this going to cause any problems when we generate the schema?

I think not. At least my preliminary conversion testing went OK without disabling bean validation.

#339 Updated by Sergey Ivanovskiy almost 7 years ago

Hynec, please review switch to ACLs from accounts (committed revision 11271).

#340 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynec, please review switch to ACLs from accounts (committed revision 11271).

It looks good. Just a small improvement, please create NameTokens.buildACLPlaceRequest(...params...) so that the query param name doesn't leak out of NameTokens.

#341 Updated by Sergey Ivanovskiy almost 7 years ago

Ok, committed revision 11272 added NameTokens.buildACLPlaceRequest(...params...) and implemented the corresponding reveal method in AccountsPresenter.

#342 Updated by Hynek Cihlar almost 7 years ago

I have implemented directory backup and reload, and server shutdown from Console sub-menu. And I am moving on to Print.

#343 Updated by Hynek Cihlar almost 7 years ago

I am looking at the Print feature in the original Admin and I am wondering whether it wouldn't be better to replace it with an Export feature. The exported data (liek csv) would allow the user to open the data in any spreadsheet processor, process the data in any way and eventually print, too.

In the end this would bring the end user more flexibility I believe. Greg, what do you think?

#344 Updated by Sergey Ivanovskiy almost 7 years ago

Hynec, are you planning to fix application jar classpath and https to use with it. I need a real application that works with database in order to test locking records functionality.
Please help with tests if you know how to test locking functionality.

#345 Updated by Sergey Ivanovskiy almost 7 years ago

Another issue is minor, there are no GCD cap in our new source files.

#346 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynec, are you planning to fix application jar classpath

If you mean the problem with bean validation, this has been already fixed. Or are you still having issues there?

and https to use with it. I need a real application that works with database in order to test locking records functionality.

The temporarily disabled SSL is due to the GWT's limitation, its superdev mode doesn't work with SSL. You can turn it back on by un-commenting new SslConnectionFactory(sslContextFactory, protocol), in GenericWebServer.configSslConnector().

Please help with tests if you know how to test locking functionality.

I suppose this feature exists to prevent edits to set of records. I think you can test this by creating a simple test case that will print the record ids (so that you can enter them in Admin), lock one or more records with Admin and try to update the locked record; testcases/uast/canfind-recid-test.p is one of the tests where recid is used.

But do not invest too much time in this. I think it would be sufficient to confirm (in log, debugger, etc.) that your UI will correctly call the backend methods (AdminServerImpl.lockRecords() for example) and those succeed.

#347 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Hynec, are you planning to fix application jar classpath

If you mean the problem with bean validation, this has been already fixed. Or are you still having issues there?

No, I meant GWT application setup. It seems that GWT application setup is not ready and its web root is defined by this manually fixed code from StandardServer.registerDefaultServices(final SecurityManager sm, final BootstrapConfig config)

               // admin2
               if (adm)
               {
                  WebAppContext webApp = new WebAppContext("adminapp", "/admin2");
                  // fix path here
                  webApp.setResourceBase("file:///home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/war");
                  webApp.addServlet(AdminServiceImpl.class, "/adminapp/AdminService");
                  webApp.addServlet(AuthServiceImpl.class, "/adminapp/AuthService");
                  webApp.addFilter(AuthFilter.class,
                            "/adminapp/AdminService",
                                    EnumSet.allOf(DispatcherType.class));
                  webApp.setWelcomeFiles(new String[] {"AdminApp.html"});
                  webApp.setContextPath("/admin2");
                  webApp.setParentLoaderPriority(true);

#348 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Hynec, are you planning to fix application jar classpath

If you mean the problem with bean validation, this has been already fixed. Or are you still having issues there?

No, I meant GWT application setup. It seems that GWT application setup is not ready and its web root is defined by this manually fixed code from StandardServer.registerDefaultServices(final SecurityManager sm, final BootstrapConfig config)
[...]

I see and you are right, this will have to change
so that the web resources are served from p2j.jar and not from file system. But this should not limit you in any way. Having the file system as the source of web resources is currently helping us to shorten the round trips (no server build is required to have access to the source code changes).

#349 Updated by Sergey Ivanovskiy almost 7 years ago

Yes, we can use it during development.
Hynek Cihlar wrote:

I suppose this feature exists to prevent edits to set of records. I think you can test this by creating a simple test case that will print the record ids (so that you can enter them in Admin), lock one or more records with Admin and try to update the locked record; testcases/uast/canfind-recid-test.p is one of the tests where recid is used.

But do not invest too much time in this. I think it would be sufficient to confirm (in log, debugger, etc.) that your UI will correctly call the backend methods (AdminServerImpl.lockRecords() for example) and those succeed.

What are the most priority issues? Are there new functionality or screens that are not ready yet?

#350 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

What are the most priority issues? Are there new functionality or screens that are not ready yet?

If you have all your screens finished, then please do the Help menu.

#351 Updated by Sergey Ivanovskiy almost 7 years ago

Ok, I will fix Acquired Locks today and move to Help. I haven't setup the current MAJIC environment on my host, thus it also will take some time.

#352 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Ok, I will fix Acquired Locks today and move to Help. I haven't setup the current MAJIC environment on my host, thus it also will take some time.

Sergey, before Help please also do Accounts/Bulk Auth Mode Update.

#353 Updated by Greg Shah almost 7 years ago

Hynek Cihlar wrote:

I am looking at the Print feature in the original Admin and I am wondering whether it wouldn't be better to replace it with an Export feature. The exported data (liek csv) would allow the user to open the data in any spreadsheet processor, process the data in any way and eventually print, too.

In the end this would bring the end user more flexibility I believe. Greg, what do you think?

I'm open to the idea. I will check with the customer to see.

#354 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Ok, I will fix Acquired Locks today and move to Help. I haven't setup the current MAJIC environment on my host, thus it also will take some time.

Sergey, before Help please also do Accounts/Bulk Auth Mode Update.

Ok , this screen is too, planning to fix today.

#355 Updated by Hynek Cihlar almost 7 years ago

I have tested the Certificates screen and it works pretty good. There are just some minor things:
  • Grids don't refresh when new certificate is added.
  • Change Alias input dialog should have prefilled the original alias.
  • The "Are you sure you want to add a root CA certificate?" dialog shows Yes, No and Cancel buttons. Cancel is probably redundant here.

I am also attaching the openssl database with all the certificates I have used during testing. It contains a root CA, an intermediate CA and three client certificates signed with the root CA. You can use it for your own testing.

#356 Updated by Sergey Ivanovskiy almost 7 years ago

Thank you, I will fix these ones.

#357 Updated by Sergey Ivanovskiy almost 7 years ago

I can run hotel_gui and attach administration GWT client to this server, thus locked records are filled with data.

#358 Updated by Sergey Ivanovskiy almost 7 years ago

Accounts/Bulk Auth Mode Update is not ready yet, we need to implement currently logged user that is also displayed by the main menu.

#359 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Accounts/Bulk Auth Mode Update is not ready yet, we need to implement currently logged user that is also displayed by the main menu.

The currently logged in user is implemented and about to be checked in.

#360 Updated by Sergey Ivanovskiy almost 7 years ago

Ok, planning to add Bulk Auth Mode Update handler to HomePresenter. I can wait until you will check these changes in.

#361 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Ok, planning to add Bulk Auth Mode Update handler to HomePresenter. I can wait until you will check these changes in.

Checked in.

#362 Updated by Sergey Ivanovskiy almost 7 years ago

Committed revision 11280 added Bulk Auth Mode Update. It seems that old admin Help has no help topics.

#363 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Committed revision 11280 added Bulk Auth Mode Update. It seems that old admin Help has no help topics.

The Help menu does have Show messages, Clear messages and About.

#364 Updated by Greg Shah almost 7 years ago

Hynek Cihlar wrote:

I am looking at the Print feature in the original Admin and I am wondering whether it wouldn't be better to replace it with an Export feature. The exported data (liek csv) would allow the user to open the data in any spreadsheet processor, process the data in any way and eventually print, too.

In the end this would bring the end user more flexibility I believe. Greg, what do you think?

I've spoken with the customer, exporting is not really a good solution. We need to generate a PDF with the print output and open it in the browser.

What time will be needed to implement this?

On a positive note, the same approach will probably form the basis for the solution to #1795.

#365 Updated by Hynek Cihlar almost 7 years ago

Greg Shah wrote:

What time will be needed to implement this?

On a positive note, the same approach will probably form the basis for the solution to #1795.

It depends on the solution we choose.

I can see three options to generate PDFs on the server:

1. Generate an HTML and use a PDF library capable to transform HTMLs into PDFs like iText (although I am not sure if their AGPL license is compatible with our open license). I think this would be the simplest solution in terms of effort (up to 2 MDs to implement). Not much control over the result, depending on the PDF lib capabilities.

2. Generate an XML with the print data and use an XSL-FO processor to generate a PDF output. This would require more work than 1, good control over the output.

3. Do a low-level printing through javax.printing. Most effort out of all the three, ultimate control over the output. This could be done with the help of Apache PDFBox (https://pdfbox.apache.org/). This one could be used for #1795, too.

There are also JavaScript libraries that would allow creating PDFs on the client, but their usage seems to be problematic. For example the demos on http://pdfkit.org don't work for me for some reason, the commercial jsPDF requires a plugin to work.

#366 Updated by Greg Shah almost 7 years ago

PDFBox looks like the correct solution and the license is acceptable.

In what scenarios would we want to use javax.printing versus creation of the PDF by directly using their classes and APIs (e.g. PDDocument, PDPage...)?

#367 Updated by Greg Shah almost 7 years ago

There are also JavaScript libraries that would allow creating PDFs on the client, but their usage seems to be problematic. For example the demos on http://pdfkit.org don't work for me for some reason, the commercial jsPDF requires a plugin to work.

Even if it did work, it wouldn't solve the #1795 problem for the Swing client.

#368 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek, please share what are ideas for printing reports in our GWT admin you are planning to use. Are you planning to use browser's printing functionality? <a onClick="window.print()" href="#">Print</a> with this style

@media print {
.noprint {
display: none;
}
}

#369 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek, please look at committed revision 11283 that added Help menu. What are the most priority tasks for the current week?

#370 Updated by Greg Shah almost 7 years ago

Hynek: Perhaps Sergey should work on the printing to PDF while you can shift to the customer-specific screens?

Hynek, please share what are ideas for printing reports in our GWT admin you are planning to use. Are you planning to use browser's printing functionality? <a onClick="window.print()" href="#">Print</a> with this style

Sergey: Please see #3222-365 and #3222-366. We will use PDFBox as the solution.

#371 Updated by Sergey Ivanovskiy almost 7 years ago

Console>Services is disabled in the old admin applet, but it is enabled for the GWT client. Is it correct?

#372 Updated by Hynek Cihlar almost 7 years ago

Greg Shah wrote:

PDFBox looks like the correct solution and the license is acceptable.

In what scenarios would we want to use javax.printing versus creation of the PDF by directly using their classes and APIs (e.g. PDDocument, PDPage...)?

I think we should prefer the javax.printing API unless we find it is too limited. This will allow us to use the gained knowledge for #1795.

#373 Updated by Hynek Cihlar almost 7 years ago

Greg Shah wrote:

Hynek: Perhaps Sergey should work on the printing to PDF while you can shift to the customer-specific screens?

Sounds good to me.

#374 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynek, please share what are ideas for printing reports in our GWT admin you are planning to use. Are you planning to use browser's printing functionality? <a onClick="window.print()" href="#">Print</a> with this style
[...]

As Greg already noted, we will use the server-side printing with PDFBox.

#375 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Console>Services is disabled in the old admin applet, but it is enabled for the GWT client. Is it correct?

According to the source code, this is an unimplemented feature so it should be disabled. I am committing a fix.

#376 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek, Did you have some design for printing? I am asking because didn't develop it yet. Probably, we should have some PrintContext interface that is implemented by each view to help with print job. The server will use it to generate pdf, my design is not ready yet. Please correct that my current task is to develop Print menu, isn't it?

#377 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynek, Did you have some design for printing? I am asking because didn't develop it yet. Probably, we should have some PrintContext interface that is implemented by each view to help with print job. The server will use it to generate pdf, my design is not ready yet.

Yes, this sounds OK. Try to keep it simple if possible. Make sure you find all the different Print cases of the original Admin before you begin with the code design.

Please correct that my current task is to develop Print menu, isn't it?

Yes.

#378 Updated by Sergey Ivanovskiy almost 7 years ago

Ok, these screens Admin ACL, Acquire Locks, Certificates, Sessions and Admin Group, Process and User Accounts have printable data.

#379 Updated by Sergey Ivanovskiy almost 7 years ago

According to https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ PDBox API has no templates printing or default table data printing. Thus this task requires to develop PDF table printing too.

#380 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

According to https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ PDBox API has no templates printing or default table data printing. Thus this task requires to develop PDF table printing too.

You have to use the low-level API of Graphics2D, see the example https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/rendering/CustomPageDrawer.java?revision=1792647&view=markup.

#381 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

According to https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ PDBox API has no templates printing or default table data printing. Thus this task requires to develop PDF table printing too.

You have to use the low-level API of Graphics2D, see the example https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/rendering/CustomPageDrawer.java?revision=1792647&view=markup.

Due to this low level api I don't understand advantages of using this library. If we compare it with Apache FOP, then at least we can create templates to render data in pdf.
It probably takes more time to develop reports with PBox API and coded reports are difficult to change according the customer design. Is it correct that we should use PBox in our case?

#382 Updated by Sergey Ivanovskiy almost 7 years ago

Greg, please approve one more time that we should use PBox API for generating reports for our GWT client.

#383 Updated by Greg Shah almost 7 years ago

It probably takes more time to develop reports with PBox API and coded reports are difficult to change according the customer design. Is it correct that we should use PBox in our case?

I agree that the low level drawing (Graphics2D) API will not yield the results we want. You point about the code being difficult to change is valid. Also, the result is a PDF of images, which is not what the customer needs. The text must be selectable/copyable.

However, I don't want to use FOP. It is a messier solution and I don't see why we can't just use the high level PDFBox API to build the reports. This seems pretty straightforward and is a simpler solution in my opinion.

#384 Updated by Sergey Ivanovskiy almost 7 years ago

Ok, planning to use PDFBox API.

#385 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek, please review committed revision 11286 added print preview selection dialog, added EnumCreator to InputDialog, fixed EnumRadioGroup to use translation map for its labels. Now I am moving to the server side in order to generate pdf report.

#386 Updated by Sergey Ivanovskiy almost 7 years ago

It seems that there is this small project https://github.com/vandeseer/easytable that can be used to build PDF tables for reports.

#387 Updated by Greg Shah almost 7 years ago

Sergey Ivanovskiy wrote:

It seems that there is this small project https://github.com/vandeseer/easytable that can be used to build PDF tables for reports.

Can you show an alternative example that uses PDFBox directly? I'd like to understand how it this makes it easier.

#388 Updated by Hynek Cihlar almost 7 years ago

Greg Shah wrote:

It probably takes more time to develop reports with PBox API and coded reports are difficult to change according the customer design. Is it correct that we should use PBox in our case?

I agree that the low level drawing (Graphics2D) API will not yield the results we want. You point about the code being difficult to change is valid. Also, the result is a PDF of images, which is not what the customer needs. The text must be selectable/copyable.

True I didn't realize the Graphics2D would yield a raster image. Regarding the complexity, both the G2D and the native PDFBox API are comparable in granularity.

#389 Updated by Sergey Ivanovskiy almost 7 years ago

Greg Shah wrote:

Sergey Ivanovskiy wrote:

It seems that there is this small project https://github.com/vandeseer/easytable that can be used to build PDF tables for reports.

Can you show an alternative example that uses PDFBox directly? I'd like to understand how it this makes it easier.

Yes, I am working on reports now.

#390 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynek, please review committed revision 11286 added print preview selection dialog, added EnumCreator to InputDialog, fixed EnumRadioGroup to use translation map for its labels. Now I am moving to the server side in order to generate pdf report.

The changes look good.

#391 Updated by Sergey Ivanovskiy almost 7 years ago

Please review server side for reports, committed revision 11289. Now empty Users report can be viewed and printed (downloaded as a pdf file). Committed revision 11290 fixed content type for pdf reports.

#392 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Please review server side for reports, committed revision 11289. Now empty Users report can be viewed and printed (downloaded as a pdf file). Committed revision 11290 fixed content type for pdf reports.

It looks good.

My only concern is that you keep all the reports in memory (in the http session) which could easily waste the server's memory. Why not to create a new servlet taking as the input all the report parameters and creating the report on demand?

Also please remove the string constants representing the individual report parameters and use the ReportParameters enum fields instead. For example in HomePresenter.java where PlaceRequest is built, do not hard-code the parameter names as string literals but use ReportParameters.PARAM1.name().

#393 Updated by Sergey Ivanovskiy almost 7 years ago

Ok, we can bound this cache size to permit 1 report per a http session, GWT RPC is used for preview and for report, but downloading is possible only if a target report has been built already on the server and its url is available on the client side.

#394 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Ok, we can bound this cache size to permit 1 report per a http session, GWT RPC is used for preview and for report, but downloading is possible only if a target report has been built already on the server and its url is available on the client side.

What do you mean by preview?

#395 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek Cihlar wrote:

What do you mean by preview?

Print Preview is a standard functionality to preview a report on the screen before printing.

#396 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Ok, we can bound this cache size to permit 1 report per a http session, GWT RPC is used for preview and for report, but downloading is possible only if a target report has been built already on the server and its url is available on the client side.

Limiting the number of reports may not work either. Consider the use case where the user prints multiple reports, i.e. opens multiple browser windows with the pdf content and then decides to save one or more of the pdfs to his local drive. The save operation would end up with an error because the data may get purged at that time.

I see the idea of requesting the "print" servlet directly with all the input data as a more robust solution. Besides, the print link will be guaranteed to always return the pdf output when requested by the client, which brings the user other benefits - bookmarking, possible automation, etc.

#397 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Ok, we can bound this cache size to permit 1 report per a http session, GWT RPC is used for preview and for report, but downloading is possible only if a target report has been built already on the server and its url is available on the client side.

Limiting the number of reports may not work either. Consider the use case where the user prints multiple reports, i.e. opens multiple browser windows with the pdf content and then >decides to save one or more of the pdfs to his local drive. The save operation would end up with an error because the data may get purged at that time.

I didn't plan to do like you wrote here.

I see the idea of requesting the "print" servlet directly with all the input data as a more robust solution. Besides, the print link will be guaranteed to always return the pdf output >when requested by the client, which brings the user other benefits - bookmarking, possible automation, etc.

Yes, print can be done directly by building report and transmitting it to the client. I will fix it later after reports will be done.

#398 Updated by Greg Shah almost 7 years ago

Print Preview is a standard functionality to preview a report on the screen before printing.

I don't know if we need a preview. I think for now, exclude this. Just focus on generation/display of the PDF report.

#399 Updated by Sergey Ivanovskiy almost 7 years ago

Greg Shah wrote:

Print Preview is a standard functionality to preview a report on the screen before printing.

I don't know if we need a preview. I think for now, exclude this. Just focus on generation/display of the PDF report.

Ok, the preview is just what user can observe on the screen, it doesn't require extra work.

There is an unclear functionality that is described by ClientAccountExtension interface used by the admin applet application. I think it doesn't have an implementation in new GWT client.

#400 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

There is an unclear functionality that is described by ClientAccountExtension interface used by the admin applet application. I think it doesn't have an implementation in new GWT client.

What do you mean in particular?

#401 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

There is an unclear functionality that is described by ClientAccountExtension interface used by the admin applet application. I think it doesn't have an implementation in new GWT client.

What do you mean in particular?

There is no entry point for this interface in GWT client. This interface is not used and we have no an interface that represents the same functionality.

#402 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

There is no entry point for this interface in GWT client. This interface is not used and we have no an interface that represents the same functionality.

This is one of the extension points used by Majic. I am working on this right now.

#403 Updated by Sergey Ivanovskiy almost 7 years ago

I observed recently that admin2 in a bad state

~/projects/3222a/src/com/goldencode/p2j/admin2$ ant
Buildfile: /home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/build.xml

gwtc:
     [java] Compiling module com.goldencode.p2j.admin2.AdminApp
     [java]    Tracing compile failure path for type 'com.goldencode.p2j.admin2.client.application.login.LoginPresenter'
     [java]       [ERROR] Errors in 'file:/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/client/application/login/LoginPresenter.java'
     [java]          [ERROR] Line 98: SecurityConstants cannot be resolved to a variable
     [java]    [ERROR] Aborting compile due to errors in some input files

BUILD FAILED
/home/sbi/projects/3222a/src/com/goldencode/p2j/admin2/build.xml:35: Java returned: 1

Total time: 6 seconds

#404 Updated by Sergey Ivanovskiy almost 7 years ago

Don't mind, it was just incorrect built state. All sources are compiled now without errors.

#405 Updated by Sergey Ivanovskiy almost 7 years ago

Greg Shah wrote:

Sergey Ivanovskiy wrote:

It seems that there is this small project https://github.com/vandeseer/easytable that can be used to build PDF tables for reports.

Can you show an alternative example that uses PDFBox directly? I'd like to understand how it this makes it easier.

Yes, committed revision 11292 introduced Users report. Today planning to fix the reports for Groups and Processes except extended reports related to ClientAccountExtension and
to generalize this construction to build tables. Committed rev. 11293 fixed extended reports.

#406 Updated by Sergey Ivanovskiy almost 7 years ago

This is an example of extended reports.

#407 Updated by Sergey Ivanovskiy almost 7 years ago

Committed revision 11294 fixed the case if rows are printed on several pages. These report pages can be fastened together. It seems it should be useful.

#408 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Committed revision 11294 fixed the case if rows are printed on several pages. This report pages can be fastened together. It seems it should be useful.

The report looks good, here are my comments.

The content should be horizontally centered on the page, the lines separating the individual rows should be thinner so that they are less distracting, the columns should be separated by lines. Also besides the ability to choose the page size, the user should be also able to choose the page orientation (portrait vs landscape).

#409 Updated by Sergey Ivanovskiy almost 7 years ago

Should it be like a standard Print dialog? Is it enough to be able to select only a page size and its orientation? Can be there another report parameters to set up?

#410 Updated by Greg Shah almost 7 years ago

I agree with Hynek's comments. The first result is quite good.

My only other request: please center and bold the column heading text.

#411 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Should it be like a standard Print dialog? Is it enough to be able to select only a page size and its orientation? Can be there another report parameters to set up?

I think page size and orientation should be enough. Greg, what do you think?

#412 Updated by Greg Shah almost 7 years ago

I think page size and orientation should be enough. Greg, what do you think?

Agreed.

#413 Updated by Sergey Ivanovskiy almost 7 years ago

Working to fix content to be centred, columns heading text to be bold and centred, columns and rows to be separated by thin lines, to add Print dialog to set page size and orientation.

#414 Updated by Sergey Ivanovskiy almost 7 years ago

Committed rev. 11296 added showFilterDialog to InputDialog in order to reuse this common dialog.

#415 Updated by Sergey Ivanovskiy almost 7 years ago

Committed revision 11298 fixed ReportBuilder and AbstractReportBuilder api such that each report builder should provide columns and data stream to build pdf reports.

#416 Updated by Sergey Ivanovskiy almost 7 years ago

Committed revision 11299 added group and processes accounts reports. Group accounts report shows the case if the string data length is greater than the page width. In this case the report is displayed incorrectly. Working on this issue. The solution can be to cut values to parts or to introduce column renderers and to print data so that rows can have variable heights.

#417 Updated by Greg Shah almost 7 years ago

introduce column renderers and to print data so that rows can have variable heights.

I think this is the right way to go.

#418 Updated by Hynek Cihlar almost 7 years ago

Sergey, I have merged the admin2/build.xml with the main gradle build script together with the web resources being served from a classpath (whether jar file or a directory on the server process classpath).

If you have any changes to the admin build script, please commit them to avoid conflicts.

#419 Updated by Sergey Ivanovskiy almost 7 years ago

You can commit your changes because I have only changes in the sources and now testing report settings: paper format and orientation and have no changes in build.xml.

#420 Updated by Hynek Cihlar almost 7 years ago

I am having issues with the IDE (Idea) setup to serve the static admin files (css, images, htmls, etc.) when P2J server is launched directly from the IDE. This makes development and debugging more complicated than necessary.

The problem comes from the IDE's inability to add the resource files (the admin static files) to the classpath when the resource files are placed in the tree of compilable sources (src dir). The IDE treats the source directories and resource directories differently. The source directory is compiled and the compile output is put into the build dir (leaving out uncompilable sources like html, css, js, etc.), this build dir is then put on the classpath. The resource directory is just put on the classpath by the IDE.

Since the admin resource files (html, css, js) are currently located in the src dir they must be manually copied into the build output dir so that they become "visible" in the java process launched by the IDE. This is error prone as after any change the changed files must not be forgotten to be copied to the build output.

IMHO the most straightforward solution to this would be to move the resource files into its own project directory root and mark the root as a resource dir in the IDE. As is done with the common project layout nowadays (https://docs.gradle.org/current/userguide/java_plugin.html#sec:java_project_layout). But since the src dir in the P2J project root directly contains the Java namespace this setup is not possible. And so src/com dir would have to be moved to src/java/com (or src/main/java/com) so that src/resources (or src/main/resources) could be created, or the resources directory would have to be created in the P2J root.

Any idea anyone? Greg, what do you think?

#421 Updated by Sergey Ivanovskiy almost 7 years ago

I am using Eclipse and have no problems in launching P2J server. Did you commit your changes?

Since the admin resource files (html, css, js) are currently located in the src dir they must be manually copied into the build output dir so that they become "visible" in the java process launched by the IDE. This is error prone as after any change the changed files must not be forgotten to be copied to the build output.

The admin resource files are now in src/com/goldencode/p2j/admin2/war, aren't they?

#422 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

I am using Eclipse and have no problems in launching P2J server. Did you commit your changes?

Since the admin resource files (html, css, js) are currently located in the src dir they must be manually copied into the build output dir so that they become "visible" in the java process launched by the IDE. This is error prone as after any change the changed files must not be forgotten to be copied to the build output.

The admin resource files are now in src/com/goldencode/p2j/admin2/war, aren't they?

No, src/com/goldencode/p2j/admin2/war holds the gwt compiler's output. src/com/goldencode/p2j/admin2 contains the resource files (AdminApp.html, AdminApp.css, favicon.ico, menu.css).

#423 Updated by Greg Shah almost 7 years ago

The reason we don't follow this "standard" project layout is because it adds unnecessary complexity into the directory structure. Mentally I don't differentiate between Java, Scala, Javascript ... because they are all just aspects of the code for the application. It is easy to see the related code when everything for a given package/module is in the same place. With the "standard", one must look in many places to see if there are related files. This is a different kind of "error prone" where a mental barrier is introduced that can confuse.

It is unfortunate that Maven's lack of customizability is infecting IDEs. I will think about this, but I have reservations.

#424 Updated by Hynek Cihlar almost 7 years ago

Greg Shah wrote:

It is unfortunate that Maven's lack of customizability is infecting IDEs. I will think about this, but I have reservations.

I have found a workaround for Idea. The admin resources dir (p2j/src) can be added to the launch configuration as another jar/dir dependency.

#425 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

You can commit your changes because I have only changes in the sources and now testing report settings: paper format and orientation and have no changes in build.xml.

The changes are checked in. Please see admin2/README.md with updated instructions how to build, run and integrate Admin with your IDE.

#426 Updated by Sergey Ivanovskiy almost 7 years ago

Committed rev 11301 added print settings. Continue working on the issues summarized by notes 413 and 416.

#427 Updated by Sergey Ivanovskiy almost 7 years ago

It is required to reinvent word wrapping if a content doesn't fit the maximal available column space along a horizontal. FOP has word wrap functionality, but PDF Box doesn't implement it.

#428 Updated by Greg Shah almost 7 years ago

It is required to reinvent word wrapping if a content doesn't fit the maximal available column space along a horizontal. FOP has word wrap functionality, but PDF Box doesn't implement it.

I assume you can use java2d to measure the text width and thus implement this feature.

#429 Updated by Sergey Ivanovskiy almost 7 years ago

I did it but word wrapping by FOP is according to English, if there is a long word that doesn't fit column width. Are there requirements that bound the data length for account names and their descriptions?

#430 Updated by Greg Shah almost 7 years ago

I did it but word wrapping by FOP is according to English

We cannot implement support that only works for English.

Are there requirements that bound the data length for account names and their descriptions?

I don't think we have previously put any limits here.

#431 Updated by Sergey Ivanovskiy almost 7 years ago

Ok, please look at this example as an example of word wraps, vertical lines will be added and column headers will be centred, page margin bound will be removed.

#432 Updated by Greg Shah almost 7 years ago

The word wrapping looks good.

Please do vertically center the drawing of the text in a row.

#433 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Ok, please look at this example as an example of word wraps, vertical lines will be added and column headers will be centred, page margin bound will be removed.

Do you handle the case when the word is longer then the column width?

#434 Updated by Sergey Ivanovskiy almost 7 years ago

Yes, I am testing and fixing the changes now, but it can do a word break in any place if the whole word is out of its cell, it can break a sentence by words. Don't know how to improve it.

#435 Updated by Sergey Ivanovskiy almost 7 years ago

Committed revision 11303 fixed report look and feel according to note 413 except a column heading is not bold. Please review.

#436 Updated by Greg Shah almost 7 years ago

It is very close.

1. It is good that the column headings are horizontally centered. But the row content should not be horizontally centered.

2. Please have the headings and all rows be vertically centered.

#437 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Committed revision 11303 fixed report look and feel according to note 413 except a column heading is not bold. Please review.

In DefaultCellRenderer.render() (and some other places), you catch all Exceptions and don't let the caller know that an error occurred. So in case of an error the end-user may not get any indication that the print failed. You should let the exception propagate up the call stack and catch it only when you can handle it (in this case the exception should be translated to an HTTP error and the exception should be logged with java.util.Logger).

#438 Updated by Sergey Ivanovskiy almost 7 years ago

You are correct. I will fix this issue.

#439 Updated by Sergey Ivanovskiy almost 7 years ago

Committed revision 11304 fixed reports look and feel and implemented reports for selected records, added display details report parameter to request extended reports.
The remaining issues are to handle IO exceptions inside consumers, to remove reports cache, to clear the preview widget before displaying a new report.

#440 Updated by Sergey Ivanovskiy almost 7 years ago

Committed revision 11305 added ReportServlet to handle print report requests.

#441 Updated by Sergey Ivanovskiy almost 7 years ago

Committed revision 11309 added ReportPreview, fixed preview pages count for the client report preview control. I think that all issues from 439 are fixed and the remaining task is to implement extended reports that is related to MAJIC client extensions. I didn't do this, but the port points are ready. They are ReportRequest.isDetailedReportRequest() and
there are two methods to implement for each report type

   protected abstract Stream<TRowObject> getDataStream();

   protected abstract List<AbstractReportBuilder.ColumnInfo<TRowObject>> getColumns();

#442 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Committed revision 11309 added ReportPreview, fixed preview pages count for the client report preview control. I think that all issues from 439 are fixed and the remaining task is to implement extended reports that is related to MAJIC client extensions. I didn't do this, but the port points are ready. They are ReportRequest.isDetailedReportRequest() and
there are two methods to implement for each report type
[...]

I will be soon committing the Majic extensions so that you can implement the Majic report menus.

#443 Updated by Hynek Cihlar almost 7 years ago

I have checked in changes to 3222a that implement Admin extensibility support.

Note that admin2/build.xml is deprecated, use the main gradle build instead. Specifically the tasks buildAdmin and serveAdmin to build and run Admin in super devmode.

#444 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek, I don't understand the Admin extensibility support design, thus I can't be helpful there. Do you plan to integrate these functionality into the existing reports: Users, Processes and Groups?

#445 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynek, I don't understand the Admin extensibility support design, thus I can't be helpful there. Do you plan to integrate these functionality into the existing reports: Users, Processes and Groups?

See #3266.

#446 Updated by Sergey Ivanovskiy almost 7 years ago

Planning to rebase 3222a within an hour.

#447 Updated by Sergey Ivanovskiy almost 7 years ago

3222a is updated up to the rev. 11315 over the current P2J rev. 11152.

#448 Updated by Hynek Cihlar almost 7 years ago

Sergey, tomorrow I will be committing a change that will purge the sources of the original Admin. Please plan accordingly.

#449 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek, I am planning to change internal static AbstractReportBuilder.PageCanvas to IPageCanvas interface. These changes will impact report builders since they use custom headers and sections. Will these changes impact your planned changes (purge of the sources of the original Admin) too? I can postpone this commit.

#450 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynek, I am planning to change internal static AbstractReportBuilder.PageCanvas to IPageCanvas interface. These changes will impact report builders since they use custom headers and sections. Will these changes impact your planned changes (purge of the sources of the original Admin) too? I can postpone this commit.

No problem, please go ahead.

#451 Updated by Hynek Cihlar almost 7 years ago

Sergey, the print reports of the original Admin don't seem to split columns to multiple pages. But when I print Users, let's say, in the new Admin, I get one column on the second page (this happens even in the landscape mode).

#452 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek Cihlar wrote:

Sergey, the print reports of the original Admin don't seem to split columns to multiple pages. But when I print Users, let's say, in the new Admin, I get one column on the second page (this happens even in the landscape mode).

Yes, the extended columns will not fit into the page width and are printed on the next pages, so if we place the next pages along horizontal it should look like one row placed on the several pages. From the original admin code it follows that the strings are cut to fit assigned columns widths and sum of all column's widths is fitted to the page.
I should check it but we can change the maximal column's widths and then they should squeeze into one page.

#453 Updated by Sergey Ivanovskiy almost 7 years ago

Planning to postpone all tasks for the next day. I committed changes for AbstractReportBuilder into 3222a and all custom reports into 3266a.

#454 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynek Cihlar wrote:

Sergey, the print reports of the original Admin don't seem to split columns to multiple pages. But when I print Users, let's say, in the new Admin, I get one column on the second page (this happens even in the landscape mode).

Yes, the extended columns will not fit into the page width and are printed on the next pages, so if we place the next pages along horizontal it should look like one row placed on the several pages. From the original admin code it follows that the strings are cut to fit assigned columns widths and sum of all column's widths is fitted to the page.
I should check it but we can change the maximal column's widths and then they should squeeze into one page.

Aren't the widths in the original Admin proportional? If the original Admin doesn't split columns to multiple pages, then I don't think we should do this either.

#455 Updated by Sergey Ivanovskiy almost 7 years ago

I will check this issue tomorrow. It seems that Pdf report is new for admin client and we can change it according to our plans.

#456 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

I will check this issue tomorrow. It seems that Pdf report is new for admin client and we can change it according to our plans.

The PDF report is a direct replacement for the print functionality of the original Admin client and it doesn't introduce a new business use case. As such we should stick to the original functionality, unless business decides otherwise.

#457 Updated by Hynek Cihlar almost 7 years ago

Greg, Eric, please do a functional review of the new Admin in the 3222a branch. The steps are: build as usual with gradlew all, run FWD server and open the url https://server-host:admin-port/admin.

#458 Updated by Hynek Cihlar almost 7 years ago

Sergey, please note that with my most recent set of changes in 3222a I have enabled https and changed the Admin's context to admin. The access URL is thus https://server-host:admin-port/admin. Also I have removed the https endpoint of the original Admin (although the sources are still present in the branch).

#459 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek Cihlar wrote:

Sergey, please note that with my most recent set of changes in 3222a I have enabled https and changed the Admin's context to admin. The access URL is thus https://server-host:admin-port/admin. Also I have removed the https endpoint of the original Admin (although the sources are still present in the branch).

It seems that Users reports is broken now the data is incorrectly provided. Did you check it?

#460 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynek Cihlar wrote:

Sergey, please note that with my most recent set of changes in 3222a I have enabled https and changed the Admin's context to admin. The access URL is thus https://server-host:admin-port/admin. Also I have removed the https endpoint of the original Admin (although the sources are still present in the branch).

It seems that Users reports is broken now the data is incorrectly provided. Did you check it?

Please be more specific. What are the steps, what is the expected outcome?

#461 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Hynek Cihlar wrote:

Sergey, please note that with my most recent set of changes in 3222a I have enabled https and changed the Admin's context to admin. The access URL is thus https://server-host:admin-port/admin. Also I have removed the https endpoint of the original Admin (although the sources are still present in the branch).

It seems that Users reports is broken now the data is incorrectly provided. Did you check it?

Please be more specific. What are the steps, what is the expected outcome?

I just looked at this screen and observed that the data were not correct there are no users report at all. The Users view screen displays only processes account Ids filled in the Account Id column. Please check this class UsersReportBuilder that you changed recently

   protected Stream<UserAccountData> getDataStream()
   {
      SecurityAdmin sa = AdminServerImpl.getSecurityAdmin();
      AccountReportsExtension ext = sa.getAccountReportsExtension();
      TaggedName[] accounts = AdminServerImpl.listProcesses();

      Object[] ctxt = new Object[]
      {
      0,    // record index
      0,    // row index
      null, // UserAccountData for current record
      };

      return Stream.generate(() ->
      {
         UserAccountData ad;
         int recIdx = (int) ctxt[0];
         int rowIdx = (int) ctxt[1];
         if (recIdx == 0 || rowIdx >= numExtendedRows)
         {
            rowIdx = 0;

            TaggedName tn = accounts[recIdx];
            String name = tn.getName();
            UserDef proc = AdminServerImpl.getUser(name);
            Serializable extDef = ext == null ? null : ext.getAccountExtData(name);
            ad = new UserAccountData(tn, proc, extDef);
            ctxt[2] = ad;

            recIdx++;
            ctxt[0] = recIdx;
         }
         else
         {
            ad = (UserAccountData) ctxt[2];
            ad = new UserAccountData(ad.tn, ad.userDef, ad.extDef);
            ad.extRowIndex = rowIdx;
         }

         rowIdx++;
         ctxt[1] = rowIdx;
         return ad;
       }).limit(accounts.length * Math.max(numExtendedRows, 1));
   }

#462 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

I just looked at this screen and observed that the data were not correct there are no users report at all. The Users view screen displays only processes account Ids filled in the Account Id column. Please check this class UsersReportBuilder that you changed recently
[...]

Fix checked in to 3222a.

#463 Updated by Greg Shah almost 7 years ago

(Quick) Functional Review

Overall, it is a very impressive result.

1. The login dialog is strangely aligned right up against the left side of the browser. It looks pretty strange and a user might question if the system is working properly. It would be better to center the login both horizontally and vertically on the page.

2. There should be some kind of header or title on the login page to explain to what system you are logging in. Perhaps using the FWD logo here might help.

3. On the Console -> Sessions screen, the pagination controls (left arrow, page numbers and right arrow) are displayed on the lower left and they overlay the action buttons.

4. On the Access Control by Account screen, it is not clear why the Effective View check-box is disabled. It looks enabled but when you try to click on it, the cursor switches to "not allowed".

5. How hard is it to make the menu fixed on the screen so that it always displays, even if you scroll a specific page down?

6. We will want to put the FWD logo on the top left corner of the menu bar.

7. On Add ACL Item, "Regexp Nature (Uncheck for Exact Nature)" should be changed to "Regexp Match (Uncheck for Exact Match)".

8. Let's add the FWD logo and the FWD version number to the About screen.

#464 Updated by Hynek Cihlar almost 7 years ago

Greg Shah wrote:

4. On the Access Control by Account screen, it is not clear why the Effective View check-box is disabled.

I tried to replicate the original behavior, but my impression of this was that this piece was a work in progress. Does anybody know what is the expected behavior of this checkbox?

It looks enabled but when you try to click on it, the cursor switches to "not allowed".

This is the default Bootstrap style for disabled check box. I can make it appear more grayed out, but then I would have to update all form inputs.

5. How hard is it to make the menu fixed on the screen so that it always displays, even if you scroll a specific page down?

I don't think this will be difficult.

Greg, what browser and version did you use?

#465 Updated by Hynek Cihlar almost 7 years ago

Sergey, could you take 1-3 and 6-8 of note 463?

#466 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek Cihlar wrote:

Sergey, could you take 1-3 and 6-8 of note 463?

Ok, these tasks:
1 - to centre the login form
2 - to add a header to the login form
3 - to remove pager control

6 - to add FWD logo to the menu bar
7 - to change this label "Regexp Nature (Uncheck for Exact Nature)" should be changed to "Regexp Match (Uncheck for Exact Match)"
8 - to add FWD logo and version to the about dialog.

#467 Updated by Greg Shah almost 7 years ago

This is the default Bootstrap style for disabled check box. I can make it appear more grayed out, but then I would have to update all form inputs.

This default is pretty confusing from a user perspective. I guess it is better to fix this.

Greg, what browser and version did you use?

'
Firefox 53.0.3 64-bit.

#468 Updated by Sergey Ivanovskiy almost 7 years ago

Sergey Ivanovskiy wrote:

Hynek Cihlar wrote:

Sergey, could you take 1-3 and 6-8 of note 463?

Ok, these tasks:
1 - to centre the login form
2 - to add a header to the login form
3 - to remove pager control

6 - to add FWD logo to the menu bar
7 - to change this label "Regexp Nature (Uncheck for Exact Nature)" should be changed to "Regexp Match (Uncheck for Exact Match)"
8 - to add FWD logo and version to the about dialog.

These issues are committed except version number for the About dialog. What is the version number for GWT FWD administration client? It seems that this functionality has not been developed.

#469 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

8 - to add FWD logo and version to the about dialog.

These issues are committed except version number for the About dialog. What is the version number for GWT FWD administration client? It seems that this functionality has not been developed.

Please create new method getVersionInfo in AdminService and get the version from it. The service method will get the version string from the Version class.

#470 Updated by Hynek Cihlar almost 7 years ago

Sergey, assuming you have no other priorities, when you finish your current tasks, please bring all your changes to the GCD source code standards. That is add the standard file headers and copyright notices, add javadocs and fix any formatting issues (line lenghts, brackets, line wrappings, etc.).

#471 Updated by Hynek Cihlar almost 7 years ago

In my most recent commit I have removed source codes of the original Admin and moved the admin2.* namespaces to admin.

Guys, please update ASAP, otherwise you will end up with conflicts.

#472 Updated by Hynek Cihlar almost 7 years ago

Sergey, the UI improvements look nice. I have one suggestion, though.

The text "FWD Administration Console" added to the top menu takes some of the horizontal space which increases the screen size at which point the menu area wraps to multiple lines. Menu wrapping takes the vertical space for the content below and it would be good to prevent it. The suggestion is to remove the "FWD Administration Console" text from the menu area (leaving the logo there) and to put the removed text to the home screen (formatted as Boostrap jumbotron for example) with the FWD logo. This will save the space in the top menu while still provide the information to the user that he has logged in to "FWD Administration Console".

#473 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek Cihlar wrote:

Sergey, the UI improvements look nice. I have one suggestion, though.

The text "FWD Administration Console" added to the top menu takes some of the horizontal space which increases the screen size at which point the menu area wraps to multiple lines. Menu wrapping takes the vertical space for the content below and it would be good to prevent it. The suggestion is to remove the "FWD Administration Console" text from the menu area (leaving the logo there) and to put the removed text to the home screen (formatted as Boostrap jumbotron for example) with the FWD logo. This will save the space in the top menu while still provide the information to the user that he has logged in to "FWD Administration Console".

Adding "FWD Administration Console" on the top of the menu should not affect the case when the menu items wraps to lines. May be I lost something but the occupied space is not used by the menu. I only increased the height of the menu by applying this style

.navbar-header {
   height: 72px;
}

I have only one remark to your design. Is it correct to place two logo icons on the main screen if one of these is used by the navigation menu and the second one is used by Boostrap jumbotron. UI styles and good look&feel are not my area of interest thus any help will be appreciated here.

#474 Updated by Sergey Ivanovskiy almost 7 years ago

Committed revision 11365 added AdminService.getVersionInfo. Planning to fix src according to the GCD source code standards.

#475 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek, is it correct that ant-jar task of build.xml excludes first childs of client

     <jar jarfile="${build.home}/lib/p2j.jar" 
          basedir="${build.home}/classes.aop" 
          includes="com/goldencode/**
                      rules/**
                      *.dtd
                      *.xml
                      *.properties
                      *.ico" 
          excludes="com/goldencode/p2j/spi/*
                    com/goldencode/p2j/admin/client/*
                    com/goldencode/p2j/SpiVersion.class" 
          manifest="${manifest.dir}/p2j.mf" 
     />

#476 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynek, is it correct that ant-jar task of build.xml excludes first childs of client
[...]

Yes, it is correct to exclude the compiled Java classes in com.goldencode.p2j.admin.client. These are no longer used during runtime and neither during admin extension build as the gwt compiler uses Java sources. In my most recent commit I changed this line to remove the whole package, among other things.

#477 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Adding "FWD Administration Console" on the top of the menu should not affect the case when the menu items wraps to lines. May be I lost something but the occupied space is not used by the menu. I only increased the height of the menu by applying this style

I am attaching two screenshots to illustrate what I meant. Both screen shots show the same screen size, but the one with the extra text in the menu area takes more vertical space.

[...]
I have only one remark to your design. Is it correct to place two logo icons on the main screen if one of these is used by the navigation menu and the second one is used by Boostrap jumbotron. UI styles and good look&feel are not my area of interest thus any help will be appreciated here.

I am not sure if it is correct or not, but there is an empty content area after login, which could be filled with some usable content.

#478 Updated by Greg Shah almost 7 years ago

Adding "FWD Administration Console"

At least we can remove the text "FWD" since there is a logo right next to it.

#479 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek, I added java docs to accounts package except your classes developed for administration extension. Please could you add these java docs for ProcessAccountDefinition and UserAccountDefinition and related changes in this package.

#480 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynek, I added java docs to accounts package except your classes developed for administration extension. Please could you add these java docs for ProcessAccountDefinition and UserAccountDefinition and related changes in this package.

Sure, no problem.

#481 Updated by Sergey Ivanovskiy almost 7 years ago

Found that if another user from admins group tries to change the password to the admin user, then it is not possible to access to the admin user using this password, but it seems that the password has been changed in the directory xml to the new value. Don't know what is the root cause and I will postpone this issue for the next day.
Hynek, can you reproduce this issue. Trying to change admin password from another admins account makes admin account inaccessible.

#482 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Found that if another user from admins group tries to change the password to the admin user, then it is not possible to access to the admin user using this password, but it seems that the password has been changed in the directory xml to the new value. Don't know what is the root cause and I will postpone this issue for the next day.
Hynek, can you reproduce this issue. Trying to change admin password from another admins account makes admin account inaccessible.

Does it happen with the old Admin, too?

#483 Updated by Sergey Ivanovskiy almost 7 years ago

Don't know may be I have inconsistent directory or something else.

#484 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek, it seems that your commit revno: 11370 changed the layout of Print Preview, it is not correct now. If we open a preview page, then its bottom and its pager are out of the screen. Could we roll back to the layout that was used before?

#485 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynek, it seems that your commit revno: 11370 changed the layout of Print Preview, it is not correct now. If we open a preview page, then its bottom and its pager are out of the screen. Could we roll back to the layout that was used before?

Yes I did couple of changes so that the preview screen fits better to the parent layout structure. What in particular is not correct?

#486 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek, could you look at this exception that is thrown if we are trying to click on Print menu from users screen

[06/09/2017 18:26:04 MSK] (org.eclipse.jetty.server.handler.ContextHandler$Context:WARNING) Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract com.goldencode.p2j.admin.shared.ReportPreview com.goldencode.p2j.admin.shared.AdminService.getPreviewImages(com.goldencode.p2j.admin.shared.ReportRequest,com.google.gwt.view.client.Range) throws java.io.IOException' threw an unexpected exception: java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: com/goldencode/p2j/admin/client/application/home/ExtendedRowInfo
        at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:416)
        at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:605)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:333)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:303)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:373)
        at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1689)
        at com.goldencode.p2j.admin.server.AuthFilter.doFilter(AuthFilter.java:42)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at com.goldencode.p2j.admin.server.SynchronizeFilter.doFilter(SynchronizeFilter.java:34)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
        at org.eclipse.jetty.server.Server.handle(Server.java:518)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
        at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:186)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: com/goldencode/p2j/admin/client/application/home/ExtendedRowInfo
        at com.goldencode.p2j.admin.server.reports.UsersReportsBuilder.getColumns(UsersReportsBuilder.java:91)
        at com.goldencode.p2j.admin.server.reports.AbstractReportBuilder.buildReport(AbstractReportBuilder.java:179)
        at com.goldencode.p2j.admin.server.reports.AbstractReportBuilder.buildReport(AbstractReportBuilder.java:36)
        at com.goldencode.p2j.admin.server.reports.ReportsManager.buildPDFReportDocument(ReportsManager.java:99)
        at com.goldencode.p2j.admin.server.reports.ReportsManager.buildPDFPagePreview(ReportsManager.java:109)
        at com.goldencode.p2j.admin.server.AdminServiceImpl.getPreviewImages(AdminServiceImpl.java:1162)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:587)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:333)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:303)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:373)
        at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1689)
        at com.goldencode.p2j.admin.server.AuthFilter.doFilter(AuthFilter.java:42)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at com.goldencode.p2j.admin.server.SynchronizeFilter.doFilter(SynchronizeFilter.java:34)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
        at org.eclipse.jetty.server.Server.handle(Server.java:518)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
        at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:186)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: com/goldencode/p2j/admin/client/application/home/ExtendedRowInfo
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at com.goldencode.p2j.admin.server.reports.UsersReportsBuilder.getColumns(UsersReportsBuilder.java:91)
        at com.goldencode.p2j.admin.server.reports.AbstractReportBuilder.buildReport(AbstractReportBuilder.java:179)
        at com.goldencode.p2j.admin.server.reports.AbstractReportBuilder.buildReport(AbstractReportBuilder.java:36)
        at com.goldencode.p2j.admin.server.reports.ReportsManager.buildPDFReportDocument(ReportsManager.java:99)
        at com.goldencode.p2j.admin.server.reports.ReportsManager.buildPDFPagePreview(ReportsManager.java:109)
        at com.goldencode.p2j.admin.server.AdminServiceImpl.getPreviewImages(AdminServiceImpl.java:1162)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:587)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:333)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:303)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:373)
        at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1689)
        at com.goldencode.p2j.admin.server.AuthFilter.doFilter(AuthFilter.java:42)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at com.goldencode.p2j.admin.server.SynchronizeFilter.doFilter(SynchronizeFilter.java:34)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
        at org.eclipse.jetty.server.Server.handle(Server.java:518)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
        at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:186)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: com.goldencode.p2j.admin.client.application.home.ExtendedRowInfo
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at com.goldencode.p2j.admin.server.reports.UsersReportsBuilder.getColumns(UsersReportsBuilder.java:91)
        at com.goldencode.p2j.admin.server.reports.AbstractReportBuilder.buildReport(AbstractReportBuilder.java:179)
        at com.goldencode.p2j.admin.server.reports.AbstractReportBuilder.buildReport(AbstractReportBuilder.java:36)
        at com.goldencode.p2j.admin.server.reports.ReportsManager.buildPDFReportDocument(ReportsManager.java:99)
        at com.goldencode.p2j.admin.server.reports.ReportsManager.buildPDFPagePreview(ReportsManager.java:109)
        at com.goldencode.p2j.admin.server.AdminServiceImpl.getPreviewImages(AdminServiceImpl.java:1162)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:587)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:333)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:303)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:373)
        at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1689)
        at com.goldencode.p2j.admin.server.AuthFilter.doFilter(AuthFilter.java:42)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at com.goldencode.p2j.admin.server.SynchronizeFilter.doFilter(SynchronizeFilter.java:34)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
        at org.eclipse.jetty.server.Server.handle(Server.java:518)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
        at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:186)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
        at java.lang.Thread.run(Thread.java:748)

./gradlew all is done
But for the customer client this exception is not thrown.

#487 Updated by Sergey Ivanovskiy almost 7 years ago

I guessed that this interface

public interface ExtendedRowInfo
{
   int getExtendedRowIndex();
}

should be in shared package?

#488 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

I guessed that this interface
[...]
should be in shared package?

I think so.

#489 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek, it seems that these changes 11382 are not correct since the Back button doesn't work as a History button, but it should hide the current screen and moved to the parent view or to the initiator's view. But now it doesn't work as expected.

#490 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynek, it seems that these changes 11382 are not correct since the Back button doesn't work as a History button, but it should hide the current screen and moved to the parent view or to the initiator's view. But now it doesn't work as expected.

The original behavior of the Back button was displaying the empty Home screen, which is not the expected behavior that you mention: "hide the current screen and moved to the parent view or to the initiator's view". But IMHO moving back in history does exactly this, or does it work differently for you?

#491 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Hynek, it seems that these changes 11382 are not correct since the Back button doesn't work as a History button, but it should hide the current screen and moved to the parent view or to the initiator's view. But now it doesn't work as expected.

The original behavior of the Back button was displaying the empty Home screen, which is not the expected behavior that you mention: "hide the current screen and moved to the parent view or to the initiator's view". But IMHO moving back in history does exactly this, or does it work differently for you?

It doesn't work as expected if we open this view from the Home screen and the History.back() change only the url, but doesn't hide the "Server messages" view. It seems it works if we open the "Server messages" view from another view different from the main Home view.

Hynek, please update 3222a and 3266a and add your comments to report builders classes.

#492 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

It doesn't work as expected if we open this view from the Home screen and the History.back() change only the url, but doesn't hide the "Server messages" view. It seems it works if we open the "Server messages" view from another view different from the main Home view.

Right, but this is a problem of the Home screen view. It is similar as when you click on the top-left logo, the currently displayed content is not made invisible. This should be fixed by making the Home screen a full-featured presenter-view.

#493 Updated by Eric Faulhaber almost 7 years ago

Sorry if I missed this above somewhere: what are the default credentials for the new admin client with hotel_gui?

#494 Updated by Hynek Cihlar almost 7 years ago

Eric Faulhaber wrote:

Sorry if I missed this above somewhere: what are the default credentials for the new admin client with hotel_gui?

It is test123.

#495 Updated by Sergey Ivanovskiy almost 7 years ago

Please update 3222a (rev.11393) for important PDF reports fixes.

#496 Updated by Eric Faulhaber almost 7 years ago

Sergey Ivanovskiy wrote:

Please update 3222a (rev.11393) for important PDF reports fixes.

Ok. Is there anything left to do besides javadoc now?

#497 Updated by Sergey Ivanovskiy almost 7 years ago

Eric Faulhaber wrote:

Sergey Ivanovskiy wrote:

Please update 3222a (rev.11393) for important PDF reports fixes.

Ok. Is there anything left to do besides javadoc now?

It seems that there are only javadocs and unknown bugs.

#498 Updated by Sergey Ivanovskiy almost 7 years ago

Hynek, it seems that you forgot to remove EditSubjects* from ACLModule. Now 3222a doesn't pass the gradlew compilation.

[ant:javac] /home/sbi/projects/3222a/src/com/goldencode/p2j/admin/client/application/home/acl/ACLModule.java:27: error: cannot find symbol
[ant:javac]       bindPresenter(EditSubjectsPresenter.class,
[ant:javac]                     ^
[ant:javac]   symbol:   class EditSubjectsPresenter
[ant:javac]   location: class ACLModule
[ant:javac] /home/sbi/projects/3222a/src/com/goldencode/p2j/admin/client/application/home/acl/ACLModule.java:28: error: package EditSubjectsPresenter does not exist
[ant:javac]                     EditSubjectsPresenter.MyView.class,
[ant:javac]                                          ^
[ant:javac] /home/sbi/projects/3222a/src/com/goldencode/p2j/admin/client/application/home/acl/ACLModule.java:29: error: cannot find symbol
[ant:javac]                     EditSubjectsView.class,
[ant:javac]                     ^
[ant:javac]   symbol:   class EditSubjectsView
[ant:javac]   location: class ACLModule
[ant:javac] /home/sbi/projects/3222a/src/com/goldencode/p2j/admin/client/application/home/acl/ACLModule.java:30: error: package EditSubjectsPresenter does not exist
[ant:javac]                     EditSubjectsPresenter.MyProxy.class);

#499 Updated by Hynek Cihlar almost 7 years ago

Sergey Ivanovskiy wrote:

Hynek, it seems that you forgot to remove EditSubjects* from ACLModule. Now 3222a doesn't pass the gradlew compilation.
[...]

Yes, please update to revision 11400.

#500 Updated by Eric Faulhaber over 6 years ago

Hynek, I'm looking through the 3222a code and doing some testing with the Hotel GUI app. I have two sessions open and I'm generating some record locks. The Session IDs all display as "bogus:0000", even though the sessionID for one of the locker's SessionToken is 4 and the other is 8. So, the record lock view is making it look like the same locker has two claims on each share lock, when actually these represent different lockers. There seems to be a defect in SessionToken.toString, which apparently was reworked for use with GWT, based on the comment "GWT String emulation doesn't support format(String, int)".

Although there seems to be a specific defect here, my question is more general: how do you debug Java code that's been translated with GWT? My understanding is that you do this in eclipse (as if the code was still Java), not in the browser as JavaScript. I am running the eclipse debugger in attach mode (i.e., attaching to a remote FWD server which is launched normally from the command line), and eclipse is not breaking on my breakpoint in the SessionToken.toString method. I suspect the remote attach is the problem, but what is the proper way to do this?

Sergey, I know you are working on something which is high priority and time sensitive, so please don't spend any time on this right now.

#501 Updated by Hynek Cihlar over 6 years ago

Eric Faulhaber wrote:

Hynek, I'm looking through the 3222a code and doing some testing with the Hotel GUI app. I have two sessions open and I'm generating some record locks. The Session IDs all display as "bogus:0000", even though the sessionID for one of the locker's SessionToken is 4 and the other is 8. So, the record lock view is making it look like the same locker has two claims on each share lock, when actually these represent different lockers. There seems to be a defect in SessionToken.toString, which apparently was reworked for use with GWT, based on the comment "GWT String emulation doesn't support format(String, int)".

I will look at this.

Although there seems to be a specific defect here, my question is more general: how do you debug Java code that's been translated with GWT? My understanding is that you do this in eclipse (as if the code was still Java), not in the browser as JavaScript. I am running the eclipse debugger in attach mode (i.e., attaching to a remote FWD server which is launched normally from the command line), and eclipse is not breaking on my breakpoint in the SessionToken.toString method. I suspect the remote attach is the problem, but what is the proper way to do this?

There are several ways to do this.

There are GWT plugins for Eclipse and Idea that allow to debug the translated code with a help of browser's extension. But since we embed the app in a non-standard fashion I am not sure how well this would work (I didn't try). So I don't use any GWT plugin, instead I just run the GWT app in a so called super devmode, which allows to step through the Java code in the standard Chrome devel tools (Ctrl + Shift + I).

Again, since the GWT app is embedded in the Jetty container and the project layout differs from the defaults, there are some steps needed to configure the GWT app into the super devmode. There is a text file admin/README.md which gives the steps how to do this. Let me know if you find the info in the text file not enough.

#502 Updated by Hynek Cihlar over 6 years ago

Hynek Cihlar wrote:

Again, since the GWT app is embedded in the Jetty container and the project layout differs from the defaults, there are some steps needed to configure the GWT app into the super devmode. There is a text file admin/README.md which gives the steps how to do this. Let me know if you find the info in the text file not enough.

Eric, I added an important piece of info into README.md: "Make sure that the server's classpath is setup such that it resolves the Admin resources compiled in `adminBuildDir` and not the GWT resources from `p2j.jar` if that is on the classpath, too."

#503 Updated by Eric Faulhaber over 6 years ago

Thank you, Hynek.

One other thing: does the admin web session time out silently at some point, but without logging the user out? I was logged into both the application (in two sessions) and the admin web app for some time (over an hour), but I wasn't active in any session. When I resumed using the web app, the Record Locks screen would no longer refresh -- it was showing the same list of locks that existed when I wrote up note 500, even though I had cleared all the locks in the application. Once I logged out and back into the admin web app, it displayed the appropriate, empty list of record locks.

#504 Updated by Hynek Cihlar over 6 years ago

Eric Faulhaber wrote:

Thank you, Hynek.

One other thing: does the admin web session time out silently at some point, but without logging the user out? I was logged into both the application (in two sessions) and the admin web app for some time (over an hour), but I wasn't active in any session. When I resumed using the web app, the Record Locks screen would no longer refresh -- it was showing the same list of locks that existed when I wrote up note 500, even though I had cleared all the locks in the application. Once I logged out and back into the admin web app, it displayed the appropriate, empty list of record locks.

Good question, the admin app currently uses the default servlet session settings of the embedded Jetty, which is an unlimited session age until the server restarts I believe. I will check what was the behavior of the original Admin applet client and change the GWT Admin accordingly.

#505 Updated by Eric Faulhaber over 6 years ago

As I continue to exercise the "Record Locks" screen, I have another question/comment, this time regarding the filter behavior.

The Filter button brings up a dialog that prompts for a filter, but it is not clear what should be entered there. It seems this is a text filter to match text anywhere in the table, regardless of column. Is there any other syntax of which the user should be aware? I apologize if I'm asking about behavior that matches that of the old applet; I am not that familiar with the old version.

Also, please note that the prompt reads, "Define the filtering specification below. Press the 'OK' button without any specification to remove any previous filter". There is no "OK" button, but rather a "Save" button, which was clearly the intended target. Perhaps we should change both the button and the prompt to use "Apply" instead?

#506 Updated by Eric Faulhaber over 6 years ago

Continuing my functional tour of the record locking features...

In the "Acquire Locks" view, when adding a record, the "Database" dropdown lists the "hotel" database twice for me. This doesn't seem to cause a functional problem, it is just a bit confusing.

#507 Updated by Hynek Cihlar over 6 years ago

Eric Faulhaber wrote:

As I continue to exercise the "Record Locks" screen, I have another question/comment, this time regarding the filter behavior.

The Filter button brings up a dialog that prompts for a filter, but it is not clear what should be entered there. It seems this is a text filter to match text anywhere in the table, regardless of column.
Is there any other syntax of which the user should be aware? I apologize if I'm asking about behavior that matches that of the old applet; I am not that familiar with the old version.

I am not sure how the filter worked in the original Admin/Locks and the new Locks screen is Sergey's domain, so I can't give a definite answer. But I believe the filter does a "contains" string match on all the columns.

Also, please note that the prompt reads, "Define the filtering specification below. Press the 'OK' button without any specification to remove any previous filter".

The prompts are taken from the original Admin and yes I agree they are not always descriptive enough.

There is no "OK" button, but rather a "Save" button, which was clearly the intended target. Perhaps we should change both the button and the prompt to use "Apply" instead?

Yes, "Apply" sounds the best.

#508 Updated by Eric Faulhaber over 6 years ago

Hynek Cihlar wrote:

There is no "OK" button, but rather a "Save" button, which was clearly the intended target. Perhaps we should change both the button and the prompt to use "Apply" instead?

Yes, "Apply" sounds the best.

In looking around a bit more, I see that "OK" is used in at least one other filter. I don't want to cause unnecessary, 11th-hour changes based on my limited testing. If "OK" is the standard used across filters, I'm good with using that instead of "Apply", so long as the prompt message is consistent.

#509 Updated by Eric Faulhaber over 6 years ago

I noticed that the current admin session itself is not included in the "Sessions" view. If I lock a record as admin, however, it shows up as such in the "Record Locks" view.

Perhaps this is consistent with the old implementation, and there is nothing to fix here; it just seemed peculiar.

#510 Updated by Hynek Cihlar over 6 years ago

Eric Faulhaber wrote:

I noticed that the current admin session itself is not included in the "Sessions" view.

The Sessions view shows the network sessions and since the Admin client talks to FWD server directly without the network layer it is not shown in the list. This is in contrary with the old Admin where its session was displayed.

#511 Updated by Hynek Cihlar over 6 years ago

Eric Faulhaber wrote:

In looking around a bit more, I see that "OK" is used in at least one other filter. I don't want to cause unnecessary, 11th-hour changes based on my limited testing. If "OK" is the standard used across filters, I'm good with using that instead of "Apply", so long as the prompt message is consistent.

Yes, "OK" should be used across the app in the filter dialogs.

#512 Updated by Eric Faulhaber over 6 years ago

  • Related to Feature #3307: enhance LockAdministrator implementation to collect info on sessions waiting to lock a record added

#513 Updated by Sergey Ivanovskiy over 6 years ago

Eric Faulhaber wrote:

Continuing my functional tour of the record locking features...

In the "Acquire Locks" view, when adding a record, the "Database" dropdown lists the "hotel" database twice for me. This doesn't seem to cause a functional problem, it is just a bit confusing.

The twice entries in the databases list DatabaseManager.getManagedDatabases() are created by databases that have its peer meta database. I don't know it is a correct to remove from this list meta databases or not. It seems that it is a design issue

=== modified file 'src/com/goldencode/p2j/admin/AdminServerImpl.java'
--- src/com/goldencode/p2j/admin/AdminServerImpl.java    2017-05-31 17:20:47 +0000
+++ src/com/goldencode/p2j/admin/AdminServerImpl.java    2017-07-06 16:48:50 +0000
@@ -728,7 +728,10 @@
       List<String> list = new ArrayList<String>();
       for (Database database : databases)
       {
-         list.add(database.getName());
+         if (!database.isMeta())
+         {
+            list.add(database.getName());
+         }
       }
       Collections.sort(list);

#514 Updated by Eric Faulhaber over 6 years ago

Sergey Ivanovskiy wrote:

Eric Faulhaber wrote:

Continuing my functional tour of the record locking features...

In the "Acquire Locks" view, when adding a record, the "Database" dropdown lists the "hotel" database twice for me. This doesn't seem to cause a functional problem, it is just a bit confusing.

The twice entries in the databases list DatabaseManager.getManagedDatabases() are created by databases that have its peer meta database. I don't know it is a correct to remove from this list meta databases or not. It seems that it is a design issue

I think your fix is ok, but I would suggest a better test would be if (database.isPrimary()) ....

I think the AdminServerImpl code was written before we added the notion of the metadata database peer. It may be ok to address this at DatabaseManager.getManagedDatabases, but that may have unexpected side effects elsewhere. Better to leave the fix in AdminServerImpl, I think.

#515 Updated by Sergey Ivanovskiy over 6 years ago

Ok, committed revision 11408.

#516 Updated by Eric Faulhaber over 6 years ago

Sergey, please rebase task branch 3222a to the latest trunk.

#517 Updated by Sergey Ivanovskiy over 6 years ago

Planning to rebase now.

#518 Updated by Sergey Ivanovskiy over 6 years ago

3222a was rebased over the latest trunk. The current rev becomes 11413. There were conflicts in build.xml, build.gradle and StandardServer.java. I tested this branch with Eclipse IDE, and it seems that build/classes.aop/com/goldencode/p2j/admin directory of the compiled admin web application should be added to the server classpath.

Hynek, could you please review this revision to be sure that the admin build system works as expected now.

#519 Updated by Sergey Ivanovskiy over 6 years ago

Committed revision 11414 added plain password field to the data transfer object UserDef. I tried to use SHA1 implementation of https://code.google.com/archive/p/crypto-js/ on the client side but didn't succeeded. It seems that the string "test" is encoded differently by this library and HashPassword I compared this output

var hash = $wnd.CryptoJS.SHA1(message);
console.log(hash.toString($wnd.CryptoJS.enc.Base64));

with java com.goldencode.p2j.security.HashPassword test test output. Finally, I decided to use the 11414 approach.
There is an issue that the SecurityCache is not cleaned after user accounts have been deleted by the administrator. And it needs to restart the server in order that new SecurityCache is applied. Investigating the root causes.

#520 Updated by Sergey Ivanovskiy over 6 years ago

Committed revision 11415 rolled back hashedPassword->password and changed password->plainPassword, added validators for CloneUserAccountView.

#521 Updated by Greg Shah over 6 years ago

We need to always hash the password on the FWD server side. Javascript is insecure and hashing there means that it can be improperly manipulated. In the end it is best that the JS library was not compatible.

Make sure that no traces of the plain text password remain referenced after it is hashed.

#522 Updated by Sergey Ivanovskiy over 6 years ago

Found that SecurityAdmin, SecurityManager have their own instances of SecurityCache. Are these instances must be point to the same object?

If accounts are updated, then usually SecurityAdmin.currentCache() is invoked. This method creates new security cache instance com.goldencode.p2j.security.SecurityCache@28548ee2 but SecurityManager (com.goldencode.p2j.security.SecurityCache@3bfb46c1) has its own instance that is used to check logged users.

Thus if a user account password is changed, then this user will not have an access to the system with this new changed password. The same is true for all account updates and deletions.

Do you have proposals to fix this issue?

#523 Updated by Sergey Ivanovskiy over 6 years ago

Sergey,

As I recall there in a menu option to refresh the security cache in the old admin, without having to restart the server. Do you have this in the new admin? If yes, please try it.

Thanks,

Constantin

#524 Updated by Sergey Ivanovskiy over 6 years ago

It seems that we didn't implement this menu to refresh the security cache. I will check the old admin for this functionality.

#525 Updated by Greg Shah over 6 years ago

Thus if a user account password is changed, then this user will not have an access to the system with this new changed password. The same is true for all account updates and deletions.

This is intended. I think what you are describing is the concept of our security cache "generations".

  • Each time the security-related portions of the directory are changed, the system must be notified to put those changes into use. We cannot do this with every edit, because an admin may have many changes to make that only work properly when everything is "committed" as a batch. When that notification occurs (directory "refresh"), a new cache generation is created.
  • All new sessions will use the cache generation that is at the top of the stack when the session is created.
  • Existing sessions always continue using the same cache generation that was active when the session started. Otherwise security decisions might change on the fly while code is running, leading to an unpredictable result (errors, abends or some kind of incorrect decision that allows access when it should not).
  • When all the sessions using a specific cache generation are gone, that cache generation is deleted. Over time, if there is suitable turnover of sessions, all the sessions will end up using the latest generation. If not, then it can be forced by restarting the server or by killing old sessions in the admin UI.

Once you have refreshed and logged off and back on, is there an issue? If not then we are OK.

#526 Updated by Greg Shah over 6 years ago

Sergey Ivanovskiy wrote:

It seems that we didn't implement this menu to refresh the security cache. I will check the old admin for this functionality.

This is pretty important!

#527 Updated by Sergey Ivanovskiy over 6 years ago

Greg Shah wrote:

Once you have refreshed and logged off and back on, is there an issue? If not then we are OK.

Yes, I changed password and then logged off and couldn't log in with new password, and it was possible to use new password only if the server had been restarted.
Thank you for describing the security cache concept. Planning to add this functionality to refresh the security cache.

#528 Updated by Sergey Ivanovskiy over 6 years ago

Committed revision 11416 added the security cache refresh functionality on Target>Refresh menu item. I checked that if the password is changed and Refresh has been executed, then the user can use this new updated password without restarting the server.

#529 Updated by Eric Faulhaber over 6 years ago

Hynek, I have a rudimentary understanding of the GWT module concept, but please add some documentation to each of the following files (beyond the abstract at the top) to clarify their individual purposes:

./src/com/goldencode/p2j/AdminRightsEditors.gwt.xml
./src/com/goldencode/p2j/admin/AdminAppBase.gwt.xml
./src/com/goldencode/p2j/admin/AdminApp.gwt.xml
./src/com/goldencode/p2j/AdminTypes.gwt.xml

Also, I'm not quite clear on why two are in the admin directory and the other two are in its parent directory.

#530 Updated by Eric Faulhaber over 6 years ago

Sergey, I've noticed in a number of files you have edited in this branch that you are using individual import statements for each class. Please note that our coding standards call for the use of the wildcard instead, except when resolving ambiguity conflicts. Since there is no functional impact, I don't think it's worth changing all of these places on their own, but if you are in a file making other changes anyway, please adjust the import statements to be consistent with the standard we use across the rest of the project.

#531 Updated by Sergey Ivanovskiy over 6 years ago

Ok, thanks for pointing this coding rule (handbook/coding_stds/format.html, Java import statements). I was sure that we use individual import statements anywhere or just don't specify the particular rule. All my code changes are already in 3222a waiting the code review.

#532 Updated by Hynek Cihlar over 6 years ago

Eric Faulhaber wrote:

Hynek, I have a rudimentary understanding of the GWT module concept, but please add some documentation to each of the following files (beyond the abstract at the top) to clarify their individual purposes:
[...]

I will add that.

Also, I'm not quite clear on why two are in the admin directory and the other two are in its parent directory.

This is due to the source code references in the xml files. The sources for the GWT compiler are declared as relative class paths and these can not go up in the class path hierarchy.

#533 Updated by Eric Faulhaber over 6 years ago

Missing javadoc:

AdminServerImpl.java:188
RecordInfo.java
RecordLockInfo.java
TaggedName.java:88-90 (not new code, but please add javadoc)
AbstractReportBuilder.java
ReportServlet.java
Description.java:101 (security package)
SecurityAdmin.java:4976
SecurityManager.java:2929 (nit-pick: while you're in there, please also remove new indent at 2923)
SessionToken.java:127,132

Missing header or header entry:

CertificateUtils.java
AdminApp.html

Missing AGPL license text and/or wrong copyright notice; should be the one which goes with AGPL (i.e., without "CONFIDENTIAL" and "ALL RIGHTS RESERVED"):

Acl.java
AdminApp.html
AdminHelper.java
AdminProfile.java
RecordLockType.java
TaggedNameHelper.java
AccountExtension.java
AccountExtensionHolder.java
AdminCallback.java
ClientModule.java
MultiCallback.java
...

Actually, there seem to be a lot of new files without license text. Please do another pass through all the new files and make sure they each have a header with the appropriate copyright notice and the usual AGPL license text, and are fully javadoc'd.

Other items:
  • TaggedName.IDX_LAST is not used anywhere, AFAICT. Looks like an old issue.
  • What does the comment "//noinspection NonJREEmulationClassesInClientCode" mean at TaggedName:150?
  • It looks to me like a potential regression was introduced in the logic in DirectoryCopy.selectiveCopy at lines 926-952: allClasses is updated at 943, but is no longer referenced at 944 and 952. Instead, classList is checked at 944 and 952, but it appears it would have the same state as it did in the previous checks at 927 and 935.
  • Is there a reason to deprecate getRightsEditorName across the various *Resource classes instead of remove it? Is it still referenced?
  • In AdminResource.java, we reference com.goldencode.p2j.security.AdminResourceNamespace.* in an import statement. Was this meant to be a static import? There are qualified calls to the static method AdminResourceNamespace.findPath in the class.
  • An import statement for BitSet was added to ConfigManager, but there were no accompanying code changes.

The last section is only a review of modified files. I will look more closely at new files next.

#534 Updated by Eric Faulhaber over 6 years ago

More coding standard issues I'm seeing across multiple files:
  • extends and implements keywords should be on next line after class or interface declaration, with no indentation.
  • This is not really a standard, but there is a standard which is very close and should be applied: for GWT native method definitions, place the opening "brace" (i.e., /*-{ notation) on the next line following the method declaration, rather than at the end of the declaration line.

So far, nearly every class I've looked at under the com.goldencode.p2j.admin.client.home.accounts package is missing significant javadoc. Even though much of the code appears be relatively straightforward UI code, some parts are not obvious. In any event, we need to maintain the standard of documentation we've set for the rest of the project. Much of the formatting is quite off our coding standards, as well. Were these classes machine-generated?

#535 Updated by Sergey Ivanovskiy over 6 years ago

Eric Faulhaber wrote:

More coding standard issues I'm seeing across multiple files:
  • extends and implements keywords should be on next line after class or interface declaration, with no indentation.

I will fix these cases.

  • This is not really a standard, but there is a standard which is very close and should be applied: for GWT native method definitions, place the opening "brace" (i.e., /*-{ notation) on the next line following the method declaration, rather than at the end of the declaration line.

I will fix these cases.

So far, nearly every class I've looked at under the com.goldencode.p2j.admin.client.home.accounts package is missing significant javadoc. Even though much of the code appears be relatively straightforward UI code, some parts are not obvious. In any event, we need to maintain the standard of documentation we've set for the rest of the project. Much of the formatting is quite off our coding standards, as well. Were these classes machine-generated?

I guess you mean undocumented UI annotated fields like these ones

   @UiField
   Modal modal;

   @UiField
   TextBox alias;

   @UiField
   FileUpload importPEMCert;

   @UiField
   TextArea pem;

   @UiField
   Button saveAction;

   @UiField
   Button cancelAction;

   private CertificatesOptions certificateOption;

I will fix these cases too.

#536 Updated by Sergey Ivanovskiy over 6 years ago

Eric Faulhaber wrote:

Missing AGPL license text and/or wrong copyright notice; should be the one which goes with AGPL (i.e., without "CONFIDENTIAL" and "ALL RIGHTS RESERVED"):
[...]
Actually, there seem to be a lot of new files without license text. Please do another pass through all the new files and make sure they each have a header with the appropriate copyright notice and the usual AGPL license text, and are fully javadoc'd.

Please point to the usage of AGPL in the trunc to fix these issues correctly.

#537 Updated by Eric Faulhaber over 6 years ago

Sergey Ivanovskiy wrote:

I guess you mean undocumented UI annotated fields like these ones

Yes, but also many methods, inner interfaces, inner classes, etc., i.e., everything we normally javadoc.

#538 Updated by Eric Faulhaber over 6 years ago

Sergey Ivanovskiy wrote:

Please point to the usage of AGPL in the trunc to fix these issues correctly.

See, for example:
  • src/com/goldencode/p2j/Version.java
  • src/com/goldencode/p2j/report/web/res/index.html (note the location in the HTML file)

#539 Updated by Eric Faulhaber over 6 years ago

Eric Faulhaber wrote:

Were these classes machine-generated?

Just curious -- were these made by an IDE plug-in or a GWT tool? I've noticed that "//noinspection NonJREEmulationClassesInClientCode" in more locations, so I'm wondering if this is auto-generated output.

#540 Updated by Sergey Ivanovskiy over 6 years ago

Don't know. Hynek, please could you help?

#541 Updated by Sergey Ivanovskiy over 6 years ago

Committed revision 11417 fixed java docs for the certificates package.

#542 Updated by Hynek Cihlar over 6 years ago

Eric Faulhaber wrote:

Eric Faulhaber wrote:

Were these classes machine-generated?

Just curious -- were these made by an IDE plug-in or a GWT tool? I've noticed that "//noinspection NonJREEmulationClassesInClientCode" in more locations, so I'm wondering if this is auto-generated output.

I am not sure whether Sergey used the GWT editors to create the source in note 535, but I would guess these were crafted manually. I didn't use any GWT editors myself.

As far as the NonJREEmulationClassesInClientCode goes, this is an "annotation" created by IntelliJ Idea. This tells the IDE to disable code inspections on the marked region of code. This was to prevent Idea to mark the files with errors when the code was referencing Java runtime APIs not present in earlier versions of GWT.

#543 Updated by Sergey Ivanovskiy over 6 years ago

Planning to rebase 3222a now.

#544 Updated by Sergey Ivanovskiy over 6 years ago

3222a was rebased, the current revision is 11422.

Hynek, do you agree if I will add java docs and headers to ProcessActionDefinition and UserActionDefinition?

#545 Updated by Eric Faulhaber over 6 years ago

Sergey Ivanovskiy wrote:

Hynek, do you agree if I will add java docs and headers to ProcessActionDefinition and UserActionDefinition?

I guess you mean ProcessAccountDefinition and UserAccountDefinition. Yes, please do. If something is not clear, please post specific questions for Hynek.

#546 Updated by Sergey Ivanovskiy over 6 years ago

Correct, java docs for these units were added by committed revision 11425.

#547 Updated by Sergey Ivanovskiy over 6 years ago

The all code is large enough and some java docs can be missed now. The accounts package has been filled with missed java docs. Now looking for another missed java docs.

#548 Updated by Sergey Ivanovskiy over 6 years ago

Found that AcquiredLocks* classes have no java docs but it seems that I added them before. Also RecordLocks* classes have no java docs. Somehow they were missed. Adding them too.

#549 Updated by Sergey Ivanovskiy over 6 years ago

Hynek, could you please send me your local 3222a branch diff against the current 3222a branch diff if you haven't updated it yet?

#550 Updated by Hynek Cihlar over 6 years ago

Sergey Ivanovskiy wrote:

Hynek, could you please send me your local 3222a branch diff against the current 3222a branch diff if you haven't updated it yet?

Is there anything particular you are looking for? Can this be looked up from the bzr repo?

#551 Updated by Sergey Ivanovskiy over 6 years ago

No, I think, because the rebase has been done with push overwrite if you haven't updated it yet after the branch has been rebased against the current 11156, 11157, 11158?

#552 Updated by Sergey Ivanovskiy over 6 years ago

I am suspecting that some java docs at least were lost.

#553 Updated by Hynek Cihlar over 6 years ago

Sergey Ivanovskiy wrote:

I am suspecting that some java docs at least were lost.

I checked AcquiredLocks* and RecordLocksPresenter*, but didn't find any diffs there.

#554 Updated by Sergey Ivanovskiy over 6 years ago

Ok, thank you. It seems that they were not added at all. I suppose that you didn't update 3222a after my rebases.

#555 Updated by Hynek Cihlar over 6 years ago

Sergey Ivanovskiy wrote:

I suppose that you didn't update 3222a after my rebases.

I did, but I keep history in a local git repo.

#556 Updated by Sergey Ivanovskiy over 6 years ago

Committed revision 11428 fixed java docs for com.goldencode.p2j.admin.client.application.home.console package. Looking for another undocumented methods and modules in com.goldencode.p2j.admin.client. There are undocumented methods in com.goldencode.p2j.admin.server.reports.

#557 Updated by Sergey Ivanovskiy over 6 years ago

Committed revision 11429 fixed java docs for com.goldencode.p2j.admin.client.application.home.print and com.goldencode.p2j.admin.client.application.home.help packages.

#558 Updated by Sergey Ivanovskiy over 6 years ago

It seems that this Eclipse tool https://sourceforge.net/projects/jautodoc/ is helpful to add java docs automatically. If there are java docs for fields, then it can generate setters and getters java docs.

#559 Updated by Sergey Ivanovskiy over 6 years ago

Committed revision 11430 fixed missed java doc for server report package. Rebasing the branch now.

#560 Updated by Sergey Ivanovskiy over 6 years ago

3222a is rebased rev. 11431 over the current trunk 11159.

#561 Updated by Sergey Ivanovskiy over 6 years ago

3222a is rebased rev 11433 over the current trunk 11160.

#562 Updated by Sergey Ivanovskiy over 6 years ago

Committed revision 11434 fixed some of missed headers and java docs. Rebasing now.

#563 Updated by Sergey Ivanovskiy over 6 years ago

Rebased up to rev 11436 over the current trunc 11162.

#564 Updated by Sergey Ivanovskiy over 6 years ago

Committed rev 11441 was rebased over the trunc rev 11164 and fixed javadoc warnings.

#565 Updated by Hynek Cihlar over 6 years ago

The Admin part of the FWD build takes considerable amount od time relatively to the rest while the GWT compiler doesn't care whether any of the source files have not changed. This results in significant build time increase even when there is no change to the sources. I am wondering whether we should run the Admin build conditionally (i.e. with a cli parameter).

#566 Updated by Greg Shah over 6 years ago

This results in significant build time increase even when there is no change to the sources.

On average, how much is the increase?

I am wondering whether we should run the Admin build conditionally (i.e. with a cli parameter).

We probably should do this. I haven't decided the approach I prefer.

Our intention is to enhance the admin console over time to increase the features available such that most customers would find it useful for helping to manage their FWD servers. And I can see that most customers will not need to build very often. In these cases, I see a negative in making it harder to build correctly. Specifying a command line option is less attractive for this scenario.

On the other hand, during development builds adding significant time should be avoided. How about adding an ant target like core which would build without the GWT portions? Thus, the normal ant all would work for customers in a very simple way. But for developers, the normal dev path would use ant core.

#567 Updated by Greg Shah over 6 years ago

Sorry, that should have been gradle, not ant. Not sure where my mind is...

#568 Updated by Hynek Cihlar over 6 years ago

Greg Shah wrote:

On average, how much is the increase?

On my i5-6440HQ the Admin build target takes 84 seconds.

On the other hand, during development builds adding significant time should be avoided. How about adding an ant target like core which would build without the GWT portions? Thus, the normal ant all would work for customers in a very simple way. But for developers, the normal dev path would use ant core.

In this case Gradle already offers a convenient mechanism to exclude particular targets. With the -x cli parameter one can specify the target to exclude, so

./gradlew all -x buildAdmin

will build the "core" without Admin. But if you think the core target would still be needed I will add it.

#569 Updated by Greg Shah over 6 years ago

will build the "core" without Admin. But if you think the core target would still be needed I will add it.

Yes, please do add the core target to make it easier for developers.

#570 Updated by Constantin Asofiei over 6 years ago

I'm adding the coding standard issues here, all are in FWD code.

Sergey: I think most of them are yours, can you please take them?

Missing history entry header:
  1. RemoteEntryPointRightsEditor
  2. TwoURLsResource
Imports must use * and not individual classes:
  1. AdminServerImpl
  2. admin/client/ClientModule
  3. admin/shared/AdminService
  4. admin/server/reports/AbstractReportBuilder
  5. admin/server/reports/ReportsManager
  6. admin/server/AdminServiceImpl
  7. admin/server/ReportServlet
  8. admin/client/widget/dialog/ModalViewWithUiHandlers
  9. admin/client/widget/CustomComboBox
  10. admin/client/widget/EnumRadioGroup
  11. admin/client/application/login/LoginView
  12. admin/client/application/home/HomeModule
  13. admin/client/application/home/BulkAuthModeUpdateView
  14. admin/client/application/home/BaseViewWithUiHandlers
  15. admin/client/application/home/BasePresenter
  16. admin/client/application/home/AsyncAction
  17. admin/client/application/home/AboutDialogView
  18. admin/client/application/home/accounts/AccountsUiHandlers
  19. admin/client/application/home/accounts/AccountsPresenter
  20. admin/client/application/home/accounts/AccountsModule
  21. admin/client/application/home/accounts/AccountsConstants
  22. admin/client/application/home/accounts/certificates/CertificatesView
  23. admin/client/application/home/accounts/certificates/CertificatesUIHandlers
  24. admin/client/application/home/accounts/certificates/CertificatesPresenter
  25. admin/client/application/home/accounts/certificates/CertificateDetailsView
  26. admin/client/application/home/accounts/certificates/CertificateDefinitionView
  27. admin/client/application/home/accounts/groups/UnassigningUsersAlert
  28. admin/client/application/home/accounts/groups/GroupsView
  29. admin/client/application/home/accounts/groups/GroupsPresenter
  30. admin/client/application/home/accounts/groups/GroupDefinitionView
  31. admin/client/application/home/accounts/groups/DeletingGroupsAlert
  32. admin/client/application/home/accounts/groups/CloneGroupView
  33. admin/client/application/home/accounts/processes/ProcessesView
  34. admin/client/application/home/accounts/processes/ProcessesPresenter
  35. admin/client/application/home/accounts/processes/CloneProcessView
  36. admin/client/application/home/accounts/users/UsersView
  37. admin/client/application/home/accounts/users/UsersPresenter
  38. admin/client/application/home/accounts/users/RemovingGroupsAlert
  39. admin/client/application/home/accounts/users/FindUserAccountView
  40. admin/client/application/home/accounts/users/DeletingUsersAlert
  41. admin/client/application/home/accounts/users/CloneUserAccountView
  42. admin/client/application/home/accounts/console/ConsoleModule
  43. admin/client/application/home/accounts/console/acquiredlocks/AddRecordLockView
  44. admin/client/application/home/accounts/console/acquiredlocks/AcquiredLocksView
  45. admin/client/application/home/accounts/console/acquiredlocks/AcquiredLocksUIHandler
  46. admin/client/application/home/accounts/console/acquiredlocks/AcquiredLocksPresenter
  47. admin/client/application/home/accounts/console/recordlocks/RecordLocksView
  48. admin/client/application/home/accounts/console/sessions/TerminateSessionAlert
  49. admin/client/application/home/accounts/console/sessions/SessionView
  50. admin/client/application/home/accounts/console/sessions/FilterSessionsView
  51. admin/client/application/home/accounts/console/help/ServerMessagesView
  52. admin/client/application/home/accounts/console/help/ServerMessagesPresenter
  53. admin/client/application/home/accounts/console/print/PrintPreviewView
  54. admin/client/application/home/accounts/console/print/PrintPreviewUiHandlers
  55. admin/client/application/home/accounts/console/print/PrintPreviewPresenter
Missing or invalid javadoc:
  1. look for (non-Javadoc) and replace the javadoc with {@inheritDoc}
  2. AdminHelper: buildCertificateTreeNodes, getPropertyLabel
  3. NameTokes: getTokenParameter
  4. ReportRequest - equals and hashCode
  5. AccountsReportBuilder - header, footer, showExtendedColumns, numExtendedRows, AccountsReportBuilder c'tor, getPreviewPageNumber, getReportFooter, createFilterPredicate
  6. AdminServiceImpl - methods starting from line 2055 to line 2330
  7. admin/client/widget/dialog/InputDialog - setTranslationMap
  8. admin/client/widget/dialog/ModaDialogs - showError
  9. admin/client/widget/CustomComboBox - most of the class members don't hava javadocs
  10. admin/client/widget/EnumRadioGroup - most of the class members don't hava javadocs
  11. admin/client/widget/GridHelper - updateDataProvider
  12. admin/client/widget/IntegerValidator - IntegerValidator c'tor
  13. admin/client/application/home/ViewStateMachineImpl - ViewStateMachineImpl c'tor
  14. admin/client/application/home/accounts/SecuritySelectorOptions - most of the enum
  15. admin/client/application/home/accounts/PasswordOptions
  16. admin/client/application/home/accounts/CertificateValidity
  17. admin/client/application/home/accounts/CertificatesOptions
  18. admin/client/application/home/accounts/AuthModes
  19. admin/client/application/home/accounts/AccountType
  20. admin/client/application/home/accounts/AccountsPresenter - AccountsPresenter c'tor
  21. admin/client/application/home/accounts/AccountsModule
  22. admin/client/application/home/accounts/AccountsConstants
  23. admin/client/application/home/accounts/certificates/CertificatesPresenter - updateCerts - all 3 versions, addCA, addNewCertificate, updateProcessAccounts, updateCertificateHierarchyAccounts, nextCertToDelete
  24. admin/client/application/home/accounts/groups/GroupsPresenter - updateGroupsList, updateUsersInGroup, cancelUnassigningUsersAlert

#571 Updated by Sergey Ivanovskiy over 6 years ago

Working to fix the issues listed in 570.

#572 Updated by Sergey Ivanovskiy over 6 years ago

Fixing the import statements is not very valuable because we use the Bootstrap GWT UI library, GWT and Guava that have ambiguous classes with Java runtime and P2J. Although in some cases the import statements become more compact.

#573 Updated by Sergey Ivanovskiy over 6 years ago

6. AdminServiceImpl - methods starting from line 2055 to line 2330

These methods are not implemented by AdminServerImpl and their descriptions aren't provided. I can only write this phrase "Defines its stub method".

#574 Updated by Sergey Ivanovskiy over 6 years ago

Committed revision 11445 fixed java doc issues from the 570 note except the issue 6.

#575 Updated by Hynek Cihlar over 6 years ago

Eric Faulhaber wrote:

Other items:
  • TaggedName.IDX_LAST is not used anywhere, AFAICT. Looks like an old issue.

IDX_LAST removed.

  • It looks to me like a potential regression was introduced in the logic in DirectoryCopy.selectiveCopy at lines 926-952: allClasses is updated at 943, but is no longer referenced at 944 and 952. Instead, classList is checked at 944 and 952, but it appears it would have the same state as it did in the previous checks at 927 and 935.

Great eye! This is fixed.

  • Is there a reason to deprecate getRightsEditorName across the various *Resource classes instead of remove it? Is it still referenced?

getRightsEditorName and related were removed.

  • In AdminResource.java, we reference com.goldencode.p2j.security.AdminResourceNamespace.* in an import statement. Was this meant to be a static import? There are qualified calls to the static method AdminResourceNamespace.findPath in the class.

The import is required to bring into scope some nested classes.

  • An import statement for BitSet was added to ConfigManager, but there were no accompanying code changes.

The import is needed, this is to disambiguate BitSet.

#576 Updated by Hynek Cihlar over 6 years ago

Eric Faulhaber wrote:

Hynek, I have a rudimentary understanding of the GWT module concept, but please add some documentation to each of the following files (beyond the abstract at the top) to clarify their individual purposes:
[...]

More doc added.

Also, I'm not quite clear on why two are in the admin directory and the other two are in its parent directory.

The modules must reside in parent dir of the referenced dirs/resources.

#577 Updated by Hynek Cihlar over 6 years ago

3222a was merged to trunk rev 11166 and was archived.

#578 Updated by Sergey Ivanovskiy over 6 years ago

Created 3222b branch over rev 11167 at least for performance fixes related to building pdf reports.

#579 Updated by Hynek Cihlar over 6 years ago

3222b revision 11168 fixes javadoc build target failing on Windows due to the Windows command line length limitation.

Please review.

#580 Updated by Greg Shah over 6 years ago

Code Review Task Branch 3222b Revision 11168

I'm fine with the change. You can merge to trunk.

#581 Updated by Hynek Cihlar over 6 years ago

3222b merged to trunk as revision 11168 and archived.

#582 Updated by Sergey Ivanovskiy over 6 years ago

Tested implementation of IPageCanvas with jPod library. Planning to develop this within 3222c.

#583 Updated by Sergey Ivanovskiy over 6 years ago

Sergey Ivanovskiy wrote:

Tested implementation of IPageCanvas with jPod library. Planning to develop this within 3222c.

Working on dual library supports. The preview functionality should use PDFBox renderer to convert a PDF document into a PNG image and to deliver it to the client. But the printing/downloading functionality should use jPod library since it can build large pdf reports with the default memory settings. It seems there are no restrictions to add this dual library support.

#584 Updated by Hynek Cihlar over 6 years ago

Sergey Ivanovskiy wrote:

Sergey Ivanovskiy wrote:

Tested implementation of IPageCanvas with jPod library. Planning to develop this within 3222c.

Working on dual library supports. The preview functionality should use PDFBox renderer to convert a PDF document into a PNG image and to deliver it to the client. But the printing/downloading functionality should use jPod library since it can build large pdf reports with the default memory settings. It seems there are no restrictions to add this dual library support.

Can jPod render PNG images, too? If so I think it would be better to replace PDFBox with jPod, too. (1) The rendered outputs could differ for both libs and (2) it will be easier to support only one lib.

#585 Updated by Greg Shah over 6 years ago

Can jPod render PNG images, too? If so I think it would be better to replace PDFBox with jPod, too. (1) The rendered outputs could differ for both libs and (2) it will be easier to support only one lib.

I agree with this.

On a separate topic: the src/com/goldencode/p2j/admin/package.html is now quite out of date. It contains a discussion of the applet version.

I'm going to create a separate task for each of these items. We will fix them later and close this task now.

#586 Updated by Sergey Ivanovskiy over 6 years ago

Hynek Cihlar wrote:

Sergey Ivanovskiy wrote:

Sergey Ivanovskiy wrote:

Tested implementation of IPageCanvas with jPod library. Planning to develop this within 3222c.

Working on dual library supports. The preview functionality should use PDFBox renderer to convert a PDF document into a PNG image and to deliver it to the client. But the printing/downloading functionality should use jPod library since it can build large pdf reports with the default memory settings. It seems there are no restrictions to add this dual library support.

Can jPod render PNG images, too? If so I think it would be better to replace PDFBox with jPod, too. (1) The rendered outputs could differ for both libs and (2) it will be easier to support only one lib.

Yes, agree. According to this licence restriction

The jPod library is governed by the following license, allowing free use in 
open source and commercial projects.

Be aware that jPodRenderer, the rendering engine built on top of jPod  is NOT governed
by a BSD, but by a GPL license! 

jPodRenderer can't be used. we can try to develop our own renderer or can use PDFBox renderer. I postponed this task according 3110i and the next priorities.

#587 Updated by Greg Shah over 6 years ago

  • Related to Bug #3338: performance of large report PDF generation in admin UI is very slow added

#588 Updated by Greg Shah over 6 years ago

  • Related to Support #3339: rework the admin UI package javadoc to match the current advin v2 implementation added

#589 Updated by Greg Shah over 6 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF