Re: new configuration

7 views
Skip to first unread message

Ashok Hariharan

unread,
Dec 13, 2012, 5:32:33 AM12/13/12
to Samar Ayesh, bungeni...@googlegroups.com, Ahmad Hammo
I actually realized yesterday that the implementation for inlineTypes
was only partially done .. I committed a part of the fix yesterday ...
there is a small bit remaining related to the middleware which i will
fix today.

If you notice yesterday the dialogs structure was changed slightly :

https://code.google.com/p/bungeni-editor/source/diff?spec=svn2812&r=2812&format=side&path=/BungeniEditor_configs/development_configs/actions/doc_actions/debaterecord.xml

the action router configuration does not directly refer to a dialog
class , earlier :
<action name="markup_bill">
<router class="org.bungeni.editor.actions.routers.routerSelectBill"
dialog="org.bungeni.editor.selector.dialogs.Bill.Main"/>
</action>

now :

<action name="markup_bill">
<router class="org.bungeni.editor.actions.routers.routerSelectBill"
dialog="billsMain"/>
</action>

You have to refer to the id of the dialog ...

On 12 December 2012 10:18, Samar Ayesh <say...@birzeit.edu> wrote:
> I found only one example for inlineType it's in debaterecord under core
> section but it didn't work ..
>
>
> On Tue, Dec 11, 2012 at 1:40 PM, Ashok Hariharan <as...@parliaments.info>
> wrote:
>>
>> Sure let me check and get back to you ... perhaps its broken ...
>>
>>
>> On 11 December 2012 14:31, Samar Ayesh <smr....@gmail.com> wrote:
>>>
>>> Ok, I'll see ..
>>> I'm asking about inline types .. like ref .. is there any implemented
>>> example?
>>>
>>>
>>> On Tue, Dec 11, 2012 at 1:21 PM, Ashok Hariharan <as...@parliaments.info>
>>> wrote:
>>>>
>>>> Sure .. proprietary was implemented last week :
>>>>
>>>>
>>>> https://groups.google.com/group/bungeni-editor/browse_thread/thread/1da6487200d203cb
>>>>
>>>> What issue were you having with inline types ?
>>>>
>>>> I am getting around to implementing an exampel for the TLC Organization
>>>> you had asked about ..
>>>>
>>>> Also see my note on this email :
>>>> https://groups.google.com/group/bungeni-editor/browse_thread/thread/10ed7aeff470780d
>>>>
>>>>
>>>>
>>>>
>>>> On 11 December 2012 13:36, Samar Ayesh <smr....@gmail.com> wrote:
>>>>>
>>>>> Hello Ashoke,
>>>>> is there a ready updates for proprietary metadata, any documentations?
>>>>> and what about inline section types?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Dec 5, 2012 at 10:21 AM, Samar Ayesh <smr....@gmail.com>
>>>>> wrote:
>>>>>>
>>>>>> OK :)
>>>>>>
>>>>>>
>>>>>> On Wed, Dec 5, 2012 at 9:27 AM, <as...@parliaments.info> wrote:
>>>>>>>
>>>>>>> Hang on .. I am going to commit it today ... the documentation is
>>>>>>> still not complete !
>>>>>>>
>>>>>>> Ashok
>>>>>>>
>>>>>>>
>>>>>>> On 5 December 2012 10:15, Samar Ayesh <say...@birzeit.edu> wrote:
>>>>>>>>
>>>>>>>> Hello Ashok,
>>>>>>>>
>>>>>>>> I just read the documentation about new namespaces (i.e:Proprietary)
>>>>>>>> http://code.google.com/p/bungeni-editor/source/detail?r=2785
>>>>>>>>
>>>>>>>> every thing there is clear..
>>>>>>>> but Is there any documentation explaining how can I deal with
>>>>>>>> section-types folder?? so that I can add "Proprietary" as a metadata,
>>>>>>>> or for this case we have to edit on system folder ??
>>>>>>>>
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Dec 4, 2012 at 12:53 PM, <as...@parliaments.info> wrote:
>>>>>>>>>
>>>>>>>>> Hi Samar --
>>>>>>>>>
>>>>>>>>> I am testing it at the moment ... I hope to commit it today and
>>>>>>>>> update the documentation (this is for proprietary metadata support )
>>>>>>>>>
>>>>>>>>> Ashok
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 4 December 2012 13:07, Samar Ayesh <say...@birzeit.edu> wrote:
>>>>>>>>>>
>>>>>>>>>> Hello Ashok ,
>>>>>>>>>> Sorry for bothering you ... but is there any updates for the new
>>>>>>>>>> configuration?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>>>>> The information contained in this communication is intended solely
>>>>>>>>>> for the use of the individual or entity to whom it is addressed and others
>>>>>>>>>> authorized to receive it. It may contain confidential or legally privileged
>>>>>>>>>> information. If you are not the intended recipient you are hereby notified
>>>>>>>>>> that any disclosure, copying, distribution or taking any action in reliance
>>>>>>>>>> on the contents of this information is strictly prohibited and may be
>>>>>>>>>> unlawful. If you have received this communication in error, please notify us
>>>>>>>>>> immediately by responding to this email and then delete it from your system.
>>>>>>>>>> The University is neither liable for the proper and complete transmission of
>>>>>>>>>> the information contained in this communication nor for any delay in its
>>>>>>>>>> receipt.
>>>>>>>>>>
>>>>>>>>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>>> The information contained in this communication is intended solely
>>>>>>>> for the use of the individual or entity to whom it is addressed and others
>>>>>>>> authorized to receive it. It may contain confidential or legally privileged
>>>>>>>> information. If you are not the intended recipient you are hereby notified
>>>>>>>> that any disclosure, copying, distribution or taking any action in reliance
>>>>>>>> on the contents of this information is strictly prohibited and may be
>>>>>>>> unlawful. If you have received this communication in error, please notify us
>>>>>>>> immediately by responding to this email and then delete it from your system.
>>>>>>>> The University is neither liable for the proper and complete transmission of
>>>>>>>> the information contained in this communication nor for any delay in its
>>>>>>>> receipt.
>>>>>>>>
>>>>>>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> ___________________________
>>>>>> Samar Ayesh
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> ___________________________
>>>>> Samar Ayesh
>>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> ___________________________
>>> Samar Ayesh
>>>
>>
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> The information contained in this communication is intended solely for the
> use of the individual or entity to whom it is addressed and others
> authorized to receive it. It may contain confidential or legally privileged
> information. If you are not the intended recipient you are hereby notified
> that any disclosure, copying, distribution or taking any action in reliance
> on the contents of this information is strictly prohibited and may be
> unlawful. If you have received this communication in error, please notify us
> immediately by responding to this email and then delete it from your system.
> The University is neither liable for the proper and complete transmission of
> the information contained in this communication nor for any delay in its
> receipt.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Samar Ayesh

unread,
Dec 13, 2012, 5:39:50 AM12/13/12
to bungeni...@googlegroups.com
So it will be working fine after fixing middleware, right ?

--
You received this message because you are subscribed to the Google Groups "bungeni-editor" group.
To post to this group, send email to bungeni...@googlegroups.com.
To unsubscribe from this group, send email to bungeni-edito...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bungeni-editor?hl=en.




--
 ___________________________
 Samar Ayesh

Ashok Hariharan

unread,
Dec 13, 2012, 7:56:07 AM12/13/12
to bungeni...@googlegroups.com
Ok - i updated the middleware in r2813 ... but the following three updates fixed inline types :

http://code.google.com/p/bungeni-editor/source/detail?r=2813
http://code.google.com/p/bungeni-editor/source/detail?r=2812
http://code.google.com/p/bungeni-editor/source/detail?r=2811

So if you look at :
http://bungeni-editor.googlecode.com/svn/BungeniEditor_configs/development_configs/inline_types/debaterecord.xml -- there is an example "ref" inline implementation there :

<?xml version="1.0" encoding="UTF-8"?>
<inlineTypes for="debaterecord" xmlns:an="#an">
    <inlineType name="from">
             <output>
         <content>
             <an:from />
         </content>
     </output>

    </inlineType>
   
    <inlineType name="ref">
       <output>
          <metadatas>
             <metadata name="BungeniRefURI" />
          </metadatas>
          <content>
            <an:ref href="$BungeniRefURI" />
          </content>
       </output>
    </inlineType>

</inlineTypes>

The correspnding action configuration :

http://bungeni-editor.googlecode.com/svn/BungeniEditor_configs/development_configs/actions/doc_actions/debaterecord.xml

    <action name="mark_reference" source="inlineType" metadata="ref">
        <router class="org.bungeni.editor.actions.routers.routerInputReference" 
                dialog="refinline"
            />
    </action>

Which refers to a configured dialog set :
http://bungeni-editor.googlecode.com/svn/BungeniEditor_configs/development_configs/actions/selector_dialogs.xml

  <dialog id="refinline" class="org.bungeni.editor.selectors.general.Main" >
        <dialog
            class="org.bungeni.editor.selectors.general.ref.RefURI"
             />
    </dialog>



The dialog for the "ref" markup provides a text field where you can input a URI / URL and thats implemented here :

org.bungeni.editor.selectors.general.ref.RefURI

The entry point for the action is in toolbar_actions/debaterecord.xml :

<action name="ref.general" mode="TEXT_SELECTED_INSERT" target="mark_reference" visible="true" condition="textSelected:true" title="REF_INLINE" tooltip="MARK_SELECTION_AS_INLINE_REF"> </action>

The output for the markup looks like this :

<speech bodf:sourceId="speech1" as="#MemberOfParliament" asText="MemberOfParliament" by="#JamesMuendo">
<from bodf:sourceId="id687910772">Mr. James</from>
<p>
<ref bodf:sourceId="id1847723105" href="http://www.google.com">This</ref>is the speech</p>
</speech>








 




Ashok Hariharan

unread,
Dec 18, 2012, 7:45:54 AM12/18/12
to say...@birzeit.edu, bungeni...@googlegroups.com


On 18 December 2012 15:35, <say...@birzeit.edu> wrote:


---------- Forwarded message ----------
From: Samar Ayesh <say...@birzeit.edu>
Date: Mon, Dec 17, 2012 at 10:59 AM
Subject: Re: new configuration
To: bungeni...@googlegroups.com
Cc: Ahmad Hammo <hah...@birzeit.edu>


Thanks Ashok for this explaining .. it worked fine with me ...

but when the case is like that:
I have an inlineType and it doesn't have a dialog ..
"like longTitle in preface"
I think toolbarAction function is not implemented for this case
 if (actionSourceValue.length() > 0 ) {
                    if (this.actionSource.equals(actionSourceOrigin.sectionType)) {
                        this.setupSectionType(this.actionSourceValue);
                    } else if (this.actionSource.equals(actionSourceOrigin.inlineType)) {
                        log.debug("This is an inline type - no special setup for now");
                    } else if (this.actionSource.equals(actionSourceOrigin.annotationType)) {
                        log.debug("This is an annotation type - no special setup for now");
                    }

I debugged through this code, and found that !!



Thats correct - there is no special setup for inline Types ... for Section Types we instantiate a DocumentSection object with the properites of an OpenOffice section ... so thats what the setupSectionType() is about. 

Ashok

Ashok Hariharan

unread,
Dec 18, 2012, 7:48:51 AM12/18/12
to say...@birzeit.edu, bungeni...@googlegroups.com
Can you show me your inline types config for <ref> e.g. :

    <inlineType name="ref">
       <output>
          <metadatas>
             <metadata name="BungeniRefURI" />
          </metadatas>
          <content>
            <an:ref href="$BungeniRefURI" />
          </content>
       </output>
    </inlineType>

On 18 December 2012 15:36, <say...@birzeit.edu> wrote:
---------- Forwarded message ----------
From: Samar Ayesh <say...@birzeit.edu>
Date: Mon, Dec 17, 2012 at 2:02 PM
Subject: Re: new configuration
To: bungeni...@googlegroups.com


Also my output for ref is like this:

 <preamble bodf:sourceId="preamble">
         <p>4<ref href="">4444</ref>44444444</p>
      </preamble>


id attribute not shown !
href value is missing!
BungeniRefURI is used in RefURI.java ..but it's value is null when generating xml file??

also
<output>
          <metadatas>
          <metadata name="BungeniWorkAuthor" />
        </metadatas>
            <meta>
                 <references>
                    <TLCOrganization id="$BungeniWorkAuthor" />
                 </references>
           </meta>
           ....

didn't work !!




On Mon, Dec 17, 2012 at 10:59 AM, Samar Ayesh <say...@birzeit.edu> wrote:
Thanks Ashok for this explaining .. it worked fine with me ...

but when the case is like that:
I have an inlineType and it doesn't have a dialog ..
"like longTitle in preface"
I think toolbarAction function is not implemented for this case
 if (actionSourceValue.length() > 0 ) {
                    if (this.actionSource.equals(actionSourceOrigin.sectionType)) {
                        this.setupSectionType(this.actionSourceValue);
                    } else if (this.actionSource.equals(actionSourceOrigin.inlineType)) {
                        log.debug("This is an inline type - no special setup for now");
                    } else if (this.actionSource.equals(actionSourceOrigin.annotationType)) {
                        log.debug("This is an annotation type - no special setup for now");
                    }

I debugged through this code, and found that !!

Ashok Hariharan

unread,
Dec 18, 2012, 8:25:12 AM12/18/12
to bungeni...@googlegroups.com
Your middleware is actually out of date :

See the attached image .. the left hand side is your system folder in birzeit_configs on the right hand side is my system folder ... all the files are out of date . 

I would suggest you dont edit files directly since they are used by the system (except perhaps config_tmpl.xml) ... you risk being out of date. You should use xslt override mechanisms .. for example if you dont like the default template matcher for frbrthis type_static_templates.xsl : 

    <xsl:template match="*[@name='frbrthis']">
        <FRBRthis>
            <xsl:if test="@value">
                <xsl:attribute name="value"><xsl:value-of select="@value"/></xsl:attribute>
            </xsl:if>
            
            <xsl:apply-templates/>
        </FRBRthis>
    </xsl:template>

You should not edit type_static_templates.xsl .. instead create a new  empty xslt 2.0 stylesheet  and give it a different name : birzeit_type_static_templates.xsl 

Within that do an xsl:import of type_static_templates.xsl and in this new file override the frbrthis template : 

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    exclude-result-prefixes="xs"
    version="2.0">
    
    <xsl:import href="type_static_templates.xsl"/>
    
    <!-- birzeit custom frbrthis template -->
    <xsl:template match="*[@name='frbrthis']">
        <FRBRthis>
            <!-- custom processing -->
            <xsl:apply-templates/>
        </FRBRthis>
    </xsl:template>
    
</xsl:stylesheet>

The way xslt works it will ignore the original frbrthis template in the main file and use your custom one (remember to change the config_tmpl.xml to use your new birzeit_type_static_templates.xsl ... 

Is that clearer ? 

Ashok


On 18 December 2012 16:06, Samar Ayesh <smr....@gmail.com> wrote:
I have just committed birzeit_configs folder .. you can find ref under act >> preamble
--
 ___________________________
 Samar Ayesh


diff.png

Ashok Hariharan

unread,
Dec 18, 2012, 9:19:05 AM12/18/12
to bungeni...@googlegroups.com
If you notice in the diff screen system/generator and system/transform/xsl pull in the templates from externals ... and that is how it should be .. all your customizations should be in a separate xslt as described below which imports the XSL provided by externals 

Samar Ayesh

unread,
Dec 19, 2012, 3:10:15 AM12/19/12
to Ashok Hariharan, bungeni...@googlegroups.com
I attache two screen shots .. first one is my system folder .. as I updated it according to yours ..
second one is my xml generated !! why it looks like that? and sectionTypes are not shown !!

On Wed, Dec 19, 2012 at 9:36 AM, Samar Ayesh <say...@birzeit.edu> wrote:
aha , it's clear now .. I think I don't have to create separate xslt currently
I will update birzeit_configs/system folder according to your system folder
then I will try reference inlineType ..

but what about inlineTypes with no dialog .. how can implement it?


On Wed, Dec 19, 2012 at 8:50 AM, Ashok Hariharan <as...@parliaments.info> wrote:
Hi Samar --

Let me know if you got the problem .. if you need help let me know,




--
 ___________________________
 Samar Ayesh

birzeit_configs__system.jpg
actOutput.jpg

Ashok Hariharan

unread,
Dec 19, 2012, 4:06:25 AM12/19/12
to Samar Ayesh, bungeni...@googlegroups.com
Your system/transformer/xsl folder was empty -- the svn:externals property had not been set on the folder .
Also the system/generators folder had local copy of xslt files - i have made it pull them from externals and put your changed xslt in old . I would suggest you had an override xslt and put just your customization in there as mentioned yesterday via xsl:imports .

If you svn up in birzeit_configs you shuold see the changes ...

Ashok Hariharan

unread,
Dec 19, 2012, 4:08:22 AM12/19/12
to Samar Ayesh, bungeni...@googlegroups.com
Actually everytime you start up the system - check your config/system/errors folder ... such things get flagged there as errors .. you should have no errors there.

Ashok

Samar Ayesh

unread,
Dec 19, 2012, 6:43:24 AM12/19/12
to bungeni...@googlegroups.com
---------- Forwarded message ----------
From: Samar Ayesh <say...@birzeit.edu>
Date: Wed, Dec 19, 2012 at 12:40 PM
Subject: Re: new configuration
Oh , Thanks ...
I didn't know those steps before I just did copy and paste from system-configs ...
I missed doing update ..

ref is working correctly now :)

what about inlineTypes with no dialogs ? like longTitle in preface .. how can I implement it ?

in doc_actions
 <action name="make_preface_longTitle" source="inlineType" metadata="LongTitle" >
        <router class="[ ... ]" dialog="" />
    </action>
I think we would have a new generated router class for this case and dialog ="" ??




On Wed, Dec 19, 2012 at 12:12 PM, Ashok Hariharan <as...@parliaments.info> wrote:
Did you set the svn:externals property on the folder ?

http://justinram.wordpress.com/2009/06/04/howto-add-svnexternals-in-windows-using-tortoisesvn/




On 19 December 2012 13:00, Samar Ayesh <smr....@gmail.com> wrote:

Actually i deleted local copies and added externals in xsl.. So as to have same version as yours and checked out system-configs again
But i don't know why my folder is still not updated on svn after i committed it !!






--
 ___________________________
 Samar Ayesh

Reply all
Reply to author
Forward
0 new messages