Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » p.type.name is not transforming in the code(p.type.name is not transforming in the code)
p.type.name is not transforming in the code [message #1808262] Thu, 20 June 2019 17:51 Go to next message
Mohammad Inayatullah is currently offline Mohammad InayatullahFriend
Messages: 21
Registered: May 2019
Junior Member
i have the generated given below
index.php/fa/35784/0/

In the result of the code the p.type.name is generating empty string. as given below

index.php/fa/35785/0/

can any when please guide me.

Thanks
Re: p.type.name is not transforming in the code [message #1808291 is a reply to message #1808262] Fri, 21 June 2019 07:12 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
HI

You omit all the relevant parts of your repro but it looks like a FAQ.

Shortly after your empty string is a proxy URI that reveals that you are using UML and that like many others you have neglected to read the instructions in the generated Java that tell you how to initialize usage of the UML metamodel.

Regards

Ed Willink
Re: p.type.name is not transforming in the code [message #1808320 is a reply to message #1808291] Fri, 21 June 2019 13:56 Go to previous messageGo to next message
Mohammad Inayatullah is currently offline Mohammad InayatullahFriend
Messages: 21
Registered: May 2019
Junior Member
the attached file is generate.java file that i have

  • Attachment: Generate.java
    (Size: 18.46KB, Downloaded 111 times)
Re: p.type.name is not transforming in the code [message #1808355 is a reply to message #1808320] Fri, 21 June 2019 20:49 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Yes and there is a TODO that you have ignored:

/**
     * This can be used to update the resource set's resource factory registry with all needed factories.
     * 
     * @param resourceSet
     *            The resource set which registry has to be updated.
     * @generated
     */
    @Override
    public void registerResourceFactories(ResourceSet resourceSet) {
        super.registerResourceFactories(resourceSet);
        /*
         * If you want to change the content of this method, do NOT forget to change the "@generated"
         * tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
         * of the Acceleo module with the main template that has caused the creation of this class will
         * revert your modifications.
         */
        
        /*
         * TODO If you need additional resource factories registrations, you can register them here. the following line
         * (in comment) is an example of the resource factory registration.
         *
         * If you want to use the generator in stand alone, the resource factory registration will be required.
         *  
         * To learn more about the registration of Resource Factories, have a look at the Acceleo documentation (Help -> Help Contents). 
         */ 
        
        // resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(XyzResource.FILE_EXTENSION, XyzResource.Factory.INSTANCE);
        
        /*
         * Some metamodels require a very complex setup for standalone usage. For example, if you want to use a generator
         * targetting UML models in standalone, you NEED to use the following:
         */ 
        // UMLResourcesUtil.init(resourceSet)
    }


Regards

Ed Willink
Re: p.type.name is not transforming in the code [message #1808362 is a reply to message #1808355] Sat, 22 June 2019 02:05 Go to previous messageGo to next message
Mohammad Inayatullah is currently offline Mohammad InayatullahFriend
Messages: 21
Registered: May 2019
Junior Member
Thanks so much for your help.
Can you please guide me that what i have to add over here in this code.
Re: p.type.name is not transforming in the code [message #1808366 is a reply to message #1808362] Sat, 22 June 2019 04:53 Go to previous messageGo to next message
Mohammad Inayatullah is currently offline Mohammad InayatullahFriend
Messages: 21
Registered: May 2019
Junior Member
Hi Ed Willink,
Thanks so much for your help. I resolved the problem by the following two steps

1) In Generate.java file i removed comment from statment "UMLResourcesUtil.init(resourceSet);"
2) In MANIFEST.MF file i added statemtent " org.eclipse.uml2.uml.resources, "

Than so much for guiding me very well... I appreciate your help.

Cab you please send me some good links of best tutorials of acceleo .

Regards
Mohammad Inayatuallah
Re: p.type.name is not transforming in the code [message #1808367 is a reply to message #1808366] Sat, 22 June 2019 04:54 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
        /*
         * Some metamodels require a very complex setup for standalone usage. For example, if you want to use a generator
         * targetting UML models in standalone, you NEED to use the following:
         */ 
Previous Topic:Runner : Acceleo Plug-in Applications
Next Topic:[Acceleo] Assigning a Template Result to a Variable
Goto Forum:
  


Current Time: Tue Apr 16 12:05:14 GMT 2024

Powered by FUDForum. Page generated in 0.28977 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top