Coder Social home page Coder Social logo

ralscha / extdirectspring Goto Github PK

View Code? Open in Web Editor NEW
122.0 33.0 64.0 6.9 MB

Implementation of the Ext Direct protocol with Java and Spring

Home Page: https://github.com/ralscha/extdirectspring/wiki

License: Apache License 2.0

Java 99.94% Batchfile 0.06%
ext-direct java extjs extjs6 spring

extdirectspring's People

Contributors

chenzhang22 avatar dependabot[bot] avatar ilhanyumer avatar ralscha avatar simoami avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

extdirectspring's Issues

Array in @ExtDirectMethod

Is it possible to send array over simple named method??
For example:

@ExtDirectMethod(ExtDirectMethodType.SIMPLE_NAMED)
public void sendSomeData(List objects, int someId) {
...
}

No-arg methods have incorrect leg

I have the following method on the server side:

@ExtDirectMethod(ExtDirectMethodType.FORM_LOAD)
public Settings get() {..}

The generated api has len=1, which is incorrect, since the method does not have any arguments. This will cause the form load to fail.

How to implement a custom ObjectMapper

Should we use the instructions on:

  1. http://code.google.com/p/extdirectspring/issues/detail?id=11 โ€“ setting the ObjectMapper through setter injection on ch.ralscha.extdirectspring.util.JsonHandler (if so, can you provide a configuration example?)
  2. http://code.google.com/p/extdirectspring/issues/detail?id=20 โ€“ changing the ObjectMapper through Spring configuration:
    <mvc:message-converters>
        <bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
            <property name="objectMapper" ref="jacksonObjectMapper" />
        </bean>
    </mvc:message-converters>
</mvc:annotation-driven>

<bean id="jacksonObjectMapper" class="my.package.MyMapper"></bean>

Model Association management with extdirectspring

Hello,

I have a question about Model Associations and formUpdate. I have an entity1 that has many entity2. I have created a form for entity2, and I want to update entity2. Should I have a form with the value of the foreign key (value of the primary key of entity1), or would it be enough to transmit only the fields that really belon to entity2 ? Is there any need to set the associations in ExtJs (belongsTo, HasMany) ? These are not generated when I have tried the generator and the JPA Entities.

In general, how would you manage this kind of situation with extdirectspring ?

Thanks !

Support for Spring Roo?

Hi Ralscha,

have you ever thought about creating an add on for spring roo to expose your functionality in a similar fashion like the GWT addon?

enhancement model generator

Hi,

I had in mind to upgrade to the new model generator as I have a new grid to build from a deprecated one.
Every thing is fine so far.
But I face a problem with one single column type 'checkcolumn' which is a virtual field in the original model.
code
fields: [
....
,{name: 'sl', type: 'string'}
,{name: 'ac', type: 'bool', //Virtual Field
mapping: 'sl', persist: false,
convert: function(v, record) {
var a = record.raw.sl.split('|');
return (a.length > 1);
}
}
],
......

Question is: will it be possible to extend the model generator to produce this virtual field.
The difficult part is maybe the convert function but I have some ode somewhere which I made for a metachange store event , I was sending a convert function from the backend without troubles.
I could contribute for that bit or more if you want.

What do you think?

annotation @ExtDirectMethod not working

Hello,

Good job.

I have this service:

@service
public class HelloDemoService {

@ExtDirectMethod
  public String doHello(String message) {
    return "Hola " + message;
  }

}

But in my api-demo.js not appears (actions is empty) :

Ext.ns('Ext.app');Ext.app.REMOTING_API =
{
"url":"/smf-extjs-demo/action/router",
"type":"remoting",
"actions":{},
"timeout":12000,
"maxRetries":10,
"enableBuffer":false
};

ModelController mapping

I have a problem getting ModelController working while using Ext Loader.

I have configured a servlet with /controller/* url pattern and it works nicely with ExtDirectSpring.

Then I decided to try out ModelController and ran into a problem. Ext Loader is trying to access /app/model/MODEL_NAME.js and I have the same path mapped with @RequestMapping on the corresponding method. Seeing as my servlet is filtering only /controller/*, the working path would be /controller/app/model/MODEL_NAME.js which Ext Loader doesn't know about.

I tried creating another servlet and filtered url the following way: "/app/model/*" and then changed @RequestMapping to just "MODEL_NAME.js". Everything seems to be in the right places but app just doesn't start up anymore.

I don't have vast expertise of Spring, so I might be confusing something. Any help would be appreciated.

Loving your project so far.

Problem with generic abstract class

extdirect map method parameter type not correct with generic parameter type.
i declare abstract class with generic type parameter and inherite them with clear type like this
class RealClass {
do(SomeThing param) {

 }

}

extdirect try call jackson for instantiate param object with parent of SomeThing class but it is abstract class and thrown exception.
How to solve this?

Change the "/router" controller mapping

Hi Ralscha,

first of all i would like to thank you for the really interesting work.

A question: is it possible to specify a different mapping/path for the /router controller?

Thanks.

Why is extTID now required?

We just updated to v1.2 from v1.0.15. I noticed that the constructor for ExtDirectResponse has changed from:

public ExtDirectResponse(final HttpServletRequest request) {
    action = request.getParameter("extAction");
    method = request.getParameter("extMethod");

    String extTID = request.getParameter("extTID");
    if (extTID != null) {
        tid = Integer.parseInt(extTID);
    }
    type = request.getParameter("extType");
}

To:

public ExtDirectResponse(HttpServletRequest request) {
    action = request.getParameter("extAction");
    method = request.getParameter("extMethod");
    tid = Integer.parseInt(request.getParameter("extTID"));
    setType(request.getParameter("extType"));
}

Essentially, the extTID parameter is now REQUIRED, and if it is not there, an exception is thrown. This has broken some of our calls. Is there a reason why this was changed? Thanks.

STORE_MODIFY custom params?

Hello,
is it possible to send some extra params to STORE_MODIFY funciton?

Someting like this:
@ExtDirectMethod(value = ExtDirectMethodType.STORE_MODIFY)
public ScannerPreferences addScannerPreferences(
@RequestParam(value = "confId") Long confId, ScannerPreferences scanPrefs) {
.... do something here ...
}

I'm able to add param to Json Data object on request, but I get JAVA error, because custom param isn't part of main object (ScannerPreferences):
Unrecognized field "confId" (Class cz.designplus.platon.terminal.ScannerPreferences), not marked as ignorable
at [Source: N/A; line: -1, column: -1](through reference chain: cz.designplus.platon.terminal.ScannerPreferences["confId"])

Is there a way how to pass some params beside main object? Thanks.

FORM_SUBMIT: optional Date field

Hello,
I have ExtJS formpanel that has Date field. But this field is optional, so user can leave it empty.
But when form is saved over FORM_SUBMIT method I get the error:
Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'startOfService'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type java.lang.String to type @org.codehaus.jackson.map.annotate.JsonSerialize java.util.Date for value ''; nested exception is java.lang.IllegalArgumentException

I cannot figure how to set this field as optional. So when contains empty string I need field be ignored.

question: api self documentation

Question

We are outsourcing part of the Extjs GUI, and in that effect we need to document the api.js which interface with the web server.

I first gave the api-debug.js, but for performance reason and confidentiality, property and method names are stripped to the strict minimum (less than 6 character).

Itself without an accompanying documentation, the file is worthless, so came to me the idea to document Ext Direct Spring with Documentation Annotation which will be only used when the user request for the api-debug.js to document the javascript Ext.Direct methods generated.

I made a draft of what could be such self-documentation without being too intrusive to the current library:
example

@ExtDirectMethod(value = ExtDirectMethodType.FORM_POST, group = "standard",
documentation={
@ExtDirectParameters(params = { "id", "e", "p", "ic"}, values = {"id is used to ...", "enum type", "product id", "blah blah"}),
@ExtDirectMethod("this method create a new user..."),
@ExtDirectReturn(properties= {"success", "errors"}, values={"true for success, false otherwise", "list of failed fields"})
}
which will produce

......
/**
method to ...
@param blah
@param blah
@return blah
*/
"cs" : [ {
"name" : "imp",
"len" : 0,
"formHandler" : true
}
.....
I reuse a notation use in @javax.persistence.Table

Would anyone make any use of that feature?
And if yes where can I contribute to develop that thing?

Kind regards,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.