You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openmeetings.apache.org by Andun Sameera <an...@gmail.com> on 2013/04/04 16:50:14 UTC

How to set attribute value to a language xml file entry

Hi All,

I have a language xml entry like this,

    <string id="1541" name="content_is_saving">
        <value>Content is Saving, Please wait.</value>
    </string>

I want to save this value to a attribute like this,

     <attribute name="errorid" value="I want to put it here" type="number" />

What will be the way?

Also I have added the above new entry to master language (English) xml
file. Running the test method in
singlewebapp/src/org/apache/openmeetings/test/labels/FillLabels.java
will populate that entry to other languages. Am I correct?

Thanks!

-- 
Regards
Andun S.L. Gunawardana
Undergraduate
Department of Computer Science And Engineering
University of Moratuwa
Sri Lanka

Blog - http://www.insightforfuture.blogspot.com/
LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
Twitter -http://twitter.com/AndunSLG

Re: How to set attribute value to a language xml file entry

Posted by Andun Sameera <an...@gmail.com>.
I found that running test method of
singlewebapp/src/org/apache/openmeetings/test/labels/FillLabels.java
will do the task. but getting some exceptions while running it. Will
report the result.

Thanks!

On Fri, Apr 5, 2013 at 2:07 PM, Andun Sameera <an...@gmail.com> wrote:
> Hi Maxim,
>
> Problem Solved! Thank you very much for the help. Also what will be
> the way to sync my new entry to english.xml with all other languages?
>
>     <string id="1541" name="content_is_saving">
>         <value>Content is Saving, Please wait.</value>
>     </string>
>
> Thanks!
>
> On Fri, Apr 5, 2013 at 1:21 PM, Maxim Solodovnik <so...@gmail.com> wrote:
>> I believe the error is in this line:
>>       this.parent.setAttribute('errortext',canvas.getLabelName(1541));
>> you should write
>>       this.setAttribute('errortext',canvas.getLabelName(1541));
>> since in XML hierarchy 'errortext' is on the same level.
>>
>> parent means 'parent XML element' not 'parent class'
>>
>>
>>
>> On Fri, Apr 5, 2013 at 8:54 AM, Andun Sameera <an...@gmail.com> wrote:
>>
>>> Hi Maxim,
>>>
>>> There was a small mistake in my question. I will state the question
>>> more clearly with some new findings.
>>>
>>> In the baseErrorDialog class it has a view like this,
>>>
>>> <attribute name="errortext" value="" type="string" />
>>>
>>> <view y="24" width="$once{ parent.width - 40 }" height="130" x="30"
>>> clip="true">
>>>     <text fontsize="10" fontstyle="bold" text="${
>>> parent.parent.errortext }" multiline="true" width="$once{ parent.width
>>> - 16 }" selectable="true" />
>>> </view>
>>>
>>> the contentSaveWindow class has been created by extending
>>> baseErrorDialog. So I want to update the text of the above text view
>>> from the subclass contentSaveWindow. For that task, I thought updating
>>> the value of errorText attribute which is used to specify the text of
>>> text view.
>>>
>>> So I have created a english.xml file entry like this,
>>>
>>> <string id="1541" name="content_is_saving">
>>>            <value>Content is Saving, Please wait.</value>
>>> </string>
>>>
>>> Then I have changed the oninit handler of the contentSaveWindow class
>>> like this to update the variable.
>>>
>>> <handler name="oninit">
>>>         this.parent.setAttribute('errortext',canvas.getLabelName(1541));
>>>         lz.ModeManager.makeModal(this);
>>>         if ($debug) Debug.write("contentsavewindow: ",errorid);
>>>         if ($debug)
>>> Debug.write("this.parent.errortext:",this.parent.errortext);
>>>         this.startSave();
>>> </handler>
>>>
>>> In the debug mode I saw the value of errortext attribute is updated.
>>> But the message window come without empty value in the text box. So
>>> what is wrong here?
>>>
>>> My basic requirement is to add a text to the empty text box of
>>> baseErrorDialog while being in the sub class
>>> contentSaveWindow.
>>>
>>> Also my other question was how to update all the language xml files
>>> with this new entry,
>>>
>>> <string id="1541" name="content_is_saving">
>>>            <value>Content is Saving, Please wait.</value>
>>> </string>
>>>
>>> Vasiliy instructed me to use
>>> org.apache.openmeetings.test.labels.FillLabels for this task. Is it
>>> enough to run the text() method of that particular class to update all
>>> langue xml files.
>>>
>>> Please be kind enough to instruct me on these questions. Sorry for the
>>> earlier mistake.
>>>
>>> Thanks!
>>>
>>> On Fri, Apr 5, 2013 at 7:06 AM, Maxim Solodovnik <so...@gmail.com>
>>> wrote:
>>> > I'm totally confused with this question,
>>> >
>>> > 1) since you have entry in your english.xml file (and have this language
>>> > file imported via language admin) there is no need to create any
>>> attributes.
>>> >
>>> > 2) Why do you need attribute?
>>> >
>>> > 3) your attribute declaration is confusing: by setting  *type="number"*
>>> you
>>> > telling openlaszlo the value will be number, but in the same line you
>>> > declaring: value="I want to put it here".
>>> >
>>> > Please take a look at the code, there is special label which takes string
>>> > id, you just need to use it.
>>> >
>>> >
>>> >
>>> > On Thu, Apr 4, 2013 at 9:50 PM, Andun Sameera <an...@gmail.com>
>>> wrote:
>>> >
>>> >> Hi All,
>>> >>
>>> >> I have a language xml entry like this,
>>> >>
>>> >>     <string id="1541" name="content_is_saving">
>>> >>         <value>Content is Saving, Please wait.</value>
>>> >>     </string>
>>> >>
>>> >> I want to save this value to a attribute like this,
>>> >>
>>> >>      <attribute name="errorid" value="I want to put it here"
>>> type="number"
>>> >> />
>>> >>
>>> >> What will be the way?
>>> >>
>>> >> Also I have added the above new entry to master language (English) xml
>>> >> file. Running the test method in
>>> >> singlewebapp/src/org/apache/openmeetings/test/labels/FillLabels.java
>>> >> will populate that entry to other languages. Am I correct?
>>> >>
>>> >> Thanks!
>>> >>
>>> >> --
>>> >> Regards
>>> >> Andun S.L. Gunawardana
>>> >> Undergraduate
>>> >> Department of Computer Science And Engineering
>>> >> University of Moratuwa
>>> >> Sri Lanka
>>> >>
>>> >> Blog - http://www.insightforfuture.blogspot.com/
>>> >> LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
>>> >> Twitter -http://twitter.com/AndunSLG
>>> >>
>>> >
>>> >
>>> >
>>> > --
>>> > WBR
>>> > Maxim aka solomax
>>>
>>>
>>>
>>> --
>>> Regards
>>> Andun S.L. Gunawardana
>>> Undergraduate
>>> Department of Computer Science And Engineering
>>> University of Moratuwa
>>> Sri Lanka
>>>
>>> Blog - http://www.insightforfuture.blogspot.com/
>>> LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
>>> Twitter -http://twitter.com/AndunSLG
>>>
>>
>>
>>
>> --
>> WBR
>> Maxim aka solomax
>
>
>
> --
> Regards
> Andun S.L. Gunawardana
> Undergraduate
> Department of Computer Science And Engineering
> University of Moratuwa
> Sri Lanka
>
> Blog - http://www.insightforfuture.blogspot.com/
> LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
> Twitter -http://twitter.com/AndunSLG



-- 
Regards
Andun S.L. Gunawardana
Undergraduate
Department of Computer Science And Engineering
University of Moratuwa
Sri Lanka

Blog - http://www.insightforfuture.blogspot.com/
LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
Twitter -http://twitter.com/AndunSLG

Re: How to set attribute value to a language xml file entry

Posted by Vasya <va...@unipro.ru>.
You should use org.apache.openmeetings.test.labels.FillLabels to sync 
for other languages.

Thanks,
Vasiliy


On 05.04.2013 15:37, Andun Sameera wrote:
> Hi Maxim,
>
> Problem Solved! Thank you very much for the help. Also what will be
> the way to sync my new entry to english.xml with all other languages?
>
>      <string id="1541" name="content_is_saving">
>          <value>Content is Saving, Please wait.</value>
>      </string>
>
> Thanks!
>
> On Fri, Apr 5, 2013 at 1:21 PM, Maxim Solodovnik <so...@gmail.com> wrote:
>> I believe the error is in this line:
>>        this.parent.setAttribute('errortext',canvas.getLabelName(1541));
>> you should write
>>        this.setAttribute('errortext',canvas.getLabelName(1541));
>> since in XML hierarchy 'errortext' is on the same level.
>>
>> parent means 'parent XML element' not 'parent class'
>>
>>
>>
>> On Fri, Apr 5, 2013 at 8:54 AM, Andun Sameera <an...@gmail.com> wrote:
>>
>>> Hi Maxim,
>>>
>>> There was a small mistake in my question. I will state the question
>>> more clearly with some new findings.
>>>
>>> In the baseErrorDialog class it has a view like this,
>>>
>>> <attribute name="errortext" value="" type="string" />
>>>
>>> <view y="24" width="$once{ parent.width - 40 }" height="130" x="30"
>>> clip="true">
>>>      <text fontsize="10" fontstyle="bold" text="${
>>> parent.parent.errortext }" multiline="true" width="$once{ parent.width
>>> - 16 }" selectable="true" />
>>> </view>
>>>
>>> the contentSaveWindow class has been created by extending
>>> baseErrorDialog. So I want to update the text of the above text view
>>> from the subclass contentSaveWindow. For that task, I thought updating
>>> the value of errorText attribute which is used to specify the text of
>>> text view.
>>>
>>> So I have created a english.xml file entry like this,
>>>
>>> <string id="1541" name="content_is_saving">
>>>             <value>Content is Saving, Please wait.</value>
>>> </string>
>>>
>>> Then I have changed the oninit handler of the contentSaveWindow class
>>> like this to update the variable.
>>>
>>> <handler name="oninit">
>>>          this.parent.setAttribute('errortext',canvas.getLabelName(1541));
>>>          lz.ModeManager.makeModal(this);
>>>          if ($debug) Debug.write("contentsavewindow: ",errorid);
>>>          if ($debug)
>>> Debug.write("this.parent.errortext:",this.parent.errortext);
>>>          this.startSave();
>>> </handler>
>>>
>>> In the debug mode I saw the value of errortext attribute is updated.
>>> But the message window come without empty value in the text box. So
>>> what is wrong here?
>>>
>>> My basic requirement is to add a text to the empty text box of
>>> baseErrorDialog while being in the sub class
>>> contentSaveWindow.
>>>
>>> Also my other question was how to update all the language xml files
>>> with this new entry,
>>>
>>> <string id="1541" name="content_is_saving">
>>>             <value>Content is Saving, Please wait.</value>
>>> </string>
>>>
>>> Vasiliy instructed me to use
>>> org.apache.openmeetings.test.labels.FillLabels for this task. Is it
>>> enough to run the text() method of that particular class to update all
>>> langue xml files.
>>>
>>> Please be kind enough to instruct me on these questions. Sorry for the
>>> earlier mistake.
>>>
>>> Thanks!
>>>
>>> On Fri, Apr 5, 2013 at 7:06 AM, Maxim Solodovnik <so...@gmail.com>
>>> wrote:
>>>> I'm totally confused with this question,
>>>>
>>>> 1) since you have entry in your english.xml file (and have this language
>>>> file imported via language admin) there is no need to create any
>>> attributes.
>>>> 2) Why do you need attribute?
>>>>
>>>> 3) your attribute declaration is confusing: by setting  *type="number"*
>>> you
>>>> telling openlaszlo the value will be number, but in the same line you
>>>> declaring: value="I want to put it here".
>>>>
>>>> Please take a look at the code, there is special label which takes string
>>>> id, you just need to use it.
>>>>
>>>>
>>>>
>>>> On Thu, Apr 4, 2013 at 9:50 PM, Andun Sameera <an...@gmail.com>
>>> wrote:
>>>>> Hi All,
>>>>>
>>>>> I have a language xml entry like this,
>>>>>
>>>>>      <string id="1541" name="content_is_saving">
>>>>>          <value>Content is Saving, Please wait.</value>
>>>>>      </string>
>>>>>
>>>>> I want to save this value to a attribute like this,
>>>>>
>>>>>       <attribute name="errorid" value="I want to put it here"
>>> type="number"
>>>>> />
>>>>>
>>>>> What will be the way?
>>>>>
>>>>> Also I have added the above new entry to master language (English) xml
>>>>> file. Running the test method in
>>>>> singlewebapp/src/org/apache/openmeetings/test/labels/FillLabels.java
>>>>> will populate that entry to other languages. Am I correct?
>>>>>
>>>>> Thanks!
>>>>>
>>>>> --
>>>>> Regards
>>>>> Andun S.L. Gunawardana
>>>>> Undergraduate
>>>>> Department of Computer Science And Engineering
>>>>> University of Moratuwa
>>>>> Sri Lanka
>>>>>
>>>>> Blog - http://www.insightforfuture.blogspot.com/
>>>>> LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
>>>>> Twitter -http://twitter.com/AndunSLG
>>>>>
>>>>
>>>>
>>>> --
>>>> WBR
>>>> Maxim aka solomax
>>>
>>>
>>> --
>>> Regards
>>> Andun S.L. Gunawardana
>>> Undergraduate
>>> Department of Computer Science And Engineering
>>> University of Moratuwa
>>> Sri Lanka
>>>
>>> Blog - http://www.insightforfuture.blogspot.com/
>>> LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
>>> Twitter -http://twitter.com/AndunSLG
>>>
>>
>>
>> --
>> WBR
>> Maxim aka solomax
>
>


Re: How to set attribute value to a language xml file entry

Posted by Andun Sameera <an...@gmail.com>.
Hi,

I have successfully updated all the language files using
org.apache.openmeetings.test.labels.FillLabels. Also I have added
patch to fix the content save window in [1]. Thank you very much for
the big help.

Thanks!

[1] - https://issues.apache.org/jira/browse/OPENMEETINGS-507

On Fri, Apr 5, 2013 at 2:41 PM, Maxim Solodovnik <so...@gmail.com> wrote:
> As Vasiliy already mentioned you need to manually edit all files or run
> FillLabels.test() with correct environment variables set (please check the
> code)
>
>
> On Fri, Apr 5, 2013 at 3:37 PM, Andun Sameera <an...@gmail.com> wrote:
>
>> Hi Maxim,
>>
>> Problem Solved! Thank you very much for the help. Also what will be
>> the way to sync my new entry to english.xml with all other languages?
>>
>>     <string id="1541" name="content_is_saving">
>>         <value>Content is Saving, Please wait.</value>
>>     </string>
>>
>> Thanks!
>>
>> On Fri, Apr 5, 2013 at 1:21 PM, Maxim Solodovnik <so...@gmail.com>
>> wrote:
>> > I believe the error is in this line:
>> >       this.parent.setAttribute('errortext',canvas.getLabelName(1541));
>> > you should write
>> >       this.setAttribute('errortext',canvas.getLabelName(1541));
>> > since in XML hierarchy 'errortext' is on the same level.
>> >
>> > parent means 'parent XML element' not 'parent class'
>> >
>> >
>> >
>> > On Fri, Apr 5, 2013 at 8:54 AM, Andun Sameera <an...@gmail.com>
>> wrote:
>> >
>> >> Hi Maxim,
>> >>
>> >> There was a small mistake in my question. I will state the question
>> >> more clearly with some new findings.
>> >>
>> >> In the baseErrorDialog class it has a view like this,
>> >>
>> >> <attribute name="errortext" value="" type="string" />
>> >>
>> >> <view y="24" width="$once{ parent.width - 40 }" height="130" x="30"
>> >> clip="true">
>> >>     <text fontsize="10" fontstyle="bold" text="${
>> >> parent.parent.errortext }" multiline="true" width="$once{ parent.width
>> >> - 16 }" selectable="true" />
>> >> </view>
>> >>
>> >> the contentSaveWindow class has been created by extending
>> >> baseErrorDialog. So I want to update the text of the above text view
>> >> from the subclass contentSaveWindow. For that task, I thought updating
>> >> the value of errorText attribute which is used to specify the text of
>> >> text view.
>> >>
>> >> So I have created a english.xml file entry like this,
>> >>
>> >> <string id="1541" name="content_is_saving">
>> >>            <value>Content is Saving, Please wait.</value>
>> >> </string>
>> >>
>> >> Then I have changed the oninit handler of the contentSaveWindow class
>> >> like this to update the variable.
>> >>
>> >> <handler name="oninit">
>> >>         this.parent.setAttribute('errortext',canvas.getLabelName(1541));
>> >>         lz.ModeManager.makeModal(this);
>> >>         if ($debug) Debug.write("contentsavewindow: ",errorid);
>> >>         if ($debug)
>> >> Debug.write("this.parent.errortext:",this.parent.errortext);
>> >>         this.startSave();
>> >> </handler>
>> >>
>> >> In the debug mode I saw the value of errortext attribute is updated.
>> >> But the message window come without empty value in the text box. So
>> >> what is wrong here?
>> >>
>> >> My basic requirement is to add a text to the empty text box of
>> >> baseErrorDialog while being in the sub class
>> >> contentSaveWindow.
>> >>
>> >> Also my other question was how to update all the language xml files
>> >> with this new entry,
>> >>
>> >> <string id="1541" name="content_is_saving">
>> >>            <value>Content is Saving, Please wait.</value>
>> >> </string>
>> >>
>> >> Vasiliy instructed me to use
>> >> org.apache.openmeetings.test.labels.FillLabels for this task. Is it
>> >> enough to run the text() method of that particular class to update all
>> >> langue xml files.
>> >>
>> >> Please be kind enough to instruct me on these questions. Sorry for the
>> >> earlier mistake.
>> >>
>> >> Thanks!
>> >>
>> >> On Fri, Apr 5, 2013 at 7:06 AM, Maxim Solodovnik <so...@gmail.com>
>> >> wrote:
>> >> > I'm totally confused with this question,
>> >> >
>> >> > 1) since you have entry in your english.xml file (and have this
>> language
>> >> > file imported via language admin) there is no need to create any
>> >> attributes.
>> >> >
>> >> > 2) Why do you need attribute?
>> >> >
>> >> > 3) your attribute declaration is confusing: by setting
>>  *type="number"*
>> >> you
>> >> > telling openlaszlo the value will be number, but in the same line you
>> >> > declaring: value="I want to put it here".
>> >> >
>> >> > Please take a look at the code, there is special label which takes
>> string
>> >> > id, you just need to use it.
>> >> >
>> >> >
>> >> >
>> >> > On Thu, Apr 4, 2013 at 9:50 PM, Andun Sameera <an...@gmail.com>
>> >> wrote:
>> >> >
>> >> >> Hi All,
>> >> >>
>> >> >> I have a language xml entry like this,
>> >> >>
>> >> >>     <string id="1541" name="content_is_saving">
>> >> >>         <value>Content is Saving, Please wait.</value>
>> >> >>     </string>
>> >> >>
>> >> >> I want to save this value to a attribute like this,
>> >> >>
>> >> >>      <attribute name="errorid" value="I want to put it here"
>> >> type="number"
>> >> >> />
>> >> >>
>> >> >> What will be the way?
>> >> >>
>> >> >> Also I have added the above new entry to master language (English)
>> xml
>> >> >> file. Running the test method in
>> >> >> singlewebapp/src/org/apache/openmeetings/test/labels/FillLabels.java
>> >> >> will populate that entry to other languages. Am I correct?
>> >> >>
>> >> >> Thanks!
>> >> >>
>> >> >> --
>> >> >> Regards
>> >> >> Andun S.L. Gunawardana
>> >> >> Undergraduate
>> >> >> Department of Computer Science And Engineering
>> >> >> University of Moratuwa
>> >> >> Sri Lanka
>> >> >>
>> >> >> Blog - http://www.insightforfuture.blogspot.com/
>> >> >> LinkedIn -
>> http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
>> >> >> Twitter -http://twitter.com/AndunSLG
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > WBR
>> >> > Maxim aka solomax
>> >>
>> >>
>> >>
>> >> --
>> >> Regards
>> >> Andun S.L. Gunawardana
>> >> Undergraduate
>> >> Department of Computer Science And Engineering
>> >> University of Moratuwa
>> >> Sri Lanka
>> >>
>> >> Blog - http://www.insightforfuture.blogspot.com/
>> >> LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
>> >> Twitter -http://twitter.com/AndunSLG
>> >>
>> >
>> >
>> >
>> > --
>> > WBR
>> > Maxim aka solomax
>>
>>
>>
>> --
>> Regards
>> Andun S.L. Gunawardana
>> Undergraduate
>> Department of Computer Science And Engineering
>> University of Moratuwa
>> Sri Lanka
>>
>> Blog - http://www.insightforfuture.blogspot.com/
>> LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
>> Twitter -http://twitter.com/AndunSLG
>>
>
>
>
> --
> WBR
> Maxim aka solomax



-- 
Regards
Andun S.L. Gunawardana
Undergraduate
Department of Computer Science And Engineering
University of Moratuwa
Sri Lanka

Blog - http://www.insightforfuture.blogspot.com/
LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
Twitter -http://twitter.com/AndunSLG

Re: How to set attribute value to a language xml file entry

Posted by Maxim Solodovnik <so...@gmail.com>.
As Vasiliy already mentioned you need to manually edit all files or run
FillLabels.test() with correct environment variables set (please check the
code)


On Fri, Apr 5, 2013 at 3:37 PM, Andun Sameera <an...@gmail.com> wrote:

> Hi Maxim,
>
> Problem Solved! Thank you very much for the help. Also what will be
> the way to sync my new entry to english.xml with all other languages?
>
>     <string id="1541" name="content_is_saving">
>         <value>Content is Saving, Please wait.</value>
>     </string>
>
> Thanks!
>
> On Fri, Apr 5, 2013 at 1:21 PM, Maxim Solodovnik <so...@gmail.com>
> wrote:
> > I believe the error is in this line:
> >       this.parent.setAttribute('errortext',canvas.getLabelName(1541));
> > you should write
> >       this.setAttribute('errortext',canvas.getLabelName(1541));
> > since in XML hierarchy 'errortext' is on the same level.
> >
> > parent means 'parent XML element' not 'parent class'
> >
> >
> >
> > On Fri, Apr 5, 2013 at 8:54 AM, Andun Sameera <an...@gmail.com>
> wrote:
> >
> >> Hi Maxim,
> >>
> >> There was a small mistake in my question. I will state the question
> >> more clearly with some new findings.
> >>
> >> In the baseErrorDialog class it has a view like this,
> >>
> >> <attribute name="errortext" value="" type="string" />
> >>
> >> <view y="24" width="$once{ parent.width - 40 }" height="130" x="30"
> >> clip="true">
> >>     <text fontsize="10" fontstyle="bold" text="${
> >> parent.parent.errortext }" multiline="true" width="$once{ parent.width
> >> - 16 }" selectable="true" />
> >> </view>
> >>
> >> the contentSaveWindow class has been created by extending
> >> baseErrorDialog. So I want to update the text of the above text view
> >> from the subclass contentSaveWindow. For that task, I thought updating
> >> the value of errorText attribute which is used to specify the text of
> >> text view.
> >>
> >> So I have created a english.xml file entry like this,
> >>
> >> <string id="1541" name="content_is_saving">
> >>            <value>Content is Saving, Please wait.</value>
> >> </string>
> >>
> >> Then I have changed the oninit handler of the contentSaveWindow class
> >> like this to update the variable.
> >>
> >> <handler name="oninit">
> >>         this.parent.setAttribute('errortext',canvas.getLabelName(1541));
> >>         lz.ModeManager.makeModal(this);
> >>         if ($debug) Debug.write("contentsavewindow: ",errorid);
> >>         if ($debug)
> >> Debug.write("this.parent.errortext:",this.parent.errortext);
> >>         this.startSave();
> >> </handler>
> >>
> >> In the debug mode I saw the value of errortext attribute is updated.
> >> But the message window come without empty value in the text box. So
> >> what is wrong here?
> >>
> >> My basic requirement is to add a text to the empty text box of
> >> baseErrorDialog while being in the sub class
> >> contentSaveWindow.
> >>
> >> Also my other question was how to update all the language xml files
> >> with this new entry,
> >>
> >> <string id="1541" name="content_is_saving">
> >>            <value>Content is Saving, Please wait.</value>
> >> </string>
> >>
> >> Vasiliy instructed me to use
> >> org.apache.openmeetings.test.labels.FillLabels for this task. Is it
> >> enough to run the text() method of that particular class to update all
> >> langue xml files.
> >>
> >> Please be kind enough to instruct me on these questions. Sorry for the
> >> earlier mistake.
> >>
> >> Thanks!
> >>
> >> On Fri, Apr 5, 2013 at 7:06 AM, Maxim Solodovnik <so...@gmail.com>
> >> wrote:
> >> > I'm totally confused with this question,
> >> >
> >> > 1) since you have entry in your english.xml file (and have this
> language
> >> > file imported via language admin) there is no need to create any
> >> attributes.
> >> >
> >> > 2) Why do you need attribute?
> >> >
> >> > 3) your attribute declaration is confusing: by setting
>  *type="number"*
> >> you
> >> > telling openlaszlo the value will be number, but in the same line you
> >> > declaring: value="I want to put it here".
> >> >
> >> > Please take a look at the code, there is special label which takes
> string
> >> > id, you just need to use it.
> >> >
> >> >
> >> >
> >> > On Thu, Apr 4, 2013 at 9:50 PM, Andun Sameera <an...@gmail.com>
> >> wrote:
> >> >
> >> >> Hi All,
> >> >>
> >> >> I have a language xml entry like this,
> >> >>
> >> >>     <string id="1541" name="content_is_saving">
> >> >>         <value>Content is Saving, Please wait.</value>
> >> >>     </string>
> >> >>
> >> >> I want to save this value to a attribute like this,
> >> >>
> >> >>      <attribute name="errorid" value="I want to put it here"
> >> type="number"
> >> >> />
> >> >>
> >> >> What will be the way?
> >> >>
> >> >> Also I have added the above new entry to master language (English)
> xml
> >> >> file. Running the test method in
> >> >> singlewebapp/src/org/apache/openmeetings/test/labels/FillLabels.java
> >> >> will populate that entry to other languages. Am I correct?
> >> >>
> >> >> Thanks!
> >> >>
> >> >> --
> >> >> Regards
> >> >> Andun S.L. Gunawardana
> >> >> Undergraduate
> >> >> Department of Computer Science And Engineering
> >> >> University of Moratuwa
> >> >> Sri Lanka
> >> >>
> >> >> Blog - http://www.insightforfuture.blogspot.com/
> >> >> LinkedIn -
> http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
> >> >> Twitter -http://twitter.com/AndunSLG
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > WBR
> >> > Maxim aka solomax
> >>
> >>
> >>
> >> --
> >> Regards
> >> Andun S.L. Gunawardana
> >> Undergraduate
> >> Department of Computer Science And Engineering
> >> University of Moratuwa
> >> Sri Lanka
> >>
> >> Blog - http://www.insightforfuture.blogspot.com/
> >> LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
> >> Twitter -http://twitter.com/AndunSLG
> >>
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
>
>
>
> --
> Regards
> Andun S.L. Gunawardana
> Undergraduate
> Department of Computer Science And Engineering
> University of Moratuwa
> Sri Lanka
>
> Blog - http://www.insightforfuture.blogspot.com/
> LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
> Twitter -http://twitter.com/AndunSLG
>



-- 
WBR
Maxim aka solomax

Re: How to set attribute value to a language xml file entry

Posted by Andun Sameera <an...@gmail.com>.
Hi Maxim,

Problem Solved! Thank you very much for the help. Also what will be
the way to sync my new entry to english.xml with all other languages?

    <string id="1541" name="content_is_saving">
        <value>Content is Saving, Please wait.</value>
    </string>

Thanks!

On Fri, Apr 5, 2013 at 1:21 PM, Maxim Solodovnik <so...@gmail.com> wrote:
> I believe the error is in this line:
>       this.parent.setAttribute('errortext',canvas.getLabelName(1541));
> you should write
>       this.setAttribute('errortext',canvas.getLabelName(1541));
> since in XML hierarchy 'errortext' is on the same level.
>
> parent means 'parent XML element' not 'parent class'
>
>
>
> On Fri, Apr 5, 2013 at 8:54 AM, Andun Sameera <an...@gmail.com> wrote:
>
>> Hi Maxim,
>>
>> There was a small mistake in my question. I will state the question
>> more clearly with some new findings.
>>
>> In the baseErrorDialog class it has a view like this,
>>
>> <attribute name="errortext" value="" type="string" />
>>
>> <view y="24" width="$once{ parent.width - 40 }" height="130" x="30"
>> clip="true">
>>     <text fontsize="10" fontstyle="bold" text="${
>> parent.parent.errortext }" multiline="true" width="$once{ parent.width
>> - 16 }" selectable="true" />
>> </view>
>>
>> the contentSaveWindow class has been created by extending
>> baseErrorDialog. So I want to update the text of the above text view
>> from the subclass contentSaveWindow. For that task, I thought updating
>> the value of errorText attribute which is used to specify the text of
>> text view.
>>
>> So I have created a english.xml file entry like this,
>>
>> <string id="1541" name="content_is_saving">
>>            <value>Content is Saving, Please wait.</value>
>> </string>
>>
>> Then I have changed the oninit handler of the contentSaveWindow class
>> like this to update the variable.
>>
>> <handler name="oninit">
>>         this.parent.setAttribute('errortext',canvas.getLabelName(1541));
>>         lz.ModeManager.makeModal(this);
>>         if ($debug) Debug.write("contentsavewindow: ",errorid);
>>         if ($debug)
>> Debug.write("this.parent.errortext:",this.parent.errortext);
>>         this.startSave();
>> </handler>
>>
>> In the debug mode I saw the value of errortext attribute is updated.
>> But the message window come without empty value in the text box. So
>> what is wrong here?
>>
>> My basic requirement is to add a text to the empty text box of
>> baseErrorDialog while being in the sub class
>> contentSaveWindow.
>>
>> Also my other question was how to update all the language xml files
>> with this new entry,
>>
>> <string id="1541" name="content_is_saving">
>>            <value>Content is Saving, Please wait.</value>
>> </string>
>>
>> Vasiliy instructed me to use
>> org.apache.openmeetings.test.labels.FillLabels for this task. Is it
>> enough to run the text() method of that particular class to update all
>> langue xml files.
>>
>> Please be kind enough to instruct me on these questions. Sorry for the
>> earlier mistake.
>>
>> Thanks!
>>
>> On Fri, Apr 5, 2013 at 7:06 AM, Maxim Solodovnik <so...@gmail.com>
>> wrote:
>> > I'm totally confused with this question,
>> >
>> > 1) since you have entry in your english.xml file (and have this language
>> > file imported via language admin) there is no need to create any
>> attributes.
>> >
>> > 2) Why do you need attribute?
>> >
>> > 3) your attribute declaration is confusing: by setting  *type="number"*
>> you
>> > telling openlaszlo the value will be number, but in the same line you
>> > declaring: value="I want to put it here".
>> >
>> > Please take a look at the code, there is special label which takes string
>> > id, you just need to use it.
>> >
>> >
>> >
>> > On Thu, Apr 4, 2013 at 9:50 PM, Andun Sameera <an...@gmail.com>
>> wrote:
>> >
>> >> Hi All,
>> >>
>> >> I have a language xml entry like this,
>> >>
>> >>     <string id="1541" name="content_is_saving">
>> >>         <value>Content is Saving, Please wait.</value>
>> >>     </string>
>> >>
>> >> I want to save this value to a attribute like this,
>> >>
>> >>      <attribute name="errorid" value="I want to put it here"
>> type="number"
>> >> />
>> >>
>> >> What will be the way?
>> >>
>> >> Also I have added the above new entry to master language (English) xml
>> >> file. Running the test method in
>> >> singlewebapp/src/org/apache/openmeetings/test/labels/FillLabels.java
>> >> will populate that entry to other languages. Am I correct?
>> >>
>> >> Thanks!
>> >>
>> >> --
>> >> Regards
>> >> Andun S.L. Gunawardana
>> >> Undergraduate
>> >> Department of Computer Science And Engineering
>> >> University of Moratuwa
>> >> Sri Lanka
>> >>
>> >> Blog - http://www.insightforfuture.blogspot.com/
>> >> LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
>> >> Twitter -http://twitter.com/AndunSLG
>> >>
>> >
>> >
>> >
>> > --
>> > WBR
>> > Maxim aka solomax
>>
>>
>>
>> --
>> Regards
>> Andun S.L. Gunawardana
>> Undergraduate
>> Department of Computer Science And Engineering
>> University of Moratuwa
>> Sri Lanka
>>
>> Blog - http://www.insightforfuture.blogspot.com/
>> LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
>> Twitter -http://twitter.com/AndunSLG
>>
>
>
>
> --
> WBR
> Maxim aka solomax



-- 
Regards
Andun S.L. Gunawardana
Undergraduate
Department of Computer Science And Engineering
University of Moratuwa
Sri Lanka

Blog - http://www.insightforfuture.blogspot.com/
LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
Twitter -http://twitter.com/AndunSLG

Re: How to set attribute value to a language xml file entry

Posted by Maxim Solodovnik <so...@gmail.com>.
I believe the error is in this line:
      this.parent.setAttribute('errortext',canvas.getLabelName(1541));
you should write
      this.setAttribute('errortext',canvas.getLabelName(1541));
since in XML hierarchy 'errortext' is on the same level.

parent means 'parent XML element' not 'parent class'



On Fri, Apr 5, 2013 at 8:54 AM, Andun Sameera <an...@gmail.com> wrote:

> Hi Maxim,
>
> There was a small mistake in my question. I will state the question
> more clearly with some new findings.
>
> In the baseErrorDialog class it has a view like this,
>
> <attribute name="errortext" value="" type="string" />
>
> <view y="24" width="$once{ parent.width - 40 }" height="130" x="30"
> clip="true">
>     <text fontsize="10" fontstyle="bold" text="${
> parent.parent.errortext }" multiline="true" width="$once{ parent.width
> - 16 }" selectable="true" />
> </view>
>
> the contentSaveWindow class has been created by extending
> baseErrorDialog. So I want to update the text of the above text view
> from the subclass contentSaveWindow. For that task, I thought updating
> the value of errorText attribute which is used to specify the text of
> text view.
>
> So I have created a english.xml file entry like this,
>
> <string id="1541" name="content_is_saving">
>            <value>Content is Saving, Please wait.</value>
> </string>
>
> Then I have changed the oninit handler of the contentSaveWindow class
> like this to update the variable.
>
> <handler name="oninit">
>         this.parent.setAttribute('errortext',canvas.getLabelName(1541));
>         lz.ModeManager.makeModal(this);
>         if ($debug) Debug.write("contentsavewindow: ",errorid);
>         if ($debug)
> Debug.write("this.parent.errortext:",this.parent.errortext);
>         this.startSave();
> </handler>
>
> In the debug mode I saw the value of errortext attribute is updated.
> But the message window come without empty value in the text box. So
> what is wrong here?
>
> My basic requirement is to add a text to the empty text box of
> baseErrorDialog while being in the sub class
> contentSaveWindow.
>
> Also my other question was how to update all the language xml files
> with this new entry,
>
> <string id="1541" name="content_is_saving">
>            <value>Content is Saving, Please wait.</value>
> </string>
>
> Vasiliy instructed me to use
> org.apache.openmeetings.test.labels.FillLabels for this task. Is it
> enough to run the text() method of that particular class to update all
> langue xml files.
>
> Please be kind enough to instruct me on these questions. Sorry for the
> earlier mistake.
>
> Thanks!
>
> On Fri, Apr 5, 2013 at 7:06 AM, Maxim Solodovnik <so...@gmail.com>
> wrote:
> > I'm totally confused with this question,
> >
> > 1) since you have entry in your english.xml file (and have this language
> > file imported via language admin) there is no need to create any
> attributes.
> >
> > 2) Why do you need attribute?
> >
> > 3) your attribute declaration is confusing: by setting  *type="number"*
> you
> > telling openlaszlo the value will be number, but in the same line you
> > declaring: value="I want to put it here".
> >
> > Please take a look at the code, there is special label which takes string
> > id, you just need to use it.
> >
> >
> >
> > On Thu, Apr 4, 2013 at 9:50 PM, Andun Sameera <an...@gmail.com>
> wrote:
> >
> >> Hi All,
> >>
> >> I have a language xml entry like this,
> >>
> >>     <string id="1541" name="content_is_saving">
> >>         <value>Content is Saving, Please wait.</value>
> >>     </string>
> >>
> >> I want to save this value to a attribute like this,
> >>
> >>      <attribute name="errorid" value="I want to put it here"
> type="number"
> >> />
> >>
> >> What will be the way?
> >>
> >> Also I have added the above new entry to master language (English) xml
> >> file. Running the test method in
> >> singlewebapp/src/org/apache/openmeetings/test/labels/FillLabels.java
> >> will populate that entry to other languages. Am I correct?
> >>
> >> Thanks!
> >>
> >> --
> >> Regards
> >> Andun S.L. Gunawardana
> >> Undergraduate
> >> Department of Computer Science And Engineering
> >> University of Moratuwa
> >> Sri Lanka
> >>
> >> Blog - http://www.insightforfuture.blogspot.com/
> >> LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
> >> Twitter -http://twitter.com/AndunSLG
> >>
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
>
>
>
> --
> Regards
> Andun S.L. Gunawardana
> Undergraduate
> Department of Computer Science And Engineering
> University of Moratuwa
> Sri Lanka
>
> Blog - http://www.insightforfuture.blogspot.com/
> LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
> Twitter -http://twitter.com/AndunSLG
>



-- 
WBR
Maxim aka solomax

Re: How to set attribute value to a language xml file entry

Posted by Andun Sameera <an...@gmail.com>.
Hi Maxim,

There was a small mistake in my question. I will state the question
more clearly with some new findings.

In the baseErrorDialog class it has a view like this,

<attribute name="errortext" value="" type="string" />

<view y="24" width="$once{ parent.width - 40 }" height="130" x="30" clip="true">
    <text fontsize="10" fontstyle="bold" text="${
parent.parent.errortext }" multiline="true" width="$once{ parent.width
- 16 }" selectable="true" />
</view>

the contentSaveWindow class has been created by extending
baseErrorDialog. So I want to update the text of the above text view
from the subclass contentSaveWindow. For that task, I thought updating
the value of errorText attribute which is used to specify the text of
text view.

So I have created a english.xml file entry like this,

<string id="1541" name="content_is_saving">
           <value>Content is Saving, Please wait.</value>
</string>

Then I have changed the oninit handler of the contentSaveWindow class
like this to update the variable.

<handler name="oninit">
        this.parent.setAttribute('errortext',canvas.getLabelName(1541));
        lz.ModeManager.makeModal(this);
        if ($debug) Debug.write("contentsavewindow: ",errorid);
        if ($debug) Debug.write("this.parent.errortext:",this.parent.errortext);
        this.startSave();
</handler>

In the debug mode I saw the value of errortext attribute is updated.
But the message window come without empty value in the text box. So
what is wrong here?

My basic requirement is to add a text to the empty text box of
baseErrorDialog while being in the sub class
contentSaveWindow.

Also my other question was how to update all the language xml files
with this new entry,

<string id="1541" name="content_is_saving">
           <value>Content is Saving, Please wait.</value>
</string>

Vasiliy instructed me to use
org.apache.openmeetings.test.labels.FillLabels for this task. Is it
enough to run the text() method of that particular class to update all
langue xml files.

Please be kind enough to instruct me on these questions. Sorry for the
earlier mistake.

Thanks!

On Fri, Apr 5, 2013 at 7:06 AM, Maxim Solodovnik <so...@gmail.com> wrote:
> I'm totally confused with this question,
>
> 1) since you have entry in your english.xml file (and have this language
> file imported via language admin) there is no need to create any attributes.
>
> 2) Why do you need attribute?
>
> 3) your attribute declaration is confusing: by setting  *type="number"* you
> telling openlaszlo the value will be number, but in the same line you
> declaring: value="I want to put it here".
>
> Please take a look at the code, there is special label which takes string
> id, you just need to use it.
>
>
>
> On Thu, Apr 4, 2013 at 9:50 PM, Andun Sameera <an...@gmail.com> wrote:
>
>> Hi All,
>>
>> I have a language xml entry like this,
>>
>>     <string id="1541" name="content_is_saving">
>>         <value>Content is Saving, Please wait.</value>
>>     </string>
>>
>> I want to save this value to a attribute like this,
>>
>>      <attribute name="errorid" value="I want to put it here" type="number"
>> />
>>
>> What will be the way?
>>
>> Also I have added the above new entry to master language (English) xml
>> file. Running the test method in
>> singlewebapp/src/org/apache/openmeetings/test/labels/FillLabels.java
>> will populate that entry to other languages. Am I correct?
>>
>> Thanks!
>>
>> --
>> Regards
>> Andun S.L. Gunawardana
>> Undergraduate
>> Department of Computer Science And Engineering
>> University of Moratuwa
>> Sri Lanka
>>
>> Blog - http://www.insightforfuture.blogspot.com/
>> LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
>> Twitter -http://twitter.com/AndunSLG
>>
>
>
>
> --
> WBR
> Maxim aka solomax



-- 
Regards
Andun S.L. Gunawardana
Undergraduate
Department of Computer Science And Engineering
University of Moratuwa
Sri Lanka

Blog - http://www.insightforfuture.blogspot.com/
LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
Twitter -http://twitter.com/AndunSLG

Re: How to set attribute value to a language xml file entry

Posted by Maxim Solodovnik <so...@gmail.com>.
I'm totally confused with this question,

1) since you have entry in your english.xml file (and have this language
file imported via language admin) there is no need to create any attributes.

2) Why do you need attribute?

3) your attribute declaration is confusing: by setting  *type="number"* you
telling openlaszlo the value will be number, but in the same line you
declaring: value="I want to put it here".

Please take a look at the code, there is special label which takes string
id, you just need to use it.



On Thu, Apr 4, 2013 at 9:50 PM, Andun Sameera <an...@gmail.com> wrote:

> Hi All,
>
> I have a language xml entry like this,
>
>     <string id="1541" name="content_is_saving">
>         <value>Content is Saving, Please wait.</value>
>     </string>
>
> I want to save this value to a attribute like this,
>
>      <attribute name="errorid" value="I want to put it here" type="number"
> />
>
> What will be the way?
>
> Also I have added the above new entry to master language (English) xml
> file. Running the test method in
> singlewebapp/src/org/apache/openmeetings/test/labels/FillLabels.java
> will populate that entry to other languages. Am I correct?
>
> Thanks!
>
> --
> Regards
> Andun S.L. Gunawardana
> Undergraduate
> Department of Computer Science And Engineering
> University of Moratuwa
> Sri Lanka
>
> Blog - http://www.insightforfuture.blogspot.com/
> LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
> Twitter -http://twitter.com/AndunSLG
>



-- 
WBR
Maxim aka solomax