Re: Flexibility to provide prim-key or not-null in extend-entity tag

2022-09-20 Thread Altafhusen Makandar
Can someone help me out with this scenario?

On Mon, Sep 19, 2022 at 3:30 PM Altafhusen Makandar 
wrote:

> Hi,
> I have a requirement to extend a table and add a new column with
> prim-key tag. I used the  but the prim-key does not work. I
> checked the entitymodel.xsd and it does not have this feature in the
> extend-entity tag. I also tried to provide a not-null="true" in "field" tag
> but that didn't work either.
>
> 
>
> Am I missing something or is there a workaround for this?
> Thanks in advance.
>


Flexibility to provide prim-key or not-null in extend-entity tag

2022-09-19 Thread Altafhusen Makandar
Hi,
I have a requirement to extend a table and add a new column with
prim-key tag. I used the  but the prim-key does not work. I
checked the entitymodel.xsd and it does not have this feature in the
extend-entity tag. I also tried to provide a not-null="true" in "field" tag
but that didn't work either.



Am I missing something or is there a workaround for this?
Thanks in advance.


Re: Avoid creating entry in content_keyword on content and party_content creation

2022-03-22 Thread Altafhusen Makandar
Can someone provide some solution on this?

On Mon, Mar 21, 2022, 09:42 Altafhusen Makandar 
wrote:

> Hi, When I create a record in the "content" table using
> dispatcher.runSync("createContent", map), it also creates an entry in
> "content_keyword" table with keyword=contentId. Is there a way to avoid
> creating this entry? Also, when I create a records in "party_content" table
> using  dispatcher.runSync("createPartyContent", map), it creates entries in
> "content_keyword" with keywords having the values from "groupName" in
> "party_group" table. Is there a way to avoid this as well? Thank you in
> advance.
>


Avoid creating entry in content_keyword on content and party_content creation

2022-03-21 Thread Altafhusen Makandar
Hi, When I create a record in the "content" table using
dispatcher.runSync("createContent", map), it also creates an entry in
"content_keyword" table with keyword=contentId. Is there a way to avoid
creating this entry? Also, when I create a records in "party_content" table
using  dispatcher.runSync("createPartyContent", map), it creates entries in
"content_keyword" with keywords having the values from "groupName" in
"party_group" table. Is there a way to avoid this as well? Thank you in
advance.


Re: Ofbiz Rest API content-type

2022-02-20 Thread Altafhusen Makandar
Thank you both for your responses. I totally agree on using JSON. I
explained the "separation of concern" to the person who takes the final
call on design before posting the question here but he wanted to use some
of the features from "Content Management" and wanted to send HTML. So I
wanted to check if there is any such possibility in Ofbiz Rest.

On Sun, Feb 20, 2022 at 5:14 PM Michael Brohl 
wrote:

> Hi,
>
> the REST-API ist designed to either automatically expose standard OFBiz
> services through the export configuration or configure an API through
> the special rest configuration (also using services underneath). It is
> automatically reading body or url parameters, providing them to the
> underlying service and returns the service results in a structured
> format which is currently only JSON.
>
> As Carsten mentioned, for a REST API it is common to have structured
> input/output like JSON or the less used XML format. The REST-API plugin
> currently supports JSON. We are working on enhancing the plugin (see
> [1]) but I don't expect to have it support HTML.
>
> If you want to return HTML, you can just go with the standard way of
> http requests, getting data and rendering through the Freemarker
> template engine.
>
> I agree with Carsten, it sounds like you should use the REST-API as-is
> and render the JSON results using some templating in your consuming client.
>
> Best regards,
>
> Michael Brohl
>
> ecomify GmbH - www.ecomify.de
>
> [1] https://issues.apache.org/jira/browse/OFBIZ-11328
>
> Am 19.02.22 um 07:36 schrieb Carsten Schinzer:
> > Hi again,
> >
> >
> > I wonder why a REST API Service would be expected to return HTML. Isn’t
> the
> > client of the REST API responsible to render the returned JSON?
> >
> > If you would expect XML for example, ok. But HTML? Hum.
> > Maybe it is worth to read the Wikipedia article on REST API and
> understand
> > that your idea rather counters its basic idea of separating concerns.
> > https://en.wikipedia.org/wiki/Representational_state_transfer
> >
> > You might want to review your “scenario” and consider a HTML rendering
> step
> > on your side after retrieving the relevant data from the API?
> >
> > Warm regards
> >
> >
> > Carsten
> >
> >
> > Altafhusen Makandar  schrieb am Fr. 18. Feb.
> 2022
> > um 11:06:
> >
> >> Thank you for your response. This is a generic question related to the
> >> request and response object type in ofbiz rest API. In my understanding,
> >> the rest API currently supports the request and response object type as
> >> JSON. I've scenario where I want to return a HTML data and not JSON
> object.
> >> Similarly, there may be other type of object that I may receive or
> return.
> >> So I wanted to check if the feature to receive or return other types
> other
> >> than JSON is available. If it's available then a small code snippet of
> it's
> >> usage would be helpful to me. It would be great if I get some
> information
> >> on this. Thank you.
> >>
> >> On Fri, Feb 18, 2022, 09:40 Carsten Schinzer <
> >> cars...@dcs-verkaufssysteme.de>
> >> wrote:
> >>
> >>> Hello,
> >>>
> >>>
> >>> I am not really sure, your question is clear to everybody. I would
> >> wonder:
> >>> Is this a generic question?
> >>> I ask, because "application/json" indicates that a structured content
> >> with
> >>> key-value pairs (potentially matching a given schema) will be returned
> >>> while the other content types you are asking for are (content-wise) not
> >>> structured in that sense: text/html, text/plain, multipart/*.
> >>> Are you looking for something concrete here?
> >>>
> >>> Maybe it helps to describe your use case a bit more.
> >>> Warm regards
> >>>
> >>>
> >>> Carsten
> >>>
> >>>
> >>>
> >>> ---
> >>>
> >>>
> >>> Dr. Carsten Schinzer
> >>>
> >>> *Inhaber*
> >>>
> >>>
> >>> t +49 89 88569642 | f +49 89 99964059 | m +49 159 05269462
> >>>
> >>> DCS Verkaufssysteme
> >>>
> >>> Gerner Str. 27 | 80638 München | Germany
> >>>
> >>>
> >>> Am Do., 17. Feb. 2022 um 22:55 Uhr schrieb Altafhusen Makandar <
> >>> altafhusen...@gmail.com>:
> >>>
> >>>> Can someone please provide some information on this?
> >>>>
> >>>> On Thu, Feb 17, 2022, 10:43 Altafhusen Makandar <
> >> altafhusen...@gmail.com
> >>>> wrote:
> >>>>
> >>>>> Hi,
> >>>>>
> >>>>> I am using the rest API feature of the ofbiz and I found the
> >>>>> "application/json".as the content-type. Do we have a feature for
> >> other
> >>>>> content types like text/html, text/plain, multipart/* and so on?
> >>>>>
> >>>>> Regards,
> >>>>> Altaf.
> >>>>>
>


Re: Ofbiz Rest API content-type

2022-02-18 Thread Altafhusen Makandar
Thank you for your response. This is a generic question related to the
request and response object type in ofbiz rest API. In my understanding,
the rest API currently supports the request and response object type as
JSON. I've scenario where I want to return a HTML data and not JSON object.
Similarly, there may be other type of object that I may receive or return.
So I wanted to check if the feature to receive or return other types other
than JSON is available. If it's available then a small code snippet of it's
usage would be helpful to me. It would be great if I get some information
on this. Thank you.

On Fri, Feb 18, 2022, 09:40 Carsten Schinzer 
wrote:

> Hello,
>
>
> I am not really sure, your question is clear to everybody. I would wonder:
> Is this a generic question?
> I ask, because "application/json" indicates that a structured content with
> key-value pairs (potentially matching a given schema) will be returned
> while the other content types you are asking for are (content-wise) not
> structured in that sense: text/html, text/plain, multipart/*.
> Are you looking for something concrete here?
>
> Maybe it helps to describe your use case a bit more.
> Warm regards
>
>
> Carsten
>
>
>
> ---
>
>
> Dr. Carsten Schinzer
>
> *Inhaber*
>
>
> t +49 89 88569642 | f +49 89 99964059 | m +49 159 05269462
>
> DCS Verkaufssysteme
>
> Gerner Str. 27 | 80638 München | Germany
>
>
> Am Do., 17. Feb. 2022 um 22:55 Uhr schrieb Altafhusen Makandar <
> altafhusen...@gmail.com>:
>
> > Can someone please provide some information on this?
> >
> > On Thu, Feb 17, 2022, 10:43 Altafhusen Makandar  >
> > wrote:
> >
> > > Hi,
> > >
> > > I am using the rest API feature of the ofbiz and I found the
> > > "application/json".as the content-type. Do we have a feature for other
> > > content types like text/html, text/plain, multipart/* and so on?
> > >
> > > Regards,
> > > Altaf.
> > >
> >
>


Re: Ofbiz Rest API content-type

2022-02-17 Thread Altafhusen Makandar
Can someone please provide some information on this?

On Thu, Feb 17, 2022, 10:43 Altafhusen Makandar 
wrote:

> Hi,
>
> I am using the rest API feature of the ofbiz and I found the
> "application/json".as the content-type. Do we have a feature for other
> content types like text/html, text/plain, multipart/* and so on?
>
> Regards,
> Altaf.
>


Ofbiz Rest API content-type

2022-02-17 Thread Altafhusen Makandar
Hi,

I am using the rest API feature of the ofbiz and I found the
"application/json".as the content-type. Do we have a feature for other
content types like text/html, text/plain, multipart/* and so on?

Regards,
Altaf.


REST services IN does not take Objects

2021-10-12 Thread Altafhusen Makandar
Dear Team,

I am implementing the REST API and the service does not take the Class
object as the input. Instead, I need to provide the Map as input mode and
the use ObjectMapper in my service class to map it to a specific class
object. Below is an example.






The type for attribute with mode="IN" should be abc.def.model.Employee but
I am setting it to Map. This is because the IN mode is not accepting the
model class. Instead I need to use the ObjectMapper to convert it to the
object of the respective class.

Another problem I am facing is that the ServiceUtil class does not provide
a facility to send 404 error code. Instead I always get 422 error code. Is
there any way to return specific error codes?

Thanks & Regards,
Altaf