facebook

Create custom tags for scaffolding

  1. MyEclipse IDE
  2.  > 
  3. Spring Development
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #326416 Reply

    DevAlternatives
    Participant

    Hi ,

    We want to add some custom tags on the template project in order to extract some specific properties of the persistence model (table name and schema) , I tried with the below code but with no success, on a previous post we accomplish a similar task by an extension point in the plugin on the TableDataTypeInputProvider for changing the names in each of the attributes, I’m using Oracle 11g and MyEclipse 10

    Thanks in advance,
    http://www.myeclipseide.com/PNphpBB2-viewtopic-t-28824-highlight-camelcase-sid-e78f25cef0701c60d7f5661fd348616a.html
    “>
    http://www.myeclipseide.com/PNphpBB2-viewtopic-t-28824-highlight-camelcase-sid-e78f25cef0701c60d7f5661fd348616a.html

    Java class

    
    package org.custom.provider;
    
    import org.eclipse.jet.JET2Context;
    import org.eclipse.jet.JET2Writer;
    import org.eclipse.jet.taglib.JET2TagException;
    import org.eclipse.jet.taglib.TagInfo;
    import org.skyway.core.model.data.DataType;
    import org.skyway.integration.data.persistence.emitter.ITableEmitter;
    import org.skyway.integration.data.persistence.tags.JPAEmitterTag;
    
    public class CustomPersistenceTable extends JPAEmitterTag {
        public void doAction(TagInfo td, JET2Context context, JET2Writer out)
                throws JET2TagException {
            DataType dataType = (DataType) getElementFromXPath(
                    getAttribute("select"), context);
            ITableEmitter emitter = null;
    
            emitter = (ITableEmitter) getEmitter(context, ITableEmitter.class,
                    dataType);
            out.write(emitter.getTableName());
    
        }
    
    }
    

    On the DataType.jet

    
    <%@taglib prefix="custom" id="gaudi.customTags"%>
    <custom:tableName select="$model"  />
    

    On the plugin xml

    
    <extension
             point="org.eclipse.jet.tagLibraries">
          <tagLibrary
                deprecated="false"
                id="customTags"
                name="Custom Generation Tag Libs"
                standardPrefix="custom">
          <emptyTag
                   class="org.custom.provider.CustomPersistenceTable"
                   name="tableName"
                   whenContainingLineIsEmpty="remove"
                   >
                <attribute
                      name="select"
                      type="xpath"
                      use="required"
                      >
                </attribute>
           </emptyTag>
          </tagLibrary>
       </extension>
           
    #326631 Reply

    cconway
    Member

    The templates are provided so that users can make minor modifications to them and scaffold the CRUD pattern. The level of customization being asked for is not supported by MyEclipse for Spring support. If you can get it to work, then that is great and I commend you, but we are unable to tell you how to achieve every possible customization related task.

    The templates are there, and you can use them in that form. Outside of that, I’m afraid you are venturing beyond the intent of the template project.

    #326702 Reply

    DevAlternatives
    Participant

    Cindy,

    Our approach for doing custom tags is because some functionalities are not extensible from the actual templates (i.e. Extract only the table name for doing some custom generations for adding sequences to oracle tables). We understand that your company is reusing some of the functionalities that skyway builder provides in order to offer the MyEclipse for Spring, and your support is more for “end users” , but our project goes beyond of the simple crud generation and we would like to have documentation and support on these kind of customizations directly from skyway, is it possible to contact them through you ? or can you give me some contact info for requesting support to them ?

    Thanks in advance,

    #326843 Reply

    Brian Fernandes
    Moderator

    As Cindy stated, your needs go beyond the intended scope of the MyEclipse for Spring application; supporting your customizations within the product is therefore not possible.

    As far as support directly from Skyway is concerned, I’m afraid that these features and further work in this area are something that neither Skyway nor Genuitec find viable. Your requests have been discussed with both companies and we cannot provide more support in this area.

    I’m sorry I could not be of further assistance, please let us know if you need any additional clarifications.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Create custom tags for scaffolding

You must be logged in to post in the forum log in