[ 
https://issues.apache.org/jira/browse/OFBIZ-1802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599601#action_12599601
 ] 

Ashish Vijaywargiya commented on OFBIZ-1802:
--------------------------------------------

Scott Thanks for your comments.
It may possible that you are submitting the form without putting any values 
inside the fields to generate the EntityDefinition file.

Or 

In simple way your code is not coming inside the following two blocks.

if (dataFile != null && dataFileSave != null && dataFileSave.length() > 0) {
    try {
        dataFile.writeDataFile(dataFileSave);
        messages.add(uiLabelMap.get("WebtoolsDataFileSavedTo") + dataFileSave);
    }
    catch (Exception e) {
        messages.add(e.getMessage());
    }
}
 

if (dataFile != null && entityXmlFileSave != null && entityXmlFileSave.length() 
> 0) {
    try {
        //dataFile.writeDataFile(entityXmlFileSave);
        DataFile2EntityXml.writeToEntityXml(entityXmlFileSave, dataFile);
        messages.add(uiLabelMap.get("WebtoolsDataEntityFileSavedTo") + 
entityXmlFileSave);
    }
    catch (Exception e) {
        messages.add(e.getMessage());
    }
}
 

Please put the following sentence at the top of the viewdatafile.bsh 
file.(Without applying my patch)
System.err.println("The value of uiLabelMap ========" + 
uiLabelMap.get("WebtoolsDataFileSavedTo"));
You will get the same error in this case as well.

Because in the Screen Definition the BSH file is used in which we are calling 
uiLabelMap.
The scope of uiLabelMap comes after the inclusion of main-decorator.

I am attaching the two sample file so that you can generate the 
EntityDefinition file and see the same result on your machine as well.
Please let me know if you are unable to reproduce the error.

--
Ashish Vijaywargiya



> Error in Data File Tool
> -----------------------
>
>                 Key: OFBIZ-1802
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1802
>             Project: OFBiz
>          Issue Type: Bug
>         Environment: CentOS + Java 5
>            Reporter: Ashish Vijaywargiya
>            Priority: Minor
>         Attachments: Data_File_Tool_Files.zip, DataFileTool.patch
>
>
> While using the Data File Tool when user submits to generate new file for the 
> Entity Definition it blows up with an error of uiLabelMap is missing.
> Here is the Error details :-
> org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen 
> [component://webtools/widget/MiscScreens.xml#viewdatafile]: 
> org.ofbiz.base.util.GeneralException: Error running BSH script at location 
> [component://webtools/webapp/webtools/WEB-INF/actions/datafile/viewdatafile.bsh]
>  (Error running BSH script at 
> [component://webtools/webapp/webtools/WEB-INF/actions/datafile/viewdatafile.bsh],
>  line [94]: Sourced file: 
> component://webtools/webapp/webtools/WEB-INF/actions/datafile/viewdatafile.bsh
>  : Attempt to resolve method: get() on undefined variable or class name: 
> uiLabelMap : at Line: 94 : in file: 
> component://webtools/webapp/webtools/WEB-INF/actions/datafile/viewdatafile.bsh
>  : uiLabelMap .get ( "WebtoolsDataEntityFileSavedTo" )
> (Sourced file: 
> component://webtools/webapp/webtools/WEB-INF/actions/datafile/viewdatafile.bsh
>  : Attempt to resolve method: get() on undefined variable or class name: 
> uiLabelMap)) (Error running BSH script at location 
> [component://webtools/webapp/webtools/WEB-INF/actions/datafile/viewdatafile.bsh]
>  (Error running BSH script at 
> [component://webtools/webapp/webtools/WEB-INF/actions/datafile/viewdatafile.bsh],
>  line [94]: Sourced file: 
> component://webtools/webapp/webtools/WEB-INF/actions/datafile/viewdatafile.bsh
>  : Attempt to resolve method: get() on undefined variable or class name: 
> uiLabelMap : at Line: 94 : in file: 
> component://webtools/webapp/webtools/WEB-INF/actions/datafile/viewdatafile.bsh
>  : uiLabelMap .get ( "WebtoolsDataEntityFileSavedTo" )
> (Sourced file: 
> component://webtools/webapp/webtools/WEB-INF/actions/datafile/viewdatafile.bsh
>  : Attempt to resolve method: get() on undefined variable or class name: 
> uiLabelMap)))
> --
> Ashish Vijaywargiya

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to