Yes, you get it right. This was looking as easy path at beginning. I was new in SmartClient library and also SmartGWT was only in development. SmartClient is PURE javascript library which allow you to do a lot of tricks just with declarations or JavaScript callback. SmartGWT is in reality only Java bind above this powerful javascript library. My GUI extends little bit possibilities of SmartClient library. At first it ask server about menu (via getMenu service). Server do some tricky stuff and return structure of menu and actions available on this menu item. Together with this information also information about something called DataSource is hooked to every menu item. Than structure of Data is also fetched from Server in form of DataSource definitions. One DataSource for every entity. Of course model of menu, DataSource and field definition exist, and is written in sculptor ;-). DataSource is very fundamental object in SmartClient and attributes on this define behavior of fields in DataSource, Grid and also on Detail form. DataSource is unbelievable powerful. It's responsible for paging, lazy column fetching, cleaning memory, automatic client side sorting and filtering when all data are fetched. It's using specific protocol for communicating with server and can read data from JSON object, XML or anything what you can parse in JavaScript with your own methods. For better understanding how powerful it is I would like announce that it has more than 300 attributes for customizing behavior (now I'm using maybe 30). You can see some tricks here: http://www.smartclient.com/smartgwt/showcase/#grid_sortfilter_filter or investigate any other features under Grids or Forms sub-menu. I would like to introduce also Trees in next version via child<->parent relations. All this complex and complicated GUI stuff is solved by SmartClient. And all this is LGPL and even free support is very good from SmartClient. This guys are always nice and I recommend everybody to buy at least one license to support them.
Customization: I have to rethink once more your ideas (I need time and I will come with something final) but current status is: * Menu and action customization is achieved with "Decorators". You can write your own class which could enrich or strip menu items. For now for example we are using it for inserting reports directly to specific services as actions. Also 'Debug' button in detail is introduced with DebugDecorator. * Service access/visibility is customizable with security * ListGrid columns are customizable directly in application and administrator can save them as 'default' for others. He can also introduce new calculated columns. Saving grid layout is turned off in demo but customization is possible. * I would like to build for customization some simple extension which allow override default values or introduce new one. Servlet generates now simple pieces of JSON e.g.: {attr1: 'value', attr2: 'value'} and I will allow to postfix every object with your own definition like "attr1:'anotherVal', attr3:'val'" which will override attr1 because in javascript last win. This postfixes will be stored on server maybe directly in database and you can touch this way GUI behaviour. * If you need some specific screen or dialog you have to code it in Decorator as javascript string or jump to my GUI and write something here in Java GWT. Our ReportDecorator is generating full Dialog with fields as JavaScript which after filling form and pressing OK button open new window with report. I attached this javascript to give you feeling. You can go to demo press "Debug" button in detail screen, paste attached text there and "Run script", you will see result. It's important to understand that in this architecture stuff which you normally build in web server is now done directly in browser with Javascript or SmartGWT. My servlet is only "simple" bridge between service layer and browser. It converts JavaObject to JSON and back. And it understand SC DataSource protocol. I like dynamically generated definitions because this way admin can for example "shutdown" service and I plan to support some commands on client side like: * Disable menu item/service * Show dialog/warning which can be used for driving user from server by technical conditions or admin. I have also some ideas about middleware DSL and what we should support. BUUUT before this we have to all agree about features which we can support on all generated GUIs like status support, different actions support, security, ... . It will be nice to have this common set of features which can be generated in all GUIs. Should we setup some matrix about this? Hope this bring some light to topic. TNX again for your ideas for customization, I will think about this. Don't hesitate to ask anything. I would really like to develop something useful, not only for our company, but for everybody. Pavel On Mon, Jun 29, 2009 at 10:32 PM, Patrik Nordwall<patrik.nordw...@gmail.com> wrote: > > I'm impressed. Now I think I understand what you have developed. Is this > understanding correct? In runtime (startup) your servlet analyzes the > classes and configuration in business tier jar file. From that information > it builds a SmartGWT GUI using the SmartClient Java Script API (or is it > Java?). > > Customization is interesting/important. I see several options. Let us > discuss. > > Your servlet could be customized in one of these ways: > 1. You define a model (POJOs) that can be populated with customization data. > The servlet use the information in the instantiated model to build the GUI. > 2. You define an ordinary API that can be used to customize the servlet. > 3. You define an Internal DSL (fluent API) that can be used to customize the > servlet. > > Sculptor GUI DSL is a natural input for the customization, but there should > also be possibility to add hand written code/configuration. How to use the > information in the GUI DSL? > a) You could generate java code (one of the options 1-3) above > b) You could generate xml that is used to populate option 1 above > c) You could parse Sculptor DSLs in runtime (using oAW) and customize the > servlet in runtime (no code generation) > > My opinion with very limited insight in everything. > I think 1 combined with a) would be good. Maybe you already have a nice > separation of the reflection/config analyze step from the GUI building? > Maybe you already have such an model? > > c) is interesting, since it removes the code generation step, but I think it > adds more complexity (and runtime dependencies). > > /Patrik > > > PaloT wrote: >> >> Hello, >> SmartClient frontend sample generated from attached >> model-library.design is available at: >> >> http://f4.rainside.sk:8080/library >> >> It's not optimized (not compression, GWT with 'pretty' option, slow >> connection). First load should take sometimes 40-50 sec. 2nd time >> should be faster. Everything what you see is coming from default code >> generated by Sculptor entity tier. No GUI definition, additional code >> or something was written. >> >> Technical details: >> SC client is now using extensively all dirty tricks available in Java. >> Reflection, Spring context investigation, Hibernate mapping parsing, >> ... . WEB Client doesn't contain any business specific code which is >> written or generated. Only sculptor generated entity JAR file is >> dropped to web project. Everything else is done on the fly. >> >> Working features: >> * Hibernate definition (datatype, length, required, relations, ...) >> investigated on the fly >> * Spring services investigated on the fly (GUI strictly follow service >> definition) >> * Additional annotations for services for customizing behavior >> * Layout change (2 layouts) >> * Skin change (5 skins) >> * Language change >> * Status field handling (IfStatus actions, DetailBehavior, ...) >> * Translation file (have no time writing one for demo, only generated >> texts) >> * Grid/List layout saving (computed columns, column reordering, column >> sizes - right click on table header) - saving status is turned off in >> demo (require special service and entity) >> * Client side filtering, ordering >> * Lazy loading in lists on client side and paging in servlet >> * Error handling >> >> Unresolved problems: >> * Inheritance and abstract classes don't work very well - in queue >> * How to do customization :-D (expecting discusion about this, >> specially if (and what) we should generate for web tier, for now >> nothing is necessary, everything what you see is done by on the fly >> mapping)!!! >> * Working ONLY with sculptor version 1.5 - postponed >> >> Code: >> * Now I'm in process of Fornaxing code (cutting out some dependecies, >> package refactoring, ...) >> * Servlet is aroud 2000 lines of code >> * GUI is in SmartGWT around 1500 lines >> * Copyright have to stay for company (Factory4Solutions), license will be >> LGPL >> >> Any ideas, suggestions, recommendations, criticism and compliments are >> welcome >> >> Enjoy >> >> Pavel >> >> PS: Please don't hack this box. It's virtual server with empty JBoss >> and empty MySQL inside. >> >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> Fornax-developer mailing list >> Fornax-developer@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/fornax-developer >> >> > > -- > View this message in context: > http://www.nabble.com/SmartClient-frontend-demo-tp24221467s17564p24261351.html > Sent from the Fornax-Platform mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > _______________________________________________ > Fornax-developer mailing list > Fornax-developer@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/fornax-developer >
MakeWindow.js
Description: JavaScript source
------------------------------------------------------------------------------
_______________________________________________ Fornax-developer mailing list Fornax-developer@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fornax-developer