how to define new column type in liferay service builder - liferay-6

I want to define an entity like below:
<entity name="Book" local-service="true" remote-service="true">
<column name="bookId" type="long" primary="true" />
<column name="bookPrice" type="BigDecimal" />
</entity>
my liferay is 6.0.6.
how can it possible to create new type like BigDecimal or other types in liferay service builder?

Related

Edit custom customer group attribute (column) in Magento 2

Bonjour !
I try to edit some custom customer group fields in my Magento 2.3 but I don't know how to start.
I already have added some columns and displayed it in admin back-office with a module.
view/adminhtml/ui_component/customer_group_listing.xml
<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<columns name="customer_group_columns">
<column name="siret">
<settings>
<filter>text</filter>
<label translate="true">SIRET</label>
</settings>
</column>
<column name="code_client">
<settings>
<filter>text</filter>
<label translate="true">Code client</label>
</settings>
</column>
<column name="zipcode">
<settings>
<filter>text</filter>
<label translate="true">Code postal</label>
</settings>
</column>
</columns>
</listing>
But now I want on the update form to have the capability to modify this fields (siret, code_client, zipcode)
Screenshot of the BO
For exemple, here I only have 2 fields but I want to add for example the zipcode in the form.
Screenshot of the update form
Thanks :)

Microsoft Dynamics CRM 2011 PlugIn RetrieveMultiple Does not return custom attribute on pricelist

I am writing a simple PlugIn for Dynamics CRM 2011 which should retrieve a custom attribute which I customized in the pricelist entity.
When I execute the following code, all standard attributes are returned, but not the one custom attribute which I customized (and published of course). I don't get an error, but simply the attribute 'axi_submarketid' is not returned. If I read data from a completely custom entity, I have no problem.
string fetch = string.Format(#"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
<entity name='pricelevel'>
<attribute name='name' />
<attribute name='transactioncurrencyid' />
<attribute name='enddate' />
<attribute name='begindate' />
<attribute name='statecode' />
<attribute name='pricelevelid' />
<attribute name='axi_submarketid' />
<order attribute='name' descending='false' />
<filter type='and'>
<condition attribute='pricelevelid' operator='eq' uiname='10 Stromlieferung' uitype='pricelevel' value='{0}' />
</filter>
</entity>
</fetch>", pricelevelid);
EntityCollection pricelevel = _service.RetrieveMultiple(new FetchExpression(fetch));
What am I doing wrong?
Thanks for help,
Peter
I solved my issue myself and it is a bit embarassing :-)
The expected attribute was not deliverd, because it had no content. Meaning, not only in the direct context of a PlugIn, but also when requesting data in general: if in an attribute there is no data, the attribute is not sent back, for example if the attribute is NULL or has no value in it.
Thanks anyway, hope this question and answer helps someone else.
Regards,
Peter

Liferay, ServiceBuilder, what's the scope for attributes userId, companyId, userId

Although I've developed some services with Liferay ServiceBuilder, I'm not quite sure I understand the point of using the attributes:
userId
companyId
groupId
Note that these attributes are available through the PortalRequest.
Following the basic tutorials, you are instructed to create these attributes for every entity, and take care to set them on 'add' functions. But thinking of it, I've not ever seen any tutorial or referenced code where these attributes are used on data retrieval (Finder methods, dynamic queries, or custom queries either)
So what's the point on keeping this information ?
Are these attributes used automatically somehow under some convention or scope ? Something like, the Liferay's default Finders using them when they are available through the PortalRequest ?
Or is it up to the developer to use them on every Select, E.g. are all the single-parameter Finders practically useless on multi-instance Portals (since the companyId attribute should be used on every Finder method) ?
Or is it just a good practice to keep this structure for database extendability, auditing, indexing or something else I'm totally missing ?
These attributes are necessary when you use your entities for example on staging environment. The groupId specifies to which environment the entity belongs to. Meaning of userId is obvious and as for companyId it is the site identifier. So IMHO these attributes are quite important when you have multiple sites on one portal, when you have staging env. enabled etc..
Suppose you have a new table and you want to set UserId in your table then it is necessary but otherwise I don't think these attributes are neccessary.
I have created service builder
<entity name="FaoEsalesCustomer" local-service="true" remote-service="false" table="fao_esalecustomer">
<!-- PK fields -->
<column name="esaleCustomerId" type="long" primary="true" />
<!-- Audit fields -->
<column name="createdBy" type="long" />
<column name="createdOn" type="Date" />
<column name="modifiedBy" type="long" />
<column name="modifiedOn" type="Date" />
<!-- Other fields -->
<column name="customerName" type="String" />
<column name="address" type="String" />
<column name="ph" type="Integer" />
<column name="categoryId" type="long" />
<column name="categoryName" type="String" />
<column name="quantity" type="Double" />
<column name="price" type="Double" />
</entity>

function import in entity framework error

hi i have an error in the entity framework. i imported the sp get() into EF and return results as complex datatype 'GetResult'.In the edmx xml i have set the 'Amount' type to decimal.
<ComplexType Name="Get_Result">
<Property Type="String" Name="Description" Nullable="true" MaxLength="255" />
<Property Type="Decimal" Name="Amount" Nullable="false" />
<Property Type="Decimal" Name="Gst" Nullable="false" Precision="19" />
<Property Type="Decimal" Name="Total" Nullable="true" Precision="19" />
</ComplexType>
I try to bind the result with datagridview
gridview.DataSource = db.Get().ToList();
it kept giving me error message like this. and i couldn't find int32 anywhere in EF and have updated & built the EF multiple times.
The 'Amount' property on 'Get_Result' could not be set to a 'Int32' value. You must set this property to a non-null value of type 'Decimal'.
any help appreciated...
solved the issue by handling null exception

smartgwt calendar

I'm trying to populate a smartgwt calendar using data form a server obtained using a datasource. Unfortunately the examples in showcase only use client only test data, where one has to create an array of calendar events first. Can anyone give an example of how to do this directly from a rest datastore for example.
Thanks.
Yes, I had trouble tracking down an example too. I eventually figured it out by looking at the samples. It seems like the Calendar doesn't care about the type of the objects used by the datasource, but rather that they provide properties of name, startDate, endDate, and description. (Note that startDate and endDate should be defined as "datetime" in your ds.xml, or all of the events will be full-day events.) Here an example ds.xml (based on the sample for Google App Engine modified with a calendar object):
<DataSource
ID="Appointment_DataSource"
serverConstructor="com.isomorphic.jpa.GAEJPADataSource"
beanClassName="com.smartgwt.sample.server.Appointment"
>
<fields>
<field name="eventID" type="text" hidden="true" primaryKey="true" />
<field name="name" type="text" title="Name" required="true" />
<field name="startDate" type="datetime" title="Start Date" required="true" />
<field name="endDate" type="datetime" title="End Date" required="true" />
<field name="description" type="text" title="Description" />
</fields>
</DataSource>