5 Replies Latest reply on Aug 30, 2012 2:51 PM by drwho

    How to add new properties to add new site ui in GateIn

    drwho Newbie

      All,

      I want to add several customized properties for my company in the UIPortalForm for site creation and have them persisted in the jcr.

      See attached screen capture..

       

      I noticed in the code I have modify PortalDataMapper,PortalConfig  and binding.xml in the follwoing project in order to make that happen:

       

      <modelVersion>4.0.0</modelVersion>

        <artifactId>exo.portal.component.portal</artifactId>

        <packaging>jar</packaging>

        <name>GateIn Portal Component Portal Data</name>

       

      In the binding.xml:

      <mapping name="portal-config" class="org.exoplatform.portal.config.model.PortalConfig" ordered="false">
          <value name="portal-name" field="name"/>
          <value name="label" field="label" default="" />
          <value name="description" field="description" default="" />
          <value name="locale" field="locale" />
          <value name="access-permissions" field="accessPermissions" usage="optional"/>
          <value name="edit-permission" field="editPermission" usage="optional"/>
          <value name="skin" field="skin" usage="optional"/>
          <structure field="properties" usage="optional"/>
          <structure name="portal-layout" using="container" field="portalLayout" usage="optional"/>
        </mapping>


      So essential I want to add something like

      <value name="myfiled" field="myfield" default="" />

      I am unsure this is a good apprach but I do not see how I can use the extension mechanism to make this happen

      Any thoughts?

      Gordon

        • 1. Re: How to add new properties to add new site ui in GateIn
          Minh Hoang TO Novice

          Such mapping does not work if PortalConfig class does not declare 'myfield' field. By the way, you could define addtional property to PortalConfig object via 'properties' field

           

            <properties>

              <entry key="myfield">myvalue</entry>

            </properties>

          1 of 1 people found this helpful
          • 2. Re: How to add new properties to add new site ui in GateIn
            drwho Newbie

            Ming Hoang,

            I added the field in PortalConfig to match the new property in biding.xml. In addition, I had to modify PortalData, MappedAttribute, Mapper, Element classes just to add additional properties for the site model which I think is excessive and not very programmer friendly. Has this been the experience with you as well?

            Getting back to my original assumption, is this the only way we can add additional properties in the Add New Site UI? I have been combing thru the documentation to understand the extension mechanism as this approach required me to modify the exoplatfrom source directly and is not really the approach that I like. Any thoughts?

            • 3. Re: How to add new properties to add new site ui in GateIn
              drwho Newbie

              Another thought...

              Since we want to customize the Add New Site UI maybe we can extend the UI Portal and UI Portal form to add a new tab or navigation to have our company specific configurations.

              And instead of saving the properties to a portal under portal-system workspace we can save the configurations as properties in Users workspace. What do you think? Is this a good design. I am interested in hearing from all of you on this.

              Thanks,   Gordon

              • 4. Re: How to add new properties to add new site ui in GateIn
                Julien Viet Apprentice

                The most appropriate way would be to add a JCR mixin on mop:site nodes.

                 

                Such mixin would define the type you want to "attach" to a site node and contains the properties you want to describe.

                 

                Such mixins can be added and removed using the programmatic DataStorage interface but cannot be declared and I think it's not very friendly to use at the moment.

                1 of 1 people found this helpful
                • 5. Re: How to add new properties to add new site ui in GateIn
                  drwho Newbie

                  How about extending the UIPortal and UIPortalForm and add a tab to include my company's configurations? In the save action just save all properties under a top node that has the site name/identifier like

                  Site1

                         --->CompanyID

                         --->BusinessID

                  etc.? What do you think?

                  Gordon