jmix-framework / jmix Goto Github PK
View Code? Open in Web Editor NEWJmix framework
Home Page: https://www.jmix.io
License: Apache License 2.0
Jmix framework
Home Page: https://www.jmix.io
License: Apache License 2.0
see forum topic: https://www.cuba-platform.ru/discuss/t/neyavnye-izmeneniya-redaktiruemoj-sushhnosti/3859
Developer meets "Unsaved changes" dialog in a screen but there were no changes made by user.
Currently it is hard to find the cause of the problem - you need to know places in the GUI framework code where to put breakpoints.
My suggestion:
Add debug log messages that help to find when data context was modified.
Document these log categories in the developers manual.
In some cases it would be very helpful to have an ability to serialize AccessConstraint objects.
For exaple, see jmix-data#2. To solve this problem we need to save list of constraints as part of load context. But entities can be serialized, so list of constants will be lost in the process.
By default X-Frame-Options
is set to DENY
in spring security. But we need it to be set to SAMEORIGIN
for the file downloading support.
As for now this setting is hardcoded in JmixCoreSecurityConfiguration
and StandardSecurityConfiguration
. But if clients want to provide their own security configuration, they should add this setting as well.
So it would be better to think about more generic approach.
Take https://hibernate.org/orm/envers/ as a canonical way.
@Table(name = "PETCLINIC_OWNER")
@Entity(name = "petclinic_Owner")
@Audited // all fields of the entity will be audited
public class Owner extends Person {
...
}
@Entity(name = "petclinic_Pet")
// only some fields will be audited
public class Pet extends NamedEntity {
private static final long serialVersionUID = -3431453457784831240L;
@NotNull
@Column(name = "IDENTIFICATION_NUMBER", nullable = false)
@Audited
protected String identificationNumber;
@Temporal(TemporalType.DATE)
@Column(name = "BIRTH_DATE")
@Audited
protected Date birthDate;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "TYPE_ID")
protected PetType type;
...
}
See also jmix-projects/jmix-old#569
So, queries will not be declared in screen descriptors, but in Spring Data repositories.
See forum topic: https://www.cuba-platform.com/discuss/t/lookup-field-choose-particular-values/11339/4
If I am not wrong, we have received such requests several times: "user should can choose only particular values in the lookup screen".
Alexey has been talking about it for some time.
It looks like a generic functionality: add filtering capability to standard lookup action and standard lookup screen.
E.g. PickerField.LookupAction can have a install delegate to supply lookup screen filter parameters.
StandardLookup obtains these parameters and adds them to dataLoader query.
If I were using this, I would also modify lookup screen's caption (another customization point). E.g. lookup screen called by CUBA's "Move user to another group" action could have caption "Select new Access Group for user Administrator".
In Jmix project the DataGrid.Rendereres have become prototype beans (#509). But user cannot define custom DataGrid.Renderer for the column declaratively.
Maybe we can add <custom bean="bean_name" />
element to <renderers/>
to allow the user to define a custom DataGrid.Renderer for the column declaratively.
See Vaadin documentation for information on implementing custom renderers.
The Spring Security OAuth project is deprecated. The latest OAuth 2.0 support is provided by Spring Security. See the OAuth 2.0 Migration Guide for further details.
Currently it's possible to fetch entities with any global view (fetch plan) through REST API. Also all views(fetch plans) are being sent through metadata endpoint (thus, payload increases accordingly). It's not only may result in unwanted data leakage (in case of security misconfiguration) but also does not make sense since only specific views are used on clients.
Add InputDialog
and InputParameters
classes compatible with FileDescriptor
to cuba module.
This implies overriding these classes:
io.jmix.ui.app.inputdialog.InputDialog
io.jmix.ui.app.inputdialog.InputParameter
io.jmix.ui.sys.WebDialogs
io.jmix.ui.AppUI
Getters and setters are not weaved for MappedSuperclass if it is not used in the same module.
Eclipselink issue: eclipse-ee4j/eclipselink#380
io.jmix.core.entity.dummy
.From the forum thread
I have a bunch of Kotlin data class which I use for loading data from an ugly external source, then show it to the user to do some simple manipulations to ultimately save that data into the real Entities.
Right now I’m abusing the KeyValueCollection and KeyValueEntity for the UI part but reading the documentation it appears that CUBA does create some runtime metaclass for these things. So…
Is it possible to create a metaclass for a Kotlin data class (ie: define it at runtime?)
I know I could just use @Metaclass, but the main point here is to benefit from the concise syntax of data classes which is lost otherwise
https://www.cuba-platform.ru/discuss/t/exclude-action-supports-only-nested-containers/4386/6
Why not implement ExcludeAction for usual collection containers?
In this case we should kick the item from the data container, without adding it to the list of "to delete" entities in data context.
Download Jmix project: tr-tablefocus.zip and open Order browse screen.
First case:
AR
Next field is not focused.
Second case
AR
Prevoius row is focused
See also cuba-platform/cuba#3009
all()
method to load all entities.condition()
multiple times.EntityFieldCreationSupport#createCollectionContainer
.By using DataManager under the hood.
CUBA Prototype: https://github.com/cuba-rnd/cuba-jpa-repositories
https://www.cuba-platform.com/blog/spring-query-interfaces-in-cuba/
@Unsafe
into @ApplyConstraints
with spring-like logicorg.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration
Create interface that extends JmixDataRepository
and add query methods you need:
io.jmix.core.repository.Query
to explicitly specify jpql query:
Pageable
and Sort
are not counted at positional parameters resolving process;io.jmix.core.repository.FetchPlan
to specify fetch plan for loaded entities;see data model at: https://github.com/Haulmont/jmix-data/tree/master/eclipselink/src/test/java/test_support/entity/repository
Repository:
public interface OrderRepository extends JmixDataRepository<SalesOrder, UUID> {
List<SalesOrder> findByCustomerNameAndCustomerAddressCity(String name, String city);
long countSalesOrdersByCustomer(Customer customer);
boolean existsSalesOrdersByCustomerAddressCity(String city);
void removeSalesOrdersByCustomerAddressCity(String city);
List<SalesOrder> findSalesOrderByDateBeforeOrderByDateAsc(Date date);
Page<SalesOrder> findByDateAfterAndNumberIn(Date date, Pageable pageable, List<String> numbers);
@Query("select o from repository$SalesOrder o where (o.date> ?1 and o.number in ?2)")
List<SalesOrder> findByQuery(Sort sort, Date date, List<String> numbers);
@Query("select o from repository$SalesOrder o where (o.date> :date and o.number in :numbers)")
Page<SalesOrder> findByQueryWithPaging(@Param("date") Date date,
@Param("numbers") List<String> numbers,
Pageable pageable);
@FetchPlan("SalesOrder.full")
List<SalesOrder> findByCustomerNotNullOrderByCustomerAddressCityAscDateAsc();
}
When using query parameters in a data loader, the parameter value has to be set in order to let the query be performed. Setting this parameter currently requires to programmatically inject the data loader and add the parameter value to it.
Taking this query as an example:
<loader id="defaultTreatmentRoomLc">
<query>
<![CDATA[select e from alabastiapetclinic_DefaultTreatmentRoom e where e.user = :currentUser]]>
</query>
</loader>
In order to resolve this parameter before the query is performed, the parameter has to be set like this:
@Subscribe
protected void onInit(InitEvent event) {
// provide the declarative dataContainer with required parameter
defaultTreatmentRoomLc.setParameter("currentUser", userSession.getCurrentOrSubstitutedUser());
}
This programmatic setting is not really aligned with the way the majority of the UI APIs work through its @Subscribe
and @Install
method delegates.
For the data loading, it would be good to have the ability to resolve the parameter values also via a method delegate like this:
@Install(to = "defaultTreatmentRoomLc", subject = "currentUser")
protected User currentUserParameterResolver() {
return userSession.getCurrentOrSubstitutedUser();
}
This way the developer does not have to think about controller lifecycle anymore (like which Event to subscribe in order to programmatically add the parameter).
e.g. see these topics
It is one of common CUBA GUI library performance/usability problems.
Every developer who codes generated columns - implements them wrong for the first time.
People make heavy calculations or requests to database in column generation methods.
Note that even CUBA documentation says nothing about this problem.
In Sherlock I had to instruct every newbie developer to load / calculate data beforehand, not inside of column generator (in desktop client problem becomes even worse because of the network lag).
With time it becomes obvious that if 90% of developers make mistake in one particular API place - then problem is not with developers, the problem is in this place.
Asking every developer to implement his/her own caching solution is not fair.
CUBA tables should use some caching rules and re-use results of column generators.
E.g. until item is changed, or collection is refreshed or entity's property used as column ID is changed.
Depends on #3
Customization
An application can have multiple resource bundles. For example, if you want to place some messages to the com/sample/app/some_messages.properties file, redefine the MessageSource bean in the application as follows:@Bean MessageSource messageSource(JmixModules modules, Resources resources) { JmixMessageSource messageSource = new JmixMessageSource(modules, resources); messageSource.addBasenames("com/sample/app/some_messages"); return messageSource; }
This approach is too hard to support in Jmix Studio. Special annotation would be more convenient.
FetchPlanBuilder
becames unmodifiable after build()
invocation in order to avoid FetchPlanSerialization refactoring in #3
Refactor io.jmix.core.impl.serialization.FetchPlanSerializationImpl.ViewDeserializer#fetchPlanBuilders
in order to avoid multiply build()
invocations and/or using of same builder instances as parts of different parent builders.
Leave systemProperties
support for projects with CUBA module only.
Fix xsd schemes and logic in beans.
Needed for using a database in parallel with LightSwitch application. See https://www.cuba-platform.com/support/topic/azure-sql-connection-reslience#comment-5320
Original issue: cuba-platform/cuba#394
#Make FetchPlan immutable data class
#Move copy, partialView, systemProperties
from FetchPlan to FetchPlanBuilder API. This will remove AppBeans from FetchPlan.
#Remove FetchPlanParams
#The CUBA View should keep the old API
Remove includeSystemProperties
parameter from FetchPlan
and move to legacy View
.
In cuba FileUploadField
was generated for attributes of type FileDescriptor
.
In Jmix we need to:
FileUploadField
for attributes of type byte[]
.FileStorageUploadField
for attributes of type URI
.To support this, it is needed to introduce new value in io.jmix.dynattr.AttributeType
enum for files (byte[]/URI).
Investigate native ability to resize TextArea:
If native resizing meets our requirements:
If it does not:
It can be used for implementation of custom transitive dependencies: db scripts, themes, widgetsets, etc.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.