Agile Toolkit localization - atk4

I read the answer here for a question about bilingual atk, but I wonder if the framework is adapted for international use?
I tested the CRUD functionality (v 4.2) and cannot see that e.g. the labels of the buttons (Add, Edit, Delete) are run through the _() function.
Any plans for that? If needed and ATK is the right path, could I assist? If so how?

Here is the most recent localization branch.
https://github.com/atk4/atk4/tree/locale
they call $this->api->_() which you can override and make it call _() or any other way.
$this->add('translation/Controller_Basic')
->setLocale('de') // default language
->setModel('translation/Translation'); // use your model if you wish
$this->routePages('translation'); // adds translation/admin page
$this->add('Button')->setLabel('Localization Test');
If you use the translation controller with debug argument, it will add smileys to all the non-localized strings:
$this->add('translation/Controller_Basic',array('debug'=>true))
Records which has no translation will be automatically added through the model.

Related

Grails 3 "show" view with Fields plugin 2.1.0-SNAPSHOT

Stuck at a trivial problem in Grails 3.1.5: Show the fields of a domain object, excluding one of them, including a transient property. Yes, this is my first Grails 3 project after many years with previous versions.
The generated show.gsp contains
<f:display bean="rfaPdffile"/>
This will include a field that may contain megabytes of XML. It should never be shown interactively. The display: false constraint is no longer in the docs, and seems to be silenty ignored.
Next I tried explicitly naming the fields:
<f:with bean="rfaPdffile">
<f:display property='fileName'/>
<f:display property='pageCount'/>
...
</f:with>
This version suprisingly displays the values without any markup whatsoever. Changing display to field,
<f:with bean="rfaPdffile">
<f:field property='fileName'/>
<f:field property='pageCount'/>
...
</f:with>
sort of works, but shows editable values. So does f:all.
In addition I tried adding other attributes to f:display: properties (like in f:table), except (like in f:all). I note in passing that those two attributes have different syntax for similar purposes.
In the Field plugin docs my use case is explicitly mentioned as a design goal. I must have missed something obvious.
My aim is to quickly throw together a prototype gui, postponing the details until later. Clues are greatly appreciated
If I understood you correctly, you want to have all bean properties included in the gsp but the one with the "megabytes of XML" should not be displayed to the user?
If that is the case you can do:
f:with bean="beanName"
f:field property="firstPropertyName"
f:field property="secondPropertyName"
And the one you don't wish to display:
g:hiddenField name="propertyName" value="${beanName.propertyName?}"
f:with
So list all the properties as f:field or f:display and put the one you don't wish to display in a g:hiddenField Grails tag
You can also try:
f:field property="propertyName"
widget-hidden="true"
but the Label is not hidden in this case.
Hope it helps
My own answer: "use the force, read the source". The f:display tag has two rather obvious bugs. I will submit a pull request as soon as I can.
Bugs aside, the documentation does not mention that the plugin may pick up the "scaffold" static property from the domain, if it has one. Its value should be a map. Its "exclude" key may define a list of property names (List of String) to be excluded. This probably works already for the "f:all" tag; bug correction is needed for the "f:display" tag.
My subjective impression is that the fields plugin is in a tight spot. It is intertwined with the Grails architecture, making it sensitive to changes in Grails internals. It is also required by the standard scaffolding plugin, making it very visible. Thus it needs constant attention from maintainers, a position not to be envied. Even now conventions for default constraints seem to have changed somewhere between Grails 3.0.9 and 3.1.7.
Performance of the fields plugin is sensitive to the total number of plugins in the app where it is used. It searches all plugins dynamically for templates.
For the wish list I would prefer stricter tag naming. The main tags should be verbs. There are two main actions, show and edit. For each action there are two main variants, single bean or multiple beans.
My answer is that at present (2 March 2017) there is no answer. I have searched the Net high and low. For the index (list) and create and edit views, the fields plugin works well enough. A certain field can be easily excluded from the create and edit views, relatively easily from the list view (by listing those that should show), and in no way I could find from the show view. This is such a common need that one would suspect it will be addressed soon. Also, easily showing derived values in the show view, like 'total' for an invoice. One can do that by adding an ordered list with a list item showing the value below the generated ordered list of values, but that is kind of a hack.
In some ways, the old way was easier. Yes, it generated long views, but they were generated and didn't have to be done by the programmer - just custom touches here and there.

Spreadsheet Gear migration errors

I am migrating Spreadsheet gear of my application from 6.0.3.190 to
7.4.1.104.I am getting my issues with Color property.Can any one help me in this.Now I am using using Color = System.Drawing.Color; and also ToSGColor().This became very hectic to do in all places where ever we use color.I expect we should have some shortcut to do this.Can any one suggest me How can i get all functionalities with few changes only.I am also getting exceptions to c onvert IColorFormat.LineColor to system.drawing.Color.
Note the "Breaking Changes" page in the SpreadsheetGear 2012 documentation, which lists this particular change:
In order to support WPF and Silverlight, the core API has been
separated from the GDI+ and Windows Forms APIs and therefore uses the
new SpreadsheetGear.Color type rather than
SpreadsheetGear.Drawing.Color. SpreadsheetGear.Drawing.Color has been
moved to SpreadsheetGear2012.Drawing.dll. See
SpreadsheetGear.Drawing.Color for an example which uses the implicit
and static converters to convert between SpreadsheetGear.Color,
SpreadsheetGear.Drawing.Color and System.Drawing.Color.
SpreadsheetGear.Colors and SpreadsheetGear.SystemColors provide
helpful predefined colors to replace the use of predefined colors in
System.Drawing.Color.
So you'll need to ensure than any place where you were previously using System.Drawing colors now use SpreadsheetGear.Drawing colors, including API like IColorFormat.LineColor.
There aren't really any "migration" tools to automatically convert such instances to the new API. So you'll need to resolve these errors for each code file. Doing a Find/Replace keyword search for "System.Drawing" and "SpreadsheetGear.Drawing" could possibly speed up the process, though this would depend on what using statements you have added to each code file.

Scout create Table page out of database table

I heard that scout eclipse can create table page - AbstractPageWithTable out of database table properties, without manually adding columns for it.
Is this true, and if it is is somebody knows how to do it?
Dynamic UI Components:
I am not sure I understand your question correctly. Can I rephrase it like this:
How can I add a column dynamically (without having to define them as inner class)?
Here some pointers on the Scout Forum:
Is possible to create a dynamic PageView and Form ?
How to create UI fields at runtime?
...
My personal opinion is that the scout philosophy is to have a declarative UI defined with inner classes. I am not sure I would recommend someone to use this dynamic approach...
Scaffoling for Eclipse Scout:
From your comment, I now understand your question like this:
Given an existing database, is it possible to generate some elements of the application like TablePages?
I am afraid there is no open-source tool doing this for the moment. In our company, we have some developers, having a series of scripts to do something like what you are describing.
There is a project called SAML (Scout Application Modeling Language) where the user interface is described with a DSL and the Scout entities are generated. This is more a prototype that was built for the Kepler version of scout (3.9). For the moment there is no active development on it.
I have also started some builder where you do something like:
SimpleApplicationBuilder app = SimpleApplicationBuilder.create("myapp", "simple.myapp", "");
IScoutFormBuilder formBuilder = ScoutBuilders.form("MyFirstForm", "simple.myapp.client.ui.forms", "simple.myapp.shared.services")
.propTitle(app.nlsKey("MyFormTitle"))
.propSubTitle(app.nlsKey("MyFormSubTitle"))
.propAskIfNeedSave(false)
.propDisplayHint(DisplayHint.DISPLAY_HINT_VIEW)
.addField(ScoutBuilders.groupBox("ContentGroupBox")
.propBorderVisible(false)
.addField(ScoutBuilders.stringField("MyStringField")
.propLabel(app.nlsKey("MyStringLabel"))
)
.addField(ScoutBuilders.tableField("MyTableField")
.propTableStatusVisible(true)
.addTable(ScoutBuilders.table("MyTable")
.propAutoResizeColumns(true)
.addColumn(ScoutBuilders.integerColumn("IdComlum")
.propDisplayable(false)
)
.addColumn(ScoutBuilders.stringColumn("NameComlum")
.propHeaderText(app.nlsKey("Name"))
)
.addColumn(ScoutBuilders.integerColumn("AgeComlum")
.propHeaderText(app.nlsKey("Age"))
)
)
)
);
app.addForm(formBuilder);
The idea is to have a Java model of the application source code. It should allows to be able to do modifications or to add new entities and then to generate or modify the code. My tool is not open source for the moment (it is not finished yet and I do not have enough time to work on it).
I definitively think that scaffolding for Eclipse Scout would be great. I have published a master thesis proposal to work with a student on this topic. I hope we will be able to move forward.
Here some pointers in the Eclipse Scout forum:
Scout usage from command line
Form Generator based on DB Table layout
Let me know if you are interested in those topics.

cakephp how to check variable content and all function included?

sorry i was new here so this problem maybe simple.
anyone knows how to check variable content?
like xx($a);
then page shows all relate information about $a. Is CakePHP allowed to do that?
i setup a kit on my cakephp
You might be looking for either var_dump() or print_r()
You can use PHP built-in functions like
var_dump() - displays structured information about variable
print_r() - the same, but preformatted with some differences
get_defined_vars() - returns array with all defined variables
Or use true CakePHP-way
Debugger::dump() - It will print out all properties and methods (if any) of the supplied variable
For more convenience you may use CakePHP Debug Kit plugin, which provides nice toolbar and some useful tools for your purpose.

What's a good, affordable "knob" library?

I'm currently thinking of a new pet project, an "editor" for MIDI-enabled synths. I've got the MIDI side covered, I suppose, but what I'm looking for right now is something that can pass for nice "dials" and "knobs" like you see in Ableton Live, Reason, Reaktor, and so forth.
Putting my form full of trackbars, is sort of wasteful, y'know?
So, what is a nice affordable .NET 2.0 library that has that sort of graphical components?
1- http://www.codeproject.com/KB/cs/industrial_controls.aspx has some related controls (C#)
2- http://www.c-sharpcorner.com/UploadFile/desaijm/KnobControlusingWindowsForms11182005004925AM/KnobControlusingWindowsForms.aspx is another C# based Knob Control
Used the (2) personally on one project and it worked great (though not visually very strong). (1) looks cooler but havn't explored
Check out some of these. If none just do search for ".net gauges". Most of the major UI control libraries have a gauge or dashboard library.
http://www.perpetuumsoft.com/Product.aspx?lang=en&pid=44
http://www.brothersoft.com/software_developer/microsoft_.net/.net_dashboard_suite_56186.html
http://www.componentone.com/SuperProducts/GaugesSilverlight/
http://www.dundas.com/
I've never used this myself, but found KineticaRT controls. $67.06.
(source: eclipse.co.uk)
GMSI.Net Knob v2.0. $169.00.
alt text http://www.globalmajic.com/mc_images/product/thumbnail/net_knob150.jpg

Resources