Details

    • Type: Feature Request Feature Request
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 6.1.0 CE RC1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      At revision 72122
    • Similar Issues:
      Show 5 results 

      Description

      Service-Builder improvement

      Beside the feature - applying convert-null element to service generator - LPS-14863, it would be nice that Service-Builder could be able to support following features.

      1) NOT NULL constraint support

      add a new element (constraint-not-null) for entity column

      e.g., <column name="fieldG" type="Integer" constraint-not-null="true" />

      2) foreign key support

      foreign key could be represented as follows.

      e.g., <column name="userId" type="long" foreign-key="true" entity="User" on-delete="action-Value" on-update="action-Value" />

      where action-Value could be one of these values: "restrict", "cascade", "set-null", "no-action".

      3) Explicit field length support

      add a new element (constraint-max-length) for entity column

      e.g., <column name="title" type="String" constraint-max-length="150" />

      4) Explicit default value support

      add an element (constraint-default-value) like

      e.g., <column name="fieldG" type="Integer" constraint-default-value="1" />

      Refer to http://www.liferay.com/community/forums/-/message_boards/message/4541542

        Activity

        Hide
        James McGovern added a comment -

        Jonas, I would see something like:

        <column name="Credit Card" type="String" RegEx="^4[0-9]

        {12}

        (?:[0-9]

        {3}

        )?$" />

        This Regex says that a credit card can only be a VISA (not Mastercard, etc). All Visa card numbers start with a 4. New cards have 16 digits. Old cards have 13.

        Show
        James McGovern added a comment - Jonas, I would see something like: <column name="Credit Card" type="String" RegEx="^4 [0-9] {12} (?: [0-9] {3} )?$" /> This Regex says that a credit card can only be a VISA (not Mastercard, etc). All Visa card numbers start with a 4. New cards have 16 digits. Old cards have 13.
        Hide
        Jonas Yuan added a comment -

        Thanks a lot, James.

        Thus it should add two more features

        5) support comment to all types of service builder elements, e.g.

        <column name="name" type="String" comment="This is a test" />

        In details, add column attribute "comment".

        6) support regular expressions, e.g. VISA

        <column name="name" type="String" regex="^4[0-9]

        {12}

        (?:[0-9]

        {3}

        )?$" />

        in details, add column attribute "regex".

        Show
        Jonas Yuan added a comment - Thanks a lot, James. Thus it should add two more features 5) support comment to all types of service builder elements, e.g. <column name="name" type="String" comment="This is a test" /> In details, add column attribute "comment". 6) support regular expressions, e.g. VISA <column name="name" type="String" regex="^4 [0-9] {12} (?: [0-9] {3} )?$" /> in details, add column attribute "regex".
        Hide
        Eduardo Garcia added a comment - - edited

        7) define in service.xml which columns are orderable and autogenerate all required classes. E.g. for an entity myEntity with a field myField:

        • MyEntityUtil.java containing getMyEntityOrderByComparator method
        • MyEntityMyFieldComparator extending orderByComparator and overriding all required methods

        so that if you want to order some columns, you just have to use these resources from the searchContainer at your view.

        Show
        Eduardo Garcia added a comment - - edited 7) define in service.xml which columns are orderable and autogenerate all required classes. E.g. for an entity myEntity with a field myField: MyEntityUtil.java containing getMyEntityOrderByComparator method MyEntityMyFieldComparator extending orderByComparator and overriding all required methods so that if you want to order some columns, you just have to use these resources from the searchContainer at your view.
        Hide
        Randy Zhu added a comment -

        In preparation for Ideation; we are merging New Feature and Improvement tickets into a singular ticket type called “Feature Request”. Additional information to follow soon.

        Show
        Randy Zhu added a comment - In preparation for Ideation; we are merging New Feature and Improvement tickets into a singular ticket type called “Feature Request”. Additional information to follow soon.
        Hide
        Robert Morkos added a comment -

        I had to manually fix the code generated from the service builder to support Time and Byte. It would be nice to have it in the service builder improvements. Can we access the service builder code so that we can contribute with fixes. Also, the service builder does not work with collections many to many, and have lot's of issues. Thanks for taking the time and feedback and we seem to use the Service Builder on almost every Liferay project at our company.

        Show
        Robert Morkos added a comment - I had to manually fix the code generated from the service builder to support Time and Byte. It would be nice to have it in the service builder improvements. Can we access the service builder code so that we can contribute with fixes. Also, the service builder does not work with collections many to many, and have lot's of issues. Thanks for taking the time and feedback and we seem to use the Service Builder on almost every Liferay project at our company.

          People

          • Assignee:
            SE Support
            Reporter:
            Jonas Yuan
          • Votes:
            49 Vote for this issue
            Watchers:
            31 Start watching this issue

            Dates

            • Created:
              Updated:

              Development

                Subcomponents

                  Structure Helper Panel